Test method, test bench, system and equipment for CAN data recorder

By using scripts to automatically process bus messages in CAN data logger tests and comparing frame numbers and timestamps, the problems of manual configuration and inefficient comparison in existing test methods are solved, achieving efficient and accurate test results.

CN120658640APending Publication Date: 2025-09-16CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510684044.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing CAN data logger testing methods rely on manual configuration of test message diversity, making it difficult to generate comprehensive test scenarios. In addition, the playback data comparison is inefficient and has insufficient coverage.

Method used

A plurality of messages on the bus are obtained through the first script and stored in the first and second arrays respectively. A one-to-one correspondence is established based on the frame sequence number. The timestamp offset and the preset tolerance value are used for comparison to identify missed frames, multiple frames and abnormal data.

Benefits of technology

It realizes the automation and accurate comparison of CAN data logger testing, effectively identifies missed frames, multiple frames and abnormal data, and improves test efficiency and result credibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120658640A_ABST
    Figure CN120658640A_ABST
Patent Text Reader

Abstract

The invention provides a test method, a test bench, a system and equipment for a CAN data recorder, and relates to the technical field of communication network testing, and the method comprises the steps: obtaining a plurality of messages on a bus through a first script; analyzing respective message channels of the plurality of messages, and according to the respective message channels of the plurality of messages, inputting a test message into a pre-created first array, and inputting a to-be-tested message into a pre-created second array; and establishing a one-to-one correspondence relationship between the test messages in the first array and the to-be-tested messages in the second array based on respective frame numbers, and comparing the test messages and the to-be-tested messages with consistent frame numbers to obtain a test result. According to the invention, automatic and accurate comparison of the test process is realized, frame leakage, multiple frames and abnormal data can be effectively identified, and the test efficiency and the result credibility are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of automobile communication network testing, and in particular to a testing method, test bench, system and equipment for a CAN data recorder. Background Art

[0002] With the rapid development of automotive electronics in recent years, the accuracy and stability of data recording for the Controller Area Network (CAN), the core of in-vehicle communications, have become increasingly important. CAN data loggers, devices used to collect and store CAN bus communication data, are widely used in scenarios such as vehicle fault diagnosis, performance testing, and component verification. They must maintain data integrity even during long, high-load operation, making them a key test target during research and development.

[0003] Current testing methods typically involve test equipment continuously sending various CAN messages to the bus, which are then recorded by a data logger for comparison and analysis. However, existing methods have the following problems: First, the diversity of test messages relies on manual configuration, making it difficult to efficiently generate comprehensive test scenarios; second, playback data comparisons typically rely on manual sampling, which is inefficient and lacks coverage.

[0004] Therefore, a new testing method is urgently needed to improve the reliability and accuracy of the test. Summary of the Invention

[0005] In view of the above problems, embodiments of the present application provide a test method, test bench, system and device for a CAN data logger, so as to overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect of an embodiment of the present application, a method for testing a CAN data recorder is provided, the method comprising: Acquire multiple messages on the bus through a first script, wherein the multiple messages include: a test message sent by a test device, and a message to be tested fed back by a CAN data recorder; Analyze the message channels of the plurality of messages, and enter the test message into a pre-created first array and the message to be tested into a pre-created second array according to the message channels of the plurality of messages; A one-to-one correspondence is established between the test messages in the first array and the messages to be tested in the second array based on their respective frame sequence numbers, and the test messages with the same frame sequence numbers are compared with the messages to be tested to obtain a test result.

[0007] Optionally, the attributes of the message include at least a timestamp, and the comparing the test message with the message to be tested having the same frame sequence number to obtain a test result includes: Obtain the timestamp of the first test message frame in the first array and the timestamp of the first message frame to be tested in the second array; Calculating a timestamp offset based on the timestamp of the first frame test message and the timestamp of the first frame to be tested message; According to the timestamp offset and the preset timestamp tolerance value, it is determined whether the timestamps of the test message of each frame and the corresponding message to be tested correspond to each other, so as to obtain a comparison result for the timestamps.

[0008] Optionally, the step of determining whether the timestamps of the test message of each frame and the corresponding message to be tested correspond to each other based on the timestamp offset and the preset timestamp tolerance value to obtain a comparison result for the timestamps includes: Initialize index counters N and M, where the index counter N represents the current frame sequence number of the remaining test messages in the first array, and the index counter M represents the current frame sequence number of the remaining test messages in the second array, and the initial values ​​of both are 1; Under the condition that N does not exceed the total number of test message frames and M does not exceed the total number of test message frames, perform the following comparison steps: Get the timestamp of the Nth test message and the timestamp of the Mth frame of the message to be tested; Subtract the timestamp of the Nth test message from the timestamp of the corresponding Mth test message to obtain the timestamp difference; If the timestamp difference is less than or equal to the preset timestamp tolerance value, and the timestamp difference is less than or equal to the timestamp offset, then it is determined that the timestamps of the Nth frame test message match the timestamps of the Mth frame test message, and N and M are increased by 1 respectively, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is greater than the timestamp offset, it is determined that the CAN data recorder has missed the Nth frame test message, only M is increased by 1, N remains unchanged, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is less than the timestamp offset, it is determined that the CAN data recorder has recorded an M-th frame of the message to be tested more than once, and only N is increased by 1, M is kept unchanged, and the next round of comparison is entered; The comparison is performed cyclically until all test messages in the first array or all messages to be tested in the second array have been traversed.

[0009] Optionally, the method further includes: If all test messages in the first array have completed timestamp comparison, and there are test messages in the second array for which timestamp comparison has not been completed, marking the test messages in the second array for which timestamp comparison has not been completed as duplicate frames; If all the test messages in the second array have completed timestamp comparison, and there are test messages in the first array that have not completed timestamp comparison, the test messages in the first array that have not completed timestamp comparison are marked as missing frames.

[0010] Optionally, before comparing the test message with the message to be tested, the method further includes: Obtaining a rolling counter value of each test message, where the rolling counter value is a label signal pre-filled in a preset byte of the test message when the test device sends the test message; Compare the rolling counter value of the test message with the preset expected value; When the rolling counter value matches the preset expected value, determining that the test message sent by the test device is a continuous message; When the rolling counter value does not match the preset expected value, it is determined that the test message sent by the test device is a discontinuous message.

[0011] Optionally, the process of filling the rolling counter value includes: Before the test device sends a current frame test message, obtaining a rolling counter value filled in a previous frame test message; Increasing the rolling counter value of the previous frame test message by 1 to obtain the rolling counter value of the current frame test message and filling the value into the preset byte of the current frame test message; If the result of adding 1 to the rolling counter value reaches a preset maximum value, the rolling counter value of the current frame test message is reset to 0, and the filling cycle is restarted until all test messages have completed the filling of the rolling counter value, wherein the previous frame test message and the current frame test message are test messages of adjacent frames.

[0012] Optionally, before the test device sends the test message, the method further includes: Create a message template through the second script; Assigning attribute variables to the message template to generate multiple different types of test messages, wherein the attribute variables include at least one or more of a timestamp, an ID, a DLC, a BRS bit, and a Data value; The timer is started by a preset time variable to control the test device to send the test message frame by frame according to a preset sending frequency.

[0013] In a second aspect of the present application, a test bench for a CAN data recorder is provided, the test bench being used to perform the test method according to the first aspect of the present application, the test bench comprising: a test device, a CAN data recorder, and a splitter; The CAN data recorder includes a plurality of channels to be tested, the splitter includes an input port and a plurality of output ports, the plurality of channels to be tested are arranged in a one-to-one correspondence with the plurality of output ports, and any one of the channels to be tested is connected to the test device via the corresponding output port on the splitter; The test device sends a test message, which is transmitted to the splitter through the splitter input port and then transmitted to the CAN data recorder through the splitter output port. The CAN data recorder stores the received test message.

[0014] In a third aspect of the present application, a test system for a CAN data logger is provided, the system comprising: An acquisition module is used to acquire multiple messages on the bus through a first script, wherein the multiple messages include: a test message sent by a test device and a message to be tested fed back by a CAN data recorder; an analysis and recording module, configured to analyze the message channels of the plurality of messages, and record the test message into a pre-created first array and the message to be tested into a pre-created second array according to the message channels of the plurality of messages; The comparison module is used to establish a one-to-one correspondence between the test messages in the first array and the messages to be tested in the second array based on their respective frame sequence numbers, and compare the test messages with the messages to be tested with the same frame sequence numbers to obtain test results.

[0015] Optionally, the attributes of the message include at least a timestamp, and the test message with the same frame sequence number is compared with the message to be tested to obtain a test result, and the comparison module includes: A first acquisition submodule, configured to acquire a timestamp of a first frame of a test message in the first array and a timestamp of a first frame of a message to be tested in the second array; A calculation submodule, configured to calculate a timestamp offset based on the timestamp of the first frame test message and the timestamp of the first frame message to be tested; The first determining submodule is configured to determine whether the timestamps of the test message of each frame correspond to the timestamps of the corresponding message to be tested according to the timestamp offset and the preset timestamp tolerance value, so as to obtain a comparison result for the timestamps.

[0016] Optionally, based on the timestamp offset and the preset timestamp tolerance value, determining whether the timestamps of the test message of each frame and the corresponding message to be tested correspond to each other, so as to obtain a comparison result for the timestamps, the first determining submodule includes: An initialization subunit, configured to initialize index counters N and M, wherein the index counter N represents the current frame sequence number of the remaining test messages in the first array, and the index counter M represents the current frame sequence number of the remaining test messages in the second array, and both have an initial value of 1; Under the condition that N does not exceed the total number of test message frames and M does not exceed the total number of test message frames, the initialization subunit is used to perform the following comparison steps: Get the timestamp of the Nth test message and the timestamp of the Mth frame of the message to be tested; Subtract the timestamp of the Nth test message from the timestamp of the corresponding Mth test message to obtain the timestamp difference; If the timestamp difference is less than or equal to the preset timestamp tolerance value, and the timestamp difference is less than or equal to the timestamp offset, then it is determined that the timestamps of the Nth frame test message match the timestamps of the Mth frame test message, and N and M are increased by 1 respectively, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is greater than the timestamp offset, it is determined that the CAN data recorder has missed the Nth frame test message, only M is increased by 1, N remains unchanged, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is less than the timestamp offset, it is determined that the CAN data recorder has recorded an M-th frame of the message to be tested more than once, and only N is increased by 1, M is kept unchanged, and the next round of comparison is entered; The comparison is performed cyclically until all test messages in the first array or all messages to be tested in the second array have been traversed.

[0017] Optionally, the initialization subunit is further configured to perform the following steps: If all test messages in the first array have completed timestamp comparison, and there are test messages in the second array for which timestamp comparison has not been completed, marking the test messages in the second array for which timestamp comparison has not been completed as duplicate frames; If all the test messages in the second array have completed timestamp comparison, and there are test messages in the first array that have not completed timestamp comparison, the test messages in the first array that have not completed timestamp comparison are marked as missing frames.

[0018] Optionally, the system further comprises: A second acquisition submodule is configured to acquire a rolling counter value of each test message, where the rolling counter value is a label signal pre-filled in a preset byte of the test message when the test device sends the test message; A comparison submodule, used to compare the rolling counter value of the test message with a preset expected value; A second determining submodule, configured to determine, when the rolling counter value matches the preset expected value, that the test message sent by the test device is a continuous message; The third determining submodule is configured to determine that the test message sent by the test device is a discontinuous message when the rolling counter value does not match the preset expected value.

[0019] Optionally, the system further comprises: A third acquisition submodule is configured to acquire a rolling counter value filled in a previous frame of test message before the test device sends a current frame of test message; A filling submodule, configured to add 1 to the rolling counter value of the previous frame test message as the rolling counter value of the current frame test message, and fill the value into a preset byte of the current frame test message; If the result of adding 1 to the rolling counter value reaches a preset maximum value, the rolling counter value of the current frame test message is reset to 0, and the filling cycle is restarted until all test messages have completed the filling of the rolling counter value, wherein the previous frame test message and the current frame test message are test messages of adjacent frames.

[0020] Optionally, the system further comprises: Create a submodule for creating a message template through the second script; A generation submodule, configured to assign attribute variables to the message template and generate multiple different types of test messages, wherein the attribute variables include at least one or more of a timestamp, an ID, a DLC, a BRS bit, and a Data value; The start and control submodule is used to start the timer through a preset time variable to control the test device to send the test message frame by frame according to a preset sending frequency.

[0021] In a fourth aspect of the present application, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of the test method for the CAN data recorder as described in the first aspect of the present application are implemented.

[0022] Beneficial effects of this application: The present application proposes a testing method for a CAN data recorder, the method comprising: obtaining multiple messages on a bus through a first script, the multiple messages comprising: a test message sent by a test device, and a message to be tested fed back by the CAN data recorder; analyzing the message channels of each of the multiple messages, and entering the test messages into a pre-created first array and the message to be tested into a pre-created second array according to the message channels of each of the multiple messages; establishing a one-to-one correspondence between the test messages in the first array and the messages to be tested in the second array based on their respective frame sequence numbers, and comparing the test messages with the messages to be tested having the same frame sequence numbers to obtain a test result.

[0023] This application captures bus messages through a first script, distinguishes test messages from test messages by message channel, and stores them in two separate arrays. A one-to-one correspondence is established based on the frame sequence number, and messages with the same frame sequence number are compared one by one to determine the accuracy and stability of the recorder's recordings. This application automates the test process and enables precise comparison, effectively identifying missed frames, multiple frames, and abnormal data, improving test efficiency and the credibility of the results. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 This is a flowchart of the steps of a CAN data logger testing method provided in an embodiment of the present application; Figure 2 This is a flowchart of a message comparison method based on timestamp attributes provided by an embodiment of the present application; Figure 3 This is a connection block diagram of a test bench provided in an embodiment of the present application; Figure 4 1 is a schematic diagram of a test system for a CAN data recorder provided in an embodiment of the present application; Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the accompanying drawings show exemplary embodiments of the present application, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0027] This application utilizes the CANoe test system developed by Vector to establish a test environment. By running a pre-written first script, the connected CAN bus is monitored and data captured in real time. This script, deployed within a fully configured CANoe project, automatically identifies and classifies bus messages, effectively capturing test messages sent by the test equipment as well as test messages fed back by the CAN data recorder under test. The stable data acquisition capabilities of the CANoe project and the high flexibility of the first script ensure the automation of the test process and the accuracy of data acquisition.

[0028] In this application, the first script is used to capture and process messages on the bus in a CANoe project. Its main function is to monitor messages on the bus through the preset on message function and store the test messages from the test equipment and the test messages from the CAN data recorder in different arrays according to their source. The script extracts the key attributes of the message (such as timestamp, ID, DLC, data, etc.) and compares the messages according to the frame sequence number to check for errors, wrong frames, or missing frames. If an anomaly is found, the script will record the error information and mark the error type. At the same time, the script will also handle situations such as timestamp deviation by setting a tolerance range to ensure the accuracy and stability of the test process.

[0029] In a first aspect of the present application, a method for testing a CAN data recorder is provided. Figure 1 Shown, including: Step S101: obtaining a plurality of messages on the bus through a first script, wherein the plurality of messages include: a test message sent by a test device, and a message to be tested fed back by a CAN data recorder.

[0030] In this step, a pre-written first script is run in the CANoe project of the test environment built by the CANoe test system to monitor and obtain multiple messages on the bus in real time. These messages include test messages sent by the test equipment and test messages fed back by the CAN data recorder. Then, the first script captures the messages through the on message function. In this application, the first script can be a first CAPL script.

[0031] Step S102 : analyzing the respective message channels of the plurality of messages, and entering the test message into a pre-created first array and the message to be tested into a pre-created second array according to the respective message channels of the plurality of messages.

[0032] In this step, the first script needs to analyze the source of each message, that is, to determine whether it is a test message sent by the test equipment or a test message fed back by the CAN data recorder. In this application, by analyzing the message channel of each message, messages from different sources are distinguished, and then the messages from different sources are stored separately in pre-created arrays. Among them, if a message is a test message sent by the test equipment, this message is recorded in the pre-created first array. If a message is a test message received by the CAN data recorder, this message is recorded in the pre-created second array.

[0033] Step S103 , establishing a one-to-one correspondence between the test messages in the first array and the messages to be tested in the second array based on their respective frame sequence numbers, and comparing the test messages with the messages to be tested having the same frame sequence numbers to obtain a test result.

[0034] In this step, since each message on the CAN bus has a unique frame number, this frame number is used to identify the order of the message in the entire transmission sequence. In this step, the first script will first establish a one-to-one correspondence between the test message in the first array and the message to be tested in the second array based on the frame number of the message. In other words, each test message will be paired with its corresponding message to be tested, and then the test message and the message to be tested with the same frame number will be compared frame by frame, so that the test result for the CAN data recorder can be obtained based on the comparison result. For example, during the comparison process, if it is found that the test message and the message to be tested have deviations in certain fields, the script will record these errors. For example, possible errors include data inconsistency, missing frames, wrong frames, etc. These errors will be marked as exceptions and stored in an error array or log for subsequent troubleshooting.

[0035] This application captures bus messages through a first script, distinguishes test messages from test messages by message channel, and stores them in two separate arrays. A one-to-one correspondence is established based on the frame sequence number, and messages with the same frame sequence number are compared one by one to determine the accuracy and stability of the recorder's recordings. This application automates the test process and enables precise comparison, effectively identifying missed frames, multiple frames, and abnormal data, improving test efficiency and the credibility of the results.

[0036] In one embodiment, the attributes of the message include at least a timestamp, and the comparing the test message with the message to be tested having the same frame sequence number to obtain a test result includes: Obtain the timestamp of the first test message frame in the first array and the timestamp of the first message frame to be tested in the second array; Calculating a timestamp offset based on the timestamp of the first frame test message and the timestamp of the first frame to be tested message; According to the timestamp offset and the preset timestamp tolerance value, it is determined whether the timestamps of the test message of each frame and the corresponding message to be tested correspond to each other, so as to obtain a comparison result for the timestamps.

[0037] Every message sent or received on the bus is accompanied by a timestamp attribute, recording the specific time the message was captured. This time information can be used to determine the degree of synchronization between two message frames in the time dimension and is an important basis for determining whether the messages correspond.

[0038] In this embodiment, to improve the accuracy and robustness of the test, the timestamp is introduced as a key comparison attribute when comparing the test message with the message to be tested, and the offset between the timestamps is calculated and the tolerance range is set to achieve more reliable message matching. The specific steps are as follows: First, extract the timestamp of the first test frame from the first array, and simultaneously extract the timestamp of the first frame of the test message from the second array. Then, calculate the difference between these two timestamps to obtain a basic timestamp offset. This offset reflects any systematic deviation in the clock or start time between the test equipment and the data recorder.

[0039] In addition, a timestamp difference value is preset to tolerate a certain degree of clock error or processing delay. The remaining messages in the first and second arrays with the same frame sequence number are then traversed, and the timestamps of each pair of messages are compared based on the timestamp offset and the preset timestamp tolerance value to obtain a timestamp comparison result. For example, if the timestamp difference is within the tolerance range, the timestamp of the frame message is considered to be a successful match; if the time difference exceeds the tolerance range, it is marked as an anomaly, indicating possible frame errors, frame loss, or delayed recording.

[0040] This embodiment introduces a timestamp comparison mechanism to further verify the time consistency of the message based on the consistency of the frame sequence number, effectively improving the robustness of the test results, avoiding misjudgments caused by factors such as clock differences and system delays, and improving the accuracy and reliability of the test method.

[0041] In one embodiment, the step of determining whether the timestamps of the test message of each frame correspond to the timestamps of the corresponding message to be tested based on the timestamp offset and the preset timestamp tolerance value to obtain a comparison result for the timestamps includes: Initialize index counters N and M, where the index counter N represents the current frame sequence number of the remaining test messages in the first array, and the index counter M represents the current frame sequence number of the remaining test messages in the second array, and the initial values ​​of both are 1; Under the condition that N does not exceed the total number of test message frames and M does not exceed the total number of test message frames, perform the following comparison steps: Get the timestamp of the Nth test message and the timestamp of the Mth frame of the message to be tested; Subtract the timestamp of the Nth test message from the timestamp of the corresponding Mth test message to obtain the timestamp difference; If the timestamp difference is less than or equal to the preset timestamp tolerance value, and the timestamp difference is less than or equal to the timestamp offset, then it is determined that the timestamps of the Nth frame test message match the timestamps of the Mth frame test message, and N and M are increased by 1 respectively, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is greater than the timestamp offset, it is determined that the CAN data recorder has missed the Nth frame test message, only M is increased by 1, N remains unchanged, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is less than the timestamp offset, it is determined that the CAN data recorder has recorded an M-th frame of the message to be tested more than once, and only N is increased by 1, M is kept unchanged, and the next round of comparison is entered; The comparison is performed cyclically until all test messages in the first array or all messages to be tested in the second array have been traversed.

[0042] In this embodiment, refer to Figure 2 The flowchart of a message comparison method based on timestamp attributes is shown. First, two index counters N and M are set. The index counter N represents the current frame sequence number of the remaining test message in the first array, and the index counter M represents the current frame sequence number of the remaining test message in the second array. The initial value of both is 1. Next, a two-array traversal loop is executed, with the entry conditions being: N does not exceed the total number of frames in the first array (test packets); M does not exceed the total number of frames in the second array (test packets). As long as these two conditions are met, the timestamp comparison continues to ensure that the entire test data set has been traversed.

[0043] In each round of alignment, the following operations are performed: Take out the Nth test message from the first array and read its timestamp; take out the Mth test message from the second array and read its timestamp; Subtract the timestamp of the message under test from the timestamp of the test message to obtain a timestamp offset (which can be positive or negative, depending on the direction of the clock offset). In addition, to account for systematic errors caused by the lack of synchronization between the test equipment and the internal clock of the recorder, a preset timestamp tolerance value needs to be determined at the beginning of the test to indicate the maximum allowable time deviation range. If the timestamp difference is less than or equal to the preset timestamp tolerance value, and the timestamp difference is less than or equal to the timestamp offset, then the timestamps of the Nth test message and the Mth test message are determined to match, and N and M are increased by 1 respectively, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is greater than the timestamp offset, it is determined that the CAN data recorder has missed the Nth frame test message, only M is increased by 1, keeping N unchanged, and entering the next round of comparison; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is less than the timestamp offset, it is determined that the CAN data recorder has recorded the Mth frame of the test message more than once. Only N is increased by 1, and M remains unchanged, and the next round of comparison is entered; The comparison is performed cyclically until all test messages in the first array or all messages to be tested in the second array have been traversed.

[0044] In this embodiment, if the timestamp comparison result of the corresponding two frames of messages is a match, other attributes need to be judged. For example, the comparison of attributes such as ID, DLC, BRS bit and Data value can be continued. In addition, during the comparison process, if a missing frame or multiple frames are detected, the abnormal message can be recorded in the abnormal array; at the same time, a status byte can be set for each frame, and different bits can be used to record whether the comparison is successful, whether there is a missing frame, whether there are multiple frames, whether the timestamp exceeds the limit, etc. For example: for a missing frame, the status byte source bit position 0 indicates that the recorded data is a test message, and the error type bit bit 7 is set to 1 to indicate a missing frame error; for multiple frames, the status byte source bit position 1 indicates that the recorded data is a test message, and the error type bit bit 6 is set to 1 to indicate a multiple frame error; finally, a detailed test report including successfully matched messages, abnormal messages and comparison status can be generated as a basis for judging the accuracy of the CAN data recorder recharge.

[0045] In one embodiment, if all test messages in the first array have completed timestamp comparison, and there are test messages in the second array for which timestamp comparison has not been completed, the test messages in the second array for which timestamp comparison has not been completed are marked as duplicate frames; If all the test messages in the second array have completed timestamp comparison, and there are test messages in the first array whose timestamp comparison has not been completed, the test messages in the first array whose timestamp comparison has not been completed are marked as missing frames.

[0046] In this embodiment, continue to refer to Figure 2 As shown in the flowchart, in order to ensure the integrity of the frame-by-frame one-to-one comparison between the test message and the message to be tested, after completing the timestamp-based message matching process, it is necessary to perform additional processing on the remaining messages that have not completed the comparison to further determine whether there are problems such as missing frames or duplicate records.

[0047] Specifically, if it is detected that all the messages in the first array have completed the timestamp comparison of the corresponding frames, that is, N is less than or equal to b, b is the total number of all messages in the first array, and there are still remaining messages in the second array that have not participated in the comparison, that is, M is greater than a, a is the total number of all messages in the second array, then it is considered that the CAN data recorder has multiple recording behavior. At this time, these uncompleted test messages are marked as "duplicate frames", and they are added to the exception array one by one, and the status byte of each abnormal frame is updated. If all the test messages in the second array have completed the timestamp comparison, that is, M is less than or equal to a, and there are still remaining unmatched test messages in the first array, that is, N is greater than b, it means that these messages have not been recorded by the CAN data recorder, which is a "missing frame" situation. At this time, these remaining test messages should be marked as "missing frames", also added to the exception array, and the corresponding status bytes are set.

[0048] In one embodiment, before comparing the test message with the message to be tested, the method further includes: Obtaining a rolling counter value of each test message, where the rolling counter value is a label signal pre-filled in a preset byte of the test message when the test device sends the test message; Compare the rolling counter value of the test message with the preset expected value; When the rolling counter value matches the preset expected value, determining that the test message sent by the test device is a continuous message; When the rolling counter value does not match the preset expected value, it is determined that the test message sent by the test device is a discontinuous message.

[0049] In this embodiment, to further improve the accuracy and traceability of test data, before performing the test message and test message comparison step, the test message's tag signal is also identified and screened to confirm whether the message is continuous and valid test data. This embodiment embeds a rolling counter value in a preset byte of each test message when the test device sends a message. This rolling counter value can be an RC signal value, which serves as an identification tag for verifying the performance of the test device. In this application, the rolling counter value, as a tag signal, is pre-set and written by the test device when sending a message, and is used to identify the continuity status of the test message sent by the test device.

[0050] First, all test messages in the first array are parsed, and the rolling counter value at a specified byte position in each test message is extracted. Then, each extracted rolling counter value is compared against a preset expected value. This expected value can be pre-set by the test plan or generated using a specific rule, such as a sequential increment or cyclic counting method.

[0051] If the rolling counter value is consistent with the preset expected value, it means that the message is generated in a normal continuous sending process and can be identified as a valid test message, that is, a continuous message.

[0052] If the rolling counter value is inconsistent with the expected value, it means that the message may be caused by abnormal conditions such as retransmission, frame loss, frame skipping, etc., and is a discontinuous message. Such messages will be marked or excluded from subsequent comparisons to avoid interference with the accuracy of the comparison results.

[0053] By analyzing the rolling counter value, not only can the integrity of the test data be further verified, but it can also assist in identifying problems such as disorder, duplication, and frame loss that may occur during the communication process. This allows the reliability of the test equipment to be verified in advance, avoiding the situation where the test equipment sends discontinuous messages but is mistakenly judged to be unstable in the collection and storage functions of the CAN data recorder, misleading the investigation direction and wasting development and testing resources. It can also provide pre-emptive protection for subsequent timestamp comparison and attribute consistency verification.

[0054] In one embodiment, the process of filling the rolling counter value includes: Before the test device sends a current frame test message, obtaining a rolling counter value filled in a previous frame test message; Increasing the rolling counter value of the previous frame test message by 1 to obtain the rolling counter value of the current frame test message and filling the value into the preset byte of the current frame test message; If the result of adding 1 to the rolling counter value reaches a preset maximum value, the rolling counter value of the current frame test message is reset to 0, and the filling cycle is restarted until all test messages have completed the filling of the rolling counter value, wherein the previous frame test message and the current frame test message are test messages of adjacent frames.

[0055] In this embodiment, to ensure that each test message sent by the test device is uniquely identifiable and traceable in terms of timing and data content, an automatic filling mechanism for a rolling counter value is introduced on the test device side to mark the order and continuity of test message transmission. This rolling counter value serves as an identification tag and is written into a preset byte position in the test message.

[0056] Specifically, at the start of the test, the first test message frame's rolling counter value is set to 0 by default. This value is then filled into a preset location in the data field of the message frame and sent to the bus. When the current test message frame is ready to be sent, the previously filled rolling counter value is read from the previous test message frame. The previous frame's rolling counter value is incremented by 1 to obtain the rolling counter value for the current test message frame. For example, if the previous frame's rolling counter value was 3, the current frame's rolling counter value is 4. If the result of incrementing the rolling counter value by 1 equals or exceeds the preset maximum rolling counter value (e.g., 255 or another upper limit), the current frame's rolling counter value is reset to 0, implementing a cyclic filling strategy. This strategy prevents rolling counter overflow and facilitates identifying repetitive cycles in long, continuously transmitted messages. The current frame's rolling counter value is written into a preset field in the message data and sent along with the message. The current frame's rolling counter value then becomes the "previous frame" rolling counter value for the next frame, entering the next round of incremental filling.

[0057] In this embodiment, the above filling process is achieved by writing the following rolling counter value increase algorithm in the first script: RC n+1 =(RC n+1 ) mod M, where RC n+1 is the rolling counter value to be filled in the next frame of test message to be sent, RCn is the rolling counter value filled in the current frame of test message, and M is the preset maximum value.

[0058] In one embodiment, before the test device sends the test message, the method further includes: Create a message template through the second script; Assigning attribute variables to the message template to generate multiple different types of test messages, wherein the attribute variables include at least one or more of a timestamp, an ID, a DLC, a BRS bit, and a Data value; The timer is started by a preset time variable to control the test device to send the test message frame by frame according to a preset sending frequency.

[0059] In this embodiment, in order to realize the automatic construction of the test message and accurately control the sending rhythm, before the test device starts the test process, the message to be sent is first prepared and configured by a second script running in the CANoe environment. In this application, the second script can be a second CAPL script, which specifically includes the following key steps: First, the second script creates a message template using the built-in message type in the CAPL language. This predefines the basic structure of the test message, such as the ID, DLC (data length), BRS bit, and Data field value. This template serves as the basis for all subsequent test message instances.

[0060] Next, the second script programmatically assigns values ​​to multiple attribute variables within the message template to generate test messages with varying content and attributes. These attributes can be dynamically assigned based on test requirements, for example through loops, conditional branching, or by reading from external configuration tables, allowing for flexible generation of message types required for various test scenarios.

[0061] To ensure that each message frame sent by the test device strictly follows the preset interval, the second script uses the pre-set msTimer variable to start a timer (for example, triggering every 10ms). This timer is bound to the on timer event and sends a constructed test message frame to the CAN bus each time it is triggered. By precisely controlling the frequency of test message transmission, actual communication processes can be simulated or the time accuracy of the recorder can be verified.

[0062] In this embodiment, the second script is used to implement the complete construction and scheduling process of the test message from "template creation, attribute assignment, to timing control sending" in the pre-test stage, ensuring that the test message during the test process can cover the test scenarios to the maximum extent, enrich the test sample types, and improve the applicability of the test.

[0063] The present application proposes a test method for a CAN data recorder, the method comprising: obtaining multiple messages on the bus through a first script, the multiple messages comprising: a test message sent by a test device, and a message to be tested fed back by a CAN data recorder; analyzing the message channels of each of the multiple messages, and according to the message channels of each of the multiple messages, entering the test message into a pre-created first array, and entering the message to be tested into a pre-created second array; establishing a one-to-one correspondence between the test message in the first array and the message to be tested in the second array based on their respective frame numbers, and comparing the test message with the message to be tested that has the same frame number to obtain a test result. The present application captures bus messages through a first script, distinguishes the test message and the message to be tested by the message channel and stores them in two arrays respectively, and establishes a one-to-one correspondence based on the frame number, and compares the messages with the same frame number one by one to judge the accuracy and stability of the recorder's records. This application realizes the automation and precise comparison of the test process, which can effectively identify missed frames, multiple frames and abnormal data, and improve test efficiency and result credibility.

[0064] Based on the same inventive concept, in a second aspect of the present application, a test bench for a CAN data recorder is provided, wherein the test bench is used to perform the test method as described in the first aspect of the present application, and the test bench comprises: a test device, a CAN data recorder, and a splitter; The CAN data recorder includes a plurality of channels to be tested, the splitter includes an input port and a plurality of output ports, the plurality of channels to be tested are arranged in a one-to-one correspondence with the plurality of output ports, and any one of the channels to be tested is connected to the test device via the corresponding output port on the splitter; The test device sends a test message, which is transmitted to the splitter through the splitter input port and then transmitted to the CAN data recorder through the splitter output port. The CAN data recorder stores the received test message.

[0065] Refer to Figure 3 The test bench connection block diagram shown in the figure consists of three main components: test equipment, CAN data recorder, and splitter. The test equipment simulates actual vehicle CAN network communications and is capable of generating and sending various test messages. A script runs within the test equipment, sending test messages according to preset frequency, content, and rules. The CAN data recorder is the object under test and typically has multiple independent test channels, each used to record and store communication data from different vehicle network segments. The splitter is used to distribute and isolate signals and has one input port and multiple output ports. The splitter's design is critical, ensuring that the signal from a single network segment sent by the test equipment is evenly and stably distributed to the various test channels of the CAN data recorder while maintaining signal integrity.

[0066] The specific connection method of the test bench is as follows: the input port of the splitter is connected to the output port of the test equipment; the multiple output ports of the splitter are respectively connected to the multiple test channels of the CAN data recorder; one test channel is connected to one output port of the splitter in a one-to-one correspondence to ensure independent transmission and precise matching of data.

[0067] Based on the same inventive concept, the third aspect of the present application provides a test system for a CAN data recorder, such as Figure 4 As shown, the system includes: An acquisition module 201 is configured to acquire multiple messages on the bus through a first script, wherein the multiple messages include: a test message sent by a test device, and a test message fed back by a CAN data recorder; An analysis and recording module 202 is configured to analyze the message channels of the plurality of messages and, according to the message channels of the plurality of messages, record the test message into a pre-created first array and record the message to be tested into a pre-created second array; The comparison module 203 is used to establish a one-to-one correspondence between the test messages in the first array and the messages to be tested in the second array based on their respective frame sequence numbers, and compare the test messages with the messages to be tested with the same frame sequence numbers to obtain a test result.

[0068] Optionally, the attributes of the message include at least a timestamp, and the test message with the same frame sequence number is compared with the message to be tested to obtain a test result, and the comparison module 203 includes: A first acquisition submodule, configured to acquire a timestamp of a first frame of a test message in the first array and a timestamp of a first frame of a message to be tested in the second array; A calculation submodule, configured to calculate a timestamp offset based on the timestamp of the first frame test message and the timestamp of the first frame message to be tested; The first determining submodule is configured to determine whether the timestamps of the test message of each frame correspond to the timestamps of the corresponding message to be tested according to the timestamp offset and the preset timestamp tolerance value, so as to obtain a comparison result for the timestamps.

[0069] Optionally, based on the timestamp offset and the preset timestamp tolerance value, determining whether the timestamps of the test message of each frame and the corresponding message to be tested correspond to each other, so as to obtain a comparison result for the timestamps, the first determining submodule includes: An initialization subunit, configured to initialize index counters N and M, wherein the index counter N represents the current frame sequence number of the remaining test messages in the first array, and the index counter M represents the current frame sequence number of the remaining test messages in the second array, and both have an initial value of 1; Under the condition that N does not exceed the total number of test message frames and M does not exceed the total number of test message frames, the initialization subunit is used to perform the following comparison steps: Get the timestamp of the Nth test message and the timestamp of the Mth frame of the message to be tested; Subtract the timestamp of the Nth test message from the timestamp of the corresponding Mth test message to obtain the timestamp difference; If the timestamp difference is less than or equal to the preset timestamp tolerance value, and the timestamp difference is less than or equal to the timestamp offset, then it is determined that the timestamps of the Nth frame test message match the timestamps of the Mth frame test message, and N and M are increased by 1 respectively, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is greater than the timestamp offset, it is determined that the CAN data recorder has missed the Nth frame test message, only M is increased by 1, N remains unchanged, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is less than the timestamp offset, it is determined that the CAN data recorder has recorded an M-th frame of the message to be tested more than once, and only N is increased by 1, M is kept unchanged, and the next round of comparison is entered; The comparison is performed cyclically until all test messages in the first array or all messages to be tested in the second array have been traversed.

[0070] Optionally, the initialization subunit is further configured to perform the following steps: If all test messages in the first array have completed timestamp comparison, and there are test messages in the second array for which timestamp comparison has not been completed, marking the test messages in the second array for which timestamp comparison has not been completed as duplicate frames; If all the test messages in the second array have completed timestamp comparison, and there are test messages in the first array that have not completed timestamp comparison, the test messages in the first array that have not completed timestamp comparison are marked as missing frames.

[0071] Optionally, the system further comprises: A second acquisition submodule is configured to acquire a rolling counter value of each test message, where the rolling counter value is a label signal pre-filled in a preset byte of the test message when the test device sends the test message; A comparison submodule, used to compare the rolling counter value of the test message with a preset expected value; A second determining submodule, configured to determine, when the rolling counter value matches the preset expected value, that the test message sent by the test device is a continuous message; The third determining submodule is configured to determine that the test message sent by the test device is a discontinuous message when the rolling counter value does not match the preset expected value.

[0072] Optionally, the system further comprises: A third acquisition submodule is configured to acquire a rolling counter value filled in a previous frame of test message before the test device sends a current frame of test message; A filling submodule, configured to add 1 to the rolling counter value of the previous frame test message as the rolling counter value of the current frame test message, and fill the value into a preset byte of the current frame test message; If the result of adding 1 to the rolling counter value reaches a preset maximum value, the rolling counter value of the current frame test message is reset to 0, and the filling cycle is restarted until all test messages have completed the filling of the rolling counter value, wherein the previous frame test message and the current frame test message are test messages of adjacent frames.

[0073] Optionally, the system further comprises: Create a submodule for creating a message template through the second script; A generation submodule, configured to assign attribute variables to the message template and generate multiple different types of test messages, wherein the attribute variables include at least one or more of a timestamp, an ID, a DLC, a BRS bit, and a Data value; The start and control submodule is used to start the timer through a preset time variable to control the test device to send the test message frame by frame according to a preset sending frequency.

[0074] Based on the same inventive concept, the fourth aspect of the present application provides a Figure 5 The electronic device 100 shown includes a processor 120, a memory 110, and a program or instruction stored in the memory 110 and executable on the processor 120. When the program or instruction is executed by the processor, the steps of the test method for the CAN data recorder as described in the first aspect of the present application are implemented.

[0075] Each embodiment in this specification focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referenced to each other.

[0076] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0077] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0078] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0080] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0081] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0082] The above describes in detail the test method, test bench, system, and equipment for a CAN data logger. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. At the same time, for those skilled in the art, according to the concept of the present application, there may be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting the present application.

Claims

1. A method for testing a CAN data recorder, characterized in that: The method comprises: Acquire multiple messages on the bus through a first script, wherein the multiple messages include: a test message sent by a test device, and a message to be tested fed back by a CAN data recorder; Analyze the message channels of the plurality of messages, and enter the test message into a pre-created first array and the message to be tested into a pre-created second array according to the message channels of the plurality of messages; A one-to-one correspondence is established between the test messages in the first array and the messages to be tested in the second array based on their respective frame sequence numbers, and the test messages with the same frame sequence numbers are compared with the messages to be tested to obtain a test result.

2. The method for testing a CAN data recorder according to claim 1, wherein: The attributes of the message include at least a timestamp, and the test message with the same frame sequence number is compared with the message to be tested to obtain a test result, including: Obtain the timestamp of the first test message frame in the first array and the timestamp of the first message frame to be tested in the second array; Calculating a timestamp offset based on the timestamp of the first frame test message and the timestamp of the first frame to be tested message; According to the timestamp offset and the preset timestamp tolerance value, it is determined whether the timestamps of the test message of each frame and the corresponding message to be tested correspond to each other, so as to obtain a comparison result for the timestamps.

3. The testing method of the CAN data recorder according to claim 2, characterized in that: The step of determining whether the timestamps of the test message of each frame correspond to the timestamps of the corresponding message to be tested according to the timestamp offset and the preset timestamp tolerance value to obtain a comparison result for the timestamps includes: Initialize index counters N and M, where the index counter N represents the current frame sequence number of the remaining test messages in the first array, and the index counter M represents the current frame sequence number of the remaining test messages in the second array, and the initial values ​​of both are 1; Under the condition that N does not exceed the total number of test message frames and M does not exceed the total number of test message frames, perform the following comparison steps: Get the timestamp of the Nth test message and the timestamp of the Mth frame of the message to be tested; Subtract the timestamp of the Nth test message from the timestamp of the corresponding Mth test message to obtain the timestamp difference; If the timestamp difference is less than or equal to the preset timestamp tolerance value, and the timestamp difference is less than or equal to the timestamp offset, then it is determined that the timestamps of the Nth frame test message match the timestamps of the Mth frame test message, and N and M are increased by 1 respectively, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is greater than the timestamp offset, it is determined that the CAN data recorder has missed the Nth frame test message, only M is increased by 1, N remains unchanged, and the next round of comparison is entered; If the timestamp difference is greater than the preset timestamp tolerance value, and the timestamp difference is less than the timestamp offset, it is determined that the CAN data recorder has recorded an M-th frame of the message to be tested more than once, and only N is increased by 1, M is kept unchanged, and the next round of comparison is entered; The comparison is performed cyclically until all test messages in the first array or all messages to be tested in the second array have been traversed.

4. The method for testing a CAN data recorder according to claim 3, wherein: The method further comprises: If all test messages in the first array have completed timestamp comparison, and there are test messages in the second array for which timestamp comparison has not been completed, marking the test messages in the second array for which timestamp comparison has not been completed as duplicate frames; If all the test messages in the second array have completed timestamp comparison, and there are test messages in the first array that have not completed timestamp comparison, the test messages in the first array that have not completed timestamp comparison are marked as missing frames.

5. The method for testing a CAN data recorder according to claim 1, wherein: Before comparing the test message with the message to be tested, the method further includes: Obtaining a rolling counter value of each test message, where the rolling counter value is a label signal pre-filled in a preset byte of the test message when the test device sends the test message; Compare the rolling counter value of the test message with the preset expected value; When the rolling counter value matches the preset expected value, determining that the test message sent by the test device is a continuous message; When the rolling counter value does not match the preset expected value, it is determined that the test message sent by the test device is a discontinuous message.

6. The method for testing a CAN data recorder according to claim 5, wherein: The process of filling the rolling counter value includes: Before the test device sends a current frame test message, obtaining a rolling counter value filled in a previous frame test message; Increasing the rolling counter value of the previous frame test message by 1 to obtain the rolling counter value of the current frame test message and filling the value into the preset byte of the current frame test message; If the result of adding 1 to the rolling counter value reaches a preset maximum value, the rolling counter value of the current frame test message is reset to 0, and the filling cycle is restarted until all test messages have completed the filling of the rolling counter value, wherein the previous frame test message and the current frame test message are test messages of adjacent frames.

7. The method for testing a CAN data recorder according to claim 1, wherein: Before the test device sends the test message, the method further includes: Create a message template through the second script; Assigning attribute variables to the message template to generate multiple different types of test messages, wherein the attribute variables include at least one or more of a timestamp, an ID, a DLC, a BRS bit, and a Data value; The timer is started by a preset time variable to control the test device to send the test message frame by frame according to a preset sending frequency.

8. A test bench for a CAN data recorder, characterized in that: The test bench is used to perform the test method according to any one of claims 1 to 7, and the test bench comprises: a test device, a CAN data recorder, and a splitter; The CAN data recorder includes a plurality of channels to be tested, the splitter includes an input port and a plurality of output ports, the plurality of channels to be tested are arranged in a one-to-one correspondence with the plurality of output ports, and any one of the channels to be tested is connected to the test device via the corresponding output port on the splitter; The test device sends a test message, which is transmitted to the splitter through the splitter input port and then transmitted to the CAN data recorder through the splitter output port. The CAN data recorder stores the received test message.

9. A CAN data recorder test system, characterized in that: The system comprises: An acquisition module is used to acquire multiple messages on the bus through a first script, wherein the multiple messages include: a test message sent by a test device and a message to be tested fed back by a CAN data recorder; an analysis and recording module, configured to analyze the message channels of the plurality of messages, and record the test message into a pre-created first array and the message to be tested into a pre-created second array according to the message channels of the plurality of messages; The comparison module is used to establish a one-to-one correspondence between the test messages in the first array and the messages to be tested in the second array based on their respective frame sequence numbers, and compare the test messages with the messages to be tested with the same frame sequence numbers to obtain test results.

10. An electronic device, characterized in that: The device comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method for testing a CAN data recorder according to any one of claims 1 to 7.