Software analysis method, apparatus and device, and readable medium

By combining sample source code and sampling source code, and processing using the compiler and compilation options of the actual project, the object code is generated for analysis, and the problem in the existing technology is difficult to efficiently verify whether the software complies with the DO-178B/C level A standard, achieving efficient and trustworthy software verification.

CN119557188APending Publication Date: 2025-03-04ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311132080.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

It is difficult for the prior art to efficiently verify whether the software meets the high standards of DO-178B/C level A, especially in the field of object code verification that cannot be traced to the source code.

Method used

By obtaining the sample source code written according to the software coding standard and the sample source code extracted from the actual project source code, combining them and processing them using the compiler and compilation options corresponding to the actual project source code, the object code is generated, and then comparative analysis of the source code and the object code is performed to obtain the analysis results.

Benefits of technology

This method can efficiently verify whether the software complies with relevant software standards, improve verification efficiency, ensure the credibility and reusability of the analysis results, and avoid the deviation caused by the separation of the analysis results from the actual project.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557188A_ABST
    Figure CN119557188A_ABST
Patent Text Reader

Abstract

The invention provides a software analysis method, device and equipment and a readable medium, and belongs to the technical field of software. The method comprises the following steps: acquiring a sample source code written according to a software coding standard; obtaining a sampling source code, wherein the sampling source code is extracted from an actual project source code; combining the sample source code and the sampling source code to obtain a source code, and processing the source code based on a compiler and a compiling option corresponding to the actual project source code to obtain a target code corresponding to the source code; and analyzing the source code and the target code to obtain an analysis result. The method is used for efficiently verifying whether software meets related software standards or not.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of software technology, and in particular to a software analysis method, device, equipment and readable medium. Background Art

[0002] In the software airworthiness certification projects in the civil aviation field, authoritative aviation management agencies all recognize the software considerations in the airborne system and equipment qualification review in the industry certification standard DO-178B / C, and use it as a compliance method for airborne software airworthiness certification. The document requires that Level A software must verify additional target code that cannot be traced to the source code.

[0003] Currently, there is a lack of technology that can effectively verify whether software meets high software standards such as Level A in DO-178B / C. Summary of the invention

[0004] The present invention provides a software analysis method, device, equipment and storage medium.

[0005] A first aspect of the present disclosure provides a software analysis method, comprising:

[0006] Get sample source code written in accordance with software coding standards;

[0007] Obtaining a sample source code, where the sample source code is extracted from an actual project source code;

[0008] Combining the sample source code and the sample source code to obtain a source code, processing the source code based on a compiler and compilation options corresponding to the actual project source code to obtain a target code corresponding to the source code;

[0009] The source code and the target code are analyzed to obtain analysis results.

[0010] A second aspect of the present disclosure provides a software analysis device, comprising:

[0011] A first acquisition module is used to acquire sample source code written according to software coding standards;

[0012] A second acquisition module is used to acquire a sample source code, where the sample source code is extracted from an actual project source code;

[0013] A processing module, configured to combine the sample source code and the sample source code to obtain a source code, and to process the source code based on a compiler and compilation options corresponding to the actual project source code to obtain a target code corresponding to the source code;

[0014] The analysis module is used to analyze the source code and the target code to obtain analysis results.

[0015] A third aspect of the present disclosure provides an electronic device, including:

[0016] at least one processor;

[0017] A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to the first aspect;

[0018] At least one I / O interface is connected between the processor and the memory and is configured to implement information interaction between the processor and the memory.

[0019] A fourth aspect of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to the first aspect is implemented.

[0020] The present disclosure has the following advantages:

[0021] In the software analysis method, by writing sample source code according to the software coding standard and extracting sample source code from the actual project source code, the source code obtained by combining the sample source code and the sample source code is processed using the compiler and compilation options corresponding to the actual project source code to obtain the target code, which is used to obtain the analysis results after comparison and analysis with the source code. As a result, the software analysis combines the software coding standard and the actual project source code at the same time; through the analysis and verification of the software coding standard part, the reusability of the verification is guaranteed, and the software analysis that meets the software coding mark can reuse the analysis results of this part, and the verification efficiency is improved; in addition, the actual project source code can be strongly combined with the code that needs to be verified, which ensures credibility and avoids the deviation caused by the separation of the analysis results from the actual project. In summary, this method can efficiently verify whether the software meets the relevant software standards and ensure the verification effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flowchart of a software analysis method provided in an embodiment of the present disclosure;

[0023] Figure 2 A schematic diagram of the structure of a software analysis device provided in an embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.

[0026] As used in this disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0027] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure.As used in the present disclosure, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0028] When the terms “comprising” and / or “made of…” are used in the present disclosure, it specifies the existence of the stated features, integers, steps, operations, elements and / or components, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0029] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.

[0030] The standard CAST-12 (CAST, Guidelines for Approving Source Code to Object Code Traceability) provides two traceability analysis methods (full code analysis method and minimal subset analysis method).

[0031] In the full code analysis method, all source codes and target codes of the actual project are used as the tracking and analysis objects, and the target codes that cannot be traced to the source code are manually identified to explain their implementation functions and verify the correctness of this additional target code. There are the following defects: the tracking and analysis object is the full code of the project. When the project scale is large, the workload is huge, and the source code of the same structure causes repeated analysis, which is inefficient; when the project changes involve the source code, the credibility of the original analysis results is reduced due to the change of the analysis object, and it is often necessary to repeat the tracking and analysis activities in order to obtain the confidence of the certification agency; the analysis object of this method is the source code of the project itself, which is not conducive to the reuse of tracking and analysis results in other projects, and the reusability of the analysis conclusions is poor.

[0032] In the minimum subset analysis method, the minimum subset of the source code structure is constructed according to the software coding standard, and the sample source code is written, then compiled, and the tracking relationship between the sample source code and the target code is analyzed. In the related technology, it is proposed to formulate a general grammatical structure equivalence and inclusion relationship criterion for different types of grammatical structures of programming languages; then the detailed grammatical structure of the airborne software source code is extracted through static analysis, and the equivalence class is divided according to the equivalence and inclusion relationship criterion, and the grammatical structure equivalence and inclusion relationship list of the complete software is generated; the typical code structure is selected from the grammatical structure equivalence and inclusion relationship list of the source code, and the function where the typical code structure is located is selected as the typical code subset as the object of source code and target code comparison analysis.

[0033] In the related technologies of the minimum subset analysis method, the project source code is replaced by constructing a minimum subset to carry out subsequent tracking and analysis activities. There are the following defects: there is no unified evaluation standard for the constructed minimum subset of source code, which is more dependent on the construction rules. The minimum subset cannot fully represent the source code characteristics and complexity in the actual project, so the credibility of the analysis activities is reduced in the review of the certification agency; the target code used in the tracking analysis is generated by the minimum subset source code, and the analysis and tracking results are partially separated from the actual project, and the analysis conclusions may be biased.

[0034] In addition to the full code analysis method and the minimum subset analysis method, the relevant technology also proposes a sampling analysis method, which has the following defects: when the project change involves the source code, and the changed source code characteristics are not included in the sampled source code, the credibility of the original analysis result is reduced due to the change in the analysis object. In order to obtain the confidence of the review agency, it is often necessary to repeat the tracking and analysis activities. The analysis object of this method is the source code of the project sampling, which is not conducive to the reuse of tracking and analysis results in other projects, and the reusability of the analysis conclusions is poor.

[0035] Based on the above analysis, the embodiment of the present disclosure provides a software analysis method for tracing source code and target code to verify whether the requirements of software-related standards are met. The method can be applied to any electronic device, which can be a terminal or a server.

[0036] In the disclosed embodiment, additional target code refers to target code that cannot be directly traced to source code statements and is not directly represented at the source code level, for example, code generated by a compiler for array bounds checking.

[0037] Figure 1 The figure shows a flow chart of the software analysis method. The software analysis method flow mainly includes:

[0038] Step 101, obtaining sample source code written according to software coding standards.

[0039] In some embodiments, obtaining sample source code written in accordance with software coding standards includes: obtaining a minimum subset of software source code structures, wherein the minimum subset of software source code structures includes the minimum number of software source code structures required to meet the software coding standards adopted by the project; obtaining sample source code, wherein the sample source code is written based on each of the software source code structures included in the minimum subset of software source code structures.

[0040] In some embodiments, obtaining the total sample source code includes: obtaining a first sample source code set, the first sample source code set including sample source codes respectively written based on each software source code structure in the minimum subset of the software source code structure; obtaining a second sample source code set, the second sample source code set including sample source codes written based on a combination of at least two software source code structures in the minimum subset of the software source code structure; and integrating the first sample source code set and the second sample source code set to obtain the total sample source code.

[0041] Among them, the corresponding sample source code is written through the various software source code structures and their combinations included in the minimum subset of the software source code structure, so that the sample source code can more comprehensively reflect the software coding standards met by the project software source code, making the traceability analysis based on the sample source code more comprehensive.

[0042] Step 102: Obtain sample source code, where the sample source code is extracted from actual project source code.

[0043] In some embodiments, the ratio of the sampled source code to the actual project source code is not less than a preset ratio.

[0044] For example, the proportion of the sampled source code to the actual project source code is not less than a preset proportion of 5%.

[0045] In an exemplary embodiment, the sample source code tries to include various code structures allowed in the actual project source code, taking into account the diversity and complexity of the code structure.

[0046] Step 103: Combining the sample source code and the sample source code to obtain source code, processing the source code based on the compiler and compilation options corresponding to the actual project source code, and obtaining target code corresponding to the source code.

[0047] In some embodiments, the source code is a code collection including sample source code and sampling source code.

[0048] In some embodiments, the processing of the source code based on the compiler and compilation options corresponding to the actual project source code to obtain the target code corresponding to the source code includes: using the compiler and compilation options corresponding to the actual project source code to compile the source code to obtain a total compiled code; disassembling the compiled code corresponding to the sample source code in the total compiled code to obtain a first disassembly code; using the compiled code corresponding to the sample source code in the total compiled code as the target assembly code; using the compiler and compilation options corresponding to the actual project source code to disassemble the actual target code of the project corresponding to the sample source code to obtain a second disassembly code; obtaining the target code corresponding to the source code, the target code including the first disassembly code and at least one of the target assembly code and the second disassembly code.

[0049] That is, the target code is a code set including the first disassembly code, the target assembly code and the second disassembly code; or, the target code is a code set including the first disassembly code and the target assembly code, or, the target code is a code set including the first disassembly code and the second disassembly code.

[0050] Step 104: Analyze the source code and the target code to obtain analysis results.

[0051] In some embodiments, analyzing the source code and the target code to obtain analysis results includes:

[0052] Taking the function in the source code as the analysis unit, traversing each of the analysis units in the source code, and performing the following processing on each of the analysis units respectively: matching the target code fragment corresponding to the analysis unit from the target code, and establishing an association relationship between the analysis unit and the target code fragment if there is a target code fragment matching the analysis unit in the target code;

[0053] Based on the association relationship, obtaining additional target codes in the target code that are not matched to any of the analysis units, and obtaining analysis and verification status of the additional target codes;

[0054] The association relationship and the analysis and verification status of the additional target code are taken as the analysis results.

[0055] For functions in the source code that can be traced, an association relationship between the function and a matching target code fragment is established, and for functions in the source code that cannot be traced, they are marked so that the function can be identified as additional target code through the mark.

[0056] In some embodiments, matching the target code segment corresponding to the analysis unit from the target code, and establishing an association relationship between the analysis unit and the target code segment when there is a target code segment matching the analysis unit in the target code, includes:

[0057] In the case where the analysis unit belongs to a function in the sample source code, matching a target code fragment corresponding to the analysis unit in the first disassembly code, and in the case where a target code fragment matching the analysis unit exists in the first disassembly agent, establishing an association relationship between the analysis unit and the target code fragment;

[0058] In a case where the analysis unit belongs to the sampled source code, a target code fragment corresponding to the analysis unit is matched in at least one of the target assembly code and the second disassembly code; and in a case where a target code fragment matching the analysis unit exists in the assembly code and the second disassembly code, an association relationship between the analysis unit and the target code fragment is established.

[0059] In an exemplary embodiment, when the target code includes the target assembly code and the second disassembly code, if the analysis unit belongs to the sampled source code, the target code fragment corresponding to the analysis unit is matched in the target assembly code and the second disassembly code respectively.

[0060] In a case where the target code includes the target assembly code but does not include the second disassembly code, if the analysis unit belongs to the sampled source code, the target code segment corresponding to the analysis unit is matched in the target assembly code.

[0061] In the case that the target code includes the second disassembly code but does not include the target assembly code, if the analysis unit belongs to the sampled source code, the target code segment corresponding to the analysis unit is matched in the second disassembly code.

[0062] In an exemplary embodiment, the analysis and verification of the additional target code includes: explaining the code function; using analysis or testing verification means to prove the correctness of the code. Where the analysis verification means are used, the analysis process and analysis conclusions should be described; where the testing verification means are used, the test cases, test procedures and test results used should be described. These analysis and verification means are used to show that the code has no possibility of introducing software anomalies due to the compiler.

[0063] In an exemplary embodiment, the analysis results include the association between the analysis unit and the target code fragment, as well as the analysis verification status of the additional target code. The analysis results may be expressed in a variety of specific forms, such as a table, etc. The expression form of the analysis results is not limited here, and the contents of the analysis results are only illustrated by taking a table as an example.

[0064] Table 1 shows the function tracing table of the sample source code, which records the tracing comparison relationship between the sample source code and the target code, that is, the association relationship, and gives an annotated description of each set of comparison relationships.

[0065] Table 1

[0066]

[0067] Table 2 shows the function tracing table of the sampled source code, which records the tracing comparison relationship between the sampled source code and the target code, that is, the association relationship, and gives an annotated description of each set of comparison relationships.

[0068] Table 2

[0069]

[0070]

[0071] Table 3 shows the function tracing table of the additional target code, which records the additional target code that has not been traced to the source code, explains the functions implemented by the additional target code, and uses analysis or testing verification methods to prove its correctness. If it is proved by testing, the identification information of the test data can also be given.

[0072] Table 3

[0073]

[0074] It should be noted that Tables 1-3 are only examples, and the style of the tables is not limited thereto and can be adjusted as needed.

[0075] In the disclosed embodiment, a minimum subset of software source code structure is constructed according to the software coding standard. The analysis and tracking results of this part can be reused in other projects that also follow the software coding standard. When the source code to be changed and maintained is within the sampling range of the minimum subset of software source code structure, there is no need to re-perform the traceability analysis activities. Therefore, the source code to be changed and maintained in the project is within the code feature range corresponding to the minimum subset of the source code structure, and no additional analysis activities are required, thus ensuring the reusability of the analysis conclusions.

[0076] Moreover, by adding the actual source code of the project with diverse and complex characteristics when building the source code, it is closely integrated with the software project to be reviewed, and the analysis conclusion is closer to the actual situation of the software product, avoiding the defect that the analysis conclusion in the minimum subset analysis method may be biased.

[0077] In addition, when tracing and analyzing source code and target code, not only the regenerated target code is considered, but also the actual target code of the project corresponding to the sampled source code. The conclusions of the two can be compared horizontally to provide higher confidence and avoid the defect of low credibility in the minimum subset analysis method.

[0078] This approach can effectively control the amount of code used for tracking analysis, making the workload of analysis and verification activities controllable, and can use reasonable analysis methods to achieve significant improvement in results.

[0079] In summary, the embodiment of the present disclosure is improved based on the minimum subset analysis method, and the sample source code is written according to the project software coding standard, and the sample source code extracted from the actual project is added. In the sampling process, the diversity and complexity of the code structure are taken into account, and the source code is compiled according to the compilation options of the actual project. After the target code is generated, it is disassembled to obtain the assembly code, and the disassembled code obtained by disassembling the project target code corresponding to the sample source code is added at the same time. The assembly code, disassembled code and source code are compared and analyzed to identify and verify the correctness of the additional target code. Therefore, the evidence of the tracking and analysis activities of the source code and the target code is more credible, and a higher confidence and more effective analysis conclusion is provided to the certification agency, which meets the verification goals proposed by DO-178B / C for Class A software at the target code level, and is conducive to showing to the certification agency that the tracking and analysis activities of the forensic project meet the relevant goals of DO-178B / C, and meet the verification goals proposed by ISO-26262 ASIL-D software at the target code level.

[0080] The method provided in the embodiment of the present disclosure is mainly used in the tracing analysis of source code and target code to identify and verify additional target code, determine the reliability of tools such as compilers and linkers, and ensure effective identification of unexpected functions added due to tool reasons.

[0081] It should be noted that the method provided in the embodiments of the present disclosure can be applied to the above-mentioned DO-178B / C A-level software verification and ISO-26262 ASIL-D-level software verification, and can also be applied to the verification of other software projects that require high security and high reliability.

[0082] In the software analysis method provided by the embodiment of the present disclosure, by writing sample source code according to the software coding standard, and extracting the sample source code from the actual project source code, the source code obtained by combining the sample source code and the sample source code is processed using the compiler and compilation options corresponding to the actual project source code to obtain the target code, which is used to obtain the analysis result after comparing and analyzing with the source code. Thereby, the software analysis combines the software coding standard and the actual project source code at the same time; through the analysis and verification of the software coding standard part, the reusability of the verification is guaranteed, and the software analysis that meets the software coding mark can reuse the analysis results of this part, and the verification efficiency is improved; in addition, the actual project source code can be strongly combined with the code that needs to be verified at present, which ensures the credibility and avoids the deviation caused by the separation of the analysis results from the actual project. In summary, this method can efficiently verify whether the software meets the relevant standards and ensure the verification effect.

[0083] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this disclosure. Adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the protection scope of this disclosure.

[0084] A software analysis device is provided in an embodiment of the present disclosure. The specific implementation of the device can refer to the relevant description of the method embodiment, which will not be repeated here. Figure 2 The schematic diagram of the structure of the device is shown, which mainly includes:

[0085] A first acquisition module 201 is used to acquire sample source code written according to software coding standards;

[0086] A second acquisition module 202 is used to acquire a sample source code, where the sample source code is extracted from an actual project source code;

[0087] A processing module 203 is used to combine the sample source code and the sample source code to obtain a source code, and to process the source code based on the compiler and compilation options corresponding to the actual project source code to obtain a target code corresponding to the source code;

[0088] The analysis module 204 is used to analyze the source code and the target code to obtain analysis results.

[0089] The functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the method described in the method embodiments. The specific implementation and technical effects thereof can be referred to the description of the method embodiments above, and will not be described again here for the sake of brevity.

[0090] It should be noted that all modules involved in this embodiment are logic modules. In practical applications, a logic unit may be a physical unit, or a part of a physical unit, or may be implemented as a combination of multiple physical units. In addition, in order to highlight the innovative part of the present disclosure, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by the present disclosure, but this does not mean that there are no other units in this embodiment.

[0091] Reference Figure 3 , an embodiment of the present disclosure provides an electronic device, comprising:

[0092] at least one processor 301;

[0093] A memory 302 storing at least one program, when the at least one program is executed by the at least one processor, the at least one processor implements the above method;

[0094] At least one I / O interface 303 is connected between the processor and the memory and is configured to implement information exchange between the processor and the memory.

[0095] Among them, the processor 301 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 302 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 303 is connected between the processor 301 and the memory 302, and can realize information interaction between the processor 301 and the memory 302, including but not limited to a data bus (Bus), etc.

[0096] In some embodiments, the processor 301 , the memory 302 , and the I / O interface 303 are connected to each other through a bus, and further connected to other components of the computing device.

[0097] This embodiment further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided in this embodiment is implemented. To avoid repeated description, the specific steps of the method are not repeated here.

[0098] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods applied for above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0099] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0100] Those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present embodiment and to form different embodiments.

[0101] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and substance of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.

Claims

1. A software analysis method, characterized in that: include: Get sample source code written in accordance with software coding standards; Obtaining a sample source code, where the sample source code is extracted from an actual project source code; Combining the sample source code and the sample source code to obtain a source code, processing the source code based on a compiler and compilation options corresponding to the actual project source code to obtain a target code corresponding to the source code; The source code and the target code are analyzed to obtain analysis results.

2. The method according to claim 1, characterized in that The obtaining of sample source code written in accordance with software coding standards includes: Obtaining a minimum subset of software source code structures, wherein the minimum subset of software source code structures includes a minimum number of software source code structures required to meet a software coding standard adopted by the project; A sample source code is obtained, wherein the sample source code is compiled based on each of the software source code structures included in the minimum subset of the software source code structure.

3. The method according to claim 2, characterized in that The obtaining of the sample source code includes: Acquire a first sample source code set, wherein the first sample source code set includes sample source codes respectively written based on each software source code structure in the minimum subset of the software source code structure; Acquire a second sample source code set, wherein the second sample source code set includes sample source codes written based on a combination of at least two software source code structures in the minimum subset of software source code structures; The first sample source code set and the second sample source code set are integrated to obtain a total sample source code.

4. The method according to claim 1, characterized in that The processing of the source code based on the compiler and compilation options corresponding to the actual project source code to obtain the target code corresponding to the source code includes: Using the compiler and compilation options corresponding to the actual project source code, compile the source code to obtain a total compiled code; Disassembling the compiled code corresponding to the sample source code in the total compiled code to obtain a first disassembled code; Using the compiled code corresponding to the sampled source code in the total compiled code as the target assembly code; Using the compiler and compilation options corresponding to the actual project source code, disassemble the actual target code of the project corresponding to the sample source code to obtain a second disassembled code; Obtaining a target code corresponding to the source code, wherein the target code includes the first disassembly code and at least one of the target assembly code and the second disassembly code.

5. The method according to claim 4, characterized in that The analyzing the source code and the target code to obtain analysis results includes: Taking the function in the source code as the analysis unit, traversing each of the analysis units in the source code, and performing the following processing on each of the analysis units respectively: matching the target code fragment corresponding to the analysis unit from the target code, and establishing an association relationship between the analysis unit and the target code fragment if there is a target code fragment matching the analysis unit in the target code; Based on the association relationship, obtaining additional target codes in the target code that are not matched to any of the analysis units, and obtaining analysis and verification status of the additional target codes; The association relationship and the analysis and verification status of the additional target code are taken as the analysis results.

6. The method according to claim 5, characterized in that The matching of the target code segment corresponding to the analysis unit from the target code, and establishing an association relationship between the analysis unit and the target code segment when there is a target code segment matching the analysis unit in the target code, includes: In the case where the analysis unit belongs to a function in the sample source code, matching a target code fragment corresponding to the analysis unit in the first disassembly code, and in the case where a target code fragment matching the analysis unit exists in the first disassembly agent, establishing an association relationship between the analysis unit and the target code fragment; In a case where the analysis unit belongs to the sampled source code, a target code fragment corresponding to the analysis unit is matched in at least one of the target assembly code and the second disassembly code; and in a case where a target code fragment matching the analysis unit exists in the assembly code and the second disassembly code, an association relationship between the analysis unit and the target code fragment is established.

7. The method according to claim 1, characterized in that The ratio of the sampled source code to the actual project source code is not less than a preset ratio.

8. A software analysis device, characterized in that: include: A first acquisition module is used to acquire sample source code written according to software coding standards; A second acquisition module is used to acquire a sample source code, where the sample source code is extracted from an actual project source code; A processing module, configured to combine the sample source code and the sample source code to obtain a source code, and to process the source code based on a compiler and compilation options corresponding to the actual project source code to obtain a target code corresponding to the source code; The analysis module is used to analyze the source code and the target code to obtain analysis results.

9. An electronic device, characterized in that: include: at least one processor; A memory having at least one program stored thereon, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7; At least one I / O interface is connected between the processor and the memory and is configured to implement information interaction between the processor and the memory.

10. A computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 7.