Equipment function test method and device based on fault injection, electronic equipment and storage medium

By acquiring and adjusting the processing signals of the target device for fault testing, combined with simulation and continuous injection technology, the problem of low efficiency of device functional testing in the existing technology is solved, and efficient and accurate fault detection and functional degradation are achieved.

CN118550783APending Publication Date: 2024-08-27CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410423490.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-09
Publication Date
2024-08-27

Smart Images

  • Figure CN118550783A
    Figure CN118550783A
Patent Text Reader

Abstract

The embodiment of the invention relates to an equipment function testing method and device based on fault injection, electronic equipment and a storage medium, and the method comprises the steps: obtaining a target processing signal of target equipment, and enabling the target processing signal to be used for achieving a target function of the target equipment; the signal value of the target processing signal serves as an initial signal value, the initial signal value is adjusted to be a fault signal value corresponding to the target processing signal, a fault test signal of the target equipment is obtained, and the fault test signal is used for testing the target function; determining an actual processing result, the actual processing result representing a processing result of the target device on the fault test signal; and generating a test result of the target function based on the actual processing result. Therefore, the fault test signal used for testing the target function of the target equipment can be generated through the target processing signal used for realizing the target function of the target equipment, and then the fault test signal is used for performing the fault test aiming at the function, so that the efficiency of the function test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method, a device, an electronic device and a storage medium for testing device functions based on fault injection. Background Art

[0002] With the development of science and technology, the functions integrated in equipment are becoming increasingly rich, and some mechanical equipment and intelligent devices have more and more functions. Usually, before the equipment is put into actual use, it is necessary to perform functional testing on it to ensure that it operates normally during use. In related technologies, the testing of equipment functions based on fault injection often requires a complex and lengthy process, which is due to the many functions of the equipment on the one hand and the high complexity of the real environment on the other.

[0003] It can be seen that how to improve the testing efficiency of device functions based on fault injection is a technical issue worthy of attention. Summary of the invention

[0004] In view of this, in order to solve some or all of the above-mentioned technical problems, the embodiments of the present application provide a method, an apparatus, an electronic device and a storage medium for testing device functions based on fault injection.

[0005] In a first aspect, an embodiment of the present application provides a method for testing a device function based on fault injection, the method comprising:

[0006] Acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device;

[0007] Using the signal value of the target processing signal as the initial signal value, and adjusting the initial signal value to the fault signal value corresponding to the target processing signal, to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function;

[0008] Determining an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal;

[0009] Based on the actual processing result, a test result of the target function is generated.

[0010] In a possible implementation, the step of using the signal value of the target processing signal as an initial signal value, and adjusting the initial signal value to a fault signal value corresponding to the target processing signal to obtain a fault test signal of the target device includes:

[0011] Acquire a test case for testing the target function; wherein the test case includes a fault signal value; the fault signal value is a signal value of a fault test signal corresponding to the target processing signal;

[0012] The signal value of the target processing signal is used as an initial signal value, and the initial signal value is adjusted to the fault signal value included in the test case to obtain a fault test signal of the target device.

[0013] In a possible implementation manner, the test case further includes a target processing result; the target processing result indicates a processing result of the target device on the fault test signal corresponding to the target processing signal; and

[0014] The generating the test result of the target function based on the actual processing result includes:

[0015] Determine whether the actual processing result matches the target processing result to obtain discrimination information;

[0016] In a case where the discrimination information indicates that the actual processing result matches the target processing result, generating a first test result, wherein the first test result indicates that the result of testing the target function is that the test passes;

[0017] In a case where the determination information indicates that the actual processing result does not match the target processing result, a second test result is generated, wherein the first test result indicates that the result of testing the target function is that the test fails.

[0018] In a possible implementation, generating the test result of the target function based on the actual processing result includes:

[0019] Based on the actual processing result, a test result of functional degradation of the target function is generated.

[0020] In a possible implementation manner, there is a target time period during which the target device is in a non-restart state, wherein the target time period represents a time period between two times of generating test results using the device function test method based on fault injection.

[0021] In a possible implementation manner, after determining a processing result of the target device on the fault test signal, the method further includes:

[0022] Adjusting the fault signal value of the fault test signal of the target device to the initial signal value to obtain the target processing signal;

[0023] The target device is controlled to process the target processing signal.

[0024] In a possible implementation manner, determining a processing result of the target device on the fault test signal includes:

[0025] Inputting the fault test signal to a simulation module of the target function of the target device, wherein the simulation module is used to simulate the processing logic of the target device to implement the target function;

[0026] Obtaining a processing result of the simulation module on the fault test signal;

[0027] The processing result of the fault test signal by the simulation module is determined as the processing result of the fault test signal by the target device.

[0028] In a possible implementation manner, the target processing signal is generated in the following manner:

[0029] Acquire the signal output by the target device through sensing and interacting with the simulation environment, and obtain the target processing signal;

[0030] The simulation environment is used to simulate the environment where the target device is located.

[0031] In a possible implementation manner, the target device is a vehicle, and the target function includes at least one of the following: a bus function, a sensor function, a button function, a positioning function, a map function, a chassis function, and a target recognition function.

[0032] In a second aspect, an embodiment of the present application provides a device for testing device functions based on fault injection, the device comprising:

[0033] an acquisition unit, configured to acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device;

[0034] a first adjustment unit, configured to use the signal value of the target processing signal as an initial signal value, and adjust the initial signal value to a fault signal value corresponding to the target processing signal, so as to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function;

[0035] a determining unit, configured to determine an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal;

[0036] A generating unit is used to generate a test result of the target function based on the actual processing result.

[0037] In a possible implementation, the step of using the signal value of the target processing signal as an initial signal value, and adjusting the initial signal value to a fault signal value corresponding to the target processing signal to obtain a fault test signal of the target device includes:

[0038] Acquire a test case for testing the target function; wherein the test case includes a fault signal value; the fault signal value is a signal value of a fault test signal corresponding to the target processing signal;

[0039] The signal value of the target processing signal is used as an initial signal value, and the initial signal value is adjusted to the fault signal value included in the test case to obtain a fault test signal of the target device.

[0040] In a possible implementation manner, the test case further includes a target processing result; the target processing result indicates a processing result of the target device on the fault test signal corresponding to the target processing signal; and

[0041] The generating the test result of the target function based on the actual processing result includes:

[0042] Determine whether the actual processing result matches the target processing result to obtain discrimination information;

[0043] In a case where the discrimination information indicates that the actual processing result matches the target processing result, generating a first test result, wherein the first test result indicates that the result of testing the target function is that the test passes;

[0044] In a case where the determination information indicates that the actual processing result does not match the target processing result, a second test result is generated, wherein the first test result indicates that the result of testing the target function is that the test fails.

[0045] In a possible implementation, generating the test result of the target function based on the actual processing result includes:

[0046] Based on the actual processing result, a test result of functional degradation of the target function is generated.

[0047] In a possible implementation manner, there is a target time period during which the target device is in a non-physical key restart state, wherein the target time period represents a time period between two times of generating test results using the device function test apparatus based on fault injection.

[0048] In a possible implementation manner, after determining the processing result of the target device on the fault test signal, the apparatus further includes:

[0049] A second adjustment unit, configured to adjust a fault signal value of a fault test signal of the target device to the initial signal value to obtain the target processing signal;

[0050] A control unit is used to control the target device to process the target processing signal.

[0051] In a possible implementation manner, determining a processing result of the target device on the fault test signal includes:

[0052] Inputting the fault test signal to a simulation module of the target function of the target device, wherein the simulation module is used to simulate the processing logic of the target device to implement the target function;

[0053] Obtaining a processing result of the simulation module on the fault test signal;

[0054] The processing result of the fault test signal by the simulation module is determined as the processing result of the fault test signal by the target device.

[0055] In a possible implementation manner, the target processing signal is generated in the following manner:

[0056] Acquire the signal output by the target device through sensing and interacting with the simulation environment, and obtain the target processing signal;

[0057] The simulation environment is used to simulate the environment where the target device is located.

[0058] In a possible implementation manner, the target device is a vehicle, and the target function includes at least one of the following: a bus function, a sensor function, a button function, a positioning function, a map function, a chassis function, and a target recognition function.

[0059] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0060] Memory for storing computer programs;

[0061] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method of any embodiment of the device function testing method based on fault injection in the first aspect of the present application is implemented.

[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any embodiment of the device function testing method based on fault injection as described in the first aspect above is implemented.

[0063] In a fifth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code is executed on a device, the processor in the device implements a method of any embodiment of the device function testing method based on fault injection as described in the first aspect above.

[0064] The device function testing method based on fault injection provided in the embodiment of the present application can obtain the target processing signal of the target device, wherein the target processing signal is used to realize the target function of the target device, and then the signal value of the target processing signal is used as the initial signal value, and the initial signal value is adjusted to the fault signal value corresponding to the target processing signal, so as to obtain the fault test signal of the target device, wherein the fault test signal is used to test the target function, and then the actual processing result is determined, wherein the actual processing result represents the processing result of the target device on the fault test signal, and finally, based on the actual processing result, the test result of the target function is generated. Thus, the fault test signal for testing the function can be generated by the target processing signal for realizing the target function of the target device, and then the fault test signal can be used to perform a fault test on the function, thereby improving the efficiency of functional testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0067] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0068] Figure 1 A flowchart of a method for testing device functions based on fault injection provided in an embodiment of the present application;

[0069] Figure 2 A flowchart of another method for testing device functions based on fault injection provided in an embodiment of the present application;

[0070] Figure 3A framework diagram of a device function testing system based on fault injection provided in an embodiment of the present application;

[0071] Figure 4 A fault injection flow chart of a method for testing device functions based on fault injection provided in an embodiment of the present application;

[0072] Figure 5 A flowchart of an evaluation method for testing device functions based on fault injection provided in an embodiment of the present application;

[0073] Figure 6 A schematic diagram of the structure of a device function testing device based on fault injection provided in an embodiment of the present application;

[0074] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values ​​described in these embodiments do not limit the scope of the present application.

[0076] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.

[0077] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.

[0078] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0079] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0080] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0081] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.

[0082] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment should be considered as part of the specification.

[0083] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0084] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0085] In order to solve the technical problem of how to improve the efficiency of functional testing in the prior art, the present application provides a testing method, apparatus, electronic device and storage medium for device functions based on fault injection, which can improve the efficiency of functional testing.

[0086] Figure 1 A flow chart of a method for testing device functions based on fault injection provided in an embodiment of the present application. This method can be applied to one or more electronic devices such as vehicles (e.g., autonomous driving vehicles), smart phones, laptops, desktop computers, portable computers, servers, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or a plurality of electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. It is not specifically limited here.

[0087] like Figure 1 As shown, the method specifically includes:

[0088] Step 101: Acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device.

[0089] In this embodiment, the target device may be any device having a signal processing function, such as a computer, a vehicle, a smart home device, etc.

[0090] The target function may be any one or more functions that the target device implements by processing the signal. For example, when the target device is a computer, the target function may include at least one of the following: Bluetooth function, screen projection function, image acquisition function, etc.

[0091] In some optional implementations of this embodiment, when the target device is a vehicle, the target function includes at least one of the following: a bus function, a sensor function, a button function, a positioning function, a map function, a chassis function, and a target recognition function.

[0092] The above bus function may include at least one of the following:

[0093] Data Bus: Transfers data that needs to be processed or stored back and forth between the CPU (Central Processing Unit) and RAM (Random Access Memory).

[0094] Address Bus: Used to specify the address of data stored in RAM.

[0095] Control Bus: Transmits signals from the microprocessor control unit to peripheral devices.

[0096] Expansion Bus: A bus for data communication between external devices and the computer host, such as the ISA (Instruction Set Architecture) bus and the PCI (Peripheral Component Interconnect) bus.

[0097] Local Bus: Replaces the expansion bus for higher speed data transmission.

[0098] It can be understood that in the above-mentioned optional implementation method, one or more target processing signals for implementing one or more functions of the vehicle's bus function, sensor function, button function, positioning function, map function, chassis function, and target recognition function can be used to generate a fault test signal for testing the corresponding function, and then the fault test signal can be used to perform a fault test on the corresponding function, thereby improving the efficiency of vehicle function testing.

[0099] The number of target processing signals may be one or more. For example, when a target function of a target device needs to be tested for a fault, one or more signals for implementing the target function may be selected and determined as target processing signals.

[0100] In some optional implementations of this embodiment, the target processing signal is generated in the following manner:

[0101] The signal output by the target device through sensing and interacting with the simulation environment is obtained to obtain a target processed signal. In other words, the target processed signal may be a signal output by the target device through sensing and interacting with the simulation environment.

[0102] The simulation environment is used to simulate the environment where the target device is located.

[0103] It can be understood that in the above-mentioned optional implementation method, the target processing signal can be generated through the simulation environment. In this way, a more comprehensive functional test of the target device can be achieved by simulating environments in more scenarios, and there is no need to change the actual environment in which the target device is located. Therefore, the cost of functional testing of the target device can be reduced and the efficiency of functional testing of the target device can be improved.

[0104] Optionally, the target processing signal may also be a signal output by the target device through sensing and interacting with an actual environment (rather than a simulated environment).

[0105] Here, in some cases, the signal value of the target processing signal (i.e., the initial signal value) can be the normal value of the target processing signal. For example, if the normal value of the target processing signal x (i.e., the initial signal value) is 5, then any value other than 5 can be used as the fault signal value (i.e., the abnormal signal value).

[0106] Step 102, taking the signal value of the target processing signal as the initial signal value, and adjusting the initial signal value to the fault signal value corresponding to the target processing signal, to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function.

[0107] In this embodiment, the initial signal value may be a signal value of the target processing signal. In some cases, the initial signal value may be a normal signal value of the target processing signal. The fault signal value may be any signal value other than the initial signal value. In some cases, the fault signal value may be an abnormal signal value of the target processing signal.

[0108] Each signal (including the target processing signal) may correspond to one or more initial signal values ​​(eg, normal signal values), and each signal (including the target processing signal) may correspond to one or more additional fault signal values ​​(eg, abnormal signal values).

[0109] In practice, the fault signal value may be any signal value different from the initial signal value; or it may be a signal value pre-set for the target processing signal and indicating that a target function corresponding to the target processing signal has failed.

[0110] The fault test signal may be a fault test signal obtained by taking the signal value of the target processing signal as the initial signal value and adjusting the initial signal value to the fault signal value corresponding to the target processing signal.

[0111] Step 103: determining an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal.

[0112] In this embodiment, after the fault test signal is obtained, a processing result of the fault test signal may be generated via a target device entity or a simulation application of the target device.

[0113] The actual processing result may be a processing result of the target device on the fault test signal.

[0114] Step 104: Generate a test result of the target function based on the actual processing result.

[0115] In this embodiment, after obtaining the actual processing result, the test result of the target function can be further generated based on the actual processing result. For example, the test result of the target function can be generated by determining the matching degree between the actual processing result and the preset processing result.

[0116] The above test results can indicate whether the target function can be downgraded or exited when a failure occurs in the target function.

[0117] In some cases, the present method for testing device functions based on fault injection can be executed once or multiple times. As an example, when the present method for testing device functions based on fault injection is executed once, it can be used to test the situation where the target function fails only at a certain moment; when the present method for testing device functions based on fault injection is executed multiple times, it can be used to test the situation where the target function fails at multiple moments, for example, multiple faults occur at short intervals or multiple faults occur at long intervals.

[0118] In some optional implementations of this embodiment, the following method may be used to generate the test result of the target function based on the actual processing result:

[0119] Based on the actual processing result, a test result of functional degradation of the target function is generated.

[0120] Here, functional degradation means that in some cases, due to system failure, environmental changes or other unforeseen factors, the target device cannot operate normally or provide full functions. The target device can automatically reduce its functional level to ensure safety and reliability.

[0121] For example, in the field of autonomous driving, when the autonomous driving system detects certain risks or fails to meet safety requirements, a functional degradation strategy can be adopted to switch the autonomous driving mode to an assisted driving mode or a fully manual driving mode. This can reduce reliance on the autonomous driving system and return control to the driver to ensure safe operation of the vehicle. Functional degradation can include temporarily disabling certain advanced autonomous driving functions, limiting the operating range or connectivity of the vehicle, or requiring the driver to take over control. The purpose is to ensure the safety of the vehicle and passengers by reducing the complexity and risks of the system.

[0122] Functional degradation is an important safety strategy for autonomous driving systems, which aims to handle various abnormal situations and maintain vehicle operation while maintaining safety.

[0123] It can be understood that in the above optional implementation, a test result of functional degradation of the target function can be generated, so that the security of the target device during operation can be improved.

[0124] In some optional implementations of this embodiment, there is a target time period during which the target device is in a non-restart state.

[0125] The target time period refers to the time period between two times of generating test results using the device function test method based on fault injection.

[0126] Here, in the case where the device function testing method based on fault injection is executed multiple times, the target device may (but not necessarily) not need to be restarted between two executions of the method.

[0127] It can be understood that in the above optional implementation, multiple functional tests of the target device can be performed without restarting the target device, thereby avoiding the impact of restart on the test results, thereby improving the accuracy of the functional test and improving the efficiency of the functional test.

[0128] In some optional implementations of this embodiment, after determining the processing result of the target device on the fault test signal, the following steps may also be performed:

[0129] The first step is to adjust the fault signal value of the fault test signal of the target device to the initial signal value to obtain the target processing signal.

[0130] The second step is to control the target device to process the target processing signal.

[0131] It can be understood that in the above optional implementation, after the test is completed, the target processing signal can be restored so that the target device can process the normal signal, thereby facilitating subsequent functional testing.

[0132] In some optional implementations of this embodiment, the following method may be used to determine the processing result of the target device on the fault test signal:

[0133] The first step is to input the fault test signal into the simulation module of the target function of the target device.

[0134] The simulation module is used to simulate the processing logic of the target device to implement the target function.

[0135] The second step is to obtain the processing result of the simulation module on the fault test signal.

[0136] The third step is to determine the processing result of the simulation module on the fault test signal as the processing result of the target device on the fault test signal.

[0137] It can be understood that in the above optional implementation, the target processing result of the fault test signal can be obtained through the simulation module, so that the cost of functional testing can be reduced by reducing the amount of data actually processed by the target device and reducing the loss of the target device.

[0138] The device function testing method based on fault injection provided in the embodiment of the present application can obtain the target processing signal of the target device, wherein the target processing signal is used to realize the target function of the target device, and then the signal value of the target processing signal is used as the initial signal value, and the initial signal value is adjusted to the fault signal value corresponding to the target processing signal, so as to obtain the fault test signal of the target device, wherein the fault test signal is used to test the target function, and then the actual processing result is determined, wherein the actual processing result represents the processing result of the target device on the fault test signal, and finally, based on the actual processing result, the test result of the target function is generated. Thus, the fault test signal for testing the function can be generated by the target processing signal for realizing the target function of the target device, and then the fault test signal can be used to perform a fault test on the function, thereby improving the efficiency of functional testing.

[0139] Figure 2 A flowchart of another method for testing device functions based on fault injection provided in an embodiment of the present application. Figure 2As shown, the method specifically includes:

[0140] Step 201: Acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device.

[0141] In this embodiment, step 201 and Figure 1 Step 101 in the corresponding embodiment is basically the same and will not be described again here.

[0142] Step 202, obtaining a test case for testing the target function; wherein the test case includes a fault signal value; the fault signal value is a signal value of a fault test signal corresponding to the target processing signal.

[0143] In this embodiment, after a test requirement for a target function of a target device is generated, a test case may be determined based on the test requirement.

[0144] Step 203, taking the signal value of the target processing signal as the initial signal value, and adjusting the initial signal value to the fault signal value included in the test case, to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function.

[0145] In this embodiment, the initial signal value may be a signal value of the target processing signal. In some cases, the initial signal value may be a normal signal value of the target processing signal. The fault signal value may be any signal value other than the initial signal value. In some cases, the fault signal value may be an abnormal signal value of the target processing signal.

[0146] Each signal (including the target processing signal) may correspond to one or more initial signal values ​​(eg, normal signal values), and each signal (including the target processing signal) may correspond to one or more additional fault signal values ​​(eg, abnormal signal values).

[0147] In practice, the fault signal value may be any signal value different from the initial signal value; or it may be a signal value pre-set for the target processing signal and indicating that a target function corresponding to the target processing signal has failed.

[0148] The fault test signal may be a fault test signal obtained by taking the signal value of the target processing signal as the initial signal value and adjusting the initial signal value to the fault signal value corresponding to the target processing signal.

[0149] Step 204: determine an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal.

[0150] In this embodiment, step 204 and Figure 1 Step 103 in the corresponding embodiment is basically the same and will not be described again here.

[0151] Step 205: Generate a test result of the target function based on the actual processing result.

[0152] In this embodiment, step 205 and Figure 1 Step 104 in the corresponding embodiment is basically the same and will not be described again here.

[0153] In some optional implementations of this embodiment, the test case further includes a target processing result. The target processing result indicates the processing result of the target device on the fault test signal corresponding to the target processing signal. In other words, the target processing result may indicate the expected processing result of the target device processing the fault test signal.

[0154] On this basis, the following method can be used to generate the test result of the target function based on the actual processing result:

[0155] The first step is to determine whether the actual processing result matches the target processing result to obtain discrimination information.

[0156] The determination information may indicate whether the actual processing result matches the target processing result.

[0157] In the second step, when the discrimination information indicates that the actual processing result matches the target processing result, a first test result is generated.

[0158] The first test result indicates that the result of testing the target function is that the test passed;

[0159] In the second step, when the discrimination information indicates that the actual processing result does not match the target processing result, a second test result is generated.

[0160] The first test result indicates that the result of testing the target function is that the test failed.

[0161] It can be understood that in the above optional implementation, the result of testing the target function can be generated by determining whether the actual processing result matches the target processing result, so that the efficiency of the function test can be further improved.

[0162] It should be noted that, in addition to the above contents, this embodiment may also include Figure 1 The corresponding technical features described in the corresponding embodiments are realized Figure 1 The technical effect of the device function testing method based on fault injection is shown in the figure. For details, please refer to Figure 1For the sake of brevity, the relevant description is not repeated here.

[0163] The device function testing method based on fault injection provided in the embodiment of the present application determines the fault signal value of the target processing signal through a test case, and then generates a fault test signal accordingly, thereby further improving the efficiency of testing the target function of the target device.

[0164] The following is an example in which the target device is an autonomous driving vehicle to illustrate the embodiments of the present application. However, it should be noted that the embodiments of the present application may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiments of the present application.

[0165] With the continuous advancement and application of autonomous driving technology, autonomous driving systems are gradually becoming an important trend and development direction in the future transportation field. Against this background, the penetration rate of Advanced Driving Assistant System (ADAS) technology is also increasing year by year. During the driving process of the vehicle, ADAS can use sensors installed on the vehicle to sense the surrounding environment and collect relevant data, and improve the safety and comfort of car driving by pre-analyzing possible dangers. Due to the complexity of the ADAS system and the severity of accidents, ADAS functional fault injection degradation testing is particularly important. In related technologies, fault degradation testing can be performed based on bus injection channels. However, such solutions can only test bus functions. In addition, some solutions use fault injection configuration files to achieve simultaneous batch injection of multiple faults and improve test efficiency. However, due to the high complexity of the real environment, the system may run for a long time and constantly face various faults and abnormalities. The above-mentioned existing fault injection test methods have the following limitations: First, there is a lack of continuous injection and scripted injection considering faults, which affects the efficiency of fault degradation testing; second, there is a lack of standardized fault injection evaluation modules. Therefore, in response to the above problems, there is an urgent need to design a solution to better meet the needs of actual use during the function degradation test of the autonomous driving system.

[0166] The continuous injection refers to that a plurality of fault signals (ie the above-mentioned fault test signals) are injected in chronological order, and the system (ie the above-mentioned target device) does not need to be restarted.

[0167] Scripted injection refers to the process of automatically injecting faults without manual operation of the equipment through scripts in languages ​​such as Python and C++.

[0168] In view of this, the present invention takes into account that the autonomous driving system may have different degrees of failures in various aspects, such as the vehicle bus, sensors, button operations, etc., and the system needs to make correct fault alarm prompts, safety strategies, and function degradation behaviors. Therefore, the present invention proposes a test system for autonomous driving vehicle functions, including a fault automation injection module, a function status reset module, a simulation adaptation module, and an evaluation module.

[0169] Among them, the fault injection module is responsible for selecting the corresponding fault mode, fault category and specific fault signal, and triggering the script to implant the signal fault value (that is, the above-mentioned fault signal value); including time point injection, short-term intermittent injection, and long-term intermittent injection.

[0170] Among them, point-in-time injection refers to injecting a fault only once at a certain moment; short-term intermittent injection refers to injecting multiple faults at short intervals; long-term intermittent injection refers to injecting multiple faults at long intervals.

[0171] The fault value is the error value of a signal (that is, the target processing signal) (that is, the fault signal value). For example, the normal value of signal x is 5, and 10 is injected into the algorithm. This 10 is the fault value of signal x.

[0172] Then the fault signal is injected into the autonomous driving system under test. After receiving the fault signal, the autonomous driving system is tested to see whether its function can be normally exited or downgraded to a lower level, thereby generating the test result.

[0173] The simulation adaptation module is responsible for receiving the fault signal implanted midway, reorganizing the data structure and publishing the output; replacing the corresponding target information field with the target information injected by the script (that is, the above-mentioned fault signal value), and then sending it out.

[0174] The evaluation module is used to monitor function status, alarm prompts and other information, and automatically record the results in the test report. The results can indicate whether each use case passes or fails, whether the function is exited, or whether the function remains activated.

[0175] The function state reset module can be responsible for clearing the fault signal and reactivating or starting the driving or parking function after a test case is completed, so as to perform a second fault injection test, that is, controlling the target device to process the target processing signal.

[0176] In order to achieve the above characteristics, the present invention adopts the following technical solutions:

[0177] Step 1: Develop a closed-loop control tool chain of scenario simulation software, simulation adaptation module and the algorithm under test. In the closed loop, the scenario data sent by the scenario simulation software will be sent to the autonomous driving algorithm under test through the simulation adaptation module. The algorithm responds and issues control instructions, which are sent to the scenario simulation software through the adaptation module to control the virtual vehicle in the software.

[0178] Step 2: The automated fault injection module outputs a fault signal.

[0179] Step 3, the fault injection script cuts off the sending process, resets the signal and publishes the message; wherein, cutting off means that when there is no fault signal, the simulation adapter module is in a state of consistently sending the correct signal to the algorithm under test. When a fault needs to be injected, the fault injection script will cut off the sending process of the simulation adapter module, reset the fault signal, and then send it again; resetting can also be called rewriting, which can rewrite the signal value (that is, the initial signal value) of one of the signals (that is, the target processing signal mentioned above) into a fault value (that is, the fault signal value mentioned above), and then send it out. To achieve the purpose of fault injection; publishing a message means publishing these fault signals, the scene signals required by the algorithm.

[0180] Step 4, the evaluation module monitors the algorithm's functional status output, Hmi (Human-Machine Interface) output, and safety strategy output, and writes the results into a report document; Functional status output: mainly the activation status of the autonomous driving system function; Hmi output: fault prompt information, such as engine fault prompt, door open prompt, trunk open prompt, etc.; Safety strategy output: for example, emergency deceleration signal, pull over signal, etc.

[0181] Step 5: Clear the function status module, reactivate or enable the function, and perform the next round of automatic fault injection.

[0182] The development of the scenario simulation software, simulation adaptation module and closed-loop control tool chain of the algorithm under test in step 1 is based on simulation scenario software including but not limited to VTD (Virtual Test Drive) and PreScan (a test simulation software), and develops positioning simulation adaptation module, map simulation adaptation module, fusion target simulation adaptation module, chassis signal simulation adaptation module, based on communication protocols including but not limited to TCP / UDP (Transmission Control Protocol / UserDatagram Protocol), shellmemery, etc. to communicate, obtain the scenario data, target data (such as human targets, obstacle targets), and positioning data sent by the scenario simulation software, and package and send them to the algorithm under test. Develop a control signal feedback module, based on but not limited to zmq protocol and TCP / UDP communication protocol to obtain the control signal output of the algorithm under test and return it to the scenario simulation software for vehicle control, thereby realizing closed-loop simulation test of the algorithm under test.

[0183] The automatic fault injection module outputs a fault signal in step 2, which mainly includes two parts: a fault signal and a fault injection implementation. The fault signal is a hierarchical fault signal tree.

[0184] The first level is the fault injection mode, which includes point-in-time injection, short-term intermittent injection, and long-term intermittent injection.

[0185] Among them, one injection can be injection at a time point; multiple injections can be divided into short-term intermittent injection and long-term intermittent injection.

[0186] Here, when simulating the situation where multiple faults break out in a concentrated manner, short-term intermittent injection can be used; when simulating the situation where multiple faults occur normally one after another, long-term intermittent injection can be used. The time thresholds for short-term intermittent and long-term injection are 2s (seconds) and 5s. Injection with an interval less than 2s is short-term intermittent injection, and injection with an interval greater than 2s but less than 5s is long-term intermittent injection.

[0187]

[0188] In the above formula 1, f(x) represents the fault injection mode, which can be short-term intermittent injection or long-term intermittent injection. T represents the time interval between two tests.

[0189] The second level is the fault category, including target information "out of thin air", target information missed identification, target information jump, target information error, and target misidentification. Among them, target information "out of thin air" includes pedestrians, vehicles, and stationary obstacles suddenly outputting necessary information such as category, speed, acceleration, etc. at a certain moment; target information missed identification includes the disappearance or clearing of information such as category, position coordinates, speed status, acceleration status, etc. output by pedestrians, vehicles, and stationary obstacles at a certain moment; target information jump includes the short-term intermittent changes in the position coordinates, speed, acceleration, etc. of pedestrians, vehicles, and stationary obstacles within a certain period of time. Target information error includes the corresponding lateral and longitudinal errors in the movement information such as the position indicators and speed status of pedestrians, vehicles, and stationary obstacles at a certain moment. Error introduction includes but is not limited to random errors, normal distribution errors, etc.

[0190] The lateral position error refers to the deviation of the lateral position value. That is, the deviation of the Y value of the position coordinate (X, Y)

[0191] The longitudinal position error may refer to the deviation of the longitudinal position value, that is, the deviation of the X value of the position coordinate (X, Y).

[0192] The lateral velocity error means that the lateral velocity has a deviation.

[0193] The longitudinal speed error means that the longitudinal speed is deviated. The target is misidentified, including pedestrians, vehicles, stationary obstacles, etc. The category signal has changed, and the category is wrong.

[0194] The third level is the fault signal, which includes target information category, position coordinates, heading angle, and speed and acceleration status.

[0195] The fault injection script in step 3 cuts off the sending process, resets the signal and publishes the message based on programming languages ​​including but not limited to python, C++, matlab, etc. The cutting off the sending process refers to the fault injection script communicating with the fusion target simulation adapter module described in step 1 using protocols including but not limited to TCP and UDP, sending the signal to be injected to the adapter module, and the adapter module replaces the corresponding target information field with the target information injected by the script before publishing the message, and then sends it out with the specified topic name.

[0196] The evaluation module of step 4 monitors the functional status output, Hmi output, and security policy output of the algorithm, and writes the demerits into the report document including the algorithm output monitoring and result records. Among them, the algorithm output monitoring is to specify the signal category to be received through the communication protocol including but not limited to TCP / UDP, and receive the structure or proto signal of the functional status, Hmi output and security policy output. Among them, the reception of the proto signal needs to be serialized and deserialized for data compilation and parsing. The result record is based on but not limited to fwrite, xmlwrite in matlab, fout in c++, etc., and is written into files including but not limited to txt, word, csv or xml.

[0197] The function status module of step 5 is cleared, reactivated or enabled, and the next round of fault automation injection is performed, including resetting the fault signal to the initial value and the script operation function activation button. The fault signal is reset to the initial value, which directly reassigns the fault signals injected in this case to the default reasonable value; the script operation function activation button is to re-script and simulate the pressing of the corresponding tbox switch step signal and the parking command section step signal, as shown in the following formula 2.

[0198]

[0199] In the above formula 2, f(x) indicates the signal value of the activation switch signal, frame is the number of simulation running frames, index is the number of injection time frames, and 10 means that the key is pressed for 10 frames.

[0200] The above formula 2 simulates the process of activating the function of a real car. The activation signal of a real car is that the button is not pressed initially, the button is pressed at a certain moment, and then the button pops up and resets.

[0201] In order to simulate the key activation process of this function, the script has operations that set and reset the activation signal.

[0202] The present invention also provides a set of functional degradation test system for automatic and continuous fault injection for autonomous driving, which includes a PC (personal computer), scenario simulation software, a fault injection module, a functional state activation module, and an evaluation module.

[0203] Among them, the PC is used to display the real-time simulation visual information; the scene simulation software is used to run the simulation scene and simulate the control loop; the fault injection module is responsible for assigning the corresponding software interface signal through the code script according to the fault mode, fault category and fault signal, and modifying the corresponding fault data packet before the simulation closed loop sends the data packet; the function state activation module is to initialize all the fault injection signals to the original reasonable default values ​​after the last fault test, and then send them to the back-end algorithm to restore it to the uninhibited state. Among them, the uninhibited state is a state where all the conditions for activating the autonomous driving function are met. The evaluation module is responsible for obtaining the output of the algorithm module through the communication protocol, judging and outputting the results based on the judgment conditions and rules, and finally saving the test report locally.

[0204] This solution takes into account that the autonomous driving system will have different degrees of failures in various aspects, such as the vehicle bus, sensors, button operations, etc. The system needs to make correct fault alarm prompts, safety strategies, and functional degradation behaviors. Therefore, the present invention proposes a functional degradation test system for automatic continuous injection of faults for autonomous driving, including a fault automation injection module, a functional state reset module, a simulation adaptation module, and an evaluation module. The fault injection module is responsible for selecting the corresponding fault mode, fault category, and specific fault signal, and triggering the script to implant the signal fault value; the simulation adaptation module is responsible for receiving the fault signal implanted midway, reorganizing the data structure and publishing the output; the evaluation module is used to monitor the functional status, alarm prompts and other information, and automatically record the results in the test report; the functional state reset module is responsible for clearing the fault signal after a use case test is completed, and reactivating or starting the driving or parking function in order to perform a second fault injection test. The implementation of the functional degradation test method is divided into the following steps. The system framework diagram for implementing the functional degradation test method is shown in the following figure. Figure 3 shown.

[0205] Step 1: Develop a closed-loop control link between simulation data and the algorithm under test based on scenario simulation software;

[0206] Step 2: The automated fault injection module affects the front-end field information and outputs a fault signal;

[0207] Step 3: The fault injection script cuts off the sending process, resets the signal and publishes the message;

[0208] Step 4: The evaluation module monitors the algorithm’s functional status output, HMI output, and security policy output, and writes the demerits into a report document;

[0209] Step 5: Clear the function status module, reactivate or enable the function, and perform the next round of automatic fault injection.

[0210] The closed-loop control tool chain for developing scenario simulation software, simulation adaptation module and the algorithm under test is based on VTD (Virtual Test Drive) simulation scenario software, and develops positioning simulation adaptation module, map simulation adaptation module, fusion target simulation adaptation module, chassis signal simulation adaptation module, and communicates based on TCP communication protocol to obtain the scenario data, target data, and positioning data sent by the scenario simulation software, and packages and sends them to the algorithm under test. Develop a control signal feedback module, obtain the control signal output of the algorithm under test based on the zmq protocol communication protocol, and return it to the scenario simulation software for vehicle control, thereby realizing the closed-loop simulation test of the algorithm under test.

[0211] The fault signal output by the automatic fault injection module mainly includes two parts: fault signal and fault injection implementation. The fault signal is a hierarchical fault signal tree. The first level is the fault injection mode, including time point injection, short-term intermittent injection, and long-term intermittent injection. The time thresholds of short-term intermittent injection and long-term intermittent injection are 2s and 5s, respectively. Injection with an interval less than 2s is short-term intermittent injection, and injection with an interval greater than 2s and less than 5s is long-term intermittent injection. The details are as described in the above formula 1.

[0212] The second level is the fault category, including target information "out of thin air", target information missed identification, target information jump, target information error, and target misidentification. Among them, target information "out of thin air" includes pedestrians, vehicles, and stationary obstacles suddenly outputting necessary information such as category, speed, acceleration, etc. at a certain moment; target information missed identification includes the disappearance or clearing of information such as category, position coordinates, speed state, acceleration state, etc. output by pedestrians, vehicles, and stationary obstacles at a certain moment; target information jump includes the short-term intermittent changes in the position coordinates, speed, acceleration, etc. of pedestrians, vehicles, and stationary obstacles within a certain period of time. Target information error includes the corresponding lateral and longitudinal errors in the motion information such as the position index and speed state of pedestrians, vehicles, and stationary obstacles at a certain moment, and the error introduction includes but is not limited to random errors, normal distribution errors, etc. Target misidentification includes changes in the category signals of pedestrians, vehicles, stationary obstacles, etc., and the category is wrong. The third level is the fault signal, including target information category, position coordinates, heading angle, speed acceleration state.

[0213] The fault injection script cuts off the sending process, resets the signal and publishes the message based on programming languages ​​including but not limited to python, C++, matlab, etc. The cutting off the sending process refers to the fault injection script communicating with the fusion target simulation adapter module described in step 1 using protocols including but not limited to TCP and UDP, sending the signal to be injected to the adapter module, and the adapter module replaces the corresponding target information field with the target information injected by the script before publishing the message, and then sends it out. The fault injection process is as follows Figure 4 shown.

[0214] The evaluation module monitors the algorithm's functional status output, HMI output, and security policy output, and writes demerits into a report document including algorithm output monitoring and result records. Among them, the algorithm output monitoring is to specify the signal category to be received through a communication protocol including but not limited to TCP / UDP, and receive the structure or proto signal of the functional status, HMI output, and security policy output. Among them, the reception of the proto signal needs to be serialized and deserialized for data compilation and parsing. The result record is based on methods including but not limited to fwrite, xmlwrite in matlab, fout in c++, etc. and is written into files including but not limited to txt, word, csv or xml. Among them, the evaluation process flowchart is as follows Figure 5 shown.

[0215] The function status module clears, reactivates or starts the function, and performs the next round of fault automation injection, including resetting the fault signal to the initial value and the script operation function activation button. The fault signal is reset to the initial value, which directly reassigns the fault signals injected in this case to the default reasonable value; the script operation function activation button is to re-script and simulate the corresponding tbox switch step signal and parking command section step signal, as shown in the above formula 2.

[0216] The present invention also provides a test system for the function of an autonomous driving vehicle, which includes a PC, scene simulation software, a fault injection module, a function state activation module, and an evaluation module.

[0217] Among them, the PC is used to display the real-time simulation visual information; the scene simulation software is used to run the simulation scene and simulate the control loop; the fault injection module is responsible for assigning the corresponding software interface signal through the code script according to the fault mode, fault category and fault signal, and modifying the corresponding fault data packet before the simulation closed loop sends the data packet; the function status activation module is to initialize all the fault injection signals to the original reasonable default values ​​after the last fault test is completed, and then send them to the back-end algorithm to restore it to the uninhibited state; the evaluation module is responsible for obtaining the output of the algorithm module through the communication protocol, judging and outputting the results based on the judgment conditions and rules, and finally saving the test report locally.

[0218] It should be noted that, in addition to the contents recorded above, this embodiment may also include the technical features described in the above embodiments, so as to achieve the technical effect of the device function testing method based on fault injection shown above. Please refer to the above description for details. For the sake of brevity, it will not be repeated here.

[0219] The device function testing method based on fault injection provided in the embodiment of the present application improves the efficiency of function degradation testing through continuous injection and scripted injection of fault test signals and a standardized fault injection evaluation module.

[0220] Figure 6 A schematic diagram of a device function test apparatus based on fault injection provided in an embodiment of the present application. Specifically comprising:

[0221] An acquisition unit 401 is used to acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device;

[0222] A first adjustment unit 402 is configured to use the signal value of the target processing signal as an initial signal value, and adjust the initial signal value to a fault signal value corresponding to the target processing signal, so as to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function;

[0223] A determination unit 403, configured to determine an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal;

[0224] The generating unit 404 is used to generate the test result of the target function based on the actual processing result.

[0225] In a possible implementation, the step of using the signal value of the target processing signal as an initial signal value, and adjusting the initial signal value to a fault signal value corresponding to the target processing signal to obtain a fault test signal of the target device includes:

[0226] Acquire a test case for testing the target function; wherein the test case includes a fault signal value; the fault signal value is a signal value of a fault test signal corresponding to the target processing signal;

[0227] The signal value of the target processing signal is used as an initial signal value, and the initial signal value is adjusted to the fault signal value included in the test case to obtain a fault test signal of the target device.

[0228] In a possible implementation manner, the test case further includes a target processing result; the target processing result indicates a processing result of the target device on the fault test signal corresponding to the target processing signal; and

[0229] The generating the test result of the target function based on the actual processing result includes:

[0230] Determine whether the actual processing result matches the target processing result to obtain discrimination information;

[0231] In a case where the discrimination information indicates that the actual processing result matches the target processing result, generating a first test result, wherein the first test result indicates that the result of testing the target function is that the test passes;

[0232] In a case where the determination information indicates that the actual processing result does not match the target processing result, a second test result is generated, wherein the first test result indicates that the result of testing the target function is that the test fails.

[0233] In a possible implementation, generating the test result of the target function based on the actual processing result includes:

[0234] Based on the actual processing result, a test result of functional degradation of the target function is generated.

[0235] In a possible implementation manner, there is a target time period during which the target device is in a non-physical key restart state, wherein the target time period represents a time period between two times of generating test results using the device function test apparatus based on fault injection.

[0236] In a possible implementation manner, after determining the processing result of the target device on the fault test signal, the apparatus further includes:

[0237] A second adjustment unit (not shown in the figure), configured to adjust the fault signal value of the fault test signal of the target device to the initial signal value to obtain the target processing signal;

[0238] A control unit (not shown in the figure) is used to control the target device to process the target processing signal.

[0239] In a possible implementation manner, determining a processing result of the target device on the fault test signal includes:

[0240] Inputting the fault test signal to a simulation module of the target function of the target device, wherein the simulation module is used to simulate the processing logic of the target device to implement the target function;

[0241] Obtaining a processing result of the simulation module on the fault test signal;

[0242] The processing result of the fault test signal by the simulation module is determined as the processing result of the fault test signal by the target device.

[0243] In a possible implementation manner, the target processing signal is generated in the following manner:

[0244] Acquire the signal output by the target device through sensing and interacting with the simulation environment, and obtain the target processing signal;

[0245] The simulation environment is used to simulate the environment where the target device is located.

[0246] In a possible implementation manner, the target device is a vehicle, and the target function includes at least one of the following: a bus function, a sensor function, a button function, a positioning function, a map function, a chassis function, and a target recognition function.

[0247] The device function testing apparatus based on fault injection provided in this embodiment may be as follows: Figure 6 The device function testing apparatus based on fault injection shown in the figure can execute all the steps of the device function testing methods based on fault injection described above, thereby achieving the technical effects of the device function testing methods based on fault injection described above. For details, please refer to the above related description. For the sake of brevity, it will not be repeated here.

[0248] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 7The electronic device 500 shown includes: at least one processor 501, a memory 502, at least one network interface 504 and other user interfaces 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 505 is not shown in FIG. Figure 7 Various buses are labeled as bus system 505 .

[0249] The user interface 503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0250] It can be understood that the memory 502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0251] In some implementations, the memory 502 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 5021 and an application program 5022 .

[0252] Among them, the operating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 5022.

[0253] In this embodiment, by calling the program or instruction stored in the memory 502, specifically, the program or instruction stored in the application 5022, the processor 501 is used to execute the method steps provided by each method embodiment, for example, including:

[0254] Acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device;

[0255] Using the signal value of the target processing signal as the initial signal value, and adjusting the initial signal value to the fault signal value corresponding to the target processing signal, to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function;

[0256] Determining an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal;

[0257] Based on the actual processing result, a test result of the target function is generated.

[0258] The method disclosed in the above embodiment of the present application can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.

[0259] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.

[0260] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0261] The electronic device provided in this embodiment may be Figure 7 The electronic device shown in can execute all the steps of the above-mentioned test methods for device functions based on fault injection, thereby achieving the technical effects of the above-mentioned test methods for device functions based on fault injection. For details, please refer to the above related description. For the sake of brevity, it will not be repeated here.

[0262] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0263] When one or more programs in the storage medium can be executed by one or more processors, the above-mentioned device function testing method based on fault injection executed on the electronic device side is implemented.

[0264] The processor is used to execute the test program of the device function based on fault injection stored in the memory to implement the following steps of the device function test method based on fault injection performed on the electronic device side:

[0265] Acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device;

[0266] Using the signal value of the target processing signal as the initial signal value, and adjusting the initial signal value to the fault signal value corresponding to the target processing signal, to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function;

[0267] Determining an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal;

[0268] Based on the actual processing result, a test result of the target function is generated.

[0269] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0270] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0271] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0272] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for testing device functions based on fault injection, characterized in that: The method comprises: Acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device; Using the signal value of the target processing signal as the initial signal value, and adjusting the initial signal value to the fault signal value corresponding to the target processing signal, to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function; Determining an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal; Based on the actual processing result, a test result of the target function is generated.

2. The method according to claim 1, characterized in that The step of taking the signal value of the target processing signal as the initial signal value and adjusting the initial signal value to a fault signal value corresponding to the target processing signal to obtain a fault test signal of the target device includes: Acquire a test case for testing the target function; wherein the test case includes a fault signal value; the fault signal value is a signal value of a fault test signal corresponding to the target processing signal; The signal value of the target processing signal is used as an initial signal value, and the initial signal value is adjusted to the fault signal value included in the test case to obtain a fault test signal of the target device.

3. The method according to claim 2, characterized in that The test case also includes a target processing result; the target processing result indicates a processing result of the target device on the fault test signal corresponding to the target processing signal; as well as The generating the test result of the target function based on the actual processing result includes: Determine whether the actual processing result matches the target processing result to obtain discrimination information; In a case where the discrimination information indicates that the actual processing result matches the target processing result, generating a first test result, wherein the first test result indicates that the result of testing the target function is that the test passes; In a case where the determination information indicates that the actual processing result does not match the target processing result, a second test result is generated, wherein the first test result indicates that the result of testing the target function is that the test fails.

4. The method according to claim 1, characterized in that: The generating the test result of the target function based on the actual processing result includes: Based on the actual processing result, a test result of functional degradation of the target function is generated.

5. The method according to any one of claims 1 to 4, characterized in that: There is a target time period during which the target device is in a non-restart state, wherein the target time period represents a time period between two times of respectively using the device function test method based on fault injection to generate test results.

6. The method according to any one of claims 1 to 4, characterized in that: After determining the processing result of the target device on the fault test signal, the method further includes: Adjusting the fault signal value of the fault test signal of the target device to the initial signal value to obtain the target processing signal; The target device is controlled to process the target processing signal.

7. The method according to any one of claims 1 to 4, characterized in that: The determining a processing result of the target device on the fault test signal includes: Inputting the fault test signal to a simulation module of the target function of the target device, wherein the simulation module is used to simulate the processing logic of the target device to implement the target function; Obtaining a processing result of the simulation module on the fault test signal; The processing result of the fault test signal by the simulation module is determined as the processing result of the fault test signal by the target device.

8. The method according to any one of claims 1 to 4, characterized in that: The target processing signal is generated in the following manner: Acquire the signal output by the target device through sensing and interacting with the simulation environment, and obtain the target processing signal; The simulation environment is used to simulate the environment where the target device is located.

9. The method according to any one of claims 1 to 4, characterized in that: The target device is a vehicle, and the target function includes at least one of the following: a bus function, a sensor function, a button function, a positioning function, a map function, a chassis function, and a target recognition function.

10. A device for testing equipment functions based on fault injection, characterized in that: The device comprises: an acquisition unit, configured to acquire a target processing signal of a target device, wherein the target processing signal is used to implement a target function of the target device; a first adjustment unit, configured to use the signal value of the target processing signal as an initial signal value, and adjust the initial signal value to a fault signal value corresponding to the target processing signal, so as to obtain a fault test signal of the target device, wherein the fault test signal is used to test the target function; a determining unit, configured to determine an actual processing result, wherein the actual processing result represents a processing result of the target device on the fault test signal; A generating unit is used to generate a test result of the target function based on the actual processing result.

11. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute a computer program stored in the memory, and when the computer program is executed, implement the method described in any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method described in any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Signal routing test method and system and electronic equipment

    CN119996274A

  • Signal routing test method, system, and electronic device

    CN119996274B

  • Simulation system and test method and device based on simulation system

    CN121325648A