CN115834281A - Data transmission method and device, electronic equipment and storage medium - Google Patents

Data transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115834281A
CN115834281A CN202211372813.4A CN202211372813A CN115834281A CN 115834281 A CN115834281 A CN 115834281A CN 202211372813 A CN202211372813 A CN 202211372813A CN 115834281 A CN115834281 A CN 115834281A
Authority
CN
China
Prior art keywords
data
request
service request
data transmission
canid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211372813.4A
Other languages
Chinese (zh)
Inventor
刘新
李森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202211372813.4A priority Critical patent/CN115834281A/en
Publication of CN115834281A publication Critical patent/CN115834281A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The application is applicable to the technical field of computers, and provides a data transmission method, a data transmission device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring first data, and sending flow control frame data to the data receiving equipment based on the first data when the first data meets the following conditions: 1. the first data is ISO15765 first frame data; 2. if the first data is the first frame data of ISO15765, acquiring a response CANID and a first service request ID of the first data, and finding a request CANID and a second service request ID which are matched with the response CANID and the first service request ID in a preset configuration file. The problem that remote data transmission fails due to the fact that some bus data are mistakenly judged as the data of the first frame of ISO15765 and the control frame data are mistakenly replaced can be solved.

Description

Data transmission method and device, electronic equipment and storage medium
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a data transmission method and apparatus, an electronic device, and a storage medium.
Background
Remote data transmission is very time-delay-critical, typically requiring response times of no more than 55 ms, and timeout can cause transmission failure. To solve this problem, the data transmission device will replace the flow control frame data in the remote data transmission to avoid response time timeout.
However, in practical applications, it is found that the data transmission device is inevitable to falsely replace the control frame data by misinterpret some bus data as the data of the first frame in ISO15765, thereby resulting in a failure of remote data transmission.
Disclosure of Invention
The embodiment of the application provides a data transmission method, a data transmission device, electronic equipment and a storage medium, and can solve the problem that remote data transmission fails because some bus data are wrongly judged as ISO15765 first frame data and the control frame data are wrongly replaced.
In a first aspect, an embodiment of the present application provides a data transmission method, where the method is applied to a first data transmission device in a data transmission system, where the data transmission system further includes a data sending device, a data receiving device, and a second data transmission device, where the first data transmission device is connected to the second data transmission device and the data receiving device, respectively, and the method includes:
acquiring first data, wherein the first data is bus data sent to the first data transmission equipment by the data receiving equipment;
judging whether the first data is ISO15765 first frame data;
if the first data is ISO15765 first frame data, acquiring a response CANID and a first service request ID of the first data, and searching whether a matched request CANID and a second service request ID exist in a preset configuration file based on the response CANID and the first service request ID;
if yes, sending flow control frame data to the data receiving equipment based on the first data;
the request CANID and the second service request ID are information carried by second data sent by the data sending equipment to the first data transmission equipment.
Optionally, before sending the stream control frame data to the data receiving device based on the first data, the method further includes:
acquiring a response CAN channel number of the first data;
and searching whether a matched request CAN channel number exists in a preset configuration file based on the response CAN channel number.
Optionally, before the acquiring the first data, the method further includes:
acquiring the second data;
judging whether the second data is ISO15765 single-frame data or first-frame data;
if the second data is ISO15765 single-frame data or first-frame data, acquiring a request CAN channel number, a request CANID and a second service request ID of the second data;
and storing the request CAN channel number, the request CANID and the second service request ID into a preset data structure.
Optionally, after the request CAN channel number, the request CAN ID, and the second service request ID for obtaining the second data, the method further includes;
searching whether the request CAN channel number and the request CANID exist in the preset data structure;
and if so, updating a second service request ID which is stored in the preset data structure and corresponds to the request CAN channel number and the request CANID by using the current second service request ID.
Optionally, the searching whether there are a matching request candid and a second service request ID in a preset configuration file based on the response candid and the first service request ID includes:
searching whether a matched request CANID exists in the preset configuration file based on the response CANID;
if the request exists, acquiring a second service request ID corresponding to the request CANID from the preset data structure;
and if the first service request ID is equal to the second service request ID plus 0x40, determining that a request CANID and a second service request ID which are matched with the response CANID and the first service request ID exist in a preset configuration file.
Optionally, the sending, to the data receiving device, stream control frame data based on the first data includes:
searching flow control frame data corresponding to the response CANID in the preset configuration file;
and sending the flow control frame data to the data receiving equipment.
Optionally, before or after the sending of the flow control frame data to the data receiving device based on the first data, the method further includes:
and deleting the request CAN channel number, the request CANID and the second service request ID stored in the preset data structure.
In a second aspect, an embodiment of the present application provides a data transmission apparatus, where the data transmission apparatus is built in a data transmission device in a data transmission system, and the data transmission system further includes a data sending device and a data receiving device, where the data transmission device is in communication connection with the data sending device and the data receiving device, respectively, and the data transmission apparatus includes:
a first data obtaining module, configured to obtain first data, where the first data is bus data sent by the data receiving device to the first data transmission device;
the first judging module is used for judging whether the first data is ISO15765 first frame data;
a first searching module, configured to obtain a response caidd and a first service request ID of the first data if the first data is first frame data of ISO15765, and search, based on the response caidd and the first service request ID, whether a matching request caidd and a second service request ID exist in a preset configuration file, where the request caidd and the second service request ID are information carried by second data sent by the data sending device to the first data transmission device;
and the flow control frame sending module is used for sending flow control frame data to the data receiving equipment based on the first data if the flow control frame data exists.
Optionally, the data transmission apparatus further includes:
and the second searching module is used for acquiring the response CAN channel number of the first data and searching whether a matched request CAN channel number exists in a preset configuration file based on the response CAN channel number.
Optionally, the data transmission apparatus further includes:
the second data acquisition module is used for acquiring the second data;
the second judging module is used for judging whether the second data is ISO15765 single-frame data or first-frame data;
a request data obtaining module, configured to obtain a request CAN channel number, a request CAN ID, and a second service request ID of the second data if the second data is ISO15765 single-frame data or first-frame data;
and the request data storage module is used for storing the request CAN channel number, the request CANID and the second service request ID into a preset data structure.
Optionally, the data transmission apparatus further includes;
a third searching module, configured to search, in the preset data structure, whether the request CAN channel number and the request CAN id exist;
and if the second service request ID exists, updating the second service request ID which is stored in the preset data structure and corresponds to the request CAN channel number and the request CANID by using the current second service request ID.
Optionally, the first lookup module includes:
a first searching unit, configured to search, based on the response candid, whether there is a matching request candid in the preset configuration file;
a service request ID obtaining unit, configured to obtain, if the service request ID exists, a second service request ID corresponding to the request candid from the preset data structure;
a determining unit, configured to determine that there are a request CANID and a second service request ID that match the response CANID and the first service request ID in a preset configuration file if the first service request ID is equal to the second service request ID plus 0x40.
Optionally, the flow control frame sending module includes:
a second searching unit, configured to search, in the preset configuration file, flow control frame data corresponding to the response caidd;
and the flow control frame sending unit is used for sending the flow control frame data to the data receiving equipment.
Optionally, the data transmission apparatus further includes:
and the request data deleting module is used for deleting the request CAN channel number, the request CANID and the second service request ID which are stored in the preset data structure.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the data transmission method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps of the data transmission method of the first aspect described above.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on an electronic device, causes the electronic device to execute the steps of the data transmission method according to the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: since the flow control frame data is sent based on the first data after the first data is determined to be the first frame data of the ISO15765 and the matched request caid and the second service request ID can be found in the preset configuration file based on the response caid of the first data and the first service request ID, the flow control frame data can be sent based on the first data after the second data corresponding to the first data is determined to exist, bus data of other similar first frame data of the ISO15765 sent by the data receiving device can be prevented from being judged to be the first frame data of the ISO15765 needing to replace the flow control frame data, and flow frame data can be sent based on the bus data of the other similar first frame data of the ISO15765, so that the accuracy of replacing flow control can be improved, and the problem that the flow control frame data is mistakenly replaced due to the fact that some bus data are judged to be the first frame data of the ISO15765, and remote data transmission failure is caused by the fact that the flow control frame data are mistakenly replaced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a data transmission system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing a relative importance or importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
When data transmission is performed between a data sending device and a data receiving device, since there may be a device without remote communication capability in the two devices, or in order to meet the requirement of a data transmission protocol, remote data transmission is often assisted by using a data transmission device connected with the two devices as an intermediary.
In the process of remote data transmission, when the data sending equipment sends out first frame data, the data sending equipment needs to receive flow control frame data sent by the data receiving equipment, and then continuous frame data corresponding to the first frame data are continuously sent to the data receiving equipment.
In consideration of the problem of data transmission delay, it is generally required that the response time between sending the first frame of data and receiving the flow control frame data by the data sending device does not exceed a time threshold (for example, 55 ms), and if the response time is exceeded, the data sending device fails. In order to avoid timeout, the data transmission device needs to reply the proxy stream control frame to solve the problem, that is, the data transmission device queries a response caidd corresponding to the request caidd of the first frame or single frame of data in the configuration file, and then sends stream control frame data associated with the response caidd to the data sending device instead of the data receiving device.
Taking the data sending device as the diagnostic device and the data receiving device as the vehicle as an example, when the diagnostic device sends the first frame of data, it needs to receive the flow control frame data sent by the vehicle, and then will continue to send the continuous frame corresponding to the first frame of data. For remote diagnosis, even if the data transmission devices all adopt wired ethernet transmission, it is difficult to ensure that the time delay does not exceed 55 ms, and even if the data transmission devices connected to the vehicle do not necessarily have ethernet, wireless connections such as WIFI or 5G are likely to be used.
The data transmission device may locally perform some processing on some ISO15765 diagnostic data according to the caid configured by the configuration file, for example, by sending the flow control frame data instead to solve the timeout problem.
It is common practice to write a configuration file in advance according to vehicles of different brands, and the mapping relationship between the request candid and the response candid is stored in the configuration file. And during initialization, the data transmission equipment reads the configuration file, and returns control frame data if first frame data matched with the request CANID is received. For example, if the data transmission device on the vehicle side receives the first frame data that is sent by the vehicle and requests that the caidd be 0x5797, the corresponding flow control frame caidd is 0x0617, and the flow control frame data 30080000000000000000 that the caidd be 0x0617 is replaced to the vehicle.
The data transmission device receives other bus data transmitted by the vehicle in addition to the ISO15765 diagnostic data transmitted by the diagnostic device. Data with a format similar to that of the first frame or single frame of ISO15765 diagnostic data is inevitably generated in bus data sent by a vehicle, so that the data transmission equipment is inevitably subjected to mistaken replacement of control frame data due to the fact that some bus data are mistakenly judged as the first frame of ISO15765 data, and further diagnosis is failed.
In order to solve the above problem, fig. 1 shows a schematic structural diagram of a data transmission system provided in an embodiment of the present application, in the schematic structural diagram of the data transmission system, a B-side transmitting data to a C-side is taken as an example for explanation, in this embodiment, a diagnosis device of the B-side may be a data transmitting device, and a vehicle of the C-side may be a data receiving device. In actual operation, the diagnosis equipment can send data to the vehicle and also can receive the data sent by the vehicle; the vehicle can send data to the diagnostic device and can also receive data sent by the diagnostic device. The data transmission system comprises a first data transmission device at the C end, a data receiving device, a second data transmission device at the B end and a data sending device.
The data receiving equipment is connected with first data transmission equipment, the first data transmission equipment is connected with second data transmission equipment, and the second data transmission equipment is connected with data sending equipment.
It should be noted that, the connection mode between the above devices may be selected according to actual situations. In some specific embodiments, the data receiving device and the first data transmitting device and the second data transmitting device and the data sending device may be communicatively connected by short-range communication, such as can bus connection, and the first data transmitting device and the second data transmitting device may be communicatively connected by remote communication.
In an embodiment of the present application, a data interaction process between the devices in the data transmission system is shown in fig. 2, and the method may be applied to the first data transmission device at the C-end, and specifically includes the following steps S210 to S240, where a specific implementation principle of each step is as follows:
s210, obtain first data, where the first data is bus data sent by the data receiving device to the first data transmitting device.
In some embodiments, after receiving the service request data sent by the data sending device, the data receiving device may send response data to the data sending device.
For convenience of description, the response data sent by the data receiving device to the first data transmission device is denoted as first data, and the data sent by the data sending device to the first data transmission device is denoted as second data.
After the data sending equipment sends the service request data to the second data transmission equipment through the CAN bus, the second data transmission equipment converts the service request data into second data and transmits the second data to the first data transmission equipment through the network.
After receiving the service request data sent by the data sending device, the data receiving device may send corresponding response data to the data sending device, where the response data may be the first frame data of IS 015765.
The first data sent by the data sending device to the first data transmission device includes, in addition to the response data in the format of the first frame data of IS015765, other bus data sent by the data receiving device, and these other bus data may be continuous frame data or bus data similar to the format of the first frame data of IS 015765.
Step S220, determine whether the first data is ISO15765 first frame data.
In some embodiments, the first data may comprise ISO15765 single frame data, each frame of data may comprise a plurality of bytes, for example 8 bytes,
the first frame data may refer to first frame data of the first data, and the single frame data may be one frame of bus data.
Since the standard for can is a maximum of 8 bytes of data in a frame. However, the length of command data of the Universal Diagnostic Services (UDS) may be greater than 8 bytes, and if the command data of the UDS cannot be transmitted through a frame of bus data, it needs to transmit data in multiple frames, where the first frame of bus data is the first frame of data and the data following the first frame of data is continuous frame data.
After receiving the first data, the first data transmission device may parse the first data, and extract the upper four bits of the first byte of the first data from the first data, where if the upper four bits of the first byte of the first data are 0, the first data is ISO15765 single-frame data; if the upper four bits of the first byte of the first data are 1, the first data is the first frame data of ISO 15765.
If the first data transmission apparatus determines that the first data is the data of the first frame of ISO15765, step S230 is further executed.
S230, if the first data is the first frame data of ISO15765, obtaining a response candid and a first service request ID of the first data, and searching whether there are a matching request candid and a second service request ID in a preset configuration file based on the response candid and the first service request ID, where the request candid and the second service request ID are information carried by second data sent by the data sending device to the first data transmission device.
In some embodiments, the second data is transparent transmission data corresponding to service request data sent by the data sending device to the data receiving device, and the information carried by the second data and the service request data is the same.
After receiving the service request data sent by the data sending device, the data receiving device sends response data to the data sending device. The response data sent by the data receiving device is sent to the first data transmission device in the form of bus data, however, when the data receiving device sends the bus data, the data receiving device sends bus data except the response data, so that after receiving the first data sent by the data receiving device, the first transmission device needs to parse the first data to obtain a response CANID of the first data and a first service request ID, and searches whether a matched request CANID and a second service request ID exist in a preset configuration file based on the response CANID of the first data and the first service request ID of the first data, if the request CANID and the second service request ID which are matched with the response CANID and the first service request ID do not exist in the preset configuration file, it CAN be determined that the first data is not the response data of the second data, the first data CAN be directly converted into transparent transmission data and transmitted to the second data transmission device, and the transparent transmission data is converted into flow control data by the second data transmission device, and transmitted to the data sending device through the CAN bus without sending non-frame data of the first data, and the non-frame data is not transmitted to the data.
If there are a request candid and a second service request ID matching the response candid and the first service request ID in the preset configuration file, it may be determined that the first data is response data of the second data, and step S240 is further performed.
Wherein the configuration file stores a request candid and a response candid matching the request candid. The request caidd and the second service request ID are information carried by second data sent by the data sending device to the first data transmission device, and the request caidd and the second service request ID can be obtained by analyzing the second data.
S240, sending the stream control frame data to the data receiving device based on the first data.
In some embodiments, if there are a request candid and a second service request ID matching the response candid and the first service request ID in the preset configuration file, the flow control frame data may be sent to the data receiving device based on the first data, so that the flow control frame data may be accurately replaced, and the reliability of replacing the flow control frame data is improved.
It should be understood that, in the above steps S210 to S240, since the flow control frame data is sent based on the first data after the first data is determined to be the first frame data of ISO15765 and the matching request casid and second service request ID can be found in the preset configuration file based on the response casid of the first data and the first service request ID, the flow control frame data can be sent based on the first data after the second data corresponding to the first data is determined to exist, and it can be avoided that the bus data of other similar first frame data of ISO15765 sent by the data receiving device is erroneously determined to be the first frame data of ISO15765 needing to replace the flow control frame data and the flow frame data is sent based on the bus data of other similar first frame data of ISO15765, so that the accuracy of replacing flow control can be improved, and the problem that transmission of remote data fails due to erroneously determining some bus data as the first frame data of ISO15765 can be solved.
In some embodiments, on the basis of the embodiment of the data transmission method shown in fig. 2, before sending the stream control frame data to the data receiving device based on the first data in step S230, the method may include the following steps:
and 11, acquiring the response CAN channel number of the first data.
And step 12, searching whether a matched request CAN channel number exists in a preset configuration file based on the response CAN channel number.
It should be understood that, in the above steps 11 to 12, the request CAN channel number matching the response CAN channel number may be searched in the preset configuration file before the flow control frame is sent, so that after it is further determined that the second data corresponding to the first data exists, the flow control frame data is sent based on the first data, and the accuracy of the flow control frame data is further improved.
In some embodiments, on the basis of the above-mentioned embodiment of the data transmission method shown in fig. 2, before the step S210 of acquiring the first data, the following steps may be further included:
and step 21, acquiring second data.
In some embodiments, when the data sending device and the data receiving device communicate, the data sending device and the data receiving device are in a one-to-one form, so that if the bus data sent by the data sending device is service request data, the bus data sent by the data receiving device to the data sending device is response data, and the two data are in a one-to-one correspondence relationship.
After receiving the service request data sent by the data sending equipment, the second data transmission equipment converts the service request data into second data, transmits the second data to the first data transmission equipment through the network, and then converts the second data into the service request data and sends the service request data to the data receiving equipment by the first data transmission equipment.
Step 22, judging whether the second data is ISO15765 single frame data or first frame data;
step 23, if the second data is ISO15765 single frame data or first frame data, acquiring a request CAN channel number, a request CANID and a second service request ID of the second data;
and 24, storing the request CAN channel number, the request CANID and the second service request ID into a preset data structure.
In a specific embodiment of the present application, after receiving second data sent by a data sending device, a first data transmission device first parses the second data, extracts high four bits of a first byte of the second data, and if the high four bits of the first byte of the second data are 0, the second data is ISO15765 single-frame data; if the upper four bits of the first byte of the second data are 1, the second data is the first frame data of ISO 15765.
After the second data is determined to be the first frame data or the single frame data of the ISO15765, the first frame data or the single frame data of the ISO15765 CAN be analyzed, the CAN channel number, the request CAN ID and the second service request ID of the first frame data or the single frame data of the ISO15765 are extracted, and the extracted CAN channel number, the request CAN ID and the second service request ID are stored.
The second data may be stored in a preset data structure, where the preset data structure may be an array, and the like, without limitation.
The storage of the request CAN channel number, the request CAN ID and the second service request ID in the array may be as follows:
Struct rev_id
{
uint8_t can_id[5];
int can_channel;
uint8_t sid;
}
where can _ ID [5] is used to store the request CANID, can _ channel is used to store the CANID channel number, and sid is used to store the service request ID.
The data structure is stored in the first data transmission device, or may be stored in a separate storage medium, as long as the first data transmission device can operate the data structure, which is not limited herein. Here, the operation refers to accessing, modifying, deleting, or the like.
It should be understood that, in the above steps 21 to 24, the first data transmission device may store the request CAN channel number, the request CAN ID and the second service request ID of the first frame data or the single frame data sent by the data sending device for subsequent use.
In some embodiments, on the basis of the embodiment of the data transmission method shown in fig. 2, after acquiring the request CAN channel number, the request CAN ID and the second service request ID of the second data in step 23, the following steps may be further implemented:
step 31, searching whether the request CAN channel number and the request CANID exist in the preset data structure;
and step 32, if the second service request ID exists, updating the second service request ID stored in the preset data structure and corresponding to the request CAN channel number and the request caidd by using the current second service request ID.
It should be appreciated that the above steps 31 to 32, storing only the above request CAN channel number and the last second service request ID under the above request CAN ID, is advantageous for saving memory space.
In some embodiments, on the basis of the above-mentioned embodiment of the data transmission method shown in fig. 2, step S230 may be implemented by searching whether there are matching request candid and second service request ID in a preset configuration file based on the response candid and the first service request ID, and includes the following steps:
and step 41, searching whether a matched request CANID exists in the preset configuration file based on the response CANID.
And step 42, if the request exists, acquiring a second service request ID corresponding to the request CANID from the preset data structure.
Step 43, if the first service request ID is equal to the second service request ID plus 0x40, it is determined that there are a request CANID and a second service request ID matching the response CANID and the first service request ID in a preset configuration file.
In some embodiments of the present application, since the data receiving device must respond to the service request sent by the data sending device, the first byte of the response message is the service request id +0x40 sent by the data sending device. For example, the data transmission apparatus transmits service request data having the second service request ID of 0x22, and the first byte of response data returned by the data reception apparatus, i.e., the first service request ID, is 0x62, i.e., 0 × 22+0 × 40.
After receiving the first data, the first data transmission device may analyze the first data, extract the caidd channel number of the first data and the response caidd of the first data, and then read a preset configuration file to obtain a request caidd matching the response caidd of the first data.
If the CANID channel number of the second data sent by the data sending equipment stored in the preset data structure is 1, the request CANID is 0x0617, and the second service request ID is 0x22; and the response caid of the first data is 0x0617, and the first byte of the first data, i.e. the first service request ID is0 × 22+0 × 40, indicates that the relationship between the service request data and the response data is between the first data and the second data. If the data with the second service request ID of 0x22 is not stored in the preset data structure, it indicates that no data is stored in the preset data structure or other service request data is stored in the preset data structure, and it may be determined that the first data received by the first data transmission device is not response data to the service request data sent by the data reception device, and the flow control frame data is not sent to the data reception device.
It should be understood that, in the above steps 41 to 43, it may be determined that the first data is response data of the second data, bus data that is not the response data may be filtered, and only the flow control frame data is sent for the response data, which is more accurate.
In some embodiments, on the basis of the embodiment of the data transmission method shown in fig. 2, step S240 of sending the flow control frame data to the data receiving device based on the first data may be implemented by:
and step 51, searching the flow control frame data corresponding to the response CANID in the preset configuration file.
And step 52, sending the flow control frame data to the data receiving equipment.
In an embodiment of the present application, the preset configuration file further stores a corresponding relationship between the response caidd and the stream control frame data, and the first data transmission device may search the preset configuration file, search the stream control frame data corresponding to the response caidd of the first data from the configuration file, and then send the stream control frame data to the data receiving device.
It should be understood that the above steps 51 to 52 may implement sending the corresponding flow control frame data to the data sending device.
In some embodiments, on the basis of the embodiment of the data transmission method shown in fig. 2, before or after the step S240 sends the flow control frame data to the data receiving device based on the first data, the method may further include the following steps:
and step 61, deleting the request CAN channel number, the request CAN ID and the second service request ID stored in the preset data structure.
It should be understood that, in the step 61, since the UDS specifies that the data sending device sends the service request and the data receiving device responds, and a communication manner of one question and one answer is provided between the two devices, in the case that the data receiving device has responded to the response data, it is not necessary to store the information of the service request data in the preset data structure, so that the data in the preset data structure can be deleted to save the storage space of the first data transmission device.
Corresponding to the data transmission method shown in fig. 3, fig. 3 shows a data transmission apparatus M100 provided in this embodiment of the present application, where the data transmission apparatus M100 is built in a data transmission device in a data transmission system, the data transmission system further includes a data sending device and a data receiving device, where the data transmission device is in communication connection with the data sending device and the data receiving device, respectively, and the data transmission apparatus M100 includes:
a first data obtaining module M110, configured to obtain first data, where the first data is bus data sent by the data receiving device to the first data transmission device;
a first determining module M120, configured to determine whether the first data is ISO15765 first frame data;
a first searching module M130, configured to, if the first data is first frame data of ISO15765, obtain a response candid and a first service request ID of the first data, and search, based on the response candid and the first service request ID, whether there is a matching request candid and a second service request ID in a preset configuration file, where the request candid and the second service request ID are information carried by second data sent by the data sending device to the first data transmission device;
and a flow control frame sending module M140, configured to send flow control frame data to the data receiving device based on the first data if the flow control frame exists.
Optionally, the data transmission apparatus M100 further includes:
and the second searching module is used for acquiring the response CAN channel number of the first data and searching whether the matched request CAN channel number exists in a preset configuration file based on the response CAN channel number.
Optionally, the data transmission apparatus M100 further includes:
the second data acquisition module is used for acquiring the second data;
the second judging module is used for judging whether the second data is ISO15765 single-frame data or first-frame data;
a request data obtaining module, configured to obtain a request CAN channel number, a request CAN ID, and a second service request ID of the second data if the second data is ISO15765 single-frame data or first-frame data;
and the request data storage module is used for storing the request CAN channel number, the request CANID and the second service request ID into a preset data structure.
Optionally, the data transmission apparatus M100 further includes;
a third searching module, configured to search, in the preset data structure, whether the request CAN channel number and the request CAN id exist;
and if the second service request ID exists, updating the second service request ID which is stored in the preset data structure and corresponds to the request CAN channel number and the request CANID by using the current second service request ID.
Optionally, the first lookup module M130 includes:
a first searching unit, configured to search, based on the response candid, whether there is a matching request candid in the preset configuration file;
a service request ID obtaining unit, configured to obtain, if the service request ID exists, a second service request ID corresponding to the request candid from the preset data structure;
a determining unit, configured to determine that a request candid and a second service request ID that match the response candid and the first service request ID exist in a preset configuration file if the first service request ID is equal to the second service request ID plus 0x40.
Optionally, the flow control frame sending module M140 includes:
a second searching unit, configured to search, in the preset configuration file, flow control frame data corresponding to the response caidd;
and the flow control frame sending unit is used for sending the flow control frame data to the data receiving equipment.
Optionally, the data transmission apparatus M100 further includes:
and the request data deleting module is used for deleting the request CAN channel number, the request CANID and the second service request ID which are stored in the preset data structure. It is to be understood that various implementations and combinations of implementations in the above embodiments and their advantages are also applicable to this embodiment, and are not described herein again.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 4, the electronic device D10 of this embodiment includes: at least one processor D100 (only one is shown in fig. 4), a memory D101, and a computer program D102 stored in the memory D101 and operable on the at least one processor D100, wherein the processor D100 implements the steps of any of the method embodiments described above when executing the computer program D102. Alternatively, the processor D100, when executing the computer program D102, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules M110 to M140 shown in fig. 3.
In some embodiments, the processor D100, when executing the computer program D102, performs the following steps:
acquiring first data, wherein the first data is bus data sent to the first data transmission equipment by the data receiving equipment;
judging whether the first data is ISO15765 first frame data;
if the first data is the first frame data of ISO15765, acquiring a response caidd and a first service request ID of the first data, and searching whether a matching request caidd and a second service request ID exist in a preset configuration file based on the response caidd and the first service request ID, where the request caidd and the second service request ID are information carried by second data sent by the data sending device to the first data transmission device;
and if so, sending flow control frame data to the data receiving equipment based on the first data.
When the processor D100 executes the computer program D102, before the sending of the flow control frame data to the data receiving device based on the first data is implemented, the method may further include the following steps:
acquiring a response CAN channel number of the first data;
and searching whether a matched request CAN channel number exists in a preset configuration file based on the response CAN channel number.
When the processor D100 executes the computer program D102, before implementing the acquiring the first data, the following steps may be further performed:
acquiring the second data;
judging whether the second data is ISO15765 single-frame data or first-frame data;
if the second data is ISO15765 single-frame data or first-frame data, acquiring a request CAN channel number, a request CANID and a second service request ID of the second data;
and storing the request CAN channel number, the request CANID and the second service request ID into a preset data structure.
When the processor D100 executes the computer program D102, after implementing the request CAN channel number, the request CAN ID and the second service request ID for obtaining the second data, the following steps may be further performed:
searching whether the request CAN channel number and the request CANID exist in the preset data structure;
and if so, updating a second service request ID which is stored in the preset data structure and corresponds to the request CAN channel number and the request CANID by using the current second service request ID.
When the processor D100 executes the computer program D102, when the finding whether there is a matching request candid and a second service request ID in a preset configuration file based on the response candid and the first service request ID is implemented, the method may include the following steps:
searching whether a matched request CANID exists in the preset configuration file based on the response CANID;
if the request exists, acquiring a second service request ID corresponding to the request CANID from the preset data structure;
and if the first service request ID is equal to the second service request ID plus 0x40, determining that a request CANID and a second service request ID which are matched with the response CANID and the first service request ID exist in a preset configuration file.
When the processor D100 executes the computer program D102, the method for sending flow control frame data to the data receiving device based on the first data may include the following steps:
searching flow control frame data corresponding to the response CANID in the preset configuration file;
and sending the flow control frame data to the data receiving equipment.
When the processor D100 executes the computer program D102, before or after the sending of the flow control frame data to the data receiving device based on the first data is implemented, the following steps may be further performed:
and deleting the request CAN channel number, the request CANID and the second service request ID stored in the preset data structure.
The electronic device D10 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The electronic device may include, but is not limited to, a processor D100, a memory D101. Those skilled in the art will appreciate that fig. 4 is merely an example of the electronic device D10, and does not constitute a limitation of the electronic device D10, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
Processor D100 may be a Central Processing Unit (CPU), and processor D100 may be other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage D101 may be an internal storage unit of the electronic device D10 in some embodiments, for example, a hard disk or a memory of the electronic device D10. In other embodiments, the memory D101 may also be an external storage device of the electronic device D10, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device D10. Further, the memory D101 may also include both an internal storage unit and an external storage device of the electronic device D10. The memory D101 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer programs. The memory D101 may also be used to temporarily store data that has been output or is to be output.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the foregoing method embodiments may be implemented.
Embodiments of the present application provide a computer program product, which when executed on an electronic device, enables the electronic device to implement the steps in the above method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A data transmission method, applied to a first data transmission device in a data transmission system, the data transmission system further including a data sending device, a data receiving device and a second data transmission device, wherein the first data transmission device is connected to the second data transmission device and the data receiving device, respectively, and the method includes:
acquiring first data, wherein the first data is bus data sent to the first data transmission equipment by the data receiving equipment;
judging whether the first data is ISO15765 first frame data;
if the first data is the first frame data of ISO15765, acquiring a response caidd and a first service request ID of the first data, and searching whether a matching request caidd and a second service request ID exist in a preset configuration file based on the response caidd and the first service request ID, where the request caidd and the second service request ID are information carried by second data sent by the data sending device to the first data transmission device;
and if so, sending the flow control frame data to the data receiving equipment based on the first data.
2. The data transmission method according to claim 1, wherein before the sending the flow control frame data to the data receiving device based on the first data, further comprising:
acquiring a response CAN channel number of the first data;
and searching whether a matched request CAN channel number exists in a preset configuration file based on the response CAN channel number.
3. The data transmission method of claim 2, wherein prior to said obtaining the first data, further comprising:
acquiring the second data;
judging whether the second data is ISO15765 single-frame data or first-frame data;
if the second data is ISO15765 single-frame data or first-frame data, acquiring a request CAN channel number, a request CANID and a second service request ID of the second data;
and storing the request CAN channel number, the request CANID and the second service request ID into a preset data structure.
4. The data transmission method according to claim 3, further comprising, after the request CAN channel number, the request CAN ID, and the second service request ID for obtaining the second data;
searching whether the request CAN channel number and the request CANID exist in the preset data structure;
and if so, updating a second service request ID which is stored in the preset data structure and corresponds to the request CAN channel number and the request CANID by using the current second service request ID.
5. The data transmission method according to claim 4, wherein the searching whether there is a matching request CANID and second service request ID in a preset configuration file based on the response CANID and the first service request ID comprises:
searching whether a matched request CANID exists in the preset configuration file based on the response CANID;
if the request exists, acquiring a second service request ID corresponding to the request CANID from the preset data structure;
and if the first service request ID is equal to the second service request ID plus 0x40, determining that a request CANID and a second service request ID which are matched with the response CANID and the first service request ID exist in a preset configuration file.
6. The data transmission method according to claim 5, wherein the sending flow control frame data to the data receiving device based on the first data comprises:
searching flow control frame data corresponding to the response CANID in the preset configuration file;
and sending the flow control frame data to the data receiving equipment.
7. The data transmission method according to claim 6, wherein before or after said sending the stream control frame data to the data receiving device based on the first data, further comprising:
and deleting the request CAN channel number, the request CANID and the second service request ID which are stored in the preset data structure.
8. A data transmission device is characterized in that the data transmission device is arranged in data transmission equipment in a data transmission system, the data transmission system further comprises data sending equipment and data receiving equipment, wherein the data transmission equipment is respectively in communication connection with the data sending equipment and the data receiving equipment, and the data transmission device comprises:
a first data obtaining module, configured to obtain first data, where the first data is bus data sent by the data receiving device to the first data transmission device;
the first judging module is used for judging whether the first data is ISO15765 first frame data;
a first searching module, configured to obtain a response caidd and a first service request ID of the first data if the first data is first frame data of ISO15765, and search, based on the response caidd and the first service request ID, whether a matching request caidd and a second service request ID exist in a preset configuration file, where the request caidd and the second service request ID are information carried by second data sent by the data sending device to the first data transmission device;
and the flow control frame sending module is used for sending flow control frame data to the data receiving equipment based on the first data if the flow control frame data exists.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data transmission method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the data transmission method according to any one of claims 1 to 7.
CN202211372813.4A 2022-11-03 2022-11-03 Data transmission method and device, electronic equipment and storage medium Pending CN115834281A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211372813.4A CN115834281A (en) 2022-11-03 2022-11-03 Data transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211372813.4A CN115834281A (en) 2022-11-03 2022-11-03 Data transmission method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115834281A true CN115834281A (en) 2023-03-21

Family

ID=85526530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211372813.4A Pending CN115834281A (en) 2022-11-03 2022-11-03 Data transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115834281A (en)

Similar Documents

Publication Publication Date Title
CN114048164B (en) Chip interconnection method, system, device and readable storage medium
CN113608483B (en) Method for acquiring vehicle signal value, electronic equipment and electronic control unit
CN108964972B (en) Method, device and system for managing computing nodes
CN114553373A (en) Data transmission method, device, equipment and storage medium
CN112445630B (en) Information interaction method and device and terminal equipment
CN111552268B (en) Vehicle remote diagnosis method, equipment connector and vehicle connector
CN113645097A (en) Vehicle signal monitoring method, terminal equipment and electronic control unit
CN115134236A (en) Intelligent network card management method, device, equipment and readable medium
CN115834281A (en) Data transmission method and device, electronic equipment and storage medium
CN113498597A (en) PCIe-based data transmission method and device
CN114338270B (en) Data communication method, device, electronic equipment and storage medium
CN113242169B (en) Multi-slave data updating method, system, equipment and storage medium
CN114513385B (en) Data transmission method, device, electronic equipment and storage medium
CN115562246A (en) Remote diagnosis method and related equipment
CN112910902B (en) Data analysis method and device, electronic equipment and computer readable storage medium
CN114326673A (en) Vehicle remote diagnosis method and device, connector and storage medium
CN114756585A (en) Vehicle data acquisition method and device, electronic equipment and storage medium
CN111541697B (en) On-line communication method based on protocol configuration
CN112395147A (en) Debugging device on SOC
CN114615105B (en) Data transmission method, device, electronic equipment, system and storage medium
CN117640676A (en) Signal processing method, device, vehicle and storage medium
CN114884768B (en) Detection device, system and detection method for bus idle state
CN112566082B (en) Data transmission method, device, equipment and medium
US20230208676A1 (en) Data communication method and apparatus, electronic device, and storage medium
CN112291131B (en) CAN signal automatic analysis device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination