A vehicle CAN signal transceiving test method and system
Patent Information
- Application Number
- CN202411928550.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2044-12-25
AI Technical Summary
[0003]目前,一般通过人工测试的方式对车辆CAN信号的路由帧进行收发测试,而车辆CAN信号路由帧的接收方式的相互关系是交错复杂的,人工测试需要根据路由表,人工查找CAN信号对应的收发关系,并且CAN信号路由帧的测试数量极大,可包括数千条CAN信号的发送帧和接收帧,提高了测试难度,此外,CAN信号路由帧的转发还需要人工根据DBC的定义来赋值以找到对应的接收帧,降低了车辆CAN信号收发测试的准确性,进而降低了车辆CAN信号收发测试的效率
[0050]本申请实施例提供的车辆CAN信号收发测试方法及系统,所述方法应用于车辆CAN信号收发测试系统;其中,所述系统包括上位机端和实时机端,所述方法包括:由所述上位机端针对待测车辆的多路CAN信号对应的接收端和发送端,基于预先设定的所述多路CAN信号对应的测试路由表,利用预设的路由帧测试模型生成所述发送端对应的一个来源信号表和所述接收端分别对应的多个目标信号表,并将所述来源信号表中的多个发送帧对应的随机数发送至所述实时机端;由所述实时机端将接收到的所述随机数写入至设置于所述待测车辆中的目标控制器,并响应于接收到所述目标控制器发送的写入结果,基于所述写入结果,判断所述目标控制器是否将所述随机数写入成功,并将判断结果发送至所述上位机端;由所述上位机端响应于确定所述判断结果为写入成功,基于所述目标信号表,获取由所述目标控制器发送的多个接收帧信号对应的数值,并将所述数值分别与对应的所述随机数进行比对,得到比对结果,以确定对所述待测车辆进行CAN信号收发测试的测试结果。
Smart Images

Figure CN119781350B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle hardware-in-the-loop testing technology, and in particular to a method and system for testing vehicle CAN signal transmission and reception. Background Technology
[0002] In hardware-in-the-loop (HIL) testing of vehicles, the controlled object runs in real time and is controlled by a real controller. Since HIL testing is conducted in the laboratory under extreme conditions, it is relatively safe and less expensive than real vehicle testing. It can also comprehensively test the controller before the control algorithm is deployed in the vehicle.
[0003] Currently, the transmission and reception of vehicle CAN signal routing frames are generally tested manually. However, the relationships between the receiving methods of vehicle CAN signal routing frames are complex and intertwined. Manual testing requires manually looking up the corresponding transmission and reception relationships of CAN signals according to the routing table. Furthermore, the number of CAN signal routing frames to be tested is extremely large, which may include thousands of CAN signal transmission and reception frames, increasing the difficulty of testing. In addition, the forwarding of CAN signal routing frames also requires manual assignment according to the definition of DBC to find the corresponding reception frame, which reduces the accuracy of vehicle CAN signal transmission and reception testing and thus reduces the efficiency of vehicle CAN signal transmission and reception testing. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method and system for testing vehicle CAN signal transmission and reception. The method involves a host computer generating a source signal table corresponding to the transmitting end of multiple CAN signals from the vehicle and multiple target signal tables corresponding to the receiving ends using a routing frame test model. This separates the transmitting and receiving frames in the routing table, reducing the testing difficulty. The real-time computer sends the random numbers corresponding to the transmitting frames in the source signal table sent by the host computer to the target controller located in the vehicle under test. The computer then determines whether the writing was successful based on the writing result from the target controller. If the writing is successful, the host computer obtains the values corresponding to the multiple receiving frame signals sent by the target controller and compares them with the random numbers in the source signal table to obtain the test results for the CAN signal transmission and reception test of the vehicle under test. This improves the accuracy and efficiency of the vehicle CAN signal transmission and reception test.
[0005] This application provides a method for testing vehicle CAN signal transceiver, which is applied to a vehicle CAN signal transceiver testing system; wherein the system includes a host computer and a real-time computer, and the method includes:
[0006] The host computer generates a source signal table for the transmitter and multiple target signal tables for the receiver based on a pre-set test routing table for the multiple CAN signals of the vehicle under test, and sends the random numbers corresponding to the multiple transmission frames in the source signal table to the real-time computer.
[0007] The real-time terminal writes the received random number to the target controller set in the vehicle under test, and responds to the writing result sent by the target controller. Based on the writing result, it determines whether the target controller has successfully written the random number, and sends the determination result to the host computer.
[0008] In response to the determination that the write was successful, the host computer obtains the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table, and compares the values with the corresponding random numbers to obtain the comparison results, thereby determining the test results of the CAN signal transmission and reception test of the vehicle under test.
[0009] Furthermore, the step of generating a source signal table corresponding to the transmitting end and multiple target signal tables corresponding to the receiving end based on a pre-set test routing table corresponding to the multiple CAN signals and using a preset routing frame test model includes:
[0010] In the pre-set test routing table corresponding to the multiple CAN signals, the CAN signal information, transmission frame, signal domain and random number corresponding to multiple transmitting ends are determined, as well as the CAN signal information, reception frame, signal domain and target data corresponding to multiple receiving ends.
[0011] Based on the CAN signal information, transmission frames, signal domains, and random numbers corresponding to the multiple transmitters, a source signal table corresponding to the transmitter is generated using a preset routing frame test model.
[0012] Based on the CAN signal information, received frames, signal domains, and target data corresponding to the multiple receivers, a target signal table corresponding to each of the multiple receivers is generated using a preset routing frame test model.
[0013] Furthermore, in response to receiving the write result sent by the target controller, determining whether the target controller has successfully written the random number based on the write result includes:
[0014] In response to receiving the write result sent by the target controller, determine the write feedback value obtained by the target controller for writing each of the random numbers, and determine whether each of the write feedback values is consistent with the random number;
[0015] When each of the written feedback values is consistent with the corresponding random number, it is determined that the target controller has successfully written the random number.
[0016] When at least one of the write feedback values is inconsistent with the corresponding random number, it is determined that the target controller has failed to write the random number.
[0017] Furthermore, in response to determining that the judgment result is a successful write, the steps include obtaining the values corresponding to multiple received frame signals sent by the target controller based on the target signal table, including:
[0018] Receive multiple receive frame signals sent by the random number written by the target controller;
[0019] In response to determining that the judgment result is successful, the values corresponding to the multiple received frame signals are obtained based on the received frames in the target signal table.
[0020] Furthermore, comparing the numerical values with the corresponding random numbers to obtain comparison results, and determining the test results for the CAN signal transmission and reception test of the vehicle under test, includes:
[0021] The values corresponding to multiple received frame signals are compared with the random numbers corresponding to multiple transmitted frames in the source signal table to obtain the comparison result of each value.
[0022] Based on the comparison results, the test results of the CAN signal transmission and reception test on the vehicle under test are determined.
[0023] This application embodiment also provides a vehicle CAN signal transceiver testing system, the system comprising:
[0024] The host computer is used to generate a source signal table corresponding to the transmitter and multiple target signal tables corresponding to the transmitter based on a pre-set test routing table corresponding to the multiple CAN signals of the vehicle under test, and to send the random numbers corresponding to the multiple transmission frames in the source signal table to the real-time computer.
[0025] The real-time terminal is used to write the received random number to the target controller set in the vehicle under test, and in response to receiving the writing result sent by the target controller, determine whether the target controller has successfully written the random number based on the writing result, and send the determination result to the host computer terminal.
[0026] When the host computer determines that the write is successful, it is further configured to obtain the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table, and compare the values with the corresponding random numbers to obtain the comparison results, so as to determine the test results of the CAN signal transmission and reception test of the vehicle under test.
[0027] Furthermore, the host computer terminal includes:
[0028] The table generation module is used to generate a source signal table corresponding to the transmitter and multiple target signal tables corresponding to the receiver based on a pre-set test routing table corresponding to the multiple CAN signals of the vehicle under test, using a preset routing frame test model, and sending the random numbers corresponding to the multiple transmission frames in the source signal table to the real-time terminal.
[0029] The signal acquisition module is used to, in response to determining that the judgment result is successful, acquire the values corresponding to multiple received frame signals sent by the target controller based on the target signal table;
[0030] The numerical comparison module is used to compare the numerical values with the corresponding random numbers to obtain comparison results, so as to determine the test results of the CAN signal transmission and reception test of the vehicle under test.
[0031] Furthermore, when the table generation module generates a source signal table corresponding to the transmitting end and multiple target signal tables corresponding to the receiving end based on a pre-set test routing table corresponding to the multiple CAN signals and using a preset routing frame test model, the table generation module is used to:
[0032] In the pre-set test routing table corresponding to the multiple CAN signals, the CAN signal information, transmission frame, signal domain and random number corresponding to multiple transmitting ends are determined, as well as the CAN signal information, reception frame, signal domain and target data corresponding to multiple receiving ends.
[0033] Based on the CAN signal information, transmission frames, signal domains, and random numbers corresponding to the multiple transmitters, a source signal table corresponding to the transmitter is generated using a preset routing frame test model.
[0034] Based on the CAN signal information, received frames, signal domains, and target data corresponding to the multiple receivers, a target signal table corresponding to each of the multiple receivers is generated using a preset routing frame test model.
[0035] Furthermore, when the signal acquisition module is used to obtain the values corresponding to multiple received frame signals sent by the target controller based on the target signal table in response to determining that the judgment result is successful, the signal acquisition module is used to:
[0036] Receive multiple receive frame signals sent by the random number written by the target controller;
[0037] In response to determining that the judgment result is successful, the values corresponding to the multiple received frame signals are obtained based on the received frames in the target signal table.
[0038] Furthermore, when the numerical comparison module compares the numerical values with the corresponding random numbers to obtain comparison results, thereby determining the test results for the CAN signal transceiver test of the vehicle under test, the numerical comparison module is used to:
[0039] The values corresponding to multiple received frame signals are compared with the random numbers corresponding to multiple transmitted frames in the source signal table to obtain the comparison result of each value.
[0040] Based on the comparison results, the test results of the CAN signal transmission and reception test on the vehicle under test are determined.
[0041] Furthermore, the real-time terminal includes:
[0042] The signal writing module is used to write the received random number to the target controller installed in the vehicle under test.
[0043] The write judgment module is used to respond to the write result sent by the target controller, determine whether the target controller has successfully written the random number based on the write result, and send the judgment result to the host computer.
[0044] Furthermore, when the write determination module is used to determine whether the target controller has successfully written the random number based on the write result received from the target controller, the write determination module is used to:
[0045] In response to receiving the write result sent by the target controller, determine the write feedback value obtained by the target controller for writing each of the random numbers, and determine whether each of the write feedback values is consistent with the random number;
[0046] When each of the written feedback values is consistent with the corresponding random number, it is determined that the target controller has successfully written the random number.
[0047] When at least one of the write feedback values is inconsistent with the corresponding random number, it is determined that the target controller has failed to write the random number.
[0048] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the vehicle CAN signal transceiver test method described above are performed.
[0049] This application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the vehicle CAN signal transceiver test method described above.
[0050] This application provides a vehicle CAN signal transceiver testing method and system. The method is applied to a vehicle CAN signal transceiver testing system. The system includes a host computer and a real-time computer. The method includes: the host computer, for the receiver and transmitter corresponding to multiple CAN signals of the vehicle under test, generates a source signal table corresponding to the transmitter and multiple target signal tables corresponding to the receiver based on a pre-set test routing table for the multiple CAN signals, using a preset routing frame test model; and sends random numbers corresponding to multiple transmission frames in the source signal table to the real-time computer. The terminal writes the received random number to the target controller set in the vehicle under test, and in response to receiving the writing result sent by the target controller, determines whether the target controller has successfully written the random number based on the writing result, and sends the determination result to the host computer. In response to determining that the determination result is successful, the host computer obtains the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table, and compares the values with the corresponding random number to obtain the comparison result, so as to determine the test result of CAN signal transceiver test of the vehicle under test.
[0051] Compared to existing manual testing methods for transmitting and receiving vehicle CAN signals, this new approach uses a host computer to generate a source signal table corresponding to the transmitter of multiple CAN signals and multiple target signal tables corresponding to the receivers, separating the transmitting and receiving frames in the routing table and reducing testing difficulty. The real-time terminal sends random numbers corresponding to the transmitting frames in the source signal table from the host computer to the target controller in the vehicle under test. It then determines whether the writing was successful based on the target controller's write result. If successful, the host computer obtains the values corresponding to the multiple receiving frame signals sent by the target controller and compares them with the random numbers in the source signal table to obtain the test results for CAN signal transmission and reception of the vehicle under test. This improves the accuracy and efficiency of vehicle CAN signal transmission and reception testing.
[0052] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0053] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 A flowchart illustrating a vehicle CAN signal transceiver test method provided in an embodiment of this application;
[0055] Figure 2 This is a schematic diagram of vehicle CAN signal transmission and reception provided in an embodiment of this application;
[0056] Figure 3 This is one of the structural schematic diagrams of a vehicle CAN signal transceiver test system provided in an embodiment of this application;
[0057] Figure 4 This is a second schematic diagram of a vehicle CAN signal transceiver test system provided in an embodiment of this application;
[0058] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0060] Research has revealed that current methods for testing the transmission and reception of vehicle CAN signal routing frames typically involve manual testing. However, the relationships between the receiving methods of vehicle CAN signal routing frames are complex and intertwined. Manual testing requires manually searching for the corresponding transmission and reception relationships of CAN signals based on the routing table. Furthermore, the number of CAN signal routing frames tested is enormous, potentially including thousands of CAN signal transmission and reception frames, increasing the testing difficulty. In addition, the forwarding of CAN signal routing frames requires manual assignment based on the DBC definition to find the corresponding reception frame, reducing the accuracy of vehicle CAN signal transmission and reception testing and consequently reducing its efficiency.
[0061] Based on this, this application provides a method for testing vehicle CAN signal transmission and reception. The host computer uses a routing frame test model to generate a source signal table corresponding to the transmitting end of multiple CAN signals from the vehicle and multiple target signal tables corresponding to the receiving ends. This separates the transmitting and receiving frames in the routing table, reducing testing difficulty. The real-time computer sends the random numbers corresponding to the transmitting frames in the source signal table sent by the host computer to the target controller located in the vehicle under test. It then determines whether the writing was successful based on the writing result from the target controller. If the writing is successful, the host computer obtains the values corresponding to the multiple receiving frame signals sent by the target controller and compares them with the random numbers in the source signal table to obtain the test results for the CAN signal transmission and reception test of the vehicle under test. This improves the accuracy and efficiency of the vehicle CAN signal transmission and reception test.
[0062] Please see Figure 1 , Figure 1 This is a flowchart illustrating a vehicle CAN signal transceiver testing method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the vehicle CAN signal transceiver test method is typically applied to a vehicle CAN signal transceiver test system. The system may include a host computer and a real-time computer. The method includes:
[0063] It should be noted that the embodiments of this application can be applied to hardware-in-the-loop (HIL) testing of vehicles, and the hardware-in-the-loop testing can include the following aspects.
[0064] Real-time simulation creates a high-precision mathematical model to simulate the behavior of the controlled object. This model typically includes the dynamic characteristics of the physical system, such as mechanical, electrical, or thermodynamic properties, and is capable of operating under real-time conditions.
[0065] For interfaces and communication, the hardware-in-the-loop test system can provide the necessary interfaces to connect to the vehicle's controller hardware (VCU). These interfaces support various types of signals, including analog signals, digital signals, PWM (pulse width modulation), CAN bus and other communication protocols.
[0066] In closed-loop testing, the controller's output directly acts on the simulated environment, while the feedback from the simulated environment is returned to the controller as input, forming a closed-loop control system. This can accurately reproduce the interaction process in the real world.
[0067] Data acquisition and analysis: Throughout the testing process, all relevant signals are recorded for subsequent data analysis and report generation.
[0068] In this embodiment, the vehicle CAN signal transceiver test system may include a host computer and a real-time computer. The host computer may include at least one host computer device, which refers to a computer running advanced software applications for managing and monitoring the operation of lower-level devices or systems. It can be a regular personal computer (PC), workstation, or server.
[0069] The real-time machine may include at least one real-time machine device, which refers to a dedicated computing platform capable of executing tasks according to strict time constraints to ensure that critical tasks are completed within a specified time window.
[0070] In a vehicle CAN signal transceiver test system, the host computer and the real-time machine typically work together via a network connection. The host computer is responsible for high-level logic processing, user interaction, and non-real-time tasks, while the real-time machine focuses on real-time control and data processing.
[0071] On the other hand, the host computer can be seen as the "brain," responsible for planning and decision-making; while the real-time machine is the "hands and feet," responsible for quickly executing specific actions. This division of labor improves the efficiency and reliability of the entire system.
[0072] In hardware-in-the-loop (HIL) testing, the host computer can run simulation models to simulate environmental changes in the real world, while the real-time machine acts as the controller under test, making real-time responses based on these simulation conditions.
[0073] S101. The host computer generates a source signal table corresponding to the transmitter and a plurality of target signal tables corresponding to the transmitter and receiver respectively, based on a pre-set test routing table corresponding to the plurality of CAN signals of the vehicle under test, and sends the random numbers corresponding to the plurality of transmission frames in the source signal table to the real-time computer.
[0074] In this embodiment of the application, the multiple CAN signals may include PTDomain, EPCAN, PTCAN and CHCAN.
[0075] Among them, PTDomain (Powertrain Domain) refers to the powertrain domain, which includes functions such as engine management and transmission control, and is crucial to vehicle performance and fuel efficiency.
[0076] EPCAN (Electronic Powertrain CAN) refers to the CAN signal of a vehicle's electronic powertrain system, which is used for communication between powertrain-related components, such as the engine, transmission, electric motor (in electric or hybrid vehicles), and battery management system.
[0077] PTCAN (Powertrain CAN) refers to a CAN signal suitable for high-speed data exchange between powertrain-related components, such as the engine control module (ECM) and automatic transmission control module (TCM).
[0078] CHCAN (Chassis CAN) refers to a chassis CAN signal, mainly used for communication between components of the chassis system, such as the braking system and suspension control system. Since the performance of the chassis system directly affects the vehicle's safety and driving experience, CHCAN provides a reliable communication platform to ensure the coordinated operation of these critical systems.
[0079] For further details, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the transmission and reception of vehicle CAN signals according to an embodiment of this application. Figure 2As shown, the relationship between the receiving methods of the vehicle CAN signal routing frames is complex and intertwined. The multiple CAN signals, including PTDomain, EPCAN, PTCAN, and CHCAN, can be used as the receiving end and transmitting end of the multiple CAN signals of the vehicle under test, respectively. Therefore, each CAN signal can act as a transmitting end to send routing frame signals (transmit frames) to the other three CAN signals. At the same time, each CAN signal can act as a receiving end to receive routing frame signals (receive frames) sent by the other three CAN signals.
[0080] In this embodiment, the test routing table corresponding to the multiple CAN signals can be specifically set according to actual test requirements, relevant industry standards, and historical experimental data; the test routing table may include, but is not limited to, the signal content and signal name corresponding to the sending and receiving ends of multiple different CAN data.
[0081] The preset routing frame test model can be obtained through model training based on the data and signal addresses corresponding to the CAN signals and the mutual transmission and reception logic of the CAN signals.
[0082] In one embodiment of this application, in specific implementation, step S101, which generates a source signal table corresponding to the transmitting end and multiple target signal tables corresponding to the receiving end based on a pre-set test routing table corresponding to the multiple CAN signals and using a preset routing frame test model, may include:
[0083] S1011. In the pre-set test routing table corresponding to the multiple CAN signals, determine the CAN signal information, transmission frame, signal field and random number corresponding to multiple transmitting ends, and the CAN signal information, reception frame, signal field and target data corresponding to multiple receiving ends.
[0084] In this embodiment of the application, the random number corresponds to the transmission frame, and the random number can be obtained by converting the transmission frame according to the definition in a preset DBC file.
[0085] The DBC (Database Container) file is a file used to define the format and attributes of messages and signals in the CAN communication protocol. It is commonly used in the automotive and industrial automation fields to ensure compatibility and interoperability between devices from different manufacturers.
[0086] Here, the sending frame refers to routing frame data created by the source device (e.g., a computer, router, or other network device) and prepared for transmission over the network to the target device; the receiving frame, relative to the sending frame, refers to routing frame data received at the network interface layer.
[0087] In this step, information identification is performed on the test routing table corresponding to the multiple CAN signals, so as to determine the CAN signal information, transmission frame, signal domain and random number corresponding to the transmitter for multiple transmitters in the test routing table.
[0088] Furthermore, for multiple receivers, the CAN signal information, received frames, signal domains, and target data corresponding to each receiver are determined in the test routing table.
[0089] S1012. Based on the CAN signal information, transmission frame, signal domain and random number corresponding to the multiple transmitters respectively, a source signal table corresponding to the transmitter is generated using a preset routing frame test model.
[0090] In this step, a source signal table corresponding to the transmitter is generated by using a preset routing frame test model, which includes the CAN signal information, transmission frame, signal domain, and random number corresponding to the determined transmitter.
[0091] Here, the multiple CAN signals, including PTDomain, EPCAN, PTCAN, and CHCAN, can each serve as a transmitter, and the generated source signal table can include the CAN signal information, transmission frame, signal domain, and random number corresponding to each CAN signal that serves as a transmitter; wherein, the CAN signal information can include the CAN signal content and the CAN signal name.
[0092] An example of a source signal table is shown in the table below.
[0093]
[0094] In this way, a source signal table is generated by using multiple CAN signals as the transmitting end and related data and information. This source signal table is sent to the real-time machine, which then writes it into the target controller of the vehicle under test. This solves the problem of excessive complexity in the transmission and reception test caused by too many transmitting ends, thereby improving the efficiency of CAN signal transmission and reception test.
[0095] S1013. Based on the CAN signal information, received frames, signal domains and target data corresponding to the multiple receivers respectively, generate the target signal table corresponding to the multiple receivers respectively using a preset routing frame test model.
[0096] In this step, a preset routing frame test model is used to generate multiple target signal tables corresponding to multiple receivers based on the CAN signal information, received frames, signal domains and target data corresponding to the determined receivers.
[0097] Here, the multiple CAN signals, including PTDomain, EPCAN, PTCAN and CHCAN, can be used as receiving ends. Each receiving end can correspond to a target signal table. Each target signal table can include the CAN signal information, received frame, signal domain and target data corresponding to the receiving end.
[0098] For example, an example of a target signal table is shown in the table below.
[0099]
[0100] In this way, when receiving the received frame signal sent by the target controller of the vehicle under test, the received frame signal can be compared and matched based on a target signal table corresponding to each receiver, thereby improving the accuracy and efficiency of CAN signal transmission and reception testing.
[0101] S102. The real-time terminal writes the received random number to the target controller set in the vehicle under test, and in response to receiving the writing result sent by the target controller, determines whether the target controller has successfully written the random number based on the writing result, and sends the determination result to the host computer.
[0102] In this step, the real-time terminal writes all the random numbers corresponding to the multiple transmission frames received to the target controller set in the vehicle under test through Ethernet communication. After receiving the writing result sent by the target controller, it determines whether the target controller has successfully written the random numbers, obtains the judgment result, and sends the judgment result to the host computer through XCP communication.
[0103] In one embodiment of this application, in specific implementation, step S102, in response to receiving the write result sent by the target controller, and based on the write result, determining whether the target controller has successfully written the random number, may include:
[0104] S1021. In response to receiving the write result sent by the target controller, determine the write feedback value obtained by the target controller for writing each of the random numbers, and determine whether each of the write feedback values is consistent with the random number.
[0105] In this step, in specific implementation, firstly, after the target controller is written with random numbers by the real-time machine, it sends the write result of each random number to the real-time machine; then, in response to receiving the write result of each random number sent by the target controller, the real-time machine determines the write feedback value obtained by the target controller for writing each random number; finally, it compares the write feedback value of each random number with the random number to determine whether each write feedback value is consistent with the corresponding random number.
[0106] S1022. When each of the written feedback values is consistent with the corresponding random number, it is determined that the target controller has successfully written the random number.
[0107] In this step, when all write feedback values sent by the target controller to the real-time machine are consistent with the random numbers in the corresponding source signal table, it is determined that the target controller has successfully written the random numbers.
[0108] S1023. When at least one of the write feedback values is inconsistent with the corresponding random number, it is determined that the target controller has failed to write the random number.
[0109] In this step, if at least one of the write feedback values sent by the target controller to the real-time machine is inconsistent with the random number in the corresponding source signal table, it is determined that the target controller has failed to write the random number.
[0110] S103. In response to the determination that the judgment result is successful, the host computer obtains the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table, and compares the values with the corresponding random numbers to obtain the comparison results, so as to determine the test results of the CAN signal transmission and reception test of the vehicle under test.
[0111] In this embodiment, after the host computer sends the random number corresponding to the sent frame that needs to be written into the source signal table of the target controller to the real-time computer, the host computer first needs to respond to the judgment result sent by the real-time computer indicating that the writing was successful, and then obtain the values corresponding to the multiple received frame signals sent by the target controller, so as to further compare the values with the corresponding random numbers to obtain the comparison results, and then determine the test results of the CAN signal transmission and reception test of the vehicle under test.
[0112] Furthermore, the host computer determines the test result of the comparison between the random number corresponding to each transmitted frame in the source signal table and the received frames in multiple target signal tables as the test result of the CAN signal transmission and reception test of the vehicle under test, and generates the corresponding test report based on the test result.
[0113] In one embodiment of this application, in specific implementation, step S103, in response to determining that the judgment result is successful, obtaining the values corresponding to multiple received frame signals sent by the target controller based on the target signal table, may include:
[0114] S1031. Receive multiple receive frame signals sent by the random number written by the target controller.
[0115] In this step, after all random numbers are written to the target controller, the multiple receive frame signals obtained from writing the random numbers are sent to the host computer. The host computer receives the multiple receive frame signals and suspends them, waiting for the judgment result sent by the real-time machine.
[0116] S1032. In response to determining that the judgment result is successful, obtain the values corresponding to the multiple received frame signals based on the received frames in the target signal table.
[0117] In this step, if the result of the judgment that the target controller has written the random number is successful, the value corresponding to each received frame signal is obtained based on the target signal table corresponding to the receiver of each CAN signal and according to the information of the received frame signal in each target signal table.
[0118] In one embodiment of this application, in specific implementation, the step of comparing the numerical value with the corresponding random number in step S103 to obtain the comparison result, and determining the test result of the CAN signal transceiver test of the vehicle under test, may include:
[0119] S1033. The values corresponding to the multiple received frame signals are compared with the random numbers corresponding to the multiple transmitted frames in the source signal table to obtain the comparison result of each value.
[0120] In this step, the value corresponding to the received frame signal of each CAN signal receiver is compared with the random number corresponding to each transmitted frame in the source signal table to obtain the comparison result of the value corresponding to each received frame signal.
[0121] S1034. Based on the comparison results, determine the test results of the CAN signal transmission and reception test of the vehicle under test.
[0122] In this step, the comparison result of the value corresponding to each received frame signal, as well as the corresponding transmitted frame and its random number, are determined as the test result of the CAN signal transmission and reception test of the vehicle under test.
[0123] The vehicle CAN signal transceiver testing method provided in this application uses a routing frame test model to generate a source signal table corresponding to the transmitting end of multiple CAN signals of the vehicle and multiple target signal tables corresponding to the receiving end, thereby separating the transmitting and receiving frames in the routing table and reducing the testing difficulty. The real-time terminal sends the random number corresponding to the transmitting frame in the source signal table sent by the host computer to the target controller set in the vehicle under test, and determines whether the writing is successful based on the writing result of the target controller. If the writing is successful, the host computer obtains the values corresponding to the multiple receiving frame signals sent by the target controller and compares them with the random number in the source signal table to obtain the test result of the CAN signal transceiver test of the vehicle under test, thereby improving the accuracy and efficiency of the vehicle CAN signal transceiver test.
[0124] Please see Figure 3 , Figure 4 , Figure 3 This is one of the structural schematic diagrams of a vehicle CAN signal transceiver test system provided in an embodiment of this application. Figure 4 This is a second schematic diagram of a vehicle CAN signal transceiver test system provided in an embodiment of this application.
[0125] like Figure 3 As shown, the vehicle CAN signal transceiver test system 30 includes:
[0126] The host computer 310 is used to generate a source signal table corresponding to the transmitter and multiple target signal tables corresponding to the transmitter based on a pre-set test routing table corresponding to the multiple CAN signals of the vehicle under test, and to send the random numbers corresponding to the multiple transmission frames in the source signal table to the real-time computer 320.
[0127] The real-time terminal 320 is used to write the received random number to the target controller set in the vehicle under test, and in response to receiving the writing result sent by the target controller, determine whether the target controller has successfully written the random number based on the writing result, and send the determination result to the host terminal 310.
[0128] When the host computer 310 determines that the write is successful, it is further configured to obtain the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table, and compare the values with the corresponding random numbers to obtain the comparison results, so as to determine the test results of the CAN signal transmission and reception test of the vehicle under test.
[0129] Furthermore, such as Figure 4 As shown, the host computer terminal 310 includes:
[0130] The table generation module 311 is used to generate a source signal table corresponding to the transmitter and multiple target signal tables corresponding to the receiver and transmitter of the multi-channel CAN signals of the vehicle under test based on a pre-set test routing table corresponding to the multi-channel CAN signals and using a preset routing frame test model. The module also sends the random numbers corresponding to the multiple transmission frames in the source signal table to the real-time terminal 320.
[0131] The signal acquisition module 312 is used to, in response to determining that the judgment result is successful, acquire the values corresponding to multiple received frame signals sent by the target controller based on the target signal table;
[0132] The numerical comparison module 313 is used to compare the numerical values with the corresponding random numbers to obtain comparison results, so as to determine the test results of the CAN signal transmission and reception test of the vehicle under test.
[0133] Furthermore, when the table generation module 311 generates a source signal table corresponding to the transmitting end and multiple target signal tables corresponding to the receiving end based on a preset test routing table corresponding to the multiple CAN signals and using a preset routing frame test model, the table generation module 311 is used to:
[0134] In the pre-set test routing table corresponding to the multiple CAN signals, the CAN signal information, transmission frame, signal domain and random number corresponding to multiple transmitting ends are determined, as well as the CAN signal information, reception frame, signal domain and target data corresponding to multiple receiving ends.
[0135] Based on the CAN signal information, transmission frames, signal domains, and random numbers corresponding to the multiple transmitters, a source signal table corresponding to the transmitter is generated using a preset routing frame test model.
[0136] Based on the CAN signal information, received frames, signal domains, and target data corresponding to the multiple receivers, a target signal table corresponding to each of the multiple receivers is generated using a preset routing frame test model.
[0137] Furthermore, when the signal acquisition module 312 is used to acquire the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table in response to determining that the judgment result is successful, the signal acquisition module 312 is used to:
[0138] Receive multiple receive frame signals sent by the random number written by the target controller;
[0139] In response to determining that the judgment result is successful, the values corresponding to the multiple received frame signals are obtained based on the received frames in the target signal table.
[0140] Furthermore, when the numerical comparison module 313 compares the numerical values with the corresponding random numbers to obtain comparison results, thereby determining the test results for the CAN signal transmission and reception test of the vehicle under test, the numerical comparison module 313 is used to:
[0141] The values corresponding to multiple received frame signals are compared with the random numbers corresponding to multiple transmitted frames in the source signal table to obtain the comparison result of each value.
[0142] Based on the comparison results, the test results of the CAN signal transmission and reception test on the vehicle under test are determined.
[0143] Furthermore, such as Figure 4 As shown, the real-time terminal 320 includes:
[0144] The signal writing module 321 is used to write the received random number to the target controller installed in the vehicle under test.
[0145] The write judgment module 322 is used to respond to the write result sent by the target controller, determine whether the target controller has successfully written the random number based on the write result, and send the judgment result to the host computer 310.
[0146] Furthermore, when the write determination module 322 is used to determine whether the target controller has successfully written the random number based on the write result received from the target controller, the write determination module 322 is used to:
[0147] In response to receiving the write result sent by the target controller, determine the write feedback value obtained by the target controller for writing each of the random numbers, and determine whether each of the write feedback values is consistent with the random number;
[0148] When each of the written feedback values is consistent with the corresponding random number, it is determined that the target controller has successfully written the random number.
[0149] When at least one of the write feedback values is inconsistent with the corresponding random number, it is determined that the target controller has failed to write the random number.
[0150] Please see Figure 5 , Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
[0151] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 and the memory 520 communicate via the bus 530. When the machine-readable instructions are executed by the processor 510, they can perform the operations described above. Figure 1 The steps of the vehicle CAN signal transmission and reception test method in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0152] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the vehicle CAN signal transmission and reception test method in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0153] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0154] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0156] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0157] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0158] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for testing vehicle CAN signal transmission and reception, characterized in that, The method is applied to a vehicle CAN signal transceiver test system; wherein the system includes a host computer and a real-time computer, and the method includes: The host computer, targeting the receivers and transmitters of multiple CAN signals from the vehicle under test, generates a source signal table for the transmitter and multiple target signal tables for the receivers based on a pre-defined test routing table for the multiple CAN signals and a preset routing frame test model. It then sends random numbers corresponding to multiple transmission frames in the source signal table to the real-time computer. The test routing table includes signal content and names corresponding to the transmitters and receivers of multiple different CAN data streams. The routing frame test model can be obtained through model training based on the data and signal addresses corresponding to the CAN signals and the mutual transmission and reception logic of the CAN signals. The process, based on a pre-defined test routing table corresponding to the multiple CAN signals, utilizes a pre-defined routing frame test model to generate a source signal table corresponding to the transmitting end and multiple target signal tables corresponding to the receiving end, including: In the pre-set test routing table corresponding to the multiple CAN signals, the CAN signal information, transmission frame, signal domain and random number corresponding to multiple transmitting ends are determined, as well as the CAN signal information, reception frame, signal domain and target data corresponding to multiple receiving ends. Based on the CAN signal information, transmission frame, signal domain and random number corresponding to the multiple transmitters, a source signal table corresponding to the transmitter is generated using a preset routing frame test model. Based on the CAN signal information, received frames, signal domains and target data corresponding to the multiple receivers respectively, a target signal table corresponding to the multiple receivers is generated using a preset routing frame test model. The real-time terminal writes the received random number to the target controller set in the vehicle under test, and responds to the writing result sent by the target controller. Based on the writing result, it determines whether the target controller has successfully written the random number, and sends the determination result to the host computer. In response to the determination that the write was successful, the host computer obtains the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table, and compares the values with the corresponding random numbers to obtain the comparison results, thereby determining the test results of the CAN signal transmission and reception test of the vehicle under test.
2. The method according to claim 1, characterized in that, The step of responding to receiving the write result sent by the target controller and determining whether the target controller has successfully written the random number based on the write result includes: In response to receiving the write result sent by the target controller, determine the write feedback value obtained by the target controller for writing each of the random numbers, and determine whether each of the write feedback values is consistent with the random number; When each of the written feedback values is consistent with the corresponding random number, it is determined that the target controller has successfully written the random number. When at least one of the write feedback values is inconsistent with the corresponding random number, it is determined that the target controller has failed to write the random number.
3. The method according to claim 1, characterized in that, In response to determining that the judgment result is a successful write, the method retrieves the values corresponding to multiple received frame signals sent by the target controller based on the target signal table, including: Receive multiple receive frame signals sent by the random number written by the target controller; In response to determining that the judgment result is successful, the values corresponding to the multiple received frame signals are obtained based on the received frames in the target signal table.
4. The method according to claim 1, characterized in that, The step of comparing the numerical values with the corresponding random numbers to obtain comparison results, and determining the test results for the CAN signal transmission and reception test of the vehicle under test, includes: The values corresponding to multiple received frame signals are compared with the random numbers corresponding to multiple transmitted frames in the source signal table to obtain the comparison result of each value. Based on the comparison results, the test results of the CAN signal transmission and reception test on the vehicle under test are determined.
5. A vehicle CAN signal transceiver test system, characterized in that, The system includes: On the host computer side, for the receiver and transmitter corresponding to multiple CAN signals of the vehicle under test, based on a pre-set test routing table corresponding to the multiple CAN signals, a source signal table corresponding to the transmitter and multiple target signal tables corresponding to the receiver are generated using a preset routing frame test model. Random numbers corresponding to multiple transmission frames in the source signal table are then sent to the real-time computer. The test routing table includes the signal content and signal name corresponding to multiple transmitters and receivers of different CAN data. The routing frame test model can be obtained through model training based on the data and signal addresses corresponding to the CAN signals and the mutual transmission and reception logic of the CAN signals. When the host computer generates a source signal table corresponding to the transmitting end and multiple target signal tables corresponding to the receiving end based on a pre-set test routing table corresponding to the multiple CAN signals and using a preset routing frame test model, the host computer is used to: In the pre-set test routing table corresponding to the multiple CAN signals, the CAN signal information, transmission frame, signal domain and random number corresponding to multiple transmitting ends are determined, as well as the CAN signal information, reception frame, signal domain and target data corresponding to multiple receiving ends. Based on the CAN signal information, transmission frame, signal domain and random number corresponding to the multiple transmitters, a source signal table corresponding to the transmitter is generated using a preset routing frame test model. Based on the CAN signal information, received frames, signal domains and target data corresponding to the multiple receivers respectively, a target signal table corresponding to the multiple receivers is generated using a preset routing frame test model. The real-time terminal is used to write the received random number to the target controller set in the vehicle under test, and in response to receiving the writing result sent by the target controller, determine whether the target controller has successfully written the random number based on the writing result, and send the determination result to the host computer terminal. When the host computer determines that the write is successful, it is further configured to obtain the values corresponding to the multiple received frame signals sent by the target controller based on the target signal table, and compare the values with the corresponding random numbers to obtain the comparison results, so as to determine the test results of the CAN signal transmission and reception test of the vehicle under test.
6. The system according to claim 5, characterized in that, The host computer includes: The table generation module is used to generate a source signal table for the transmitter and multiple target signal tables for the receiver based on a pre-set test routing table for the multiple CAN signals of the vehicle under test, using a preset routing frame test model. The module also sends random numbers corresponding to multiple transmission frames in the source signal table to the real-time machine. The test routing table includes signal content and signal names corresponding to the transmitter and receiver of multiple different CAN data. The routing frame test model can be obtained through model training based on the data and signal addresses corresponding to the CAN signals and the mutual transmission and reception logic of the CAN signals. When the table generation module generates a source signal table corresponding to the transmitting end and multiple target signal tables corresponding to the receiving end based on a pre-set test routing table corresponding to the multiple CAN signals and using a preset routing frame test model, the table generation module is used to: In the pre-set test routing table corresponding to the multiple CAN signals, the CAN signal information, transmission frame, signal domain and random number corresponding to multiple transmitting ends are determined, as well as the CAN signal information, reception frame, signal domain and target data corresponding to multiple receiving ends. Based on the CAN signal information, transmission frames, signal domains, and random numbers corresponding to the multiple transmitters, a source signal table corresponding to the transmitter is generated using a preset routing frame test model. Based on the CAN signal information, received frames, signal domains and target data corresponding to the multiple receivers respectively, a target signal table corresponding to the multiple receivers is generated using a preset routing frame test model. The signal acquisition module is used to, in response to determining that the judgment result is successful, acquire the values corresponding to multiple received frame signals sent by the target controller based on the target signal table; The numerical comparison module is used to compare the numerical values with the corresponding random numbers to obtain comparison results, so as to determine the test results of the CAN signal transmission and reception test of the vehicle under test.
7. The system according to claim 5, characterized in that, The real-time terminal includes: A signal writing module is used to write the received random number to a target controller installed in the vehicle under test; The write judgment module is used to respond to the write result sent by the target controller, determine whether the target controller has successfully written the random number based on the write result, and send the judgment result to the host computer.
8. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the vehicle CAN signal transceiver test method as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the vehicle CAN signal transceiver test method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Controller CAN signal test method and system
CN116389314A
Signal detection method and device, electronic equipment and vehicle
CN116915645A
Test method and device, electronic equipment and storage medium
CN117792941A
Performance test method and device of vehicle-mounted controller, electric vehicle and medium
CN118348958A