In the field of software engineering, code clone detection methods based on semantic similarity can reduce the cost of software maintenance and prevent system vulnerabilities. As a typical form of code abstract representation, Abstract Syntax Tree (AST) has achieved success in code clone detection tasks of many program languages. However, the existing work mainly uses the original AST to extract code semantics, and does not dig deep semantic and structural information in AST. To solve the above problem, a code clone detection method based on Dependency Enhanced Hierarchical Abstract Syntax Tree (DEHAST) was proposed. Firstly, the AST was layered and divided into different semantic levels. Secondly, corresponding dependency enhancement edges were added to different levels of AST to construct DEHAST, thus a simple AST was transformed into a heterogeneous graph with richer program semantics. Finally, a Graph Matching Network (GMN) model was used to detect the similarity of heterogeneous graphs to achieve code clone detection. Experimental results on two datasets BigCloneBench and Google Code Jam show that DEHAST is able to detect 100% of Type-1 and Type-2 code clones, 99% of Type-3 code clones, and 97% of Type-4 code clones; compared with the tree based method ASTNN (AST-based Neural Network), the F1 values all increase by 4 percentage points. Therefore, DEHAST can effectively perform code semantic clone detection.
Aiming at the hidden danger of fire caused by electric bicycles and gas tanks taken into elevators, an improved attention mechanism was proposed to detect dangerous goods in elevator scene, and a method based on the mechanism was proposed. With YOLOX-s as the baseline model, firstly, a depthwise separable convolution was introduced in the enhanced feature extraction network to replace the standard convolution, which improved the reasoning speed of the model. Secondly, an Efficient Convolutional Block Attention Module (ECBAM) based on mixed-domain was proposed and embedded into the backbone feature extraction network. In the channel attention part of ECBAM, two fully connected layers were replaced by a one-dimensional convolution, which not only reduced the complexity of Convolutional Block Attention Module (CBAM) but also improved the detection precision. Finally, a multi-frame collaboration algorithm was proposed to reduce the false alarms of dangerous goods’ intrusion into the elevator by combining the dangerous goods detection results of multiple images. Experimental results show that compared with YOLOX-s, the improved model can increase the mean Average Precision (mAP) by 1.05 percentage points, reduce the floating point computational cost by 34.1% and reduce the model size by 42.8%. The improved model reduces false alarms in practical applications and meets the precision and speed requirements of dangerous goods detection in elevator scene.
To address the problems of Web crawler code failure and high manual maintenance cost caused by webpage source code changes led by frequent webpage redesigns, especially changes in element structures or attribute identifiers of target entities such as article dates, main body of text or source organizations, a self-adaptive Web crawler code generation method based on webpage source code structure comprehension was proposed. Firstly, the corresponding Web crawler code was extracted by analyzing the change patterns of webpage structural characteristics. Secondly, the changes in the webpage source code and code were represented by the Encoder-Decoder model. By fusing the semantic features of the webpage source code structure, the features of webpage source code changes and the features of webpage code changes, an adaptive code generation model was obtained. Finally, the perception, generation and activation mechanisms of the adaptive system were improved to form a Web crawler system with adaptive processing capability. Compared with TF-IDF+Seq2Seq and TriDNR+Seq2Seq models, the proposed adaptive code generation model was experimentally verified to show the superiority in the representation of webpage source code changes and the effectiveness of code generation with a final accuracy of 78.5%. With the proposed method, the Web crawler code operation problems caused by the webpage source code changes could be solved, and a new idea for the adaptive processing capability of Web resource acquisition — Web crawler technique was provided.
The algorithm platform, as the implementation way of automatic machine learning, has attracted the wide attention in recent years. However, the business processes of these platforms need to be built manually, and these platforms are faced with inflexible model calling and the incapability of customized automatic algorithm construction for specific business requirements. To address these problems, an algorithm path self-assembling model for business requirements was proposed. Firstly, the sequence features and structural features of code were modeled simultaneously based on Graph Convolutional Network (GCN) and word2vec representation. Secondly, functions in the algorithm set were further discovered through a clustering model, and the obtained function subsets were used for the preparation of the path discovery of algorithm components between subsets. Finally, based on the relationship discovery model and ranking model trained with prior knowledge, the self-assembled paths of candidate code components were mined, thus realizing the algorithm code self-assembling. Using the proposed evaluation indicators for comparison and analysis, the best result of the proposed algorithm path self-assembling model is 0.8, while that of the baseline model Okapi BM25+word2vec is 0.21. To a certain extent, the proposed model solves the problem of missing code structure and semantic information in traditional code representation methods and lays the foundation for the research of refinement of algorithm process self-assembling and automatic construction of algorithm pipelines.
To solve the problem of stockout, increasing inventory level and the fluctuation of order quantity caused by stochastic disturbance, an optimization model of inventory system under stochastic disturbance based on Active Disturbance Rejection Control (ADRC) was proposed. Firstly, according to the operational management logic behind the purchase-sale-storage product and information flows, the transfer function of the inventory system was obtained and transformed to a second-order state space standard form by the Laplace transform. Secondly, an optimization model of inventory system under stochastic disturbance based on ADRC including the tracking differentiator, the extended state observer and the nonlinear state error feedback control law was designed to control and compensate the adverse effects on the inventory system caused by stochastic disturbance under the premise of ensuing system stability. Finally, simulations were carried out by using data collected from the industry to verify the effectiveness of the optimization model on optimization of the inventory system under stochastic disturbance. Simulation results show that compared to the inventory feedback control model without ADRC, the optimization model of inventory system under stochastic disturbance based on ADRC has the residual inventory reduced by 40%, the average order quantity reduced by 47.4%, the order fluctuation decreased by 39.3%, and the stockout of enterprise inventory system caused by stochastic disturbance greatly improved. It can be seen that the optimization model of inventory system under stochastic disturbance based on ADRC can guide enterprises to make a reasonable ordering decision, decrease the inventory level, improve the stability of inventory system dynamically, and provide the scientific theoretical reference and countermeasures for the actual operations of enterprises.
Since the traditional wavelet threshold functions have some drawbacks such as the non-continuity on the points of threshold, and large deviation of estimated wavelet coefficient, distortion and Gibbs phenomenon occur after denoising. To overcome these drawbacks, an improved threshold function was proposed. Compared with the hard, soft threshold functions and the existing improved threshold function, the proposed function not only is easy to be calculated, but also has the superior mathematical characteristics.To verify its advantages, a series of simulation experiments were performed, the Peak Signal-to-Noise Ratio (PSNR) and Mean Squared Error (MSE) values were compared with other different denoising methods.The experimental results indicate that it is better than above mentioned denoising methods in both the visual effects and the performance of PSNR and MSE.