A message testing method, device and equipment

By generating key information files for target messages and allocating test channels, the system automatically identifies and verifies E2E protection mechanism messages in vehicle communication network segments, solving the problems of low efficiency and high error rate in existing technologies and improving testing efficiency and accuracy.

CN119676124BActive Publication Date: 2026-04-07VOYAH AUTOMOBILE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, there are many vehicle communication network segments, which leads to low efficiency and easy errors when performing message verification for E2E protection mechanisms.

Method used

By generating a key information file for the target message, the system collects and stores messages from all communication network segments of the vehicle under test. Based on the test configuration information, a test channel is allocated for each communication network segment. The key information file is then used to extract test data of the target message under test from the test channel for verification.

Benefits of technology

It achieves automatic identification of the target message under test, reduces the error rate, and improves testing efficiency and accuracy through multi-channel verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676124B_ABST
    Figure CN119676124B_ABST
Patent Text Reader

Abstract

The application provides a message testing method, device and equipment, the method comprising: generating a key information file of a target message according to a communication matrix of each communication network segment of a target vehicle; the target message is a message using an end-to-end communication protection mechanism; collecting and storing messages of all communication network segments of a vehicle to be tested to obtain a target message file; assigning a corresponding test channel to each communication network segment according to received test configuration information; extracting test data of a target message to be tested from the target message file according to the key information file, and testing the target message to be tested in the test channel using the test data; thus, the target message to be tested can be automatically identified according to the key information of the target message, the error rate of the target message to be tested can be greatly reduced compared with the manual identification method of the target message to be tested; and the test efficiency of the target message to be tested is improved by using the test channel to test the target message to be tested in multiple channels.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of vehicle testing, in particular to a message testing method, device and equipment. BACKGROUND

[0002] With the development of automobile information security technology, the secure transmission of in-vehicle communication data is paid more and more attention. Therefore, many important messages in the CAN / LIN communication and Ethernet communication of the whole vehicle will use the mechanism of end-to-end communication protection (E2E), thereby improving the security of in-vehicle communication data transmission.

[0003] In the whole life cycle of a vehicle, in order to ensure that the vehicle functions can be normally executed, it is necessary to test and verify the messages provided with the E2E protection mechanism (referred to as E2E messages) to ensure the accuracy of the E2E messages.

[0004] At present, each communication network segment message needs to be identified manually, and the E2E messages are sorted and summarized into a test information file, and then a third-party test tool is used to manually calculate and verify the E2E messages one by one. However, due to the large number of communication network segments of intelligent vehicles, there will be a large amount of manual repetitive work for each network segment, which not only is low in efficiency, but also is prone to verification errors. SUMMARY

[0005] In view of the problems in the prior art, the embodiments of the present application provide a message testing method, device and equipment to solve or partially solve the technical problem that the testing efficiency and accuracy cannot be ensured when verifying and testing the messages provided with the E2E protection mechanism in the prior art.

[0006] In a first aspect, the present application provides a message testing method, characterized in that the method comprises:

[0007] generating a key information file of a target message according to a communication matrix of each communication network segment of a target vehicle; the target message is a message using an end-to-end communication protection mechanism;

[0008] collecting and storing messages of all communication network segments of a vehicle to be tested to obtain a target message file;

[0009] allocating a corresponding test channel for each communication network segment according to the received test configuration information;

[0010] extracting test data of a target message to be tested from the target message file according to the key information file, and testing the target message to be tested in the test channel using the test data.

[0011] In the scheme, the generation of the key information file of the target message according to the communication matrix of each communication network segment of the target vehicle type comprises:

[0012] When the communication network segment is a first type communication network segment, the first message key information is extracted from the first type communication matrix corresponding to the first type communication network segment according to a preset first keyword; the first type communication network segment comprises a CAN communication network segment and a LIN communication network segment, and the first type communication matrix comprises a CAN communication matrix and a LIN communication matrix;

[0013] The first message key information corresponding to each first type communication network segment is stored in a preset format to obtain a key information file corresponding to each first type communication network segment.

[0014] In the scheme, the generation of the key information file of the target message according to the communication matrix of each communication network segment of the target vehicle type comprises:

[0015] When the communication network segment is a second type communication network segment, the target service interface is searched in a service definition page of a second type communication matrix according to a preset second keyword; the second type communication network segment is an Ethernet communication network segment, and the second type communication matrix is an Ethernet communication matrix;

[0016] The second message key information corresponding to the target service interface is extracted in a data type definition page of the second type communication matrix, and the second message key information is stored in a preset format to obtain a key information file corresponding to the second type communication network segment.

[0017] In the scheme, the test channel has a plurality of test channels, and the allocation of the corresponding test channel for each communication network segment according to the received test configuration information comprises:

[0018] The test configuration information is parsed to obtain a mapping relationship between each communication network segment and test channel;

[0019] Each communication network segment is associated with the corresponding test channel according to the mapping relationship.

[0020] In the scheme, the key information file comprises first key information used for searching the target message to be tested and second key information used for searching test data; and the extraction of the test data of the target message to be tested in the target message file according to the key information file comprises:

[0021] The name of the key information file is determined according to the name of the key information file; the name of the key information file is consistent with the name of the communication network segment;

[0022] According to the communication network segment name, all messages contained in the target message file under the communication network segment are searched;

[0023] According to the first key information, the target message to be tested is determined from all messages contained in the communication network segment, and according to the second key information, the test data is extracted from the target message to be tested.

[0024] In the above scheme, when the communication network segment is a first type of communication network segment, the first key information includes a message identifier, and the second key information includes a start byte of a counter, a start bit of the counter, and a start byte of a cyclic redundancy check.

[0025] When the communication network segment is a second type of communication network segment, the first key information includes an Ethernet service identifier, a service routine identifier, a transmission protocol type, an address of a server, a source transmission port of the server, a client address of the service, and a destination transmission port of the Ethernet service; and the second key information includes a data identifier of the target service interface, a length of the target service interface, a start byte of a cyclic redundancy check of the target service interface, a length start byte of the target service interface, and a start byte of a counter of the target service interface.

[0026] In the above scheme, the test data includes a cyclic redundancy check theoretical value and a value of a counter, and the testing of the target message to be tested in the test channel by using the test data includes:

[0027] According to a pre-agreed address, a cyclic redundancy check byte is extracted from the target message to be tested, and a cyclic redundancy check actual value is determined according to the cyclic redundancy check byte.

[0028] If it is determined that the cyclic redundancy check theoretical value is consistent with the cyclic redundancy check actual value, and the values of the counters of a plurality of consecutive target messages to be tested are in a continuously increasing state, it is determined that the target message to be tested passes the test.

[0029] In the above scheme, after the target message to be tested is tested by using the test channel, the method further includes:

[0030] Obtaining a test result of the target message to be tested of each communication network segment;

[0031] Generating a test report in a predetermined format according to the test result.

[0032] The second aspect of the application provides a message testing device, which includes:

[0033] The generating unit is configured to generate a key information file of a target message according to a communication matrix of each communication network segment of a target vehicle model, the target message being a message using an end-to-end communication protection mechanism;

[0034] The collecting unit is configured to collect and store messages of all communication network segments of a to-be-tested vehicle to obtain a target message file;

[0035] The distribution unit is configured to distribute a corresponding test channel to each communication network segment according to the received test configuration information;

[0036] The test unit is configured to extract test data of a to-be-tested target message from the target message file according to the key information file, and test the to-be-tested target message in the test channel by using the test data.

[0037] In the above scheme, the generating unit is configured to:

[0038] When the communication network segment is a first type of communication network segment, first message key information is extracted from a first type of communication matrix corresponding to the first type of communication network segment according to a preset first keyword; the first type of communication network segment includes a CAN communication network segment and a LIN communication network segment, and the first type of communication matrix includes a CAN communication matrix and a LIN communication matrix;

[0039] The first message key information corresponding to each first type of communication network segment is stored in a preset format to obtain a key information file corresponding to each first type of communication network segment.

[0040] In the above scheme, the generating unit is configured to:

[0041] When the communication network segment is a second type of communication network segment, a target service interface is found in a service definition page of a second type of communication matrix according to a preset second keyword; the second type of communication network segment is an Ethernet communication network segment, and the second type of communication matrix is an Ethernet communication matrix;

[0042] Second message key information corresponding to the target service interface is extracted in a data type definition page of the second type of communication matrix, and the second message key information is stored in a preset format to obtain a key information file corresponding to the second type of communication network segment.

[0043] In the above scheme, the test channel has a plurality of test channels, and the distribution unit is configured to:

[0044] The test configuration information is parsed to obtain a mapping relationship between each communication network segment and a test channel;

[0045] Each communication network segment is associated with a corresponding test channel according to the mapping relationship.

[0046] In the scheme, the key information file includes first key information for searching the target message to be tested and second key information for searching test data; and the test unit is configured to:

[0047] determine a communication network segment name according to a name of the key information file, the name of the key information file being consistent with the communication network segment name;

[0048] search all messages contained in the communication network segment according to the communication network segment name in the target message file;

[0049] determine the target message to be tested from all messages contained in the communication network segment according to the first key information, and extract the test data from the target message to be tested according to the second key information.

[0050] In the scheme, when the communication network segment is a first type of communication network segment, the first key information includes a message identifier, and the second key information includes a start byte of a counter, a start bit of the counter, and a start byte of a cyclic redundancy check;

[0051] when the communication network segment is a second type of communication network segment, the first key information includes an Ethernet service identifier, a service routine identifier, a transmission protocol type, an address of a server, a source transmission port of the server, a client address of a service, and a destination transmission port of the Ethernet service; and the second key information includes a data identifier of the target service interface, a length of the target service interface, a start byte of a cyclic redundancy check of the target service interface, a length start byte of the target service interface, and a start byte of a counter of the target service interface.

[0052] In the scheme, the test data includes a cyclic redundancy check theoretical value and a value of a counter, and the testing of the target message to be tested in the test channel by using the test data includes:

[0053] extracting a cyclic redundancy check byte from the target message to be tested according to a pre-agreed address, and determining a cyclic redundancy check actual value according to the cyclic redundancy check byte;

[0054] if it is determined that the cyclic redundancy check theoretical value is consistent with the cyclic redundancy check actual value, and the values of the counters of a plurality of consecutive target messages to be tested are in a continuously increasing state, then it is determined that the target message to be tested passes the test.

[0055] In the scheme, the generating unit is further configured to:

[0056] obtain a test result of the target message to be tested of each communication network segment;

[0057] generating a test report in a predetermined format according to the test result.

[0058] In a third aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of any one of the first aspect when executing the program.

[0059] The present application provides a message test method, device and equipment, the method comprises the following steps: generating a key information file of a target message according to a communication matrix of each communication network segment of a target vehicle; the target message is a message using an end-to-end communication protection mechanism; collecting and storing messages of all communication network segments of a vehicle to be tested to obtain a target message file; assigning a corresponding test channel to each communication network segment according to received test configuration information; extracting test data of a target message to be tested from the target message file according to the key information file, and testing the target message to be tested in the test channel using the test data; in this way, the target message to be tested can be automatically identified according to the key information of the target message, and compared with the manual identification method of the target message to be tested, the error rate of the target message to be tested can be greatly reduced; and the test channel can be used for multi-channel test of the target message to be tested, thereby improving the test efficiency of the target message to be tested. BRIEF DESCRIPTION OF DRAWINGS

[0060] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments with reference made to the accompanying drawings. The drawings are for purposes of illustration only and are not intended to be limiting in any respect. Further, like reference numerals are used throughout the drawings and textual to designate identical or like components. In the drawings:

[0061] Figure 1 A message test method flowchart according to one embodiment of the present application is shown;

[0062] Figure 2 A test channel configuration page according to one embodiment of the present application is shown;

[0063] Figure 3 A message test device structure according to one embodiment of the present application is shown. DETAILED DESCRIPTION

[0064] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings, in which exemplary embodiments of the present disclosure are shown. This present disclosure may, however, be embodied in various forms without being limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the present disclosure to those skilled in the art.

[0065] This invention provides a message testing method, such as... Figure 1 As shown, the method includes the following steps:

[0066] S110, Based on the communication matrix of each communication network segment of the target vehicle model, generate a key information file for the target message; the target message is a message using an end-to-end communication protection mechanism.

[0067] Each vehicle model includes multiple Electronic Control Units (ECUs). These ECUs are interconnected via data buses or Ethernet to share information and communicate, improving the overall performance and functionality of the vehicle. Therefore, the in-vehicle local area network (LAN) is configured with numerous communication segments. When each ECU transmits messages using its corresponding communication segment, a communication matrix is ​​generated; that is, each communication segment corresponds to a separate communication matrix.

[0068] The communication network segments include CAN, LIN, and Ethernet segments. It's worth noting that each CAN and LIN communication segment has its own corresponding communication matrix. Because the vehicle has port mirroring capabilities, data from all Ethernet communication segments can be collected on a single port. Therefore, only one Ethernet communication matrix exists for all Ethernet communication segments, and this matrix includes the service interfaces for all Ethernet communication segments.

[0069] It is understandable that, regardless of whether it is a CAN communication network segment, a LIN communication network segment, or an Ethernet communication network segment, the communication matrix corresponding to the communication network segment contains both the key information of ordinary messages and the key information of target messages. Therefore, this invention can extract the key information of messages based on the communication matrix of each communication network segment of the target vehicle model, and then generate a key information file of the target message based on the key information of messages; the target message is a message using the end-to-end communication protection mechanism E2E.

[0070] In one implementation, a key information file for the target message is generated based on the communication matrix of each communication network segment of the target vehicle model. This includes: when the communication network segment is a first type of communication network segment, extracting key information of the first message from the first type of communication matrix corresponding to the first type of communication network segment according to a preset first keyword; the first type of communication network segment includes CAN communication network segment and LIN communication network segment, and the first type of communication matrix includes CAN communication matrix and LIN communication matrix; storing the key information of the first message corresponding to each first type of communication network segment in a preset format to obtain a key information file corresponding to each first type of communication network segment.

[0071] In one implementation, a key information file for the target message is generated based on the communication matrix of each communication network segment of the target vehicle model. This includes: when the communication network segment is a second type of communication network segment, searching for the target service interface in the service definition page of the second type of communication matrix according to a preset second keyword; if the second type of communication network segment is an Ethernet communication network segment and the second type of communication matrix is ​​an Ethernet communication matrix; extracting the key information of the second message corresponding to the target service interface from the data type definition page of the second type of communication matrix, and storing the key information of the second message in a preset format to obtain the key information file corresponding to the second type of communication network segment.

[0072] The key information file includes first key information for locating the target message under test and second key information for locating test data. That is, both the first and second message key information contain the first and second key information.

[0073] When the communication network segment is a Type I communication network segment, the first key information includes the message identifier, and the second key information includes the start byte of the counter, the start bit of the counter, and the start byte of the Cyclic Redundancy Check (CRC). For example, the message identifier can be a unique identifier for the message (ID, IdentityDocument).

[0074] When the communication network segment is a Type II communication network segment, the first key information includes the Ethernet service identifier, service routine identifier, transmission protocol type, server address, server source transmission port, service client address, and Ethernet service destination transmission port; the second key information includes the data identifier of the target service interface, the length of the target service interface, the CRC start byte of the target service interface, the length start byte of the target service interface, and the counter start byte of the target service interface. For example, the Ethernet service identifier can be the Ethernet service ID, the server address can be the server's IP address, the service client address can be the client's IP address, and the data identifier of the target service interface can be the data ID.

[0075] Specifically, when the communication network segment is a Type I communication network segment, and the communication matrix is ​​also a Type I communication matrix, then the primary key is either a message rolling counter or a message count sum. For example, a message rolling counter can be represented as `rollingcounter`, and a message count sum can be represented as `checksum`. Then, the key information of the first message containing `rollingcounter` or `checksum` is extracted from the Type I communication matrix, and this key information is stored in a preset format to obtain the key information file corresponding to the Type I communication network segment. The preset format can be INI format.

[0076] Taking the CAN communication network segment as an example, assuming that the name of a certain CAN communication network segment is Body_CAN, the generated key information file can be Body_CAN.ini.

[0077] Taking a LIN communication network segment as an example, assuming that the name of a certain LIN communication network segment is Body_LIN1, the generated key information file can be Body_LIN1.ini.

[0078] The key information of the first message corresponding to the CAN communication network segment and the LIN communication network segment is the same, including: message ID, the starting byte of the rolling counter, the starting bit of the rolling counter, and the starting byte of the cyclic redundancy check. In some embodiments, in addition to the above key information, the key information of the first message may also include message length, message transmission period, and E2E test flag.

[0079] When the communication network segment is a Type II communication network segment, the communication matrix is ​​also a Type II communication matrix, which includes the Ethernet communication matrix. Therefore, the second key is "E2E". A pre-configured Python script can be used to find interfaces with "E2E" in the service definition page of the Type II communication matrix and use these interfaces as the target service interfaces. Then, the second message key information of the target service interface is extracted from the data type definition page. This second message key information is stored in INI format, resulting in the key information file corresponding to the Ethernet communication network segment.

[0080] It should be noted that since there is only one Ethernet communication matrix, the generated key information file also contains only one file.

[0081] When the communication matrix is ​​an Ethernet communication matrix, the generated key information file can be SOMEIP_Info_ini. There may be multiple target service interfaces found, and the key information for the second message corresponding to multiple target service interfaces can be stored in the same SOMEIP_Info_ini file. For easy differentiation, the SOMEIP_Info_ini file contains the name of each target service interface, and each target service interface contains its own key information for the second message.

[0082] Taking the target service interface as service interface 1 for explanation, the key information of the second message corresponding to service interface 1 includes Ethernet service ID, service routine ID, transport protocol type, server IP address, service client IP address, service transport port, E2E test flag, service interface 1 data ID, service interface 1 length, service interface 1 cyclic redundancy check (CRC) start byte, service interface 1 end-to-end (E2E) length start byte, and service interface 1 counter start byte.

[0083] Similarly, the target service interface also includes service interface 2. The key information of the second message corresponding to service interface 2 also includes Ethernet service ID, service routine ID, transport protocol type, server IP address, service client IP address, service transport port, E2E test flag, data ID of service interface 2, length of service interface 2, CRC start byte of service interface 2, E2E length start byte of service interface 2, and counter start byte of service interface 2.

[0084] This yields the key information file corresponding to each communication network segment.

[0085] S111: Collect and store messages from all communication network segments of the vehicle under test to obtain the target message file.

[0086] In this step, packets from all communication network segments of the vehicle under test can be collected based on a preset collection period. After the preset collection duration is reached (e.g., 1 minute, or any other duration, without restriction), the collected packets are stored as a binary data file format (Binary Logging Format, BLF) packet file. The BLF packet file is the target packet file.

[0087] The target message file can contain multiple folders, with messages from each communication network segment stored in their own folder, named after the communication network segment. For example, if a CAN communication network segment is named Body_CAN, then the Body_CAN folder in the target message file will store all messages from the Body_CAN communication segment.

[0088] Similarly, since information is transmitted through services and interfaces in Ethernet communication, an electronic control unit can contain multiple services, and each service can contain multiple service interfaces. One service interface is equivalent to a message in a CAN communication segment.

[0089] After collecting the service interfaces of all Ethernet communication segments, all service interfaces are stored in a single folder. The folder name matches the name of the key information file corresponding to each Ethernet communication segment. Since the key information in the second message includes the Ethernet service ID, the server's IP address, and other crucial information, even though all the service interfaces of all Ethernet communication segments are stored in one folder, the service ID can be used to determine which service issued the message. Knowing the server's IP address allows us to determine which electronic control unit (ECU) this service belongs to.

[0090] S112, Allocate a corresponding test channel for each of the communication network segments according to the received test configuration information.

[0091] Before testing the target message, the test configuration information needs to be set according to the actual test data. For example, the test configuration information can be manually entered into the configuration page, or a configuration file can be pre-set, loaded, and then the test configuration information from the configuration file can be transmitted to the configuration page. Then, the testing device can allocate the corresponding test channel for each communication network segment based on the received test configuration information.

[0092] In one implementation, a corresponding test channel is allocated to each communication network segment based on the received test configuration information, including:

[0093] The test configuration information is parsed to obtain the mapping relationship between each communication network segment and the test channel;

[0094] Each communication network segment is associated with its corresponding test channel based on the mapping relationship.

[0095] Specifically, to improve testing efficiency, the test channels include multiple channels, allowing for parallel testing of target messages on CAN, LIN, and Ethernet communication segments. For example... Figure 2 As shown, the test channels include 20 CAN test channels, 10 LIN test channels, and 1 Ethernet test channel, which can simultaneously support the testing of up to 20 CAN type target messages, 10 LIN type target messages, and 1 Ethernet type target messages.

[0096] Based on the test configuration information, for the CAN test channels, associate the CAN1 test channel with the Body_CAN communication network segment; associate the CAN2 test channel with the Light_CAN communication network segment; and so on.

[0097] For the LIN test channels, associate the LIN1 test channel with the Body_LIN1 communication network segment; associate the LIN2 test channel with the Light_LIN1 communication network segment; and so on.

[0098] For the Ethernet test channel, since there is only one Ethernet communication matrix, only one Ethernet test channel can be set up, namely ETH1. Ethernet communication segments can be associated with ETH1. When the ETH1 test channel is in Active mode, it means that the ETH1 channel is active and can test the target packets of all Ethernet communication segments.

[0099] Among them, Figure 2 The "None" value indicates that the channel has no associated communication network segment and no test data.

[0100] S113, extract the test data of the target message to be tested from the target message file according to the key information file, and use the test data to test the target message to be tested in the test channel.

[0101] This invention can extract test data of the target message to be tested from the target message file based on the key information file, and use the test data to test the target message to be tested.

[0102] In one implementation, the test data includes: the theoretical value of cyclic redundancy check (CRC) and the value of a counter. The test data is used to test the target packet in the test channel, including:

[0103] Extract the Cyclic Redundancy Check (CR) byte from the target message to be tested according to the pre-agreed address, and determine the actual value of the CR based on the CR byte;

[0104] If the theoretical value of the Cyclic Redundancy Check (CRBC) is consistent with the actual value of the CRBC, and the counter values ​​of multiple consecutive target packets under test are continuously increasing, then the target packets under test are determined to have passed the test.

[0105] Specifically, for the first type of communication network segment, each communication network segment has a corresponding key information file. Since the name of the key information file corresponding to each communication network segment is the same as the name of the communication network segment, all messages contained under the first type of communication network segment can be found in the target message file based on the name of the communication network segment.

[0106] For example, if the name of the key information file corresponding to the first type of communication network segment is Body_CAN_ini, then the name of the communication network segment is also Body_CAN. The target message file contains messages corresponding to all communication network segments, therefore, all messages under the Body_CAN network segment can be filtered out from the target message file.

[0107] After obtaining all packets under the Body_CAN network segment, the target packets to be tested can be further filtered according to the packet ID contained in Body_CAN_ini. After finding the target packet to be tested, the theoretical CRC value can be extracted from the packet to be tested according to the CRC start byte contained in Body_CAN_ini, and the value of the rollingcounter can be obtained according to the start byte and start bit of the rollingcounter contained in Body_CAN_ini.

[0108] Then, obtain the CRC checksum byte (the address of the CRC checksum byte is usually pre-defined in the communication protocol), and use a checksum algorithm (such as CRC8 / CRC64 or AutoSar Profile7 algorithm) to calculate the CRC checksum byte to obtain the actual CRC value.

[0109] If the actual CRC value is consistent with the theoretical CRC value, and the value of rollingcounter is determined to be in an increasing state (continuously +1, or changing from F to 0, or changing from 0xFFFF to 0), then the target message under test is determined to have passed the test.

[0110] Similarly, for the key information file corresponding to the Ethernet communication segment, the name of the key information file is the same as the name of the folder storing all the service interfaces of the Ethernet communication segment. Therefore, all service interfaces contained in the Ethernet communication segment can be found in the target packet file based on the name of this folder. Then, the target service interface can be found from all service interfaces based on the key information such as the Ethernet service ID and service routine ID in the key information file corresponding to the Ethernet communication segment.

[0111] After locating the target service interface, extract the theoretical CRC value from the E2ECRC start byte in the target service interface, determine the overwritten checksum byte based on the E2E length start byte, and calculate the actual CRC value based on the checksum byte. Determine the value of the counter `conuter` based on the E2Econuter start byte.

[0112] If the theoretical CRC value is consistent with the actual CRC value, and the counter values ​​of multiple consecutive target packets under test are continuously increasing, then the target packets under test are determined to have passed the test.

[0113] This completes the testing of the E2E message to be tested.

[0114] In this embodiment, the data length of the CRC check byte can also be customized, and the bytes to be checked can be flexibly defined.

[0115] Following the above testing method, target packets across all network segments can be tested in parallel. In one implementation, after testing the target packets using the test channel, the method further includes:

[0116] Obtain the test results of the target message in the communication network segment;

[0117] Generate a test report in a predefined format based on the test results. The predefined format can be CSV or HTML.

[0118] The message testing method provided by this invention can automatically identify the target message to be tested based on key information files. Compared with the manual identification of the target message to be tested, it can greatly reduce the error rate of the target message to be tested. Furthermore, by using test channels, multiple channels can be used to verify and test the target message to be tested, which improves the testing efficiency and accuracy of the target message to be tested.

[0119] Based on the same inventive concept as in the foregoing embodiments, this embodiment also provides a message testing device, such as... Figure 3 As shown, the device includes:

[0120] The generation unit 31 is used to generate a key information file of the target message based on the communication matrix of each communication network segment of the target vehicle model; the target message is a message using an end-to-end communication protection mechanism.

[0121] The acquisition unit 32 is used to acquire and store messages from all communication network segments of the vehicle under test to obtain the target message file;

[0122] Allocation unit 33 is used to allocate a corresponding test channel for each of the communication network segments according to the received test configuration information;

[0123] The test unit 34 is used to extract test data of the target message to be tested from the target message file according to the key information file, and to test the target message to be tested in the test channel using the test data.

[0124] Since the apparatus described in the embodiments of this invention is used to implement the message testing method of the embodiments of this invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in the embodiments of this invention, and therefore will not be described in detail here. All apparatuses used in the methods of the embodiments of this invention fall within the scope of protection of this invention.

[0125] Based on the same inventive concept, this embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any step of the method described above.

[0126] Through one or more embodiments of the present invention, the present invention has the following beneficial effects or advantages:

[0127] This invention provides a message testing method, apparatus, and device. The method includes: generating a key information file for target messages based on the communication matrix of each communication network segment of a target vehicle model; the target messages are messages using an end-to-end communication protection mechanism; collecting and storing messages from all communication network segments of the vehicle under test to obtain a target message file; allocating a corresponding test channel for each communication network segment based on received test configuration information; extracting test data of the target message under test from the target message file based on the key information file; and testing the target message under test using the test data in the test channel. Thus, the target message under test can be automatically identified based on its key information, significantly reducing the error rate compared to manual identification. Furthermore, the test channel allows for multi-channel verification testing of the target message, improving testing efficiency.

[0128] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0129] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0130] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0131] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0132] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0133] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components of the gateway, proxy server, or system according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing some or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0134] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0135] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0136] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A message testing method, characterized in that, The method includes: Based on the communication matrix of each communication network segment of the target vehicle model, a key information file for the target message is generated; the target message is a message using an end-to-end communication protection mechanism. Collect and store messages from all communication network segments of the vehicle under test to obtain the target message file; Each communication network segment is assigned a corresponding test channel based on the received test configuration information; Based on the key information file, test data of the target message to be tested is extracted from the target message file, and the target message to be tested is then tested using the test data in the test channel; wherein... The key information file includes first key information for locating the target message to be tested and second key information for locating test data; the step of extracting the test data of the target message to be tested from the target message file according to the key information file includes: The name of the communication network segment is determined based on the name of the key information file; the name of the key information file is consistent with the name of the communication network segment. Based on the communication segment name, search the target message file for all messages contained under the communication segment; The target message to be tested is determined from all messages contained in the communication network segment based on the first key information, and the test data is extracted from the target message to be tested based on the second key information.

2. The method as described in claim 1, characterized in that, The step of generating a key information file for the target message based on the communication matrix of each communication network segment of the target vehicle includes: When the communication network segment is a first type of communication network segment, the first message key information is extracted from the first type of communication matrix corresponding to the first type of communication network segment according to the preset first keyword; the first type of communication network segment includes CAN communication network segment and LIN communication network segment, and the first type of communication matrix includes CAN communication matrix and LIN communication matrix. The key information of the first message corresponding to each of the first type of communication network segments is stored in a preset format to obtain the key information file corresponding to each of the first type of communication network segments.

3. The method as described in claim 1, characterized in that, The step of generating a key information file for the target message based on the communication matrix of each communication network segment of the target vehicle includes: When the communication network segment is a second type of communication network segment, the target service interface is searched in the service definition page of the second type of communication matrix according to the preset second keyword; the second type of communication network segment is an Ethernet communication network segment, and the second type of communication matrix is ​​an Ethernet communication matrix. Extract the key information of the second message corresponding to the target service interface from the data type definition page of the second type of communication matrix, store the key information of the second message in a preset format, and obtain the key information file corresponding to the second type of communication network segment.

4. The method as described in claim 1, characterized in that, There are multiple test channels, and the process of allocating a corresponding test channel for each communication network segment based on the received test configuration information includes: The test configuration information is parsed to obtain the mapping relationship between each communication network segment and test channel; Each communication network segment is associated with its corresponding test channel according to the mapping relationship.

5. The method as described in claim 3, characterized in that, When the communication network segment is a first type of communication network segment, the first key information includes a message identifier, and the second key information includes the start byte of the counter, the start bit of the counter, and the start byte of the cyclic redundancy check. When the communication network segment is a second type of communication network segment, the first key information includes Ethernet service identifier, service routine identifier, transmission protocol type, server address, server source transmission port, service client address, and Ethernet service destination transmission port; the second key information includes the data identifier of the target service interface, the length of the target service interface, the cyclic redundancy check start byte of the target service interface, the length start byte of the target service interface, and the start byte of the counter of the target service interface.

6. The method as described in claim 1, characterized in that, The test data includes: the theoretical value of cyclic redundancy check and the value of the counter. The step of testing the target packet under test using the test data in the test channel includes: Extract the Cyclic Redundancy Check (CR) byte from the target message to be tested according to the pre-agreed address, and determine the actual value of the CR based on the CR byte; If it is determined that the theoretical value of the Cyclic Redundancy Check (CRC) is consistent with the actual value of the CRC, and the counter values ​​of multiple consecutive target packets under test are continuously increasing, then the target packet under test is determined to have passed the test.

7. The method as described in claim 1, characterized in that, After testing the target packet using the test channel, the method further includes: Obtain the test results of the target packets for each communication network segment; A test report in a predetermined format is generated based on the test results.

8. A message testing device, characterized in that, The device includes: The generation unit is used to generate a key information file of the target message based on the communication matrix of each communication network segment of the target vehicle model; the target message is a message using an end-to-end communication protection mechanism. The acquisition unit is used to acquire and store messages from all communication network segments of the vehicle under test to obtain the target message file; The allocation unit is used to allocate a corresponding test channel for each of the communication network segments according to the received test configuration information; The testing unit is configured to extract test data of the target message to be tested from the target message file based on the key information file, and to test the target message to be tested using the test data in the test channel; wherein, The key information file includes first key information for locating the target message to be tested and second key information for locating test data; the step of extracting the test data of the target message to be tested from the target message file according to the key information file includes: The name of the communication network segment is determined based on the name of the key information file; the name of the key information file is consistent with the name of the communication network segment. Based on the communication segment name, search the target message file for all messages contained under the communication segment; The target message to be tested is determined from all messages contained in the communication network segment based on the first key information, and the test data is extracted from the target message to be tested based on the second key information.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Universal automatic driving information testing system for automobiles

    CN104215854A

  • Automatic testing method and device, electronic equipment and storage medium

    CN115757483A