Firmware analysis and verification method, jig, computer equipment and storage medium

By writing the firmware file into the electrical signal programming and erasing unit for analysis and verification, the problem of low efficiency and high cost in firmware testing of PCIe devices and other extended devices is solved, enabling efficient testing and accurate verification without the need for physical equipment.

CN118550840AActive Publication Date: 2024-08-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411028006.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-08-27
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

In server compatibility testing, firmware compatibility testing of PCIe devices and other expansion devices is inefficient and costly, requiring a large amount of manpower and material resources, and the equipment is easily damaged, resulting in increased maintenance costs.

Method used

By writing the firmware file to the electrical signal programming and erasing unit for analysis, extracting configuration item data, and interacting with the server for verification testing, physical replacement and damage of the device is avoided, testing efficiency is improved and costs are reduced.

Benefits of technology

It realizes firmware compatibility testing without physical equipment, improves testing efficiency and reduces maintenance costs, simplifies the process, and improves the accuracy and efficiency of verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550840A
    Figure CN118550840A
Patent Text Reader

Abstract

The invention relates to the technical field of firmware compatibility testing, and discloses a firmware analysis and verification method, a fixture, computer equipment and a storage medium, and the firmware analysis and verification method comprises the following steps: writing a firmware file into an electric signal programming and erasing unit; the firmware file on the electric signal programming and erasing unit is analyzed to obtain configuration item data of the firmware file, and the configuration item data comprises configuration parameter options and function switch options; taking the obtained configuration item data as verification data to interact with a server for verification test, so as to obtain a test result; according to the firmware analysis and verification method, the fixture, the computer equipment and the storage medium disclosed by the invention, the problems of low compatibility test efficiency and high test cost of Firmware of PCIe equipment and other types of extension equipment can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of firmware compatibility testing, and in particular to a firmware parsing and verification method, a fixture, a computer device and a storage medium. Background Art

[0002] In the process of building high-performance servers, server manufacturers usually use a large number of PCIe (Peripheral component interconnect express) devices and other types of expansion devices to enrich their service content; in the entire initialization process of the server, the firmware of PCIe devices and other types of expansion devices plays a vital role; it determines the various parameters and configurations of the device during the initialization process, and these parameters and configurations directly affect the working status of the device during the subsequent server operation; in order to ensure the stability and reliability of the server, it is necessary to perform compatibility testing on PCIe devices and other types of expansion devices. In the compatibility test, it is particularly important to parse and verify the firmware of PCIe devices and other types of expansion devices.

[0003] In the related technology, taking PCIe devices as an example, a detailed and mature testing and verification process has been established for the analysis and verification of PCIe device firmware. However, in the whole process, each new version of the firmware needs to be flashed into the corresponding PCIe device, and then it needs to be matched with various server environments for detailed compatibility testing. Therefore, it is necessary not only to prepare a sufficient number of PCIe devices and server hardware, but also to ensure that these devices will not interrupt the test due to failure or other reasons during the test process. At the same time, for the equipment that may be damaged or fail during the test, corresponding spare parts and maintenance support are also required.

[0004] In summary, a large amount of manpower and material resources are invested in the compatibility testing phase of the firmware of PCIe devices and other types of expansion devices to carry out compatibility testing. Therefore, how to improve the verification efficiency of the firmware of PCIe devices and other types of expansion devices, and how to reduce the testing cost have become technical problems that technical personnel in this field need to solve urgently. Summary of the invention

[0005] In view of this, the present invention provides a firmware parsing and verification method, a fixture, a computer device and a storage medium to solve the problems of low compatibility testing efficiency and high testing cost of firmware of PCIe devices and other types of expansion devices.

[0006] In a first aspect, the present invention provides a firmware parsing and verification method, comprising: Writing the firmware file into the electrical signal programming and erasing unit; Parsing the firmware file on the electrical signal programming and erasing unit to obtain configuration item data of the firmware file, wherein the configuration item data includes configuration parameter options and function switch options; The obtained configuration item data is used as verification data to interact with the server for verification testing to obtain the test results.

[0007] In this implementation, the firmware file is written into the electrical signal programming and erasing unit, and then the firmware file in the electrical signal programming and erasing unit is parsed and analyzed to obtain configuration item data, and then the configuration item interacts with the server for verification testing to obtain test results to verify the compatibility of the firmware file. The entire process only requires direct use of the firmware file of the PCIe device or other types of expansion devices. There is no need to purchase different PCIe devices and other types of expansion devices, and there is no need to perform a large number of plug-in and unplug operations to replace different PCIe devices and other types of expansion devices, thereby avoiding damage to different PCIe devices and other types of expansion devices. This not only improves the efficiency of firmware compatibility testing, but also reduces the investment in test equipment and maintenance costs, thereby effectively reducing testing costs.

[0008] In an optional implementation, the firmware parsing and verification method further includes: Compare the configuration option data of different versions of firmware files to obtain distinguishing item data; The distinguishing item data is used as verification data to interact with the server for verification testing, thereby obtaining the test results of the distinguishing items.

[0009] In an optional implementation, the distinguishing item data is structurally presented and screened, and the screened distinguishing item data is used as verification data to interact with the server for verification testing, thereby obtaining test results of the screened distinguishing items.

[0010] In an optional implementation, the method for comparing configuration option data of different versions of firmware files includes a text comparison method, a structured data comparison method, and a semantic analysis comparison method.

[0011] In an optional embodiment, the text comparison method includes at least one of direct text comparison and string parsing and comparison; and / or, the structured data comparison method includes at least one of XML / JSON structured data comparison and database model comparison; and / or, the semantic analysis comparison method includes at least one of natural language processing and semantic similarity calculation.

[0012] In an optional implementation, the step of parsing the firmware file on the electrical signal programming and erasing unit includes: File identification, identifying the type of firmware file and its environment configuration, which includes the chip type supported by the firmware and the system running on the firmware; Binary processing: convert non-standard binary format firmware files into binary format and extract strings and hexadecimal data in firmware files; Firmware structure analysis: identify the partitions of the firmware files to obtain the functions of each partition; perform system analysis on the firmware files to obtain the files and data of the file system in the firmware files; Configuration item data extraction: obtain configuration item data through static analysis and dynamic analysis; Result collation and presentation: The obtained configuration item data is collated and presented.

[0013] In an optional implementation, the step of interacting the obtained configuration item data with the server for verification testing includes: Data cleaning and verification: cleaning the configuration option data to remove invalid or abnormal data; using a verification algorithm to verify the cleaned configuration option data to prevent the configuration item data from being tampered with; wherein the verification algorithm includes at least one of a checksum and a hash value; Parameter parsing and comparison: parsing the configuration option data in the firmware into an operable parameter set; comparing the parameters in the parsed parameter set with the preset values ​​to ensure that the parameter settings meet the specifications; the preset values ​​include the legal value range, dependency relationships, and mutually exclusive conditions; Logical consistency check, verifying whether the logical relationships between different configuration options in the firmware are consistent; Simulate execution and testing, simulating the execution process of firmware in a safe environment, testing critical paths and logic to verify that its functions work as expected.

[0014] In an optional implementation, the firmware file is first transferred to a storage unit, and then the firmware file is written into the electrical signal programming and erasing unit; and / or, the configuration item data of the firmware file is parsed and stored in the storage unit; and / or, the test results are summarized in the storage unit.

[0015] In a second aspect, the present invention also provides a firmware parsing and verification fixture, comprising a storage module, an electrical signal programming and erasing module, a connection module and a central processing module, wherein the storage module is used to receive and store firmware files; the central processing module is used to write the firmware files in the storage module into the electrical signal programming and erasing module, parse the firmware files on the electrical signal programming and erasing module, and obtain configuration item data of the firmware files, wherein the configuration item data includes configuration parameter options and function switch options; and the obtained configuration item data is interacted with the server through the connection module for verification testing.

[0016] In this embodiment, the firmware parsing and verification method in the first aspect is implemented by the coordination and cooperation of the storage module, the electrical signal programming and erasing module, the connection module and the central processing module, which has the same effect as the firmware parsing and verification method and will not be repeated here.

[0017] In an optional embodiment, the central processing module includes a firmware parsing unit and a data processing unit. The firmware parsing unit is used to write the firmware file in the storage module into the electrical signal programming and erasing module, parse the firmware file on the electrical signal programming and erasing module, and obtain the configuration item data of the firmware file; the data processing unit is used to verify and test the obtained configuration item data through the connection module and the server interaction.

[0018] In an optional implementation, the firmware parsing and verification fixture further includes a monitoring module, which is capable of monitoring and parsing data packets at the physical layer, data link layer, and transaction layer during the interaction between the central processing module and the server.

[0019] In an optional implementation, a network interface module is further included for remote control and operation, and the firmware file is transmitted to the storage module through the network interface module or the server.

[0020] In an optional implementation, the firmware parsing and verification fixture further includes a dynamic access module for storing temporary data generated by the central processing module; and / or the connection module is a PCIe interface.

[0021] In a third aspect, the present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores computer instructions; the memory and the processor are communicatively connected to each other, and the processor executes the firmware parsing and verification method described in any one of the embodiments of the first aspect by executing the computer instructions.

[0022] In this embodiment, because the computer device can execute the computer instructions of the firmware parsing and verification method in the first aspect, it has the same effect as the firmware parsing and verification method, and will not be repeated here.

[0023] In a fourth aspect, the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the firmware parsing and verification method described in any one of the embodiments of the first aspect above.

[0024] In this embodiment, because the computer-readable storage medium stores computer instructions for causing a computer to execute the firmware parsing and verification method in the first aspect, it has the same effect as the firmware parsing and verification method and is not described in detail here.

[0025] In a fifth aspect, the present invention further provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the firmware parsing and verification method described in any one of the embodiments of the first aspect.

[0026] In this embodiment, because the computer program product includes computer instructions for causing a computer to execute the firmware parsing and verification method in the first aspect, it has the same effect as the firmware parsing and verification method, and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 A flowchart of a firmware analysis and verification method according to an embodiment of the present invention; Figure 2 A flowchart of a parsing process in a firmware parsing and verification method according to an embodiment of the present invention; Figure 3 A flowchart of a verification process in a firmware parsing and verification method according to an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a firmware analysis and verification fixture according to an embodiment of the present invention; Figure 5 The figure is a schematic diagram of a firmware analysis and verification fixture according to an embodiment of the present invention.

[0029] Description of reference numerals: 1. Storage module; 2. Electrical signal programming and erasing module; 3. Connection module; 4. Central processing module; 5. Monitoring module; 6. Network interface module; 7. Dynamic access module; 401, firmware analysis unit; 402, data processing unit. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0031] In the related technology, in the entire initialization process of the server, the firmware of PCIe devices and other types of expansion devices plays a vital role; it determines the various parameters and configurations of the device during the initialization process, and these parameters and configurations directly affect the working status of the device during the subsequent server operation process; in order to ensure the stability and reliability of the server, it is necessary to perform compatibility testing on PCIe devices and other types of expansion devices. In the compatibility test, it is particularly important to parse and verify the firmware of PCIe devices and other types of expansion devices.

[0032] Taking PCIe devices as an example, a detailed and mature testing and verification process has been established for the analysis and verification of PCIe device firmware. However, in the whole process, each new version of the firmware needs to be flashed into the corresponding PCIe device, and then paired with a variety of server environments for detailed compatibility testing. Therefore, it is necessary not only to prepare a sufficient number of PCIe devices and server hardware, but also to ensure that these devices will not interrupt the test due to failure or other reasons during the test process. At the same time, for the equipment that may be damaged or fail during the test, corresponding spare parts and maintenance support are also required.

[0033] In summary, a large amount of manpower and material resources are invested in the compatibility testing phase of the firmware of PCIe devices and other types of expansion devices to carry out compatibility testing. Therefore, how to improve the verification efficiency of the firmware of PCIe devices and other types of expansion devices, and how to reduce the testing cost have become technical problems that technical personnel in this field need to solve urgently.

[0034] In order to solve the above problems, the present invention provides a firmware parsing and verification method, a fixture, a computer device and a storage medium to solve the problems of low compatibility testing efficiency and high testing cost of firmware of PCIe devices and other types of expansion devices.

[0035] Combine the following Figures 1 to 5 , describing an embodiment of the present invention.

[0036] According to an embodiment of the present invention, in a first aspect, a firmware parsing and verification method is provided, such as Figure 1 As shown, the steps include: Step 102, writing the firmware file into the electrical signal programming and erasing unit; specifically, the electrical signal programming and erasing unit may be an EEPROM (Electrically-Erasable Programmable Read-Only Memory).

[0037] Step 103, parse the firmware file on the electrical signal programming and erasing unit to obtain configuration item data of the firmware file, where the configuration item data includes configuration parameter options and function switch options.

[0038] Specifically, the steps of parsing the firmware file on the electrical signal programming and erasing unit are as follows: Figure 2 As shown, including: Step 1031, file identification, identifying the type of the firmware file and its environment configuration, the environment configuration includes the chip type supported by the firmware and the system running on the firmware.

[0039] Specifically, identify the type of firmware file being imported (such as BIN, IMG, SREC, Intel HEX, etc.); this can be done by checking the file header (magic bytes) or using specialized tools (such as the file command).

[0040] Understand the environment in which the firmware runs, including supported chip models, chip architecture (such as ARM, x86, etc.), and the system running on the firmware (RTOS, Linux, etc.).

[0041] Step 1032, binary processing, converting the firmware file in non-standard binary format into binary format, and extracting the character string and hexadecimal data in the firmware file.

[0042] It should be noted that if the firmware file is in binary format, no conversion is required, and the character string and hexadecimal data of the firmware file can be directly extracted.

[0043] Specifically, converting firmware files in non-standard binary format into binary format for subsequent analysis can be achieved by using specialized tools (such as bincopy) or writing scripts; extracting strings and hexadecimal data from firmware files can be done using tools (such as strings, hexdump), which may contain key information such as configuration parameters and function switches.

[0044] Step 1033, firmware structure analysis, partition identification of the firmware file to obtain the function of each partition; system analysis of the firmware file to obtain the files and data of the file system in the firmware file.

[0045] Specifically, partition identification, a firmware file usually contains multiple partitions, each of which is responsible for different functions. It is necessary to identify these partitions and understand the purpose of each partition.

[0046] File system parsing: If the firmware file contains a file system (such as JFFS2, YAFFS, etc.), these file systems need to be parsed to extract the files and data therein.

[0047] Step 1034: extract configuration item data, and obtain configuration item data through static analysis and dynamic analysis.

[0048] Specifically, static analysis extracts information about configuration parameter options and function switch options by reading configuration files, parameter tables or specific data structures in firmware files.

[0049] Dynamic analysis: In some cases, it may be necessary to dynamically analyze the firmware behavior by simulating the firmware operating environment or using a dedicated firmware simulator to extract the actual effects of configuration parameter options and function switch options (this process can be performed according to actual needs).

[0050] Step 1035, result collation and presentation, the obtained configuration item data is collated and presented.

[0051] Specifically, data collation is to organize the extracted configuration parameter options, function switch options and other information into a format that is easy to understand and use (such as a table, JSON, etc.).

[0052] Result presentation: presenting the analysis results to the user or subsequent processing module through the user interface or API.

[0053] like Figure 2 As shown, the method in step 1031 to step 1035 can extract each configuration item in the firmware text and ensure the integrity of the configuration extraction, thereby avoiding missing items and improving the reliability of firmware text verification.

[0054] The following is a specific example to explain step 1031 to step 1035 in detail.

[0055] Assuming there is a network card firmware file (assumed to be nic.bin), the firmware parsing is performed according to the following steps: Step 1031, file identification, uses the file command to identify the firmware file type and confirms that it is a binary file.

[0056] Step 1032, binary processing, uses the hexdump command to view the hexadecimal representation of the firmware file to gain a preliminary understanding of the file structure.

[0057] Step 1033, firmware structure analysis, Partition identification: Identify the partitions contained in the firmware and their uses by analyzing specific areas of the firmware file (such as the partition table).

[0058] File system parsing: If the firmware contains a file system (such as JFFS2), use specialized tools (such as binwalk) to extract the file system and parse the files and data in it.

[0059] Step 1034, extracting configuration item data, Static analysis: By reading the configuration file (such as config.txt) in the firmware, the network configuration, security settings and other parameters of the network card are extracted.

[0060] Step 1035, result organization and presentation: organize the extracted configuration parameter options and function switch options into a table format and present it to the user through the user interface.

[0061] Step 106, such as Figure 1 As shown, the obtained configuration item data is used as verification data to interact with the server for verification testing, thereby obtaining the test results.

[0062] Specifically, the steps of interacting the obtained configuration item data with the server for verification testing are as follows: Figure 3 As shown, including: Step 1061, data cleaning and verification, Data cleaning: perform data cleaning on configuration option data to remove invalid or abnormal data; for example, check whether the data is complete, whether the format is correct, whether there are out-of-range values, etc.

[0063] Data verification: Use a verification algorithm to verify the cleaned configuration option data to prevent the configuration item data from being tampered with; the verification algorithm includes at least one of the algorithms such as checksum, hash value (such as MD5, SHA-256), etc.

[0064] Step 1062, parameter analysis and comparison, Parameter parsing: parsing the configuration option data in the firmware (such as configuration registers, flag bits, etc.) into an operable parameter set.

[0065] Comparison verification compares the parameters in the parsed parameter set with the preset legal value range, dependencies, and mutually exclusive conditions to ensure that the parameter settings meet the specifications.

[0066] Step 1063, logic consistency check, verifies whether the logical relationship between different configuration options in the firmware is consistent; for example, the enabling of some configuration items may depend on the status of other configuration items.

[0067] Step 1064, simulate execution and testing, simulate the execution process of the firmware in a safe environment, and test the critical paths and logic to verify whether its functions work as expected.

[0068] The corresponding functions of each configuration item after parsing are verified through the parameter processing model. This model supports custom settings. The state transition process of the firmware configuration item is modeled as a state machine. Each state represents a valid state of a configuration item, and the state transition reflects the change process of the configuration item. Through the state machine model, the dependencies and transition conditions between configuration items can be clearly described, which is convenient for logical consistency checking.

[0069] Rule Engine: Defines a rule set, each rule describes one or more validation conditions for a configuration item.

[0070] The rule engine applies the rules in the rule set to verify the input configuration item data; if a violation of the rules is found, the corresponding error or warning information is output.

[0071] Decision tree model,For complex firmware configuration item verification problems, a decision tree model can be used to represent the decision logic between configuration items. Each node represents a configuration item or decision point, and the branches represent different decision paths. By traversing the decision tree, the correctness of the firmware configuration can be systematically verified.

[0072] The following is a specific example to explain step 1061 to step 1064 in detail.

[0073] Assume that there is an option set for network configuration in the firmware, including parameters such as IP address, subnet mask, gateway, etc.; the following steps can be used to verify: Step 1061, data cleaning: Check whether the parameters such as IP address, subnet mask, gateway, etc. are in the correct format and contain no illegal characters.

[0074] Step 1062, parameter parsing and comparison, parse the IP address into four decimal numbers and check whether each number is between 0 and 255. Verify whether the subnet mask is in a valid format (such as 255.255.255.0). Check whether the gateway IP address is in the same subnet.

[0075] Step 1063, logical consistency check, ensures that there is no logical conflict between parameters such as IP address, subnet mask, gateway, etc. (eg, subnet mask does not match IP address).

[0076] Step 1064, simulate execution and testing, try to use these configuration parameters to establish a network connection in a simulated environment, and verify whether it is successful.

[0077] Through the methods in step 1061 to step 1064, the data processing unit 402 can ensure that each configuration item in the firmware file is accurately calculated and compared, thereby ensuring the correctness of the option setting and the reliability of the function.

[0078] The firmware parsing and verification method in the above steps 102, 103 and 106 writes the firmware file into the electrical signal programming and erasing unit, and then parses and analyzes the firmware file in the electrical signal programming and erasing unit to obtain configuration item data, and then interacts the configuration item with the server for verification testing, thereby obtaining test results to verify the compatibility of the firmware file. The entire process only requires direct use of the firmware file of the PCIe device or other types of expansion devices. There is no need to purchase different PCIe devices and other types of expansion devices, and there is no need to perform a large number of plug-in and unplug operations to replace different PCIe devices and other types of expansion devices, thereby avoiding damage to different PCIe devices and other types of expansion devices. This not only improves the efficiency of firmware compatibility testing, but also reduces the investment and maintenance costs of test equipment, thereby effectively reducing testing costs.

[0079] In one embodiment, Figure 1 As shown, the firmware parsing and verification method also includes: Step 104, comparing the configuration option data of different versions of firmware files to obtain distinguishing item data; Step 106: Use the distinguishing item data as verification data to interact with the server for verification testing, thereby obtaining a test result of the distinguishing item.

[0080] It should be noted that the above-mentioned difference item data refers to the different configuration items between different versions of firmware files.

[0081] In this embodiment, by comparing different versions of firmware files, including option settings, functional characteristics, etc., directly performing verification tests on the difference item data and interacting with the server, it is possible to clearly understand the improvements and optimization points of each version, thereby providing direction for server upgrade decisions.

[0082] In one embodiment, Figure 1 As shown, the firmware parsing and verification method also includes: Step 105, presenting the distinguishing item data in a structured manner and screening; Step 106: Use the screened distinguishing item data as verification data to interact with the server for verification testing, thereby obtaining the test results of the screened distinguishing items.

[0083] Specifically, structural presentation of distinguished item data refers to displaying them on the screen; screening refers to removing data that does not need to be verified and retaining data that needs to be verified.

[0084] By screening the distinguishing item data, a part of the distinguishing item data is selected to interact with the server for verification testing, thereby obtaining the test results of the selected distinguishing items. In this embodiment, by presenting the distinguishing item data, it is convenient to perform the distinguishing item selection operation, thereby selecting a part of the distinguishing items for targeted verification to ensure the correctness of their functions and performance.

[0085] In one embodiment, a method for comparing configuration option data of different versions of firmware files includes a text comparison method, a structured data comparison method, and a semantic analysis comparison method; in a specific embodiment, the text comparison method includes at least one of direct text comparison and string parsing and comparison; and / or, the structured data comparison method includes at least one of XML / JSON structured data comparison and database model comparison; and / or, the semantic analysis comparison method includes at least one of natural language processing and semantic similarity calculation.

[0086] Specifically, ① Direct text comparison Method description: Directly compare the text of files (such as binary files, configuration files, etc.) of two firmware versions to find differences.

[0087] Applicable scenarios: Applicable to configuration files in text format or those that are easy to convert to text format.

[0088] Tool examples: diff tool (commonly used in Linux and Unix systems), WinMerge (a graphical difference comparison tool in Windows systems), etc.

[0089] ② String parsing and comparison Method description: Extract the strings (such as version number, configuration option name, etc.) in the firmware file, and parse and compare them.

[0090] Implementation: Write scripts or use existing tools to parse firmware files, extract key information, and perform comparisons.

[0091] ③ XML / JSON and other structured data comparison Method description: If the firmware configuration item files are stored in a structured format such as XML or JSON, you can use specialized tools or libraries to compare these files.

[0092] Tool examples: XMLDiff (for comparison of XML files), JSONDiff (for comparison of JSON files), etc.

[0093] ④ Database model comparison Method description: Map the configuration information in the firmware to the database model, and use the difference comparison function provided by the database management system to find the differences.

[0094] Implementation: First define the database schema, then import the firmware configuration information into the database, and use SQL queries or database management tools to compare the differences.

[0095] ⑤Natural Language Processing (NLP) Method description: For configuration items or functional features that contain natural language descriptions, NLP technology can be used to extract key information and perform comparisons.

[0096] Implementation method: Use NLP libraries (such as NLTK, spaCy, etc.) to perform text segmentation, part-of-speech tagging, named entity recognition, and other processing, and then compare the extracted key information.

[0097] ⑥Semantic similarity calculation Method Description: Compute the semantic similarity of identical or similar configuration options in two versions of firmware to evaluate the differences between them.

[0098] Implementation method: Use models such as Word2Vec and BERT to calculate the semantic similarity between texts, and judge the degree of difference based on the similarity value.

[0099] You can also use automated comparison tools and models to compare different versions of firmware files, such as firmware difference comparison tools, custom comparison models, etc.

[0100] ⑦Firmware difference comparison tool Tool Description: Some specialized firmware analysis tools (such as Binwalk, firmware-mod-kit, etc.) provide firmware difference comparison function.

[0101] How to use: Use these tools to analyze two firmware versions and generate a difference report.

[0102] ⑧Custom comparison model Model description: Design and implement a customized comparison model based on the specific structure and content of the firmware.

[0103] Implementation steps: Analyze the file structure and content format of the firmware.

[0104] Design comparison algorithms and processes.

[0105] Implement the comparison model and perform testing and optimization.

[0106] Specifically, a training set is first set, including multiple groups of combined features of firmware structure + firmware content and their corresponding comparison output results; then a part of the data in the training set is input into an artificial intelligence learning model (such as a convolutional neural network, etc.) for learning and training to obtain a firmware comparison model, and then the remaining data in the training set is input into the firmware comparison model for verification, and then the obtained firmware comparison model is used to compare different versions of the firmware files and output the difference item data.

[0107] In practical applications, appropriate comparison methods and models can be selected according to the specific situation of the firmware. For example, if the firmware configuration file is in XML format, the XMLDiff tool can be used for comparison; if the firmware contains a large number of configuration options described in natural language, NLP technology can be used for semantic analysis and comparison. In addition, multiple methods and models can be combined to improve the accuracy and efficiency of the comparison. For example, the text comparison method can be used to find obvious differences, and then the semantic analysis comparison method can be used to evaluate the actual significance and impact of the differences.

[0108] In this embodiment, direct text comparison is applicable to firmware files that are in text format or configuration files that are easily converted to text format; string parsing and comparison can extract strings in the firmware for parsing and comparison; XML / JSON structured data comparison is applicable to firmware files stored in structured formats such as XML and JSON for comparison; database model comparison can map the configuration information in the firmware file to the database model, and use the difference comparison function provided by the database management system to find differences; natural language processing can extract key information and compare configuration items containing natural language descriptions; semantic similarity calculation evaluates the differences between them by calculating the semantic similarity of the same or similar configuration options in different versions of firmware files.

[0109] In one embodiment, Figure 1As shown, the firmware parsing and verification method also includes step 101, first transferring the firmware file to the storage unit; then in step 102, writing the firmware file into the electrical signal programming and erasing unit; and / or, parsing the configuration item data of the firmware file and storing it in the storage unit; and / or, summarizing the test results in the storage unit. In this embodiment, the storage unit can store multiple firmware texts for sequential parsing and verification, without the need to perform separate operations on each firmware text, thereby improving the convenience of firmware text parsing and verification and avoiding time waste.

[0110] In a second aspect, the present invention also provides a firmware analysis and verification tool, such as Figure 4 and Figure 5 As shown, it includes a storage module 1, an electrical signal programming and erasing module 2, a connection module 3 and a central processing module 4, wherein the storage module 1 is used to receive and store firmware files; the central processing module 4 is used to write the firmware files in the storage module 1 into the electrical signal programming and erasing module 2, parse the firmware files on the electrical signal programming and erasing module 2, and obtain configuration item data of the firmware files, wherein the configuration item data includes configuration parameter options and function switch options; and the obtained configuration item data is interacted with the server through the connection module 3 for verification testing.

[0111] Specifically, the storage module 1 can be a storage device such as a mechanical hard disk or a solid-state hard disk; the electrical signal programming and erasing module 2 is an EEPROM, which is an important component for storing firmware files. It supports repeated erasing and writing, ensuring that users can import new firmware files for parsing at any time. Through the firmware parsing unit 401, the firmware files in the EEPROM will be accurately parsed out; the connection module 3 is specifically a PCIe interface, which can be easily connected to the server and has high data transmission efficiency; the central processing module 4 can be a CPU (Central Processing Unit); more specifically, as Figure 5 As shown, the central processing module 4 includes a firmware parsing unit 401 and a data processing unit 402. The firmware parsing unit 401 is used to write the firmware file in the storage module 1 into the electrical signal programming and erasing module 2, parse the firmware file on the electrical signal programming and erasing module 2, and obtain the configuration item data of the firmware file; the data processing unit 402 is used to interact with the server through the connection module 3 to perform verification test on the obtained configuration item data. The firmware parsing unit 401 and the data processing unit 402 can be used to parse the firmware file and verify the firmware file respectively, with high processing efficiency and good stability.

[0112] In the specific use process, such as Figure 4As shown, (1) the connection module 3 is used to connect with the server to ensure the stability and efficiency of data transmission; (2) the firmware file is imported into the storage module 1; (3) the firmware file to be tested is taken out from the storage module 1 through the data processing unit 402 of the central processing module 4, and refreshed to the electrical signal programming and erasing module 2. Subsequently, the firmware parsing unit 401 will perform a deep analysis of the firmware file on the electrical signal programming and erasing module 2, extract all configuration items including various configuration parameter options, function switch options, etc., and these parsing results will be passed back to the storage module 1 for subsequent use; (4) the data processing unit 402 starts to verify each function switch option and configuration parameter option one by one according to the configuration item data in the storage module 1. In order to simulate the actual working environment, the system will transmit data with the server through the PCIE link, and perform detailed tests on the function and configuration parameters of each function switch.

[0113] In this embodiment, the firmware parsing and verification method in the first aspect is implemented by the coordination and cooperation among the storage module 1, the electrical signal programming and erasing module 2, the connection module 3 and the central processing module 4, which has the same effect as the firmware parsing and verification method and will not be repeated here.

[0114] In one embodiment, Figure 4 and Figure 5 As shown, the firmware analysis and verification fixture also includes a monitoring module 5, which can monitor and analyze data packets of the physical layer, data link layer, and transaction layer during the interaction between the central processing module 4 and the server.

[0115] Specifically, during the data transmission process, the monitoring module 5 will monitor the data transmission status on the link and the interaction result return value of the server host in real time. Through this information, the rationality and effectiveness of each function switch and configuration parameter can be judged; in addition, the monitoring module 5 also allows users to define different data transmission states to meet the needs of different test scenarios.

[0116] Monitoring module 5 is mainly an MCU chip with powerful data acquisition and processing capabilities. It can capture and record data flows on the PCIE link in real time. With real-time monitoring software, it can be used to configure monitoring parameters, display captured data packets, analyze data flows and performance bottlenecks, and support comprehensive monitoring from the physical layer to the transaction layer. Based on the PCIE protocol specification and through data analysis algorithms, it is used to parse captured data packets and compare data transmission conditions under different firmware option settings.

[0117] The verification of a single configuration item of the firmware file can be done separately according to the state machine model; the state machine model can clearly describe the dependencies and transition conditions between configuration items. Each configuration item has one or more verification conditions, and the verification of a single configuration item is performed by verifying these verification conditions separately.

[0118] In this embodiment, the monitoring module 5 can monitor and analyze the interaction data between the central processor and the server, so as to ensure the accuracy of the verification; at the same time, it can also compare the impact of a single configuration option on high-speed link data transmission, and provide users with the impact range of the configuration option settings in the firmware file.

[0119] In one embodiment, Figure 4 and Figure 5 As shown, a network interface module 6 is also included for remote control and operation, and the firmware file is transmitted to the storage module 1 through the network interface module 6 or the server.

[0120] Specifically, the firmware file can be transferred to the storage module 1 in two ways; The first method is to directly transfer the firmware file to the storage module 1 through the network interface module 6. This method is suitable for the case where the network environment is stable and the file size is moderate.

[0121] The second method is to upload the firmware file to the storage module 1 through the graphical interface of the BMC of the server using the I2C link. This method is more flexible, especially when the server network environment is limited or remote operation is required.

[0122] In this embodiment, the network interface module 6 can realize external network communication, and the user can remotely access the fixture to realize remote management and control; at the same time, it can provide convenience for the firmware text input storage module 1.

[0123] In a specific embodiment, Figure 4 and Figure 5 As shown, the firmware parsing and verification fixture also includes a dynamic access module 7 for storing temporary data generated by the central processing module 4. Specifically, the dynamic access module 7 can be a DRAM (Dynamic Random Access Memory). In this embodiment, the setting of the dynamic access module 7 can store temporary data generated by the central processing module 4 to ensure the stability and reliability of the operation of the central processing module 4.

[0124] In summary, the firmware parsing and verification fixture with a standard PCIE interface provided by the present invention has powerful parsing and verification capabilities, and supports deep parsing and comprehensive verification of firmware files; at the same time, it also has flexible storage and import functions, as well as powerful network communication capabilities, providing comprehensive support for firmware management and maintenance.

[0125] In a third aspect, the present invention further provides a computer device, comprising one or more processors and a memory, wherein the memory stores computer instructions; the memory and the processor are communicatively connected to each other, and the processor executes the firmware parsing and verification method in any one of the embodiments of the first aspect by executing the computer instructions; the processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0126] The processor may be a central processing unit, a network processor or a combination thereof. The processor may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0127] The memory stores instructions executable by at least one processor, so that the at least one processor executes the method shown in the above embodiment.

[0128] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0129] The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid state drive; the memory may also include a combination of the above types of memory.

[0130] In this embodiment, because the computer device can execute the computer instructions of the firmware parsing and verification method in the first aspect, it has the same effect as the firmware parsing and verification method, and will not be described in detail here.

[0131] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, and the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or is implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0132] In this embodiment, because the computer-readable storage medium stores computer instructions for causing a computer to execute the firmware parsing and verification method in the first aspect, it has the same effect as the firmware parsing and verification method and is not described in detail here.

[0133] In a fifth aspect, a part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0134] In summary, the beneficial effects of the present invention are mainly reflected in the following aspects: 1. Simplify the process and improve compatibility: By introducing the standard PCIe interface, the present invention greatly simplifies the process of the server in processing the PCIe device firmware parsing and verification. This highly integrated and standardized design enables the firmware of different PCIe devices to be easily imported into the integrated EEPROM through the standard interface, thereby improving the convenience of operation and compatibility with various PCIe devices.

[0135] 2. Improve the depth and accuracy of analysis: The built-in firmware analysis engine can deeply analyze the imported firmware and accurately extract all option settings contained in the firmware, including configuration parameters, function switches, etc. This precise analysis capability provides comprehensive and accurate data support for subsequent verification work, which helps to improve the efficiency and accuracy of verification.

[0136] 3. Support targeted verification: The present invention supports targeted verification of extracted firmware options, and users can choose to test specific options or parameters according to actual needs. This flexibility makes verification work more efficient, can quickly locate and solve problems, and reduce testing costs.

[0137] 4. Firmware version difference comparison: With the development of technology and product iteration, the firmware version of PCIe devices is constantly updated. The firmware version difference comparison function provided by the present invention enables users to clearly understand the improvements and optimization points of each version, so as to make more informed upgrade decisions. This not only helps to improve the performance and stability of the server, but also helps users better manage firmware resources.

[0138] 5. Improve test and verification efficiency: Overall, the firmware parsing and verification fixture with a standard PCIe interface proposed by the present invention simplifies the firmware test and verification process and improves the efficiency and accuracy of compatibility testing. This helps to reduce testing costs, shorten product time to market, and enhance market competitiveness.

[0139] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A firmware analysis and verification method, characterized in that: include: Writing the firmware file into the electrical signal programming and erasing unit; Parsing the firmware file on the electrical signal programming and erasing unit to obtain configuration item data of the firmware file, wherein the configuration item data includes configuration parameter options and function switch options; The obtained configuration item data is used as verification data to interact with the server for verification testing to obtain the test results.

2. The firmware analysis and verification method according to claim 1, characterized in that: Also includes: Compare the configuration option data of different versions of firmware files to obtain distinguishing item data; The distinguishing item data is used as verification data to interact with the server for verification testing, thereby obtaining the test results of the distinguishing items.

3. The firmware analysis and verification method according to claim 2, characterized in that: Also includes: The distinguishing item data is presented in a structured manner and screened, and the screened distinguishing item data is used as verification data to interact with the server for verification testing, thereby obtaining the test results of the screened distinguishing items.

4. The firmware analysis and verification method according to claim 2 or 3, characterized in that: Methods for comparing configuration option data of different versions of firmware files include text comparison methods, structured data comparison methods, and semantic analysis comparison methods.

5. The firmware analysis and verification method according to claim 4, characterized in that: The text comparison method includes at least one of direct text comparison and string parsing and comparison; And / or, the structured data comparison method includes at least one of XML / JSON structured data comparison and database model comparison; And / or, the semantic analysis comparison method includes at least one of natural language processing and semantic similarity calculation.

6. The firmware analysis and verification method according to any one of claims 1 to 3, characterized in that: The steps of parsing the firmware file on the electrical signal programming and erasing unit include: File identification, identifying the type of firmware file and its environment configuration, which includes the chip type supported by the firmware and the system running on the firmware; Binary processing: converting non-standard binary format firmware files into binary format and extracting strings and hexadecimal data from firmware files; Firmware structure analysis: identify the partitions of the firmware files to obtain the functions of each partition; perform system analysis on the firmware files to obtain the files and data of the file system in the firmware files; Configuration item data extraction: obtain configuration item data through static analysis and dynamic analysis; Result collation and presentation: The obtained configuration item data is collated and presented.

7. The firmware analysis and verification method according to any one of claims 1 to 3, characterized in that: The steps of interacting the obtained configuration item data with the server for verification testing include: Data cleaning and verification: cleaning the configuration option data to remove invalid or abnormal data; using a verification algorithm to verify the cleaned configuration option data to prevent the configuration item data from being tampered with; wherein the verification algorithm includes at least one of a checksum and a hash value; Parameter parsing and comparison: parsing the configuration option data in the firmware into an operable parameter set; comparing the parameters in the parsed parameter set with the preset values ​​to ensure that the parameter settings meet the specifications; the preset values ​​include the legal value range, dependency relationships, and mutually exclusive conditions; Logical consistency check, verifying whether the logical relationships between different configuration options in the firmware are consistent; Simulate execution and testing, simulating the execution process of firmware in a safe environment, testing critical paths and logic to verify that its functions work as expected.

8. The firmware analysis and verification method according to any one of claims 1 to 3, characterized in that: Firstly, the firmware file is transferred to the storage unit, and then the firmware file is written into the electrical signal programming and erasing unit; and / or, parsing and obtaining the configuration item data of the firmware file and storing it in a storage unit; And / or, the obtained test results are summarized in a storage unit.

9. A firmware analysis and verification tool, characterized in that: include: A storage module (1), used for receiving and storing firmware files; Electrical signal programming and erasing module (2); Connect module (3); as well as A central processing module (4), the central processing module (4) being used to write the firmware file in the storage module (1) into the electrical signal programming and erasing module (2), and to parse the firmware file on the electrical signal programming and erasing module (2) to obtain configuration item data of the firmware file, wherein the configuration item data includes configuration parameter options and function switch options; The obtained configuration item data is then interacted with the server through the connection module (3) for verification testing.

10. The firmware analysis and verification jig according to claim 9, characterized in that: The central processing module (4) comprises a firmware parsing unit (401) and a data processing unit (402). The firmware parsing unit (401) is used to write the firmware file in the storage module (1) into the electrical signal programming and erasing module (2), parse the firmware file on the electrical signal programming and erasing module (2), and obtain configuration item data of the firmware file; the data processing unit (402) is used to perform a verification test on the obtained configuration item data by interacting with a server through the connection module (3).

11. The firmware analysis and verification jig according to claim 10, characterized in that: It also includes a monitoring module (5), which is capable of monitoring and analyzing data packets at the physical layer, data link layer, and transaction layer during the interaction between the central processing module (4) and the server.

12. The firmware analysis and verification jig according to claim 10, characterized in that: It also includes a network interface module (6) for remote control and operation, and the firmware file is transmitted to the storage module (1) via the network interface module (6) or the server.

13. The firmware analysis and verification tool according to any one of claims 9 to 12, characterized in that: It also includes a dynamic access module (7) for storing temporary data generated by the central processing module (4); And / or, the connection module (3) is a PCIe interface.

14. A computer device, characterized in that: include: a memory, wherein computer instructions are stored in the memory; The processor, the memory and the processor are communicatively connected to each other, and the processor executes the firmware parsing and verification method according to any one of claims 1 to 8 by executing the computer instructions.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the firmware parsing and verification method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Cloud server test verification method based on firmware dynamic parameter adjustment

    CN115237429A

  • Method and device for verifying module compatibility, electronic equipment and storage medium

    CN115514680A

  • Firmware testing method and system, electronic equipment and readable storage medium

    CN115756994A

  • Firmware configuration page generation method and device, computer equipment and storage medium

    CN118113399A

  • Method for effectively improving coverage rate and robustness of test case

    CN118349431A