Vehicle communication test method, system, electronic device and storage medium
By constructing and configuring the sending and receiving end, the message interaction of different communication protocols in the vehicle is tested, which solves the problem of lack of S2S communication process testing in the vehicle and ensures communication accuracy and quality.
Patent Information
- Application Number
- CN202410941553.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-07-15
AI Technical Summary
The prior art lacks a general testing method to ensure and verify the accuracy and quality of signal-to-service (S2S) communication processes in vehicles based on Ethernet SOME/IP service and CAN signals.
By building a communication test list, configuring the sending and receiving end, using preset configuration files to control the sending and receiving test messages, determine the communication test results, and ensure that the communication function of the equipment to be tested is normal.
A general testing method is provided to verify data interactions between different communication protocols in the vehicle, ensure the accuracy and quality of S2S communication, and solve the problem of lack of effective testing methods in the prior art.
Smart Images

Figure CN118487971B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a vehicle communication test method, system, electronic equipment and storage medium. Background Art
[0002] With the continuous development of automobile intelligence, networking and service, Ethernet has been applied in the automotive field, and the emergence of SOA architecture has promoted the continuous implementation of the architecture. The communication between the controllers in the car has become more and more complicated, and the communication between systems equipped with different buses and different protocols has increased. This means that there are a lot of conversions between signals and services. How to make the controller based on Ethernet SOME / IP service (Service) communicate with the controller based only on CAN signal (Signal) has become the focus of industry attention. In order to meet the data information interaction between the controllers based on Signal and Service, the concept of S2S (Signal to Service) is introduced. S2S is the conversion between Signal to Service and Service to Signal. How to ensure the communication accuracy and quality of S2S has become the focus of the testing direction of various automobile companies. However, in the relevant technologies, there is a lack of common testing methods to test the communication process of S2S.
[0003] There is no effective solution to the above problems yet. Summary of the invention
[0004] The embodiments of the present invention provide a vehicle communication test method, system, electronic device and storage medium to at least solve the technical problem in the related art that there is a lack of a universal test method for testing the S2S communication process.
[0005] According to one embodiment of the present invention, a vehicle communication test method is provided, comprising: constructing a communication test list according to a first preset configuration file, wherein the communication test list includes a first vehicle controller and a second vehicle controller, the communication protocol of the first vehicle controller is a first communication protocol, and the communication protocol of the second vehicle controller is a second communication protocol; configuring the first vehicle controller and the second vehicle controller in the communication test list according to the second preset configuration file to obtain a sending end and a receiving end, wherein when the first vehicle controller is the sending end, the second vehicle controller is the receiving end, and when the first vehicle controller is the receiving end, the second vehicle controller is the sending end; controlling the sending end to send a test message to a device under test, wherein the device under test is used to forward the message sent by the sending end to the receiving end; controlling the receiving end to receive the test message from the device under test and determine the receiving result; determining the communication test result according to the receiving result, wherein the communication test result is used to characterize whether the communication function of the device under test is normal.
[0006] Optionally, a communication test list is constructed according to a first preset configuration file, including: according to the first preset configuration file, marking multiple controllers in the vehicle as a first vehicle controller and a second vehicle controller, respectively; determining a correspondence between multiple first vehicle controllers and multiple second vehicle controllers; and determining a communication test list based on the multiple first vehicle controllers, multiple second vehicle controllers and the correspondence.
[0007] Optionally, according to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end, including: according to the second preset configuration file, configuring multiple first vehicle controllers as transmitting ends and configuring multiple second vehicle controllers as receiving ends.
[0008] Optionally, according to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end, including: according to the second preset configuration file, configuring multiple first vehicle controllers as receiving ends and configuring multiple second vehicle controllers as transmitting ends.
[0009] Optionally, controlling the sending end to send a test message includes: judging the type of the sending end to obtain a judgment result; in response to the judgment result indicating that the type of the sending end is a first vehicle controller, sending the test message using a first communication protocol; or, in response to the judgment result indicating that the type of the sending end is a second vehicle controller, sending the test message using a second communication protocol.
[0010] Optionally, the vehicle communication test method also includes: obtaining the time when the transmitting end sends the test message to obtain the sending time; in response to the receiving result indicating that the receiving end has received the test message, obtaining the receiving time, wherein the receiving time is used to characterize the time when the receiving end receives the test message; determining the communication test result based on the sending time and the receiving time.
[0011] Optionally, determining the test result based on the sending time and the receiving time includes: determining the difference between the sending time and the receiving time; and in response to the difference being less than a preset difference threshold, determining that the communication test result is a test pass.
[0012] Optionally, determining a communication test result based on the receiving result includes: in response to the receiving result indicating that the receiving end successfully receives the test message, determining that the communication test result is a test pass.
[0013] Optionally, the first communication protocol is an Ethernet communication protocol, and the second communication protocol is a bus communication protocol.
[0014] Optionally, the vehicle communication test method further includes: pushing the communication test result to a preset target device according to a preset push strategy.
[0015] Optionally, determining a communication test result based on the receiving result includes: in response to the receiving result indicating that the receiving end did not receive the test message, determining that the communication test result is a test failure.
[0016] According to one embodiment of the present invention, a vehicle communication test system is also provided, including: a construction module, used to construct a communication test list according to a first preset configuration file, wherein the communication test list includes a first vehicle controller and a second vehicle controller, the communication protocol of the first vehicle controller is the first communication protocol, and the communication protocol of the second vehicle controller is the second communication protocol; a configuration module, used to configure the first vehicle controller and the second vehicle controller in the communication test list according to the second preset configuration file to obtain a sending end and a receiving end, wherein when the first vehicle controller is the sending end, the second vehicle controller is the receiving end, and when the first vehicle controller is the receiving end, the second vehicle controller is the sending end; a first control module, used to control the sending end to send a test message to a device under test, wherein the device under test is used to forward the message sent by the sending end to the receiving end; a second control module, used to control the receiving end to receive the test message from the device under test and determine the receiving result; a determination module, used to determine the communication test result according to the receiving result, wherein the communication test result is used to characterize whether the communication function of the device under test is normal.
[0017] Optionally, the construction module is also used to: mark multiple controllers in the vehicle as first vehicle controllers and second vehicle controllers according to a first preset configuration file; determine the correspondence between multiple first vehicle controllers and multiple second vehicle controllers; and determine a communication test list based on the multiple first vehicle controllers, multiple second vehicle controllers and the correspondence.
[0018] Optionally, the configuration module is also used to: configure multiple first vehicle controllers as sending ends and configure multiple second vehicle controllers as receiving ends according to a second preset configuration file.
[0019] Optionally, the configuration module is further used to: configure multiple first vehicle controllers as receiving ends and configure multiple second vehicle controllers as sending ends according to a second preset configuration file.
[0020] Optionally, the first control module is also used to: judge the type of the sending end to obtain a judgment result; in response to the judgment result indicating that the type of the sending end is the first vehicle controller, send a test message using the first communication protocol; or, in response to the judgment result indicating that the type of the sending end is the second vehicle controller, send a test message using the second communication protocol.
[0021] Optionally, the determination module is also used to: obtain the time when the sending end sends the test message to obtain the sending time; in response to the receiving result indicating that the receiving end has received the test message, obtain the receiving time, wherein the receiving time is used to characterize the time when the receiving end receives the test message; determine the communication test result based on the sending time and the receiving time.
[0022] Optionally, the determination module is further used to: determine the difference between the sending time and the receiving time; and in response to the difference being less than a preset difference threshold, determine that the communication test result is a test pass.
[0023] Optionally, the determination module is further used to: in response to the reception result indicating that the receiving end successfully receives the test message, determine that the communication test result is a test pass.
[0024] Optionally, the determination module is further used to: push the communication test result to a preset target device according to a preset push strategy.
[0025] Optionally, the determination module is further used to: in response to the reception result indicating that the receiving end did not receive the test message, determine that the communication test result is a test failure.
[0026] According to one embodiment of the present invention, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above vehicle communication test methods.
[0027] According to one embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above-mentioned vehicle communication test methods when running.
[0028] According to one embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the vehicle communication test method described above is implemented.
[0029] In an embodiment of the present invention, a communication test list is constructed according to a first preset configuration file, wherein the communication test list includes a first vehicle controller and a second vehicle controller, the communication protocol of the first vehicle controller is a first communication protocol, and the communication protocol of the second vehicle controller is a second communication protocol; according to the second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitter and a receiver, wherein when the first vehicle controller is a transmitter, the second vehicle controller is a receiver, and when the first vehicle controller is a receiver, the second vehicle controller is a transmitter; the transmitter is controlled to send a test message to the device under test, wherein the device under test is used to forward the message sent by the transmitter to the receiver; the receiver is controlled to receive the test message from the device under test and determine the receiving result; according to the receiving result, the communication test result is determined, wherein the communication test result is used to characterize whether the communication function of the device under test is normal. By constructing a transmitter and a receiver, the present invention can test the communication function of the device under test that enables communication between the first vehicle controller and the second vehicle controller, thereby solving the technical problem of the lack of a general test method for testing the S2S communication process in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0031] Figure 1 is a flow chart of a vehicle communication testing method according to one embodiment of the present invention;
[0032] Figure 2 is a schematic diagram of the architecture of an execution system according to one embodiment of the present invention;
[0033] Figure 3 is a flowchart of a vehicle communication test method according to one embodiment of the present invention;
[0034] Figure 4 is a structural block diagram of a vehicle communication test system according to one embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] According to an embodiment of the present invention, an embodiment of a vehicle communication testing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system containing at least one set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] The method embodiment can also be executed in an electronic device including a memory and a processor, a similar control device or a vehicle-mounted terminal. Taking a vehicle-mounted terminal as an example, the vehicle-mounted terminal may include one or more processors and a memory for storing data. Optionally, the vehicle-mounted terminal may also include a communication device and a display device for communication functions. It can be understood by those of ordinary skill in the art that the above structural description is only illustrative and does not limit the structure of the vehicle-mounted terminal. For example, the vehicle-mounted terminal may also include more or fewer components than the above structural description, or have a configuration different from the above structural description.
[0039] The processor may include one or more processing units. For example, the processor may include a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a field-programmable gate array (FPGA), a neural-network processing unit (NPU), a tensor processing unit (TPU), an artificial intelligence (AI) type processor, and other processing devices. Among them, different processing units may be independent components or integrated into one or more processors. In some instances, the electronic device may also include one or more processors.
[0040] The memory can be used to store computer programs, such as storing a computer program corresponding to the vehicle communication test method in the embodiment of the present invention. The processor implements the above-mentioned vehicle communication test method by running the computer program stored in the memory. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the electronic device via a grid. Examples of the above-mentioned grid include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0041] The communication device is used to receive or send data via a grid. The specific examples of the above-mentioned grid may include a wireless grid provided by a communication provider of the mobile terminal. In one example, the communication device includes a grid adapter (network interface controller, NIC), which can be connected to other grid devices through a base station so as to communicate with the Internet. In one example, the communication device can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly. In some embodiments of the present solution, the communication device is used to connect to mobile devices such as mobile phones and tablets, and instructions can be sent to the vehicle-mounted terminal through the mobile device.
[0042] The display device may be a touch screen type liquid crystal display (LCD) and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with the user interface of the vehicle-mounted terminal. In some embodiments, the vehicle-mounted terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contact and / or gestures on the touch-sensitive surface. The human-computer interaction function here may include a vehicle gear shifting function, and executable instructions for executing the above human-computer interaction function are configured / stored in a computer program product or a readable storage medium executable by one or more processors.
[0043] Figure 1 FIG. 1 is a flow chart of a vehicle communication test method according to one embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0044] Step S101: construct a communication test list according to a first preset configuration file.
[0045] Among them, the communication test list includes a first vehicle controller and a second vehicle controller, the communication protocol of the first vehicle controller is a first communication protocol, and the communication protocol of the second vehicle controller is a second communication protocol.
[0046] Exemplarily, the first configuration file includes an Arxml file and a dbc database file, and the first vehicle controller and the second vehicle controller, as well as the communication configurations corresponding to the first vehicle controller and the second vehicle controller, can be obtained by parsing the Arxml file and the dbc database file. Then, a communication test list is constructed based on all the parsed first vehicle controllers and second vehicle controllers and their corresponding communication protocols.
[0047] It can be understood that the first vehicle controller and the second vehicle controller in the communication test list are the vehicle controllers required for performing the communication test.
[0048] It should be noted that the first vehicle controller and the second vehicle controller are simulated vehicle controllers.
[0049] Step S102: According to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end.
[0050] When the first vehicle controller is a transmitting end, the second vehicle controller is a receiving end; when the first vehicle controller is a receiving end, the second vehicle controller is a transmitting end.
[0051] Specifically, after obtaining the communication test list in step S101, it is necessary to configure the first vehicle controller as a transmitter or a receiver according to the configuration file. If the first vehicle controller is configured as a transmitter, the second vehicle controller is configured as a receiver. If the first vehicle controller is configured as a receiver, the second vehicle controller is configured as a transmitter.
[0052] It can be understood that the sending end is used to send messages, and the receiving end is used to receive the messages sent by the sending end.
[0053] Step S103, controlling the sending end to send a test message to the device under test.
[0054] The device under test is used to forward the message sent by the sending end to the receiving end.
[0055] Exemplarily, if the sending end is a first vehicle controller, the first vehicle controller is controlled to send a predefined test message through a first communication protocol. If the sending end is a second vehicle controller, the second vehicle controller is controlled to send a predefined test message through a second communication protocol.
[0056] It is understandable that when vehicle controllers configured with different communication protocols communicate, the device under test needs to convert the message sent by the sender according to the sender's protocol into a message that can be received by the receiver. Therefore, when testing the communication function between vehicle controllers with different protocols, it is necessary to test whether the function of the device under test is normal, and then send the test message to the device under test.
[0057] Step S104, controlling the receiving end to receive a test message from the device under test, and determining a receiving result.
[0058] Specifically, the receiving end is controlled to continuously receive messages. If a test message sent by the corresponding sending end is received, the receiving result is determined to be a successful reception. At this time, the message received by the receiving end is the test message sent by the sending end.
[0059] It is understandable that if the sender sends a test message to the device under test via the first communication protocol, the device under test needs to convert the test message into a message corresponding to the second communication protocol so that the receiver can receive and parse the test message from the device under test.
[0060] Step S105, determining the communication test result according to the receiving result.
[0061] The communication test result is used to indicate whether the communication function of the device under test is normal.
[0062] Specifically, when the receiving result is determined in step S104, the communication test result can be determined according to the preset expected result.
[0063] It can be understood that when the sender and the receiver can transmit the test message normally through the device under test, the communication function of the device under test is normal; when the sender and the receiver cannot transmit the test message normally through the device under test, the communication function of the device under test is abnormal.
[0064] In an embodiment of the present invention, a communication test list is constructed according to a first preset configuration file, wherein the communication test list includes a first vehicle controller and a second vehicle controller, the communication protocol of the first vehicle controller is a first communication protocol, and the communication protocol of the second vehicle controller is a second communication protocol; according to the second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitter and a receiver, wherein when the first vehicle controller is a transmitter, the second vehicle controller is a receiver, and when the first vehicle controller is a receiver, the second vehicle controller is a transmitter; the transmitter is controlled to send a test message to the device under test, wherein the device under test is used to forward the message sent by the transmitter to the receiver; the receiver is controlled to receive the test message from the device under test and determine the receiving result; according to the receiving result, the communication test result is determined, wherein the communication test result is used to characterize whether the communication function of the device under test is normal. By constructing a transmitter and a receiver, the present invention can test the communication function of the device under test that enables communication between the first vehicle controller and the second vehicle controller, thereby solving the technical problem of the lack of a general test method for testing the S2S communication process in the related art.
[0065] Optionally, in step S101, constructing a communication test list according to the first preset configuration file may include the following steps:
[0066] Step S1011, according to a first preset configuration file, marking a plurality of controllers in the vehicle as a first vehicle controller and a second vehicle controller respectively;
[0067] Step S1012, determining a correspondence between a plurality of first vehicle controllers and a plurality of second vehicle controllers;
[0068] Step S1013, determining a communication test list according to the plurality of first vehicle controllers, the plurality of second vehicle controllers and the corresponding relationship.
[0069] Specifically, when constructing a communication test list, first, the multiple controllers of the simulated vehicle are marked as the first vehicle controller and the second vehicle controller according to the first preset configuration file, and then the second controller corresponding to each of the multiple first controllers is determined to obtain the corresponding relationship. Finally, a communication test list including multiple first vehicle controllers, multiple second vehicle controllers and their corresponding relationships can be established.
[0070] It can be understood that the communication test list includes multiple groups of one-to-one corresponding first vehicle controllers and second vehicle controllers.
[0071] It should be noted that the communication test list also includes the communication protocol corresponding to each vehicle controller and the basic communication configuration used for communication between controllers.
[0072] Optionally, according to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end, including: according to the second preset configuration file, configuring multiple first vehicle controllers as transmitting ends and configuring multiple second vehicle controllers as receiving ends.
[0073] Specifically, the multiple first vehicle controllers are configured as sending ends, that is, messages are sent through the first communication protocol, and the multiple second vehicle controllers are configured as receiving ends, that is, messages are received through the second communication protocol.
[0074] Optionally, according to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end, including: according to the second preset configuration file, configuring multiple first vehicle controllers as receiving ends and configuring multiple second vehicle controllers as transmitting ends.
[0075] Specifically, the multiple second vehicle controllers are configured as sending ends, that is, messages are sent through the second communication protocol, and the multiple first vehicle controllers are configured as receiving ends, that is, messages are received through the first communication protocol.
[0076] Optionally, in step S103, controlling the sending end to send a test message may include the following steps:
[0077] Step S1031, determining the type of the sending end to obtain a determination result;
[0078] Step S1032, in response to the judgment result indicating that the type of the sending end is the first vehicle controller, sending a test message using the first communication protocol; or, in response to the judgment result indicating that the type of the sending end is the second vehicle controller, sending a test message using the second communication protocol.
[0079] Specifically, when controlling the sending end to send a test message, it is first necessary to determine the type of the sending end. If the sending end is a first vehicle controller, the test message is sent to the device under test using a first communication protocol. If the sending end is a second vehicle controller, the test message is sent to the device under test using a second communication protocol.
[0080] Optionally, the vehicle communication test method further includes:
[0081] Step S106, obtaining the time when the sender sends the test message, and obtaining the sending time;
[0082] Step S107, in response to the reception result indicating that the receiving end has received the test message, obtaining the reception time, wherein the reception time is used to represent the time when the receiving end receives the test message;
[0083] Step S108, determining the communication test result according to the sending time and the receiving time.
[0084] Specifically, during the communication test, it is necessary to record the time when the sender sends the test message and the time when the receiver receives the test message from the device under test, and then determine whether the communication test result passes or not based on the sending time and the receiving time.
[0085] Optionally, in step S108, determining the test result according to the sending time and the receiving time may include the following steps:
[0086] Step S1081, determining the difference between the sending time and the receiving time;
[0087] Step S1082: In response to the difference being less than a preset difference threshold, determining that the communication test result is a test pass.
[0088] Exemplarily, the first vehicle controller acts as the transmitter, and the time for sending the test message is t1; the second vehicle controller acts as the receiver, and the receiving time is t2. If the time difference between t1 and t2 is less than the preset difference threshold, it indicates that the second controller has received the test message within the preset time, and the communication test result is determined to be the test passed, that is, the communication function of the device under test is normal.
[0089] It can be understood that if the time difference between t1 and t2 is greater than or equal to the preset difference threshold, it indicates that the second controller has timed out when receiving the test message, and the communication test result is determined to be test failure, that is, the communication function of the device under test is abnormal, and there is a problem in the communication between the first vehicle controller and the second vehicle controller.
[0090] It should be noted that if t2 is less than t1, it indicates that there is an abnormality in this test and an abnormal prompt message is output.
[0091] Optionally, determining a communication test result based on the receiving result includes: in response to the receiving result indicating that the receiving end successfully receives the test message, determining that the communication test result is a test pass.
[0092] It can be understood that the reception result shows that the receiving end successfully received the test message from the device under test, indicating that the communication between the first vehicle controller and the second vehicle controller is normal, and determining that the communication test result is the test passed means that the communication function of the device under test is normal.
[0093] Optionally, determining a communication test result based on the receiving result includes: in response to the receiving result indicating that the receiving end did not receive the test message, determining that the communication test result is a test failure.
[0094] It can be understood that the reception result shows that the receiving end did not receive the test message from the device under test, indicating that the communication between the first vehicle controller and the second vehicle controller is abnormal, and the communication test result is determined to be a test failure, that is, the communication function of the device under test is abnormal.
[0095] Optionally, the first communication protocol is an Ethernet communication protocol, and the second communication protocol is a bus communication protocol.
[0096] Exemplarily, the Ethernet communication protocol is the SOME / IP communication protocol, and the bus communication protocol is the CAN communication protocol.
[0097] SOME / IP (Scalable service-oriented MiddlewarE over IP) is a protocol for real-time communication and network services, designed to provide efficient data exchange for automobiles and other embedded systems. It was jointly developed by automobile manufacturers and suppliers to replace traditional automotive network communication protocols. The SOME / IP protocol is based on IP network communication and supports multiple data transmission methods, including UDP and TCP. It is highly scalable and flexible and can easily adapt to various network topologies and application requirements. In addition, SOME / IP also provides security and reliability functions to ensure the secure transmission and integrity of data.
[0098] CAN (Controller Area Network) communication protocol is a modern data communication protocol. It is a serial communication protocol used to transmit data between cars and other devices. CAN communication protocol is efficient, fast, stable and reliable, and is widely used in the automotive field and industrial control systems. CAN communication protocol adopts a distributed communication method, that is, multiple nodes send and receive data at the same time without the need for a central controller. This communication method enables the CAN bus to support a large number of nodes, thereby achieving efficient data transmission.
[0099] Optionally, the vehicle communication test method further includes: pushing the communication test result to a preset target device according to a preset push strategy.
[0100] Specifically, after the test is completed and the test results are obtained, the test results can be pushed to a preset target device according to a preset push strategy so that the tester can view and analyze the test results.
[0101] Optionally, the preset target device may be a mobile phone or a computer.
[0102] Reference Figure 2 , Figure 2 It is a schematic diagram of the architecture of the execution system for executing the method of the present invention. In some embodiments of the present invention, the system for executing the vehicle communication test method provided by the present invention includes: a host computer, a simulation communication board, a simulation sending end, a simulation receiving end and a connected device to be tested.
[0103] Specifically, the host computer configures the simulation sending end and the simulation receiving end according to the preset configuration file, the simulation communication board sends the test message to the device under test through the simulation sending end, and the simulation communication board obtains the test message sent by the simulation sending end from the device under test through the simulation receiving end.
[0104] It can be understood that the simulation transmitting end and the simulation receiving end are obtained by simulating the vehicle controller.
[0105] For example, refer to Figure 3 In some embodiments of the present invention, the steps of the vehicle communication test method are as follows:
[0106] A. The sending end encapsulates a CAN message with a signal value of x according to the communication test list and the first preset configuration file and sends it on the specified CAN channel to send the CAN message to the device under test and record the sending time t1.
[0107] B. On the designated Ethernet channel, the receiving end filters the SOME / IP messages from the device under test according to the message type, and parses the SOME / IP messages under test according to the Message ID (unique identifier of the message) and Member (receiving end identifier).
[0108] C. Compare the parsed SOME / IP message with the sent CAN message.
[0109] D. Verify whether the Member value at the receiving end is equal to the signal value x of the sent CAN message.
[0110] E. If the result of step D is "yes", record the time t2 when the SOME / IP message is received, and verify whether the receiving time interval t2-t1 meets the requirements.
[0111] F. Determine the test result based on whether t2-t1 meets the requirements and print the test result in the test report.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or grid device, etc.) to execute the methods of various embodiments of the present invention.
[0113] In this embodiment, a vehicle communication test system is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0114] Figure 4 FIG. 2 is a structural block diagram of a vehicle communication test system 200 according to one embodiment of the present invention. Figure 4 As shown, the system includes: a construction module 201, which is used to construct a communication test list according to a first preset configuration file, wherein the communication test list includes a first vehicle controller and a second vehicle controller, the communication protocol of the first vehicle controller is the first communication protocol, and the communication protocol of the second vehicle controller is the second communication protocol; a configuration module 202, which is used to configure the first vehicle controller and the second vehicle controller in the communication test list according to the second preset configuration file to obtain a sending end and a receiving end, wherein when the first vehicle controller is the sending end, the second vehicle controller is the receiving end, and when the first vehicle controller is the receiving end, the second vehicle controller is the sending end; a first control module 203, which is used to control the sending end to send a test message to the device under test, wherein the device under test is used to forward the message sent by the sending end to the receiving end; a second control module 204, which is used to control the receiving end to receive the test message from the device under test and determine the receiving result; a determination module 205, which is used to determine the communication test result according to the receiving result, wherein the communication test result is used to characterize whether the communication function of the device under test is normal.
[0115] Optionally, the construction module 201 is also used to: mark multiple controllers in the vehicle as first vehicle controllers and second vehicle controllers according to a first preset configuration file; determine the correspondence between multiple first vehicle controllers and multiple second vehicle controllers; and determine a communication test list based on multiple first vehicle controllers, multiple second vehicle controllers and the correspondence.
[0116] Optionally, the configuration module 202 is further used to: configure multiple first vehicle controllers as sending ends and configure multiple second vehicle controllers as receiving ends according to a second preset configuration file.
[0117] Optionally, the configuration module 202 is further used to: configure multiple first vehicle controllers as receiving ends and configure multiple second vehicle controllers as sending ends according to a second preset configuration file.
[0118] Optionally, the first control module 203 is also used to: judge the type of the sending end to obtain a judgment result; in response to the judgment result indicating that the type of the sending end is the first vehicle controller, send a test message using the first communication protocol; or, in response to the judgment result indicating that the type of the sending end is the second vehicle controller, send a test message using the second communication protocol.
[0119] Optionally, the determination module 205 is also used to: obtain the time when the sending end sends the test message to obtain the sending time; in response to the receiving result indicating that the receiving end has received the test message, obtain the receiving time, wherein the receiving time is used to characterize the time when the receiving end receives the test message; determine the communication test result based on the sending time and the receiving time.
[0120] Optionally, the determination module 205 is further used to: determine the difference between the sending time and the receiving time; and in response to the difference being less than a preset difference threshold, determine that the communication test result is a test pass.
[0121] Optionally, the determination module 205 is further configured to: in response to the reception result indicating that the receiving end successfully receives the test message, determine that the communication test result is a test pass.
[0122] Optionally, the determination module 205 is further configured to: push the communication test result to a preset target device according to a preset push strategy.
[0123] Optionally, the determination module 205 is further configured to: in response to the reception result indicating that the receiving end has not received the test message, determine that the communication test result is a test failure.
[0124] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the above-mentioned vehicle communication test method.
[0125] Optionally, in this embodiment, the processor in the above electronic device may be configured to run a computer program to perform the following steps:
[0126] Step S101: construct a communication test list according to a first preset configuration file.
[0127] Step S102: According to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end.
[0128] Step S103, controlling the sending end to send a test message to the device under test.
[0129] Step S104, controlling the receiving end to receive a test message from the device under test, and determining a receiving result.
[0130] Step S105, determining the communication test result according to the receiving result.
[0131] Optionally, the processor in the above-mentioned electronic device can be configured to run a computer program to perform the following steps: according to a first preset configuration file, mark multiple controllers in the vehicle as a first vehicle controller and a second vehicle controller, respectively; determine the correspondence between multiple first vehicle controllers and multiple second vehicle controllers; and determine a communication test list based on the multiple first vehicle controllers, multiple second vehicle controllers and the correspondence.
[0132] Optionally, the processor in the above electronic device can be configured to run a computer program to perform the following steps: according to a second preset configuration file, configure multiple first vehicle controllers as transmitting ends and configure multiple second vehicle controllers as receiving ends.
[0133] Optionally, the processor in the above-mentioned electronic device can be configured to run a computer program to perform the following steps: according to a second preset configuration file, configure multiple first vehicle controllers as receiving ends and configure multiple second vehicle controllers as sending ends.
[0134] Optionally, the processor in the above-mentioned electronic device can be configured to run a computer program to perform the following steps: determine the type of the sending end to obtain a determination result; in response to the determination result indicating that the type of the sending end is a first vehicle controller, send a test message using a first communication protocol; or, in response to the determination result indicating that the type of the sending end is a second vehicle controller, send a test message using a second communication protocol.
[0135] Optionally, the processor in the above-mentioned electronic device can be configured to run a computer program to perform the following steps: obtain the time when the sending end sends the test message to obtain the sending time; in response to the receiving result indicating that the receiving end has received the test message, obtain the receiving time, wherein the receiving time is used to characterize the time when the receiving end receives the test message; determine the communication test result based on the sending time and the receiving time.
[0136] Optionally, the processor in the above electronic device can be configured to run a computer program to perform the following steps: determine the difference between the sending time and the receiving time; in response to the difference being less than a preset difference threshold, determine that the communication test result is a test pass.
[0137] Optionally, the processor in the above electronic device can be configured to run a computer program to perform the following steps: in response to the reception result indicating that the receiving end successfully receives the test message, determine that the communication test result is a test pass.
[0138] Optionally, the processor in the above electronic device may be configured to run a computer program to perform the following steps: according to a preset push strategy, push the communication test result to a preset target device.
[0139] Optionally, the processor in the above electronic device can be configured to run a computer program to perform the following steps: in response to the reception result indicating that the receiving end did not receive the test message, determining that the communication test result is a test failure.
[0140] An embodiment of the present invention further provides a non-volatile storage medium, in which a computer program is stored, wherein the computer program is configured to execute the vehicle communication test method in any of the above embodiments when running.
[0141] Optionally, in this embodiment, the above-mentioned computer program may be configured to store a computer program for performing the following steps:
[0142] Step S101: construct a communication test list according to a first preset configuration file.
[0143] Step S102: According to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end.
[0144] Step S103, controlling the sending end to send a test message to the device under test.
[0145] Step S104, controlling the receiving end to receive a test message from the device under test, and determining a receiving result.
[0146] Step S105, determining the communication test result according to the receiving result.
[0147] Optionally, the above-mentioned computer program can be configured to store a computer program for performing the following steps: according to a first preset configuration file, marking multiple controllers in the vehicle as a first vehicle controller and a second vehicle controller, respectively; determining the correspondence between multiple first vehicle controllers and multiple second vehicle controllers; and determining a communication test list based on the multiple first vehicle controllers, the multiple second vehicle controllers and the correspondence.
[0148] Optionally, the above-mentioned computer program can be configured to store a computer program for performing the following steps: according to a second preset configuration file, configuring multiple first vehicle controllers as sending ends and configuring multiple second vehicle controllers as receiving ends.
[0149] Optionally, the above-mentioned computer program can be configured to store a computer program for performing the following steps: according to a second preset configuration file, configuring multiple first vehicle controllers as receiving ends and configuring multiple second vehicle controllers as sending ends.
[0150] Optionally, the above-mentioned computer program can be configured to store a computer program for executing the following steps: judging the type of the sending end to obtain a judgment result; in response to the judgment result indicating that the type of the sending end is the first vehicle controller, sending a test message using the first communication protocol; or, in response to the judgment result indicating that the type of the sending end is the second vehicle controller, sending a test message using the second communication protocol.
[0151] Optionally, the above-mentioned computer program can be configured to store a computer program for performing the following steps: obtaining the time when the sending end sends the test message to obtain the sending time; in response to the receiving result indicating that the receiving end has received the test message, obtaining the receiving time, wherein the receiving time is used to characterize the time when the receiving end receives the test message; and determining the communication test result based on the sending time and the receiving time.
[0152] Optionally, the above-mentioned computer program can be configured to store a computer program for executing the following steps: determining the difference between the sending time and the receiving time; and in response to the difference being less than a preset difference threshold, determining that the communication test result is a test pass.
[0153] Optionally, the computer program may be configured to store a computer program for executing the following steps: in response to the reception result indicating that the receiving end successfully receives the test message, determining that the communication test result is a test pass.
[0154] Optionally, the above-mentioned computer program may be configured to store a computer program for executing the following steps: according to a preset push strategy, pushing the communication test result to a preset target device.
[0155] Optionally, the computer program may be configured to store a computer program for executing the following steps: in response to the reception result indicating that the receiving end does not receive the test message, determining that the communication test result is a test failure.
[0156] An embodiment of the present invention further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the vehicle communication test method described in any of the above embodiments is implemented.
[0157] Optionally, in this embodiment, the above computer program implements the following steps when executed by a processor:
[0158] Step S101: construct a communication test list according to a first preset configuration file.
[0159] Step S102: According to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end.
[0160] Step S103, controlling the sending end to send a test message to the device under test.
[0161] Step S104, controlling the receiving end to receive a test message from the device under test, and determining a receiving result.
[0162] Step S105, determining the communication test result according to the receiving result.
[0163] Optionally, the above-mentioned computer program implements the following steps when executed by the processor: according to a first preset configuration file, marking multiple controllers in the vehicle as a first vehicle controller and a second vehicle controller respectively; determining the correspondence between multiple first vehicle controllers and multiple second vehicle controllers; and determining a communication test list based on multiple first vehicle controllers, multiple second vehicle controllers and the correspondence.
[0164] Optionally, the above-mentioned computer program implements the following steps when executed by a processor: according to a second preset configuration file, configuring multiple first vehicle controllers as sending ends and configuring multiple second vehicle controllers as receiving ends.
[0165] Optionally, the above-mentioned computer program implements the following steps when executed by a processor: according to a second preset configuration file, configuring multiple first vehicle controllers as receiving ends and configuring multiple second vehicle controllers as sending ends.
[0166] Optionally, the above-mentioned computer program implements the following steps when executed by the processor: judge the type of the sending end to obtain a judgment result; in response to the judgment result indicating that the type of the sending end is the first vehicle controller, send a test message using the first communication protocol; or, in response to the judgment result indicating that the type of the sending end is the second vehicle controller, send a test message using the second communication protocol.
[0167] Optionally, the above-mentioned computer program implements the following steps when executed by the processor: obtain the time when the sending end sends the test message to obtain the sending time; in response to the receiving result indicating that the receiving end has received the test message, obtain the receiving time, wherein the receiving time is used to characterize the time when the receiving end receives the test message; determine the communication test result based on the sending time and the receiving time.
[0168] Optionally, the above-mentioned computer program implements the following steps when executed by the processor: determining the difference between the sending time and the receiving time; in response to the difference being less than a preset difference threshold, determining that the communication test result is a test pass.
[0169] Optionally, the computer program implements the following steps when executed by a processor: in response to the reception result indicating that the receiving end successfully receives the test message, determining that the communication test result is a test pass.
[0170] Optionally, the above-mentioned computer program implements the following steps when executed by the processor: according to a preset push strategy, the communication test result is pushed to a preset target device.
[0171] Optionally, the computer program implements the following steps when executed by a processor: in response to the reception result indicating that the receiving end did not receive the test message, determining that the communication test result is a test failure.
[0172] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0173] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0174] In some embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0175] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0176] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0177] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or grid device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.
[0178] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A vehicle communication test method, characterized in that: The method comprises: According to the parsing result of the first preset configuration file, multiple controllers in the vehicle are marked as a first vehicle controller and a second vehicle controller respectively, wherein the first preset configuration file includes an Arxml file and a dbc database file; Determining a correspondence between a plurality of the first vehicle controllers and a plurality of the second vehicle controllers; Determine a communication test list according to the plurality of first vehicle controllers, the plurality of second vehicle controllers and the corresponding relationship, wherein the communication test list includes a plurality of groups of one-to-one corresponding first vehicle controllers and second vehicle controllers, a communication protocol corresponding to each of the plurality of vehicle controllers, and a communication basic configuration for mutual communication between the plurality of controllers, the communication protocol of the first vehicle controller is a first communication protocol, and the communication protocol of the second vehicle controller is a second communication protocol; According to a second preset configuration file, the first vehicle controller and the second vehicle controller in the communication test list are configured to obtain a transmitting end and a receiving end, wherein when the first vehicle controller is the transmitting end, the second vehicle controller is the receiving end, and when the first vehicle controller is the receiving end, the second vehicle controller is the transmitting end; Controlling the sending end to send a test message to the device under test, wherein the device under test is used to forward the message sent by the sending end to the receiving end; Controlling the receiving end to receive the test message from the device under test and determining a receiving result; A communication test result is determined according to the receiving result, wherein the communication test result is used to indicate whether the communication function of the device under test is normal.
2. The vehicle communication test method according to claim 1, characterized in that: The configuring the first vehicle controller and the second vehicle controller in the communication test list according to the second preset configuration file to obtain a transmitting end and a receiving end includes: According to the second preset configuration file, multiple first vehicle controllers are configured as the transmitting ends, and multiple second vehicle controllers are configured as the receiving ends.
3. The vehicle communication test method according to claim 1, characterized in that: The configuring the first vehicle controller and the second vehicle controller in the communication test list according to the second preset configuration file to obtain a transmitting end and a receiving end includes: According to the second preset configuration file, multiple first vehicle controllers are configured as the receiving ends, and multiple second vehicle controllers are configured as the sending ends.
4. The vehicle communication test method according to claim 1, characterized in that: The controlling the sending end to send a test message comprises: Determining the type of the sending end to obtain a determination result; In response to the determination result indicating that the type of the sending end is the first vehicle controller, sending the test message using the first communication protocol; Or, in response to the judgment result indicating that the type of the sending end is the second vehicle controller, the test message is sent using the second communication protocol.
5. The vehicle communication test method according to claim 1, characterized in that: Also includes: Obtaining the time when the sending end sends the test message to obtain the sending time; In response to the reception result indicating that the receiving end has received the test message, acquiring a reception time, wherein the reception time is used to represent the time when the receiving end receives the test message; The communication test result is determined according to the sending time and the receiving time.
6. The vehicle communication test method according to claim 5, characterized in that: The determining the test result according to the sending time and the receiving time includes: Determining a difference between the sending time and the receiving time; In response to the difference being less than a preset difference threshold, the communication test result is determined to be a test pass.
7. The vehicle communication test method according to claim 1, characterized in that: Determining the communication test result according to the receiving result includes: In response to the reception result indicating that the receiving end successfully receives the test message, it is determined that the communication test result is a test pass.
8. The vehicle communication test method according to claim 1, characterized in that: The first communication protocol is an Ethernet communication protocol, and the second communication protocol is a bus communication protocol.
9. The vehicle communication test method according to claim 1, characterized in that: Also includes: According to a preset push strategy, the communication test result is pushed to a preset target device.
10. The vehicle communication test method according to claim 1, characterized in that: Determining the communication test result according to the receiving result includes: In response to the reception result indicating that the receiving end has not received the test message, it is determined that the communication test result is a test failure.
11. A vehicle communication test system, characterized in that: include: A construction module is used to mark multiple controllers in a vehicle as a first vehicle controller and a second vehicle controller respectively according to the parsing result of a first preset configuration file, wherein the first preset configuration file includes an Arxml file and a dbc database file; determine the correspondence between multiple first vehicle controllers and multiple second vehicle controllers; determine a communication test list according to multiple first vehicle controllers, multiple second vehicle controllers and the correspondence; wherein the communication test list includes multiple groups of one-to-one corresponding first vehicle controllers and second vehicle controllers, a communication protocol corresponding to each of the multiple vehicle controllers, and a communication basic configuration for mutual communication between the multiple controllers, the communication protocol of the first vehicle controller is a first communication protocol, and the communication protocol of the second vehicle controller is a second communication protocol; A configuration module, configured to configure the first vehicle controller and the second vehicle controller in the communication test list according to a second preset configuration file to obtain a transmitting end and a receiving end, wherein when the first vehicle controller is the transmitting end, the second vehicle controller is the receiving end, and when the first vehicle controller is the receiving end, the second vehicle controller is the transmitting end; A first control module, used to control the sending end to send a test message to the device under test, wherein the device under test is used to forward the message sent by the sending end to the receiving end; A second control module, used to control the receiving end to receive the test message from the device under test and determine a receiving result; The determination module is used to determine a communication test result according to the receiving result, wherein the communication test result is used to indicate whether the communication function of the device under test is normal.
12. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the vehicle communication test method as claimed in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the vehicle communication test method described in any one of claims 1 to 10 when running on a computer or a processor.
14. A computer program product, characterized in that The invention comprises a computer program, which implements the vehicle communication test method according to any one of claims 1 to 10 when being executed by a processor.
Citation Information
Patent Citations
Automatic test method and device for protocol conversion, equipment and storage medium
CN116418706A