Embedded software virtualization fault injection method
By building an integrated digital system simulation and verification platform and creating corresponding fault injection tools, the problem of inaccurate fault injection in embedded software testing is solved, efficient and automated virtualization fault injection is achieved, and the comprehensiveness and effectiveness of the test is improved.
Patent Information
- Application Number
- CN202411434421.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art is difficult to accurately inject fault data in embedded software testing, which affects the comprehensiveness and effectiveness of the test, and failure testing in a natural way is time-consuming and difficult to collect sufficient data.
Build an integrated digital system simulation and verification platform for embedded software, create data interfaces and fault injection tools for underlying and management mechanism levels, and realize virtualized fault injection.
No specific hardware equipment is required, improving fault injection accuracy and portability, reducing development costs, and enhancing testing effectiveness and automation.
Smart Images

Figure CN119576757A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of fault injection of embedded software and relates to a virtualized fault injection method of embedded software. Background Art
[0002] Software testing and verification is an important part of ensuring and improving software quality. Fault injection technology, as a testing technology that can cause the system to fail quickly, is widely used in the testing and verification of embedded software. Fault injection technology evaluates the reliability and robustness of the system by simulating or forcing the system to have unexpected error conditions during operation. Its main purpose is to detect the behavior of the system when facing abnormal conditions, identify potential design defects, failure of recovery mechanisms, and security vulnerabilities, so as to improve the system design and enhance its ability to resist real faults.
[0003] Since embedded software is highly integrated with hardware when achieving its designed functions, testers are often limited by the characteristics of hardware interfaces and find it difficult to accurately inject fault data based entirely on the designed failure mode, which to some extent affects the comprehensiveness and effectiveness of the test. In addition, if the faults used to test embedded software are obtained in a natural way, it will take a lot of time and it is difficult to collect sufficient data about the faults. This requires fault injection technology for virtualized systems. Based on an integrated digital system simulation and verification platform, it can effectively analyze the root cause of the fault without the need for specific hardware equipment and without causing damage to the hardware. It can improve the accuracy and portability of fault injection and greatly reduce development costs. In addition, research on virtualized fault injection technology is also conducive to the development of cloud computing, virtualization, and fault-tolerant technologies. Summary of the invention
[0004] In view of the defects of current embedded software testing technology, the purpose of the present invention is to provide an embedded software virtualization fault injection method, which can effectively ensure the development of embedded software testing work.
[0005] Build an integrated digital system simulation and verification platform for embedded software and a data interface for data interaction, create underlying fault injection tools and management mechanism layer fault injection tools to realize the testing of virtualized fault injection of embedded software.
[0006] Purpose of the Invention
[0007] To achieve the above object, the present invention provides an embedded software virtualization fault injection method, which specifically includes the following steps:
[0008] Step 1
[0009] Build an integrated digital system simulation and verification platform for embedded software, and test the fault tolerance of the embedded software under test based on this platform;
[0010] Step 2
[0011] Then construct a data interface for communication and data interaction with the embedded software to be tested, which contains the correspondence between the communication protocol and various physical quantities, and parses the corresponding data in the communication protocol into physical quantities, or packages the physical quantities into the communication protocol format according to the communication rules and sends them to the embedded software;
[0012] Step 3
[0013] Create low-level fault injection tools for virtualized systems, including CPU, memory, and file system faults;
[0014] Step 4
[0015] Create a virtualization management mechanism layer fault injection tool, obtain normal external stimuli from the data interface suite, and replace them with erroneous data based on the test, so as to implement virtualization fault injection testing.
[0016] Furthermore, in step 1, the integrated digital system simulation and verification platform of the embedded software is based on digital virtual simulation technology to construct digital virtualization of the hardware platform running the embedded software, including virtualization of computing resources, storage resources, network resources, etc.;
[0017] Further, in step 1, the integrated digital system simulation and verification platform of the embedded software is composed of a digital processor and a digital communication chip, and the platform is divided into six modules: fault injection tool set, load set, fault injection tool management, load management, user interaction, and log management;
[0018] Furthermore, in step 1, the integrated digital system simulation and verification platform of the embedded software has its input as hardware platform design plan, design description, and product manual, and outputs an embedded system virtual environment based on the above input, thereby realizing software simulation verification independent of hardware.
[0019] Furthermore, in step 2, the data interface kit integrates a variety of communication protocols and physical quantities, and defines in detail the precise mapping relationship between these protocols and physical quantities to ensure accurate conversion and transmission of data. After receiving the fault injection command, the embedded software under test enters the receiving interrupt, parses the communication message, changes the value of the physical quantity according to the communication protocol, and performs fault injection.
[0020] Further, in step 3, the underlying fault injection tool of the virtualized system, such as CPU, memory, and file system faults, is used. The CPU fault injection is performed by injecting faults into the registers of all processes, the memory fault injection is performed by intercepting memory-related system calls and modifying their parameters, and the file system fault is injected by intercepting system calls for file operations through the kprobes kernel probe technology;
[0021] Furthermore, in step 4, based on the above technical solution, the management mechanism layer fault injection tool obtains normal external stimuli from the data interface suite and replaces them with erroneous data based on the test, thereby realizing the virtualization fault injection test.
[0022] In steps 1-4, the embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.
[0023] Furthermore, the fault injection tool set described in the six modules in step 1 realizes multi-level and multi-target fault injection of the virtualization system; the load set contains corresponding loads that cooperate with each fault injection tool; the fault injection tool management is used to complete the automated testing and configuration deployment of the fault injection tool; the load management refers to the responsibility for managing the occurrence and termination of the load required for the fault injection experiment; the user interaction is used to guide the user to complete the fault injection work; the fault injection log management module is used to reliably record the fault injection log for use in result analysis.
[0024] Furthermore, before implementing step 1, a secure logging mechanism should be established so that subsequent testers have a basis for analyzing the experimental results.
[0025] Furthermore, after step 4 is completed, a virtualized environment for the fault injection test is deployed, including an industrial computer, a test machine with several virtual machines installed, various modules of the platform are deployed on the control machine, and various fault injection tools and loads are deployed on the test machine. After the deployment is completed, the fault injection test verification is carried out.
[0026] Furthermore, in any of steps 1-4, if an abnormal situation occurs during fault injection, the PC-side control power supply is reset and restarted; after the fault injection is completed, the PC-side control power supply restarts the system to reset.
[0027] Compared with the prior art, the advantages of the present invention are: by applying advanced digital virtual technology, a virtual hardware platform is created for the operation of embedded software, so that it no longer relies on the actual embedded system hardware environment, and directly simulates and injects faults into the embedded software in a flexible manner according to the communication protocol. The characteristics of virtualization make the fault injection technology not require specific hardware equipment and do not cause damage to the hardware. It can improve the accuracy and portability of fault injection, greatly reduce development costs, and effectively ensure the effectiveness of embedded software testing. The present invention can realize the automatic operation of fault injection, save time and labor costs, and has broad development prospects not only in the field of aviation electromechanical, but also in the automotive industry, computer field and automation control industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for describing the embodiments are briefly introduced below.
[0029] Figure 1 The present invention is a flowchart of an embedded software fault injection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical scheme and advantages of the implementation of the present invention clearer, the technical scheme in the embodiment of the present invention will be described in more detail in combination with the embodiment of the present invention. In the example, the same or similar reference numerals throughout represent the same or similar originals or elements with the same or similar functions. The described embodiments are part of the embodiments of the present invention, not all of them. The embodiments described below by reference are exemplary and intended to be used to explain the present invention, and should not be construed as limitations on the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The following is a detailed description in combination with the embodiments of the present invention.
[0031] In order to more intuitively and clearly describe the structural principles and working methods in the examples of the present invention, the embodiments will be introduced in conjunction with relevant drawings. In view of the defects existing in the current embedded software testing technology, the purpose of the present invention is to provide an embedded software virtualization fault injection method that can effectively ensure the development of embedded software testing work.
[0032] Build an integrated digital system simulation and verification platform for embedded software and a data interface for data interaction, create underlying fault injection tools and management mechanism layer fault injection tools to realize the testing of virtualized fault injection of embedded software.
[0033] To achieve the above object, the present invention provides an embedded software virtualization fault injection method, which specifically includes the following steps:
[0034] Step 1
[0035] Build an integrated digital system simulation and verification platform for embedded software, and test the fault tolerance of the embedded software under test based on this platform;
[0036] Step 2
[0037] Then construct a data interface for communication and data interaction with the embedded software to be tested, which contains the correspondence between the communication protocol and various physical quantities, and parses the corresponding data in the communication protocol into physical quantities, or packages the physical quantities into the communication protocol format according to the communication rules and sends them to the embedded software;
[0038] Step 3
[0039] Create low-level fault injection tools for virtualized systems, including CPU, memory, and file system faults;
[0040] Step 4
[0041] Create a virtualization management mechanism layer fault injection tool, obtain normal external stimuli from the data interface suite, and replace them with erroneous data based on the test, so as to implement virtualization fault injection testing.
[0042] In step 1, the integrated digital system simulation and verification platform of the embedded software is based on digital virtual simulation technology to build digital virtualization of the hardware platform running the embedded software, including virtualization of computing resources, storage resources, network resources, etc.;
[0043] In step 1, the integrated digital system simulation and verification platform of the embedded software is composed of a digital processor and a digital communication chip, and the platform is divided into six modules: fault injection tool set, load set, fault injection tool management, load management, user interaction, and log management;
[0044] In step 1, the integrated digital system simulation and verification platform of the embedded software takes as input the hardware platform design plan, design description, and product manual, and outputs an embedded system virtual environment based on the above input, thereby realizing software simulation verification independent of hardware.
[0045] In step 2, the data interface suite integrates a variety of communication protocols and physical quantities, and defines in detail the precise mapping relationship between these protocols and physical quantities to ensure accurate conversion and transmission of data. After receiving the fault injection command, the embedded software under test enters the receiving interrupt, parses the communication message, changes the value of the physical quantity according to the communication protocol, and performs fault injection.
[0046] In step 3, the underlying fault injection tool of the virtualized system, such as CPU, memory, and file system faults, is used. The CPU fault injection is performed by injecting faults into the registers of all processes. The memory fault injection is performed by intercepting memory-related system calls and modifying their parameters. The file system fault is injected by intercepting system calls for file operations through the kprobes kernel probe technology.
[0047] In step 4, based on the above technical solution, the management mechanism layer fault injection tool obtains normal external stimuli from the data interface suite and replaces them with erroneous data based on the test, thereby realizing the virtualization fault injection test.
[0048] In steps 1-4, the embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.
[0049] In a certain implementation case of the present invention, the fault injection tool set described in the six modules in step 1 realizes multi-level and multi-target fault injection of the virtualization system; the load set includes corresponding loads that cooperate with each fault injection tool; the fault injection tool management is used to complete the automated testing and configuration deployment of the fault injection tool; the load management refers to the responsibility for managing the occurrence and termination of the load required for the fault injection experiment; the user interaction is used to guide the user to complete the fault injection work; the fault injection log management module is used to reliably record the fault injection log for use in result analysis.
[0050] In a certain implementation case of the present invention, before implementing step 1, a secure log recording mechanism should be established so that subsequent testers have a basis for analyzing the experimental results.
[0051] In a certain implementation case of the present invention, after step 4 is completed, a virtualized environment for a fault injection evaluation experiment is deployed, including an industrial computer, a test machine with several virtual machines installed, various modules of the platform are deployed on the control machine, and various fault injection tools and loads are deployed on the test machine. After the deployment is completed, a fault injection test verification is performed.
[0052] In a certain implementation case of the present invention, in a certain step of steps 1-4, if an abnormal situation occurs when the fault is injected, the PC-side control power is reset and restarted; when the fault injection is completed, the PC-side control power restarts the system to reset.
[0053] It is understood by those skilled in the art that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of ordinary technicians in the field to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and unless defined as here, will not be interpreted with idealized or overly formal meanings. The specific implementation methods described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the present invention. Within the spirit and principle of the present invention, any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment of equivalent changes for application in other fields, but any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the technical solution content of the present invention, any modification, equivalent replacement, improvement, etc., made according to the technical essence of the present invention, should be included in the protection scope of the present invention.
Claims
1. A method for virtualizing fault injection in embedded software, characterized in that: The specific steps include: Step 1 Build an integrated digital system simulation and verification platform for embedded software, and test the fault tolerance of the embedded software under test based on this platform; Step 2 Then construct a data interface for communication and data interaction with the embedded software to be tested, which contains the correspondence between the communication protocol and various physical quantities, and parses the corresponding data in the communication protocol into physical quantities, or packages the physical quantities into the communication protocol format according to the communication rules and sends them to the embedded software; Step 3 Create low-level fault injection tools for virtualized systems, including CPU, memory, and file system faults; Step 4 Create a virtualization management mechanism layer fault injection tool, obtain normal external stimuli from the data interface suite, and replace them with erroneous data based on the test, so as to implement virtualization fault injection testing.
2. The method according to claim 1, characterized in that In step 1, the integrated digital system simulation and verification platform of the embedded software is based on digital virtual simulation technology to build digital virtualization of the hardware platform running the embedded software, including virtualization of computing resources, storage resources, network resources, etc.
3. The method according to claim 2, characterized in that In step 1, the integrated digital system simulation and verification platform of the embedded software is composed of a digital processor and a digital communication chip, and the platform is divided into six modules: fault injection tool set, load set, fault injection tool management, load management, user interaction, and log management.
4. The method according to claim 3, characterized in that In step 1, the integrated digital system simulation and verification platform of the embedded software takes as input the hardware platform design plan, design description, and product manual, and outputs an embedded system virtual environment based on the above input, thereby realizing software simulation verification independent of hardware.
5. The method according to claim 4, characterized in that In step 2, the data interface kit integrates a variety of communication protocols and physical quantities, and defines in detail the precise mapping relationship between these protocols and physical quantities to ensure accurate conversion and transmission of data; after receiving the fault injection command, the embedded software under test enters the receiving interrupt, parses the communication message, changes the value of the physical quantity according to the communication protocol, and executes the fault injection.
6. The method according to claim 5, characterized in that In step 3, the underlying fault injection tools of the virtualization system, such as CPU, memory, and file system faults, CPU fault injection adopts the method of injecting faults into the registers of all processes, memory fault injection intercepts memory-related system calls and modifies their parameters, and file system faults are injected by intercepting system calls for file operations through kprobes kernel probe technology.
7. The method according to claim 6, characterized in that In step 4, based on the above technical solution, the management mechanism layer fault injection tool obtains normal external stimuli from the data interface suite and replaces them with erroneous data based on the test, thereby realizing the virtualization fault injection test.
8. The method according to claim 1, characterized in that In step 4, the embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.
9. The method according to claim 8, characterized in that The fault injection tool set described in the six modules in step 1 realizes multi-level and multi-target fault injection of the virtualized system; the load set includes corresponding loads that cooperate with each fault injection tool; the fault injection tool management is used to complete the automated testing and configuration deployment of the fault injection tool; the load management refers to the generation and termination of the load required for the management of the fault injection experiment; The user interaction is used to guide the user to complete the fault injection work; The fault injection log management module is used to reliably record fault injection logs for use in result analysis.
10. The method according to claim 9, characterized in that Before implementing step 1, a secure logging mechanism should be established so that subsequent testers can have a basis for analyzing the experimental results; After step 4 is completed, deploy the virtualized environment of the fault injection evaluation experiment, including an industrial computer and a test machine with several virtual machines installed. Deploy the various modules of the platform on the control machine, and deploy the various fault injection tools and loads on the test machine. After the deployment is completed, perform the fault injection test verification. If an abnormal situation occurs when the fault is injected, the PC-side control power supply is reset and re-up; When the fault injection is complete, the PC controls the power supply to restart the system and reset it.
Citation Information
Cited By
Embedded software full-digital deployment verification platform
CN121764814A