Disclosure of Invention
Accordingly, in order to solve the above-mentioned problems in the related art, 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, so as to improve the accuracy of automobile testing.
According to various embodiments of the present application, an aspect of the present application provides a bus testing apparatus comprising a message sending device for connecting to a bus of a vehicle, the message sending device being configured to perform at least the following steps in a first operating state:
Acquiring first message data and configuration parameters, wherein the configuration parameters are at least used for determining the sending time of the first message data;
And sending the first message data to the vehicle bus according to the configuration parameters and the local clock of the message sending equipment.
In the bus test device in the above embodiment, since the clock precision of the message sending device is higher than that of the upper computer, the local clock of the message sending device is used as the reference clock to send the message data, and compared with the case that the clock of the upper computer is used as the reference clock to send the message data, the time precision of sending the message data to the vehicle bus is effectively improved, thereby ensuring the time stability of the vehicle bus for obtaining the message data and avoiding the occurrence of the event affecting the vehicle test result due to the unstable time of sending the signal to the vehicle bus.
In some embodiments, the bus testing apparatus further includes a host computer, where the host computer is connected to at least one message sending device, and is configured to obtain message data to be sent by the at least one message sending device and configuration parameters thereof. The upper computer is connected with one or more message sending devices and can respectively control the message sending of each message sending device; the upper computer can acquire the message data to be transmitted and the configuration parameters thereof, and the message data to be transmitted is configured to be transmitted through at least one channel of the at least one message transmitting device. Therefore, based on the upper computer connected with the message sending devices, the message sending devices can be controlled in batches to send test data to the vehicle bus, so that multichannel test is realized.
In some embodiments, the upper computer is further configured to obtain a mode parameter of the message data to be sent, where the mode parameter is at least used to determine a sending mode of the message data to be sent; the upper computer is configured to:
if the mode parameter is the first mode parameter, acquiring first message data based on the message data to be sent, and controlling the message sending equipment to execute the steps in the first working state;
If the mode parameter is the second mode parameter, acquiring second message data based on the message data to be transmitted, transmitting the second message data to the message transmitting equipment according to the configuration parameter and the system clock of the upper computer, and controlling the message transmitting equipment to execute the steps in the second working state; the step of the message sending device executing the second working state comprises the following steps: and receiving and forwarding second message data sent by the upper computer to the vehicle bus.
In the bus test apparatus in the above embodiment, the following two message data transmission modes are provided: mode one, executing the step in the first working state through the message sending equipment; and in the second mode, the second message data sent by the upper computer is received and forwarded to the vehicle bus through the message sending equipment. The mode one or the mode two is selected according to the mode parameters, the use is more convenient and flexible, and the actual functional requirements of various different application scenes are met.
In some embodiments, the host computer is further configured to perform the step of obtaining the mode parameters as follows:
if the message data to be sent is a first type message, judging that the mode parameter of the message data to be sent is a first mode parameter;
If the message data to be sent is the second type message, judging that the mode parameter of the message data to be sent is the second mode parameter; wherein the probability of the first type of message being modified is less than the probability of the second type of message being modified.
In the bus test device in the above embodiment, for the message data to be sent with higher modification probability, since the message data may be frequently modified, the modification needs to be responded immediately; and for the message data to be transmitted with lower modification probability, the modification times and the modification frequency are lower. Therefore, the method automatically switches to a matched working mode by setting the modification probability according to the message data to be sent, and the intelligence and the accuracy of the message data sending are improved.
In some embodiments, the host computer is further configured to perform the step of obtaining the mode parameters as follows:
if the message data to be sent is the third type message, judging that the mode parameter of the message data to be sent is the first mode parameter;
If the message data to be sent is the fourth type message, judging that the mode parameter of the message data to be sent is the second mode parameter; the number of times that the mode parameter is the first mode parameter in the history sending record of the third type message is larger than the number of times that the mode parameter is the second mode parameter, and the number of times that the mode parameter is the first mode parameter in the history sending record of the fourth type message is smaller than the number of times that the mode parameter is the second mode parameter.
In the bus test device in the above embodiment, the number of times of switching to the mode parameter with higher frequency occupation ratio is automatically switched according to the number of times that the mode parameter is the first mode parameter or the second mode parameter in the history sending records of the messages of different types, so that the appropriate working mode is intelligently matched according to the history sending records of the messages of different types, and the intelligence and the accuracy of the data sending of the messages are improved.
In some embodiments, the configuration parameters include a cycle parameter that is used at least to determine a transmission time difference between two transmissions of the message data to be transmitted; the upper computer is further configured to perform the steps of obtaining the mode parameters as follows:
If the message data to be sent is a fifth type message, judging 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 sixth type message, judging that the mode parameter of the message data to be sent is a second mode parameter; the sending time difference of the two sending of the fifth type message is smaller than the sending time difference of the two sending of the sixth type message.
In the bus test device in the above embodiment, for the to-be-transmitted message data with smaller transmission time difference, the requirement on the transmission time precision is higher, for the to-be-transmitted message data with larger transmission time difference, the requirement on the transmission time precision is slightly lower, and by intelligently matching the proper working mode according to the transmission time difference of two transmissions of the to-be-transmitted message data, the intelligence and the precision of the transmission of the message data are improved.
In some embodiments, the host computer is further configured to: obtaining target model data and the current model type of the message sending equipment; the target model data comprises a target model type used for indicating the message sending equipment to support the first working state;
If the current model type is the same as a target model type in the target model data, the message sending equipment is judged to have the function of executing the steps in the first working state.
In the bus testing apparatus in the above embodiment, after determining that the current message sending device supports the first working state according to the current model type of the current message sending device, the current message sending device is controlled to execute the step in the first working state, so as to avoid failure in control of the working mode and influence on time accuracy of sending the message data.
In some embodiments, the configuration parameters include a start transmission time and a cycle parameter, the cycle parameter being at least used to determine a transmission time difference between two transmissions of the first message data, and the steps in the message transmission device performing the first working state include:
acquiring first message data and configuration parameters;
And transmitting the first message data to the vehicle bus according to the starting transmission time and the circulation parameter and the local clock of the message transmitting equipment.
In the bus test device in the above embodiment, the sending time of the message data is flexibly adjusted by setting the sending start time in the configuration parameter, so as to improve the flexibility of sending the message data.
In some embodiments, the configuration parameters include a cycle parameter, where the cycle parameter is at least used to determine a transmission time difference between two transmissions of the first message data, and the step of the message transmission device performing the first working state includes:
acquiring first message data and configuration parameters;
and responding to the sending instruction, wherein the sending instruction is at least used for determining the starting sending time, and sending the first message data to the vehicle bus according to the starting sending time and the circulation parameter and the local clock of the message sending equipment.
In the bus test apparatus in the above embodiment, the transmission instruction may be set to include a transmission mode such as immediate transmission or timing transmission, so that the transmission time of the message data may be flexibly adjusted according to the transmission mode of the transmission instruction.
In some embodiments, another aspect of the present application provides a bus testing method, comprising:
based on the message sending equipment, acquiring first message data and configuration parameters, wherein the configuration parameters are at least used for determining the sending moment of the first message data;
and based on the message sending equipment, sending the first message data to the vehicle bus according to the configuration parameters and the local clock of the message sending equipment.
In the bus test method in the above embodiment, since the clock precision of the message sending device is higher than that of the upper computer, the local clock of the message sending device is used as the reference clock to send the message data, and compared with the case that the clock of the upper computer is used as the reference clock to send the message data, the sending time precision of sending the message data to the vehicle bus is effectively improved, thereby ensuring the time stability of obtaining the message data by the vehicle bus and avoiding the occurrence of the event that the vehicle test result is influenced due to the unstable time of sending the signal to the vehicle bus.
Detailed Description
In order that the application may be readily understood, a more complete description of the application will be rendered by reference to the appended drawings. Preferred embodiments of the present application are shown in the drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
Where the terms "comprising," "having," and "including" are used herein, another component may also be added unless a specifically defined term is used, such as "consisting of only," "… …," etc. Unless mentioned to the contrary, singular terms may include plural and are not to be construed as being one in number.
It will 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 could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the present application.
In the description of the present application, it should be noted that, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; the connection may be direct or indirect via an intermediate medium, or may be internal communication between two components. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art.
In bus simulation, test and diagnosis for a vehicle, a module to be tested is a vehicle electronic controller (Electronic Control Unit, ECU) or a sensor, upper computer software runs on various terminals, and a target simulation signal determined by an upper computer can be used for simulating an output signal of the electronic controller or the sensor in the vehicle so as to test the module to be tested. However, for the simulation signal sent in a circulating way, for example, the simulation signal is sent once in 1ms, because the time accuracy of the Windows system of the upper computer is not high, the time interval of the simulation signal output by the upper computer is not 1ms, for example, part of the time interval is 0.9ms or 1.1ms, and the like, so that the time interval of the simulation signal sent to the bus of the vehicle is unstable, and the accuracy and reliability of the test result are affected.
Based on the above, the 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 so as to improve the accuracy of automobile testing.
Referring to fig. 1-2, in some embodiments of the present application, a bus testing apparatus 300 is provided, including a message sending device 302 for connecting to a vehicle bus 400, where the message sending device 302 is configured to perform at least the following steps in a first operating state:
Step S102: acquiring first message data and configuration parameters, wherein the configuration parameters are at least used for determining the sending time of the first message data;
Step S104: and sending the first message data to the vehicle bus according to the configuration parameters and the local clock of the message sending equipment.
As an example, the message sending device 302 is a bus board card, where the bus board card is used to connect an upper computer and a bus system of a vehicle, and is responsible for transferring information between the two, and the upper computer may send a target simulation signal to the bus board card, where the bus board card as a node accesses the vehicle bus and communicates with other nodes on the vehicle bus, so as to send the target simulation signal to a module to be tested on the vehicle bus. After the bus board card obtains the configuration parameters, the sending time of the first message data can be determined according to the configuration parameters, and the obtained first message data is sent to the vehicle bus based on the local clock of the bus board card, where the sending time is used for indicating one or more sending times of the first sending message.
As an example, the bus board card may use its own clock, or may be connected to an external time service device, and obtain a local clock through time service of the external time service device.
For example, the external time service device may be at least one selected from a GPS device, an RTK device, a vehicle controller, or the like, and is configured to provide a clock source with time precision higher than that of the Windows system clock to the bus board card.
With continued reference to fig. 1-2, since the clock precision of the message sending device 302 is higher than the Windows system clock precision of the host computer, the local clock of the message sending device 302 is used as the reference clock to send the message data, so that the sending time precision of sending the message data to the vehicle bus 400 is effectively improved, the time stability of the vehicle bus 400 for obtaining the message data is ensured, and the event that the vehicle test result is affected due to the unstable time of sending the signal to the vehicle bus 400 is avoided.
In some embodiments, the message sending device includes a storage module, a control module, and a transceiver module, where the control module receives the first message data and the configuration parameters, and stores the first message data and the configuration parameters in the storage module, and the storage module may store the first message data and the configuration parameters, and the control module may send the first message data to the vehicle bus through the transceiver module by using the configuration parameters. For example, the configuration parameters include a cycle interval or a transmission frequency, and a transmission time period or a cycle number or a transmission end time, after starting transmission, the control module transmits the first message data to the vehicle bus according to the configuration parameters, for example, the cycle interval is 10ms, the cycle number is 20, and after starting transmission, the control module transmits the first message data to the vehicle bus once every 10ms in real intervals locally until 20 times are accumulated.
Referring to fig. 3, in some embodiments, the bus testing apparatus 300 further includes a host computer 304, where the host computer 304 is connected to at least one message sending device 302, and is configured to obtain message data to be sent by the at least one message sending device 302 and configuration parameters of the message data to be sent.
For example, with continued reference to fig. 3, the upper computer 304 is connected to one or more message sending devices 302, and the upper computer 304 can respectively control the message sending of each message sending device 302; one message sending device 302 includes at least one channel for connecting to the vehicle bus 400, and the host computer 304 may obtain the message data to be sent and the configuration parameters thereof, and configure the message data to be sent through at least one channel of the at least one message sending device 302. Thus, based on the upper computer 304 connected to each of the plurality of message sending devices 302, the plurality of message sending devices 302 are controlled in batch to send test data to the vehicle bus 400, so as to realize multi-channel testing, and improve the testing efficiency.
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, and the host obtains the message data to be sent and the configuration parameters thereof, specifies one or more bus channel bus messaging of one or more message sending devices 302 for a plurality of message data to be sent, and controls sending of each channel of each message sending device 302 according to the configuration parameters of the message data to be sent.
Referring to fig. 4, in some embodiments, the upper computer is further configured to obtain a mode parameter of the message data to be sent, where the mode parameter is at least used to determine a sending mode of the message data to be sent; the upper computer is configured to execute the following steps:
Step S202: if the mode parameter is the first mode parameter, acquiring first message data based on the message data to be sent, and controlling the message sending equipment to execute the steps in the first working state;
Step S204: if the mode parameter is the second mode parameter, acquiring second message data based on the message data to be transmitted, transmitting the second message data to the message transmitting equipment according to the configuration parameter and the system clock of the upper computer, and controlling the message transmitting equipment to execute the steps in the second working state; the step of the message sending device executing the second working state comprises the following steps: and receiving and forwarding second message data sent by the upper computer to the vehicle bus.
As an example, please continue to refer to fig. 4, two modes of message data transmission are provided: mode one, executing the steps in the first working state through the message sending equipment; and in the second mode, the second message data sent by the upper computer is received and forwarded to the vehicle bus through the message sending equipment. The mode I or the mode II is intelligently selected according to the mode parameters, the use is more convenient and flexible, and the actual functional requirements of various different application scenes are met.
In the mode, the message sending device sends the first message data to the bus body according to the configuration parameters and the local clock of the message sending device, in the mode, the time accuracy is higher than that of the mode two because the message sending device sends the message by using the local clock of the message sending device, but when the message data or the configuration parameters are modified, the message sending device needs to be synchronized to the message sending device after the modification is carried out on an upper computer, the message sending device sends the message according to new contents, if the message data or the configuration parameters need to be frequently modified, for example, the content of the message data or the configuration parameters can be regulated according to the feedback information of the bus body, the problem of slow response exists, and the message sending device needs to frequently modify the message data and the sent configuration parameters, so that the configuration errors are easy to be caused, and the normal operation of the device is influenced;
In the second mode, the upper computer sends the second message data to the message sending equipment according to the configuration parameters and the system clock of the upper computer, and the message sending equipment only carries out forwarding operation.
When the bus test device is used, for each message data to be transmitted, the mode parameters of the message data can be respectively configured to determine the transmission mode of each message. For example, after the user determines the mode parameter of each message data to be sent, the configuration parameters and the mode parameters of the message data to be sent are sent to the upper computer; for example, after the upper computer obtains the message data to be sent and the configuration parameters thereof, the user manually determines the mode parameters of each message data to be sent on the upper computer software interface. For example, the first mode parameter or the second mode parameter is set as a default mode parameter, the mode parameter of each message data to be sent is configured as a default mode parameter, and the user can manually modify the mode parameter of the message data to be sent from the default mode parameter to another mode parameter.
Referring to fig. 5, in some embodiments, the upper computer is further configured to perform the following steps of obtaining the mode parameters:
step S2012: if the message data to be sent is a first type message, judging that the mode parameter of the message data to be sent is a first mode parameter;
step S2015: if the message data to be sent is the second type message, judging that the mode parameter of the message data to be sent is the second mode parameter; wherein the probability of the first type of message being modified is less than the probability of the second type of message being modified.
For example, a stability parameter may be set in the message parameter, where the stability parameter is used to indicate a probability that the message is modified, for example, the stability parameter may be a numerical value, and the numerical value indicates a magnitude of the probability that the message is modified; the stability parameter may be a state, including stable constant or constantly modified; the probability of the message being modified is small, the mode one can be selected, the probability of the message being modified is large, and the mode two can be selected.
Specifically, for the message data to be sent with higher modification probability, the message data and the configuration parameters may be modified, and the modification needs to be responded immediately, if the first mode is used for sending, the message sending device may be caused to frequently acquire new message data and configuration parameters, and continuously send the new message data according to the new configuration parameters, firstly, the modification made by the message data and the configuration parameters cannot be fed back to the message sending device immediately, and secondly, the message sending device may be caused to frequently modify and easily generate errors; for the message data to be transmitted with low modification probability, the message data and the configuration parameters generally remain unchanged for a long time, the modification times and the modification frequency are low, and the message transmitting equipment can remain unchanged for a long time after acquiring the message data and the configuration parameters, so that the stability is good. Therefore, the method automatically switches to a matched working mode by setting the modification probability according to the message data to be sent, and the intelligence and the accuracy of the message data sending are improved.
In some embodiments, the stability parameters are obtained in a manner set by the user.
Referring to fig. 6, in some embodiments, the upper computer is further configured to perform the following steps of obtaining the mode parameters:
Step S2013: if the message data to be sent is the third type message, judging that the mode parameter of the message data to be sent is the first mode parameter;
Step S2016: if the message data to be sent is the fourth type message, judging that the mode parameter of the message data to be sent is the second mode parameter; the number of times that the mode parameter is the first mode parameter in the history sending record of the third type message is larger than the number of times that the mode parameter is the second mode parameter, and the number of times that the mode parameter is the first mode parameter in the history sending record of the fourth type message is smaller than the number of times that the mode parameter is the second mode parameter.
For example, the message data may be used for simulating signals, such as for simulating ECU control signals or for simulating sensor signals, different message data being used for simulating different signals, which due to their different properties often have different selected mode parameters. For example, for the message data simulating the vehicle speed signal, the value of the message data needs to be frequently modified, and is generally set as the second mode parameter, and for the message data simulating the power-on state, the value of the message data is basically unchanged, and is generally set as the first mode parameter. Therefore, for one message data, a history message sending record can be obtained according to the simulated signal, and the mode parameter is automatically switched to the mode parameter with higher frequency occupation ratio according to the frequency or occupation ratio of the first mode parameter or the second mode parameter in the history message sending record, so that the history sending record of the message data simulating different types of signals is realized, the proper working mode is intelligently matched, and the intelligence and the accuracy of the message data sending are improved.
Referring to fig. 7, in some embodiments, the configuration parameters include a cycle parameter, where the cycle parameter is at least used to determine a transmission time difference between two transmissions of the message data to be transmitted; the upper computer is further configured to perform the steps of obtaining the mode parameters as follows:
Step S2014: if the message data to be sent is a fifth type message, judging that the mode parameter of the message data to be sent is a first mode parameter;
Step S2017: if the message data to be sent is a sixth type message, judging that the mode parameter of the message data to be sent is a second mode parameter; the sending time difference of the two sending of the fifth type message is smaller than the sending time difference of the two sending of the sixth type message.
For example, the cycle parameter may include a cycle interval or a cycle frequency, and a cycle number or a transmission start time and an end time of the message data, where the cycle interval is a transmission time difference between two adjacent transmissions of the message data; the mode parameter can be determined according to the sending time difference of the two adjacent messages, and the mode one or the mode two is automatically selected according to the sending time difference of the two adjacent messages, so that the message with smaller sending time difference of the two adjacent messages, such as 1ms, has relatively higher requirement on time precision, and the mode one is selected; for the message with larger time difference between the sending of two adjacent messages, such as 1000ms, the requirement on time precision is relatively low, and the mode two is selected. According to the size of the sending time difference of the two sending times of the message data to be sent, the proper working mode is intelligently matched, and the intelligence and the accuracy of the sending of the message data are improved.
It can be understood that when the number of message data is large, the buffer capacity and the transmission capacity of the message transmitting device are limited, so when determining the mode parameter, the message data with small modification probability, small transmission time difference and relatively large first mode parameter in the history transmission record is preferentially set as the first mode parameter. Specifically, in some embodiments, the configuration parameters include a cycle parameter, where the cycle parameter is at least used to determine a transmission time difference between two transmissions of the message data to be transmitted; the upper computer is further configured to perform the steps of obtaining the mode parameters as follows:
if the message data to be sent is a first type message, judging that the mode parameter of the message data to be sent is a first mode parameter;
If the message data to be sent are the second type message and the fifth type message, and the number of the message data to be sent, of which the mode parameters are the first mode parameters, in the bus test device is lower than a preset first threshold value, judging that the mode parameters of the message data to be sent are the first mode parameters;
If the message data to be sent are a second type message, a sixth type message and a third type message, and the number of the message data to be sent, of which the mode parameters are first mode parameters, in the bus test device is lower than a preset second threshold value, judging that the mode parameters of the message data to be sent are first mode parameters;
otherwise, judging the mode parameter of the message data to be sent as a second mode parameter.
The values of the first threshold and the second threshold may be preset according to the number of the message sending devices, the number of channels of the message sending devices, the buffering and the performance of the message sending devices, and the like. The mode parameters are determined according to the transmission capacity of the message transmission equipment by integrating the stability parameters, the message transmission time difference and the historical message transmission record, so that the transmission performance of the message transmission equipment is ensured, and the stability of message data transmission is further ensured.
In some embodiments, the host computer is further configured to perform the steps of:
Step S2002: obtaining target model data and the current model type of the message sending equipment; the target model data comprises a target model type used for indicating the message sending equipment to support the first working state;
Step S2004: if the current model type is the same as a target model type in the target model data, the message sending equipment is judged to have the function of executing the steps in the first working state.
For example, after the current message sending device is determined to support the first working state according to the current model type of the current message sending device, the current message sending device is controlled to execute the step in the first working state, so that failure of control of the working mode is avoided, and time accuracy of message data sending is affected.
It can be understood that after the upper computer determines that the message sending device has the function of executing the step in the first working state, the mode parameter of the message data to be sent can be determined to be the first mode parameter or the second mode parameter, and after the upper computer determines that the message sending device does not have the function of executing the step in the first working state, all the mode parameters of the message data to be sent are the second mode parameter.
In some embodiments, the configuration parameters include a start transmission time and a cycle parameter, the cycle parameter being at least used to determine a transmission time difference between two transmissions of the first message data, and the steps in the message transmission device performing the first working state include:
Step S1022: acquiring first message data and configuration parameters; the configuration parameters comprise a starting transmission time and a circulation parameter, wherein the circulation parameter is at least used for determining a transmission time difference of two transmissions of the first message data;
Step S1042: and transmitting the first message data to the vehicle bus according to the starting transmission time and the circulation parameter and the local clock of the message transmitting equipment.
By setting the starting transmission time in the configuration parameters, the transmission time of the message data is flexibly adjusted, so that the timing transmission or the instant transmission is realized, and the flexibility of the message data transmission is improved.
In some embodiments, the configuration parameters include a start transmission time and a cycle parameter, the cycle parameter being used at least to determine a transmission time difference between two transmissions of the second message data, the host computer being configured to: if the mode parameter is the second mode parameter, acquiring second message data based on the message data to be transmitted, transmitting the second message data to the message transmitting equipment according to the starting transmission time and the circulation parameter and the system clock of the upper computer, and controlling the message transmitting equipment to execute the steps in the second working state; the step of the message sending device executing the second working state comprises the following steps: and receiving and forwarding second message data sent by the upper computer to the vehicle bus.
In some embodiments, the configuration parameters of one message data include a Custom Name (Custom Name), a signal Name (Name) to be emulated, a message parameter, a trigger parameter, a cycle parameter, and the like, where the cycle parameter is at least used to determine a transmission time difference between two transmissions of the message data to be transmitted; the message parameters may include: coding (ID), channel (Channel), data Length Code (DLC), type (type), etc., wherein the coding is used for distinguishing different message data, the Channel is used for indicating message sending equipment and Channel used for sending the message data, the data length code is used for indicating bit number of the message data, and the type is used for indicating bus protocol type of the message data; the trigger parameters may include: a transmission time (Sent) for indicating a start transmission time including instant transmission and timing transmission, a trigger Key value (Key) for indicating how to give a transmission instruction, and the like, and a cycle parameter including a cycle interval and a cycle number. The upper computer can add new frames or blank frames for obtaining the message data to be sent, and the new frames can be added by selecting one frame of message data from data files such as DBC, LDF, arxml and the like and importing the message data into the upper computer; adding a blank frame can create a new blank frame in the upper computer software interface and edit the message content.
In some embodiments, a message data to be sent is obtained in an 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, DLC (data length code) is 8, the type is CAN, the value of the sending time in the trigger parameter is Now, the instant sending is indicated, the trigger key value is set to K, the click key K is the start sending instruction, the cycle interval is set to 500ms (the time interval of sending the signal is 500 ms), the cycle number is infinite (the signal is always sent until the stop sending signal instruction is not received), and the mode parameter is configured as the second mode parameter. Because the mode parameter is the second mode parameter, when the user presses the key K on the computer keyboard, a command for starting to send is given, and according to the starting sending time, the Frame-1 is continuously sent to the vehicle bus by the upper computer until the sending is stopped. 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 related configuration parameters is 0x1, the mode parameters are configured as the first mode parameters, and other configuration parameters are the same as the first message data. Because the mode parameter is the first mode parameter, the Frame-2, the transmission starting time and the circulation parameter are transmitted to the message transmitting equipment, when the user presses the key K on the computer keyboard, a transmission starting instruction is given, and the message transmitting equipment continuously transmits the Frame-2 to the vehicle bus until transmission is stopped.
In some embodiments, if there are multiple first message data or multiple second message data to be sent at the same time, for example, the starting sending time of two message data is the same, or the two message data are all sent in a loop, and the loop intervals are different, but the two message data are sent at the same time at intervals, and multiple message frames may be sequentially sent to the vehicle bus according to the order of priority levels (for example, ID values) of the multiple message frames.
In some embodiments, the step of the messaging device performing the first operating state includes:
Step S1024: acquiring first message data and configuration parameters; the configuration parameters comprise circulation parameters which are at least used for determining the sending time difference of the two sending of the first message data;
Step S1044: and responding to the sending instruction, wherein the sending instruction is at least used for determining the starting sending time, and sending the first message data to the vehicle bus according to the starting sending time and the circulation parameter and the local clock of the message sending equipment.
For example, the transmission instruction may be configured to include a transmission mode such as immediate transmission or timing transmission, so that the transmission time of the message data is flexibly adjusted according to the transmission mode of the transmission instruction.
In some embodiments, the configuration parameters include a cycle parameter, the cycle parameter being used at least to determine a transmission time difference between two transmissions of the second message data, the upper computer being configured to: if the mode parameter is the second mode parameter, acquiring second message data based on the message data to be transmitted, responding to a transmitting instruction, wherein the transmitting instruction is at least used for determining the starting transmission time, transmitting the second message data to the message transmitting equipment according to the starting transmission time, the circulating parameter and the system clock of the upper computer, and controlling the message transmitting equipment to execute the steps in the second working state; the step of the message sending device executing the second working state comprises the following steps: and receiving and forwarding second message data sent by the upper computer to the vehicle bus.
In some embodiments, the configuration parameters include cycle interval, number of cycles; the upper computer is configured to execute the following steps:
Step S2062: if the mode parameter is the second mode parameter, before receiving the end sending instruction, detecting whether a message frame modification instruction is received or not;
Step S2064: if yes, the modified configuration parameters and/or second message data are obtained in response to the message modification instruction, and the second message data are sent to the message sending equipment according to the system clock of the upper computer and the modified configuration parameters and/or the second message data.
In some embodiments, the configuration parameters include cycle interval, number of cycles; the upper computer is configured to execute the following steps:
If the mode parameter is the first mode parameter, before receiving the end sending instruction, detecting whether a message frame modification instruction is received or not;
if so, responding to the message modification instruction, acquiring the modified configuration parameters and/or first message data, and sending the modified configuration parameters and/or first message data to the message sending equipment, wherein the message sending equipment sends the first message data to the vehicle bus according to the local clock and the modified configuration parameters and/or first message data.
Referring to fig. 8, in some embodiments, another aspect of the present application provides a bus testing method, including the steps of:
Step S302: based on the message sending equipment, acquiring first message data and configuration parameters, wherein the configuration parameters are at least used for determining the sending moment of the first message data;
step S304: and based on the message sending equipment, sending the first message data to the vehicle bus according to the configuration parameters and the local clock of the message sending equipment.
By way of example, since the clock precision of the message sending device is higher than that of the upper computer, the local clock of the message sending device is used as the reference clock to send the message data, and the sending time precision of sending the message data to the vehicle bus is effectively improved relative to that of sending the message data by using the clock of the upper computer as the reference clock, so that the time stability of the vehicle bus for obtaining the message data is ensured, and the event that the vehicle test result is influenced due to the unstable time of sending the signal to the vehicle bus is avoided.
It should be understood that, although the steps in the flowcharts of fig. 2, 4-8 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, while at least some of the steps of fig. 2, 4-8 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of execution of the sub-steps or stages is not necessarily sequential, and may be performed in rotation or alternatively with at least a portion of the sub-steps or stages of other steps or steps.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile 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. By way of illustration and not limitation, RAM is available in a variety of 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), among others.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the claims. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.