Data transmission method, device, equipment and medium
By pre-configuring target identifiers and data on the vehicle bus, the problem in the existing technology that diagnostic equipment needs to interact with multiple frames is solved, and efficient and real-time data acquisition is achieved.
Patent Information
- Application Number
- CN202410708735.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-23
AI Technical Summary
When existing vehicle diagnostic equipment obtains ECU data, it needs to interact with request frames and reply frames, resulting in a large number of frames on the bus and low efficiency and timeliness.
By pre-configuring the target identification, the diagnostic device sends the target identification to the vehicle bus. When the configuration information exists locally, the electronic control unit sends the target data back to form a single frame of data, reducing the number of frames on the bus.
It improves the efficiency and real-time performance of data acquisition, reduces the number of frames on the bus, and enables diagnostic equipment to obtain data from the electronic control unit through one frame.
Smart Images

Figure CN118540179A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle diagnosis technology, and in particular to a data transmission method, device, equipment and medium. Background Art
[0002] Currently, when obtaining data from a vehicle-related ECU (Electronic Control Unit), the diagnostic device is required to first send a request frame to the ECU. After receiving the frame, the ECU fills the requested data in a reply frame and sends it back to the diagnostic device.
[0003] That is, the current diagnostic equipment needs two frames, a request frame and a reply frame, to obtain the data from the ECU. When some data needs to be read frequently, two frames need to be exchanged each time to obtain the data, resulting in more frames being sent on the bus, and the efficiency and timeliness are relatively low.
[0004] In summary, how to reduce the number of frames on the bus and improve data acquisition efficiency and real-time performance are issues that need to be resolved. Summary of the invention
[0005] In view of this, the object of the present invention is to provide a data transmission method, device, equipment and medium, which can reduce the number of frames on the bus and improve the efficiency and real-time performance of data acquisition. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a data transmission method, which is applied to a diagnostic device, wherein the diagnostic device communicates with each electronic control unit in a vehicle to be diagnosed via a vehicle bus, comprising:
[0007] Determine a pre-configured target identifier corresponding to the data to be acquired;
[0008] Sending the target identifier to the vehicle bus so that each electronic control unit in the vehicle to be diagnosed obtains the target identifier from the vehicle bus, and when configuration information of the target identifier exists locally, sending target data determined based on the configuration information to the vehicle bus;
[0009] The target data is acquired from the vehicle bus.
[0010] Optionally, the process of configuring a target identifier corresponding to the data to be acquired includes:
[0011] Select an undefined ID number from the preset ID range;
[0012] Establishing an association relationship between the identification number and the data to be acquired, and sending a request command carrying the association relationship to a target electronic control unit, so that after the target electronic control unit responds to the request command, it locally generates corresponding configuration information based on the association relationship;
[0013] An instruction for indicating successful configuration, which is returned by the target electronic control unit after generating the configuration information, is obtained, and the identification number is configured as a target identification corresponding to the data to be obtained.
[0014] Optionally, the selecting an undefined identification number from a preset identification range includes:
[0015] Randomly select an initial identification number from the preset identification range;
[0016] Sending an inquiry command to each electronic control unit in the vehicle to be diagnosed based on the initial identification number to confirm whether there is configuration information corresponding to the initial identification number in each electronic control unit;
[0017] If no configuration information corresponding to the initial identification number exists in each electronic control unit, the initial identification number is confirmed as an undefined identification number;
[0018] If any electronic control unit has configuration information corresponding to the initial identification number, the process jumps again to the step of selecting any initial identification number from the preset identification range until it is confirmed that the initial identification number is an undefined identification number.
[0019] Optionally, all identifiers in the preset identification range are currently undefined; wherein, when any first identification number is defined, the first identification number is deleted from the preset identification range, and when any second identification number is cancelled, the second identification number is added to the preset identification range.
[0020] Optionally, the data transmission method further includes:
[0021] When a preset deregistration condition is met, sending a deregistration request for deregistering the target identifier to the target electronic control unit, so that the target electronic control unit responds to the deregistration request and deletes the configuration information locally;
[0022] Obtain an instruction returned by the target electronic control unit after the configuration information is locally deleted, which is used to indicate that the deregistration is successful.
[0023] Optionally, the communication format of the data frame on the vehicle bus includes an identifier, a data length code and a data byte;
[0024] Correspondingly, the target data includes data byte information and a data length code of the data to be acquired.
[0025] In a second aspect, the present application discloses a data transmission method, which is applied to an electronic control unit in a vehicle to be diagnosed, wherein the electronic control unit communicates with a diagnostic device via a vehicle bus, and the method comprises:
[0026] Acquire a target identifier sent by the diagnostic device from the vehicle bus; the target identifier is a pre-configured identifier corresponding to the data to be acquired;
[0027] Determine whether the configuration information of the target identifier exists locally;
[0028] If yes, the target data determined based on the configuration information is sent to the vehicle bus, so that the diagnostic device acquires the target data from the vehicle bus.
[0029] In a third aspect, the present application discloses a data transmission device, which is applied to a diagnostic device, wherein the diagnostic device communicates with each electronic control unit in a vehicle to be diagnosed via a vehicle bus, and the device comprises
[0030] An identification determination module, used to determine a pre-configured target identification corresponding to the data to be acquired;
[0031] an identification sending module, used for sending the target identification to the vehicle bus, so that each electronic control unit in the vehicle to be diagnosed obtains the target identification from the vehicle bus, and when the configuration information of the target identification exists locally, sends the target data determined based on the configuration information to the vehicle bus;
[0032] A data acquisition module is used to acquire the target data from the vehicle bus.
[0033] In a fourth aspect, the present application discloses an electronic device, including:
[0034] Memory, used to store computer programs;
[0035] The processor is used to execute the computer program to implement the steps of the aforementioned disclosed data transmission method.
[0036] In a fifth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed data transmission method are implemented.
[0037] It can be seen that the diagnostic device in the present application communicates with each electronic control unit in the vehicle to be diagnosed through the vehicle bus. The diagnostic device first determines the pre-configured target identifier corresponding to the data to be obtained; sends the target identifier to the vehicle bus, so that each electronic control unit in the vehicle to be diagnosed can obtain the target identifier from the vehicle bus, and when the configuration information of the target identifier exists locally, the target data determined based on the configuration information is sent to the vehicle bus; and the target data is obtained from the vehicle bus. It can be seen that the present application pre-configures the target identifier corresponding to the data to be obtained. The diagnostic device in the present application sends the target identifier to the vehicle bus instead of sending a request frame, wherein according to the definition of the communication frame on the vehicle bus, the target identifier is the identifier part of the communication frame. Further, since all electronic control units can receive the data sent to the vehicle bus, each electronic control unit in the vehicle to be diagnosed will obtain the target identifier from the vehicle bus, and when the configuration information of the target identifier exists locally, each electronic control unit sends the target data determined based on the configuration information to the vehicle bus, and the diagnostic device obtains the target data from the vehicle bus, wherein according to the definition of the communication frame, the target data is the data part of the communication frame. That is, not all electronic control units in the vehicle to be diagnosed have configuration information corresponding to the target identifier. Only when the relevant configuration information exists inside the electronic control unit will the corresponding target data be returned to the diagnostic device. In the above scheme, the target identifier and the target data together constitute a single frame of data. The diagnostic device can obtain the data of the electronic control unit through one frame, which reduces the number of frames on the bus and improves the efficiency and real-time performance of data acquisition. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0039] Figure 1 A flow chart of a data transmission method disclosed in this application;
[0040] Figure 2 A flowchart of configuring a target identifier corresponding to data to be acquired disclosed in this application;
[0041] Figure 3 This is a flow chart of another data transmission method disclosed in this application;
[0042] Figure 4 This is a schematic diagram of the structure of a data transmission device disclosed in this application;
[0043] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0045] The current diagnostic equipment needs two frames, a request frame and a reply frame, to obtain the data of the ECU. When some data needs to be read frequently, two frames need to be exchanged each time to obtain the data, resulting in more frames sent on the bus, and the efficiency and timeliness are relatively low. To this end, the embodiment of the present application discloses a data transmission method, device, equipment and medium, which can reduce the number of frames on the bus and improve the efficiency and real-time performance of data acquisition.
[0046] See also Figure 1 As shown, an embodiment of the present application discloses a data transmission method, which is applied to a diagnostic device, wherein the diagnostic device communicates with each electronic control unit in a vehicle to be diagnosed through a vehicle bus, and the method includes:
[0047] Step S11: Determine a pre-configured target identifier corresponding to the data to be acquired.
[0048] In this embodiment, it is first necessary to determine the pre-configured target identifier corresponding to the data to be acquired, wherein, according to the definition of the communication frame on the vehicle bus, the target identifier is the identification part of the communication frame. It can be understood that the target identifier represents the identifier of certain data of a certain ECU, and the identifier can represent one or more items. For example, 0x0111 can be configured to represent the speed and voltage of the engine ECU. That is to say, when the data to be acquired is the speed and voltage of the engine ECU, the corresponding target identifier is 0x0111.
[0049] Step S12: Send the target identifier to the vehicle bus so that each electronic control unit in the vehicle to be diagnosed obtains the target identifier from the vehicle bus, and when the configuration information of the target identifier exists locally, sends the target data determined based on the configuration information to the vehicle bus.
[0050] In this embodiment, the diagnostic device sends the target identifier to the vehicle bus instead of sending a request frame. Furthermore, since all electronic control units can receive the data sent to the vehicle bus, each electronic control unit in the vehicle to be diagnosed will obtain the target identifier from the vehicle bus, and when each electronic control unit has the configuration information of the target identifier locally, it will send the target data determined based on the configuration information to the vehicle bus. That is, not all electronic control units in the vehicle to be diagnosed have the configuration information corresponding to the target identifier, and only when the relevant configuration information exists inside the electronic control unit will the corresponding target data be returned to the diagnostic device. According to the definition of the communication frame, the target data is the data part of the communication frame.
[0051] It should be pointed out that the communication format of the data frame on the above vehicle bus includes an ID, a data length code (DLC) and a data byte; in a request frame, the ID indicates the request ID of the ECU, in a reply frame, the ID indicates the ID of the replying ECU, the DLC indicates the number of the following data bytes, and the data bytes are the actual transmitted data bytes. For example, take the following pair of request and reply frames as an example:
[0052] Request frame req: 7E0 8 02 10 03 00 00 00 00 00, 7E0 in the request frame indicates that it is to be sent to the engine ECU, 8 indicates that the data has 8 bytes, followed by 8 request data bytes;
[0053] Reply frame ans: 7E8 8 06 50 03 00 32 01 F4 00. In the reply frame, 7E8 indicates that it is the frame replied by the engine. 8 indicates that there are 8 bytes of data, followed by 8 bytes of reply data.
[0054] Correspondingly, the target data includes the data byte information and the data length code of the data to be acquired. That is, the target identifier and the target data in the present application together constitute a single frame of data.
[0055] That is to say, when the electronic control unit determines that the target identifier on the bus has configuration information inside it, it will look for the configuration information, take out the real-time value of the data item according to the data item in the configuration information, and then generate a data length code and data bytes as the data part of a single frame and send it to the vehicle bus.
[0056] Step S13: Acquire the target data from the vehicle bus.
[0057] In this embodiment, the diagnostic device obtains the target data from the vehicle bus, that is, receives the data length code and data byte information of the data to be obtained. In this way, the diagnostic device can obtain the data of the electronic control unit through one frame, reducing the number of frames on the bus and improving the data acquisition efficiency and real-time performance.
[0058] From the above scheme, it can be seen that for data that needs to be read frequently, the diagnostic device can agree on an ID with the ECU, and then obtain the data by sending a single frame. The diagnostic device sends the ID part of the single frame. When the ECU obtains the ID as the agreed ID, it sends the data part of the single frame. Because all ECUs can receive the vehicle bus data, the data part sent by the ECU can also be received by the diagnostic device. In this way, the ECU data can be obtained through one frame, reducing the number of bus frames and improving data acquisition efficiency and real-time performance.
[0059] It can be seen that the diagnostic device in the present application communicates with each electronic control unit in the vehicle to be diagnosed through the vehicle bus. The diagnostic device first determines the pre-configured target identifier corresponding to the data to be obtained; sends the target identifier to the vehicle bus, so that each electronic control unit in the vehicle to be diagnosed can obtain the target identifier from the vehicle bus, and when the configuration information of the target identifier exists locally, the target data determined based on the configuration information is sent to the vehicle bus; and the target data is obtained from the vehicle bus. It can be seen that the present application pre-configures the target identifier corresponding to the data to be obtained. The diagnostic device in the present application sends the target identifier to the vehicle bus instead of sending a request frame, wherein according to the definition of the communication frame on the vehicle bus, the target identifier is the identifier part of the communication frame. Further, since all electronic control units can receive the data sent to the vehicle bus, each electronic control unit in the vehicle to be diagnosed will obtain the target identifier from the vehicle bus, and when the configuration information of the target identifier exists locally, each electronic control unit sends the target data determined based on the configuration information to the vehicle bus, and the diagnostic device obtains the target data from the vehicle bus, wherein according to the definition of the communication frame, the target data is the data part of the communication frame. That is, not all electronic control units in the vehicle to be diagnosed have configuration information corresponding to the target identifier. Only when the relevant configuration information exists inside the electronic control unit will the corresponding target data be returned to the diagnostic device. In the above scheme, the target identifier and the target data together constitute a single frame of data. The diagnostic device can obtain the data of the electronic control unit through one frame, which reduces the number of frames on the bus and improves the efficiency and real-time performance of data acquisition.
[0060] For further information, see Figure 2 As shown, the embodiment of the present application specifically discloses a process of configuring a target identifier corresponding to the data to be acquired, including:
[0061] Step S21: Select an undefined identification number from a preset identification range.
[0062] In this embodiment, when acquiring ECU data by using a single frame, it is first necessary to select an undefined identification number, and specifically, the selection can be made from a preset identification range.
[0063] In a specific embodiment, the above-mentioned selecting an undefined identification number from a preset identification range includes: arbitrarily selecting an initial identification number from the preset identification range; sending an inquiry command to each electronic control unit in the vehicle to be diagnosed based on the initial identification number to confirm whether there is configuration information corresponding to the initial identification number in each electronic control unit; if there is no configuration information corresponding to the initial identification number in each electronic control unit, the initial identification number is confirmed as an undefined identification number; if there is configuration information corresponding to the initial identification number in any electronic control unit, jumping back to the step of arbitrarily selecting an initial identification number from the preset identification range until it is confirmed that the initial identification number is an undefined identification number.
[0064] That is, the present application needs to ensure that the selected identification number has not been defined. Specifically, an initial identification number can be arbitrarily selected from the preset identification range, for example, one can be arbitrarily selected from the identification range 000-0x700, and then a query command is sent to each electronic control unit in the vehicle to be diagnosed based on the initial identification number to confirm whether there is configuration information corresponding to the initial identification number in each electronic control unit, that is, to confirm whether the initial identification number has been defined. If there is no configuration information corresponding to the initial identification number in each electronic control unit, it means that the initial identification number has not been defined, and therefore the initial identification number is confirmed as an undefined identification number. If there is configuration information corresponding to the initial identification number in any electronic control unit, it means that the initial identification number has been defined in the electronic control unit, and then it is necessary to re-select an initial identification number arbitrarily from the preset identification range until it is confirmed that the selected initial identification number is an undefined identification number.
[0065] In another specific implementation, all identifiers in the above-mentioned preset identification range are currently undefined; wherein, when any first identification number is defined, the first identification number is deleted from the preset identification range, and when any second identification number is cancelled, the second identification number is added to the preset identification range. This embodiment can also maintain a dynamic preset identification range, and the identifiers in the preset identification range are all currently undefined. The key is that once an identification number is defined, the identification number is deleted from the preset identification range, and when an identification number is cancelled, the identification number is re-added to the preset identification range, so that all identifiers in the preset identification range are currently undefined. Then, when it is necessary to select an undefined identification number, any one of the preset identification ranges can be selected.
[0066] Step S22: establishing an association relationship between the identification number and the data to be acquired, and sending a request command carrying the association relationship to a target electronic control unit, so that the target electronic control unit generates corresponding configuration information locally based on the association relationship after responding to the request command.
[0067] In this embodiment, after confirming that the selected identification number is an undefined identification number, an association relationship is established between the identification number and the data to be acquired, and a request command carrying the association relationship is sent to the target electronic control unit. For example, when the data to be acquired is the speed and voltage of the engine ECU and the identification number is 0x0111, an association relationship is established between the speed and voltage of the engine ECU and the identification number 0x0111. Specifically, an association relationship is established between the identification number and the DID (Data Identifier) of the speed and voltage, and a request command carrying the association relationship is sent to the engine ECU. Among them, the DID is used to identify and acquire specific parameter data in the ECU, such as sensor data, status information, etc., and each DID corresponds to a specific data item of the vehicle. That is, the request command includes the value of the new identification number to be defined, as well as the DID of the data item to be represented by this identification number, for example, the DID of the speed is 0x0201 and the DID of the voltage is 0x0808. Furthermore, after receiving the request command, the target electronic control unit will locally generate configuration information of the new identification number and associated data items, and then reply to the diagnostic device that the configuration is successful.
[0068] Step S23: obtaining an instruction returned by the target electronic control unit after generating the configuration information, which is used to indicate successful configuration, and configuring the identification number as a target identification corresponding to the data to be obtained.
[0069] In this embodiment, the target electronic control unit returns a command indicating successful configuration after generating configuration information, and configures the identification number as the target identification corresponding to the data to be obtained. That is, when the diagnostic device receives a reply indicating successful configuration of the ECU, the single frame mode can be used to read the data, and the diagnostic device can send the identification part of the single frame to the vehicle bus.
[0070] Furthermore, the above method also includes: when the preset cancellation conditions are met, sending a cancellation request for canceling the target identifier to the target electronic control unit, so that the target electronic control unit responds to the cancellation request and deletes the configuration information locally; obtaining the instruction returned by the target electronic control unit after deleting the configuration information locally to indicate successful cancellation. It can be understood that when the preset cancellation conditions are met, for example, when there is no need to read data frequently, the defined target identifier can also be cancelled. Specifically, the diagnostic device sends a cancellation request for canceling the target identifier to the target electronic control unit, that is, the request includes the ID to be cancelled, so that after the target electronic control unit responds to the cancellation request, the configuration information corresponding to the target identifier in the request will be cancelled and deleted inside the ECU, and then the cancellation will be replied to be successful. After cancellation, this ID is no longer valid.
[0071] It can be seen that the embodiment of the present application discloses a specific process of configuring the target identification corresponding to the data to be acquired. First, it is necessary to select an identification number that has not been defined. In a specific embodiment, after selecting an initial identification number in the preset identification range, each electronic control unit is asked whether the initial identification number has been defined. If it has been defined, it needs to be reselected. In another specific embodiment, a dynamic preset identification range can be maintained, and the identifications in the preset identification range are all currently undefined. After confirming that the selected identification number is an identification number that has not been defined, an association relationship is established between the identification number and the data to be acquired, and a request command carrying the association relationship is sent to the target electronic control unit. After receiving the request command, the target electronic control unit will generate the configuration information of this new identification number and the associated data item locally, and then reply to the diagnostic device for successful configuration. In addition, when it is not necessary to read data frequently, the defined target identification can also be cancelled, and this ID is no longer valid after cancellation.
[0072] See also Figure 3 As shown, an embodiment of the present application discloses a data transmission method, which is applied to an electronic control unit in a vehicle to be diagnosed, wherein the electronic control unit communicates with a diagnostic device via a vehicle bus, and the method comprises:
[0073] Step S31: Acquire a target identifier sent by the diagnostic device from the vehicle bus; the target identifier is a pre-configured identifier corresponding to the data to be acquired.
[0074] In this embodiment, all electronic control units in the vehicle to be diagnosed can obtain data on the vehicle bus, so each electronic control unit obtains the target identifier sent by the diagnostic device from the vehicle bus. The target identifier is a pre-configured identifier corresponding to the data to be obtained, and according to the definition of the communication frame on the vehicle bus, the target identifier is the identifier part of the communication frame.
[0075] Step S32: Determine whether configuration information of the target identifier exists locally.
[0076] In this embodiment, after each electronic control unit in the vehicle to be diagnosed obtains the target identifier, it will determine whether the configuration information of the target identifier exists locally.
[0077] Step S33: If yes, the target data determined based on the configuration information is sent to the vehicle bus, so that the diagnostic device obtains the target data from the vehicle bus.
[0078] In this embodiment, if the electronic control unit has configuration information of the target identifier locally, the target data determined based on the configuration information is sent to the vehicle bus so that the diagnostic device can obtain the target data from the vehicle bus. According to the definition of the communication frame, the target data is the data part of the communication frame.
[0079] It can be seen that the electronic control unit in the vehicle to be diagnosed in this application obtains the target identifier sent by the diagnostic device from the vehicle bus; the target identifier is a pre-configured identifier corresponding to the data to be obtained; it is determined whether there is configuration information of the target identifier locally; if there is, the target data determined based on the configuration information is sent to the vehicle bus so that the diagnostic device can obtain the target data from the vehicle bus. It can be seen that the application pre-configures the target identifier corresponding to the data to be obtained. The electronic control unit in this application obtains the target identifier sent by the diagnostic device, rather than the request frame. According to the definition of the communication frame on the vehicle bus, the target identifier is the identifier part of the communication frame. Further, since all electronic control units can receive the data sent to the vehicle bus, each electronic control unit in the vehicle to be diagnosed will obtain the target identifier from the vehicle bus. When each electronic control unit has the configuration information of the target identifier locally, it will send the target data determined based on the configuration information to the vehicle bus, and the diagnostic device will obtain the target data from the vehicle bus, wherein according to the definition of the communication frame, the target data is the data part of the communication frame. That is, not all electronic control units in the vehicle to be diagnosed have configuration information corresponding to the target identifier. Only when the relevant configuration information exists inside the electronic control unit will the corresponding target data be returned to the diagnostic device. In the above scheme, the target identifier and the target data together constitute a single frame of data. The diagnostic device can obtain the data of the electronic control unit through one frame, which reduces the number of frames on the bus and improves the efficiency and real-time performance of data acquisition.
[0080] See also Figure 4 As shown, an embodiment of the present application discloses a data transmission device, which is applied to a diagnostic device, wherein the diagnostic device communicates with each electronic control unit in a vehicle to be diagnosed through a vehicle bus, and the device includes:
[0081] The identification determination module 11 is used to determine a pre-configured target identification corresponding to the data to be acquired;
[0082] an identification sending module 12, configured to send the target identification to the vehicle bus, so that each electronic control unit in the vehicle to be diagnosed obtains the target identification from the vehicle bus, and when configuration information of the target identification exists locally, sends target data determined based on the configuration information to the vehicle bus;
[0083] The data acquisition module 13 is used to acquire the target data from the vehicle bus.
[0084] It can be seen that the diagnostic device in the present application communicates with each electronic control unit in the vehicle to be diagnosed through the vehicle bus. The diagnostic device first determines the pre-configured target identifier corresponding to the data to be obtained; sends the target identifier to the vehicle bus, so that each electronic control unit in the vehicle to be diagnosed can obtain the target identifier from the vehicle bus, and when the configuration information of the target identifier exists locally, the target data determined based on the configuration information is sent to the vehicle bus; and the target data is obtained from the vehicle bus. It can be seen that the present application pre-configures the target identifier corresponding to the data to be obtained. The diagnostic device in the present application sends the target identifier to the vehicle bus instead of sending a request frame, wherein according to the definition of the communication frame on the vehicle bus, the target identifier is the identifier part of the communication frame. Further, since all electronic control units can receive the data sent to the vehicle bus, each electronic control unit in the vehicle to be diagnosed will obtain the target identifier from the vehicle bus, and when the configuration information of the target identifier exists locally, each electronic control unit sends the target data determined based on the configuration information to the vehicle bus, and the diagnostic device obtains the target data from the vehicle bus, wherein according to the definition of the communication frame, the target data is the data part of the communication frame. That is, not all electronic control units in the vehicle to be diagnosed have configuration information corresponding to the target identifier. Only when the relevant configuration information exists inside the electronic control unit will the corresponding target data be returned to the diagnostic device. In the above scheme, the target identifier and the target data together constitute a single frame of data. The diagnostic device can obtain the data of the electronic control unit through one frame, which reduces the number of frames on the bus and improves the efficiency and real-time performance of data acquisition.
[0085] In some specific embodiments, the device is further used to configure a target identifier corresponding to the data to be acquired, specifically including:
[0086] An identification number selection module, used to select an undefined identification number from a preset identification range;
[0087] a request command sending module, used for establishing an association relationship between the identification number and the data to be acquired, and sending a request command carrying the association relationship to a target electronic control unit, so that the target electronic control unit generates corresponding configuration information locally based on the association relationship after responding to the request command;
[0088] The identification configuration module is used to obtain the instruction returned by the target electronic control unit after generating the configuration information, which is used to indicate that the configuration is successful, and configure the identification number as the target identification corresponding to the data to be obtained.
[0089] In some specific embodiments, the identification number selection module may specifically include:
[0090] A selection unit, used to arbitrarily select an initial identification number from a preset identification range;
[0091] an inquiry unit, configured to send an inquiry command to each electronic control unit in the vehicle to be diagnosed based on the initial identification number, so as to confirm whether configuration information corresponding to the initial identification number exists in each electronic control unit;
[0092] an identification number confirmation unit, configured to confirm the initial identification number as an undefined identification number if no configuration information corresponding to the initial identification number exists in each electronic control unit;
[0093] A reselection unit is used to jump again to the step of selecting an initial identification number from a preset identification range if configuration information corresponding to the initial identification number exists in any electronic control unit, until it is confirmed that the initial identification number is an undefined identification number.
[0094] In some specific embodiments, all identifiers in the preset identification range are currently undefined; wherein, when any first identification number is defined, the first identification number is deleted from the preset identification range, and when any second identification number is cancelled, the second identification number is added to the preset identification range.
[0095] In some specific embodiments, the device further comprises:
[0096] an identification cancellation unit, configured to send a cancellation request for canceling the target identification to the target electronic control unit when a preset cancellation condition is met, so that the target electronic control unit responds to the cancellation request and locally deletes the configuration information;
[0097] The instruction acquisition unit is used to acquire the instruction returned by the target electronic control unit after the configuration information is locally deleted, which is used to indicate that the deregistration is successful.
[0098] In some specific embodiments, the communication format of the data frame on the vehicle bus includes an identifier, a data length code, and a data byte;
[0099] Correspondingly, the target data includes data byte information and a data length code of the data to be acquired.
[0100] Figure 5A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data transmission method performed by the electronic device disclosed in any of the aforementioned embodiments.
[0101] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0102] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0103] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0104] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data transmission method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can also further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25, etc.
[0105] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the data transmission method disclosed in any of the aforementioned embodiments are implemented.
[0106] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0107] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0108] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.
[0109] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0110] The above is a detailed introduction to a data transmission method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A data transmission method, It is characterized in that Applied to a diagnostic device, the diagnostic device communicates with each electronic control unit in a vehicle to be diagnosed via a vehicle bus, the method comprising: Determine a pre-configured target identifier corresponding to the data to be acquired; Sending the target identifier to the vehicle bus so that each electronic control unit in the vehicle to be diagnosed obtains the target identifier from the vehicle bus, and when configuration information of the target identifier exists locally, sending target data determined based on the configuration information to the vehicle bus; The target data is acquired from the vehicle bus.
2. The data transmission method according to claim 1, It is characterized in that The process of configuring the target identifier corresponding to the data to be acquired includes: Select an undefined ID number from the preset ID range; Establishing an association relationship between the identification number and the data to be acquired, and sending a request command carrying the association relationship to a target electronic control unit, so that after the target electronic control unit responds to the request command, it locally generates corresponding configuration information based on the association relationship; An instruction for indicating successful configuration, which is returned by the target electronic control unit after generating the configuration information, is obtained, and the identification number is configured as a target identification corresponding to the data to be obtained.
3. The data transmission method according to claim 2, It is characterized in that The step of selecting an undefined identification number from a preset identification range includes: Randomly select an initial identification number from the preset identification range; Sending an inquiry command to each electronic control unit in the vehicle to be diagnosed based on the initial identification number to confirm whether there is configuration information corresponding to the initial identification number in each electronic control unit; If no configuration information corresponding to the initial identification number exists in each electronic control unit, the initial identification number is confirmed as an undefined identification number; If any electronic control unit has configuration information corresponding to the initial identification number, the process jumps again to the step of selecting any initial identification number from the preset identification range until it is confirmed that the initial identification number is an undefined identification number.
4. The data transmission method according to claim 2, It is characterized in that All identifiers in the preset identification range are currently undefined; wherein, when any first identification number is defined, the first identification number is deleted from the preset identification range, and when any second identification number is cancelled, the second identification number is added to the preset identification range.
5. The data transmission method according to claim 2, It is characterized in that Also includes: When a preset deregistration condition is met, sending a deregistration request for deregistering the target identifier to the target electronic control unit, so that the target electronic control unit responds to the deregistration request and deletes the configuration information locally; Obtain an instruction returned by the target electronic control unit after the configuration information is locally deleted, which is used to indicate that the deregistration is successful.
6. The data transmission method according to any one of claims 1 to 5, It is characterized in that The communication format of the data frame on the vehicle bus includes an identifier, a data length code and a data byte; Correspondingly, the target data includes data byte information and a data length code of the data to be acquired.
7. A data transmission method, It is characterized in that An electronic control unit is applied to a vehicle to be diagnosed, the electronic control unit communicates with a diagnostic device via a vehicle bus, and the method comprises: Acquire a target identifier sent by the diagnostic device from the vehicle bus; the target identifier is a pre-configured identifier corresponding to the data to be acquired; Determine whether the configuration information of the target identifier exists locally; If yes, the target data determined based on the configuration information is sent to the vehicle bus, so that the diagnostic device acquires the target data from the vehicle bus.
8. A data transmission device, It is characterized in that Applied to a diagnostic device, the diagnostic device communicates with each electronic control unit in the vehicle to be diagnosed through a vehicle bus, the device comprises An identification determination module, used to determine a pre-configured target identification corresponding to the data to be acquired; an identification sending module, used for sending the target identification to the vehicle bus, so that each electronic control unit in the vehicle to be diagnosed obtains the target identification from the vehicle bus, and when the configuration information of the target identification exists locally, sends the target data determined based on the configuration information to the vehicle bus; A data acquisition module is used to acquire the target data from the vehicle bus.
9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Multi-system data stream selection method and device, equipment and storage medium
CN119225344A
Diagnosis method and device based on macro definition, equipment and storage medium
CN120540262A
A macro definition-based diagnosis method, device, equipment and storage medium
CN120540262B
