Identification software component analysis method and equipment, and medium
Through standardized processing of software file paths and extension name data, feature matching of abstract syntax trees and control flow charts, the problems of high computational complexity and inaccurate recognition in traditional software component analysis are solved, and efficient and accurate open source component recognition is achieved.
Patent Information
- Application Number
- CN202510735725.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Traditional software component analysis methods have high computational complexity and high false alarm rate when analyzing large data packet software, and focus on semantic features and ignore overall structural features, resulting in inaccurate identification of open source components.
By obtaining the software file directory path and extension name data, generating path strings and normalizing them, combining abstract syntax trees and control flow charts, calculating instruction similarity using the minimum hash signature and editing text distance, and performing multi-level feature matching to identify open source components.
Reduces computational complexity, improves the accuracy and depth of open source component recognition, and ensures the accuracy of recognition.
Smart Images

Figure CN120256275A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software technology, and in particular, to a method and device, and a medium for identifying software component analysis. Background Art
[0002] In recent years, open-source databases have been widely adopted in software development due to their unique advantages. Open-source components can usually be used for free or at a low price, which is very friendly to developers in controlling costs. Open-source components can be specifically optimized according to the specific requirements of development projects during use. In addition, developers can obtain technical support such as materials and tutorials in the developer community corresponding to the open-source project. Therefore, open-source components are not only limited to traditional web development, mobile application development, and desktop application development, but the content of open-source projects in software in emerging fields such as artificial intelligence, cloud computing, big data, SAAS, and financial services has also increased rapidly. However, at the same time, open-source components may have security vulnerabilities themselves, and there is a hidden danger that the developed finished software may be maliciously exploited. In addition, the version iteration speed of open-source components is inconsistent, and some old components are prone to bring security risks to the software due to untimely updates. Therefore, identifying the open-source file components in software is an important step in software component analysis.
[0003] Currently, the Chinese invention patent with the application number 202311667073.1 discloses a software component analysis method and related devices. The application solution includes: first, obtaining the source code of the target software, extracting the feature information of the source code, and further, determining the main component information of the target software according to the feature information, using a software measurement tool to determine the measurement index of the target software, and finally, performing a risk assessment on the main component information according to the measurement index. This application can effectively solve the problem that multivariate statistical analysis technology is not used in the existing software component analysis and evaluation process, analyze some measurement data obtained by using a software measurement tool for the target software, reduce the difficulty of finding high-risk modules or high-risk classes in software development, facilitate developers or managers to effectively carry out risk management, reduce the information redundancy between various indicators, improve the efficiency of problem analysis, and improve the accuracy and efficiency of software component analysis and evaluation. However, this solution directly parses and processes all the code content, which is prone to problems such as high computational complexity and high false alarm rate. In addition, when analyzing and extracting feature extraction for the software code to be identified, it usually focuses on calculating semantic features and does not make full use of the overall structural features, which is not conducive to ensuring the accuracy of identifying open-source components. Summary of the Invention
[0004] The technical problem solved by the present invention is that when analyzing the components of software using traditional methods, the entire code content is directly parsed and processed. When the software to be detected consists of large data packets, it is prone to problems such as high computational complexity and high false positive rate. In addition, when extracting analysis features from software code, it usually focuses on calculating semantic features and local structural features, and the overall structural features are not fully utilized, which is not conducive to ensuring the accuracy of open source component identification.
[0005] To solve the above technical problems, the present invention provides the following technical solution: A method for identifying software component analysis, including step S1, obtaining all files in the software to be identified to obtain a first data set; Step S2, extracting meta-file data to obtain a second data set, extracting features based on the second data set to obtain a first feature set, and performing a first feature match between the first feature set and a preset reference database to obtain a first open source file set; Step S2, performing deletion processing on the first data set based on the first open source file set to obtain a third data set, generating a program abstract syntax tree and corresponding sub-syntax trees based on the third data set, generating a second feature set through the calculated minimum hash signatures of each file and the sub-syntax trees, and performing a third feature match between the second feature set and the preset reference database to obtain a second open source file set; Step S4, performing deletion processing on the third data set based on the second open source file set to obtain a fourth data set, constructing a control flow diagram based on the abstract syntax tree and the fourth data set based on the updated syntax tree, extracting features through the control flow diagram to obtain a third feature set, and performing a fourth feature match between the third feature set and the preset reference database to obtain a third open source file set; Step S5, merging the first open source file set, the second open source file set, and the second open source file set to obtain the total set of open source components in the software to be identified.
[0006] As a preferred solution of a method for identifying software component analysis according to the present invention, among them: extracting features from the second data set to obtain a first feature set, obtaining file directory path data and file extension data from the first data set, arranging the file directory path data in the order from the file root directory to the sub-directory to obtain a path string, performing normalization processing on the path string to obtain a first directory path data set, traversing the first data set to identify file extensions to obtain a first file extension data set, and merging the first directory path data set and the first file extension data set to obtain a first feature set.
[0007] As a preferred solution of an identification software component analysis method according to the present invention, wherein: the operation logic of the first feature matching is: comparing the first file extension data set with the file extension list in the preset reference database one by one to determine all files with the same extension to obtain the first matching files; Extracting the directory path data corresponding to the first matching files from the first directory path data set, comparing it with the directory path data list in the preset reference database one by one to determine all files with the same path structure to obtain the first open source file set; The calculation logic for normalizing the path string is: unifying the path string delimiter symbols of different operating systems and removing redundant delimiters, converting the relative path of the path string into an absolute path, converting the constituent letters of the path string to lowercase, and clearing the invalid space characters in the path string; The preset reference database includes an open source database on the network side and a local database.
[0008] As a preferred solution of an identification software component analysis method according to the present invention, wherein: deleting the first open source file set data from the first data set to obtain a third data set, parsing the code in the third data set to obtain the abstract syntax tree corresponding to each file, performing a pre-order traversal on each abstract syntax tree through depth-first search to generate a corresponding sub-syntax tree, calculating the minimum hash signature of each file in the third data set based on the sub-syntax tree and the minhash algorithm, generating a second feature set based on the minimum hash signature of each file and the sub-syntax tree, and performing a third feature matching with the preset reference database according to the second feature set to obtain a second open source file set; As a preferred solution of an identification software component analysis method according to the present invention, wherein: the second feature set is composed of the syntax feature vectors of each file in the third data set, and the composition of the syntax feature vectors of each file includes: the minimum hash signature, the number of sub-syntax trees, and the total number of nodes in the sub-syntax tree; The calculation logic of the third feature matching is: extracting each syntax feature vector in the second feature set and performing threshold screening based on the syntax feature vector set of the preset reference database, and its calculation expression is:
[0009] wherein, SFR represents the syntax feature threshold screening result, i represents the index of each file in the third data set, represents the index of each file in the preset reference database, represents the minimum hash signature of each file in the third data set, represents the minimum hash signature set in the preset reference database, represents the number of sub-syntax trees generated by each file in the third data set, Represents the set of the number of sub-syntax trees corresponding to the preset reference database file, Represents the total number of nodes of the sub-syntax trees generated by each file in the third dataset, Represents the set of the total number of nodes of the sub-syntax trees corresponding to the preset reference database file, Represents the minimum hash deviation threshold, Represents the sub-syntax tree deviation threshold, Represents the sub-syntax tree node deviation threshold.
[0010] As a preferred solution of an identification software component analysis method according to the present invention, wherein: the third dataset is pruned based on the second open-source file set to obtain a fourth dataset, the abstract syntax tree is pruned based on the second open-source file set to obtain an updated syntax tree, a control flow diagram is constructed based on the updated syntax tree, a third feature set is obtained by feature extraction through the control flow diagram, and a third open-source file set is obtained by performing a fourth feature matching between the third feature set and a preset reference database; The calculation logic for converting the updated syntax tree into a control flow diagram is as follows: traverse and identify the control syntax structure based on the updated syntax tree, determine the execution order and conditional branches between each syntax tree node through the control syntax structure, perform code segmentation based on the execution order and conditional branches between each syntax tree node to obtain code segments with independent control structures, establish control flow nodes based on each code segment with an independent control structure, divide a continuous sequence of non-branching updated syntax tree nodes into basic blocks, establish corresponding control flow directed edges based on each node type and the basic blocks, and construct a control flow diagram based on the obtained control flow nodes, basic blocks, and control flow directed edges.
[0011] As a preferred solution of an identification software component analysis method according to the present invention, wherein: a third feature set is obtained by feature extraction through the control flow diagram, and the operation logic of the feature extraction is as follows: obtain the program instruction set corresponding to each node based on the mapping relationship between the nodes and program instructions in the control flow diagram, divide each program instruction in the program instruction set through a fixed window sliding algorithm to obtain corresponding program instruction segments, calculate the segment hash value through the CityHash algorithm, splice the segment hash values to obtain a program instruction feature value, and obtain a third feature set based on the program instruction feature values corresponding to each program instruction.
[0012] As a preferred solution of an identification software component analysis method according to the present invention, wherein: the calculation logic for the four matches is as follows: calculate the edit text distance of the third feature based on the third feature set and the preset reference database, calculate the instruction similarity based on the edit text distance, and when the instruction similarity is greater than the similarity threshold, determine that the corresponding file in the third feature set matches the preset reference database to obtain a third open-source file set, and its calculation expression is:
[0013] Among them, SPC represents instruction similarity, represents the program instruction feature value in the third feature set, represents the set of program instruction feature values in the preset reference database, represents the edit text distance between each program instruction in the third feature set and the program instructions in the preset reference database. k represents the index of each program instruction in the third feature set, l represents the index of the program instruction in the preset reference database, and represents the total length. represents the maximum value function.
[0014] The present invention provides an electronic device, including a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, an identification software component analysis method as described above is run.
[0015] The present invention provides a storage medium, on which a computer program is stored. It is characterized in that when the computer program is executed by a processor, an identification software component analysis method as described above is run.
[0016] The beneficial effects of the present invention: In the process of software component analysis, first analyze the metadata of the software, narrowing the scope of analysis of the software content data. Through the common matching of the directory path and file extension, the open-source component part that is not shelled and directly cloned can be quickly identified, that is, the first open-source file set in the above-mentioned invention content. After obtaining the open-source file set, delete the original file data, and perform software component analysis according to the structure from more file content to less file content and from simple identification method to complex identification method, effectively reducing the computational complexity. Calculate the minimum hash signature through the program abstract syntax tree and the corresponding sub-syntax tree to generate the second feature set, which can use semantic features to identify open-source components. Extract features by constructing a control flow chart to obtain the program fragment hash value, and combine the edit text distance to calculate the instruction similarity to obtain the third open-source file set, which is beneficial to accurately identify the open-source component composition from the perspective of the program code control flow structure, improving the accuracy and depth of software component identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of the basic process of an identification software component analysis method provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] In order to make the above objects, features and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention will be given with reference to the accompanying drawings of the specification. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.
[0019] Example 1. Refer to Figure 1 , which is an embodiment of the present invention, and provides a method for identifying software component analysis, including: Step S1: Obtain all files in the software to be identified to obtain a first data set; Step S2: Extract meta-file data to obtain a second data set, perform feature extraction on the second data set to obtain a first feature set, and perform first feature matching between the first feature set and a preset reference database to obtain a first open-source file set; Step S2: Based on the first open-source file set, perform deletion processing on the first data set to obtain a third data set, generate a program abstract syntax tree and corresponding sub-syntax trees based on the third data set, generate a second feature set through the calculated minimum hash signatures of each file and the sub-syntax trees, and perform third feature matching between the second feature set and a preset reference database to obtain a second open-source file set; Step S4: Based on the second open-source file set, perform deletion processing on the third data set to obtain a fourth data set, construct a control flow diagram based on the abstract syntax tree and the fourth data set based on the updated syntax tree, perform feature extraction through the control flow diagram to obtain a third feature set, and perform fourth feature matching between the third feature set and a preset reference database to obtain a third open-source file set; Step S5: Merge the first open-source file set, the second open-source file set, and the second open-source file set to obtain the total set of open-source components in the software to be identified.
[0020] In this embodiment, feature extraction is performed on the second data set to obtain a first feature set. File directory path data and file extension data are obtained from the first data set. The file directory path data is arranged in the order from the file root directory to the sub-directory to obtain a path string. The path string is normalized to obtain a first directory path data set. The first data set is traversed to identify file extension names to obtain a first file extension name data set. The first directory path data set and the first file extension name data set are merged to obtain a first feature set.
[0021] In this embodiment, the operation logic of the first feature matching is: Compare the first file extension name data set with the file extension list in the preset reference database one by one to determine all files with the same extension to obtain a first matching file; Extract the directory path data corresponding to the first matching file from the first directory path data set, compare it with the directory path data list in the preset reference database one by one to determine all files with the same path structure to obtain a first open-source file set; The calculation logic for normalizing the path string is as follows: unify the path string delimiter of different operating systems to " / ", remove redundant delimiters, convert the relative path of the path string to an absolute path, lowercase the constituent letters of the path string, and remove invalid space characters in the path string; The preset reference database includes an open-source database on the network side and a local database.
[0022] First, the first feature matching of file extensions such as.dll and.so is beneficial to narrow the range of the second feature matching of the application path structure, which can reduce the computational complexity.
[0023] In this embodiment, the first open-source file set data is deleted from the first data set to obtain a third data set. The abstract syntax tree corresponding to each file is parsed based on the code in the third data set. The preorder traversal of each abstract syntax tree is performed through depth-first search to generate a corresponding sub-syntax tree. The minimum hash signature of each file in the third data set is calculated based on the sub-syntax tree and the minimum hash algorithm. A second feature set is generated based on the minimum hash signature of each file and the sub-syntax tree. The second open-source file set is obtained through the third feature matching according to the second feature set and the preset reference database; Among them, in the depth-first search, the parent node is visited first through the preorder traversal, and then the child nodes are recursively visited to complete the traversal of the abstract syntax tree of each file In this embodiment, the second feature set is composed of the syntax feature vectors of each file in the third data set. The composition of the syntax feature vector of each file includes: the minimum hash signature, the number of sub-syntax trees, and the total number of nodes in the sub-syntax tree; The calculation logic of the third feature matching is as follows: extract each syntax feature vector in the second feature set, and perform threshold screening based on the syntax feature vector set of the preset reference database. Its calculation expression is:
[0024] Among them, SFR represents the result of syntax feature threshold screening, i represents the index of each file in the third data set, represents the index of each file in the preset reference database, represents the minimum hash signature of each file in the third data set, represents the set of minimum hash signatures in the preset reference database, represents the number of sub-syntax trees generated by each file in the third data set, represents the set of the number of sub-syntax trees corresponding to the files in the preset reference database, represents the total number of nodes of the sub-syntax trees generated by each file in the third data set, represents the set of the total number of nodes of the sub-syntax trees corresponding to the files in the preset reference database, represents the minimum hash deviation threshold, represents the sub-syntax tree deviation threshold, represents the sub-syntax tree node deviation threshold.
[0025] In this embodiment, the fourth data set is obtained by deleting the third data set based on the second open-source file set, the updated syntax tree is obtained by deleting the abstract syntax tree based on the second open-source file set, the control flow chart is constructed based on the updated syntax tree, the third feature set is obtained by feature extraction through the control flow chart, and the third open-source file set is obtained by performing the fourth feature matching based on the third feature set and the preset reference database; The calculation logic for converting the updated syntax tree into a control flow chart is as follows: traversing and identifying the control syntax structure based on the updated syntax tree, determining the execution order and conditional branches between each syntax tree node through the control syntax structure, performing code segmentation based on the execution order and conditional branches between each syntax tree node to obtain code segments with independent control structures, establishing control flow nodes based on each code segment with an independent control structure, dividing the sequence of consecutive non-branching updated syntax tree nodes into basic blocks, establishing corresponding control flow directed edges based on each node type and basic block, and constructing a control flow chart based on the obtained control flow nodes, basic blocks, and control flow directed edges.
[0026] Among them, the control flow nodes include conditional judgment nodes (such as if and switch nodes), loop nodes (such as for and while nodes), and function call nodes.
[0027] In this embodiment, the third feature set is obtained by feature extraction through the control flow chart, and the operation logic of its feature extraction is as follows: obtaining the program instruction set corresponding to each node based on the mapping relationship between the nodes in the control flow chart and the program instructions, dividing each program instruction in the program instruction set into corresponding program instruction segments through the fixed window sliding algorithm, calculating the segment hash value through the CityHash algorithm, splicing the segment hash values to obtain the program instruction feature value, and obtaining the third feature set based on the program instruction feature values corresponding to each program instruction.
[0028] In this embodiment, the calculation logic of the four matches is as follows: calculating the edit text distance of the third feature based on the third feature set and the preset reference database, calculating the instruction similarity based on the edit text distance, and when the instruction similarity is greater than the similarity threshold, determining that the corresponding file in the third feature set matches the preset reference database to obtain the third open-source file set, and its calculation expression is:
[0029] Among them, SPC represents the instruction similarity, represents the program instruction feature value in the third feature set, Represents a set of program instruction feature values in a preset reference database. Represents the edit text distance between each program instruction in the third feature set and the program instructions in the preset reference database. k represents the index of each program instruction in the third feature set, and l represents the index of the program instruction in the preset reference database. Represents the total length. Represents the maximum value function.
[0030] An electronic device includes a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, an identification software component analysis method as described above is run.
[0031] A storage medium stores a computer program. The computer program, when executed by a processor, runs an identification software component analysis method as described above.
[0032] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, abbreviated as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, abbreviated as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, abbreviated as EPROM), programmable read-only memory (Programmable Red-Only Memory, abbreviated as PROM), read-only memory (Read-Only Memory, abbreviated as ROM), magnetic memory, flash memory, a magnetic disk, or an optical disc. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, and the instruction device implements the functions specified in one Figure 1 One process or multiple processes and / or Figure 1 One block or multiple blocks.
[0033] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
Claims
1. A method for identifying software component analysis, characterized in that, Including: Step S1: Obtain all files in the software to be recognized to get a first data set; Step S2: Extract meta-file data to get a second data set, perform feature extraction based on the second data set to get a first feature set, and perform first feature matching between the first feature set and a preset reference database to get a first open-source file set; Step S3: Perform deletion processing on the first data set based on the first open-source file set to get a third data set, generate a program abstract syntax tree and corresponding sub-syntax trees based on the third data set, generate a second feature set through the calculated minimum hash signatures of each file and the sub-syntax trees, and perform third feature matching between the second feature set and the preset reference database to get a second open-source file set; Step S4: Perform deletion processing on the third data set based on the second open-source file set to get a fourth data set, obtain an updated syntax tree and construct a control flow chart based on the abstract syntax tree and the fourth data set, perform feature extraction through the control flow chart to get a third feature set, and perform fourth feature matching between the third feature set and the preset reference database to get a third open-source file set; Step S5: Merge based on the first open-source file set, the second open-source file set, and the third open-source file set to get the total open-source component set in the software to be recognized.
2. The method for identifying software component analysis according to claim 1, characterized in that: Perform feature extraction on the second data set to get a first feature set, obtain file directory path data and file extension data from the first data set, arrange the file directory path data in the order from the file root directory to the sub-directory to get a path string, perform normalization processing on the path string to get a first directory path data set, traverse the first data set to identify file extensions to get a first file extension data set, and perform merging processing on the first directory path data set and the first file extension data set to get a first feature set.
3. The method for identifying software component analysis according to claim 2, wherein: The operation logic of the first feature matching is: Compare the first file extension data set with the file extension list in the preset reference database one by one to determine all files with the same extension to get a first matching file; Extract the directory path data corresponding to the first matching file from the first directory path data set, compare it with the directory path data list in the preset reference database one by one to determine all files with the same path structure to get a first open-source file set; The calculation logic for performing normalization processing on the path string is: Unify the path string delimiter symbols of different operating systems and remove redundant delimiters, convert the relative path of the path string to an absolute path, lowercase the constituent letters of the path string, and remove invalid space characters in the path string; The preset reference database includes an online open-source database and a local database.
4. The method for identifying software component analysis according to claim 1, wherein: Delete the first open-source file set data from the first data set to obtain a third data set. Parse the code in the third data set to obtain the abstract syntax tree corresponding to each file. Perform a pre-order traversal on each abstract syntax tree through depth-first search to generate a corresponding sub-syntax tree. Calculate the minimum hash signature of each file in the third data set based on the sub-syntax tree and the minhash algorithm. Generate a second feature set based on the minimum hash signature of each file and the sub-syntax tree. Perform a third feature matching between the second feature set and a preset reference database to obtain a second open-source file set.
5. The method for identifying software component analysis according to claim 4, characterized in that: The second feature set is composed of the syntax feature vectors of each file in the third data set. The composition of the syntax feature vector of each file includes: the minimum hash signature, the number of sub-syntax trees, and the total number of nodes in the sub-syntax tree. The calculation logic of the third feature matching is: extract each syntax feature vector in the second feature set, and perform threshold screening based on the syntax feature vector set of the preset reference database. Its calculation expression is: ; Among them, SFR represents the screening result of the syntactic feature threshold, and i represents the index of each file in the third dataset. represents the index of each file in the preset reference database. represents the minimum hash signature of each file in the third dataset. represents the set of minimum hash signatures in the preset reference database. represents the number of sub-syntax trees generated by each file in the third dataset. represents the set of the number of sub-syntax trees corresponding to the preset reference database files. represents the total number of nodes of the sub-syntax trees generated by each file in the third dataset. represents the set of the total number of nodes of the sub-syntax trees corresponding to the preset reference database files. represents the minimum hash deviation threshold. represents the sub-syntax tree deviation threshold. represents the sub-syntax tree node deviation threshold.
6. The method for identifying software component analysis according to claim 1, characterized in that: Perform a deletion process on the third data set based on the second open-source file set to obtain a fourth data set. Perform a deletion process on the abstract syntax tree based on the second open-source file set to obtain an updated syntax tree. Construct a control flow diagram based on the updated syntax tree. Extract features through the control flow diagram to obtain a third feature set. Perform a fourth feature matching between the third feature set and a preset reference database to obtain a third open-source file set. The calculation logic for converting the updated syntax tree into a control flow diagram is: traverse the updated syntax tree to identify control syntax structures, determine the execution order and conditional branches between the syntax tree nodes through the control syntax structures, perform code segmentation based on the execution order and conditional branches between the syntax tree nodes to obtain code segments with independent control structures, establish control flow nodes based on each code segment with an independent control structure, divide the continuous sequence of non-branching updated syntax tree nodes into basic blocks, establish corresponding control flow directed edges based on each node type and basic block, and construct a control flow diagram based on the obtained control flow nodes, basic blocks, and control flow directed edges.
7. The method for identifying software component analysis according to claim 6, wherein: Extract features through the control flow diagram to obtain a third feature set. The operation logic of its feature extraction is: obtain the program instruction set corresponding to each node based on the mapping relationship between the nodes and program instructions in the control flow diagram, divide each program instruction in the program instruction set through the fixed window sliding algorithm to obtain corresponding program instruction segments, calculate the segment hash value through the CityHash algorithm, splice the segment hash values to obtain the program instruction feature value, and obtain the third feature set based on the program instruction feature values corresponding to each program instruction.
8. The method for identifying software component analysis according to claim 7, characterized in that: The calculation logic of the four matches is: calculate the edit text distance of the third feature based on the third feature set and the preset reference database, calculate the instruction similarity based on the edit text distance, and when the instruction similarity is greater than the similarity threshold, determine that the corresponding file of the data in the third feature set matches the preset reference database to obtain the third open-source file set. Its calculation expression is: ; Among them, SPC represents the instruction similarity, represents the program instruction feature value in the third feature set, represents the set of program instruction feature values in the preset reference database, represents the edit text distance between each program instruction in the third feature set and the program instructions in the preset reference database. k represents the index of each program instruction in the third feature set, and l represents the index of the program instruction in the preset reference database, represents the total length, represents the maximum value function.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of a method for identifying software component analysis as described in any one of claims 1 to 8.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of a method for identifying software component analysis as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Software component analysis method and related equipment
CN118035069A
Method and device for detecting software plagiarism
CN103729580A
Code detection method, system and equipment based on open source component and storage medium
CN114201406A
Hierarchical multi-feature code homologous analysis method and system
CN114968351A
Open source license detection method, electronic device, medium and computer program product
CN117931675A