Software dependency relationship detection method and related equipment

The function-level features of the software being tested are extracted and matched through the software development platform to identify the dependencies between the software, solving the problem of difficult to analyze software dependencies in traditional methods, and achieving efficient vulnerability detection and repair.

CN118916070APending Publication Date: 2024-11-08HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310854376.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-08
Filing Date
2023-07-12
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The prior art is difficult to accurately analyze the dependencies between software, especially after the software is compiled from the source code to a binary program, traditional software component analysis methods are difficult to identify the dependencies between other software referenced by the software or the software and the software. Dependencies between other software referenced.

Method used

The software development platform obtains the code files of the tested software, extracts function-level features to form a feature set, and matches it with the software feature library, determines the dependency between the tested software and multiple referenced software, and uses function call information to identify and Indirect dependencies to enable vulnerability detection and repair.

Benefits of technology

Improve the accuracy of software dependency detection, can identify the dependency between the tested software and the referenced software after compilation, reduce vulnerability detection costs, and enhance the analysis ability to affect security vulnerabilities of open source software or closed source software. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916070A_ABST
    Figure CN118916070A_ABST
Patent Text Reader

Abstract

The invention provides a software dependency relationship detection method, the method is executed by a software development platform, and the method comprises the following steps: obtaining a code file of tested software; according to the code file of the tested software, a feature set of the tested software is extracted, and the feature set of the tested software comprises features of at least one function level; matching the feature set of the tested software with a feature set of software in a software feature library, and determining multiple pieces of reference software of the tested software from the software feature library; and according to the function call information in the feature set of the multiple pieces of reference software, determining the dependency relationship between the tested software and the multiple pieces of reference software or the dependency relationship among the multiple pieces of reference software. According to the method, omission of the reference software of the tested software can be avoided, the software dependency relationship is effectively identified, the detection accuracy of the software dependency relationship is improved, and vulnerability detection or repair for the tested software is realized.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office of China on May 8, 2023, with application number 202310511362.6 and invention name “A Dependency Detection Method and Related Equipment”, the entire contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of software development and testing technology, and in particular to a software dependency detection method, a software development platform, a computing device cluster, a computer-readable storage medium, and a computer program product. Background Art

[0003] During the software development process, developers can usually reference other software, such as one or more open source software, to assist in the development of the current software, thereby avoiding duplicate development of some functions and reducing development workload. For a software, the software referenced by the software can also reference other software. Therefore, the following types of dependencies can exist between software: direct dependency and indirect dependency (also called transitive dependency). For example, the currently developed software A calls the function of software B, then the dependency between software A and software B is a direct dependency. If the operation of software B depends on software C (for example, software B calls software C), then the dependency between software A and software C is an indirect dependency.

[0004] Since there is a clear call relationship tree in the source code engineering of the software, the dependencies between software are easy to identify at the source code stage. For example, by checking the function names of the introduced open source software and the called open source software, as well as the file and code line locations of the source code in the source code, the dependencies between software can be obtained. In the process of compiling the source code into executable software (such as a binary program), the above dependencies will be lost or blurred. Traditional software composition analysis (SCA) can usually only analyze other software referenced by the software, and it is difficult to analyze the dependencies between other software referenced by the software or the dependencies between the software and other software referenced by the software (such as direct dependencies or indirect dependencies).

[0005] How to detect the dependency between other software referenced by software or the dependency between software and other referenced software has become a key issue in the industry. Summary of the invention

[0006] The present application provides a software dependency detection method, which can effectively identify the dependency between the tested software and the referenced software or the dependency between multiple referenced software by matching the characteristics of function granularity, thereby improving the detection accuracy of software dependency. The present application also provides a software development platform, a computing device cluster, a computer-readable storage medium, and a computer program product corresponding to the method.

[0007] In a first aspect, the present application provides a software dependency detection method, which can be performed by a software development platform. The software development platform is used to detect dependencies between software. The software development platform can be a software system, which can be an independent software system, such as a software system deployed locally or on the cloud, and the software system can also be integrated into other systems, such as integrated into other software systems in the form of plug-ins. The software system can be deployed in a computing device cluster, and the computing device cluster executes the program code of the software system, thereby executing the software dependency detection method of the present application. The software development platform can also be a hardware system with a software dependency detection function, and when the hardware system is running, the software dependency detection method of the present application is executed.

[0008] Specifically, the software development platform obtains the code file of the software under test, which is a compiled code file, and extracts the feature set of the software under test based on the code file of the software under test, wherein the feature set of the software under test includes at least one function-level feature. Then the software development platform matches the feature set of the software under test with the feature set of the software in the software feature library, and determines multiple reference software of the software under test from the software feature library, wherein the software feature library includes a feature set of open source software or closed source software with source code access rights, and the feature set of the software in the software feature library includes at least one function-level feature. According to the function call information in the feature sets of the multiple reference software, the dependency relationship between the software under test and the multiple reference software or the dependency relationship between the multiple reference software is determined, and the dependency relationship can be used for vulnerability detection or repair of the software under test.

[0009] This method extracts features of the software under test with functions as the smallest granularity to form a feature set, and uses the feature set of the software under test to comprehensively match the feature set of the software in the software feature library to avoid missing the referenced software of the software under test. Then, through the function call information in the feature set of the referenced software, the dependency relationship between the software under test and the referenced software or the dependency relationship between multiple referenced software is effectively identified, thereby improving the detection accuracy of software dependency relationships and realizing vulnerability detection or repair for the software under test.

[0010] In some possible implementations, the software development platform can detect or repair vulnerabilities in the software under test based on the dependency relationship between the software under test and multiple referenced software or the dependency relationship between multiple referenced software. In this method, the detected software dependency relationship can be used to implement vulnerability detection or vulnerability repair, thereby avoiding security threats caused by the software under test referencing open source software.

[0011] In some possible implementations, the multiple reference software may include a first reference software and a second reference software. When the function call information of the first reference software indicates that the first function of the first reference software calls the second function of the second reference software, the software development platform may determine that the dependency relationship between the first reference software and the second reference software includes a direct dependency.

[0012] In this method, the software development platform can clearly and accurately determine the direct dependency between referenced software through function-level features (such as function call information), thereby improving the efficiency of software dependency detection.

[0013] In some possible implementations, the multiple reference software may further include a third reference software. When the function call information of the second reference software indicates that the second function of the second reference software calls the third function of the third reference software, the software development platform may determine that the dependency relationship between the first reference software and the third reference software includes an indirect dependency.

[0014] In this method, the software development platform clarifies the indirect dependencies between referenced software through function-level features (such as function call information), avoids omissions or errors in the indirect dependencies between referenced software, and realizes accurate software dependency detection.

[0015] In some possible implementations, multiple reference software may include a fourth reference software. When the feature set of the software under test includes the feature of a fourth function of the fourth reference software, and the feature of the fourth function of the fourth reference software is not hit in the function call information of reference software other than the fourth reference software in the multiple reference software, the software development platform can determine that the dependency relationship between the software under test and the fourth reference software includes a direct dependency.

[0016] In this method, the software development platform can accurately identify the direct dependency between the software under test and the referenced software through function-level features (such as function call information), thereby making up for the defect that the direct dependency between the software under test and the referenced software cannot be obtained in the method of querying the open source software dependency database.

[0017] In some possible implementations, the feature set of the software in the software feature library may include the name of the function, the string features referenced by the function, and the function call information, wherein the string features referenced by the function include strings that are not related to compilation. In this method, the feature set is generated using the function call relationship, which has a finer granularity and can improve the accuracy of subsequent dependency detection, providing the ability to analyze the impact of security vulnerabilities in open source software or closed source software with source code access rights.

[0018] In some possible implementations, the feature set of the software in the software feature library can be extracted from the source code file of the open source software or the source code file of the closed source software with source code access permission. This method realizes efficient feature extraction without setting up a source code construction environment and without the source code being successfully compiled. For open source software or closed source software with source code access permission, especially new versions of open source software, feature extraction can be completed in a relatively short time.

[0019] In some possible implementations, the feature set of the software in the software feature library can be stored in a tree structure. This method improves query efficiency and achieves efficient feature matching by storing the feature set of the software in the software feature library in a tree structure.

[0020] In some possible implementations, the software development platform can disassemble the code file of the software under test to obtain an assembly code file, and then extract the function name, function address or string features of the function reference from the assembly code file to obtain a feature set of the software under test.

[0021] In this method, by disassembling the code files of the software under test, features that are insensitive to compilation options are extracted, thereby generating a feature set of function granularity of the software under test and improving the accuracy of subsequent feature matching.

[0022] In some possible implementations, the software development platform can be deployed entirely on the cloud, for example, providing software dependency detection services to users in the form of software as a service, and users can implement software dependency detection through a dependency detection page or an application programming interface.

[0023] In some possible implementations, the software development platform can be partially deployed locally and the other part deployed on the cloud, thereby providing users with software dependency detection services on the basis of reducing user deployment costs.

[0024] In a second aspect, the present application provides a software development platform, the software development platform is used to detect dependencies between software, and the software development platform includes:

[0025] A code file acquisition module is used to acquire a code file of the software under test, wherein the code file of the software under test is a compiled code file;

[0026] A tested software feature extraction module, used to extract a feature set of the tested software according to a code file of the tested software, wherein the feature set of the tested software includes at least one function-level feature;

[0027] A feature matching module is used to match the feature set of the software under test with the feature set of software in a software feature library, and determine multiple reference software of the software under test from the software feature library, wherein the software feature library includes a feature set of open source software or closed source software with source code access rights, and the feature set of software in the software feature library includes at least one function-level feature;

[0028] A dependency determination module is used to determine the dependency between the software under test and the multiple reference software or the dependency between the multiple reference software according to the function call information in the feature set of the multiple reference software, and the dependency is used for vulnerability detection or repair of the software under test.

[0029] In some possible implementations, the software development platform further includes:

[0030] The vulnerability detection and repair module is used to detect or repair the vulnerabilities of the software under test according to the dependency relationship between the software under test and the multiple reference software or the dependency relationship between the multiple reference software.

[0031] In some possible implementations, the plurality of reference software includes a first reference software and a second reference software, and the dependency determination module is specifically configured to:

[0032] When the function call information of the first reference software indicates that the first function of the first reference software calls the second function of the second reference software, it is determined that the dependency relationship between the first reference software and the second reference software includes direct dependency.

[0033] In some possible implementations, the plurality of reference software further includes a third reference software, and the dependency determination module is further configured to:

[0034] When the function call information of the second reference software indicates that the second function of the second reference software calls the third function of the third reference software, it is determined that the dependency relationship between the first reference software and the third reference software includes an indirect dependency.

[0035] In some possible implementations, the plurality of reference software includes fourth reference software, and the dependency determination module is specifically configured to:

[0036] When the feature set of the software under test includes the feature of the fourth function of the fourth reference software, and the feature of the fourth function of the fourth reference software is not hit in the function call information of the reference software other than the fourth reference software among the multiple reference software, it is determined that the dependency relationship between the software under test and the fourth reference software includes direct dependency.

[0037] In some possible implementations, the feature set of the software in the software feature library includes the name of the function, the string features referenced by the function, and the function call information, and the string features referenced by the function include strings that are not related to compilation.

[0038] In some possible implementations, the software development platform further includes:

[0039] The software feature library construction module is used to extract features from the source code files of the open source software or the source code files of the closed source software with source code access rights.

[0040] In some possible implementations, the feature set of the software in the software feature library is stored in a tree structure.

[0041] In some possible implementations, the tested software feature extraction module is specifically used to:

[0042] Disassembling the code file of the software under test to obtain an assembly code file;

[0043] The name of the function, the address of the function or the character string feature of the function reference is extracted from the assembly code file to obtain the feature set of the software under test.

[0044] In a third aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory. The at least one processor and the at least one memory communicate with each other. The at least one processor is used to execute instructions stored in the at least one memory, so that the computing device or the computing device cluster executes the software dependency detection method as described in the first aspect or any implementation of the first aspect.

[0045] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions instruct a computing device or a computing device cluster to execute the software dependency detection method described in the first aspect or any one of the implementations of the first aspect.

[0046] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device or a computing device cluster, enables the computing device or the computing device cluster to execute the software dependency detection method described in the first aspect or any one of the implementations of the first aspect.

[0047] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.

[0049] Figure 1 A schematic diagram of the architecture of a software development platform provided in an embodiment of the present application;

[0050] Figure 2 A flowchart of a software dependency detection method provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of a compilation process provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of a process for extracting a feature set of tested software provided in an embodiment of the present application;

[0053] Figure 5 A schematic diagram of a process for extracting a feature set of software in a software feature library provided in an embodiment of the present application;

[0054] Figure 6 A schematic diagram of a feature set of software in a software feature library provided in an embodiment of the present application;

[0055] Figure 7 A schematic diagram of the dependency relationship between software in a software feature library provided in an embodiment of the present application;

[0056] Figure 8 A schematic diagram of a feature set stored in a tree structure provided in an embodiment of the present application;

[0057] 9A to 9D A schematic diagram of a software dependency detection method provided in an embodiment of the present application;

[0058] Fig.10 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0059] Fig.11 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0060] Fig.12 A schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;

[0061] Fig.13 A schematic diagram of the structure of another computer cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0063] First, some technical terms involved in the embodiments of the present application are introduced.

[0064] Software composition analysis (SCA) is a technique for identifying and analyzing the components of software. SCA analyzes the source code, modules, frameworks, and libraries used by software developers to identify other software referenced by the software (such as open source software) and the dependencies between software.

[0065] Open source software (OSS) refers to software with open source code. Users can use, modify, and distribute the source code used by open source software through specific types of licenses. However, open source software security development is not standardized enough, there are many security vulnerabilities, and there are certain risks in using open source software. Therefore, by identifying the open source software referenced by the software through SCA, known security vulnerabilities and potential security risks in the open source software can be checked to avoid security threats caused by the software referencing open source software.

[0066] The following types of dependencies can exist between software: direct dependency and indirect dependency. Direct dependency means that software A calls the function of software B. In this case, software A directly depends on software B, and there is a direct dependency relationship between software A and software B. Indirect dependency, also known as transitive dependency, means that software A calls the function of software B, and the function of software B calls the function of software C. In this case, software A indirectly depends on software C, and there is an indirect dependency or transitive dependency relationship between software A and software C.

[0067] In the source code engineering of software, there is usually a clear call relationship tree. In the source code stage, the dependencies between software can be identified through the call relationship tree. For example, through the call relationship tree, you can view the referenced open source software, the functions of the called open source software, and the files and code lines where the source code is located, so as to obtain the dependencies between software.

[0068] Considering that in the process of compiling source code into executable software (such as binary programs), the clear dependency relationships in the call relationship tree will be lost or blurred, traditional SCA can usually only analyze other software referenced by the software, and it is difficult to analyze the dependency relationships between other software referenced by the software or the dependency relationships between the software and other software referenced by the software. For example, through SCA analysis, it can be obtained that other software referenced by software A includes open source software B, open source software C and open source software D, but it is difficult to further analyze the dependency relationship between open source software B, open source software C and open source software D, or the dependency relationship between software A and open source software B, open source software C or open source software D.

[0069] For the above-mentioned dependencies between open source software, analysts usually obtain them by querying the dependency data of open source software. Specifically, analysts can build an open source software dependency database, for example, by manually or using data collection tools to collect the dependency information of open source software (such as the information that open source software depends on other open source software) from the website of the open source software or other channels, and record the dependency information of the open source software in the open source software dependency database, thereby realizing the construction of the open source software dependency database. Then, according to the open source software referenced by the analyzed software, query in the open source software dependency database to obtain the dependency information of the open source software referenced by the software, thereby obtaining the dependency relationship between the open source software.

[0070] However, the above method of querying the open source software dependency database is not very accurate. For software written in compiled languages ​​such as C or C++, due to partial compilation, that is, not all functions of the component are used in the compilation project, only part of the functional code of the component is compiled into a binary program. When querying the open source software dependency database, the open source software referenced by the code that is not compiled into a binary program will also be queried, resulting in false positives and reducing the accuracy of software component analysis. In addition, the above method is also unable to obtain the dependency relationship between the software and other software referenced by the software, making it difficult to meet user needs.

[0071] In view of this, the present application provides a method for detecting software dependencies. The method can be executed by a software development platform, which has software development and testing functions and can be used to detect dependencies between software. The software development platform can be a software system, which can be an independent software system, such as a software system deployed locally or on the cloud, and the software system can also be integrated into other systems, such as integrated into other software systems in the form of plug-ins. The software system can be deployed in a computing device cluster, and the computing device cluster executes the program code of the software system, thereby executing the software dependency detection method of the present application. The software development platform can also be a hardware system with a software dependency detection function, and when the hardware system is running, the software dependency detection method of the present application is executed.

[0072] Specifically, the software development platform obtains the code file of the software under test, which is a compiled code file, and extracts the feature set of the software under test based on the code file of the software under test, wherein the feature set of the software under test includes at least one function-level feature. Then the software development platform matches the feature set of the software under test with the feature set of the software in the software feature library, and determines multiple reference software of the software under test from the software feature library, wherein the software feature library includes a feature set of open source software or closed source software with source code access rights, and the feature set of the software in the software feature library includes at least one function-level feature. According to the function call information in the feature sets of the multiple reference software, the dependency relationship between the software under test and the multiple reference software or the dependency relationship between the multiple reference software is determined, and the dependency relationship can be used for vulnerability detection or repair of the software under test.

[0073] This method extracts features of the software under test with functions as the smallest granularity to form a feature set, and uses the feature set of the software under test to comprehensively match the feature set of the software in the software feature library to avoid missing the referenced software of the software under test. Then, through the function call information in the feature set of the referenced software, the dependency relationship between the software under test and the referenced software or the dependency relationship between multiple referenced software is effectively identified, thereby improving the detection accuracy of software dependency relationships and realizing vulnerability detection or repair for the software under test.

[0074] In addition, this method does not require the construction of an additional open source software dependency database. It can detect the dependency between the software under test and the referenced software or the dependency between multiple referenced software by only using the software feature library, which greatly reduces the detection cost and facilitates the use of software dependencies to assist users in vulnerability location and repair strategy formulation.

[0075] In order to make the technical solution of the present application clearer and easier to understand, the architecture of the software development platform of the present application is introduced below with reference to the accompanying drawings.

[0076] See also Figure 1 The architecture diagram of the software development platform shown in the figure, the software development platform 10 can be used for code development, code testing and detection of dependencies between software. The software development platform 10 includes a code file acquisition module 102, a tested software feature extraction module 104, a feature matching module 106 and a dependency determination module 108.

[0077] The code file acquisition module 102 is used to acquire the code file of the software under test, wherein the code file of the software under test is a compiled code file, in other words, the code file of the software under test may be a binary file.

[0078] The tested software feature extraction module 104 is used to extract a feature set of the tested software according to the code file of the tested software. The feature set of the tested software includes at least one function-level feature. In some embodiments, the tested software feature extraction module 104 can obtain an assembly code file by disassembling the code file of the tested software, thereby extracting the name of the function, the address of the function, or the string feature of the function reference from the assembly code file to obtain the feature set of the tested software.

[0079] The feature matching module 106 is used to match the feature set of the software under test with the feature set of the software in the software feature library, and determine multiple reference software of the software under test from the software feature library. Among them, the feature set of the software in the software feature library includes at least one function-level feature. The software feature library may include a feature set of open source software or closed source software with source code access rights. In some embodiments, the feature matching module 106 may perform similarity calculation on the feature set of the software under test and the feature set of the software in the software feature library, and determine multiple reference software of the software under test based on the similarity calculation result.

[0080] The dependency determination module 108 is used to determine the dependency between the software under test and the multiple reference software or the dependency between the multiple reference software according to the function call information in the feature sets of the multiple reference software. The dependency may include direct dependency and indirect dependency, and the feature set of the reference software includes function call information, which can be used to indicate the functions of other software called by the functions of the reference software. In this way, the dependency determination module 108 can determine the dependency according to the function call relationship, and realize the detection of software dependency, and the software dependency can be used for vulnerability detection or repair of the software under test.

[0081] In some possible implementations, the software development platform 10 may further include a software feature library construction module 110. The software feature library construction module 110 is used to extract the function-level features of the software in the software feature library, generate a feature set of the software in the software feature library, and thus construct the software feature library. In some embodiments, the software feature library construction module 110 may analyze the macro-related code and the macro-irrelevant code in the uncompiled source code of the software in the software feature library, respectively, extract the function-level features of the software in the software feature library, and then generate a feature set of the software in the software feature library based on the function call information. In this way, efficient software feature extraction is achieved and the software feature library is enriched without the need to build a compilation environment.

[0082] In some possible implementations, the software development platform 10 may further include a vulnerability detection and repair module 112. The vulnerability detection and repair module 112 is used to detect or repair vulnerabilities of the software under test based on the dependency relationship between the software under test and multiple reference software or the dependency relationship between multiple reference software, thereby ensuring the security of the software under test.

[0083] The software development platform 10 of the embodiment of the present application can be a software system, which can be deployed locally and provided to users in the form of locally deployed software. The software system can also be deployed on the cloud and provided to users in the form of cloud services. In some embodiments, all modules in the software development platform 10 can be deployed on the cloud, and the software development platform 10 provides software dependency detection services to users in the form of software as a service (SaaS). For example, a user can upload the software under test through the dependency detection page, and view the dependencies of the software under test through the dependency detection page. For another example, a user can upload the software under test by calling an application programming interface (API), and obtain the dependencies of the software under test obtained by calling the API. In other embodiments, some modules in the software development platform 10 can be deployed locally, and another part of the modules are deployed on the cloud. For example, the code file acquisition module 102 and the tested software feature extraction module 104 are deployed locally as an agent, and the feature matching module 106 and the dependency determination module 108 are deployed on the cloud. The user can upload the tested software through the agent, and the agent sends the extracted feature set of the tested software to the cloud, and performs feature set matching and dependency determination on the cloud. In this way, the detection of software dependencies is achieved on the basis of reducing the user's deployment cost.

[0084] Based on the above-mentioned software development platform 10 provided in the embodiment of the present application, the embodiment of the present application further provides a software dependency detection method, which will be described in detail below in conjunction with the accompanying drawings.

[0085] See also Figure 2 The flowchart of the software dependency detection method shown in FIG. 1 includes the following steps:

[0086] S202: The software development platform 10 obtains the code file of the software under test.

[0087] Among them, the code file of the tested software is a compiled code file. In other words, in the embodiment of the present application, the detection object of the software dependency is a compiled code file. Usually, the code file of the tested software can be loaded and executed by the operating system, so the code file of the tested software can also be called the executable file or binary file of the tested software. Under different operating systems, the code file of the tested software can have different presentation methods. For example, under the windows operating system, the code file of the tested software can be an exe file, a sys file or a com file.

[0088] The code file of the software under test can be obtained by compiling. Compiling refers to the process of using a compiler to convert source code written in a programming language into a code file that can be recognized by a computing device. Figure 3 A schematic diagram of a compilation process is shown. First, the preprocessor preprocesses the source code according to the conditional compilation switch (also called precompilation), replaces the macro name in the source code with a string, and implements macro expansion. Then the compiler compiles the preprocessed source code to generate an assembly file (also called an assembly code file). At this stage, an abstract syntax tree (AST) for representing the grammatical structure of the source code can also be generated. Then the assembler can assemble the assembly file to generate a target file. Finally, the linker can link the target file according to the linking requirements to obtain the code file.

[0089] S204: The software development platform 10 extracts a feature set of the software under test according to the code file of the software under test.

[0090] Unlike the method of performing similarity matching using source code fragment features when performing dependency detection on the source code of the software under test, in the embodiment of the present application, when performing dependency detection on the code files of the software under test, subsequent feature matching and dependency detection can be achieved by extracting features that are insensitive to compilation options (i.e., features that do not differ much before and after compilation).

[0091] In specific implementation, the software development platform 10 may extract the function-level features of the software under test by disassembling the code files of the software under test, thereby obtaining a feature set of the software under test.

[0092] See also Figure 4 The process of extracting the feature set of the software under test may include the following steps:

[0093] S2042: The software development platform 10 analyzes the code files of the software under test to obtain analysis results.

[0094] Specifically, the software development platform 10 can analyze the code files of the tested software from multiple dimensions to obtain analysis results from multiple dimensions. For example, the software development platform 10 can analyze from the dimension of the operating system to obtain the file format analysis results of the code file (such as PE, ELF or MACH-O). For another example, the software development platform 10 can analyze from the dimension of the central processing unit (CPU) architecture to obtain the architecture analysis results of the code file (such as X86 or ARM). For another example, the software development platform 10 can analyze from the dimension of the library to obtain the library analysis results of the code file (such as a static library or a dynamic library).

[0095] S2044: The software development platform 10 disassembles the code file of the tested software according to the analysis result to obtain an assembly code file.

[0096] Disassembly refers to the process of converting a code file into an assembly code file. Specifically, the software development platform 10 can select a corresponding disassembler according to the analysis results of multiple dimensions, and then use the disassembler to disassemble the code file of the tested code to obtain an assembly code file.

[0097] S2046: The software development platform 10 extracts the name of the function, the address of the function or the character string feature of the function reference from the assembly code file.

[0098] Among them, the name of the function is used to identify the function. In some embodiments, the software development platform 10 can extract the name of the function from the function definition of the assembly code file. The address of the function is used to determine the location of the function in the storage unit. In some embodiments, the software development platform 10 can extract the address of the function through the function pointer. The string feature of the function reference refers to the string that appears in the function body of the function. In order to match the accuracy, it usually includes strings that are not related to compilation, for example, it can include constant strings, such as the constant strings printed in the output function (printf).

[0099] S2048: The software development platform 10 obtains a feature set of the software under test according to the extracted function name, function address or string feature of the function reference.

[0100] The software development platform 10 can organize the extracted function names, function addresses or string features of function references based on the characteristics of the feature family, generate at least one function-level feature of the software under test, and thus obtain a feature set of the software under test.

[0101] Among them, a feature family refers to a group of features consisting of multiple features that appear at the same time. In the embodiment of the present application, if a feature of a function in the tested software appears, other features of the function in the tested software will definitely appear at the same time. Therefore, a function-level feature of the tested software can be called a feature family. In this way, the software development platform 10 can extract a feature set of the function granularity of the tested software.

[0102] S206: The software development platform 10 matches the feature set of the software under test with the feature set of the software in the software feature library, and determines a plurality of reference software of the software under test from the software feature library.

[0103] Among them, the software feature library (also called software feature fingerprint library) may include a feature set of open source software or closed source software with source code access rights (for example, self-developed software), and the feature set of the software in the software feature library may include at least one function-level feature.

[0104] In specific implementation, the software development platform 10 can calculate the similarity between the function-level features of the software under test and the function-level features of the software in the software feature library, and determine the software to which the function-level features that meet the similarity conditions, such as the similarity being greater than a set similarity threshold, belong as the reference software of the software under test.

[0105] S208: The software development platform 10 determines the dependency relationship between the software under test and the multiple reference software or the dependency relationship between the multiple reference software according to the function call information in the feature sets of the multiple reference software.

[0106] The function call information may be used to indicate the functions of other software called by the functions of the referenced software. For example, the function call information may indicate that the function F1 of the referenced software A calls the function F2 of the referenced software B.

[0107] In specific implementation, the software development platform 10 can query the function call information of the reference software in the software feature library, and determine the dependency relationship between the tested software and multiple reference software or the dependency relationship between multiple reference software according to the reference software appearing in the function call information of the reference software.

[0108] The dependency relationship between the multiple reference software may include direct dependency and indirect dependency. In some embodiments, the multiple reference software may include a first reference software and a second reference software. When the function call information of the first reference software indicates that the first function of the first reference software calls the second function of the second reference software, the software development platform 10 may determine that the dependency relationship between the first reference software and the second reference software includes a direct dependency, that is, the first reference software directly depends on the second reference software.

[0109] In other embodiments, in addition to the first reference software and the second reference software, the multiple reference software may also include a third reference software. When the function call information of the second reference software indicates that the second function of the second reference software calls the third function of the third reference software, the software development platform 10 may determine that the dependency relationship between the first reference software and the third reference software includes an indirect dependency, that is, the first reference software indirectly depends on the third reference software.

[0110] Further, the software development platform 10 can determine the dependency relationship between the software under test and the multiple reference software according to the function-level features in the feature set of the software under test and the function call information of the reference software. Specifically, the multiple reference software may include a fourth reference software. When the feature set of the software under test includes the features of the fourth function of the fourth reference software, and the features of the fourth function of the fourth reference software are not hit in the function call information of the reference software other than the fourth reference software in the multiple reference software, the software development platform 10 can determine that the dependency relationship between the software under test and the fourth reference software includes a direct dependency, thereby realizing the detection of software dependency relationships.

[0111] The above dependency relationship can be used for vulnerability detection or repair of the software under test. Specifically, the software development platform 10 can detect or repair vulnerabilities of the software under test based on the dependency relationship between the software under test and multiple reference software or the dependency relationship between multiple reference software, thereby preventing the security threat to the software under test caused by vulnerabilities existing in open source software or closed source software with source code access rights.

[0112] Based on the above description, the embodiment of the present application extracts features of the software under test with functions as the smallest granularity to form a feature set, and uses the feature set of the software under test to comprehensively match the feature set of the software in the software feature library to avoid missing the referenced software of the software under test, and then uses the function call information in the feature set of the referenced software to effectively identify the dependency relationship between the software under test and the referenced software or the dependency relationship between multiple referenced software, thereby improving the detection accuracy of software dependency relationships.

[0113] In the software dependency detection method of the present application, the software development platform 10 determines the dependency by matching the feature set of the software under test with the feature set of the software in the software feature library. The construction process of the software feature library will be described below.

[0114] The software feature library includes a feature set of open source software or closed source software with source code access rights. The software development platform 10 can first perform feature extraction on the software in the software feature library. Generally, the software development platform 10 can extract features from the code files of the software in the software feature library, or the software development platform 10 can also compile the source code of the software in the software feature library into a code file and then extract features, or the software development platform 10 can also extract features using an AST generated by the source code of the software in the software feature library.

[0115] However, for the method of extracting features from the code files of the software in the software feature library or compiling the source code of the software in the software feature library into a code file and then extracting features, due to the conditional compilation switch and on-demand linking characteristics in the compilation process, the feature information in the compiled code file is less than the source code, and the extracted features may be missed. In addition, the method of extracting features from the code files of the software in the software feature library requires the source code construction process, and it is time-consuming and labor-intensive to build the source code construction environment and compile the code files. For the method of extracting features using the AST generated by the source code of the software in the software feature library, since the AST generated by the source code needs to be used, it means that the source code needs to be compiled successfully, and the time cost of feature extraction is high.

[0116] Based on this, an embodiment of the present application provides a method for extracting a feature set of open source software or closed source software with source code access rights, which can perform feature extraction efficiently, comprehensively and accurately.

[0117] See also Figure 5 A flow chart of extracting a feature set of software in a software feature library is shown, and the software development platform 10 can extract features from the source code files of open source software or closed source software with source code access rights. Specifically, the software development platform 10 can perform lexical (token) analysis on the source code files of the open source software or closed source software with source code access rights, identify the words of the source code, and thus divide the source code files into macro-related codes and macro-irrelevant codes. Further, the software development platform 10 can divide the macro-related codes into macro-on-related codes and macro-off-related codes according to the macro-on condition and the macro-off condition, perform feature extraction on the macro-on-related codes, the macro-off-related codes, and the macro-irrelevant codes, and generate the feature set of the open source software or the closed source software with source code access rights according to the function call relationship in the source code. In this way, the software feature library is constructed using the feature set of the open source software or the closed source software with source code access rights.

[0118] In an embodiment of the present application, the feature set of the software in the software feature library may include the name of the function, the string feature of the function reference, and the function call information. Furthermore, the feature set of the software in the software feature library may also include file features, such as the source code file name of open source software or closed source software with source code access rights.

[0119] This method can achieve efficient feature extraction without setting up a source code build environment or successfully compiling the source code. For open source software or closed source software with source code access rights, especially new versions of open source software, feature extraction can be completed within a shorter service level agreement (SLA) time. In addition, this method uses function call relationships to generate feature sets with fine granularity, which can improve the accuracy of subsequent dependency detection and provide the ability to analyze the impact of security vulnerabilities in open source software or closed source software with source code access rights.

[0120] The following will illustrate the process of generating a feature set from the extracted features with reference to a specific example.

[0121] See also Figure 6 A schematic diagram of a feature set of software in a software feature library is shown. A certain software in the software feature library consists of three source code files. Source code file 1 includes function F1 and function F2, source code file 2 includes function F3 and function F4, and source code file 3 includes function F5 and function F6.

[0122] Furthermore, each function includes string features of function references, for example, features of function F1 of source code file 1 include strings 1 to 3, features of function F2 of source code file 1 include strings 1, 4 and 5, and features of function F3 of source code file 2 are called.

[0123] Considering that in the code file of a certain software in the software feature library, if there is a function F1 of source code file 1, then the features of function F1 of source code file 1 include strings 1 to 3 that must appear in the code file in groups. Similarly, if there is a function F2 of source code file 1, then the features of function F2 of source code file 1 include strings 1, 4 and 5, and the features of function F3 of source code file 2 must appear in the code file in groups. Therefore, the string features referenced by each function can constitute a feature family (i.e., a function-level feature). In this way, the features extracted from the software can be used to generate the function-level features of the software, thereby generating a feature set.

[0124] Similarly, for software that references other software in the software signature library, the above method can be used to obtain the dependency relationship between the software in the software signature library. Figure 7 The diagram shows a dependency relationship between software in a software feature library, where software A references software B and software C, and software A references software C and software D in software B.

[0125] Respectively Figure 7 After feature extraction of software A, software B, software C and software D, the feature sets of software A, software B, software C and software D can be used to generate a feature set of software A. The feature set can be stored in a tree structure. Therefore, the feature set can also be called a feature fingerprint information tree.

[0126] See also Figure 8 The schematic diagram of a feature set stored in a tree structure is shown. By analyzing the feature set of software A, the dependency relationship between the software in the software feature library can be obtained, that is, the dependency relationship between software A and software B includes direct dependency, the dependency relationship between software A and software C includes direct dependency, and the dependency relationship between software A and software D includes indirect dependency. In this way, by using a tree structure to store the feature set of software in the software feature library, the dependency relationship between the software in the software feature library can be clearly expressed, effectively improving the query efficiency.

[0127] For ease of understanding, the software dependency detection method of the present application is introduced below with reference to a specific example.

[0128] See also 9A to 9D The schematic diagram of a software dependency detection method shown in FIG. 1 shows that the software under test references software A, software C, and software E. Meanwhile, software A references software B, software C, and software D.

[0129] The software development platform 10 can extract the feature set of the software under test based on the code file of the software under test. Fig.9A As shown, the feature set of the tested software may include features of software A, features of software B, features of software C, features of software D, features of software E and features of the tested software itself.

[0130] Furthermore, the software development platform 10 can perform feature matching. Fig. 9B As shown, the software feature library includes feature sets of multiple open source software or closed source software with source code access rights. By matching the feature set of the software under test with the feature set of the software in the software feature library, it can be determined that the reference software of the software under test includes software A, software B, software C, software D and software E.

[0131] Next, the software development platform 10 can determine the software dependency. The software development platform 10 can query the feature set of the referenced software in the software feature library according to the multiple referenced software of the tested software, and determine the dependency between the multiple referenced software. Fig. 9C As shown, the function call information of software A in the software feature library (see Figure 8 The feature set of software A shown in the figure includes: function F1 of software A calls function F1 of software B and function F2 of software B, function F2 of software B further calls function F1 of software C and function F2 of software C, function F2 of software A calls function F3 of software B and function F4 of software B, function F4 of software B further calls function F1 of software D and function F2 of software D, function F3 of software A calls function F3 of software C and function F4 of software C.

[0132] Based on the function call information of software A, it can be known that the dependency relationship between software A and software B includes direct dependency, the dependency relationship between software A and software C includes direct dependency, the dependency relationship between software B and software C includes direct dependency, the dependency relationship between software B and software D includes direct dependency, and the dependency relationship between software A and software D includes indirect dependency. In this way, through the function call information of software A, combined with the referenced software of the software under test, the dependency relationship between multiple referenced software can be determined.

[0133] The software development platform 10 can also determine the dependency relationship between the software under test and multiple reference software. Fig.9D As shown, the feature set of the tested software includes the feature of function F5 of software C, but the feature of function F5 of software C is not hit in the function call information of other referenced software of the tested software. Therefore, it can be determined that the tested software and software C have a direct dependency relationship.

[0134] Based on the software dependency detection method of the aforementioned embodiment, the present application embodiment further provides a software development platform 10 as described above. The software development platform 10 is introduced below in conjunction with the accompanying drawings.

[0135] See also Figure 1 The software development platform 10 is a schematic diagram of a structure of the software development platform 10 shown in FIG. 1 , and the software development platform 10 is used to detect dependencies between software. The software development platform 10 includes:

[0136] The code file acquisition module 102 is used to acquire the code file of the software under test, wherein the code file of the software under test is a compiled code file;

[0137] The tested software feature extraction module 104 is used to extract a feature set of the tested software according to the code file of the tested software, wherein the feature set of the tested software includes at least one function-level feature;

[0138] A feature matching module 106 is used to match the feature set of the software under test with the feature set of the software in the software feature library, and determine multiple reference software of the software under test from the software feature library, wherein the software feature library includes the feature set of open source software or closed source software with source code access rights, and the feature set of the software in the software feature library includes at least one function-level feature;

[0139] The dependency determination module 108 is used to determine the dependency between the software under test and the multiple reference software or the dependency between the multiple reference software according to the function call information in the feature sets of the multiple reference software, wherein the dependency is used for vulnerability detection or repair of the software under test.

[0140] The above-mentioned code file acquisition module 102, the tested software feature extraction module 104, the feature matching module 106 and the dependency determination module 108 can be implemented by hardware modules or by software modules. Among them, the code file acquisition module 102, the tested software feature extraction module 104, the feature matching module 106 and the dependency determination module 108 can be implemented by a computing device or a computing engine on a computing device. Below, the code file acquisition module 102 is taken as an example for description.

[0141] When implemented by software, the code file acquisition module 102 may be an application or application module running on a computing device or a computing device cluster, such as a computing engine. The application may be provided to users in the form of a virtualized service. Virtualized services may include virtual machine (VM) services, bare metal server (BMS) services, and container services. Among them, the VM service may be a service that uses virtualization technology to virtualize a virtual machine (VM) resource pool on multiple physical hosts (such as computing devices) to provide users with VMs on demand for use. The BMS service is a service that virtualizes a BMS resource pool on multiple physical hosts to provide users with BMS on demand for use. The container service is a service that virtualizes a container resource pool on multiple physical hosts to provide users with containers on demand for use. VM is a simulated virtual computer, that is, a logical computer. BMS is a high-performance computing service that can be elastically scalable, and its computing performance is no different from that of a traditional physical machine, and it has the characteristics of secure physical isolation. Containers are a kernel virtualization technology that can provide lightweight virtualization to achieve the purpose of isolating user space, processes, and resources. It should be understood that the VM service, BMS service and container service in the above-mentioned virtualization services are merely specific examples. In actual applications, the virtualization service may also be other lightweight or heavyweight virtualization services, which are not specifically limited here.

[0142] When implemented by hardware, the code file acquisition module 102 may include at least one computing device, such as a server, etc. Alternatively, the code file acquisition module 102 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0143] In some possible implementations, the software development platform 10 further includes:

[0144] The vulnerability detection and repair module 112 is used to detect or repair the vulnerabilities of the software under test according to the dependency relationship between the software under test and multiple reference software or the dependency relationship between multiple reference software.

[0145] In some possible implementations, the plurality of reference software includes a first reference software and a second reference software, and the dependency determination module 108 is specifically configured to:

[0146] When the function call information of the first reference software indicates that the first function of the first reference software calls the second function of the second reference software, it is determined that the dependency relationship between the first reference software and the second reference software includes a direct dependency.

[0147] In some possible implementations, the plurality of reference software further includes a third reference software, and the dependency determination module 108 is further configured to:

[0148] When the function call information of the second reference software indicates that the second function of the second reference software calls the third function of the third reference software, it is determined that the dependency relationship between the first reference software and the third reference software includes an indirect dependency.

[0149] In some possible implementations, the plurality of reference software includes a fourth reference software, and the dependency determination module 108 is specifically configured to:

[0150] When the feature set of the software under test includes the feature of the fourth function of the fourth reference software, and the feature of the fourth function of the fourth reference software is not hit in the function call information of the reference software other than the fourth reference software among the multiple reference software, it is determined that the dependency relationship between the software under test and the fourth reference software includes direct dependency.

[0151] In some possible implementations, the feature set of the software in the software feature library includes the name of the function, the string features referenced by the function, and the function call information, and the string features referenced by the function include strings that are not related to compilation.

[0152] In some possible implementations, the software development platform 10 further includes:

[0153] The software feature library construction module 110 is used to extract features from source code files of open source software or source code files of closed source software with source code access rights.

[0154] In some possible implementations, the feature set of the software in the software feature library is stored in a tree structure.

[0155] In some possible implementations, the tested software feature extraction module 104 is specifically used to:

[0156] Disassemble the code file of the software under test to obtain an assembly code file;

[0157] The name of the function, the address of the function or the string feature of the function reference is extracted from the assembly code file to obtain the feature set of the software under test.

[0158] The present application also provides a computing device 1000. Fig.10 As shown, computing device 1000 includes: bus 1002, processor 1004, memory 1006 and communication interface 1008. Processor 1004, memory 1006 and communication interface 1008 communicate through bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 1000.

[0159] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 The bus 1002 may include a path for transmitting information between various components of the computing device 1000 (eg, the memory 1006, the processor 1004, and the communication interface 1008).

[0160] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0161] The memory 1006 may include a volatile memory, such as a random access memory (RAM). The memory 1006 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD). The memory 1006 stores executable program code, and the processor 1004 executes the executable program code to implement the aforementioned software dependency detection method. Specifically, the memory 1006 stores instructions for the software development platform 10 to execute the software dependency detection method.

[0162] The communication interface 1008 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1000 and other devices or a communication network.

[0163] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0164] like Fig.11 As shown, the computing device cluster includes at least one computing device 1000. The memory 1006 in one or more computing devices 1000 in the computing device cluster may store the same software development platform 10 for executing instructions of the software dependency detection method.

[0165] In some possible implementations, one or more computing devices 1000 in the computing device cluster may also be used to execute some instructions of the software development platform 10 for executing the software dependency detection method. In other words, a combination of one or more computing devices 1000 may jointly execute the instructions of the software development platform 10 for executing the software dependency detection method.

[0166] It should be noted that the memory 1006 in different computing devices 1000 in the computing device cluster can store different instructions for executing part of the functions of the software development platform 10 .

[0167] Fig.12 A possible implementation is shown. Fig.12 As shown, two computing devices 1000A and 1000B are connected via a communication interface 1008. The memory in computing device 1000A stores instructions for executing the functions of code file acquisition module 102, tested software feature extraction module 104, and software feature library construction module 110. The memory in computing device 1000B stores instructions for executing the functions of feature matching module 106, dependency determination module 108, and vulnerability detection and repair module 112. In other words, the memories 1006 of computing devices 1000A and 1000B jointly store instructions for the software development platform 10 to execute the software dependency detection method.

[0168] Fig.12 The connection mode between the computing device clusters shown can be considered that the software development platform provided by the present application needs to extract features and match features. Therefore, it is considered that the functions implemented by the code file acquisition module 102, the tested software feature extraction module 104, and the software feature library construction module 110 are handed over to the computing device 1000A for execution, and the functions implemented by the feature matching module 106, the dependency determination module 108, and the vulnerability detection and repair module 112 are executed by the computing device 1000B.

[0169] It should be understood that Fig.12 The functions of the computing device 1000A shown in FIG. 1000A may also be completed by multiple computing devices 1000. Similarly, the functions of the computing device 1000B may also be completed by multiple computing devices 1000.

[0170] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.13 A possible implementation is shown. Fig.13 As shown, two computing devices 1000C and 1000D are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 1006 in the computing device 1000C stores instructions for executing the functions of the code file acquisition module 102, the tested software feature extraction module 104, and the software feature library construction module 110. At the same time, the memory 706 in the computing device 1000D stores instructions for executing the functions of the feature matching module 106, the dependency determination module 108, and the vulnerability detection and repair module 112.

[0171] Fig.13 The connection mode between the computing device clusters shown can be considered to be that the software development platform provided by the present application needs to extract features and match features. Therefore, it is considered that the functions implemented by the code file acquisition module 102, the tested software feature extraction module 104, and the software feature library construction module 110 are handed over to the computing device 1000C for execution, and the functions implemented by the feature matching module 106, the dependency determination module 108 and the vulnerability detection and repair module 112 are executed by the computing device 1000D. It should be understood that Fig.13 The functions of the computing device 1000C shown in FIG. 1000A may also be completed by multiple computing devices 1000. Similarly, the functions of the computing device 1000D may also be completed by multiple computing devices 1000.

[0172] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned software development platform for executing the software dependency detection method.

[0173] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the above-mentioned software dependency detection method.

[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A software dependency detection method, characterized in that: Applied to a software development platform, the software development platform is used to detect dependencies between software, the method comprises: Obtaining a code file of the software under test, wherein the code file of the software under test is a compiled code file; Extracting a feature set of the software under test according to the code file of the software under test, wherein the feature set of the software under test includes at least one function-level feature; Matching the feature set of the software under test with the feature set of software in a software feature library, and determining multiple reference software of the software under test from the software feature library, wherein the software feature library includes feature sets of open source software or closed source software with source code access rights, and the feature set of software in the software feature library includes at least one function-level feature; Determine the dependency relationship between the software under test and the multiple reference software or the dependency relationship between the multiple reference software according to the function call information in the feature sets of the multiple reference software, and the dependency relationship is used for vulnerability detection or repair of the software under test.

2. The method according to claim 1, characterized in that The method further comprises: According to the dependency relationship between the software under test and the plurality of reference software or the dependency relationship between the plurality of reference software, the vulnerability of the software under test is detected or repaired.

3. The method according to claim 1 or 2, characterized in that: The plurality of reference software includes a first reference software and a second reference software, and determining the dependency relationship between the plurality of reference software according to the function call information in the feature set of the plurality of reference software includes: When the function call information of the first reference software indicates that the first function of the first reference software calls the second function of the second reference software, it is determined that the dependency relationship between the first reference software and the second reference software includes direct dependency.

4. The method according to claim 3, characterized in that The plurality of reference software further includes a third reference software, and the method further includes: When the function call information of the second reference software indicates that the second function of the second reference software calls the third function of the third reference software, it is determined that the dependency relationship between the first reference software and the third reference software includes an indirect dependency.

5. The method according to any one of claims 1 to 4, characterized in that: The plurality of reference software includes fourth reference software, and determining the dependency relationship between the software under test and the plurality of reference software according to function call information in the feature set of the plurality of reference software includes: When the feature set of the software under test includes the feature of the fourth function of the fourth reference software, and the feature of the fourth function of the fourth reference software is not hit in the function call information of the reference software other than the fourth reference software among the multiple reference software, it is determined that the dependency relationship between the software under test and the fourth reference software includes direct dependency.

6. The method according to any one of claims 1 to 5, characterized in that: The feature set of the software in the software feature library includes the name of the function, the string feature referenced by the function and the function call information, and the string feature referenced by the function includes a string that is not related to compilation.

7. The method according to any one of claims 1 to 6, characterized in that: The feature set of the software in the software feature library is extracted from the source code file of the open source software or the source code file of the closed source software with source code access permission.

8. The method according to any one of claims 1 to 7, characterized in that: The feature set of the software in the software feature library is stored in a tree structure.

9. The method according to any one of claims 1 to 8, characterized in that: The step of extracting a feature set of the software under test according to the code file of the software under test comprises: Disassembling the code file of the software under test to obtain an assembly code file; The name of the function, the address of the function or the character string feature of the function reference is extracted from the assembly code file to obtain the feature set of the software under test.

10. A software development platform, the software development platform is used to detect dependencies between software, the software development platform comprising: A code file acquisition module is used to acquire a code file of the software under test, wherein the code file of the software under test is a compiled code file; A tested software feature extraction module, used to extract a feature set of the tested software according to a code file of the tested software, wherein the feature set of the tested software includes at least one function-level feature; A feature matching module is used to match the feature set of the software under test with the feature set of software in a software feature library, and determine multiple reference software of the software under test from the software feature library, wherein the software feature library includes a feature set of open source software or closed source software with source code access rights, and the feature set of software in the software feature library includes at least one function-level feature; A dependency determination module is used to determine the dependency between the software under test and the multiple reference software or the dependency between the multiple reference software according to the function call information in the feature set of the multiple reference software, and the dependency is used for vulnerability detection or repair of the software under test.

11. The software development platform according to claim 11, characterized in that: The software development platform also includes: The vulnerability detection and repair module is used to detect or repair the vulnerabilities of the software under test according to the dependency relationship between the software under test and the multiple reference software or the dependency relationship between the multiple reference software.

12. The software development platform according to claim 10 or 11, characterized in that: The plurality of reference software includes a first reference software and a second reference software, and the dependency determination module is specifically used for: When the function call information of the first reference software indicates that the first function of the first reference software calls the second function of the second reference software, it is determined that the dependency relationship between the first reference software and the second reference software includes direct dependency.

13. The software development platform according to claim 12, characterized in that: The plurality of reference software further includes a third reference software, and the dependency determination module is further configured to: When the function call information of the second reference software indicates that the second function of the second reference software calls the third function of the third reference software, it is determined that the dependency relationship between the first reference software and the third reference software includes an indirect dependency.

14. The software development platform according to any one of claims 10 to 13, characterized in that: The plurality of reference software includes a fourth reference software, and the dependency determination module is specifically used for: When the feature set of the software under test includes the feature of the fourth function of the fourth reference software, and the feature of the fourth function of the fourth reference software is not hit in the function call information of the reference software other than the fourth reference software among the multiple reference software, it is determined that the dependency relationship between the software under test and the fourth reference software includes direct dependency.

15. The software development platform according to any one of claims 10 to 14, characterized in that: The feature set of the software in the software feature library includes the name of the function, the string feature referenced by the function and the function call information, and the string feature referenced by the function includes a string that is not related to compilation.

16. The software development platform according to any one of claims 10 to 15, characterized in that: The software development platform also includes: The software feature library construction module is used to extract features from the source code files of the open source software or the source code files of the closed source software with source code access rights.

17. The software development platform according to any one of claims 10 to 16, characterized in that: The feature set of the software in the software feature library is stored in a tree structure.

18. The software development platform according to any one of claims 10 to 17, characterized in that: The tested software feature extraction module is specifically used for: Disassembling the code file of the software under test to obtain an assembly code file; The name of the function, the address of the function or the character string feature of the function reference is extracted from the assembly code file to obtain the feature set of the software under test.

19. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method as described in any one of claims 1 to 9.

20. A computer-readable storage medium, characterized in that: The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 9.

21. A computer program product, characterized in that The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Software supply chain security tracing method based on Hash algorithm and block chain technology

    CN119203136A