File processing method, device, computer-readable storage medium, and electronic device
By clustering the structural characteristics of the code file and generating the running rule set in an intelligent recommendation system, the problem of low efficiency in manual selection of running rule sets in the existing technology is solved, and efficient and automated code file processing is achieved.
Patent Information
- Application Number
- CN202111509593.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2041-12-10
AI Technical Summary
In the prior art, the audit of code files relies on manual selection of running rulesets, which are inefficient and costly.
By clustering the structural feature sets of code files, different running rule sets are generated, and an intelligent recommendation system is used to generate matching running rule sets based on multi-dimensional composite features.
There is no need to manually select the running rule set, saving labor costs, improving code file processing efficiency, and improving automation and standardization, reducing manual errors.
Smart Images

Figure CN114185787B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file processing method, a file processing device, a computer-readable storage medium, and an electronic device. Background Art
[0002] The probability of running errors in code files is usually relatively high, so code files need to be audited to avoid running errors to a certain extent. At present, the audit method for code files is manual audit, which specifically includes: manually selecting a suitable set of running rules to perform certain pre-control on static code detection and manually auditing the running results. This method has the problem of low efficiency.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The purpose of the present application is to provide a file processing method, a file processing device, a computer-readable storage medium and an electronic device, which can cluster multiple code files based on a set of structural features, and generate different operation rule sets for different file groups obtained by clustering, without manually selecting the operation rule set applicable to each code file, which can save labor costs and improve the processing efficiency of code files.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0006] According to one aspect of the present application, a file processing method is provided, the file processing method comprising:
[0007] When a code package to be processed is detected, each code file is clustered according to the structural feature set of each code file in the code package to obtain multiple file groups; wherein the code files within the multiple file groups correspond to the same structural feature set, and the code files between the multiple file groups correspond to different structural feature sets;
[0008] Extracting multi-dimensional composite features corresponding to each of the multiple file groups;
[0009] The multi-dimensional composite features corresponding to each file group are respectively input into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the operation rule set of the corresponding file group according to the corresponding multi-dimensional composite features.
[0010] In an exemplary embodiment of the present application, after the multi-dimensional composite features corresponding to each file group are respectively input into the intelligent recommendation system corresponding to each file group, the method further includes:
[0011] Run the corresponding file group based on the running rule set of each file group to obtain the running result of each file group;
[0012] Output the running results of each file group.
[0013] In an exemplary embodiment of the present application, the corresponding file group is run based on the running rule set of each file group to obtain the running result of each file group, including:
[0014] Output the operation rule set for each file group;
[0015] When a confirmation operation for the operation rule set of each file group is detected, the corresponding file group is run based on the operation rule set of each file group to obtain the operation result of each file group.
[0016] In an exemplary embodiment of the present application, after outputting the running results of each file group, the method further includes:
[0017] Get audit information about the operation results of each file group;
[0018] Extract the audit features of the audit information corresponding to each file group;
[0019] The audit features and multi-dimensional composite features corresponding to each file group are integrated within the group to obtain the integrated features corresponding to each file group;
[0020] Based on the fusion features corresponding to each file group, the system parameters of the intelligent recommendation system corresponding to each file group are adjusted respectively.
[0021] In an exemplary embodiment of the present application, system parameters of the intelligent recommendation system corresponding to each file group are adjusted based on the fusion features corresponding to each file group, including:
[0022] Based on the fusion features corresponding to each file group, the system parameter fitness value of the intelligent recommendation system corresponding to each file group is determined respectively;
[0023] According to the fitness values of the system parameters of each intelligent recommendation system, the system parameters of each intelligent recommendation system are adaptively iterated and updated for a preset number of times to obtain the target system parameters corresponding to each intelligent recommendation system;
[0024] The target system parameters corresponding to each intelligent recommendation system are applied to the corresponding intelligent recommendation system.
[0025] In an exemplary embodiment of the present application, the target system parameters corresponding to each intelligent recommendation system are applied to the corresponding intelligent recommendation system, including:
[0026] Initialize the target system parameters corresponding to each intelligent recommendation system through adaptive mutation parameters, and obtain the reference system parameters corresponding to each intelligent recommendation system;
[0027] Calculate the reference fitness values of the reference system parameters corresponding to each intelligent recommendation system;
[0028] According to each reference fitness value, the corresponding reference system parameters are adaptively iterated and updated for a preset number of times to obtain specific system parameters corresponding to each intelligent recommendation system;
[0029] The specific system parameters corresponding to each intelligent recommendation system are applied to the corresponding intelligent recommendation system.
[0030] In an exemplary embodiment of the present application, the set of structural features of each code file includes at least one of a language type, a syntax tree, a control flow, and program dependency information.
[0031] In an exemplary embodiment of the present application, the multi-dimensional composite features corresponding to each file group include at least a code feature and a rule feature, and extracting the multi-dimensional composite features corresponding to each file group in the multiple file groups includes:
[0032] Extract multiple first-class features corresponding to each file group according to the code information corresponding to each file group, and fuse the multiple first-class features corresponding to each file group within the group to obtain the code features corresponding to each file group; wherein the multiple first-class features are used to represent the same file group through different dimensions;
[0033] According to the rule information corresponding to each file group, multiple second-category features corresponding to each file group are extracted, and the multiple second-category features corresponding to each file group are fused within the group to obtain the rule features corresponding to each file group; wherein the multiple second-category features are used to represent the same file group through different dimensions.
[0034] In an exemplary embodiment of the present application, extracting the audit features of the audit information corresponding to each file group includes:
[0035] According to the audit information corresponding to each file group, multiple three-category features corresponding to each file group are extracted, and the multiple three-category features corresponding to each file group are fused within the group to obtain the audit features corresponding to each file group; wherein the multiple three-category features are used to represent the same file group through different dimensions.
[0036] According to one aspect of the present application, a file processing device is provided, which includes: a file group clustering unit, a feature extraction unit, and a rule set determination unit.
[0037] A file group clustering unit is used for clustering each code file according to the structural feature set of each code file in the code package when a code package to be processed is detected, so as to obtain multiple file groups; wherein the code files within the multiple file groups correspond to the same structural feature set, and the code files between the multiple file groups correspond to different structural feature sets;
[0038] A feature extraction unit, used to extract multi-dimensional composite features corresponding to each of the multiple file groups;
[0039] The rule set determination unit is used to input the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the corresponding operation rule set of the file group according to the corresponding multi-dimensional composite features.
[0040] In an exemplary embodiment of the present application, the above-mentioned device further includes:
[0041] A file running unit, for running the corresponding file group based on the running rule set of each file group to obtain the running result of each file group after the rule set determination unit inputs the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group;
[0042] The operation result output unit is used to output the operation results of each file group.
[0043] In an exemplary embodiment of the present application, the file running unit runs the corresponding file group based on the running rule set of each file group to obtain the running result of each file group, including:
[0044] The file operation unit outputs the operation rule set of each file group;
[0045] When the file running unit detects the confirmation operation for the running rule set of each file group, it runs the corresponding file group based on the running rule set of each file group to obtain the running result of each file group.
[0046] In an exemplary embodiment of the present application, the above-mentioned device further includes:
[0047] An audit information acquisition unit, used to acquire audit information on the operation results of each file group after the operation result output unit outputs the operation results of each file group;
[0048] An audit feature extraction unit, used to extract audit features of audit information corresponding to each file group;
[0049] A feature fusion unit is used to fuse the audit features and multi-dimensional composite features corresponding to each file group within the group to obtain the fusion features corresponding to each file group;
[0050] The system parameter adjustment unit is used to adjust the system parameters of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group.
[0051] In an exemplary embodiment of the present application, the system parameter adjustment unit adjusts the system parameters of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group, including:
[0052] The system parameter adjustment unit determines the system parameter fitness value of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group;
[0053] The system parameter adjustment unit adaptively iterates and updates the system parameters of each intelligent recommendation system for a preset number of times according to the system parameter fitness values of each intelligent recommendation system, and obtains the target system parameters corresponding to each intelligent recommendation system;
[0054] The system parameter adjustment unit applies the target system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0055] In an exemplary embodiment of the present application, the system parameter adjustment unit applies the target system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system, including:
[0056] The system parameter adjustment unit initializes the target system parameters corresponding to each intelligent recommendation system through adaptive variation parameters, and obtains the reference system parameters corresponding to each intelligent recommendation system;
[0057] The system parameter adjustment unit calculates the reference fitness values of the reference system parameters corresponding to each intelligent recommendation system;
[0058] The system parameter adjustment unit adaptively iterates and updates the corresponding reference system parameters for a preset number of times according to each reference fitness value, and obtains specific system parameters corresponding to each intelligent recommendation system;
[0059] The system parameter adjustment unit applies the specific system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0060] In an exemplary embodiment of the present application, the set of structural features of each code file includes at least one of a language type, a syntax tree, a control flow, and program dependency information.
[0061] In an exemplary embodiment of the present application, the multi-dimensional composite features corresponding to each file group include at least a code feature and a rule feature, and the feature extraction unit extracts the multi-dimensional composite features corresponding to each file group in the multiple file groups, including:
[0062] The feature extraction unit extracts a plurality of first-class features corresponding to each file group according to the code information corresponding to each file group, and fuses the plurality of first-class features corresponding to each file group within the group to obtain the code features corresponding to each file group; wherein the plurality of first-class features are used to represent the same file group through different dimensions;
[0063] The feature extraction unit extracts multiple second-category features corresponding to each file group according to the rule information corresponding to each file group, and fuses the multiple second-category features corresponding to each file group within the group to obtain the rule features corresponding to each file group; wherein the multiple second-category features are used to represent the same file group through different dimensions.
[0064] In an exemplary embodiment of the present application, the audit feature extraction unit extracts the audit features of the audit information corresponding to each file group, including:
[0065] The audit feature extraction unit extracts multiple three-category features corresponding to each file group according to the audit information corresponding to each file group, and fuses the multiple three-category features corresponding to each file group within the group to obtain the audit features corresponding to each file group; wherein the multiple three-category features are used to represent the same file group through different dimensions.
[0066] According to one aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0067] According to one aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above methods is implemented.
[0068] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.
[0069] The exemplary embodiments of the present application may have some or all of the following beneficial effects:
[0070] In the file processing method provided in an example embodiment of the present application, when a code package to be processed is detected, each code file can be clustered according to the structural feature set of each code file in the code package to obtain multiple file groups; wherein, the code files within the multiple file groups correspond to the same structural feature set, and the code files between the multiple file groups correspond to different structural feature sets; extract the multi-dimensional composite features corresponding to each file group in the multiple file groups; input the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the corresponding file group operation rule set according to the corresponding multi-dimensional composite features. According to the above scheme description, on the one hand, the present application clusters multiple code files based on the structural feature set, and generates different operation rule sets for different file groups obtained by clustering, without manually selecting the operation rule set applicable to each code file, which can save labor costs and improve the processing efficiency of code files. On the other hand, the present application can also improve the degree of automation and standardization of the code file processing process and reduce manual errors.
[0071] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0073] Figure 1 A schematic diagram showing an exemplary system architecture of a file processing method and a file processing device to which the embodiments of the present application can be applied;
[0074] Figure 2 A schematic diagram showing the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown;
[0075] Figure 3 A flowchart of a file processing method according to an embodiment of the present application is schematically shown;
[0076] Figure 4 The following schematically shows a code feature acquisition process diagram according to an embodiment of the present application;
[0077] Figure 5 A schematic diagram of a rule feature acquisition process according to an embodiment of the present application is shown schematically;
[0078] Figure 6 The structure diagram of the intelligent recommendation system according to one embodiment of the present application is schematically shown;
[0079] Figure 7 A schematic diagram of an audit feature acquisition process according to an embodiment of the present application is shown;
[0080] Figure 8 A schematic diagram of a fusion feature acquisition process according to an embodiment of the present application is shown schematically;
[0081] Fig. 9 A training flow chart of an intelligent recommendation system according to an embodiment of the present application is schematically shown;
[0082] Fig.10 The following is a schematic diagram showing an implementation process of a file processing method according to an embodiment of the present application;
[0083] Fig.11 A schematic diagram schematically shows the structure and application of a file processing method according to an embodiment of the present application;
[0084] Fig.12 A flowchart of a file processing method according to an embodiment of the present application is schematically shown;
[0085] Fig.13 The structural block diagram of a file processing device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0086] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present application will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present application.
[0087] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0088] Figure 1 A schematic diagram of a system architecture of an exemplary application environment in which a file processing method and a file processing device according to an embodiment of the present application can be applied is shown.
[0089] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with display screens, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0090] The file processing method provided in the embodiment of the present application is generally executed by the server 105, and accordingly, the file processing device is generally arranged in the server 105. However, it is easy for a person skilled in the art to understand that the file processing method provided in the embodiment of the present application can also be executed by the terminal device 101, 102 or 103, and accordingly, the file processing device can also be arranged in the terminal device 101, 102 or 103, and this is not particularly limited in the present exemplary embodiment. For example, in an exemplary embodiment, when the server 105 detects a code package to be processed, it clusters each code file according to the set of structural features of each code file in the code package to obtain multiple file groups; extracts the multi-dimensional composite features corresponding to each file group in the multiple file groups; and inputs the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the corresponding set of operating rules for the file group according to the corresponding multi-dimensional composite features.
[0091] Figure 2A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0092] It should be noted that Figure 2 The computer system 200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0093] like Figure 2 As shown, the computer system 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 202 or a program loaded from a storage part 208 into a random access memory (RAM) 203. Various programs and data required for system operation are also stored in the RAM 203. The CPU 201, the ROM 202, and the RAM 203 are connected to each other via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0094] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.
[0095] In particular, according to an embodiment of the present application, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 209, and / or installed from a removable medium 211. When the computer program is executed by the central processing unit (CPU) 201, various functions defined in the method and apparatus of the present application are executed.
[0096] This exemplary embodiment provides a file processing method. The file processing method can be applied to the server 105, or to one or more of the terminal devices 101, 102, 103, which is not particularly limited in this exemplary embodiment. Figure 3As shown, the file processing method may include the following steps S310 to S330.
[0097] Step S310: When a code package to be processed is detected, each code file is clustered according to the structural feature set of each code file in the code package to obtain multiple file groups; wherein the code files within the multiple file groups correspond to the same structural feature set, and the code files between the multiple file groups correspond to different structural feature sets.
[0098] Step S320: extracting multi-dimensional composite features corresponding to each of the multiple file groups.
[0099] Step S330: input the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate an operation rule set for the corresponding file group according to the corresponding multi-dimensional composite features.
[0100] It can be seen that the implementation Figure 3 The method shown can cluster multiple code files based on a set of structural features, and generate different sets of operating rules for different file groups obtained by clustering, without the need to manually select the set of operating rules applicable to each code file, which can save labor costs and improve the processing efficiency of code files. In addition, the automation and standardization of the code file processing process can be improved, reducing manual errors.
[0101] Next, the above steps of this exemplary embodiment are described in more detail.
[0102] In step S310, when a code package to be processed is detected, each code file in the code package is clustered according to the structural feature set of each code file to obtain multiple file groups; wherein the code files within the multiple file groups correspond to the same structural feature set, and the code files between the multiple file groups correspond to different structural feature sets.
[0103] Specifically, the structural feature set of each code file may include at least one of a language type, a syntax tree, a control flow, and program dependency information; wherein the language type is used to characterize the language used by the code file, such as programming languages such as C / C++, Java, Perl, xml, html, xhtml, and other markup languages such as php, js, asp, Python, ruby, and other scripting languages such as; the syntax tree (AST) is used to characterize the code file through a tree structure, and the control flow is used to characterize the relationship between codes; program dependency information is used to characterize the method reference relationship in the code file.
[0104] In step S320, multi-dimensional composite features corresponding to each of the plurality of file groups are extracted.
[0105] Specifically, the multi-dimensional composite feature may include a composite of features in at least two dimensions, and different file groups correspond to different multi-dimensional composite features.
[0106] In an exemplary embodiment of the present application, the multi-dimensional composite features corresponding to each file group include at least a code feature and a rule feature, and extracting the multi-dimensional composite features corresponding to each file group in the multiple file groups includes:
[0107] Extract multiple first-class features corresponding to each file group according to the code information corresponding to each file group, and fuse the multiple first-class features corresponding to each file group within the group to obtain the code features corresponding to each file group; wherein the multiple first-class features are used to represent the same file group through different dimensions;
[0108] According to the rule information corresponding to each file group, multiple second-category features corresponding to each file group are extracted, and the multiple second-category features corresponding to each file group are fused within the group to obtain the rule features corresponding to each file group; wherein the multiple second-category features are used to represent the same file group through different dimensions.
[0109] Specifically, the code information may include at least one of the data such as code false positive data and code basic data, different file groups correspond to different code information, and the code basic data may include at least one of the language type, syntax tree, control flow and program dependency information. The rule information may include at least one of the data such as rule false positive data and rule basic data, and different file groups correspond to different rule information; wherein the rule basic data may include data such as rule name, number of defect outbreaks, applicable language, etc., which is not limited in the embodiments of the present application. In addition, the code features can be represented as a code feature matrix of a×NS, and the rule features can be represented as a rule feature matrix of b×NS; wherein a is used to characterize the number of code blocks in the file group, b is used to characterize the number of rules in the file group, and NS is used to represent the preset number of columns in each matrix, such as 10.
[0110] See also Figure 4 , Figure 4 The following is a schematic diagram of a code feature acquisition process according to an embodiment of the present application. Figure 4 The schematic diagram of the code feature acquisition process shown can be applied to any of the above-mentioned file groups. Figure 4Specifically, the syntax tree 411, control flow 412, ..., program dependency information 413 and language type 414 corresponding to the file group 400 can be determined, and then the syntax tree 411, control flow 412, ..., program dependency information 413 and language type 414 can be extracted and input into the syntax tree 411, the embedding layer 421, the embedding layer 422, ..., the embedding layer 423, the embedding layer 424 corresponding to the syntax tree 411, the control flow 412, ..., program dependency information 413 and the language type 414 respectively. The control flow 412, ..., program dependency information 413 and language type 414 correspond to the fully connected layer 431, fully connected layer 432, ..., fully connected layer 433, and fully connected layer 434, respectively, so that the fully connected layer 431, fully connected layer 432, ..., fully connected layer 433, and fully connected layer 434 determine the first-class features 441, first-class features 442, ..., first-class features 443, and first-class features 444 corresponding to the syntax tree 411, the control flow 412, ..., program dependency information 413 and the language type 414, respectively. Furthermore, the first-class features 441, the first-class features 442, ..., the first-class features 443, and the first-class features 444 can be fused into the code features 460 through the fully connected layer 450; wherein, the parameters between the fully connected layer 450, the fully connected layer 431, the fully connected layer 432, ..., the fully connected layer 433, and the fully connected layer 434 can be the same or different, and the embodiment of the present application is not limited thereto. In addition, it should be noted that Figure 4 In the structural diagram shown, one or more pooling layers or one or more convolutional layers can be set after embedding layer 421, embedding layer 422, ..., embedding layer 423, and embedding layer 424, and before fully connected layer 431, fully connected layer 432, ..., fully connected layer 433, and fully connected layer 434, but this application does not limit this.
[0111] See also Figure 5 , Figure 5 The following schematically shows a schematic diagram of a rule feature acquisition process according to an embodiment of the present application. Figure 5 The schematic diagram of the rule feature acquisition process shown can be applied to any of the above-mentioned file groups. Figure 5Specifically, the rule name 511, the number of defect outbreaks 512, ..., and the applicable language 513 corresponding to the file group 500 can be determined, and then the rule name 511, the number of defect outbreaks 512, ..., and the applicable language 513 can be respectively extracted through the embedding layers 521, embedding layers 522, ..., and embedding layers 523 corresponding to the rule name 511, the number of defect outbreaks 512, ..., and the applicable language 513, and input into the fully connected layers 531, fully connected layers 532, ..., and fully connected layers 533 corresponding to the rule name 511, the number of defect outbreaks 512, ..., and the applicable language 513, so that the fully connected layers 531, fully connected layers 532, ..., and fully connected layers 533 determine the second-class features 551, second-class features 552, ..., and second-class features 553 corresponding to the rule name 511, the number of defect outbreaks 512, ..., and the applicable language 513, respectively. Furthermore, the second-class features 551, the second-class features 552, ..., and the second-class features 553 can be fused into the regular features 560 through the fully connected layer 550; wherein the parameters between the fully connected layer 550, the fully connected layer 531, the fully connected layer 532, ..., and the fully connected layer 533 can be the same or different, and the embodiment of the present application does not limit this. In addition, it should be noted that in Figure 5 In the structural diagram shown, one or more pooling layers or one or more convolutional layers can be set after embedding layer 521, embedding layer 522, ..., embedding layer 523 and before fully connected layer 531, fully connected layer 532, ..., fully connected layer 533, but this application does not limit this.
[0112] It can be seen that by implementing this optional embodiment, the code features of the file group can be determined by multiple first-class features that characterize the file group in multiple dimensions, and the rule features of the file group can be determined by multiple second-class features that characterize the file group in multiple dimensions. In this way, the code features and rule features determined can better represent the characteristics of the file group, which is conducive to generating a higher matching operation rule set for each file group.
[0113] In step S330, the multi-dimensional composite features corresponding to each file group are respectively input into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the operating rule set of the corresponding file group according to the corresponding multi-dimensional composite features.
[0114] Specifically, each file group corresponds to an operation rule set, and different file groups may correspond to different operation rule sets. Code files belonging to the same file group can all be run through the operation rule set corresponding to the file group; wherein the operation rule set can be used to limit the operation mode of the code files in the file group. An operation rule set may include one or more operation rules, and there may or may not be an intersection of operation rules between different operation rule sets.
[0115] For example, the multiple file groups are file group A, file group B, and file group C; file group A contains 2 code files, file group B contains 1 code file, and file group C contains 3 code files; file group A corresponds to operation rule set A, file group B corresponds to operation rule set B, and file group C corresponds to operation rule set C; then, the 2 code files in file group A can all be run based on operation rule set A, the 1 code file in file group B can all be run based on operation rule set B, and the 3 code files in file group C can all be run based on operation rule set C. In addition, the intelligent recommendation system corresponding to each file group can correspond to different system parameters of the same system structure, wherein the intelligent recommendation system (such as the deep neural network model MPSO-DNN) can be implemented as an intelligent recommendation model, and the system parameters can be understood as model parameters.
[0116] See also Figure 6 , Figure 6 The structure diagram of the intelligent recommendation system according to an embodiment of the present application is schematically shown. Figure 6 As shown, the intelligent recommendation system may include an input layer including one or more neurons, a hidden layer 1 including one or more neurons, a hidden layer 2 including one or more neurons, and an output layer including one or more neurons; wherein the neuron parameters of hidden layer 2 and hidden layer 1 may be the same or different, the neuron data of hidden layer 2 may be less than the number of neurons of hidden layer 1, and hidden layer 2 may discard some neurons to improve feature extraction accuracy. In the neural network of the intelligent recommendation system, the state can be forward updated through feature transfer between neurons, and the error can also be back propagated.
[0117] In an exemplary embodiment of the present application, after the multi-dimensional composite features corresponding to each file group are respectively input into the intelligent recommendation system corresponding to each file group, the above method: runs the corresponding file group based on the operation rule set of each file group to obtain the operation result of each file group; and outputs the operation result of each file group.
[0118] Specifically, the running result of each file group may be expressed in a form such as a text string, which is not limited in the embodiment of the present application.
[0119] It can be seen that by implementing this optional embodiment, the corresponding file group can be run based on the automatically generated running rule set, which can improve the automation level of processing the file group and reduce labor costs.
[0120] In an exemplary embodiment of the present application, the corresponding file group is run based on the operation rule set of each file group to obtain the operation result of each file group, including: outputting the operation rule set of each file group; when a confirmation operation for the operation rule set of each file group is detected, running the corresponding file group based on the operation rule set of each file group to obtain the operation result of each file group.
[0121] Specifically, the confirmation operation can be a click operation, a touch screen operation, a voice control operation, a gesture control operation, etc., which is not limited in the embodiments of the present application.
[0122] It can be seen that by implementing this optional embodiment, after the user confirms the operating rule set of each file group, the corresponding file group can be run based on the operating rule set. This can improve the level of interaction between the device and the user, increase the manual confirmation step on the basis of improving the degree of automation, and improve the processing efficiency of the code files through double guarantees and reduce the frequency of rework.
[0123] In an exemplary embodiment of the present application, after outputting the running results of each file group, the above method also includes: obtaining audit information for the running results of each file group; extracting audit features of the audit information corresponding to each file group; fusing the audit features corresponding to each file group with multi-dimensional composite features within the group to obtain fused features corresponding to each file group; and adjusting system parameters of the intelligent recommendation system corresponding to each file group based on the fused features corresponding to each file group.
[0124] Specifically, the fusion features corresponding to each file group can be expressed as a code-rule-audit feature matrix, and different file groups have different corresponding fusion features.
[0125] It can be seen that by implementing this optional embodiment, the accuracy of the intelligent recommendation system can be improved by fusing the multi-dimensional composite features with the audit features of the newly added audit information and training the intelligent recommendation system with the fusion results, so that the intelligent recommendation system can generate an operation rule set with a higher degree of match with the file group in the next round of operation rule set generation process.
[0126] In an exemplary embodiment of the present application, audit features of audit information corresponding to each file group are extracted, including: extracting multiple three-category features corresponding to each file group according to the audit information corresponding to each file group, and integrating the multiple three-category features corresponding to each file group within the group to obtain the audit features corresponding to each file group; wherein the multiple three-category features are used to represent the same file group through different dimensions.
[0127] Specifically, the audit information may include at least one of the following data: defect name, defect outbreak point location, false positive description, etc. Different file groups correspond to different audit information, which can reduce the false positive rate of static code detection. The audit feature can be represented as an audit feature matrix of c×NS, where c is used to represent the amount of audit information in the file group.
[0128] See also Figure 7 , Figure 7 The following schematically shows a process diagram of obtaining audit features according to an embodiment of the present application. Figure 7 The schematic diagram of the audit feature acquisition process shown can be applied to any of the above-mentioned file groups. Figure 7 Specifically, the defect name 711, the defect outbreak point position 712, ..., and the false alarm description 713 corresponding to the file group 700 can be determined, and then the defect name 711, the defect outbreak point position 712, ..., and the false alarm description 713 can be extracted by the embedding layers 721, 722, ..., and 723 corresponding to the defect name 711, the defect outbreak point position 712, ..., and the false alarm description 713, respectively, and input into the fully connected layers 731, 732, ..., and 733 corresponding to the defect name 711, the defect outbreak point position 712, ..., and the false alarm description 713, respectively, so that the fully connected layers 731, 732, ..., and 733 determine the three types of features 741, 742, ..., and 743 corresponding to the defect name 711, the defect outbreak point position 712, ..., and the false alarm description 713, respectively. Furthermore, the three types of features 741, 742, ..., 743 can be fused into audit features 760 through the fully connected layer 750; wherein the parameters of the fully connected layer 750, 731, 732, ..., 733 can be the same or different, and the embodiment of the present application does not limit this. In addition, it should be noted that in Figure 7 In the structural diagram shown, one or more pooling layers or one or more convolutional layers can be set after embedding layer 721, embedding layer 722, ..., embedding layer 723 and before fully connected layer 731, fully connected layer 732, ..., fully connected layer 733, but this application does not limit this.
[0129] See also Figure 8 , Figure 8 The following schematically shows a fusion feature acquisition process according to an embodiment of the present application. Figure 8As shown, the code feature 8111, the rule feature 812, and the audit feature 813 are fused through the fully connected layer 820 to obtain the fused feature 830; wherein the length, width, and height of the fused feature 830 are the number of code blocks a, the number of rules b, and the number of audit information c, respectively.
[0130] It can be seen that by implementing this optional embodiment, the audit features of the file group can be determined by multiple three-category features that characterize the file group in multiple dimensions. The audit features determined in this way can better represent the characteristics of the file group, which is conducive to generating a more matching operation rule set for each file group.
[0131] In an exemplary embodiment of the present application, system parameters of the intelligent recommendation system corresponding to each file group are adjusted based on the fusion features corresponding to each file group, including: determining the system parameter fitness values of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group; adaptively iterating and updating the system parameters of each intelligent recommendation system a preset number of times according to the system parameter fitness values of each intelligent recommendation system to obtain target system parameters corresponding to each intelligent recommendation system; and applying the target system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0132] Specifically, before determining the fitness value of the system parameters of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group, the above method may also include: initializing the intelligent recommendation system corresponding to each file group and the system parameters of each intelligent recommendation system; wherein the system parameters of each intelligent recommendation system after initialization may be the same or different, and the number of system parameters (such as weight values, bias items, etc.) in the intelligent recommendation system may be any number, which is not limited by the embodiments of the present application. wherein, when the system parameters in the intelligent recommendation system are applied to the adaptive particle algorithm, they may be used as particles to participate in the calculation of the algorithm.
[0133] Based on this, the above method can also include the following steps: receiving the calculation accuracy E, learning rate n, and maximum number of iterations M set by the user corresponding to each intelligent recommendation system, where E, n, and M are all natural numbers; and then determining the number of system parameters in the intelligent recommendation system as the number of particles T, determining a random number from a preset range (e.g., (-1,1)) to randomly generate a velocity sequence and a position sequence of a particle group corresponding to the number of particles T according to the random number, and obtaining the inertia weight, acceleration factor, and adaptive mutation operator mutation probability set by the user, and associating the inertia weight, acceleration factor, and adaptive mutation operator mutation probability with the intelligent recommendation system, wherein different intelligent recommendation systems can correspond to different inertia weights, acceleration factors, and adaptive mutation operator mutation probabilities, or can correspond to the same inertia weight, acceleration factor, and adaptive mutation operator mutation probability.
[0134] Furthermore, the fitness values of the system parameters of the intelligent recommendation system corresponding to each file group are determined based on the fusion features corresponding to each file group, including: determining the fitness values of the system parameters of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group. The fitness value of the system parameter refers to the measure of the degree of survival advantage of an individual (i.e., a system parameter) in a population (i.e., all system parameters in the intelligent recommendation system), which is used to distinguish good from bad individuals. Fitness is usually calculated using a fitness function, which is also called an evaluation function, and is used to judge the fitness of an individual through individual characteristics.
[0135] Based on this, the system parameters of each intelligent recommendation system are adaptively iterated and updated for a preset number of times according to the system parameter fitness value of each intelligent recommendation system, and the target system parameters corresponding to each intelligent recommendation system are obtained, including: according to the system parameter fitness value, calculation accuracy E, learning rate n, and maximum number of iterations M of each intelligent recommendation system, the system parameters of each intelligent recommendation system are adaptively iterated and updated for a preset number of times (e.g., 100 times), and the velocity sequence and position sequence of the particle swarm with particle number T can be updated in each adaptive iterative update, and the updated velocity sequence and position sequence of the particle swarm with particle number T are applied to the next round of adaptive iterative update until the individual extreme value corresponding to each system parameter and the initial global extreme value corresponding to the intelligent recommendation system are determined, and the target system parameters corresponding to each intelligent recommendation system are determined according to the individual extreme value corresponding to each system parameter and the initial global extreme value corresponding to the intelligent recommendation system.
[0136] It can be seen that by implementing this optional embodiment, the system parameters of the intelligent recommendation system can be adjusted through an adaptive algorithm, thereby improving the adjustment efficiency of the system parameters.
[0137] In an exemplary embodiment of the present application, the target system parameters corresponding to each intelligent recommendation system are applied to the corresponding intelligent recommendation system, including: initializing the target system parameters corresponding to each intelligent recommendation system through adaptive variation parameters to obtain reference system parameters corresponding to each intelligent recommendation system; calculating reference fitness values of the reference system parameters corresponding to each intelligent recommendation system; adaptively iterating and updating the corresponding reference system parameters a preset number of times according to each reference fitness value to obtain specific system parameters corresponding to each intelligent recommendation system; and applying the specific system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0138] Specifically, the adaptive mutation parameter can be a preset parameter, which is used to reinitialize the system parameter with a preset probability. After the corresponding reference system parameters are adaptively updated for a preset number of times according to each reference fitness value, and the specific system parameters corresponding to each intelligent recommendation system are obtained, the system error is less than the calculation accuracy E or the number of system updates reaches the above-mentioned maximum number of iterations M.
[0139] See also Fig. 9 , Fig. 9 The following schematically shows a training flow chart of an intelligent recommendation system according to an embodiment of the present application. Fig. 9 As shown, the training flow chart may include: steps S900 to S990.
[0140] Step S900: Initialize the intelligent recommendation systems corresponding to each file group and the system parameters of each intelligent recommendation system, and receive the calculation accuracy, learning rate, and maximum number of iterations corresponding to each intelligent recommendation system set by the user.
[0141] Step S910: Further, according to determining the number of system parameters in the intelligent recommendation system as the number of particles, a random number is determined from a preset range to randomly generate a velocity sequence and a position sequence of a particle group corresponding to the number of particles according to the random number.
[0142] Step S920: Obtain the inertia weight, acceleration factor, and adaptive mutation operator mutation probability set by the user, and associate the inertia weight, acceleration factor, and adaptive mutation operator mutation probability with the intelligent recommendation system.
[0143] Step S930: determining the system parameter fitness value of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group.
[0144] Step S940: The system parameters of each intelligent recommendation system are adaptively iterated and updated for a preset number of times according to the system parameter fitness value, calculation accuracy, learning rate, and maximum number of iterations of each intelligent recommendation system. The velocity sequence and position sequence of the particle swarm of particle number T can be updated in each adaptive iterative update. The updated velocity sequence and position sequence of the particle swarm of particle number T are applied to the next round of adaptive iterative update until the individual extreme value corresponding to each system parameter and the initial global extreme value corresponding to the intelligent recommendation system are determined.
[0145] Step S950: Determine the target system parameters corresponding to each intelligent recommendation system according to the individual extreme value corresponding to each system parameter and the initial global extreme value corresponding to the intelligent recommendation system.
[0146] Step S960: Initializing the target system parameters corresponding to each intelligent recommendation system through adaptive variation parameters to obtain the reference system parameters corresponding to each intelligent recommendation system.
[0147] Step S970: Calculate the reference fitness values of the reference system parameters corresponding to each intelligent recommendation system.
[0148] Step S980: According to each reference fitness value, the corresponding reference system parameters are adaptively iterated and updated for a preset number of times to obtain specific system parameters corresponding to each intelligent recommendation system.
[0149] Step S990: applying the specific system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0150] It should be noted that steps S900 to S990 correspond to the above embodiment. For the specific implementation of steps S900 to S990, please refer to the above embodiment, which will not be described again here.
[0151] It can be seen that by implementing this optional embodiment, an adaptive variation parameter can be added during the update process of the intelligent recommendation system, so that the adaptive variation parameter initializes the target system parameters corresponding to each intelligent recommendation system. In this way, the target system parameters can be reset, thereby reducing the probability of the occurrence of a local optimal solution, thereby improving the efficiency of determining the overall optimal solution.
[0152] See also Fig.10 , Fig.10 The following is a schematic diagram showing the implementation process of a file processing method according to an embodiment of the present application. Fig.10 As shown, the code feature 1021, rule feature 1022, and audit feature 1023 corresponding to the file group 1010 can be obtained, and then the code feature 1021, rule feature 1022, and audit feature 1023 are fused into a fusion feature 1040 through the fully connected layer 1030, and then the intelligent recommendation system 1050 generates an operation rule set 1060 corresponding to the file group 1010 based on the fusion feature 1040, and runs the file group 1010 according to the operation rule set 1060 to obtain the predicted false alarm rate 1071, and the loss function between the predicted false alarm rate 1071 and the actual false alarm rate 1072 can be used to realize the update of the intelligent recommendation system 1050.
[0153] See also Fig.11 , Fig.11 The following schematically shows a schematic diagram of the structure and application of a file processing method according to an embodiment of the present application. Fig.11As shown, when a code package 1100 to be processed is detected, each code file is clustered according to a set of structural features of each code file in the code package 1100 to obtain file group 1111, file group 1112, ..., file group 1113; wherein, file group 1111, file group 1112, ..., file group 1113 correspond to different intelligent recommendation systems 1121, intelligent recommendation systems 1122, ..., intelligent recommendation systems 1123, respectively.
[0154] File group 1111, file group 1112, ..., file group 1113 are respectively input into intelligent recommendation system 1121, intelligent recommendation system 1122, ..., intelligent recommendation system 1123, so that intelligent recommendation system 1121, intelligent recommendation system 1122, ..., intelligent recommendation system 1123 can determine operation rule set 1131, operation rule set 1132, ..., operation rule set 1133 corresponding to file group 1111, file group 1112, ..., file group 1113, respectively.
[0155] Furthermore, engine 1140 can run file group 1111 based on running rule set 1131, run file group 1112 based on running rule set 1132, and run file group 1113 based on running rule set 1133, thereby obtaining running results 1151, running results 1152, ..., running results 1153 corresponding to file group 1111, file group 1112, ..., file group 1113, respectively.
[0156] When audit information 1161, audit information 1162, ..., and audit information 1163 corresponding to operation result 1151, operation result 1152, ..., and operation result 1153 are obtained, audit information 1161, audit information 1162, ..., and audit information 1163 can be returned to intelligent recommendation system 1121, intelligent recommendation system 1122, ..., and intelligent recommendation system 1123 respectively, to participate in the next round of system update of intelligent recommendation system 1121, intelligent recommendation system 1122, ..., and intelligent recommendation system 1123, thereby improving the system accuracy of intelligent recommendation system 1121, intelligent recommendation system 1122, ..., and intelligent recommendation system 1123.
[0157] See also Fig.12 , Fig.12 The following is a flowchart schematically showing a file processing method according to an embodiment of the present application. Fig.12 As shown, the file processing method may include: steps S1200 to S1222.
[0158] Step S1200: input the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the corresponding operating rule set of the file group according to the corresponding multi-dimensional composite features, and the multi-dimensional composite features corresponding to each file group include at least code features and rule features.
[0159] Step S1202: extract multiple first-class features corresponding to each file group according to the code information corresponding to each file group, and fuse the multiple first-class features corresponding to each file group within the group to obtain the code features corresponding to each file group; wherein the multiple first-class features are used to represent the same file group through different dimensions.
[0160] Step S1204: extract multiple second-category features corresponding to each file group according to the rule information corresponding to each file group, and fuse the multiple second-category features corresponding to each file group within the group to obtain the rule features corresponding to each file group; wherein the multiple second-category features are used to represent the same file group through different dimensions.
[0161] Step S1206: input the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the operating rule set of the corresponding file group according to the corresponding multi-dimensional composite features.
[0162] Step S1208: outputting the operation rule set of each file group; when a confirmation operation for the operation rule set of each file group is detected, running the corresponding file group based on the operation rule set of each file group to obtain the operation result of each file group.
[0163] Step S1210: Output the operation result of each file group, and obtain audit information for the operation result of each file group.
[0164] Step S1212: extract multiple three-category features corresponding to each file group according to the audit information corresponding to each file group, and fuse the multiple three-category features corresponding to each file group within the group to obtain the audit features corresponding to each file group; wherein the multiple three-category features are used to represent the same file group through different dimensions.
[0165] Step S1214: Fusing the audit features and multi-dimensional composite features corresponding to each file group within the group to obtain fused features corresponding to each file group.
[0166] Step S1216: Initialize the target system parameters corresponding to each intelligent recommendation system through adaptive variation parameters to obtain the reference system parameters corresponding to each intelligent recommendation system.
[0167] Step S1218: Calculate the reference fitness values of the reference system parameters corresponding to each intelligent recommendation system.
[0168] Step S1220: According to each reference fitness value, the corresponding reference system parameters are adaptively iterated and updated a preset number of times to obtain specific system parameters corresponding to each intelligent recommendation system.
[0169] Step S1222: applying the specific system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0170] It should be noted that steps S1200 to S1222 are Figure 3 The steps and their embodiments shown correspond to each other. For the specific implementation of steps S1200 to S1222, please refer to Figure 3 The steps and embodiments shown are not described in detail here.
[0171] It can be seen that the implementation Fig.12 The method shown can cluster multiple code files based on a set of structural features, and generate different sets of operating rules for different file groups obtained by clustering, without the need to manually select the set of operating rules applicable to each code file, which can save labor costs and improve the processing efficiency of code files. In addition, the automation and standardization of the code file processing process can be improved, reducing manual errors.
[0172] Furthermore, in this exemplary embodiment, a file processing device is also provided. Fig.13 The file processing device 1300 shown in FIG. Figure 3 Corresponding to the steps shown, the file processing device 1300 may include: a file group clustering unit 1301 , a feature extraction unit 1302 , and a rule set determination unit 1303 .
[0173] The file group clustering unit 1301 is used for clustering each code file according to the structural feature set of each code file in the code package when a code package to be processed is detected, so as to obtain multiple file groups; wherein the code files within the multiple file groups correspond to the same structural feature set, and the code files between the multiple file groups correspond to different structural feature sets;
[0174] A feature extraction unit 1302 is used to extract multi-dimensional composite features corresponding to each of the multiple file groups;
[0175] The rule set determination unit 1303 is used to input the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate the operation rule set of the corresponding file group according to the corresponding multi-dimensional composite features.
[0176] The set of structural features of each code file includes at least one of language type, syntax tree, control flow and program dependency information.
[0177] It can be seen that the implementation Fig.13 The device shown can cluster multiple code files based on a set of structural features, and generate different sets of operating rules for different file groups obtained by clustering, without the need to manually select the set of operating rules applicable to each code file, which can save labor costs and improve the processing efficiency of code files. In addition, the degree of automation and standardization of the code file processing process can be improved, reducing manual errors.
[0178] In an exemplary embodiment of the present application, the above-mentioned device further includes:
[0179] A file running unit (not shown) is used to run the corresponding file group based on the running rule set of each file group to obtain the running result of each file group after the rule set determination unit 1303 inputs the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group;
[0180] The operation result output unit (not shown) is used to output the operation result of each file group.
[0181] It can be seen that by implementing this optional embodiment, the corresponding file group can be run based on the automatically generated running rule set, which can improve the automation level of processing the file group and reduce labor costs.
[0182] In an exemplary embodiment of the present application, the file running unit runs the corresponding file group based on the running rule set of each file group to obtain the running result of each file group, including:
[0183] The file operation unit outputs the operation rule set of each file group;
[0184] When the file running unit detects the confirmation operation for the running rule set of each file group, it runs the corresponding file group based on the running rule set of each file group to obtain the running result of each file group.
[0185] It can be seen that by implementing this optional embodiment, after the user confirms the operating rule set of each file group, the corresponding file group can be run based on the operating rule set. This can improve the level of interaction between the device and the user, increase the manual confirmation step on the basis of improving the degree of automation, and improve the processing efficiency of the code files through double guarantees and reduce the frequency of rework.
[0186] In an exemplary embodiment of the present application, the above-mentioned device further includes:
[0187] An audit information acquisition unit (not shown), used to acquire audit information of the operation results of each file group after the operation result output unit outputs the operation results of each file group;
[0188] An audit feature extraction unit (not shown), used to extract audit features of audit information corresponding to each file group;
[0189] A feature fusion unit (not shown) is used to fuse the audit features and multi-dimensional composite features corresponding to each file group to obtain fused features corresponding to each file group;
[0190] The system parameter adjustment unit (not shown) is used to adjust the system parameters of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group.
[0191] It can be seen that by implementing this optional embodiment, the accuracy of the intelligent recommendation system can be improved by fusing the multi-dimensional composite features with the audit features of the newly added audit information and training the intelligent recommendation system with the fusion results, so that the intelligent recommendation system can generate an operation rule set with a higher degree of match with the file group in the next round of operation rule set generation process.
[0192] In an exemplary embodiment of the present application, the system parameter adjustment unit adjusts the system parameters of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group, including:
[0193] The system parameter adjustment unit determines the system parameter fitness value of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group;
[0194] The system parameter adjustment unit adaptively iterates and updates the system parameters of each intelligent recommendation system for a preset number of times according to the system parameter fitness values of each intelligent recommendation system, and obtains the target system parameters corresponding to each intelligent recommendation system;
[0195] The system parameter adjustment unit applies the target system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0196] It can be seen that by implementing this optional embodiment, the system parameters of the intelligent recommendation system can be adjusted through an adaptive algorithm, thereby improving the adjustment efficiency of the system parameters.
[0197] In an exemplary embodiment of the present application, the system parameter adjustment unit applies the target system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system, including:
[0198] The system parameter adjustment unit initializes the target system parameters corresponding to each intelligent recommendation system through adaptive variation parameters, and obtains the reference system parameters corresponding to each intelligent recommendation system;
[0199] The system parameter adjustment unit calculates the reference fitness values of the reference system parameters corresponding to each intelligent recommendation system;
[0200] The system parameter adjustment unit adaptively iterates and updates the corresponding reference system parameters for a preset number of times according to each reference fitness value, and obtains specific system parameters corresponding to each intelligent recommendation system;
[0201] The system parameter adjustment unit applies the specific system parameters corresponding to each intelligent recommendation system to the corresponding intelligent recommendation system.
[0202] It can be seen that by implementing this optional embodiment, an adaptive variation parameter can be added during the update process of the intelligent recommendation system, so that the adaptive variation parameter initializes the target system parameters corresponding to each intelligent recommendation system. In this way, the target system parameters can be reset, thereby reducing the probability of the occurrence of a local optimal solution, thereby improving the efficiency of determining the overall optimal solution.
[0203] In an exemplary embodiment of the present application, the multi-dimensional composite features corresponding to each file group include at least a code feature and a rule feature. The feature extraction unit 1302 extracts the multi-dimensional composite features corresponding to each file group in the multiple file groups, including:
[0204] The feature extraction unit 1302 extracts multiple first-class features corresponding to each file group according to the code information corresponding to each file group, and fuses the multiple first-class features corresponding to each file group within the group to obtain the code features corresponding to each file group; wherein the multiple first-class features are used to represent the same file group through different dimensions;
[0205] The feature extraction unit 1302 extracts multiple second-category features corresponding to each file group according to the rule information corresponding to each file group, and fuses the multiple second-category features corresponding to each file group within the group to obtain the rule features corresponding to each file group; wherein the multiple second-category features are used to represent the same file group through different dimensions.
[0206] It can be seen that by implementing this optional embodiment, the code features of the file group can be determined by multiple first-class features that characterize the file group in multiple dimensions, and the rule features of the file group can be determined by multiple second-class features that characterize the file group in multiple dimensions. In this way, the code features and rule features determined can better represent the characteristics of the file group, which is conducive to generating a higher matching operation rule set for each file group.
[0207] In an exemplary embodiment of the present application, the audit feature extraction unit extracts the audit features of the audit information corresponding to each file group, including:
[0208] The audit feature extraction unit extracts multiple three-category features corresponding to each file group according to the audit information corresponding to each file group, and fuses the multiple three-category features corresponding to each file group within the group to obtain the audit features corresponding to each file group; wherein the multiple three-category features are used to represent the same file group through different dimensions.
[0209] It can be seen that by implementing this optional embodiment, the audit features of the file group can be determined by multiple three-category features that characterize the file group in multiple dimensions. The audit features determined in this way can better represent the characteristics of the file group, which is conducive to generating a more matching operation rule set for each file group.
[0210] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0211] Since the various functional modules of the file processing device of the example embodiment of the present application correspond to the steps of the example embodiment of the above-mentioned file processing method, for details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the above-mentioned file processing method of the present application.
[0212] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0213] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0214] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0215] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0216] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0217] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A file processing method, characterized in that: include: When a code package to be processed is detected, the code files in the code package are clustered according to the structural feature set of each code file to obtain multiple file groups; wherein the code files within the multiple file groups correspond to the same structural feature set, and the code files between the multiple file groups correspond to different structural feature sets; Extracting multi-dimensional composite features corresponding to each file group in the plurality of file groups; Inputting the multi-dimensional composite features corresponding to each file group into the intelligent recommendation system corresponding to each file group; wherein the intelligent recommendation system corresponding to each file group is used to generate an operation rule set for the corresponding file group according to the corresponding multi-dimensional composite features; The multi-dimensional composite features corresponding to each file group include at least a code feature and a rule feature; extracting the multi-dimensional composite features corresponding to each file group in the multiple file groups includes: Extracting a plurality of first-class features corresponding to each file group according to the code information corresponding to each file group, and fusing the plurality of first-class features corresponding to each file group within the group to obtain the code features corresponding to each file group; wherein the plurality of first-class features are used to represent the same file group through different dimensions; According to the rule information corresponding to each file group, multiple second-category features corresponding to each file group are extracted, and the multiple second-category features corresponding to each file group are fused within the group to obtain the rule features corresponding to each file group; wherein the multiple second-category features are used to represent the same file group through different dimensions.
2. The method according to claim 1, characterized in that After inputting the multi-dimensional composite features corresponding to each of the file groups into the intelligent recommendation systems corresponding to each of the file groups, the method further includes: Running the corresponding file group based on the running rule set of each file group to obtain the running result of each file group; Output the running results of each file group.
3. The method according to claim 2, characterized in that Running the corresponding file group based on the running rule set of each file group to obtain the running results of each file group includes: Outputting the operation rule sets of each file group; When a confirmation operation for the operation rule set of each file group is detected, the corresponding file group is run based on the operation rule set of each file group to obtain the operation result of each file group.
4. The method according to claim 2, characterized in that: After outputting the operation results of each file group, the method further includes: Obtaining audit information on the operation results of each file group; Extracting audit features of the audit information corresponding to each file group; Performing intra-group feature fusion on the audit features and multi-dimensional composite features corresponding to each file group to obtain fusion features corresponding to each file group; Based on the fusion features corresponding to the file groups, the system parameters of the intelligent recommendation system corresponding to the file groups are adjusted respectively.
5. The method according to claim 4, characterized in that Adjusting the system parameters of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group includes: Determine the system parameter fitness value of the intelligent recommendation system corresponding to each file group based on the fusion features corresponding to each file group; According to the fitness values of the system parameters of each intelligent recommendation system, adaptively iteratively update the system parameters of each intelligent recommendation system for a preset number of times to obtain the target system parameters corresponding to each intelligent recommendation system; The target system parameters corresponding to each of the intelligent recommendation systems are applied to the corresponding intelligent recommendation system.
6. The method according to claim 5, characterized in that Applying the target system parameters corresponding to each of the intelligent recommendation systems to the corresponding intelligent recommendation system includes: Initialize the target system parameters corresponding to each intelligent recommendation system respectively through adaptive variation parameters to obtain the reference system parameters corresponding to each intelligent recommendation system respectively; Calculating reference fitness values of reference system parameters corresponding to each of the intelligent recommendation systems; According to each reference fitness value, the corresponding reference system parameters are adaptively iterated for a preset number of times to obtain specific system parameters corresponding to each intelligent recommendation system; The specific system parameters corresponding to each of the intelligent recommendation systems are applied to the corresponding intelligent recommendation system.
7. The method according to claim 1, characterized in that The set of structural features of each code file includes at least one of language type, syntax tree, control flow and program dependency information.
8. The method according to claim 4, characterized in that Extracting the audit features of the audit information corresponding to each file group includes: According to the audit information corresponding to each file group, multiple three-category features corresponding to each file group are extracted, and the multiple three-category features corresponding to each file group are fused within the group to obtain the audit features corresponding to each file group; wherein the multiple three-category features are used to characterize the same file group through different dimensions.
9. A file processing device, characterized in that: include: A file group clustering unit is used for clustering the code files in the code package according to the structural feature set of each code file to obtain a plurality of file groups when a code package to be processed is detected; wherein the code files within the plurality of file groups correspond to the same structural feature set, and the code files between the plurality of file groups correspond to different structural feature sets; A feature extraction unit, used to extract multi-dimensional composite features corresponding to each file group in the plurality of file groups; A rule set determination unit, used to input the multi-dimensional composite features corresponding to each of the file groups into the intelligent recommendation system corresponding to each of the file groups; wherein the intelligent recommendation system corresponding to each of the file groups is used to generate an operation rule set for the corresponding file group according to the corresponding multi-dimensional composite features; Among them, the multi-dimensional composite features corresponding to each file group include at least code features and rule features; the feature extraction unit is used to extract multiple first-class features corresponding to each file group according to the code information corresponding to each file group, and fuse the multiple first-class features corresponding to each file group within the group to obtain the code features corresponding to each file group; wherein the multiple first-class features are used to characterize the same file group through different dimensions; according to the rule information corresponding to each file group, the multiple second-class features corresponding to each file group are extracted, and the multiple second-class features corresponding to each file group are fused within the group to obtain the rule features corresponding to each file group; wherein the multiple second-class features are used to characterize the same file group through different dimensions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.
Citation Information
Patent Citations
Method and system for identifying agricultural product by code bar
CN101055614A
Method for measuring static quality of FPGA software
CN107341101A