Software detection method, system, computer storage medium, and electronic device

By receiving software information, extracting metadata, and calling detection tools to detect software packages, the problems of low detection rate and low accuracy in existing technologies are solved, achieving more efficient software detection.

CN116303021BActive Publication Date: 2026-03-24INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies suffer from low software testing rates and low accuracy, especially due to insufficient testing personnel and high testing costs, making it difficult to guarantee accuracy.

Method used

By receiving software information from the server, the software package to be tested is identified, software metadata is extracted, software rules are obtained using the rule base, the testing tool is invoked to perform the test, the test results, including the risk level, are generated, and the result data package is transmitted to the server.

Benefits of technology

This improves the speed and accuracy of software detection, ensuring the reliability and completeness of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303021B_ABST
    Figure CN116303021B_ABST
Patent Text Reader

Abstract

The application discloses a kind of detection method, system, computer storage medium and electronic device of software, related to the field of financial technology, which comprises: receiving the software information of the software package to be detected exported by server, and determining the software package to be detected from software information, extracting the software metadata of the software package to be detected, wherein the software information includes the software package name of the software package to be detected;According to the software metadata, the software rules of the software package to be detected are acquired from the rule library, and whether the software package to be detected conforms to the software rules is detected by detection engine calling detection tool, to obtain detection result, wherein the content of detection result contains risk level, and risk level is used to indicate the degree of non-compliance of the software package to be detected with software rules;Software metadata, detection result is combined into detection result data package, and detection result data package is transmitted to server. Through the present application, the problem of low inspection rate and low accuracy in related art software detection is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a software testing method, system, computer storage medium, and electronic device. Background Technology

[0002] In the software development process of large enterprises, in order to ensure the normal operation of the software source code, the source code of the software is usually compiled to obtain a delivery package. The delivery package is then tested against the source code that makes up the package to determine whether it violates the relevant requirements in the technical specifications. In other words, the delivery package is compared and analyzed with the technical specifications that guide the code development, so as to ensure the quality of the software.

[0003] In related technologies, software testing is carried out by testers familiar with the technical specifications. However, due to the increasing number of technical specifications, the number of testers who meet the testing requirements is insufficient, and the testing costs are huge, resulting in low software testing rates and difficulty in ensuring accuracy.

[0004] There is currently no effective solution to the problems of low detection rate and low accuracy in software detection in related technologies. Summary of the Invention

[0005] This application provides a software testing method, system, computer storage medium, and electronic device to solve the problems of low detection rate and low accuracy in related technologies for software testing.

[0006] According to one aspect of this application, a method for detecting software is provided. The method includes: receiving software information of a software package to be detected transmitted from a server, identifying the software package to be detected based on the software information, and extracting software metadata of the software package to be detected, wherein the software information includes the package name of the software package to be detected; obtaining software rules for the software package to be detected from a rule base based on the software metadata, and calling a detection tool through a detection engine to detect whether the software package to be detected conforms to the software rules, obtaining a detection result, wherein the content of the detection result includes a risk level, the risk level indicating the degree to which the software package to be detected does not conform to the software rules; combining the software metadata and the detection result into a detection result data packet, and transmitting the detection result data packet to the server.

[0007] Optionally, obtaining the software rules for the software package to be tested from the rule base based on the software metadata includes: inputting the software package to be tested into a preset application system, receiving the number of software rules that the software package to be tested needs to meet returned by the preset application system, wherein the preset application system is used to query the number of software rules that the software package to be tested needs to meet; obtaining the software package type in the software metadata, and filtering out the software rules applicable to the software package to be tested from the rule base based on the software package type and the number of software rules that the software package to be tested needs to meet.

[0008] Optionally, the software rules for the software package to be tested are obtained from the rule base based on the software metadata, and the detection engine calls the detection tool to detect whether the software package to be tested conforms to the software rules, obtaining the detection result including: determining multiple first software rules that the software entities in the software package to be tested need to satisfy from the software rules of the software package to be tested, and determining a detection tool for detecting the software entity based on the content of each first software rule; calling the detection tool through the detection engine to detect whether the software entity conforms to the first software rules, obtaining a first detection result; obtaining code base information from the software metadata, and filtering out the source code of the compiled software entity from the code base based on the code base information; determining multiple second software rules that the source code needs to satisfy from the software rules of the software package to be tested, and determining a detection tool for detecting the source code based on the content of each second software rule; calling the detection tool through the detection engine to detect whether the source code of the software entity conforms to the second software rules, obtaining a second detection result.

[0009] Optionally, the detection engine calls the detection tools to detect whether the software entity conforms to the first software rule, and obtains the first detection result by: using each detection tool to detect whether the software entity conforms to the matching first software rule, and obtaining multiple first sub-detection results; determining the number of rules that the software entity does not conform to the first software rule based on the multiple first sub-detection results, and determining the first risk level of the software entity based on the number of rules; and determining the first risk level and the first software rule that the software entity does not conform to as the first detection result.

[0010] Optionally, the detection engine calls detection tools to detect whether the source code of the software entity conforms to the second software rule, and obtains the second detection result by: using each detection tool to detect whether the source code conforms to the matching second software rule, obtaining multiple second sub-detection results, wherein each second sub-detection result contains the path of the code segment that does not conform to the second software rule; determining the second risk level of the source code based on the number of rules that the source code does not conform to in the multiple second sub-detection results; and determining the second risk level, the second software rule that the source code does not conform to, and the path of the code segment that does not conform to the second software rule as the second detection result.

[0011] Optionally, before calling the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules and obtaining the detection result, the method further includes: receiving supplementary rule information fed back by the business system, wherein the business system is the system that generates the software to be detected; combining the supplementary rule information with the software rules of the software package to be detected to obtain updated software rules, wherein the detection engine calls the detection tool to detect whether the software package to be detected conforms to the updated software rules and obtains the detection result.

[0012] Optionally, the server is used to identify the risk level in the test results upon receiving them, and to issue an alarm message if the risk level is higher than a preset risk level, and to send a notification message to the target tester based on the stored tester communication information, wherein the notification message is used to indicate that the software package has a repair requirement.

[0013] According to another aspect of this application, a software detection system is provided. The system includes: a server storing software information of a software package to be detected, used to transmit the software information to a detection device and receive detection results of the software package to be detected sent by the detection device; and a detection device communicatively connected to the server, used to receive the software information transmitted from the server, determine the software package to be detected based on the software information, obtain software rules for the software package to be detected from a rule base according to the software metadata in the software package to be detected, and use a detection engine to call a detection tool to detect whether the software package to be detected conforms to the software rules, obtain detection results, combine the software metadata and detection results into a detection result data packet, and transmit the detection result data packet to the server.

[0014] Optionally, the detection system further includes: a code library, which is communicatively connected to the detection device and is used to store the source code associated with the software package to be detected; wherein, the detection device is used to obtain the source code of the software to be detected from the code library, and to call the detection tool through the detection engine to detect whether the software entities and source code of the software package to be detected conform to the software rules, and obtain the detection result.

[0015] Optionally, the detection system further includes: a preset application system, which is communicatively connected to the detection device, for receiving the software package to be detected sent by the detection device, querying the number of software rules that the software package to be detected needs to meet, and feeding back the number to the detection device; and a business system, which is communicatively connected to the detection device, for feeding back supplementary rule information, wherein the business system is the system that generates the software to be detected; wherein the detection device is used to obtain the software package type in the software metadata, obtain the software rules of the software package to be detected from the rule base according to the software package type and the number of software rules that the software package to be detected needs to meet, and is also used to receive supplementary rule information, combine the supplementary rule information and the software rules of the software package to be detected to obtain updated software rules.

[0016] According to another aspect of this application, a software detection apparatus is provided. The apparatus includes: a first receiving unit, configured to receive software information of a software package to be detected transmitted from a server, determine the software package to be detected from the software information, and extract software metadata of the software package to be detected, wherein the software information includes the package name of the software package to be detected; an obtaining unit, configured to obtain software rules for the software package to be detected from a rule base based on the software metadata, and call a detection tool through a detection engine to detect whether the software package to be detected conforms to the software rules, obtaining a detection result, wherein the content of the detection result includes a risk level, the risk level indicating the degree to which the software package to be detected does not conform to the software rules; and a first combining unit, configured to combine the software metadata and the detection result into a detection result data packet, and transmit the detection result data packet to the server.

[0017] According to another aspect of the present invention, a computer storage medium is also provided for storing a program, wherein the program, when running, controls the device where the non-volatile storage medium is located to execute a software detection method.

[0018] According to another aspect of the present invention, an electronic device is also provided, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions execute a software detection method.

[0019] This application employs the following steps: receiving software information of a software package to be tested from a server, identifying the software package based on the software information, and extracting the software metadata of the software package to be tested, wherein the software information includes the package name of the software package to be tested; obtaining software rules for the software package to be tested from a rule base based on the software metadata, and using a detection engine to call a detection tool to detect whether the software package to be tested conforms to the software rules, obtaining a detection result, wherein the content of the detection result includes a risk level, which indicates the degree to which the software package to be tested does not conform to the software rules; combining the software metadata and the detection result into a detection result data packet, and transmitting the detection result data packet to the server. This solves the problems of low detection rate and low accuracy in related technologies for software detection. By using a detection device to obtain software rules, and then using a detection engine to call a detection tool to detect the entity and source code of the software package, the speed and accuracy of software detection are improved. Attached Figure Description

[0020] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0021] Figure 1This is a schematic diagram of a software detection system provided according to an embodiment of this application;

[0022] Figure 2 This is a flowchart of a software detection method provided according to an embodiment of this application;

[0023] Figure 3 This is a schematic diagram of an optional software detection method provided according to an embodiment of this application;

[0024] Figure 4 This is a schematic diagram of a software detection device provided according to an embodiment of this application;

[0025] Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0026] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties.

[0030] According to an embodiment of this application, a software detection system is provided. Figure 1This is a schematic diagram of a software detection system provided according to an embodiment of this application, such as... Figure 1 As shown, the system includes:

[0031] Server 101 stores software information of the software package to be tested, and is used to transmit the software information to the testing device 102 and receive the testing results of the software package to be tested sent by the testing device 102.

[0032] Specifically, server 101 is communicatively connected to detection device 102. When it receives a software detection instruction, it transmits the stored software information of the software package to be detected to detection device 102. The software information refers to the software name of the software package to be detected. Detection device 102 can find the corresponding software package to be detected through the software name. The software is compiled from the source code of the software.

[0033] Furthermore, after the testing device 102 tests the software package, it generates a test result. The server 101 receives the test result and identifies relevant information in the result, such as the risk level. If the risk level is higher than the preset risk level, the tester needs to repair the software package.

[0034] The detection device 102 is communicatively connected to the server 101. It is used to receive software information transmitted from the server 101, determine the software package to be detected based on the software information, obtain the software rules of the software package to be detected from the rule base according to the software metadata in the software package to be detected, and call the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules, obtain the detection result, combine the software metadata and the detection result into a detection result data packet, and transmit the detection result data packet to the server 101.

[0035] Specifically, after receiving the software information transmitted by the server 101 connected to it, the detection device 102 identifies the software package to be detected by recognizing the software information. The software package to be detected includes software entities and software metadata. Using the software metadata in the software package, software rules that conform to the software metadata can be filtered from the rule base obtained by the technical specifications. For example, the software rule can be that passwords cannot be stored in the software.

[0036] Furthermore, the detection engine in detection device 102 obtains the detection tools corresponding to the software rules, and uses multiple detection tools to detect the software package to determine whether it conforms to the software rules, thereby obtaining the detection results. The software metadata is copied and combined with the detection results to form a detection result data packet, which is then transmitted to server 101 for subsequent repair and other processing operations.

[0037] Optionally, in the software detection system provided in this application embodiment, the detection system further includes: a code library 103, which is communicatively connected to the detection device 102 and is used to store the source code associated with the software package to be detected; wherein, the detection device 102 is used to obtain the source code of the software to be detected from the code library 103, and to call the detection tool through the detection engine to detect whether the software entity and source code of the software package to be detected conform to the software rules, and obtain the detection result.

[0038] Specifically, in this detection system, code repository 103 stores the source code for compiling the software package to be tested, and is communicatively connected to both the detection device 102 and the server 101. When the detection device 102 issues a command to retrieve the source code, code repository 103 queries the code repository 103 information in the software metadata to find the source code associated with the software package and transmits the source code to the detection device 102. After the detection device 102 obtains the source code, it uses detection tools to detect the source code, determine whether the source code conforms to the software rules, and thus obtain the detection result.

[0039] Optionally, in the software detection system provided in this application embodiment, the detection system further includes: a preset application system 104, which is communicatively connected to the detection device 102, for receiving the software package to be detected sent by the detection device 102, querying the number of software rules that the software package to be detected needs to meet, and feeding back the number to the detection device 102; and a business system 105, which is communicatively connected to the detection device 102, for feeding back rule supplement information, wherein the business system 105 is a system for generating the software to be detected; wherein the detection device 102 is used to obtain the software package type in the software metadata, obtain the software rules of the software package to be detected from the rule base according to the software package type and the number of software rules that the software package to be detected needs to meet, and is also used to receive rule supplement information, combine the rule supplement information and the software rules of the software package to be detected to obtain updated software rules.

[0040] Specifically, the preset application system 104 and the business system 105 are loaded into the detection system and establish a communication connection with the detection device 102. Upon receiving the software package to be tested from the detection device 102, the preset application system 104 runs the package to obtain the number of software rules that need to be met. For example, the package needs to meet 60% of the software rules to meet factory conditions. The business system 105 compiles the source code to obtain the software package to be tested, and after running the package, it obtains supplementary rule information.

[0041] After the quantity requirement and supplementary rule information are transmitted to the detection device 102, the detection device 102 can obtain the updated software rules more accurately using the quantity requirement, information in the software metadata, and supplementary rule information.

[0042] The software detection system provided in this application embodiment stores software information of the software package to be detected in a server 101, which is used to transmit the software information to a detection device 102 and receive the detection results of the software package to be detected sent by the detection device 102. The detection device 102 is communicatively connected to the server 101, and is used to receive the software information transmitted from the server 101, determine the software package to be detected from the software information, obtain the software rules of the software package to be detected from the rule base according to the software metadata in the software package to be detected, and call the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules, obtain the detection results, combine the software metadata and the detection results into a detection result data packet, and transmit the detection result data packet to the server 101. This solves the problems of low detection rate and low accuracy in software detection in related technologies. By using the detection device to obtain software rules and then using the detection engine to call the detection tool to detect the entity and source code of the software package, the speed and accuracy of software detection are improved.

[0043] According to an embodiment of this application, a software detection method is provided.

[0044] Figure 2 This is a flowchart of a software detection method provided according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0045] Step S202: Receive software information of the software package to be tested from the server, determine the software package to be tested based on the software information, and extract the software metadata of the software package to be tested, wherein the software information includes the package name of the software package to be tested.

[0046] Specifically, the software package refers to the product package to be delivered. After receiving the instruction from the testing software, the testing device first receives the software information of the software package transmitted by the server. Based on the software information (i.e., product information), the testing device can query the software package corresponding to the software information, i.e. the software package to be tested. The software package to be tested includes software entities and software metadata.

[0047] It should be noted that a software entity refers to a file composed of target code compiled from source code. Software metadata includes package type, application system information, and code repository information. Package type can include WAR files, JAR files, EXE files based on .NET Framework, etc.; application system information can include fixed information of the package, such as the name of the application system or package name, as well as multiple related information obtained through business systems and preset application systems; code repository information can include the code repository address of the business system and the code tag information.

[0048] Step S204: Obtain the software rules of the software package to be detected from the rule base according to the software metadata, and call the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules, and obtain the detection result. The content of the detection result includes the risk level, which is used to indicate the degree to which the software package to be detected does not conform to the software rules.

[0049] Specifically, based on the software type in the software metadata, multiple software rules in the rule base are selected from the applicable conditions. Then, a second selection is performed using the number of software rules that need to be met as queried by the preset application system. This results in multiple software rules corresponding to the software package to be tested.

[0050] Furthermore, utilizing the detection engine within the detection device, multiple detection tools are invoked based on the number of software rules, with each tool used to detect one type of software rule. After detection, the number of software rules satisfied and dissatisfied by the software package under test can be obtained. The risk level of the software package can be determined based on the number of dissatisfied software rules. The risk level and the dissatisfied software rules are then combined to form the detection result.

[0051] Step S206: Combine the software metadata and detection results into a detection result data packet, and transmit the detection result data packet to the server.

[0052] Specifically, the detection result data package is composed of software metadata and detection results obtained by the detection device. It includes software metadata information of the software package to be detected, information on non-compliant software rules, the risk level of the software package, and path information of code in the source code that does not comply with the software rules.

[0053] The software detection method provided in this application embodiment receives software information of a software package to be detected from a server, identifies the software package to be detected from the software information, extracts the software metadata of the software package to be detected, wherein the software information includes the package name of the software package to be detected; obtains the software rules of the software package to be detected from the rule base according to the software metadata, and calls the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules, thereby obtaining the detection result, wherein the content of the detection result includes a risk level, which is used to indicate the degree to which the software package to be detected does not conform to the software rules; combines the software metadata and the detection result into a detection result data packet, and transmits the detection result data packet to the server. This solves the problems of low detection rate and low accuracy in related technologies for software detection. By using a detection device to obtain software rules, and then using a detection engine to call the detection tool to detect the entity and source code of the software package, the speed and accuracy of software detection are improved.

[0054] For the selection of software rules, it is first necessary to use a preset application system to query the software package. Optionally, in the software detection method provided in this application embodiment, obtaining the software rules of the software package to be detected from the rule base according to the software metadata includes: inputting the software package to be detected into the preset application system, receiving the number of software rules that the software package to be detected needs to meet returned by the preset application system, wherein the preset application system is used to query the number of software rules that the software package to be detected needs to meet; obtaining the software package type in the software metadata, and selecting the software rules applicable to the software package to be detected from the rule base according to the software package type and the number of software rules that the software package to be detected needs to meet.

[0055] Specifically, the software package to be tested is input into a preset application system, which then runs and queries the package to determine the number of software rules the package needs to meet, i.e., the implementation level. The preset application system then transmits the obtained implementation level back to the testing device.

[0056] After receiving the implementation level information, the device uses the software package type from the acquired software metadata to filter matching software rules from a rule base connected to the detection device. This rule base consists of detection rules developed based on multiple technical specifications, and all rules are stored in the rule base before initiating a detection command. Specifically, each software rule includes applicable conditions and specific rule content. Applicable conditions can include information such as the applicable software package type and applicable implementation level. Based on the implementation level and software package type of the software package to be detected, the device iterates through the applicable conditions of all software rules to find matching conditions, thereby obtaining the software rule corresponding to those conditions.

[0057] The detection results include detection results for entities and detection results for source code. Optionally, in the software detection method provided in this application embodiment, obtaining the software rules of the software package to be detected from the rule base according to the software metadata, and calling the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules, and obtaining the detection results includes: determining multiple first software rules that the software entities in the software package to be detected need to satisfy from the software rules of the software rules of the software package to be detected, and determining a detection tool for detecting the software entity according to the content of each first software rule; calling the detection tool through the detection engine to detect whether the software entity conforms to the first software rules, and obtaining a first detection result; obtaining code library information from the software metadata, and filtering out the source code of the compiled software entity from the code library according to the code library information; determining multiple second software rules that the source code needs to satisfy from the software rules of the software package to be detected, and determining a detection tool for detecting the source code according to the content of each second software rule; calling the detection tool through the detection engine to detect whether the source code of the software entity conforms to the second software rules, and obtaining a second detection result.

[0058] Specifically, software rules refer to the rule requirements that the software package to be tested must meet, including the rule requirements that the software entities and source code must meet. Before testing, the rules need to be classified, that is, multiple software rules that the software entities must meet are selected from multiple software rules, and this is recorded as the first software rule.

[0059] There is a one-to-one correspondence between the first software rules and the detection tools used to detect entities. Each first software rule determines one detection tool for the entity, thus resulting in multiple detection tools. These multiple tools are used to detect the software entities, determining whether each entity satisfies a specific software rule. Rule content that is not satisfied is recorded and saved. The saved rule content is then combined and recorded as the first detection result.

[0060] Furthermore, for source code detection, it is necessary to first obtain the source code of the compiled entity. Specifically, the corresponding source code is obtained from the code repository through the code repository information in the software metadata. Then, based on the code repository information, software rules applicable to the source code are further selected from the pre-selected software rules and denoted as second software rules. There is a one-to-one correspondence between the second software rules and the detection tools used to detect the entity. Each second software rule can be used to determine a detection tool for detecting the source code, thus resulting in multiple detection tools. These tools are then used to detect the code, identifying software rules that the source code does not meet. These non-compliant rules are saved and combined into a second detection result.

[0061] The detection results of a software entity include a risk level and software rules that are not met. Optionally, in the software detection method provided in this application embodiment, the detection engine calls a detection tool to detect whether the software entity conforms to a first software rule, and obtains a first detection result, which includes: using each detection tool to detect whether the software entity meets the matching first software rule, obtaining multiple first sub-detection results; determining the number of rules that the software entity does not meet the first software rule based on the multiple first sub-detection results, and determining the first risk level of the software entity based on the number of rules; and determining the first risk level and the first software rule that the software entity does not meet as the first detection result.

[0062] The first detection result includes the content of the software rules that are not met and the risk level of the non-compliance. Specifically, when using detection tools to detect a software entity, each software rule that the software entity meets and each software rule that it does not meet are determined. This yields multiple first sub-detection results, which characterize whether the software entity meets a particular software rule. Based on each first sub-detection result, the first risk level of the software entity can be obtained. The risk level refers to the number of rules that the software entity needs to meet at a certain level. For example, a medium risk level means that the software entity needs to meet 60% of the software rules. Further, the obtained first risk level is combined with the non-met software rules to form the first detection result.

[0063] The source code detection result includes a risk level and the software rules that are not met. Optionally, in the software detection method provided in this application embodiment, the detection engine calls the detection tool to detect whether the source code of the software entity conforms to the second software rule, and obtains the second detection result by: using each detection tool to detect whether the source code meets the matching second software rule, obtaining multiple second sub-detection results, wherein each second sub-detection result contains the path of the code segment that does not meet the second software rule; determining the second risk level of the source code based on the number of rules that the source code does not meet according to the multiple second sub-detection results; and determining the second risk level, the second software rule that the source code does not meet, and the path of the code segment that does not meet the second software rule as the second detection result.

[0064] The second detection result can include the content of the software rules that are not met and the risk level of the non-compliance. Specifically, when the detection tool is used to detect the source code, it obtains the software rules that the source code meets and the software rules that are not met, and saves the non-metreciprocated software rules. This yields multiple second sub-detection results, which characterize whether the source code meets a certain software rule. Based on each second sub-detection result, the second risk level of the source code can be obtained. The risk level refers to the number of rules that a software entity needs to meet at a certain level. For example, a medium risk level means that the source code needs to meet 60% of the software rules. The obtained second risk level is combined with the saved non-metreciprocated software rules and recorded as the second detection result.

[0065] Determining software rules requires supplementary rule information. Optionally, in the software detection method provided in this application embodiment, before calling the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules and obtaining the detection result, the method further includes: receiving supplementary rule information fed back by the business system, wherein the business system is the system that generates the software to be detected; combining the supplementary rule information with the software rules of the software package to be detected to obtain updated software rules, wherein the detection engine calls the detection tool to detect whether the software package to be detected conforms to the updated software rules and obtains the detection result.

[0066] After filtering out the software rules, in order to select the matching software rules more accurately, it is necessary to supplement the filtering conditions. Specifically, the software package to be tested is transmitted to the business system that is connected to the testing device, so that the business system runs and queries the software package to be tested, and can obtain the supplementary rule information of the software package. The supplementary rule information can include information such as the level of the running application system. Combining the supplementary rule information with the filtered software rules can yield the updated software rules.

[0067] Furthermore, the software package is tested using detection tools to determine whether it complies with the updated software rules, and the detection results can be obtained.

[0068] Optionally, after obtaining the test results, in the software testing method provided in this application embodiment, the server is used to identify the risk level in the test results upon receiving them, and to issue an alarm message if the risk level is higher than a preset risk level, and to send a notification message to the target tester according to the stored tester communication information, wherein the notification message is used to indicate that the software package has a repair requirement.

[0069] Specifically, after obtaining the test results, the testing device transmits the results to the server. Upon receiving the results, the server identifies the risk level contained within them. If the risk level corresponding to the test result of the software package is higher than the preset risk level, the server issues an alarm message, alerting the tester to the presence of an abnormal software package. For example, if the risk level of software package A is determined to be medium after testing, but the risk level needs to be low when running the software package in the application system, then the risk level is higher than the preset risk level, and the server will issue an alarm message indicating that software package A has an abnormal risk level.

[0070] Simultaneously with issuing the alarm message, the server retrieves the stored tester contact information. Based on the tester's contact details stored in the contact information, it sends a notification to the tester, such as an email notification, text message notification, or other report query method. After receiving the notification, the tester adjusts or repairs the programs or parameters in the software package according to the test results and alarm information to ensure that its risk level meets the preset risk level.

[0071] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0072] This application also provides an optional software detection method. Figure 3 This is a schematic diagram of an optional software detection method provided according to an embodiment of this application, such as... Figure 3 As shown, the method includes:

[0073] The software package to be tested, also known as the artifact package, is transmitted from the server to the testing device. The artifact package contains two parts: the entity and metadata. The testing device's artifact package testing process includes the following steps:

[0074] First, based on the product package type in the product package metadata, the applicable rules for the product package are obtained from the rule base that communicates with the testing device. Then, based on the application system information in the metadata, supplementary rule information is obtained from the business system (i.e., the enterprise's internal system). The applicable rules and the supplementary rule information are combined to obtain the product rules.

[0075] Secondly, the detection engine calls multiple detection tools to detect the entity and determine whether the entity meets the product rules, thereby obtaining the first detection result.

[0076] The source code associated with the artifact package is obtained from the source code library that is connected to the detection device by using the code library information in the metadata. The detection engine then calls multiple detection tools to detect the source code and determine whether the source code meets the artifact rules for source code, thus obtaining the second detection result.

[0077] Combining the first and second test results yields the final test result. This result is then fed back to the server, where the testing personnel's communication information is used to notify the product's stakeholders to pay attention to the result.

[0078] If the risk level in the result is greater than the preset risk level, the stakeholders of the product package shall repair the product package according to the test results to make it meet the preset requirements.

[0079] By using a detection device to obtain product rules and using the detection engine in the device to detect the product package, it is possible to determine whether the product package meets the product rules, thereby improving the detection speed and accuracy of the products.

[0080] This application also provides a software detection device. It should be noted that the software detection device of this application can be used to execute the software detection method provided in this application. The software detection device provided in this application will be described below.

[0081] Figure 4 This is a schematic diagram of a software detection device provided according to an embodiment of this application, such as... Figure 4 As shown, the device includes: a first receiving unit 40, an acquisition unit 41, and a first combining unit 42.

[0082] The first receiving unit 40 is used to receive software information of the software package to be tested transmitted from the server, determine the software package to be tested from the software information, and extract the software metadata of the software package to be tested, wherein the software information includes the software package name of the software package to be tested.

[0083] The acquisition unit 41 retrieves the software rules of the software package to be detected from the rule base based on the software metadata, and calls the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules, and obtains the detection result. The content of the detection result includes the risk level, which is used to indicate the degree to which the software package to be detected does not conform to the software rules.

[0084] The first combining unit 42 is used to combine software metadata and detection results into a detection result data packet and transmit the detection result data packet to the server.

[0085] Optionally, in the software detection device provided in this application embodiment, the acquisition unit 41 includes: an input module, used to input the software package to be detected into a preset application system, and receive the number of software rules that the software package to be detected needs to satisfy returned by the preset application system, wherein the preset application system is used to query the number of software rules that the software package to be detected needs to satisfy; and a first acquisition module, used to acquire the software package type in the software metadata, and filter out the software rules applicable to the software package to be detected from the rule base according to the software package type and the number of software rules that the software package to be detected needs to satisfy.

[0086] Optionally, in the software detection apparatus provided in this application embodiment, the acquisition unit 41 includes: a first determining module, configured to determine multiple first software rules that software entities in the software package to be detected need to satisfy from the software rules of the software package to be detected, and determine a detection tool for detecting the software entity according to the content of each first software rule; a first calling module, configured to call the detection tool through the detection engine to detect whether the software entity conforms to the first software rules, and obtain a first detection result; a second acquisition module, configured to acquire code library information in the software metadata, and filter out the source code of the compiled software entity from the code library according to the code library information; a second determining module, configured to determine multiple second software rules that the source code needs to satisfy from the software rules of the software package to be detected, and determine a detection tool for detecting the source code according to the content of each second software rule; and a second calling module, configured to call the detection tool through the detection engine to detect whether the source code of the software entity conforms to the second software rules, and obtain a second detection result.

[0087] Optionally, in the software detection apparatus provided in this application embodiment, the acquisition unit 41 includes: a first detection module, used to detect whether the software entity meets the matching first software rule using each detection tool, and obtain multiple first sub-detection results; a third determination module, used to determine the number of rules in which the software entity does not meet the first software rule based on the multiple first sub-detection results, and determine the first risk level of the software entity based on the number of rules; and a fourth determination module, used to determine the first risk level and the first software rule in which the software entity does not meet as the first detection result.

[0088] Optionally, in the software detection apparatus provided in this application embodiment, the acquisition unit 41 includes: a second detection module, used to detect whether the source code meets the matching second software rule using each detection tool, and obtain multiple second sub-detection results, wherein each second sub-detection result contains the path of the code segment that does not meet the second software rule; a fifth determination module, used to determine the second risk level of the source code based on the number of rules that the source code does not meet the second software rule in the multiple second sub-detection results; and a sixth determination module, used to determine the second risk level, the second software rule that the source code does not meet, and the path of the code segment that does not meet the second software rule as the second detection result.

[0089] Optionally, in the software detection apparatus provided in this application embodiment, the apparatus includes: a second receiving unit, configured to receive supplementary rule information fed back by a business system before calling a detection tool through a detection engine to detect whether the software package to be detected conforms to the software rules and obtains the detection result, wherein the business system is the system that generates the software to be detected; and a second combining unit, configured to combine the supplementary rule information with the software rules of the software package to be detected to obtain updated software rules, wherein the detection engine calls a detection tool to detect whether the software package to be detected conforms to the updated software rules and obtains the detection result.

[0090] Optionally, in the software testing device provided in this application embodiment, the server is used to identify the risk level in the test result upon receiving the test result, and to issue an alarm message if the risk level is higher than a preset risk level, and to send a notification message to the target tester according to the stored tester communication information, wherein the notification message is used to indicate that the software package has a repair requirement.

[0091] The software detection device provided in this application embodiment includes a first receiving unit 40, which receives software information of a software package to be detected from a server, identifies the software package to be detected based on the software information, and extracts the software metadata of the software package to be detected. The software information includes the package name of the software package to be detected. An acquisition unit 41 acquires software rules for the software package to be detected from a rule base based on the software metadata, and uses a detection engine to call a detection tool to detect whether the software package to be detected conforms to the software rules, obtaining a detection result. The detection result includes a risk level, which indicates the degree to which the software package to be detected does not conform to the software rules. A first combining unit 42 combines the software metadata and the detection result into a detection result data packet, and transmits the detection result data packet to the server. This solves the problems of low detection rate and low accuracy in related technologies for software detection. By using the detection device to acquire software rules and then using the detection engine to call a detection tool to detect the entity and source code of the software package, the speed and accuracy of software detection are improved.

[0092] The detection device for the aforementioned software includes a processor and a memory. The first receiving unit 40, the acquisition unit 41, the first combination unit 42, etc., are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0093] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problems of low detection rate and low accuracy in software detection methods in related technologies.

[0094] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0095] This application also provides a computer storage medium for storing a program, wherein the program, when running, controls the device where the non-volatile storage medium is located to execute a software detection method.

[0096] This application also provides an electronic device. Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application, such as... Figure 5 As shown, electronic device 50 includes a processor and a memory; the memory stores computer-readable instructions, and the processor executes the computer-readable instructions, wherein the computer-readable instructions, when executed, perform a software detection method. The electronic device in this document can be a server, PC, PAD, mobile phone, etc.

[0097] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0098] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0099] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0100] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0101] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0102] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0103] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0104] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0105] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for detecting software, characterized in that, include: The system receives software information of a software package to be tested from the server, identifies the software package to be tested based on the software information, and extracts the software metadata of the software package to be tested. The software package to be tested refers to an artifact package to be delivered, and the software information includes the software package name of the software package to be tested. The software rules of the software package to be tested are obtained from the rule base according to the software metadata, and the detection engine calls the detection tool to detect whether the software package to be tested conforms to the software rules, and the detection result is obtained. The content of the detection result includes a risk level, which is used to indicate the degree to which the software package to be tested does not conform to the software rules. The process includes: retrieving software rules for the software package to be tested from a rule base based on the software metadata; and using a detection engine to call a detection tool to detect whether the software package to be tested conforms to the software rules, thereby obtaining a detection result. This process includes: determining multiple first software rules that software entities within the software package to be tested must satisfy from the software rules of the software package to be tested; determining a detection tool for detecting the software entity based on the content of each first software rule; using the detection engine to call the detection tool to detect whether the software entity conforms to the first software rules, thereby obtaining a first detection result; retrieving codebase information from the software metadata; filtering the source code for compiling the software entity from the codebase based on the codebase information; determining multiple second software rules that the source code must satisfy from the software rules of the software package to be tested; determining a detection tool for detecting the source code based on the content of each second software rule; and using the detection engine to call the detection tool to detect whether the source code of the software entity conforms to the second software rules, thereby obtaining a second detection result. The software metadata and the detection results are combined into a detection result data packet, and the detection result data packet is transmitted to the server.

2. The method according to claim 1, characterized in that, The software rules for retrieving the software package to be detected from the rule base based on the software metadata include: The software package to be tested is input into a preset application system, and the preset application system returns the number of software rules that the software package to be tested needs to satisfy. The preset application system is used to query the number of software rules that the software package to be tested needs to satisfy. Obtain the package type from the software metadata, and based on the package type and the number of software rules that the package to be detected needs to meet, filter out the software rules applicable to the package to be detected from the rule base.

3. The method according to claim 1, characterized in that, The detection engine calls the detection tool to detect whether the software entity conforms to the first software rule, and the first detection result includes: Each detection tool is used to detect whether the software entity satisfies the first matching software rule, resulting in multiple first sub-detection results; Based on the multiple first sub-detection results, determine the number of rules in which the software entity does not meet the first software rule, and determine the first risk level of the software entity based on the number of rules; The first risk level and the first software rule that the software entity does not satisfy are determined as the first detection result.

4. The method according to claim 1, characterized in that, The detection engine calls the detection tool to detect whether the source code of the software entity conforms to the second software rule, and the second detection result includes: Each detection tool is used to detect whether the source code meets the matching second software rule, resulting in multiple second sub-detection results. Each second sub-detection result contains the path of the code segment that does not meet the second software rule. Based on the number of rules in the source code that do not meet the second software rule according to the multiple second sub-detection results, the second risk level of the source code is determined according to the number of rules. The second risk level, the second software rule that the source code does not meet, and the path of the code segment that does not meet the second software rule are determined as the second detection result.

5. The method according to claim 1, characterized in that, Before calling the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules and obtaining the detection result, the method further includes: Receive supplementary rule information from the business system, wherein the business system is the system that generates the software to be tested; The supplementary information of the rules is combined with the software rules of the software package to be detected to obtain updated software rules. The detection engine calls the detection tool to detect whether the software package to be detected conforms to the updated software rules, and the detection result is obtained.

6. The method according to claim 1, characterized in that, The server is used to identify the risk level in the detection result upon receiving the detection result, and to issue an alarm message if the risk level is higher than a preset risk level, and to send a notification message to the target tester according to the stored tester communication information, wherein the notification message is used to indicate that the software package has a repair requirement.

7. A detection system, characterized in that, include: The server stores software information of the software package to be tested, and is used to transmit the software information to the testing device and receive the testing results of the software package to be tested sent by the testing device, wherein the software package to be tested refers to the product package to be delivered. The detection device is communicatively connected to the server and is used to receive software information transmitted from the server, determine the software package to be detected based on the software information, obtain the software rules of the software package to be detected from the rule base according to the software metadata in the software package to be detected, and call the detection tool through the detection engine to detect whether the software package to be detected conforms to the software rules, obtain the detection result, combine the software metadata and the detection result into a detection result data packet, and transmit the detection result data packet to the server. The process includes: retrieving software rules for the software package to be tested from a rule base based on the software metadata in the software package to be tested; and using a detection engine to call a detection tool to detect whether the software package to be tested conforms to the software rules, thereby obtaining a detection result. This process includes: determining multiple first software rules that software entities in the software package to be tested must satisfy from the software rules of the software package to be tested; determining a detection tool for detecting the software entity based on the content of each first software rule; using the detection engine to call the detection tool to detect whether the software entity conforms to the first software rules, thereby obtaining a first detection result; retrieving codebase information from the software metadata; filtering the source code for compiling the software entity from the codebase based on the codebase information; determining multiple second software rules that the source code must satisfy from the software rules of the software package to be tested; determining a detection tool for detecting the source code based on the content of each second software rule; and using the detection engine to call the detection tool to detect whether the source code of the software entity conforms to the second software rules, thereby obtaining a second detection result.

8. A computer storage medium, characterized in that, The computer storage medium is used to store a program, wherein the program, when running, controls the device where the computer storage medium is located to execute the software detection method according to any one of claims 1 to 6.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the detection method of the software according to any one of claims 1 to 6 through the computer program.

Citation Information

Patent Citations

  • Security detection method and device

    CN109753807A

  • Risk detection method and device for application program, electronic equipment and medium

    CN113254932A

  • Application detection method and device, nonvolatile storage medium and processor

    CN115730305A