A data detection method and an electronic device
Patent Information
- Application Number
- CN202611093631.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-09-15
AI Technical Summary
[0004]但是,在基于CAN进行检测的相关技术中,需要用户输入相关信息(如测试条件)以及需要用户执行被测信号的故障注入,不仅耗时费力,还易出现参数配置错误,导致故障注入的检测效率低以及准确性低
[0020] Through the above application embodiments, the original configuration parameters of the tested signal are restored. For example, in the case of fault injection, the current parameter value of the tampered signal is modified to the tampered parameter value. Then, the original configuration parameters of the tested signal are restored by restoring the current parameter value of the tampered signal back to the original parameter value, thereby restoring the tampered signal to the original signal state. Then, based on whether the multiple consecutive tested signals after restoration meet the second set condition, the fault recovery capability of the device under test is tested to determine whether the fault recovery is successful or unsuccessful, so as to verify the fault recovery capability of the device under test.
Smart Images

Figure CN122764809A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle controller local area network technology, and in particular to a data detection method and electronic equipment. Background Technology
[0002] Controller Area Network (CAN) has high real-time performance and has been widely used in the automotive industry, aerospace industry, industrial control, security protection and other fields.
[0003] In the automotive industry, CAN signals are widely used to enable communication between various electronic control units within a vehicle. Through the CAN bus, different systems within a vehicle can exchange data efficiently and reliably. Therefore, in the field of vehicle testing, multiple functions within a vehicle are typically tested based on the CAN bus.
[0004] However, in CAN-based detection technologies, users need to input relevant information (such as test conditions) and perform fault injection on the signal under test. This is not only time-consuming and laborious, but also prone to parameter configuration errors, resulting in low detection efficiency and accuracy of fault injection. Summary of the Invention
[0005] This application provides a data detection method and electronic device to improve the efficiency and accuracy of data detection. The specific implementation scheme is as follows: Firstly, this application provides a data detection method, which includes: Obtain a set of parameters for testing; wherein the set of parameters includes test conditions and the identifier of the signal under test; Determine that the collected test configuration signal meets the test conditions; Fault injection is performed on the test signal corresponding to the test signal identifier; Historical test signals within a set time period are captured and detected to obtain a first detection result; wherein, the set time period includes the time period from the start to the end of the fault injection; the first detection result includes information indicating whether the fault injection was successful or failed.
[0006] Through the above application embodiments, after determining that the collected test configuration signal meets the parameter set test conditions, that is, after the pre-verification is passed, the test signal corresponding to the test signal identifier is then injected with faults. Then, the historical test signals within the time period from the start to the end of the fault injection are extracted, and the historical test signals are detected to determine the first detection result of whether the fault injection is successful or unsuccessful. This replaces the user's input of relevant information and the user's execution of fault injection of the test signal, minimizing manual intervention, saving detection time, and avoiding parameter configuration errors caused by human error as much as possible, thereby improving the efficiency and accuracy of data detection.
[0007] In one possible implementation, obtaining the parameter set for testing includes: Obtain the configuration file for testing; The configuration file is parsed to obtain the configuration parameters; The configuration parameters are added to the parameter set; wherein the parameter set includes the test conditions, the identifier of the signal under test, timing parameters, and detection parameters.
[0008] Through the above application embodiments, after obtaining the configuration file used for testing, it is first parsed to obtain the configuration parameters, and then the configuration parameters are added to the parameter set, thereby providing data support for data detection.
[0009] In one possible implementation, adding the configuration parameters to the parameter set includes: The configuration parameters are configured and validated; the validation includes checks on parameter format, parameter range, and logical consistency. In response to the successful verification of the settings, the configuration parameters are added to the parameter set.
[0010] Through the above application embodiments, after parsing the configuration parameters, the configuration parameters are also checked for parameter format, parameter range, and logical consistency. Only after the setting check passes is the configuration parameter added to the parameter set, thereby ensuring as much as possible that the parameters in the parameter set are all legal and valid parameters.
[0011] In one possible implementation, determining that the acquired test configuration signal satisfies the test conditions includes: Acquire multiple acquired values of the continuously acquired test configuration signal; An anomaly detection algorithm is used to compare the multiple collected values with the expected range corresponding to the test configuration signal in the test conditions, and to determine whether the multiple collected values are all within the expected range; If so, then the test configuration signal is determined to meet the test conditions.
[0012] Through the above application embodiments, based on the comparison of multiple acquired values of the continuously acquired test configuration signal with the expected range corresponding to the test configuration signal in the test conditions, it is determined that the test configuration signal meets the test conditions, thereby avoiding invalid detection as much as possible.
[0013] In one possible implementation, if the signal under test includes a tampered signal and / or a signal interruption, then the fault injection for the signal under test corresponding to the signal under test identifier includes: Obtain the fault injection mode; If the fault injection mode is a tampering mode, then according to the tampering rules, the current parameter value of the tampering signal is modified to the tampering parameter value; If the fault injection mode is the interruption mode, then the interruption signal identifier of the interruption signal is added to the interruption blacklist.
[0014] Through the above-described embodiments, when the obtained fault injection mode is tampering mode, the current parameter value of the tampering signal (i.e., the measured signal) is modified to the tampering parameter value according to the tampering rules, thereby completing the fault injection of the tampering signal. Additionally, when the obtained fault injection mode is interruption mode, the interruption signal identifier is added to the interruption blacklist, thereby blocking the interruption signal and completing the fault injection of the interruption signal.
[0015] In one possible implementation, after the fault injection is performed on the test signal corresponding to the test signal identifier, the method further includes: If the duration of the tampering mode reaches a first preset value, the tampering rule is cleared, and the current parameter value of the tampering signal is restored to the original parameter value; wherein, the first preset value is determined based on the timing parameters in the parameter set; If the duration of the hair loss mode reaches a second preset value, the hair loss signal identifier is removed from the hair loss blacklist; wherein the second preset value is determined based on the timing parameters.
[0016] Through the above-described embodiments, when the duration of the tampering module reaches a first preset value, the tampering rule is cleared, and the current parameter value of the tampered signal is restored to its normal original parameter value, thereby minimizing the adverse effects of erroneous parameter values of the tampered signal on the bus. Furthermore, when the duration of the interruption mode reaches a second preset value, the interruption signal identifier is removed from the interruption blacklist to restore normal transmission of the interruption signal, minimizing the adverse effects of blocking the interruption signal on the bus.
[0017] In one possible implementation, detecting the historical measured signal to obtain a first detection result includes: A time-series signal analysis algorithm is used to determine whether all historical measured signals within the set time period meet a first set condition; wherein, the first set condition includes the current parameter value of the historical measured signal being within a first set range, or the historical measured signal being blocked; the first set range includes the tampered parameter value of the measured signal; If so, the first detection result containing information indicating that the fault injection was successful is obtained; If not, the first detection result containing information indicating that the fault injection failed is obtained.
[0018] Through the above application embodiments, a time-series signal analysis algorithm is used to determine whether all historical measured signals within a set time period meet the first set condition, thereby determining whether the fault injection is successful or failed, minimizing the misjudgment of transient signals, and basically avoiding the problems of missed judgment and misjudgment in traditional real-time single-point detection.
[0019] In one possible implementation, after obtaining the first detection result, the method further includes: Restore the original configuration parameters of the measured signal and obtain multiple consecutive measured signals after restoration; Determine whether the plurality of consecutive tested signals meet a second set condition; wherein, the second set condition includes that the current parameter values of the plurality of consecutive tested signals are all within a second set range, or that the plurality of consecutive tested signals are all successfully transmitted; the second set range includes the original parameter values of the tested signals; If so, a second detection result containing information indicating successful fault recovery is obtained; If not, the second detection result containing information indicating that fault recovery has failed is obtained.
[0020] Through the above application embodiments, the original configuration parameters of the tested signal are restored. For example, in the case of fault injection, the current parameter value of the tampered signal is modified to the tampered parameter value. Then, the original configuration parameters of the tested signal are restored by restoring the current parameter value of the tampered signal back to the original parameter value, thereby restoring the tampered signal to the original signal state. Then, based on whether the multiple consecutive tested signals after restoration meet the second set condition, the fault recovery capability of the device under test is tested to determine whether the fault recovery is successful or unsuccessful, so as to verify the fault recovery capability of the device under test.
[0021] In one possible implementation, after obtaining the first detection result, the method further includes: Collect the data used in the data detection; Based on the multiple data and the parameters detected in the parameter set, a set index is calculated; wherein, the detection parameters include the error range corresponding to the fault injection and the error range corresponding to the measured signal being restored to its original state; Generate an evaluation report based on the set indicators.
[0022] Through the above-described embodiments, after obtaining the corresponding test results from the fault injection evaluation, multiple data points used in the data detection can be collected. Based on this data and the error range corresponding to the fault injection and the error range corresponding to the recovery of the measured signal to its original state, the equipment indicators can be calculated. This allows for the determination of the detection performance of the data detection based on the set indicators. An evaluation report is then generated according to the set indicators, along with optimization suggestions, to standardize the recording of the data detection and ensure its traceability.
[0023] Secondly, this application also provides a data detection system, which includes: The parameter parsing module is used to obtain a set of parameters for testing; wherein, the parameter set includes test conditions and the identifier of the signal being tested; The intelligent decision-making and analysis module is used to determine whether the collected test configuration signals meet the test conditions; The intelligent tamper control module is used to inject faults into the test signal corresponding to the test signal identifier. A two-stage detection module is used to intercept historical test signals within a set time period, detect the historical test signals, and obtain a first detection result; wherein, the set time period includes the time period from the start to the end of the fault injection; the first detection result includes information indicating whether the fault injection was successful or failed.
[0024] In one possible implementation, when the parameter parsing module obtains the parameter set for testing, it specifically obtains the configuration file for testing; parses the configuration file to obtain configuration parameters; and adds the configuration parameters to the parameter set; wherein the parameter set includes the test conditions, the identifier of the signal under test, timing parameters, and detection parameters.
[0025] In one possible implementation, when the parameter parsing module converts the configuration parameters into a standardized parameter dictionary, it is specifically used to perform setting verification on the configuration parameters; wherein, the setting verification includes verification of parameter format, parameter range, and logical consistency; in response to the setting verification passing, the configuration parameters are added to the parameter set.
[0026] In one possible implementation, when the intelligent decision-making and analysis module determines that the collected test configuration signal meets the test conditions, it is specifically used to acquire multiple collected values of the continuously collected test configuration signal; employ an anomaly detection algorithm to compare the multiple collected values with the expected range corresponding to the test configuration signal in the test conditions, and determine whether the multiple collected values are all within the expected range; if so, it is determined that the test configuration signal meets the test conditions.
[0027] In one possible implementation, the tested signal includes a tampered signal and / or a transmission interruption signal. When the intelligent tampering control module performs fault injection on the tested signal corresponding to the tested signal identifier, it specifically acquires the fault injection mode. If the fault injection mode is a tampering mode, the current parameter value of the tampered signal is modified to the tampered parameter value according to the tampering rules. If the fault injection mode is a transmission interruption mode, the transmission interruption signal identifier of the transmission interruption signal is added to the transmission interruption blacklist.
[0028] In one possible implementation, after injecting a fault into the test signal corresponding to the test signal identifier, the intelligent tampering control module is further configured to clear the tampering rule and restore the current parameter value of the tampered signal to its original parameter value if the duration of the tampering mode reaches a first preset value; wherein the first preset value is determined based on the timing parameters in the parameter set; and if the duration of the termination mode reaches a second preset value, remove the termination signal identifier from the termination blacklist; wherein the second preset value is determined based on the timing parameters.
[0029] In one possible implementation, when the dual-stage detection module detects the historical tested signals and obtains a first detection result, it specifically employs a time-series signal analysis algorithm to determine whether all the historical tested signals within the set time period meet a first set condition. The first set condition includes the current parameter value of the historical tested signal being within a first set range, or the historical tested signal being blocked. The first set range includes the tampered parameter value of the tested signal. If yes, the first detection result containing information indicating successful fault injection is obtained; otherwise, the first detection result containing information indicating failed fault injection is obtained.
[0030] In one possible implementation, after obtaining the first detection result, the two-stage detection module is further configured to restore the original configuration parameters of the tested signal and acquire multiple consecutive tested signals after restoration; determine whether the multiple consecutive tested signals meet a second set condition; wherein, the second set condition includes that the current parameter values of the multiple consecutive tested signals are all within a second set range, or that the multiple consecutive tested signals are all successfully transmitted; the second set range includes the original parameter values of the tested signals; if yes, a second detection result containing information indicating successful fault recovery is obtained; if no, a second detection result containing information indicating failed fault recovery is obtained.
[0031] In one possible implementation, the data detection system further includes an intelligent evaluation report module. After obtaining the first detection result, the intelligent evaluation report module is specifically used to collect multiple data used in the data detection; calculate set indicators based on the multiple data and the detection parameters in the parameter set; wherein, the detection parameters include the error range corresponding to the fault injection and the error range corresponding to the measured signal being restored to its original state; and generate an evaluation report according to the set indicators.
[0032] Thirdly, this application provides an electronic device comprising: Memory, used to store computer programs; A processor, when executing a computer program stored in the memory, implements the method described in any one of the first aspects.
[0033] Fourthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in any one of the first aspects.
[0034] Fifthly, this application provides a computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of the first aspects.
[0035] For the various aspects of the second to fifth aspects mentioned above, and the technical effects that each aspect may achieve, please refer to the above description of the technical effects that can be achieved for the first aspect or the various possible solutions in the first aspect, which will not be repeated here. Attached Figure Description
[0036] Figure 1a This is a schematic diagram of a vehicle scenario provided in an embodiment of this application; Figure 1b A schematic diagram illustrating the application scenario of the data detection method provided in this application embodiment in a vehicle; Figure 2 A flowchart illustrating a data detection method provided in an embodiment of this application; Figure 3 A timing diagram provided for an embodiment of this application; Figure 4 Timing diagram provided for embodiments of this application Figure 2 ; Figure 5 This is a schematic diagram showing the connection of each module in an embodiment of this application; Figure 6 This is a schematic diagram of a data detection system provided in an embodiment of this application; Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0038] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0039] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0040] The acquisition, transmission, storage, and use of data in this application all comply with the requirements of relevant national laws and regulations.
[0041] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0042] See Figure 1a The diagram illustrates a possible application scenario in this application. This application scenario includes a vehicle 100, which contains a sensor 110 and a processor 120. Signals from both the sensor 110 and the processor 120 are transmitted via the vehicle's CAN bus. Data detected by the sensor 110 can be transmitted to the processor 120 for processing via CAN.
[0043] Currently, CAN signals are widely used to enable communication between various electronic control units within a vehicle. Through the CAN bus, different systems within a vehicle can exchange data efficiently and reliably. Therefore, in the field of vehicle testing, multiple functions within a vehicle are typically tested based on the CAN bus.
[0044] However, in CAN-based detection technologies, users need to input relevant information (such as test conditions) and perform fault injection on the signal under test. This is not only time-consuming and laborious, but also prone to parameter configuration errors, resulting in low detection efficiency and accuracy of fault injection.
[0045] In view of this, this application proposes a data detection method for use in a data detection system. The data processing system first acquires a parameter set for testing, determines that the collected test configuration signals meet the test conditions in the parameter set, then injects faults into the test signals corresponding to the test signal identifiers in the parameter set. Next, it extracts historical test signals within a set time period, including the start and end time of the fault injection, and detects these historical test signals to determine whether the fault injection was successful or failed. This replaces the user's input of relevant information and execution of fault injection into the test signals, minimizing manual intervention, saving detection time, and avoiding parameter configuration errors caused by human error, thereby improving the efficiency and accuracy of data detection.
[0046] See Figure 1b The diagram shown illustrates a possible application scenario in this application embodiment. This application scenario includes a vehicle 100, which contains a sensor 110 and a data detection system 130. The data detection system 130 is located inside the vehicle 100. However, the data detection system 130 can also be located outside the vehicle 100, and can be flexibly adjusted according to the specific application scenario.
[0047] Taking the engine coolant temperature signal as the measured signal and the engine speed signal as the test configuration signal as an example, the data detection system 130 acquires the engine coolant temperature signal and the engine speed signal from the sensor 110. Then, determining that the engine speed signal meets the parameter set test conditions, it performs fault injection on the engine coolant temperature signal. Next, it extracts the historical engine coolant temperature signal within a set time period, including the start and end time of the fault injection, and detects this historical engine coolant temperature signal to obtain a first detection result. If fault injection on the engine coolant temperature signal is successful, the first detection result can be determined to contain information indicating successful fault injection; if fault injection on the engine coolant temperature signal fails, the first detection result can be determined to contain information indicating failed fault injection. The engine coolant temperature signal and the engine speed signal originate from the sensor 110.
[0048] It should be noted that, Figure 1b The examples shown are merely illustrative and are not intended to limit the specific implementation of this application.
[0049] See Figure 2 As shown, it is a flowchart of a data detection method in an embodiment of this application. The following is a description of the method in conjunction with the attached diagram. Figure 2 The specific execution steps are explained in detail below: S201, Obtain the parameter set for testing.
[0050] When a data testing system obtains the parameter set for testing, it can first retrieve the configuration file used for testing. This configuration file can be selected by the user through a visual interface and can be an Excel file. For example, the data testing system can read the Excel configuration file using the pandas library.
[0051] Then, the data detection system reads the contents of the configuration file and parses it to obtain the configuration parameters. These configuration parameters may include test conditions, the identifier of the signal under test, timing parameters, and detection parameters.
[0052] The test conditions can be the testing environment, under which the data testing system detects whether a certain function or fault of the device under test will occur. These test conditions may include the expected range of the test configuration signal, facilitating subsequent pre-verification based on the real-time acquired test configuration signal (i.e., determining whether the test configuration signal meets the test conditions). Thus, under this test environment (i.e., an environment where the test configuration signal meets the test conditions), the data testing system performs testing on the device under test. The tested signal identifier, besides indicating the identifier (ID) of the tested signal, can also indicate the parameter value information of the tested signal. Timing parameters may include the duration of the tested signal. Detection parameters may include the error range corresponding to fault injection and the error range corresponding to the tested signal being restored to its original state.
[0053] For example, in the functional safety testing scenario of the Electronic Control Unit (ECU) of an on-board engine, in order to verify the on-board engine ECU's response capability and fault recovery capability to abnormal water temperature signals, as well as the fault tolerance capability of the on-board engine ECU under simulated water temperature scenarios, so as to achieve the reliability testing of the on-board engine ECU before the vehicle leaves the factory, the test conditions can be that the expected range of the engine speed signal is 1450 revolutions per minute (rpm) to 1550 rpm, that is, the expected range is 1500 rpm ± 50 rpm; where the engine speed signal is the test configuration signal, and the ID of the engine speed signal can be 0x100.
[0054] The measured signal identifier can be 0x101. The measured signal corresponding to this identifier can be the engine coolant temperature signal. The parameter value information of the engine coolant temperature signal corresponding to 0x101 can include: the original parameter value is 80℃, and the tampered parameter value of this coolant temperature signal is 105℃.
[0055] The timing parameters include an engine coolant temperature signal with a duration of 10 seconds. When the fault injection mode is tampering mode, this duration is the tampering duration, or the duration of fault injection into the engine coolant temperature signal. In this case, the engine coolant temperature signal can also be called a tampering signal.
[0056] When the fault injection mode is tampering mode, the detection parameters can include the tampering deviation of the engine coolant temperature signal during the tampering period (i.e., the difference between the current parameter value and the tampered parameter value) being less than or equal to 2℃, and the recovery deviation of the engine coolant temperature signal after recovery (i.e., the difference between the current parameter value and the original parameter value) being greater than or equal to -1℃ and less than or equal to 1℃.
[0057] In this scenario of functional safety testing of the vehicle engine ECU, the device to be tested can be the vehicle engine; the signals to be tested and the test configuration signals all originate from the engine.
[0058] For example, in the fault injection detection scenario of an onboard body control system, to verify the fault tolerance and fault recovery capabilities of the Body Control Module (BCM) in the event of abnormal door status signal interruption, and the working state of the BCM under simulated signal transmission interruption scenarios, in order to perform functional safety verification of the onboard body control system, the test conditions can include a desired range of 11.5 volts (V) to 12.5V for the body power signal, i.e., a desired range of 12V ± 0.5V. This body power signal is the test configuration signal, and its ID is 0x200.
[0059] The tested signal identifier can include 0x201 and 0x202. 0x201 corresponds to the left front door status signal, and 0x202 corresponds to the right front door status signal. The left front door status signal is transmitted normally and indicates that the left front door is closed, and the right front door status signal is transmitted normally and indicates that the right front door is closed.
[0060] The timing parameters include a duration of 8 seconds for the left front door status signal and the right front door status signal. When the fault injection mode is the interruption mode, this duration is the interruption duration, which is also the duration for fault injection into the left front door status signal and the right front door status signal. In this case, the left front door status signal and the right front door status signal can also be called interruption signals.
[0061] When the fault injection mode is the interruption mode, the detection parameters can include no interruption signal transmission during the interruption period and normal interruption signal transmission after recovery.
[0062] In this vehicle body control system fault injection detection scenario, the device to be tested can be the vehicle body; the signal being tested and the test configuration signal both originate from the vehicle body.
[0063] After parsing the configuration file and obtaining the configuration parameters, the data detection system can add these configuration parameters to the parameter set, thereby obtaining the parameter set used for testing.
[0064] To ensure that all parameters in the parameter set are valid and legal, the data detection system can perform a setting verification on the parsed configuration parameters after obtaining them and before adding them to the parameter set, in order to determine whether the content of the configuration parameters is correct.
[0065] This setting verification can include verification of parameter format, parameter range, and logical consistency.
[0066] The parameter format verification can be performed by: determining whether the acquired parameter format is the set format. For example, in a fault injection detection scenario for an onboard body control system, determining whether the ID of the interrupted signal is a valid ID of the body control bus. If it is the set format, then the parameter format verification is considered successful.
[0067] The parameter range verification can be performed by: determining whether the parameter value indicated by the tested signal is within a third set range. For example, in the functional safety testing scenario of an on-board engine ECU, the third set range is [50℃, 120℃]. The verification process involves determining whether the tampered parameter value of the engine coolant temperature signal is within the range of [50℃, 120℃]. If the parameter value indicated by the tested signal is determined to be within the third set range, then the parameter value is considered to be within a reasonable range, thus confirming that the parameter range verification has passed.
[0068] The logical consistency check can be performed as follows: after modifying the parameter value of the test signal corresponding to the test signal identifier, the modified test signal will not report an error during operation, thereby ensuring as much as possible that the device under test (such as a vehicle engine) can work normally after subsequent fault injection into the test signal.
[0069] Once the configuration parameters have passed the verification, i.e., the parameter format, parameter range, and logical consistency have all passed the verification, the data detection system will add the verified configuration parameters to the parameter set. This ensures that the parameters are legal and valid during the test, so that the test conditions, the signal identifier under test, timing parameters, detection parameters, and other parameters in the parameter set can be used more efficiently and accurately in the future.
[0070] Furthermore, the data detection system can subscribe to relevant data detection signals (such as the measured signal and the test configuration signal) while or after adding configuration parameters to the parameter set.
[0071] To ensure the accuracy of data detection as much as possible, the data detection system can first determine the stability of the vehicle's CAN bus data before performing data detection, thereby minimizing the impact of CAN bus data instability on the data detection. For example, if the data detection system determines that it has successfully received signals from the device under test for a continuous first set time period (e.g., 3 seconds), it can confirm that no signal loss has occurred from the device under test, and thus determine that the CAN bus data is stable.
[0072] Optionally, if the data detection system determines that the vehicle CAN bus data is still unstable after waiting for the second set time, it can report an error and determine the reason for the unstable vehicle CAN bus data. If the reason does not affect the data detection, the error can be ignored and the data detection can continue.
[0073] S202, confirm that the acquired test configuration signal meets the test conditions.
[0074] Before injecting faults into the signal corresponding to the signal identifier in the parameter set, the data detection system needs to perform a pre-verification to ensure that the collected test configuration signal meets the test conditions. Only when the test configuration signal meets the test conditions will the fault be injected into the signal being tested, thereby avoiding invalid detection.
[0075] In this embodiment, when the data detection system determines that the collected test configuration signal meets the test conditions, it can employ an anomaly detection algorithm to identify problems such as signal loss, signal parameter value exceeding limits, or abnormal signal mutations, thereby achieving intelligent decision-making and obtaining a preliminary verification result. This preliminary verification result indicates that the test configuration signal meets the test conditions, or that the test configuration signal does not meet the test conditions. The anomaly detection algorithm can be a density-based spatial clustering of applications with noise (DBSCAN), an isolated forest algorithm, or similar algorithms.
[0076] Specifically, the data detection system first acquires the test conditions set by parameters and obtains the real-time acquired test configuration signals, resulting in multiple continuously acquired values of the test configuration signals. Then, using an anomaly detection algorithm, it quickly compares the multiple acquired values of the test configuration signals with the expected range of the test configuration signals in the test conditions to determine whether all the continuously acquired values of the test configuration signals are within the expected range. If so, the test configuration signals are determined to meet the test conditions; otherwise, the data detection system can identify an anomaly (such as signal loss / parameter values exceeding limits / abnormal signal mutations), automatically analyze the cause of the anomaly, display the cause through a visual interface, and terminate the current data detection. Thus, by verifying whether the test configuration signals meet the test conditions, it can intelligently identify problems such as signal loss and numerical anomalies, minimizing invalid detections.
[0077] For example, in the functional safety testing scenario of an on-board engine ECU, the data detection system collects the engine speed signal every 100 milliseconds (ms), and then uses the isolated forest algorithm to quickly compare the collected value of the engine speed signal with the expected range. When the collected value of the engine speed signal is within the expected range for 5 consecutive times, the test configuration signal is determined to meet the test conditions.
[0078] For example, in the scenario of fault injection detection in the vehicle body control system, the data detection system collects the vehicle body power signal in real time and uses the DBSCAN algorithm to quickly compare the collected value of the vehicle body power signal with the expected range to determine whether the collected values of the vehicle body power signal for four consecutive times are all within the expected range. If so, it is determined that the test configuration signal meets the test conditions.
[0079] Once all test configuration signals meet their respective test conditions, the data detection system can enter the fault injection process, that is, execute step S203.
[0080] S203, inject faults into the signal under test corresponding to the signal under test identifier.
[0081] When injecting faults into the signal under test, the data detection system can determine the rules for fault injection by combining the parameter set and the real-time bus status (such as the real-time CAN bus status).
[0082] For example, the measured signal corresponding to the measured signal identifier in the parameter set acquired by the data detection system is a tampered signal, and the parameter value indicated by the measured signal identifier is the tampered parameter value of the measured signal, which is a third set value. Furthermore, the real-time CAN bus status acquired by the data detection system includes the current parameter value of the tampered signal as the original parameter value, which is a fourth set value. When acquiring the real-time CAN bus status, the data detection system can first acquire the original real-time CAN bus status, and then preprocess the original real-time CAN bus status data, such as removing noise, aligning data, and slicing according to a time window, to obtain a preprocessed real-time CAN bus status. Subsequently, the data detection system can combine this parameter set and the real-time CAN bus status to perform intelligent decision-making and obtain a fault injection rule. This fault injection rule includes the following: modifying the current parameter value of the tampered signal from the fourth set value (i.e., the original parameter value) to the third set value (i.e., the tampered parameter value). In this case, the fault injection rule can also be called a tampering rule.
[0083] For example, in the functional safety testing scenario of an on-board engine ECU, the data detection system determines the real-time bus status as follows: the current parameter value of the water temperature signal is 80℃, and the parameter value of the engine speed signal (i.e., the speed) is 1520rpm. Based on this real-time bus status and parameter set, the system determines that the tampering rule can include: changing the current parameter value of the water temperature signal from 80℃ to 105℃.
[0084] For example, the measured signal corresponding to the measured signal identifier in the parameter set acquired by the data detection system is a transmission interruption signal; the information contained in the acquired real-time CAN bus status indicates that the transmission interruption signal is transmitting normally. When acquiring the real-time CAN bus status, the data detection system can first acquire the raw real-time CAN bus status, and then preprocess this raw real-time CAN bus status data, such as removing noise, aligning data, and slicing according to a time window, to obtain the preprocessed real-time CAN bus status. Subsequently, the data detection system can combine this parameter set and the real-time CAN bus status to perform intelligent decision-making and obtain fault injection rules. These fault injection rules include the following: adding the transmission interruption signal identifier to the transmission interruption blacklist. In this case, the fault injection rule can also be called the transmission interruption rule.
[0085] For example, in the scenario of fault injection detection in the vehicle body control system, the data detection system determines the real-time bus status as follows: the vehicle power signal indicates a voltage of 12.2V, the left front door status signal is transmitted normally and indicates that the left front door is closed, and the right front door status signal is transmitted normally and indicates that the right front door is closed. Based on this real-time bus status and parameter set, the system determines that the disconnection rule may include adding the IDs of the left front door status signal and the right front door status signal to the disconnection blacklist.
[0086] Furthermore, the data detection system can inject faults into the signal being tested, based on the rules for fault injection, targeting the signal being tested corresponding to the signal being tested.
[0087] In this embodiment, when the data detection system injects faults into the signal under test, it can first obtain the fault injection mode. This fault injection mode can be obtained based on the detection requirements input by the user. For example, if the detection requirements include mode selection, when the selected mode is tampering mode, the fault injection mode is determined to be tampering mode; when the selected mode is interruption mode, the fault injection mode is determined to be interruption mode. Besides tampering and interruption modes, the fault injection mode can also be other fault injection modes, which can be adjusted according to the specific application scenario.
[0088] Subsequently, the data detection system injects faults into the signal under test based on the fault injection mode.
[0089] For example, when the fault injection mode is tampering mode, the data detection system can determine that the measured signal corresponding to the measured signal identifier is a tampered signal. At this time, the data detection system can modify the current parameter value of the tampered signal to the tampered parameter value according to the tampering rules, so that the parameter value of the tampered signal sent to the CAN bus is the tampered parameter value.
[0090] For example, in a functional safety testing scenario for an onboard engine ECU, the data detection system determines that the fault injection mode is a tampering mode. According to the tampering rules, it modifies the current parameter value of the engine coolant temperature signal to 105°C and then sends the tampered engine coolant temperature signal to the CAN bus, so that the parameter value of the engine coolant temperature signal sent to the CAN bus is 105°C.
[0091] When the fault injection mode is the interrupted transmission mode, the data detection system can determine that the measured signal corresponding to the measured signal identifier is the interrupted transmission signal. At this time, the data detection system can add the interrupted transmission signal identifier to the interrupted transmission blacklist according to the interrupted transmission rules, thereby blocking the interrupted transmission signal. Alternatively, it can disable the transmission function of the module that sends the interrupted transmission signal to prevent it from sending the interrupted transmission signal, thereby blocking the interrupted transmission signal.
[0092] For example, in the fault injection detection scenario of the vehicle body control system, the data detection system determines that the fault injection mode is the interruption mode. According to the interruption rules, the transmission of the left front door status signal and the right front door status signal is blocked. For example, the IDs of the left front door status signal and the right front door status signal are added to the interruption blacklist.
[0093] Thus, through the above methods, the data detection system can accurately inject faults into the measured signal to simulate abnormal CAN bus scenarios.
[0094] Optionally, after injecting faults into the signal under test, the data detection system can further combine the real-time bus status to determine whether the fault injection has achieved the expected effect. If the expected effect has not been achieved, the signal under test can be restored to its original state. For example, in the case of tampering mode, the tampered signal parameter values can be restored to their original values; in the case of transmission interruption mode, the transmission interruption signal identifier can be removed from the transmission interruption blacklist. Then, a timing signal analysis algorithm is used to dynamically optimize the parameters corresponding to the signal under test, avoiding CAN bus anomalies. At this point, the data detection system can end the current data detection or re-perform the data detection based on the optimized values. The optimized parameters may include amplitude, which can be the transmission frequency of the signal under test.
[0095] The aforementioned time-series signal analysis algorithms can be Long Short-Term Memory (LSTM) networks, Convolutional Neural Network-Long Short-Term Memory (CNN-LSTM) networks, or similar algorithms. For example, a data detection system can dynamically optimize the amplitude (i.e., transmission frequency) of the engine coolant temperature signal using LSTM, such as optimizing the transmission frequency to 10ms / time to avoid bus signal conflicts. Another example is that the data detection system can dynamically optimize the update frequency of the blacklist of interrupted signals using LSTM (e.g., to 5ms / time) to ensure effective interruption.
[0096] Optionally, in order to avoid the CAN bus being in an abnormal state for a long time and to improve the security of data detection as much as possible, the data detection system can also set the duration of fault injection when injecting faults into the signal under test, such as starting a timer, so that when the duration of fault injection reaches the set value, the signal under test is restored to the original signal state.
[0097] For example, in tampering mode, after modifying the current parameter value of the tampering signal according to the tampering rules, the data detection system starts a first timer. The set duration of this first timer can be determined based on the timing parameters in the parameter set. For example, if the timing parameters in the parameter set include a first set value, then the data detection system can set the set duration of the first timer to the first set value, so that when the duration of the first timer reaches the first set value, the fault injection into the tampering signal can be terminated.
[0098] In the interruption mode, after blocking the interruption signal according to the interruption rules, the data detection system starts a second timer. The set duration of this second timer can be determined based on the timing parameters in the parameter set. For example, if the timing parameters in the parameter set include a second set value, then the data detection system can set the set duration of the second timer to the second set value, so that when the duration of the second timer reaches the second set value, the fault injection of the interruption signal can be terminated.
[0099] Both the first timer and the second timer mentioned above can be independent sequential timers, and the two timers can be the same or different.
[0100] Furthermore, when using a timing signal analysis algorithm to dynamically optimize the parameters corresponding to the measured signal, the optimized parameters may also include tampering timing or interruption timing. The tampering timing can be the set duration of the first timer, and the interruption timing can be the set duration of the second timer.
[0101] Furthermore, when the duration of the fault injection reaches a set value, such as when the timer reaches the set duration, the data detection system restores the measured signal to its original signal state.
[0102] For example, when the duration of the tampering mode reaches a first set value (such as when the duration of the first timer reaches the first set value), the data detection system can determine that the fault injection in the tampering mode has ended. At this time, the tampering rules can be automatically cleared, the tampering signal after modifying the current parameter value can be stopped, and the current parameter value of the tampering signal can be restored to the original parameter value. Then, the tampering signal after restoring the original parameter value can be transmitted, thereby restoring the tampering signal to the original signal state.
[0103] For example, in a functional safety testing scenario for an onboard engine ECU, the data detection system, while injecting a fault into the engine coolant temperature signal, starts a first timer with a set duration of 10 seconds. Once the first timer reaches 10 seconds, the data detection system immediately clears the tampering rules, stops sending the tampered engine coolant temperature signal, restores the current parameter value of the engine coolant temperature signal to 80°C, and then transmits it again.
[0104] When the duration of the interruption mode reaches the second set value (e.g., the duration of the second timer reaches the second set value), the blocking of the interruption signal is released. For example, the interruption signal identifier is removed from the blacklist, and the normal transmission of the interruption signal corresponding to the interruption signal identifier is restored, thereby restoring the interruption signal to its original signal state.
[0105] For example, in a fault injection detection scenario for an onboard body control system, the data detection system, while injecting faults into the left front door status signal and the right front door status signal, starts a second timer with a set duration of 8 seconds. Once the second timer reaches 8 seconds, the data detection system immediately removes the IDs of the left front door status signal and the right front door status signal from the blacklist, restoring normal transmission of these signals.
[0106] Through the above methods, the data measurement system can avoid problems such as bus paralysis and electrical control module abnormalities caused by delays in manual operation and untimely recovery by using timers and automatic recovery of the measured signal, thereby improving the safety and stability of the data detection process.
[0107] Optionally, after the signal under test is restored to its original state, the data detection system can also detect the CAN bus in real time to determine whether the CAN bus is abnormal, thereby determining the recovery status of the signal under test. If it is determined that the CAN bus is not abnormal, the signal under test is determined to be restored normally, and step S204 can be executed. Otherwise, the abnormal information is recorded and the current detection is terminated.
[0108] For example, if the data detection system determines that the current parameter values of the tampered signals collected three times in a row are all within the fourth set range (the fourth set range includes the original parameter values, making the fourth set range the range near the original parameter values, such as the fourth set range for the engine coolant temperature detection signal being [79℃, 81℃]), it can determine that there is no abnormality in the CAN bus, and thus determine that the current parameter values of the tampered signals have been restored normally. At this time, step S204 can be executed.
[0109] S204: Extract the historical measured signal within a set time period, detect the historical measured signal, and obtain the first detection result.
[0110] The set time period can be determined by the data detection system based on the historical window parameters after optimizing them. For example, the historical window is the time period from the start to the end of the fault injection. The data detection system determines that the set time period includes the historical window. For instance, the set time period is the time period from the start to 0.5 seconds after the fault injection ends, so that the historical measured signal within this period can be captured.
[0111] Subsequently, the data detection system can determine the first detection result of the device under test based on the historical measured signal. This first detection result may include information on whether the fault injection effect met the standard or not, that is, information on whether the fault injection was successful or failed.
[0112] Specifically, the data detection system uses a time-series signal analysis algorithm to determine whether all historical measured signals within a set time period meet the first set condition; if so, it determines that the fault injection was successful, thereby obtaining a first detection result containing information indicating that the fault injection was successful; otherwise, it determines that the fault injection failed, thereby obtaining a first detection result containing information indicating that the fault injection failed.
[0113] In this embodiment of the application, the first setting condition may include the current parameter value of the historical measured signal within a first setting range, and the first setting range includes the tampered parameter value of the measured signal, so that the first setting range is the range near the tampered parameter value.
[0114] For example, in tampering mode, after a fault is injected into the signal under test, the data detection system intercepts the historical signal under test within a set time period that includes the start to end time period of the fault injection. Then, a time-series signal analysis algorithm is used to detect the historical signal under test. If it is determined that the current parameter values of the historical signal under test within the set time period (such as the tampered signal within the set time period) are all within the first set range, it is determined that the tampering of the tampered signal has been completed, and thus the fault injection can be determined to be successful, and a first detection result containing information indicating that the fault injection was successful is obtained.
[0115] For example, in the functional safety testing scenario of an on-board engine ECU, the window duration corresponding to the historical window parameter is 10.5 seconds, that is, the set time period is from the start of the tampering signal to 0.5 seconds after recovery. The data detection system intercepts the historical engine coolant temperature signal during this time period (i.e., the tampering period), analyzes the historical engine coolant temperature signal through LSTM, and confirms that the collected parameter values of the historical engine coolant temperature signal are all within the first set range (i.e., 105℃±2℃) during the tampering period. Then, the fault injection can be confirmed as successful, and a first detection result containing information indicating successful fault injection can be obtained.
[0116] In this embodiment of the application, the first setting condition may also include the blocking of historically measured signals.
[0117] For example, in the interrupted transmission mode, after a fault is injected into the signal under test, the data detection system intercepts the historical signal under test within a set time period that includes the start to end time period of the fault injection. Then, a time-series signal analysis algorithm is used to detect the historical signal under test. If it is determined that all the historical signals under test within the set time period (i.e., the interrupted transmission signals within the set time period) are successfully blocked, the fault injection is determined to be successful, thus obtaining a first detection result containing information indicating that the fault injection was successful.
[0118] For example, in the fault injection detection scenario of the vehicle body control system, the window duration corresponding to the historical window parameter is 8.5 seconds, that is, the set time period is from the start of the interruption signal to 0.5 seconds after the recovery. The data detection system intercepts the historical test signal within this time period (i.e. the interruption period) and analyzes the historical test signal through CNN-LSTM. If it is confirmed that there is no transmission of the left front door status signal and the right front door status signal during the interruption period, it can be determined that the left front door status signal and the right front door status signal are successfully blocked during the interruption period. Thus, it can be determined that the fault injection is successful and the first detection result indicating the successful fault injection is obtained.
[0119] In this embodiment of the application, after detecting the effect of fault injection, the data detection system can also detect the fault recovery capability of the device under test.
[0120] Specifically, after obtaining the first detection result, the data detection system restores the original configuration parameters of the tested signal and acquires multiple consecutive tested signals after restoration; it determines whether the multiple consecutive tested signals meet the second set condition; if so, it determines that the fault recovery capability of the device under test meets the standard and obtains a second detection result containing information indicating successful fault recovery; otherwise, it determines that the fault recovery capability of the device under test does not meet the standard and obtains a second detection result containing information indicating failed fault recovery.
[0121] The second setting condition may include multiple consecutive measured signals whose current parameter values are all within a second setting range. This second setting range includes the original parameter values of the measured signals, making the second setting range a range near the original parameter values.
[0122] For example, in the fault injection mode, which is a tampering mode, the data detection system can restore the current parameter value of the tampered signal back to its original value when restoring the original configuration parameters of the signal under test. Subsequently, if the data detection system determines that the current parameter values of multiple consecutive tampered signals are all within a second set range, it determines that the fault recovery capability of the device under test meets the standard and obtains a second detection result containing information indicating successful fault recovery.
[0123] For example, in the functional safety testing scenario of an on-board engine ECU, after the data detection system restores the current parameter value of the engine coolant temperature signal to 80°C, it confirms that the current parameter values of multiple consecutive collected coolant temperature signals are all within the second set range (i.e., 80°C ± 1°C). Then, it confirms that the fault recovery capability of the on-board engine meets the standard and obtains a second detection result containing information indicating successful fault recovery.
[0124] The second setting condition mentioned above may also include the successful transmission of multiple consecutive measured signals.
[0125] For example, in the fault injection mode, which is the interrupted transmission mode, the data detection system removes the interrupted transmission signal identifier from the interrupted transmission blacklist when restoring the original configuration parameters of the signal under test. Subsequently, the data detection system determines whether the collected multiple consecutive interrupted transmission signals have been successfully transmitted. If so, it determines that the fault recovery capability of the device under test meets the standard and obtains a second detection result containing information indicating successful fault recovery, thereby completing the closed-loop verification.
[0126] For example, in a fault injection detection scenario of an onboard body control system, the data detection system is set to transmit the left front door status signal and the right front door status signal normally. If it is determined that multiple consecutive left front door status signals and right front door status signals are successfully transmitted and both the left front door and the right front door are in the closed state, then the fault recovery capability of the onboard body is confirmed to meet the standard, and a second detection result indicating successful fault recovery is obtained.
[0127] The aforementioned detection of fault injection effect can be considered the first stage of detection, while the detection of fault recovery capability can be considered the second stage. Furthermore, the data detection system employs a dual-stage verification mode in this dual-stage detection, combining forward detection of fault injection effect with reverse verification of the self-healing capability of the device under test. This, combined with historical signal backtracking analysis, minimizes the misjudgment of transient signals, largely avoiding the problems of missed or incorrect judgments inherent in traditional real-time single-point detection. It comprehensively verifies the fault injection effect and the fault tolerance capability of the device under test, minimizing incomplete detection verification and achieving closed-loop reliable verification of the detection results.
[0128] In this embodiment of the application, after obtaining the first detection result and the second detection result, the data detection system can also generate an evaluation report of the data detection process.
[0129] Specifically, the data detection system can first collect multiple data points used for data detection, such as pre-verification results, data of the signal under test, detection results, and anomaly information. Then, based on this data and the detection parameters in the parameter center, it calculates and sets parameters. These parameters can include tampering success rate / sendout success rate, recovery success rate, signal packet loss rate, and tampering response time.
[0130] For example, the detection parameters include the indication that the tampering deviation of the tampered signal (such as the engine coolant temperature signal) during the tampering period is within the fifth setting range (such as the fifth setting range being [1℃, 2℃]), and the recovery deviation of the measured signal (such as the engine coolant temperature signal) after restoring the original parameter value is within the sixth setting range (such as the sixth setting range being [0.5℃, 1℃]).
[0131] Therefore, if the tampering deviation corresponding to the current parameter value of the tampering signal within the set time period during the fault injection process is within the fifth set range, then the tampering success rate of the tampering signal can be determined to be 100%.
[0132] If the recovery deviation of the tampered signal is within the sixth set range after restoring the current parameter value of the tampered signal to the original parameter value, then the recovery success rate of the tampered signal can be determined to be 100%.
[0133] Subsequently, after confirming the absence of anomalies, the data detection system generates an evaluation report according to the calculated set indicators and determines optimization suggestions. These optimization suggestions can include adjustments to tampering parameters, optimization of the testing process, and so on. For example, in a functional safety testing scenario for an automotive engine ECU, the data detection system collects multiple data points used for data detection and calculates set indicators based on this data. These calculated indicators might be: 100% tampering success rate, 100% recovery success rate, 0% signal packet loss rate, and 50ms tampering response time. After automatically identifying no anomalies, the system generates an evaluation report (such as a Word evaluation report) according to the set indicators and outputs optimization suggestions. One such optimization suggestion could be to appropriately extend the tampering time to 15 seconds. Furthermore, the data detection system can modify the system based on these optimization suggestions to further verify the ECU's long-term fault tolerance capability.
[0134] For example, in a fault injection detection scenario for an onboard vehicle body control system (BCM), the data detection system collects multiple data points for data detection and calculates set indicators based on this data. These calculated indicators might be: 100% signal interruption success rate, 100% recovery success rate, 0% signal packet loss rate, 30ms signal interruption response time, and 40ms recovery response time. After automatically identifying no anomalies, the system generates an evaluation report according to the set indicators and outputs optimization suggestions. One such suggestion could be to increase the number of interrupted signals. Furthermore, the data detection system can modify the system based on these optimization suggestions to further verify its fault tolerance capabilities in multi-signal interruption scenarios within the BCM.
[0135] In the aforementioned functional safety testing scenario for an onboard engine ECU, the timing diagrams for signal acquisition, tampering, recovery, and testing in each step of data detection can be as follows: Figure 3 As shown below. (Combined with...) Figure 3 The timing diagram shown illustrates the testing steps in the functional safety testing scenario of the vehicle engine ECU.
[0136] like Figure 3 As shown, the data detection system may include a main control unit, a CAN acquisition unit, a signal tampering unit, an automatic recovery unit, and a detection unit.
[0137] First, at time T0, the main control unit sends a first start command to the CAN acquisition unit, instructing the start of signal acquisition. Upon receiving this command, the CAN acquisition unit begins signal acquisition and uploads raw signals, such as original precondition signals and tampered signals, to the detection unit in real time. The raw signals uploaded by the CAN acquisition unit to the detection unit are the raw signals from the time period T0 to T1.
[0138] At time T1, after completing the pre-verification, the detection unit returns a message indicating the completion of the pre-verification to the main control unit. Upon receiving this message, the main control unit sends a second start command to the signal tampering unit. This second start command instructs the initiation of fault injection into the tampered signal. Subsequently, upon receiving the second start command, the signal tampering unit modifies the current parameter values of the tampered signal output by the CAN acquisition unit during the T1-T2 time period, causing the CAN acquisition unit to upload the modified tampered signal from the T1-T2 time period to the detection unit.
[0139] At time T2, the main control unit determines that the duration of the first timer has reached the set duration, triggering the recovery of the tampered signal. At this time, it sends a recovery command to the automatic recovery unit to clear the tampering rules. Then, the signal tampering unit sends an instruction to the CAN acquisition unit to restore the tampered signal to its original state within the time period T2~T3 before outputting it. This ensures that the tampered signal transmitted by the CAN acquisition unit during the time period T2~T3 is the tampered signal whose current parameter value has been restored to its original value.
[0140] At time T3, after the detection unit completes the dual-stage detection and the detection results (such as the first detection result and the second detection result) are qualified, the detection result is sent to the main control unit.
[0141] During the T3-T4 time period, after receiving the test results, the main control unit determines that the test is complete and can generate an evaluation report based on the data from the entire test process.
[0142] In the aforementioned vehicle body control system fault injection detection scenario, the timing diagram of signal interruption, recovery, and detection in the data detection steps can be as follows: Figure 4 As shown below. (Combined with...) Figure 4 The timing diagram shown illustrates the detection steps in the fault injection detection scenario of the vehicle body control system.
[0143] like Figure 4As shown, the data detection system may include a main control unit, a CAN transceiver unit, a transmission interruption control unit, an automatic recovery unit, and a detection unit.
[0144] First, at time T0, the main control unit sends a third start command to the CAN acquisition unit, instructing the start of signal acquisition. Then, upon receiving this first start command, the CAN transceiver unit begins signal acquisition and uploads raw signals, such as original precondition signals and tampered signals, to the detection unit in real time. The raw signals uploaded by the CAN transceiver unit to the detection unit are the raw signals from the time period T0 to T1.
[0145] At time T1, after completing the pre-verification, the detection unit returns a message indicating the completion of the pre-verification to the main control unit. Upon receiving this message, the main control unit sends a fourth start command to the transmission interruption control unit. This fourth start command instructs the initiation of fault injection for the transmission interruption signal. Furthermore, the CAN transceiver unit sends the IDs of the transmission interruption signals during the T1-T2 time period, such as 0x201 and 0x202, to the transmission interruption control unit. The transmission interruption control unit then adds the IDs of the transmission interruption signals during the T1-T2 time period to the transmission interruption blacklist, thereby blocking the transmission of those signals. Therefore, the CAN transceiver unit reports no transmission interruption signals to the detection unit during the T1-T2 time period.
[0146] At time T2, the main control unit determines that the duration of the second timer has reached the set duration and triggers the recovery of the interruption signal. At this time, it sends a recovery command to the automatic recovery unit so that the automatic recovery unit can clear the interruption rule.
[0147] At time T2+Δt, the automatic recovery unit sends an instruction to the CAN transceiver unit to release the interrupted transmission signal and resume normal transmission. The CAN transceiver unit can then report the interrupted transmission signal to the detection unit during the time period (T2+Δt) to T3. In other words, the CAN transceiver unit can send an interrupted transmission signal to the detection unit during the time period (T2+Δt) to T3.
[0148] At time T3, after the detection unit completes the dual-stage detection and the detection results (such as the first detection result and the second detection result) are qualified, the detection result is sent to the main control unit.
[0149] In addition, in this embodiment of the application, besides performing fault injection and fault recovery on the aforementioned engine coolant temperature signal to verify the vehicle engine ECU's response capability, fault recovery capability, and fault tolerance capability to abnormal coolant temperature signals, and performing fault injection and fault recovery on the aforementioned left front door status signal and right front door status signal to verify the BCM's fault tolerance capability, fault recovery capability, and working status under simulated signal transmission interruption scenarios, fault injection and fault recovery can also be performed on image signals (i.e., using image signals as the measured signal) to verify the image sensor (i.e., the device under test) corresponding to the image signal's response capability, fault recovery capability, and fault tolerance capability to abnormal image signals, but it is not limited to this.
[0150] The fault injection and recovery processes for this image signal are the same as those for the aforementioned fault injection and recovery processes for engine coolant temperature signals, left front door status signals, and right front door status signals, and will not be repeated here.
[0151] Optionally, after generating an evaluation report and determining optimization suggestions, the data detection system can also display the evaluation report and optimization suggestions through a visual interface. This allows users to preview, save, or export the evaluation report and optimization suggestions through the visual interface. By automatically collecting detection data throughout the entire process (i.e., multiple data used in data detection), the system can automatically identify potential problems in the data detection process, generate a standardized evaluation report with traceability, and output optimization suggestions. This achieves intelligent evaluation and standardized recording of detection results, solves the problems of low efficiency and lack of traceability in manual report compilation, and basically realizes unmanned, traceable, and iterative data detection throughout the entire process.
[0152] Optionally, after outputting evaluation reports and optimization suggestions, the data detection system can also perform resource cleanup.
[0153] For example, the data detection system can stop listening to all signals (such as the signal under test and the test configuration signal), clear all signal identifiers in the tampering rules and blacklist, disconnect the communication connection with CANoe, and release the hardware and software resources of the device under test, thereby avoiding resource waste as much as possible.
[0154] Meanwhile, the data processing system can also save the test data for subsequent batch data review, trend analysis, and test process optimization, thereby providing data support for subsequent test optimization.
[0155] Furthermore, in this embodiment, the data detection system may include a parameter parsing module, a CAN signal interaction module, an intelligent tamper control module, a two-stage detection module, an intelligent evaluation report module, an intelligent decision-making and analysis module, and a process control module, so as to achieve full automation of the data detection process based on these modules.
[0156] Therefore, during the data detection process based on the aforementioned steps S201-S204, the data detection system can utilize a parameter parsing module, a CAN signal interaction module, an intelligent tamper control module, a two-stage detection module, an intelligent evaluation report module, an intelligent decision-making and analysis module, and a process control module to automate the entire data detection process. The connection relationships between these modules can be found in [reference needed]. Figure 5 As shown.
[0157] Specifically, the data detection system can use the process control module to schedule the corresponding modules to perform the corresponding operations.
[0158] First, the data detection system uses the process control module to schedule the parameter parsing module, which then reads and parses the configuration file, sets and verifies the configuration parameters, and generates a standardized parameter dictionary to enable the configuration of parameters such as multiple CAN signal tampering, signal interruption, and timing parameters.
[0159] Furthermore, the data detection system, through the process control module, schedules the CAN signal interaction module, which serves as a communication bridge between the data detection system and the CAN bus and CAN Open Environment (CANoe), thereby subscribing to signals and determining whether the data on the vehicle's CAN bus is stable.
[0160] After the data on the vehicle's CAN bus stabilizes, the data detection system, through the process control module, schedules the intelligent decision-making and analysis module. This module performs preliminary verification to determine the rules for fault injection. The test configuration signals used for this preliminary verification can be acquired in real time by the two-stage detection module.
[0161] Subsequently, the data detection system, through the process control module, schedules the intelligent tamper control module to inject faults into the tested signal and restore it to its original state. Furthermore, after the tested signal is restored to its original state, the data detection system can also use the intelligent decision-making and analysis module to determine whether the CAN bus is abnormal and optimize the parameters corresponding to the tested signal.
[0162] Furthermore, the data detection system uses a process control module to schedule a two-stage detection module to detect the fault injection effect of the device under test and to detect the fault recovery capability of the device under test.
[0163] After completing the testing of fault injection effect and fault recovery capability, the data testing system can use the process control module to schedule the intelligent evaluation report module. Through the intelligent evaluation report module, multiple data used for data testing are collected, and based on these multiple data, set indicators are calculated. Then, according to the set indicators, an evaluation report and optimization suggestions are generated and output.
[0164] In addition, after the evaluation report and optimization suggestions, the data detection system can also perform resource cleanup and save the data from this data detection through the intelligent decision-making and analysis module, so as to provide data support for subsequent detection and optimization.
[0165] Furthermore, in this embodiment, the aforementioned parameter parsing module, CAN signal interaction module, intelligent tamper control module, two-stage detection module, intelligent evaluation report module, intelligent decision-making and analysis module, and process control module can also be configured as a target model. That is, the target model includes the parameter parsing module, CAN signal interaction module, intelligent tamper control module, two-stage detection module, intelligent evaluation report module, intelligent decision-making and analysis module, and process control module. Thus, the aforementioned data detection steps can be implemented through this target model. For example, the data detection system inputs the user-inputted configuration file into the trained target model, and through the processing of the target model, obtains detection results, evaluation reports, optimization suggestions, etc. This model design employs a loosely coupled modular structure, with clear division of labor and unified interfaces for each module, exhibiting versatility and reusability.
[0166] In summary, the data detection method provided in this application can fundamentally and completely solve the problems of high dependence on manual labor, insufficient accuracy of tampering, incomplete detection, and non-standard reports in related technologies through standardized hardware and software configuration, full empowerment, and closed-loop design of the entire process. It can be applied to the functional safety and reliability testing of various vehicle CAN bus electronic control systems, and can also be applied to the automated testing scenarios of whole vehicles.
[0167] Based on the same inventive concept, this application also provides a data detection system, such as... Figure 6 The diagram shown is a structural schematic of a data detection system provided in this application. The system includes: The parameter parsing module 601 is used to obtain a parameter set for testing; wherein, the parameter set includes test conditions and the identifier of the signal under test; The intelligent decision-making and analysis module 602 is used to determine whether the collected test configuration signal meets the test conditions; The intelligent tamper control module 603 is used to inject faults into the test signal corresponding to the test signal identifier. The dual-stage detection module 604 is used to intercept historical test signals within a set time period, detect the historical test signals, and obtain a first detection result; wherein, the set time period includes the time period from the start to the end of the fault injection; the first detection result includes information indicating whether the fault injection was successful or failed.
[0168] In one possible implementation, when the parameter parsing module 601 obtains the parameter set for testing, it specifically obtains the configuration file for testing; parses the configuration file to obtain configuration parameters; and adds the configuration parameters to the parameter set; wherein the parameter set includes the test conditions, the identifier of the signal under test, timing parameters, and detection parameters.
[0169] In one possible implementation, when the parameter parsing module 601 converts the configuration parameters into a standardized parameter dictionary, it is specifically used to perform setting verification on the configuration parameters; wherein, the setting verification includes verification of parameter format, parameter range, and logical consistency; in response to the setting verification passing, the configuration parameters are added to the parameter set.
[0170] In one possible implementation, when the intelligent decision-making and analysis module 602 determines that the collected test configuration signal meets the test conditions, it is specifically used to acquire multiple collected values of the continuously collected test configuration signal; employ an anomaly detection algorithm to compare the multiple collected values with the expected range corresponding to the test configuration signal in the test conditions, and determine whether the multiple collected values are all within the expected range; if so, it is determined that the test configuration signal meets the test conditions.
[0171] In one possible implementation, if the tested signal includes a tampered signal and / or a transmission interruption signal, then the intelligent tampering control module 603, when performing fault injection on the tested signal corresponding to the tested signal identifier, is specifically used to obtain the fault injection mode; if the fault injection mode is a tampering mode, then according to the tampering rules, the current parameter value of the tampered signal is modified to the tampered parameter value; if the fault injection mode is a transmission interruption mode, then the transmission interruption signal identifier of the transmission interruption signal is added to the transmission interruption blacklist.
[0172] In one possible implementation, after injecting a fault into the test signal corresponding to the test signal identifier, the intelligent tampering control module 603 is further configured to, if the duration of the tampering mode reaches a first preset value, clear the tampering rule and restore the current parameter value of the tampered signal to its original parameter value; wherein, the first preset value is determined based on the timing parameters in the parameter set; if the duration of the cutoff mode reaches a second preset value, remove the cutoff signal identifier from the cutoff blacklist; wherein, the second preset value is determined based on the timing parameters.
[0173] In one possible implementation, when the dual-stage detection module 604 detects the historical tested signal and obtains a first detection result, it is specifically used to employ a time-series signal analysis algorithm to determine whether all the historical tested signals within the set time period meet a first set condition; wherein, the first set condition includes the current parameter value of the historical tested signal being within a first set range, or the historical tested signal being blocked; the first set range includes the tampered parameter value of the tested signal; if yes, then the first detection result containing information indicating successful fault injection is obtained; if no, then the first detection result containing information indicating failed fault injection is obtained.
[0174] In one possible implementation, after obtaining the first detection result, the dual-stage detection module 604 is further configured to restore the original configuration parameters of the tested signal and acquire multiple consecutive tested signals after restoration; determine whether the multiple consecutive tested signals meet a second set condition; wherein the second set condition includes that the current parameter values of the multiple consecutive tested signals are all within a second set range, or that the multiple consecutive tested signals are all successfully transmitted; the second set range includes the original parameter values of the tested signals; if yes, a second detection result containing information indicating successful fault recovery is obtained; if no, a second detection result containing information indicating failed fault recovery is obtained.
[0175] In one possible implementation, the data detection system further includes an intelligent evaluation report module. After obtaining the first detection result, the intelligent evaluation report module is specifically used to collect multiple data used in the data detection; calculate set indicators based on the multiple data and the detection parameters in the parameter set; wherein, the detection parameters include the error range corresponding to the fault injection and the error range corresponding to the measured signal being restored to its original state; and generate an evaluation report according to the set indicators.
[0176] Based on the same inventive concept, this application also provides an electronic device that can realize the functions of the aforementioned data detection system. (Refer to...) Figure 7 The aforementioned electronic devices include: At least one processor 701 and a memory 702 connected to at least one processor 701. In this embodiment, the specific connection medium between the processor 701 and the memory 702 is not limited. Figure 7 The example shown is the connection between processor 701 and memory 702 via bus 700. Bus 700 is... Figure 7 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The 700 bus can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 7 The term is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, the processor 701 can also be called a controller; there is no restriction on the name.
[0177] In this embodiment, memory 702 stores instructions executable by at least one processor 701. By executing the instructions stored in memory 702, at least one processor 701 can perform the data detection method described above. Processor 701 can implement... Figure 6 The system shown illustrates the functions of each module.
[0178] The processor 701 is the control center of the system. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 702 and calling data stored in memory 702, the system can perform various functions and process data, thereby monitoring the system as a whole.
[0179] In one possible design, processor 701 may include one or more processing units. Processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.
[0180] The processor 701 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the data detection method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules within the processor.
[0181] Memory 702, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 702 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 702 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 702 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0182] By designing and programming the processor 701, the code corresponding to the data detection method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the code during operation. Figure 2 The steps of the data detection method in the illustrated embodiment are as follows. How to design and program the processor 701 is a technique well-known to those skilled in the art and will not be described further here.
[0183] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the data detection method described above.
[0184] In some possible implementations, various aspects of the data detection method provided in this application may also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps in the data detection method according to the various exemplary embodiments of this application described above.
[0185] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0186] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more flowchart illustrations and / or one or more block diagrams.
[0187] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0188] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0189] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data detection method characterized by, include: Obtain a set of parameters for testing; wherein the set of parameters includes test conditions and the identifier of the signal under test; Determine that the collected test configuration signal meets the test conditions; Fault injection is performed on the test signal corresponding to the test signal identifier; Historical test signals within a set time period are captured and detected to obtain a first detection result; wherein, the set time period includes the time period from the start to the end of the fault injection; the first detection result includes information indicating whether the fault injection was successful or failed.
2. The method of claim 1, wherein, The process of obtaining the parameter set used for testing includes: Obtain the configuration file for testing; The configuration file is parsed to obtain the configuration parameters; The configuration parameters are added to the parameter set; wherein the parameter set includes the test conditions, the identifier of the signal under test, timing parameters, and detection parameters.
3. The method of claim 2, wherein, Adding the configuration parameters to the parameter set includes: The configuration parameters are configured and validated; the validation includes checks on parameter format, parameter range, and logical consistency. In response to the successful verification of the settings, the configuration parameters are added to the parameter set.
4. The method of claim 1, wherein, The determination that the collected test configuration signal satisfies the test conditions includes: Acquire multiple acquired values of the continuously acquired test configuration signal; An anomaly detection algorithm is used to compare the multiple collected values with the expected range corresponding to the test configuration signal in the test conditions, and to determine whether the multiple collected values are all within the expected range; If so, then the test configuration signal is determined to meet the test conditions.
5. The method of claim 1, wherein, If the signal under test contains a tampered signal and / or a signal interrupted, then the fault injection for the signal under test corresponding to the signal under test identifier includes: Obtain the fault injection mode; If the fault injection mode is a tampering mode, then according to the tampering rules, the current parameter value of the tampering signal is modified to the tampering parameter value; If the fault injection mode is the interruption mode, then the interruption signal identifier of the interruption signal is added to the interruption blacklist.
6. The method of claim 5, wherein, After injecting a fault into the test signal corresponding to the test signal identifier, the method further includes: If the duration of the tampering mode reaches a first preset value, the tampering rule is cleared, and the current parameter value of the tampering signal is restored to the original parameter value; wherein, the first preset value is determined based on the timing parameters in the parameter set; If the duration of the hair loss mode reaches a second preset value, the hair loss signal identifier is removed from the hair loss blacklist; wherein the second preset value is determined based on the timing parameters.
7. The method as described in claim 1, characterized in that, The step of detecting the historical measured signal to obtain a first detection result includes: A time-series signal analysis algorithm is used to determine whether all historical measured signals within the set time period meet a first set condition; wherein, the first set condition includes the current parameter value of the historical measured signal being within a first set range, or the historical measured signal being blocked; the first set range includes the tampered parameter value of the measured signal; If so, the first detection result containing information indicating that the fault injection was successful is obtained; If not, the first detection result containing information indicating that the fault injection failed is obtained.
8. The method as described in claim 1, characterized in that, After obtaining the first detection result, the process also includes: Restore the original configuration parameters of the measured signal and obtain multiple consecutive measured signals after restoration; Determine whether the plurality of consecutive tested signals meet a second set condition; wherein, the second set condition includes that the current parameter values of the plurality of consecutive tested signals are all within a second set range, or that the plurality of consecutive tested signals are all successfully transmitted; the second set range includes the original parameter values of the tested signals; If so, a second detection result containing information indicating successful fault recovery is obtained; If not, the second detection result containing information indicating that fault recovery has failed is obtained.
9. The method as described in claim 1, characterized in that, After obtaining the first detection result, the process also includes: Collect the data used in the data detection; Based on the multiple data and the parameters detected in the parameter set, a set index is calculated; wherein, the detection parameters include the error range corresponding to the fault injection and the error range corresponding to the measured signal being restored to its original state; Generate an evaluation report based on the set indicators.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a computer program stored in the memory, implements the method of any one of claims 1-9.