Bus testing device and bus testing method
By using the local clock of the message sending device to send message data on the vehicle bus in the bus test device, the problem of unstable signal transmission time in the prior art is solved, and higher time accuracy and accuracy of test results are achieved.
Patent Information
- Application Number
- CN202410381880.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-03-29
AI Technical Summary
In the fields of automobile autonomous driving and assisted driving, it is difficult for the prior art to accurately control the transmission time of simulation signals, resulting in poor time stability of simulation signals on the vehicle bus, affecting the accuracy of the test results.
It provides a bus testing device to send message data through the local clock of the message sending device, thereby improving the accuracy of signal transmission time. The device includes a message sending device and a host computer. The message sending device is connected to the vehicle bus, determines the timing of sending message data through configuration parameters, and sends message data according to the local clock.
It effectively improves the accuracy of sending message data to the vehicle bus, ensures the time stability of the vehicle bus to obtain message data, and avoids the problem of affecting the test results due to unstable signal time.
Smart Images

Figure CN117997673B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile testing, and in particular to a bus testing device and a bus testing method. Background Art
[0002] In the fields of autonomous driving and assisted driving, multi-bus simulation, testing and diagnosis functions for vehicles can be implemented on the terminal to serve the network development and testing of vehicles. Generally, the simulation signal is determined on the host computer and sent to the vehicle through the vehicle bus, so as to test or diagnose the operation of the module under test in the vehicle according to the operation of the module under test in the vehicle in response to the simulation signal.
[0003] However, the host computer generally uses the Windows system, and the clock accuracy is not high, making it difficult to accurately control the sending time of the simulation signal, especially for the simulation signal that needs to be sent cyclically, resulting in poor time stability of the simulation signal sent to the vehicle bus, affecting the test. Summary of the invention
[0004] Based on this, it is necessary to provide a bus testing device and a bus testing method that can at least effectively improve the accuracy of signal transmission time in order to improve the accuracy of automobile testing in order to address the problems in the above-mentioned background technology.
[0005] According to various embodiments of the present application, one aspect of the present application provides a bus testing device, including a message sending device for connecting to a vehicle bus, wherein the message sending device is configured to at least perform the following steps in a first working state:
[0006] Acquire first message data and configuration parameters, where the configuration parameters are at least used to determine a sending timing of the first message data;
[0007] The first message data is sent to the vehicle bus according to the configuration parameters and the local clock of the message sending device.
[0008] In the bus test device in the above embodiment, since the clock accuracy of the message sending device is higher than the clock accuracy of the host computer, by using the local clock of the message sending device as the reference clock to send the message data, the sending time accuracy of the message data sent to the vehicle bus is effectively improved compared to using the clock of the host computer as the reference clock to send the message data, thereby ensuring the time stability of the vehicle bus in obtaining the message data and avoiding the occurrence of events that affect the vehicle test results due to unstable time of sending signals to the vehicle bus.
[0009] In some embodiments, the bus test device also includes a host computer, which is connected to at least one message sending device and is used to obtain message data to be sent by at least one message sending device and its configuration parameters. The host computer is connected to one or more message sending devices and can control the message sending of each message sending device respectively; a message sending device includes at least one channel for connecting to the vehicle bus, and the host computer can obtain the message data to be sent and its configuration parameters, and configure the message data to be sent to be sent through at least one channel of at least one message sending device. Therefore, based on the host computer connected to multiple message sending devices, multiple message sending devices can be controlled in batches to send test data to the vehicle bus to achieve multi-channel testing.
[0010] In some embodiments, the host computer is further used to obtain a mode parameter of the message data to be sent, and the mode parameter is at least used to determine a sending mode of the message data to be sent; the host computer is configured as follows:
[0011] If the mode parameter is the first mode parameter, obtaining first message data based on the message data to be sent, and controlling the message sending device to execute steps in the first working state;
[0012] If the mode parameter is the second mode parameter, the second message data is obtained based on the message data to be sent, the second message data is sent to the message sending device according to the configuration parameters and the system clock of the host computer, and the message sending device is controlled to execute the steps in the second working state; wherein, the message sending device executes the steps in the second working state including: receiving and forwarding the second message data sent by the host computer to the vehicle bus.
[0013] In the bus test device in the above embodiment, the following two message data sending modes are provided: Mode 1, executing the steps in the first working state via the message sending device; Mode 2, receiving and forwarding the second message data sent by the host computer to the vehicle bus via the message sending device. Selecting mode 1 or mode 2 according to the mode parameters is more convenient and flexible to use, and meets the actual functional requirements of various different application scenarios.
[0014] In some embodiments, the host computer is further configured to perform the following steps to obtain mode parameters:
[0015] If the message data to be sent is a first type of message, determining that the mode parameter of the message data to be sent is a first mode parameter;
[0016] If the message data to be sent is a second type message, the mode parameter of the message data to be sent is determined to be a second mode parameter; wherein the probability of the first type message being modified is less than the probability of the second type message being modified.
[0017] In the bus test device in the above embodiment, for the message data to be sent with a high modification probability, it may be frequently modified and needs to be modified immediately; while for the message data to be sent with a low modification probability, the number of modifications and the modification frequency are low. Therefore, by setting the modification probability of the message data to be sent, the matching working mode is automatically switched to improve the intelligence and accuracy of the message data transmission.
[0018] In some embodiments, the host computer is further configured to perform the following steps to obtain mode parameters:
[0019] If the message data to be sent is a third type of message, determining that the mode parameter of the message data to be sent is a first mode parameter;
[0020] If the message data to be sent is a fourth type of message, then the mode parameter of the message data to be sent is determined to be a second mode parameter; wherein, in the historical sending records of the third type of messages, the number of times the mode parameter is the first mode parameter is greater than the number of times the mode parameter is the second mode parameter, and in the historical sending records of the fourth type of messages, the number of times the mode parameter is the first mode parameter is less than the number of times the mode parameter is the second mode parameter.
[0021] In the bus test device in the above embodiment, by automatically switching to a mode parameter with a higher proportion of times according to the number of times the mode parameter is the first mode parameter or the second mode parameter in the historical sending records of different types of messages, it is possible to intelligently match the appropriate working mode according to the historical sending records of different types of messages, thereby improving the intelligence and accuracy of message data sending.
[0022] In some embodiments, the configuration parameters include a cycle parameter, and the cycle parameter is at least used to determine a transmission time difference between two transmissions of the message data to be transmitted; the host computer is further configured to perform the following steps to obtain the mode parameters:
[0023] If the message data to be sent is a message of the fifth type, determining that the mode parameter of the message data to be sent is a first mode parameter;
[0024] If the message data to be sent is a sixth type message, the mode parameter of the message data to be sent is determined to be a second mode parameter; wherein the sending time difference between two sendings of the fifth type message is less than the sending time difference between two sendings of the sixth type message.
[0025] In the bus test device in the above embodiment, for the message data to be sent with a smaller sending time difference, the requirement for the sending time accuracy is higher, and for the message data to be sent with a larger sending time difference, the requirement for the sending time accuracy is slightly lower. By intelligently matching the appropriate working mode based on the sending time difference between the two sendings of the message data to be sent, the intelligence and accuracy of the message data sending are improved.
[0026] In some embodiments, the host computer is further configured to: obtain target model data and a current model type of the message sending device; the target model data includes a target model type for indicating that the message sending device supports the first working state;
[0027] If the current model type is the same as a target model type in the target model data, it is determined that the message sending device has the function of executing the steps in the first working state.
[0028] In the bus testing device in the above embodiment, after determining that the current message sending device supports the first working state based on the current model type of the current message sending device, the current message sending device is controlled to execute the steps in the first working state to avoid failure of working mode control and affect the time accuracy of message data sending.
[0029] In some embodiments, the configuration parameters include a start transmission time and a cycle parameter, the cycle parameter is at least used to determine a transmission time difference between two transmissions of the first message data, and the steps in the message sending device executing the first working state include:
[0030] Obtaining first message data and configuration parameters;
[0031] The first message data is sent to the vehicle bus according to the start sending time and the cycle parameter and the local clock of the message sending device.
[0032] In the bus test device in the above embodiment, by setting the start sending time in the configuration parameters, the sending time of the message data can be flexibly adjusted, thereby improving the flexibility of the message data sending.
[0033] In some embodiments, the configuration parameter includes a cycle parameter, and the cycle parameter is at least used to determine a transmission time difference between two transmissions of the first message data. The message sending device performs the steps in the first working state including:
[0034] Obtaining first message data and configuration parameters;
[0035] In response to a sending instruction, the sending instruction is at least used to determine a start sending time, and the first message data is sent to the vehicle bus according to the start sending time and the cycle parameter, and the local clock of the message sending device.
[0036] In the bus test device in the above embodiment, the sending instruction can be set to include a sending mode such as immediate sending or timed sending, so that the sending time of the message data can be flexibly adjusted according to the sending mode of the sending instruction.
[0037] In some embodiments, another aspect of the present application provides a bus testing method, comprising:
[0038] Acquire first message data and configuration parameters based on the message sending device, where the configuration parameters are at least used to determine a sending time of the first message data;
[0039] Based on the message sending device according to the configuration parameters and the local clock of the message sending device, the first message data is sent to the vehicle bus.
[0040] In the bus testing method in the above embodiment, since the clock accuracy of the message sending device is higher than the clock accuracy of the host computer, by using the local clock of the message sending device as the reference clock to send the message data, the sending time accuracy of the message data sent to the vehicle bus is effectively improved compared to using the clock of the host computer as the reference clock to send the message data, thereby ensuring the time stability of the vehicle bus in obtaining the message data and avoiding the occurrence of events that affect the vehicle test results due to unstable time of sending signals to the vehicle bus. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, drawings of other embodiments can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 A schematic diagram of the structure of a bus testing device provided in one embodiment of the present application;
[0043] Figure 2 A schematic flow chart of the steps in the first execution mode of a bus test device provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of the structure of a bus testing device provided in another embodiment of the present application;
[0045] Figure 4 A schematic diagram of a process of intelligently selecting mode 1 and mode 2 of a bus test device provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of a flow chart of a host computer acquiring mode parameters in a bus test device provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram of a flow chart of a host computer acquiring mode parameters in a bus test device provided in another embodiment of the present application;
[0048] Figure 7 A schematic diagram of a flow chart of a host computer acquiring mode parameters in a bus test device provided in yet another embodiment of the present application;
[0049] Figure 8 A flowchart of a bus testing method provided in one embodiment of the present application is shown. DETAILED DESCRIPTION
[0050] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0052] In the case of using “including”, “having”, and “comprising” described herein, another component may be added unless a clear limiting term such as “only”, “consisting of”, etc. is used. Unless mentioned otherwise, a term in the singular form may include a plural form and should not be understood as being one in number.
[0053] It should be understood that although the terms "first", "second", etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element without departing from the scope of the present application.
[0054] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0055] In the bus simulation, testing and diagnosis of vehicles, the module to be tested is the vehicle electronic control unit (ECU) or sensor, and the host computer software runs on a variety of terminals. The target simulation signal determined by the host computer can be used to simulate the output signal of the electronic control unit or sensor in the vehicle, and then test the module to be tested. However, for the simulation signal sent cyclically, such as sending a simulation signal once every 1ms, due to the low accuracy of the Windows system time of the host computer, the time interval of the simulation signal output by the host computer is not all 1ms, for example, some time intervals are 0.9ms or 1.1ms, etc., resulting in the time interval of the simulation signal sent to the vehicle bus being unstable, affecting the accuracy or reliability of the test results.
[0056] Based on this, the present application aims to provide a bus testing device and a bus testing method, which can at least effectively improve the accuracy of signal sending time to improve the accuracy of automobile testing.
[0057] Please refer to Figure 1-Figure 2 In some embodiments of the present application, a bus testing device 300 is provided, comprising a message sending device 302 for connecting to a vehicle bus 400, wherein the message sending device 302 is configured to at least perform the following steps in a first working state:
[0058] Step S102: obtaining first message data and configuration parameters, where the configuration parameters are at least used to determine a sending timing of the first message data;
[0059] Step S104: Send the first message data to the vehicle bus according to the configuration parameters and the local clock of the message sending device.
[0060] As an example, the message sending device 302 is, for example, a bus card, which is used to connect the host computer and the bus system of the vehicle and is responsible for transmitting information between the two. The host computer can send the target simulation signal to the bus card, which is connected to the vehicle bus as a node and communicates with other nodes on the vehicle bus, thereby sending the target simulation signal to the module to be tested on the vehicle bus. After obtaining the configuration parameters, the bus card can determine the sending time of the first message data according to the configuration parameters, and send the obtained first message data to the vehicle bus based on the local clock of the bus card. The sending time here is used to indicate one or more sending times of the first sending message, for example.
[0061] As an example, the bus board can use its own clock, or it can be connected to an external timing device to obtain a local clock via the external timing device.
[0062] For example, the external timing device can be selected from at least one of a GPS device, an RTK device, or a vehicle controller, etc., and is used to provide a clock source with a higher time accuracy than the Windows system clock to the bus board.
[0063] Please continue to refer to Figure 1-Figure 2 Since the clock accuracy of the message sending device 302 is higher than the Windows system clock accuracy of the host computer, by using the local clock of the message sending device 302 as the reference clock to send the message data, compared with using the Windows system clock of the host computer as the reference clock to send the message data, the sending time accuracy of the message data sent to the vehicle bus 400 is effectively improved, thereby ensuring the time stability of the vehicle bus 400 obtaining the message data, and avoiding the occurrence of events that affect the vehicle test results due to unstable time of sending signals to the vehicle bus 400.
[0064] In some embodiments, the message sending device includes a storage module, a control module and a transceiver module. The control module receives the first message data and configuration parameters and stores them in the storage module. The storage module is, for example, a cache or a register, and can store the first message data and configuration parameters. The control module can configure the parameters to send the first message data to the vehicle bus via the transceiver module. For example, the configuration parameters include a cycle interval or a transmission frequency, and a transmission time period or a number of cycles or a transmission end time. After starting to send, the control module sends the first message data to the vehicle bus according to the configuration parameters. For example, the cycle interval is 10ms, and the number of cycles is 20 times. After starting to send, the control module will send the first message data to the vehicle bus every 10ms according to the local actual interval, until it is sent 20 times in total.
[0065] Please refer to Figure 3 In some embodiments, the bus testing device 300 further includes a host computer 304, which is connected to at least one message sending device 302 and is used to obtain message data to be sent by at least one message sending device 302 and configuration parameters of the message data to be sent.
[0066] For example, please continue to refer to Figure 3 , the host computer 304 is connected to one or more message sending devices 302, and the host computer 304 can control the message sending of each message sending device 302 respectively; a message sending device 302 includes at least one channel for connecting to the vehicle bus 400, and the host computer 304 can obtain the message data to be sent and its configuration parameters, and configure the message data to be sent to be sent through at least one channel of at least one message sending device 302. Therefore, based on the host computer 304 connected to multiple message sending devices 302, multiple message sending devices 302 are controlled in batches to send test data to the vehicle bus 400, so as to realize multi-channel testing and improve test efficiency.
[0067] In some embodiments, the message sending device 302 includes at least one CAN / CANFD bus channel, at least one LIN bus channel, and at least one flexray bus channel. The host computer obtains the message data to be sent and its configuration parameters. For multiple message data to be sent, one or more bus channels of one or more message sending devices 302 are specified to send bus messages, and the sending of each channel of each message sending device 302 is controlled according to the configuration parameters of the message data to be sent.
[0068] Please refer to Figure 4 In some embodiments, in step S201, after the host computer obtains the mode parameters of the message data to be sent, the mode parameters are at least used to determine the sending mode of the message data to be sent; the host computer is configured to perform the following steps:
[0069] Step S202: if the mode parameter is the first mode parameter, obtaining first message data based on the message data to be sent, and controlling the message sending device to execute steps in the first working state;
[0070] Step S204: If the mode parameter is the second mode parameter, the second message data is obtained based on the message data to be sent, the second message data is sent to the message sending device according to the configuration parameters and the system clock of the host computer, and the message sending device is controlled to execute the steps in the second working state; wherein, the steps in the second working state executed by the message sending device include: receiving and forwarding the second message data sent by the host computer to the vehicle bus.
[0071] As an example, please refer to Figure 4 , provides the following two message data sending modes: Mode 1, executing the steps in the aforementioned first working state via the message sending device; Mode 2, receiving and forwarding the second message data sent by the host computer to the vehicle bus via the message sending device. It realizes intelligent selection of mode 1 or mode 2 according to the mode parameters, which is more convenient and flexible to use and meets the actual functional requirements of various different application scenarios.
[0072] In mode 1, the message sending device sends the first message data to the vehicle body bus according to the configuration parameters and the local clock of the message sending device. In this mode, since the local clock of the message sending device is used to send the message, the time accuracy is higher than that of mode 2. However, when modifying the message data or configuration parameters, it is necessary to modify them in the upper computer and then synchronize them to the message sending device, and the message sending device sends them according to the new content. If the message data or configuration parameters need to be modified frequently, for example, the content of the message data or configuration parameters will be adjusted according to the feedback information of the vehicle bus, there will be a problem of slow response, and the message sending device needs to frequently modify the message data and the configuration parameters sent, which is easy to cause configuration errors and affect the normal operation of the device;
[0073] In mode 2, the host computer sends the second message data to the message sending device according to the configuration parameters and the system clock of the host computer, and the message sending device only performs forwarding operations. In this mode, since the system clock of the host computer is used to send the message, the time accuracy is lower than that of mode 1. However, it is easier to adjust the message data and configuration parameters to be sent.
[0074] When using the bus test device, for each message data to be sent, its mode parameters can be configured separately to determine the sending mode of each message. For example, after the user determines the mode parameters of each message data to be sent, the message data to be sent and its configuration parameters and mode parameters are sent to the host computer; for example, after the host computer obtains the message data to be sent and its configuration parameters, the user manually determines the mode parameters of each message data to be sent on the host computer software interface. For example, the first mode parameter or the second mode parameter is set as the default mode parameter, and the mode parameters of each message data to be sent are configured as the default mode parameters, and the user can manually modify the mode parameters of the message data to be sent from the default mode parameters to another mode parameter.
[0075] Please refer to Figure 5 In some embodiments, the host computer is further configured to perform the following steps of obtaining mode parameters:
[0076] Step S2012: if the message data to be sent is a first type of message, determining that the mode parameter of the message data to be sent is a first mode parameter;
[0077] Step S2015: If the message data to be sent is a second type message, determine that the mode parameter of the message data to be sent is a second mode parameter; wherein the probability of the first type message being modified is less than the probability of the second type message being modified.
[0078] For example, a stability parameter can be set in the message parameters, and the stability parameter is used to indicate the probability of the message being modified. For example, the stability parameter can be a numerical value, and the size of the numerical value indicates the size of the probability of the message being modified; the stability parameter can be a state, including stable or frequently modified; if the probability of the message being modified is small, mode one can be selected, and if the probability of the message being modified is large, mode two can be selected.
[0079] Specifically, for the message data to be sent with a high probability of modification, the message data and configuration parameters may be modified and need to be modified immediately. If the message data is sent using mode 1, the message sending device may frequently obtain new message data and configuration parameters and continuously send new message data according to the new configuration parameters. On the one hand, the changes made to the message data and configuration parameters cannot be fed back to the message sending device immediately. On the other hand, the message sending device will be frequently modified, which is prone to errors. For the message data to be sent with a low probability of modification, the message data and configuration parameters generally remain unchanged for a long time, and the number of modifications and the frequency of modification are low. After the message sending device obtains the message data and configuration parameters, they can remain unchanged for a long time, and the stability is good. Therefore, by setting the modification probability of the message data to be sent, it is automatically switched to a matching working mode to improve the intelligence and accuracy of message data sending.
[0080] In some embodiments, the stabilization parameters are obtained by setting by the user.
[0081] Please refer to Figure 6 In some embodiments, the host computer is further configured to perform the following steps of obtaining mode parameters:
[0082] Step S2013: if the message data to be sent is a third type message, determining that the mode parameter of the message data to be sent is a first mode parameter;
[0083] Step S2016: If the message data to be sent is a fourth type of message, determine that the mode parameter of the message data to be sent is a second mode parameter; wherein, in the historical sending records of the third type of messages, the number of times the mode parameter is the first mode parameter is greater than the number of times the mode parameter is the second mode parameter, and in the historical sending records of the fourth type of messages, the number of times the mode parameter is the first mode parameter is less than the number of times the mode parameter is the second mode parameter.
[0084] For example, message data can be used to simulate signals, such as simulating ECU control signals or simulating sensor signals. Different message data are used to simulate different signals. Different signals often select different mode parameters due to their different properties. For example, for message data simulating vehicle speed signals, the value of the message data needs to be modified frequently and is generally set to the second mode parameter. For message data simulating the power-on state, the value of the message data remains basically unchanged and is generally set to the first mode parameter. Therefore, for a message data, the historical message sending record can be obtained according to the signal it simulates, and the number of times or the proportion of the mode parameter being the first mode parameter or the second mode parameter in the historical message sending record can be automatically switched to the mode parameter with a higher proportion, thereby realizing intelligent matching of the appropriate working mode according to the historical sending record of message data simulating different types of signals, thereby improving the intelligence and accuracy of message data sending.
[0085] Please refer to Figure 7 In some embodiments, the configuration parameters include a cycle parameter, and the cycle parameter is at least used to determine the transmission time difference between two transmissions of the message data to be transmitted; the host computer is further configured to perform the following steps to obtain the mode parameters:
[0086] Step S2014: if the message data to be sent is a message of the fifth type, determining that the mode parameter of the message data to be sent is a first mode parameter;
[0087] Step S2017: If the message data to be sent is a sixth type message, determine that the mode parameter of the message data to be sent is a second mode parameter; wherein the sending time difference between two sendings of the fifth type message is less than the sending time difference between two sendings of the sixth type message.
[0088] For example, the cycle parameters may include the cycle interval or cycle frequency, as well as the number of cycles or the start time and end time of the message data transmission, the cycle interval is the transmission time difference between two adjacent transmissions of the message data; the mode parameter can be determined based on the transmission time difference between two adjacent messages, and the mode one or mode two is automatically selected based on the transmission time difference between two adjacent messages, so that for messages with a small transmission time difference between two adjacent messages, such as 1ms, the requirement for time accuracy is relatively high, and mode one is selected; for messages with a large transmission time difference between two adjacent messages, such as 1000ms, the requirement for time accuracy is relatively low, and mode two is selected. By intelligently matching the appropriate working mode based on the transmission time difference between the two transmissions of the message data to be sent, the intelligence and accuracy of message data transmission are improved.
[0089] It is understandable that when the amount of message data is large, the buffering capacity and sending capacity of the message sending device are limited. Therefore, when determining the mode parameters, the message data with a small modification probability, a small sending time difference, and a large proportion of the first mode parameters in the historical sending records are preferentially set as the first mode parameters. Specifically, in some embodiments, the configuration parameters include a loop parameter, and the loop parameter is at least used to determine the sending time difference between two sendings of the message data to be sent; the host computer is also configured to perform the following steps to obtain the mode parameters:
[0090] If the message data to be sent is a first type of message, determining that the mode parameter of the message data to be sent is a first mode parameter;
[0091] If the message data to be sent is a second type message and a fifth type message, and the number of message data to be sent whose mode parameter is a first mode parameter in the bus test device is lower than a preset first threshold, it is determined that the mode parameter of the message data to be sent is the first mode parameter;
[0092] If the message data to be sent is a second type message, a sixth type message, or a third type message, and the number of message data to be sent whose mode parameter in the bus test device is a first mode parameter is lower than a preset second threshold, it is determined that the mode parameter of the message data to be sent is the first mode parameter;
[0093] Otherwise, it is determined that the mode parameter of the message data to be sent is the second mode parameter.
[0094] The values of the first threshold and the second threshold can be preset according to the number of message sending devices, the number of channels of the message sending devices, the cache and performance of the message sending devices, etc. The mode parameters are determined according to the sending capability of the message sending devices by comprehensively considering the stability parameters, the sending time difference of the messages, and the historical message sending records, thereby ensuring the sending performance of the message sending devices and thus ensuring the stability of message data sending.
[0095] In some embodiments, the host computer is further configured to perform the following steps:
[0096] Step S2002: Acquire target model data and the current model type of the message sending device; the target model data includes a target model type for indicating that the message sending device supports the first working state;
[0097] Step S2004: If the current model type is the same as a target model type in the target model data, it is determined that the message sending device has the function of executing the steps in the first working state.
[0098] For example, after determining that the current message sending device supports the first working state based on the current model type of the current message sending device, the current message sending device is controlled to execute the steps in the first working state to avoid failure of working mode control and affect the time accuracy of message data sending.
[0099] It can be understood that after the upper computer determines that the message sending device has the function of executing the steps in the first working state, it can determine that the mode parameters of the message data to be sent are the first mode parameters or the second mode parameters. After the upper computer determines that the message sending device does not have the function of executing the steps in the first working state, the mode parameters of all message data to be sent are the second mode parameters.
[0100] In some embodiments, the configuration parameters include a start transmission time and a cycle parameter, the cycle parameter is at least used to determine a transmission time difference between two transmissions of the first message data, and the steps in the message sending device executing the first working state include:
[0101] Step S1022: obtaining first message data and configuration parameters; the configuration parameters include a start sending time and a cycle parameter, and the cycle parameter is at least used to determine a sending time difference between two sendings of the first message data;
[0102] Step S1042: Send the first message data to the vehicle bus according to the start sending time and the cycle parameters and the local clock of the message sending device.
[0103] For example, by setting the start sending time in the configuration parameters, the sending time of the message data can be flexibly adjusted to achieve scheduled sending or immediate sending, thereby improving the flexibility of message data sending.
[0104] In some embodiments, the configuration parameters include a start sending time and a cycle parameter, and the cycle parameter is at least used to determine the sending time difference between two sendings of the second message data. The host computer is configured to: if the mode parameter is a second mode parameter, obtain the second message data based on the message data to be sent, send the second message data to the message sending device according to the start sending time and the cycle parameter and the system clock of the host computer, and control the message sending device to execute steps in the second working state; wherein, the message sending device executes the steps in the second working state including: receiving and forwarding the second message data sent by the host computer to the vehicle bus.
[0105] In some embodiments, the configuration parameters of a message data include a custom name (Custom Name), a signal name to be simulated (Name), message parameters, trigger parameters, loop parameters, etc. The loop parameters are at least used to determine the sending time difference between two sendings of the message data to be sent; the message parameters may include: code (ID), channel (Channel), data length code (DLC), type (type), etc. The code is used to distinguish different message data, the channel is used to indicate the message sending device and channel used for sending the message data, the data length code is used to indicate the number of bits of the message data, and the type is used to indicate the bus protocol type of the message data; the trigger parameters may include: sending time (Sent) and trigger key value (Key), etc. The sending time is used to indicate the start time of sending, including immediate sending and scheduled sending, the trigger key value is used to indicate how to give a sending instruction, and the loop parameters include a loop interval and a number of loops. The host computer obtains the message data to be sent by adding a new frame or adding a blank frame. Adding a new frame can be done by selecting a frame of message data in a data file such as DBC, LDF, Arxml, etc. and importing it into the host computer; adding a blank frame can create a new, blank frame in the host computer software interface and edit its message content.
[0106] In some embodiments, a message data to be sent is obtained in the upper computer software interface, the custom name is Frame-1, the signal name to be simulated is EPBi_3FA, the ID in the message parameter is 0x1 (hexadecimal), the channel is CAN1, the DLC (data length code) is 8, the type is CAN, the value of the sending time in the trigger parameter is Now, indicating immediate sending, the trigger key value is set to K, indicating that clicking the key K is to start sending instructions, the cycle interval is set to 500ms (the time interval for sending signals is 500ms), the number of cycles is infinite (the signal is sent until the stop signal sending instruction is received), and the mode parameter is configured as the second mode parameter. Since the mode parameter is the second mode parameter, when the user presses the key K on the computer keyboard, the start sending instruction is given. According to the start sending time, Frame-1 is continuously sent to the vehicle bus by the upper computer until it stops sending. The custom name of the second message data to be sent is Frame-2, the signal name to be simulated is VCU_2FC, the ID in the relevant configuration parameters is 0x1, the mode parameter is configured as the first mode parameter, and the other configuration parameters are the same as the first message data. Since the mode parameter is the first mode parameter, Frame-2, the start sending time and the cycle parameter are sent to the message sending device. When the user presses the K key on the computer keyboard to give the start sending instruction, the message sending device continuously sends Frame-2 to the vehicle bus until it stops sending.
[0107] In some embodiments, if multiple first message data or multiple second message data need to be sent at the same time, for example, the start sending time of two message data is the same, or both message data are sent cyclically with different cycle intervals, but are sent simultaneously at regular intervals, multiple message frames can be sent to the vehicle bus in sequence according to the priority order of the multiple message frames (for example, ID value).
[0108] In some embodiments, the message sending device performs the steps in the first working state including:
[0109] Step S1024: obtaining first message data and configuration parameters; the configuration parameters include cycle parameters, and the cycle parameters are at least used to determine a sending time difference between two sendings of the first message data;
[0110] Step S1044: responding to a sending instruction, the sending instruction is at least used to determine a start time for sending, and sending the first message data to the vehicle bus according to the start time for sending and the cycle parameters, as well as the local clock of the message sending device.
[0111] For example, the sending instruction may be set to include a sending mode such as immediate sending or scheduled sending, so that the sending time of the message data can be flexibly adjusted according to the sending mode of the sending instruction.
[0112] In some embodiments, the configuration parameters include a cycle parameter, and the cycle parameter is at least used to determine the sending time difference between two sendings of the second message data. The host computer is configured to: if the mode parameter is the second mode parameter, obtain the second message data based on the message data to be sent, respond to the sending instruction, and the sending instruction is at least used to determine the start sending time, send the second message data to the message sending device according to the start sending time and the cycle parameter and the system clock of the host computer, and control the message sending device to execute the steps in the second working state; wherein, the steps in the second working state executed by the message sending device include: receiving and forwarding the second message data sent by the host computer to the vehicle bus.
[0113] In some embodiments, the configuration parameters include a loop interval and a loop count; the host computer is configured to perform the following steps:
[0114] Step S2062: If the mode parameter is the second mode parameter, before receiving the end transmission instruction, detecting whether a message frame modification instruction is received;
[0115] Step S2064: If yes, in response to the message modification instruction, obtain the modified configuration parameters and / or the second message data, and send the second message data to the message sending device according to the system clock of the host computer and the modified configuration parameters and / or the second message data.
[0116] In some embodiments, the configuration parameters include a loop interval and a loop count; the host computer is configured to perform the following steps:
[0117] If the mode parameter is the first mode parameter, before receiving the end sending instruction, detecting whether a message frame modification instruction is received;
[0118] If so, in response to the message modification instruction, the modified configuration parameters and / or the first message data are obtained and the modified configuration parameters and / or the first message data are sent to the message sending device, and the message sending device sends the first message data to the vehicle bus based on the local clock and the modified configuration parameters and / or the first message data.
[0119] Please refer to Figure 8 In some embodiments, another aspect of the present application provides a bus testing method, comprising the following steps:
[0120] Step S302: acquiring first message data and configuration parameters based on the message sending device, where the configuration parameters are at least used to determine a sending time of the first message data;
[0121] Step S304: Based on the configuration parameters of the message sending device and the local clock of the message sending device, the first message data is sent to the vehicle bus.
[0122] For example, since the clock accuracy of the message sending device is higher than that of the host computer, by using the local clock of the message sending device as the reference clock to send the message data, the sending time accuracy of the message data sent to the vehicle bus is effectively improved compared to using the clock of the host computer as the reference clock to send the message data, thereby ensuring the time stability of the vehicle bus in obtaining the message data and avoiding the occurrence of events that affect the vehicle test results due to unstable time of sending signals to the vehicle bus.
[0123] It should be understood that although Figure 2 , Figure 4-Figure 8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, although Figure 2 , Figure 4-Figure 8 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0124] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0125] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0126] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A bus testing device, characterized in that: include: Host computer; The message sending device is used to connect the vehicle bus and the host computer, and is configured to at least perform the following steps in the first working state: Acquire first message data and configuration parameters from a host computer, wherein the configuration parameters are at least used to determine a sending time of the first message data; the first message data includes test data or the first message data is used to simulate a signal; the sending time is at least used to indicate one or more sending times of the first message data; sending the first message data to the module to be tested on the vehicle bus according to the configuration parameters and the local clock of the message sending device; The host computer is connected to at least one of the message sending devices and is used to obtain message data and configuration parameters to be sent by the at least one message sending device of the user.
2. The bus testing device according to claim 1, characterized in that: The host computer is connected to a plurality of the message sending devices and is used to control the plurality of the message sending devices in parallel to send test data to the vehicle bus.
3. The bus testing device according to claim 1, characterized in that: The host computer is also used to obtain mode parameters of the message data to be sent, and the mode parameters are at least used to determine the sending mode of the message data to be sent; the host computer is configured as follows: If the mode parameter is the first mode parameter, obtaining first message data based on the message data to be sent, and controlling the message sending device to execute the steps in the first working state; If the mode parameter is a second mode parameter, obtaining second message data based on the message data to be sent, sending the second message data to the message sending device according to the configuration parameter and the system clock of the host computer, and controlling the message sending device to execute steps in the second working state; The steps of executing the second working state of the message sending device include: Receive and forward the second message data sent by the host computer to the vehicle bus.
4. The bus testing device according to claim 3, characterized in that: The host computer is also configured to perform the following steps to obtain mode parameters: If the message data to be sent is a first type of message, determining that the mode parameter of the message data to be sent is a first mode parameter; If the message data to be sent is a second type message, the mode parameter of the message data to be sent is determined to be a second mode parameter; wherein the probability of the first type message being modified is less than the probability of the second type message being modified.
5. The bus testing device according to claim 3, characterized in that: The host computer is also configured to perform the following steps to obtain mode parameters: If the message data to be sent is a message of the third type, determining that the mode parameter of the message data to be sent is the first mode parameter; If the message data to be sent is a fourth type of message, it is determined that the mode parameter of the message data to be sent is the second mode parameter; wherein, in the historical sending record of the third type of message, the number of times the mode parameter is the first mode parameter is greater than the number of times the mode parameter is the second mode parameter, and the number of times the mode parameter is the first mode parameter in the historical sending record of the fourth type of message is less than the number of times the mode parameter is the second mode parameter.
6. The bus testing device according to claim 3, characterized in that: The configuration parameters include a cycle parameter, and the cycle parameter is at least used to determine the transmission time difference between two transmissions of the message data to be transmitted; the host computer is also configured to perform the following steps to obtain the mode parameters: If the message data to be sent is a message of the fifth type, determining that the mode parameter of the message data to be sent is the first mode parameter; If the message data to be sent is a sixth type message, the mode parameter of the message data to be sent is determined to be a second mode parameter; wherein the sending time difference between two sendings of the fifth type message is smaller than the sending time difference between two sendings of the sixth type message.
7. The bus testing device according to claim 3, characterized in that: The host computer is also configured as follows: Acquire target model data and a current model type of the message sending device; the target model data includes a target model type for indicating that the message sending device supports the first working state; If the current model type is the same as a target model type in the target model data, it is determined that the message sending device has the function of executing the steps in the first working state.
8. The bus testing device according to claim 1, characterized in that: The configuration parameters include a start sending time and a cycle parameter, and the cycle parameter is at least used to determine a sending time difference between two sendings of the first message data. The steps in the first working state executed by the message sending device include: Obtaining first message data and configuration parameters; The first message data is sent to the vehicle bus according to the start sending time, the cycle parameters and the local clock of the message sending device.
9. The bus testing device according to claim 1, characterized in that: The configuration parameters include a cycle parameter, and the cycle parameter is at least used to determine a sending time difference between two sendings of the first message data. The message sending device performs the steps in the first working state including: Obtaining first message data and configuration parameters; In response to a sending instruction, the sending instruction is at least used to determine a start sending time, and the first message data is sent to the vehicle bus according to the start sending time and the cycle parameter, and a local clock of the message sending device.
10. A bus testing method, characterized in that: include: Acquire first message data and configuration parameters from a host computer based on a message sending device, wherein the configuration parameters are at least used to determine a sending timing of the first message data; The first message data includes test data or the first message data is used for simulating a signal; the sending timing is at least used to indicate one or more sending times of the first message data; the host computer is connected to at least one of the message sending devices, and is used to obtain the message data to be sent by the at least one message sending device of the user and its configuration parameters; Based on the configuration parameters and the local clock of the message sending device, the first message data is sent to the module to be tested on the vehicle bus.
Citation Information
Patent Citations
Vehicle-mounted TSN clock synchronization error test method
CN116015520A
Message sending method, device and equipment
CN116582387A