Data transmission method, apparatus, device, and system

By introducing a data request and response mechanism into the field of automotive electronics, a reliable protocol framework is established. Combined with timer and loop value mechanisms, the problem of low efficiency in existing data transmission protocols is solved, and reliable and efficient data transmission between the host computer and the domain controller is realized.

CN119254857BActive Publication Date: 2025-12-19DONGFENG MOTOR GRP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411351451.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-12-19
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

Existing inter-board data exchange protocols are inefficient in the automotive electronics field and lack rigorous timeout retransmission mechanisms, leading to network storms and data loss problems.

Method used

By introducing two data types, data request and response, a reliable protocol framework is built. Combined with timer and loop value mechanisms, data is transmitted based on the detection results, ensuring the reliability and efficiency of data between the host computer and the domain controller.

Benefits of technology

It improves the reliability and efficiency of data transmission, avoids network storms, and ensures reliable data transmission between the host computer and the domain controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254857B_ABST
    Figure CN119254857B_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method, device, equipment and system, relates to the technical field of automobile electronics, and the data transmission method is applied to a data sending end, and the method comprises the following steps: encapsulating to-be-transmitted data according to a preset data protocol to obtain a request data packet; sending the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet; detecting whether the response data packet fed back by the data receiving end is received within a preset time length to obtain a detection result; and transmitting the to-be-transmitted data according to the detection result. By introducing two data types of data request and response, a framework of a reliable protocol is built, so that data between an upper computer and a domain controller can be reliably transmitted. Finally, two mechanisms of a timer and a cycle value are added according to the functionality of each module in a cyclic algorithm, so that the efficiency of the data protocol is improved on the basis of guaranteeing reliable retransmission of the data protocol on the basis of user self-definition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of automotive electronics, in particular to a data transmission method, device, equipment and system. BACKGROUND

[0002] In the field of automotive electronics, executable programs running in the domain controller are called lower machines, which usually implement related algorithm functions, but in the development and debugging stage, in order to improve the efficiency of research and development, the upper machine running on the PC side is usually used. The most common interaction between the PC side upper machine and the lower machine on the domain controller side is data interaction. The reliability of data interaction is an important factor. Due to network and domain controller CPU scheduling problems, data interaction between the upper machine and the domain controller may be lost, so a reliable communication protocol is needed. On the other hand, the amount of data interaction between the upper machine and the domain controller is large, so the communication efficiency also needs to be considered. The existing inter-board data interaction generally does not set reliable transmission, even if it does, it is a simple timeout retransmission mechanism, and there is no strict timeout retransmission mechanism. This simple timeout retransmission mechanism will cause network storm and low transmission efficiency. SUMMARY

[0003] The main purpose of the present application is to provide a data transmission method, device, equipment and system, which aims to solve the technical problem of low efficiency of the existing data transmission protocol.

[0004] To achieve the above purpose, the present application provides a data transmission method, which is applied to a data sending end, and the method comprises:

[0005] According to a preset data protocol, the to-be-transmitted data is encapsulated to obtain a request data packet;

[0006] The request data packet is sent to a data receiving end, so that the data receiving end feeds back an answer data packet according to the request data packet;

[0007] It is detected whether the answer data packet fed back by the data receiving end is received within a preset time length, and a detection result is obtained;

[0008] According to the detection result, the to-be-transmitted data is transmitted.

[0009] In an embodiment, the step of transmitting the to-be-transmitted data according to the detection result comprises:

[0010] When the detection result is that the answer data packet fed back by the data receiving end is received within the preset time length, the corresponding data transmission state is determined according to the answer data packet;

[0011] When the data transmission state is a transmission success state, the transmission of the to-be-transmitted data is completed.

[0012] In an embodiment, the step of transmitting the to-be-transmitted data according to the detection result comprises:

[0013] When the detection result is that no response data packet is received from the data receiving end within a preset time length, a corresponding data protocol type, a module function type, and a current cycle retransmission number are determined according to the request data packet;

[0014] A corresponding timeout number threshold and a cycle retransmission number threshold are determined according to the data protocol type and the module function type;

[0015] When the current timeout number is less than the timeout number threshold, data transmission is performed according to the current cycle retransmission number and the cycle retransmission number threshold.

[0016] In an embodiment, the step of performing data transmission according to the current cycle retransmission number and the cycle retransmission number threshold when the current timeout number is less than the timeout number threshold comprises:

[0017] The current cycle retransmission number and the cycle retransmission number threshold are compared when the current timeout number is less than the timeout number threshold;

[0018] When the current cycle retransmission number is less than the cycle retransmission number threshold, the current cycle retransmission number is updated according to a preset cycle number to obtain an updated cycle retransmission number;

[0019] An updated request data packet is obtained according to the updated cycle retransmission number, and the updated request data packet is sent to the data receiving end.

[0020] In an embodiment, after the step of determining a corresponding data transmission state according to the response data packet when the detection result is that the response data packet is received from the data receiving end within a preset time length, the method further comprises:

[0021] When the data transmission state is a transmission failure state, a corresponding data protocol type, a module function type, and a current cycle retransmission number are determined according to the request data packet;

[0022] A corresponding cycle retransmission number threshold is determined according to the data protocol type and the module function type;

[0023] When the current cycle retransmission number is less than the cycle retransmission number threshold, the current cycle retransmission number is updated according to a preset cycle number to obtain an updated cycle retransmission number;

[0024] An updated request data packet is obtained according to the updated cycle retransmission number, and the updated request data packet is sent to the data receiving end.

[0025] To achieve the above object, the application provides a data transmission method, which is applied to a data receiving end, and the method comprises the following steps:

[0026] When a request data packet sent by a data sending end is received, a target check value is obtained by performing check calculation on the request data packet according to a preset check algorithm;

[0027] The target check value is compared with an initial check value in the request data packet to obtain a data check result;

[0028] When the data check result is data check success, the data protocol type of the request data packet is compared with a target protocol type;

[0029] When the data protocol type of the request data packet is inconsistent with the target protocol type, the data transmission is stopped.

[0030] In an embodiment, after the step of comparing the data protocol type of the request data packet with the target protocol type when the data check result is data check success, the method further comprises the following steps:

[0031] When the data protocol type of the request data packet is consistent with the target protocol type, the request data packet is updated according to a success response protocol to obtain a response data packet;

[0032] The response data packet is sent to the data sending end.

[0033] In addition, to achieve the above object, the application further provides a data transmission device, which is applied to a data sending end, and the data transmission device comprises the following modules:

[0034] An encapsulation module is configured to encapsulate to-be-transmitted data according to a preset data protocol to obtain a request data packet;

[0035] A sending module is configured to send the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet;

[0036] A processing module is configured to detect whether the response data packet fed back by the data receiving end is received within a preset time length to obtain a detection result;

[0037] A transmission module is configured to transmit the to-be-transmitted data according to the detection result.

[0038] In addition, to achieve the above object, the application further provides a data transmission device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the data transmission method.

[0039] In addition, to achieve the above object, the application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the data transmission method.

[0040] In addition, to achieve the above object, the application further provides a data transmission system, which comprises the data sending end and the data receiving end.

[0041] The application encapsulates the to-be-transmitted data according to a preset data protocol to obtain a request data packet, sends the request data packet to the data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet, detects whether the response data packet fed back by the data receiving end is received within a preset time length to obtain a detection result, and transmits the to-be-transmitted data according to the detection result. By introducing two data types of data request and response, a framework of a reliable protocol is built, so that the data between the upper computer and the domain controller can be reliably transmitted. Finally, according to the functionality of each module, a timer and a cycle value mechanism are added according to a cyclic algorithm, which can ensure the efficiency of the data protocol on the basis of ensuring reliable retransmission of the data protocol on the basis of user self-definition. BRIEF DESCRIPTION OF DRAWINGS

[0042] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the application and, together with the specification, serve to explain the principles of the application.

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without creative labor.

[0044] Figure 1 A flowchart is provided for the data transmission method embodiment one of the application applied to the data sending end;

[0045] Figure 2 A data protocol diagram is provided for the data transmission method embodiment one of the application applied to the data sending end;

[0046] Figure 3A data protocol type interaction model schematic diagram provided by the data transmission method embodiment one of the data transmission method applied to the data sending end of the application;

[0047] Figure 4 A data protocol total framework schematic diagram provided by the data transmission method embodiment one of the data transmission method applied to the data sending end of the application;

[0048] Figure 5 A request REQ protocol reliability verification process schematic diagram provided by the data transmission method embodiment one of the data transmission method applied to the data sending end of the application;

[0049] Figure 6 A flow schematic diagram provided by the data transmission method embodiment two of the data transmission method applied to the data receiving end of the application;

[0050] Figure 7 A data receiving end protocol processing flow schematic diagram provided by the data transmission method embodiment two of the data transmission method applied to the data receiving end of the application;

[0051] Figure 8 A cycle value calculation algorithm schematic diagram of each module provided by the data transmission method embodiment two of the data transmission method applied to the data receiving end of the application;

[0052] Figure 9 A module structure schematic diagram of the data transmission device applied to the data sending end of the application;

[0053] Figure 10 A device structure schematic diagram of the hardware running environment involved in the data transmission method in the embodiment of the application;

[0054] Figure 11 A module structure schematic diagram of the data transmission system in the embodiment of the application.

[0055] The purpose implementation, function characteristics and advantages of the application will be further explained by combining with the embodiments and referring to the drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the application, and are not used to limit the application.

[0057] In order to better understand the technical solutions of the application, the following will be described in detail by combining with the drawings of the specification and specific embodiments.

[0058] The main solution of the embodiment of the application is: encapsulating the to-be-transmitted data according to a preset data protocol to obtain a request data packet; sending the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet; detecting whether the response data packet fed back by the data receiving end is received within a preset time length to obtain a detection result; and transmitting the to-be-transmitted data according to the detection result.

[0059] In the field of automotive electronics, executable programs running in the domain controller are called lower machines, which usually implement related algorithm functions. However, in the development and debugging stage, in order to improve the efficiency of research and development, the upper machine running on the PC side is usually used in cooperation. The most common interaction between the PC side upper machine and the domain controller side lower machine is data interaction. The reliability of data interaction is an important factor. Due to network and domain controller CPU scheduling problems, data interaction between the upper machine and the domain controller may be lost, so a reliable communication protocol is needed. On the other hand, the amount of data interaction between the upper machine and the domain controller is large, so the communication efficiency also needs to be considered. The existing inter-board data interaction generally does not set reliable transmission, even if it does, it is a simple timeout retransmission mechanism, and there is no strict timeout retransmission mechanism. This simple timeout retransmission mechanism can cause network storm and low transmission efficiency.

[0060] The application encapsulates the to-be-transmitted data according to a preset data protocol to obtain a request data packet; sends the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet; detects whether the response data packet fed back by the data receiving end is received within a preset time length to obtain a detection result; and transmits the to-be-transmitted data according to the detection result. By introducing two types of data, data request and response, a framework of a reliable protocol is built, so that data between the upper machine and the domain controller can be reliably transmitted. Finally, according to the functionality of each module, a timer and a loop value mechanism are added according to a loop algorithm, which can ensure the efficiency of the data protocol on the basis of ensuring reliable retransmission of the data protocol on the basis of user-defined.

[0061] It should be noted that the execution subject of the embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a data transmission device capable of realizing the above functions. The data transmission device is taken as an example to illustrate the embodiment and the following embodiments.

[0062] Based on this, the embodiment of the application provides a data transmission method, which is applied to a data sending end, and the data transmission method comprises the steps of Figure 1 , Figure 1 The flowchart of the first embodiment of the data transmission method applied to the data sending end of the application is shown in the figure.

[0063] In the embodiment, the data transmission method comprises steps S10-S40:

[0064] In step S10, the data to be transmitted is encapsulated according to a preset data protocol to obtain a request data packet.

[0065] It should be noted that the domain controller and the host computer in the embodiment interact with each other through a network, and lightweight communication group (LCM) protocol is used for underlying data transmission. In order to realize reliable communication, a custom data protocol packet is encapsulated in the application layer. The custom data protocol design scheme is as shown in Figure 2 The custom data protocol includes an 18-byte byte header and an M-byte data field. The M bytes are filled with actual data. The protocol header is used for data verification and reliable communication information transmission. Before sending the protocol data, the packet is uniformly encapsulated, and the data segment is unpacked. The 18-byte byte header is specifically defined as shown in Table 1.

[0066] Table 1

[0067]

[0068] It should be noted that the data types between the domain controller and the host computer in the embodiment include request and response, as shown in Figure 3 When the data sending end needs to send data, the data type is the request protocol REQ. After sending the data, a timer is started. When the data receiving end receives the correct REQ request protocol data, it will immediately send the response protocol ACK. After the data sending end receives the response protocol ACK with the same ID, the timer stops timing. At this time, a complete data protocol process is completed.

[0069] It should be understood that the total framework of the data protocol in the embodiment is as shown in Figure 4 The main functions include data sending callback function, data receiving callback function and error event. The host computer and the domain controller both include the three types of events. The data sending callback function 101 is mainly responsible for sending data, including filling and encapsulating the packet, starting the timer after sending the packet, and then waiting for the response. The data receiving callback function 102 is mainly responsible for receiving data, including unpacking, CRC verification and feedback. The error event module 103 is mainly responsible for determining whether the data packet is correct, including timer threshold determination and CRC verification determination.

[0070] It should be understood that the preset data protocol refers to the pre-set request data protocol (REQ, Request Data Protocol), that is, the custom data protocol in the embodiment. The data to be transmitted refers to the actual data to be transmitted. The request data packet refers to the encapsulated data packet with the request protocol type.

[0071] In a specific implementation, the actual data to be transmitted is encapsulated according to a preset request data protocol to obtain an encapsulated data packet of the data type of the request protocol, that is, the actual data to be transmitted is filled into the M-byte data field of the custom data protocol for encapsulation, and finally an encapsulated data packet of the data type of the request protocol is obtained from the 18-byte byte header and the M-byte data field.

[0072] Step S20, sending the request data packet to a data receiving end, so that the data receiving end feeds back an answer data packet according to the request data packet;

[0073] It can be understood that the answer data packet refers to a data packet of the data type of the answer protocol.

[0074] In a specific implementation, the encapsulated data packet of the data type of the request protocol is sent to the data receiving end, so that the data receiving end feeds back a data packet of the answer protocol ACK to the data sending end immediately after receiving the correct REQ request protocol data, wherein the answer protocol ACK includes an answer OK ACK protocol and an answer FAIL ACK protocol, and in the answer mechanism, the OK ACK and the FAIL ACK are usually used to indicate whether the message is correctly processed.

[0075] Step S30, detecting whether the answer data packet fed back by the data receiving end is received within a preset time length to obtain a detection result;

[0076] It can be understood that the preset time length refers to a time length preset for monitoring whether the answer ACK protocol is received, and the detection result refers to a result of monitoring whether the answer ACK protocol data packet is received.

[0077] In a specific implementation, when the data sending end sends the request REQ data packet, a timer is started immediately, the timer is counted every 1 second, then the answer ACK protocol data packet of the data receiving end is waited for, and then if the answer ACK protocol is not received within the preset time length for monitoring whether the answer ACK protocol is received, the timer is waited for to be timed out; if the above is the FAIL ACK type, the timer is ended actively, which indicates that the receiving end does not receive the data or the received data is incorrect and the sender needs to resend the data; if the above is the OK ACK type, it indicates that the data interaction is successful, and the process is ended.

[0078] Step S40, transmitting the data to be transmitted according to the detection result.

[0079] It can be understood that the detection result includes a received ACK protocol data packet result and an un-received ACK protocol data packet result, and the received ACK protocol data packet result includes a FAIL ACK type and an OK ACK type data packet, and thus different data transmission modes are taken according to different detection results to transmit the to-be-transmitted data.

[0080] In a possible implementation, the step S40 can include steps A41-A42:

[0081] The step A41, when the detection result is that the response data packet fed back by the data receiving end is received within a preset time length, determining a corresponding data transmission state according to the response data packet;

[0082] It can be understood that the data transmission state includes a transmission failure state and a transmission success state.

[0083] In a specific implementation, when the detection result is that the response data packet fed back by the data receiving end is received within a preset time length, it is further needed to determine whether the protocol type Type in the protocol header is a FAIL ACK to determine the data transmission state, wherein if the protocol type is a FAIL ACK, the data transmission state is the transmission failure state; and if the protocol type is an OK ACK, the data transmission state is the transmission success state.

[0084] In a possible implementation, the step A41 can include steps B411-B414:

[0085] The step B411, when the data transmission state is the transmission failure state, determining a corresponding data protocol type, a module function type, and a current cycle retransmission number according to the request data packet;

[0086] It can be understood that the data protocol type includes a REQ protocol and an ACK protocol (OK ACK and FAIL ACK), the module function type includes Common, APA, Fusion, AVM, and MidWare, and the current cycle retransmission number refers to a protocol cycle sending number recorded in a byte header of the current request data packet.

[0087] In a specific implementation, when the data transmission state is the transmission failure state, it indicates that the data receiving end does not receive data or the received data is incorrect and needs to be repeatedly sent by the data sending end, and thus the corresponding data protocol type, the module function type, and the current protocol cycle sending number are determined according to the byte header of the request data packet.

[0088] The step B412, determining a corresponding cycle retransmission number threshold according to the data protocol type and the module function type;

[0089] It can be understood that the cycle retransmission number threshold refers to a critical value of the number of times for determining whether to send the current protocol data packet.

[0090] In a specific implementation, the same message cannot be repeatedly sent indefinitely in the embodiment, which will waste network bandwidth and cause subsequent messages to be unable to be sent. Therefore, it is determined whether the current protocol data packet is the same message according to the data protocol type, and if it is the same message, the critical value of the number of times for determining whether to send the current protocol data packet is determined according to the corresponding module function type.

[0091] Step B413, when the current cycle retransmission number is less than the cycle retransmission number threshold, updating the current cycle retransmission number according to a preset cycle number to obtain an updated cycle retransmission number;

[0092] It can be understood that the preset cycle number refers to a preset increased cycle number 1, and the updated cycle retransmission number refers to an updated protocol cycle transmission number.

[0093] In a specific implementation, the protocol cycle transmission number recorded in the byte header of the current request data packet is compared with the critical value of the number of times for determining whether to send the current protocol data packet. When the protocol cycle transmission number recorded in the byte header of the current request data packet is less than the critical value of the number of times for determining whether to send the current protocol data packet, it indicates that the data sending end needs to repeatedly send data, and then the updated protocol cycle transmission number is obtained by performing sum value calculation on the preset increased cycle number 1 and the protocol cycle transmission number recorded in the byte header of the current request data packet.

[0094] Step B414, obtaining an updated request data packet according to the updated cycle retransmission number, and sending the updated request data packet to a data receiving end.

[0095] In a specific implementation, the cycle code (CYCLE) in the byte header of the request data packet is adjusted based on the updated protocol cycle transmission number, and then the updated request data packet is obtained, and the updated request data packet is sent to the data receiving end to complete the repeated sending of data.

[0096] Step A42, when the data transmission state is a transmission success state, completing transmission of the to-be-transmitted data.

[0097] In a specific implementation, if the response ACK protocol data packet is received, it is necessary to determine whether the protocol type Type in the protocol header is FAIL ACK. If not, it indicates that the data transmission state is a transmission success state (the protocol type is OK ACK), that is, the data interaction is successful, and the process ends.

[0098] In an implementable embodiment, step S40 can include steps B41-B43:

[0099] Step B41, when the detection result is that no reply data packet is received from the data receiving end within a preset time length, determining the corresponding data protocol type, module function type, and current cycle retransmission number according to the request data packet;

[0100] In a specific implementation, when the detection result is that no reply data packet is received from the data receiving end within a preset time length, it indicates that the waiting timer is timed out, and thus the timer timeout number is determined according to the protocol type (Type) and module type (Module) of the sent data protocol packet, and then the corresponding data protocol type, module function type, and current protocol cycle sending number are determined according to the byte header of the request data packet.

[0101] Step B42, determining the corresponding timeout number threshold and cycle retransmission number threshold according to the data protocol type and the module function type;

[0102] It can be understood that the timeout number threshold refers to a timeout number critical value for determining whether to resend data.

[0103] In a specific implementation, in the present embodiment, the same message cannot be repeatedly sent indefinitely, which will waste network bandwidth and cause subsequent messages to be unable to be sent, and thus whether the current protocol data packet is the same message is determined according to the data protocol type, and if it is the same message, the number critical value for determining whether to send the current protocol data packet and the timeout number critical value for determining whether to resend data are determined according to the corresponding module function type.

[0104] Step B43, when the current timeout number is less than the timeout number threshold, performing data transmission according to the current cycle retransmission number and the cycle retransmission number threshold.

[0105] In a specific implementation, when the current waiting timer timeout number is less than the timeout number critical value for determining whether to resend data, it indicates that the condition for resending data is met, and when the protocol cycle sending number recorded in the byte header of the current request data packet is less than the number critical value for determining whether to send the current protocol data packet, it indicates that the data sending end needs to repeatedly send data, and then the updated protocol cycle sending number is obtained by performing sum value calculation on the previously set increased cycle number 1 and the protocol cycle sending number recorded in the byte header of the current request data packet, the cycle code (CYCLE) in the byte header of the request data packet is adjusted based on the updated protocol cycle sending number, and then the updated request data packet is obtained, and the updated request data packet is sent to the data receiving end to complete the repeated sending of data.

[0106] In one possible implementation, step B43 can include steps C431-C433:

[0107] Step C431, when the current timeout times is less than the timeout times threshold, comparing the current loop retransmission times with the loop retransmission times threshold.

[0108] It can be understood that, when the current waiting timer timeout times is less than the timeout times threshold for judging whether to retransmit data, the protocol loop sending times recorded in the byte header of the current request data packet is compared with the times threshold for judging whether to send the current protocol data packet.

[0109] Step C432, when the current loop retransmission times is less than the loop retransmission times threshold, updating the current loop retransmission times according to the preset loop times to obtain updated loop retransmission times.

[0110] In a specific implementation, when the protocol loop sending times recorded in the byte header of the current request data packet is less than the times threshold for judging whether to send the current protocol data packet, it indicates that the data sending end needs to repeatedly send data, and then the updated protocol loop sending times is obtained by summing the preset loop times 1 and the protocol loop sending times recorded in the byte header of the current request data packet.

[0111] Step C433, obtaining an updated request data packet according to the updated loop retransmission times, and sending the updated request data packet to the data receiving end.

[0112] In a specific implementation, the loop code (CYCLE) in the byte header of the request data packet is adjusted based on the updated protocol loop sending times, and then the updated request data packet is obtained, and the updated request data packet is sent to the data receiving end to complete the repeated data sending.

[0113] It should be noted that, if the interactive data in the embodiment is a REQ request data packet, a timer needs to be started and a subsequent sending reliability verification process needs to be performed, such as Figure 5The timer is started immediately after the sending data callback function sends the request REQ packet. The timer is counted every 1 second. Then, the ACK protocol packet is waited for. If the ACK protocol packet is received, it is determined whether the protocol type Type in the protocol header is FAIL ACK. If not, it is determined that the data interaction is successful, and the process ends. If the FAIL ACK type is received, the timer is automatically ended, which indicates that the receiving end does not receive data or the received data is incorrect, and the sending end needs to resend the data. Before resending, it is determined whether the CYCLE exceeds the threshold value according to the protocol type Type and the Module. If the CYCLE does not exceed the threshold value, the ID in the protocol header of the sending data is unchanged, which indicates that the current data needs to be sent. However, the CYCLE field needs to be increased by 1. If the CYCLE exceeds the threshold value, the protocol packet is not sent, which indicates that the link is not connected, and the network resource is not wasted. If the sending end does not receive the ACK protocol, the timer is waited for. The timer is timed according to the Type and the Module of the sending data protocol packet. After the timer is timed, the above process is repeated.

[0114] In the embodiment, the data to be transmitted is encapsulated according to the preset data protocol to obtain a request packet. The request packet is sent to a data receiving end, so that the data receiving end feeds back an ACK packet according to the request packet. It is detected whether the ACK packet fed back by the data receiving end is received within a preset time length, to obtain a detection result. The data to be transmitted is transmitted according to the detection result. By introducing two data types of data request and ACK, a framework of a reliable protocol is built, so that the data between the host computer and the domain controller can be reliably transmitted. Finally, according to the functionality of each module, a timer and a cycle value are added according to a cyclic algorithm, so that the efficiency of the data protocol is improved on the basis of ensuring reliable retransmission of the data protocol on the basis of user customization.

[0115] In addition, the data transmission method provided in the embodiment of the application is applied to a data receiving end. Please refer to Figure 6 , Figure 6 FIG. 1 is a flowchart of a data transmission method applied to a data receiving end according to a first embodiment of the application.

[0116] In the embodiment, the data transmission method applied to the data receiving end includes steps S01-S04.

[0117] In step S01, when a request packet sent by a data sending end is received, a preset check algorithm is used to perform check calculation on the request packet, to obtain a target check value.

[0118] It can be understood that the preset check algorithm refers to a preset CRC check algorithm, and the target check value refers to a check value calculated by the data receiving end.

[0119] In a specific implementation, after receiving the protocol data, the data receiving end needs to unpack, and first needs to perform CRC check on the protocol header to verify the correctness of the protocol packet. That is, a check value of the request data packet is calculated by a preset CRC check algorithm, and finally a check value calculated by the data receiving end is obtained.

[0120] Step S02, comparing the target check value with the initial check value in the request data packet to obtain a data check result.

[0121] It can be understood that the initial check value refers to a check value in the byte header of the request data packet, and the data check result includes a data check success result and a data check failure result.

[0122] In a specific implementation, the check value calculated by the data receiving end is compared with the check value in the byte header of the request data packet. When the check value calculated by the data receiving end is consistent with the check value in the byte header of the request data packet, it is determined that the data check result is the data check success result. When the check value calculated by the data receiving end is inconsistent with the check value in the byte header of the request data packet, it is determined that the data check result is the data check failure result.

[0123] Step S03, when the data check result is the data check success, comparing the data protocol type of the request data packet with a target protocol type.

[0124] It can be understood that the target protocol type refers to a preset protocol type (request protocol).

[0125] In a specific implementation, when the data check result is the data check success, it is continued to check whether it is a request REQ protocol packet. Therefore, the data type corresponding to the request data packet is obtained, and then the data protocol type of the request data packet is compared with the target protocol type to determine whether the data protocol type of the request data packet is the preset protocol type (request protocol).

[0126] Step S04, when the data protocol type of the request data packet is inconsistent with the target protocol type, stopping data transmission.

[0127] In a specific implementation, when the data protocol type of the request data packet is inconsistent with the target protocol type, it is indicated that the received protocol data packet is not the request REQ packet, which means that it is the response ACK packet. Therefore, the subsequent process is not needed, that is, the data transmission is stopped.

[0128] In a feasible implementation, step S04 can include steps A041-A042:

[0129] Step A041, updating the request data packet according to a success response protocol to obtain a response data packet when the data protocol type of the request data packet is consistent with the target protocol type;

[0130] In a specific implementation, when the data protocol type of the request data packet is consistent with the target protocol type, it is indicated that the received protocol data packet is a request REQ protocol packet, and the sending packet needs to be responded to, so as to send a response ACK protocol packet to the data sending end, and then obtain a response data packet. In the packet header of the response ACK protocol packet, the ID and CYCLE are unchanged, and only the Type is changed into the OK ACK protocol type.

[0131] Step A042, sending the response data packet to the data sending end.

[0132] In a specific implementation, the response data packet is sent to the data sending end, so that the data sending end judges whether the protocol type of the response data packet is FAIL ACK. If not, it is indicated that the data interaction is successful, and the data transmission process is completed.

[0133] It should be noted that the protocol processing flow of the data receiving end in the embodiment is as follows Figure 7 As shown in the figure, after the data receiving end receives the protocol data, it needs to be unpacked. First, the protocol header needs to be CRC checked to verify the correctness of the protocol packet. If the CRC check is correct, it is continued to be checked whether it is a request REQ protocol packet. If it is not a request REQ packet, it is indicated that it is a response ACK packet, and no subsequent process is needed. If it is a request REQ protocol packet, the sending packet needs to be responded to, and a response ACK protocol packet is sent. The ID and CYCLE in the packet header of the response ACK protocol packet are unchanged, and only the Type is changed into the OK ACK protocol type. If the data receiving end finds an error when performing data CRC check on the received protocol packet, it is indicated that the packet is wrong, and a failure response FAIL ACK protocol packet needs to be sent to the data sending end. The ID of the protocol packet is unchanged, but the CYCLE needs to be increased by 1.

[0134] It should be noted that the communication protocol of the embodiment ensures the interaction of data packets through an acknowledgement mechanism, and further adds a timer Timer for a timeout retransmission mechanism. The timer can cause the sender to resend the message again within a specified time if no feedback is received from the receiver, thereby ensuring reliable transmission of the message. However, the same message cannot be repeatedly sent indefinitely, which would waste network bandwidth and cause subsequent messages to be unable to be sent. Therefore, a cycle limit mechanism, that is, a CYCLE field, is added. Each protocol packet has a fixed number of retransmissions. When the number of retransmissions CYCLE exceeds the number of retransmissions, the protocol packet will no longer be sent regardless of whether the protocol packet is correctly sent. In a large project, different modules have primary and secondary functions, and message transmission also needs to have primary and secondary functions. Therefore, the timer Timer and the number of cycle retransmissions CYCLE in the present application are calculated according to the following algorithm according to different modules. Figure 8 Figure 8 Each module adds the cycle value according to four conditions, that is, whether it is a main function module, whether the cycle period of the function module is less than 10 ms, whether the number of single transmission bytes is less than 1024 bytes, and whether the parameters in the transmission bytes are common to multiple modules.

[0135] It can be understood that the FAPA system of the embodiment obtains the cycle values of the main modules in Table 2 according to the module cycle value calculation algorithm. The Common module and the Midware module have a cycle value of 1 because they are common parts of each module.

[0136] Table 2

[0137]

[0138] The embodiment calculates a target check value by performing check calculation on the request data packet sent by the data sending end according to a preset check algorithm when the request data packet is received. The target check value is compared with an initial check value in the request data packet to obtain a data check result. When the data check result is a data check success, the data protocol type of the request data packet is compared with a target protocol type. When the data protocol type of the request data packet is inconsistent with the target protocol type, data transmission is stopped. In this way, the efficiency of data transmission is improved.

[0139] It should be noted that the above examples are only used to understand the present application and do not limit the data transmission method of the present application. Based on this technical concept, more forms of simple changes are made, which are all within the protection scope of the present application.

[0140] The present application also provides a data transmission device. Please refer to Figure 9 The data transmission device applied to a data sending end comprises:​

[0141] The encapsulation module 10 is configured to encapsulate the to-be-transmitted data according to a preset data protocol to obtain a request data packet.

[0142] The sending module 20 is configured to send the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet.

[0143] The processing module 30 is configured to detect whether the response data packet fed back by the data receiving end is received within a preset time length, to obtain a detection result.

[0144] The transmission module 40 is configured to transmit the to-be-transmitted data according to the detection result.

[0145] In an embodiment, the transmission module 40 is further configured to:

[0146] when the detection result is that the response data packet fed back by the data receiving end is received within the preset time length, determining a corresponding data transmission state according to the response data packet.

[0147] when the data transmission state is a transmission success state, completing the transmission of the to-be-transmitted data.

[0148] In an embodiment, the transmission module 40 is further configured to:

[0149] when the detection result is that the response data packet fed back by the data receiving end is not received within the preset time length, determining a corresponding data protocol type, a module function type and a current cycle retransmission number according to the request data packet.

[0150] determining a corresponding timeout number threshold and a cycle retransmission number threshold according to the data protocol type and the module function type.

[0151] when a current timeout number is less than the timeout number threshold, performing data transmission according to the current cycle retransmission number and the cycle retransmission number threshold.

[0152] In an embodiment, the transmission module 40 is further configured to:

[0153] when the current timeout number is less than the timeout number threshold, comparing the current cycle retransmission number with the cycle retransmission number threshold.

[0154] when the current cycle retransmission number is less than the cycle retransmission number threshold, updating the current cycle retransmission number according to a preset cycle number to obtain an updated cycle retransmission number.

[0155] According to the updated cycle retransmission number, an updated request data packet is obtained, and the updated request data packet is sent to a data receiving end.

[0156] In an embodiment, the transmission module 40 is further configured to:

[0157] When the data transmission state is a transmission failure state, a corresponding data protocol type, a module function type, and a current cycle retransmission number are determined according to the request data packet.

[0158] A corresponding cycle retransmission number threshold is determined according to the data protocol type and the module function type.

[0159] When the current cycle retransmission number is less than the cycle retransmission number threshold, the current cycle retransmission number is updated according to a preset cycle number, to obtain an updated cycle retransmission number.

[0160] According to the updated cycle retransmission number, an updated request data packet is obtained, and the updated request data packet is sent to a data receiving end.

[0161] The application further provides a data transmission device, which is applied to a data receiving end and includes:

[0162] A receiving module 01 is configured to, when a request data packet sent by a data sending end is received, perform a check calculation on the request data packet according to a preset check algorithm, to obtain a target check value.

[0163] A comparison module 02 is configured to compare the target check value with an initial check value in the request data packet, to obtain a data check result.

[0164] The comparison module 02 is further configured to, when the data check result is a data check success, compare a data protocol type of the request data packet with a target protocol type.

[0165] A control module 03 is configured to, when the data protocol type of the request data packet is inconsistent with the target protocol type, stop data transmission.

[0166] In an embodiment, the comparison module 02 is further configured to:

[0167] When the data protocol type of the request data packet is consistent with the target protocol type, the request data packet is updated according to a success response protocol, to obtain a response data packet.

[0168] The response data packet is sent to the data sending end.

[0169] The data transmission device provided in the present application adopts the data transmission method in the above embodiment, and can solve the technical problem of low efficiency of the existing data transmission protocol. Compared with the prior art, the data transmission device provided in the present application has the same beneficial effects as the data transmission method provided in the above embodiment, and other technical features in the data transmission device are the same as the features disclosed in the above embodiment method, which will not be described herein.

[0170] The present application provides a data transmission device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the data transmission method in the above embodiment one.

[0171] Reference will be made to the following description Figure 10 , which shows a structural schematic diagram of a data transmission device suitable for implementing the embodiments of the present application. The data transmission device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 10 The data transmission device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0172] As Figure 10As shown, the data transmission device can include a processing apparatus 1001 (e.g., a central processor, a graphics processor, etc.) that can perform various appropriate actions and processes according to a program stored in a read only memory (ROM) 1002 or a program loaded from a storage apparatus 1003 into a random access memory (RAM) 1004. In the RAM 1004, various programs and data required for operation of the data transmission device are also stored. The processing apparatus 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input apparatus 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output apparatus 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage apparatus 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication apparatus 1009. The communication apparatus 1009 can allow the data transmission device to communicate with other devices wirelessly or by wire to exchange data. Although the data transmission device having various systems is shown in the figure, it should be understood that all the shown systems are not required to be implemented or possessed. More or less systems can be alternatively implemented or possessed.

[0173] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication apparatus, or installed from the storage apparatus 1003, or installed from the ROM 1002. When the computer program is executed by the processing apparatus 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are performed.

[0174] The data transmission device provided in the present application adopts the data transmission method in the above-mentioned embodiments, and can solve the technical problem of low efficiency of the existing data transmission protocol. Compared with the prior art, the data transmission device provided in the present application has the same beneficial effects as the data transmission method provided in the above-mentioned embodiments, and other technical features in the data transmission device are the same as the features disclosed in the above-mentioned embodiments, which will not be described here.

[0175] It should be understood that various parts of the present disclosure can be implemented in hardware, software, firmware, or a combination thereof. In the above description of embodiments, specific functional, structural, material or characteristic features are combined in a manner that is appropriate for the particular embodiment or examples. However, each feature can also be implemented individually or in any combination.

[0176] The above description is merely illustrative of the application and is not intended to limit the scope of the application. Any variations and modifications that can be made by those skilled in the art without departing from the spirit of the application are intended to be included in the scope of the application. The scope of the application should be determined not by the above description but by the claims.

[0177] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e., a computer program) for performing the data transmission method in the above-described embodiments.

[0178] The computer readable storage medium provided by the present application may, for example, be a U disk, but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more conductive wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted in any appropriate medium, including but not limited to electrical wire, optical cable, RF (Radio Frequency), etc., or any suitable combination thereof.

[0179] The above computer readable storage medium can be included in a data transmission device or can exist separately without being assembled into a data transmission device.

[0180] The computer readable storage medium carries one or more programs, when the one or more programs are executed by the data transmission device, the data transmission device is caused to: encapsulate the to-be-transmitted data according to a preset data protocol to obtain a request data packet; send the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet; detect whether the response data packet fed back by the data receiving end is received within a preset time length, to obtain a detection result; and transmit the to-be-transmitted data according to the detection result.

[0181] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0182] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a procedure, or a part of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that noted in the figures. For example, two blocks noted in succession can in fact be executed substantially concurrently or in the opposite order, depending on the functionality involved. It should also be noted that each block in the block diagrams and / or flow diagrams, and combinations of blocks in the block diagrams and / or flow diagrams, can be implemented by dedicated hardware-based systems that perform the specified functions or operations, or can be implemented by a combination of dedicated hardware-based systems and computer instructions.

[0183] The modules involved in the embodiments of the present application can be implemented in a software manner or in a hardware manner. In some cases, the name of the module does not constitute a limitation on the module itself.

[0184] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer program) for executing the above-mentioned data transmission method, and can solve the technical problem of low efficiency of the existing data transmission protocol. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the data transmission method provided by the above-mentioned embodiments, which will not be repeated here.

[0185] The present application also provides a computer program product comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned data transmission method.

[0186] The computer program product provided by the present application can solve the technical problem of low efficiency of the existing data transmission protocol. Compared with the prior art, the computer program product provided by the present application has the same beneficial effects as the data transmission method provided by the above-mentioned embodiments, which will not be repeated here.

[0187] In addition, in order to achieve the above-mentioned purposes, as Figure 11 The present application also provides a data transmission system, which comprises the data sending end 10 and the data receiving end 20 described above.

[0188] Since the transmission system adopts all the technical solutions of the above-mentioned embodiments, it at least has all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be repeated here.

[0189] The above-mentioned is only part of the embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structural transformation made by using the content of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the present application.

Claims

1. A data transmission method, characterized by, The data transmission method is applied to a data sending end, and the method comprises the following steps: According to a preset data protocol, encapsulating to-be-transmitted data to obtain a request data packet; Sending the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet; Detecting whether the response data packet fed back by the data receiving end is received within a preset time length to obtain a detection result; According to the detection result, transmitting the to-be-transmitted data; The step of transmitting the to-be-transmitted data according to the detection result comprises the following steps: When the detection result is that the response data packet fed back by the data receiving end is not received within the preset time length, determining a corresponding data protocol type, a module function type and a current cycle retransmission number according to the request data packet; According to the data protocol type and the module function type, determining a corresponding timeout number threshold and a cycle retransmission number threshold; When a current timeout number is less than the timeout number threshold, performing data transmission according to the current cycle retransmission number and the cycle retransmission number threshold.

2. The method of claim 1, wherein, The step of transmitting the to-be-transmitted data according to the detection result comprises the following steps: When the detection result is that the response data packet fed back by the data receiving end is received within the preset time length, determining a corresponding data transmission state according to the response data packet; When the data transmission state is a transmission success state, completing transmission of the to-be-transmitted data.

3. The method of claim 2, wherein, The step of performing data transmission according to the current cycle retransmission number and the cycle retransmission number threshold when the current timeout number is less than the timeout number threshold comprises the following steps: When the current timeout number is less than the timeout number threshold, comparing the current cycle retransmission number with the cycle retransmission number threshold; When the current cycle retransmission number is less than the cycle retransmission number threshold, updating the current cycle retransmission number according to a preset cycle number to obtain an updated cycle retransmission number; According to the updated cycle retransmission number, obtaining an updated request data packet, and sending the updated request data packet to the data receiving end.

4. The method of claim 2, wherein, The step of determining a corresponding data protocol type, a module function type and a current cycle retransmission number according to the request data packet when the data transmission state is a transmission failure state comprises the following steps: According to the data protocol type and the module function type, determining a corresponding cycle retransmission number threshold; When the current cycle retransmission number is less than the cycle retransmission number threshold, updating the current cycle retransmission number according to a preset cycle number to obtain an updated cycle retransmission number; According to the updated cycle retransmission number, obtaining an updated request data packet, and sending the updated request data packet to the data receiving end. The data transmission device is applied to a data sending end, and the device comprises the following modules:

5. A data transmission apparatus characterized by comprising: An encapsulation module, configured to encapsulate to-be-transmitted data according to a preset data protocol to obtain a request data packet; ​ a sending module, configured to send the request data packet to a data receiving end, so that the data receiving end feeds back a response data packet according to the request data packet; a processing module, configured to detect whether the response data packet fed back by the data receiving end is received within a preset time length, to obtain a detection result; a transmission module, configured to perform transmission on the to-be-transmitted data according to the detection result; the transmission module is further configured to, when the detection result is that the response data packet fed back by the data receiving end is not received within the preset time length, determine a corresponding data protocol type, a module function type and a current cycle retransmission number according to the request data packet; determine a corresponding timeout number threshold and a cycle retransmission number threshold according to the data protocol type and the module function type; when a current timeout number is less than the timeout number threshold, perform data transmission according to the current cycle retransmission number and the cycle retransmission number threshold.

6. A data transmission device, characterized by The device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, and the computer program is configured to implement the steps of the data transmission method applied to the data sending end according to any one of claims 1 to 4.

7. A data transmission system, characterized in that The data transmission system comprises the data sending end according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • System on chip and power supply state configuration, feedback and control method thereof

    CN117331422A