Application layer data transmission method, device, equipment and medium

By sending data packets when the buffer is idle and backing them to the retransmission queue, and combining the interface call return value to determine the packet storage situation, the problem of cloud load pressure and message upload failure identification is solved, and efficient data transmission and error handling is achieved.

CN114786216BActive Publication Date: 2025-04-22CHINA FAW CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210419561.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2025-04-22
Estimated Expiration
2042-04-20

AI Technical Summary

Technical Problem

In the prior art, when the information interaction between the vehicle terminal and the cloud is interacting, frequent ACK response mechanism is required, resulting in severe load pressure in the cloud, and canceling the ACK response mechanism will lead to the problem of failure to upload messages and unrecognized unrecognized information.

Method used

By calling the setting interface to send the next target packet in the sending queue to the buffer and back up the current packet to the retransmission queue; determine whether the packet is successfully stored in the buffer based on the return value of the interface call operation. If it is successful, modify the buffer state to occupy state and send it to the cloud, and if it fails, it will be stored in the buffer again.

Benefits of technology

When reducing the load pressure in the cloud, timely and effectively identify the successful or failure of the terminal upload message, avoid message loss and optimize the data transmission process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114786216B_ABST
    Figure CN114786216B_ABST
Patent Text Reader

Abstract

The present invention discloses an application layer data transmission method, device, equipment and medium. The method includes: obtaining the buffer state, if it is in an idle state, determining that the last target data packet in the sending queue is successfully sent to the cloud; calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing it up to the retransmission queue; judging whether the current data packet is successfully stored in the buffer according to the return value of the interface call operation; if so, modifying the buffer state to an occupied state, and sending the current data packet to the cloud through the transport layer; if the sending is successful, modifying the buffer state to an idle state, and deleting the current data packet in the retransmission queue; if the sending fails, the current data packet in the retransmission queue is stored back in the buffer. Through the technical solution of the present invention, the success or failure of the terminal upload message can be timely and effectively identified while reducing the cloud load pressure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network data transmission, and in particular to an application layer data transmission method, device, equipment and medium. Background Art

[0002] With the rapid development of science and technology, the field of Internet of Vehicles has higher requirements on the acquisition rate of information interaction results between vehicle terminals and the cloud.

[0003] In the prior art, the "request->response" method is usually used to realize information interaction between the vehicle terminal and the cloud to ensure that the cloud can receive the messages sent by the vehicle terminal in a timely and accurate manner. At the same time, the cloud will reply with a confirmation mark (ACK, Acknowledgement) after receiving the message to determine whether the message is sent successfully.

[0004] However, if the method in the prior art is used, the vehicle terminal and the cloud need to implement a set of ACK response mechanisms. Usually, the vehicle terminal needs to upload vehicle condition information to the cloud once every 10 seconds on average. Considering the number of terminals connected to the same cloud platform across the country, the cloud needs to reply hundreds of thousands or even millions of ACKs every 10 seconds, which puts serious pressure on the cloud load. However, if the ACK response mechanism for periodic upload messages is cancelled in order to reduce the cloud load pressure, the terminal will not be able to identify the failure of message upload, and thus cannot take corresponding exception handling measures, which will eventually lead to problems such as the loss of uploaded messages. Therefore, how to timely and effectively identify the success or failure of terminal upload messages while reducing the cloud load pressure is a problem that needs to be solved urgently. Summary of the invention

[0005] The present invention provides an application layer data transmission method, device, equipment and medium, which can timely and effectively identify the success or failure of terminal upload message sending while reducing cloud load pressure.

[0006] According to one aspect of the present invention, there is provided an application layer data transmission method, characterized in that it includes:

[0007] Obtaining a buffer state, and if the buffer is in an idle state, determining that the last target data packet in the sending queue is successfully sent to the cloud;

[0008] Calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing up the current data packet to the retransmission queue;

[0009] Obtaining a return value of the interface call operation, and determining whether the current data packet is successfully stored in the buffer according to the return value;

[0010] If so, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer;

[0011] If the transmission is successful, the buffer state is modified to an idle state, and the current data packet in the retransmission queue is deleted;

[0012] If the transmission fails, the current data packet in the retransmission queue is stored back into the buffer, and the buffer state remains occupied.

[0013] According to another aspect of the present invention, there is provided an application layer data transmission device, the device comprising:

[0014] A status acquisition module is used to acquire the buffer status. If the buffer is in an idle state, it is determined that the last target data packet was successfully sent to the cloud.

[0015] A data cache module, used for calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing up the current data packet to the retransmission queue;

[0016] A cache status judgment module, used to obtain the return value of the interface call operation, and judge whether the current data packet is successfully stored in the buffer according to the return value;

[0017] A data transmission module, configured to, if yes, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through a transport layer;

[0018] A first result module, configured to set the buffer state to an idle state and delete the current data packet in the retransmission queue if the transmission is successful;

[0019] The second result module is used for re-storing the current data packet in the retransmission queue into the buffer if the transmission fails, and the buffer state remains in an occupied state.

[0020] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0021] at least one processor; and

[0022] a memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application layer data transmission method described in any embodiment of the present invention.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application layer data transmission method described in any embodiment of the present invention when executed.

[0025] The technical solution of the embodiment of the present invention is to call a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer when the buffer is in an idle state, and to back up the current data packet to the retransmission queue; then, determine whether the current data packet is successfully stored in the buffer according to the return value of the interface call operation, and after the current data packet is successfully stored in the buffer, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer; finally, if the sending is successful, modify the buffer state to an idle state, and delete the current data packet in the retransmission queue; if the sending fails, store the current data packet in the retransmission queue back into the buffer, and maintain the occupied state of the buffer, thereby solving the problem in the prior art that the ACK response mechanism causes serious pressure on the cloud load, and canceling the ACK response mechanism for periodic upload messages will make the terminal unable to identify the failure of message upload, and can timely and effectively identify the success or failure of the terminal upload message sending while reducing the cloud load pressure.

[0026] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 is a flowchart of an application layer data transmission method provided according to Embodiment 1 of the present invention;

[0029] Figure 2a is a flowchart of an application layer data transmission method provided according to Embodiment 2 of the present invention;

[0030] Figure 2b is a flowchart of a preferred application layer data transmission method provided according to Embodiment 2 of the present invention;

[0031] Figure 3is a schematic diagram of the structure of an application layer data transmission device provided according to Embodiment 3 of the present invention;

[0032] Figure 4 It is a structural diagram of an electronic device that implements the application layer data transmission method of an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] With the rapid development of science and technology, the field of Internet of Vehicles has higher requirements on the acquisition rate of information interaction results between vehicle terminals and the cloud.

[0036] The existing Transmission Control Protocol (TCP) provides a reliable transmission method for transport layer data, specifically: the application layer data stores the application layer data to be sent into the socket send buffer by calling the system interface; the system kernel follows the TCP protocol to send the data in the socket send buffer to the cloud; after receiving the data, the cloud replies to the vehicle terminal with a TCP ACK representing successful data reception; after receiving the TCP ACK, the terminal deletes the successfully sent data from the send buffer; if the terminal does not receive the TCP ACK within the set timeout period, the timeout unanswered data is resent; if the terminal still does not receive the TCP ACK after the maximum number of retries, the data is discarded.

[0037] However, although the existing TCP mechanism can ensure the reliable transmission of messages sent by the vehicle terminal at the transport layer, the application layer cannot directly obtain TCP ACK, and the system does not provide relevant interfaces to notify the application layer of the event of receiving TCP ACK; TCP data packets and application layer data packets do not have a one-to-one mapping relationship, that is, the application layer data packet will be split into multiple TCP data packets when transmitted at the TCP layer. When the terminal receives TCP ACK, it cannot determine which application layer data packet the successfully sent TCP data packet corresponds to; and the TCP protocol can only provide a reliable data transmission solution based on a successful TCP connection. When the TCP connection is abnormal, it is impossible to resend the data that failed to be transmitted after the TCP connection is restored to ensure that the uploaded data is not lost.

[0038] Therefore, in order to solve the problem that the ACK response mechanism in the prior art causes serious pressure on the cloud load, and canceling the ACK response mechanism for periodic uploaded messages will make the terminal unable to identify the failure of message upload, an embodiment of the present invention provides an application layer data transmission method, which can timely and effectively identify the success or failure of terminal upload message sending while reducing the cloud load pressure.

[0039] Embodiment 1

[0040] Figure 1 A flowchart of an application layer data transmission method is provided for the first embodiment of the present invention. This embodiment is applicable to the case where the success or failure of a terminal uploading message is identified. The method can be executed by an application layer data transmission device. The application layer data transmission device can be implemented in the form of hardware and / or software. The application layer data transmission device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0041] S110, obtaining a buffer state, and if the buffer is in an idle state, determining that the last target data packet in the sending queue is successfully sent to the cloud.

[0042] The buffer state may refer to a state indicating whether the current storage space of the buffer is free. For example, the buffer state may be free, indicating that no data is currently stored in the buffer; or occupied, indicating that data is currently stored in the buffer. The target data packet may refer to a data packet sent from the vehicle terminal to the cloud. The sending queue may refer to a queue containing each target data packet.

[0043] S120, calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing up the current data packet to the retransmission queue.

[0044] The set interface may refer to an interface in the buffer for transmitting data packets, and may be a socket sending interface, for example. The current data packet may refer to a target data packet for the current transmission operation. The retransmission queue may refer to a queue for backing up and storing the current data packet.

[0045] Therefore, by transmitting the current data packet to the buffer after the previous target data packet is successfully sent, it can be ensured that only one application layer data packet is transmitted to the buffer at a time, so that the current data packet is not split into multiple TCP data packets when transmitted to the transport layer.

[0046] S130: Obtain a return value of the interface call operation, and determine whether the current data packet is successfully stored in the buffer according to the return value.

[0047] The return value may refer to a status value returned by the buffer according to the connection status between the buffer and the transport layer, indicating whether the current data packet is successfully stored in the buffer.

[0048] Optionally, judging whether the current data packet is successfully stored in the buffer according to the return value includes: if the return value of the interface call operation is a positive number, determining that the current data packet is successfully stored in the buffer; if the return value of the interface call operation is zero or a negative number, determining that the current data packet is not successfully stored in the buffer. A positive return value may refer to the number of bytes sent; a zero return value may refer to a network disconnection; a negative return value may refer to other abnormalities. Therefore, by judging whether the return value is a positive number, it is possible to determine whether the current data packet is successfully stored in the buffer, and timely identify the situation where the current data packet is not successfully stored in the buffer.

[0049] S140: If yes, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer.

[0050] Specifically, if the return value of the interface call operation is identified as a positive number, it indicates that the current data packet has been successfully stored in the buffer and the buffer is occupied. Therefore, the buffer state can be modified to an occupied state so that when other target data packets recognize that the buffer is in an occupied state, the operation of storing in the buffer can be temporarily suspended.

[0051] In an optional embodiment, after the current data packet in the buffer is sent to the cloud through the transport layer, it also includes: periodically obtaining the buffer status; if the buffer status is found to be idle within the timeout period, it is determined that the current data packet has been sent successfully; if the buffer status is found to be continuously occupied within the timeout period, it is determined that the current data packet has failed to be sent. The timeout period may refer to a threshold for evaluating the time spent on obtaining the buffer status, for example, it may be a multiple of the time spent on obtaining the buffer status within a single cycle, or it may be a pre-specified time. Thus, it can be ensured that if the current data packet is not sent successfully within the timeout period, continuing to periodically obtain the buffer status will cause the problem of slow data packet transmission process, thereby avoiding unnecessary waste of resources.

[0052] S150: If the transmission is successful, the buffer state is changed to an idle state, and the current data packet in the retransmission queue is deleted.

[0053] Specifically, if the transport layer successfully sends the current data packet in the buffer to the cloud, the buffer is empty. Therefore, the buffer state can be modified to an idle state so that the buffer state can be known in time when the next target data packet enters.

[0054] Therefore, the transmission status of the current data packet can be judged by the buffer status without relying on the ACK response mechanism, which reduces the load pressure on the cloud.

[0055] S160: If the transmission fails, the current data packet in the retransmission queue is stored again in the buffer, and the buffer remains in an occupied state.

[0056] Specifically, if the transport layer fails to successfully send the current data packet in the buffer to the cloud, the current data packet exists in the buffer, and therefore, the current data packet in the retransmission queue can be retransmitted to the buffer for subsequent operations.

[0057] The technical solution of the embodiment of the present invention is to call a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer when the buffer is in an idle state, and to back up the current data packet to the retransmission queue; then, determine whether the current data packet is successfully stored in the buffer according to the return value of the interface call operation, and after the current data packet is successfully stored in the buffer, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer; finally, if the sending is successful, modify the buffer state to an idle state, and delete the current data packet in the retransmission queue; if the sending fails, store the current data packet in the retransmission queue back into the buffer, and maintain the occupied state of the buffer, thereby solving the problem in the prior art that the ACK response mechanism causes serious pressure on the cloud load, and canceling the ACK response mechanism for periodic upload messages will make the terminal unable to identify the failure of message upload, and can timely and effectively identify the success or failure of the terminal upload message sending while reducing the cloud load pressure.

[0058] Embodiment 2

[0059] Figure 2a A flowchart of an application layer data transmission method provided in the second embodiment of the present invention. This embodiment is based on the above embodiment for supplementation. In this embodiment, it is specifically supplemented before the buffer state is modified to the occupied state. Specifically, it may include: recording the backup time of the current data packet backed up to the retransmission queue; correspondingly, if the transmission fails, the current data packet in the retransmission queue is stored back in the buffer, including: if the backup time exceeds the preset time, the current data packet in the backup queue is stored back in the buffer. Figure 2a As shown, the method includes:

[0060] S210, obtaining a buffer state, and if the buffer is in an idle state, determining that the last target data packet in the sending queue is successfully sent to the cloud.

[0061] In an optional embodiment, after obtaining the buffer state, it also includes: if the buffer is in an occupied state, storing the current data packet in the retransmission queue, and periodically querying the buffer state until the buffer is in an idle state, calling the setting interface to send the current data packet in the retransmission queue to the buffer. Specifically, if the buffer is in an occupied state, it indicates that the previous target data packet has not been sent successfully, and the current data packet needs to wait until the previous target data packet is sent before entering the buffer. In this way, it can be ensured that the number of target data packets entering the buffer each time is only one, so that the application layer data packet and the transport layer data packet can be generated in a one-to-one correspondence.

[0062] S220, calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing up the current data packet to the retransmission queue.

[0063] S230, determine whether the return value of the interface call operation is a positive number; if so, execute S240; if not, execute S280.

[0064] S240: Determine that the current data packet is successfully stored in the buffer, and record the backup time of the current data packet backed up in the retransmission queue.

[0065] The backup time may refer to the time that the current data packet is stored in the retransmission queue. By recording the backup time, the transmission status of the current data packet may be monitored more intuitively.

[0066] S250: modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer.

[0067] In an optional embodiment, if the return value of the interface call operation is a positive number, it is determined that the transport layer connection between the vehicle terminal and the cloud is normal; if the return value of the interface call operation is zero or a negative number, it is determined that the transport layer connection between the vehicle terminal and the cloud is abnormal; and the sending of the current data packet in the buffer to the cloud through the transport layer includes: if the transport layer connection between the vehicle terminal and the cloud is normal, a transport layer data packet having a one-to-one mapping relationship with the current data packet is generated, and the transport layer data packet is sent to the cloud through the transport layer. Among them, since if the current target data packet fails to be successfully stored in the buffer, it is assumed that the transport layer connection between the vehicle terminal and the cloud is abnormal, therefore, the return value of the interface call operation can also be used to reflect whether the transport layer connection between the vehicle terminal and the cloud is abnormal, and only when the transport layer connection between the vehicle terminal and the cloud is normal, a transport layer data packet having a one-to-one mapping relationship with the current data packet is generated, and the transport layer data packet is sent to the cloud through the transport layer.

[0068] S260: If the transmission is successful, the buffer state is changed to an idle state, and the current data packet in the retransmission queue is deleted.

[0069] S270: If the backup time exceeds the preset time, the current data packet in the backup queue is stored again in the buffer, and the buffer state remains in an occupied state.

[0070] The preset time may refer to a preset threshold time for evaluating the backup time. Specifically, after the current data packet is backed up in the retransmission queue, the backup time of the current data packet is recorded. When the backup time is greater than the preset time, it proves that the current data packet has not been successfully sent within the preset time. In order to reduce unnecessary waste of resources, the current data packet is retransmitted into the buffer for retransmission.

[0071] S280, storing the current data packet in the retransmission queue, and periodically querying the buffer state until the buffer is in an idle state, and calling a setting interface to send the current data packet in the retransmission queue to the buffer.

[0072] Specifically, if the current data packet is not successfully stored in the buffer, it may indicate that the current TCP connection is abnormal. Therefore, in order to avoid the current data packet being lost, the current data packet needs to be stored in the retransmission queue first, and the buffer status needs to be queried periodically until the buffer is idle, and the current data packet is sent to the buffer for subsequent data transmission operations.

[0073] The technical solution of the embodiment of the present invention is to call a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer when the buffer is in an idle state, and to back up the current data packet to the retransmission queue; if the return value of the interface call operation is a positive number, it is determined that the current data packet is successfully stored in the buffer, the backup time of the current data packet backed up to the retransmission queue is recorded, and the buffer state is modified to an occupied state, and the current data packet in the buffer is sent to the cloud through the transport layer. If the sending is successful, the buffer state is modified to an idle state, and the current data packet in the retransmission queue is deleted. If the backup time exceeds the preset time, the current data packet in the backup queue is The data packet is stored in the buffer again, and the buffer status remains occupied; if the return value of the interface call operation is zero or a negative number, it is determined that the current data packet has not been successfully stored in the buffer, the current data packet is stored in the retransmission queue, and the buffer status is periodically queried until the buffer is idle, and the setting interface is called to send the current data packet in the retransmission queue to the buffer, which solves the problem that the ACK response mechanism in the prior art causes serious pressure on the cloud load, and cancels the ACK response mechanism for periodic uploaded messages, which makes the terminal unable to identify the failure of message upload. It can timely and effectively identify the success or failure of terminal upload message sending while reducing the cloud load pressure.

[0074] Figure 2bIt is a flowchart of a preferred application layer data transmission method provided according to the second embodiment of the present invention. Specifically, when the vehicle-mounted terminal starts to report data to the cloud, first, the buffer status is obtained. If the buffer is in an occupied state, the current data packet is stored in the retransmission queue, and is sent to the buffer when the buffer is in an idle state; if the buffer is in an idle state, the setting interface is called to send the current data packet to the buffer, and it is determined whether the return value of the interface call operation is a positive number. If not, the current data packet is stored in the retransmission queue, and is sent to the buffer when the buffer is in an idle state; if so, it is determined that the current data packet is successfully stored in the buffer and the buffer is in an occupied state, and the current data packet is backed up to the retransmission queue, and the backup time of the current data packet backed up to the retransmission queue is recorded, and the current data packet in the buffer is sent to the cloud through the transport layer; the buffer status is periodically obtained. For example, the waiting time for each cycle can be set to 500ms. If the buffer status is found to be idle within the timeout period, it is determined that the current data packet is sent successfully, and the current data packet in the retransmission queue is deleted; if the backup time exceeds the preset time, the current data packet in the backup queue is stored back in the buffer, and the buffer status remains occupied.

[0075] Embodiment 3

[0076] Figure 3 This is a schematic diagram of the structure of an application layer data transmission device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a state acquisition module 310, a data cache module 320, a cache state determination module 330, a data transmission module 340, a first result module 350, and a second result module 360;

[0077] The status acquisition module 310 is used to acquire the buffer status. If the buffer is in an idle state, it is determined that the last target data packet was successfully sent to the cloud.

[0078] The data cache module 320 is used to call the setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and back up the current data packet to the retransmission queue;

[0079] The cache status determination module 330 is used to obtain the return value of the interface call operation and determine whether the current data packet is successfully stored in the buffer according to the return value;

[0080] Data transmission module 340, for, if yes, modifying the buffer state to an occupied state, and sending the current data packet in the buffer to the cloud through a transport layer;

[0081] A first result module 350, configured to set the buffer state to an idle state and delete the current data packet in the retransmission queue if the transmission is successful;

[0082] The second result module 360 ​​is used to store the current data packet in the retransmission queue back into the buffer if the transmission fails, and the buffer state remains in an occupied state.

[0083] The technical solution of the embodiment of the present invention is to call a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer when the buffer is in an idle state, and to back up the current data packet to the retransmission queue; then, determine whether the current data packet is successfully stored in the buffer according to the return value of the interface call operation, and after the current data packet is successfully stored in the buffer, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer; finally, if the sending is successful, modify the buffer state to an idle state, and delete the current data packet in the retransmission queue; if the sending fails, store the current data packet in the retransmission queue back into the buffer, and maintain the occupied state of the buffer, thereby solving the problem in the prior art that the ACK response mechanism causes serious pressure on the cloud load, and canceling the ACK response mechanism for periodic upload messages will make the terminal unable to identify the failure of message upload, and can timely and effectively identify the success or failure of the terminal upload message sending while reducing the cloud load pressure.

[0084] Optionally, the application layer data transmission device may further include a first time recording module, which is used to record the backup time of the current data packet backed up to the retransmission queue before the buffer state is modified to the occupied state;

[0085] Correspondingly, the second result module 360 ​​may be specifically configured to store the current data packet in the backup queue back into the buffer if the backup time exceeds a preset time.

[0086] Optionally, the cache status judgment module 330 can be specifically used to determine that the current data packet is successfully stored in the buffer if the return value of the interface call operation is a positive number; if the return value of the interface call operation is zero or a negative number, determine that the current data packet is not successfully stored in the buffer.

[0087] Optionally, the application layer data transmission device may further include a connection status judgment module, which is used to determine that the transport layer connection between the vehicle terminal and the cloud is normal if the return value of the interface call operation is a positive number; if the return value of the interface call operation is zero or a negative number, it is determined that the transport layer connection between the vehicle terminal and the cloud is abnormal;

[0088] Furthermore, the data transmission module 340 can be specifically used to generate a transport layer data packet having a one-to-one mapping relationship with the current data packet if the transport layer connection between the vehicle terminal and the cloud is normal, and send the transport layer data packet to the cloud through the transport layer.

[0089] Optionally, the application layer data transmission device may also include a first retransmission module, which is used to, after obtaining the buffer status, if the buffer is in an occupied state, store the current data packet in a retransmission queue, and periodically query the buffer status until the buffer is in an idle state, and call a setting interface to send the current data packet in the retransmission queue to the buffer.

[0090] Optionally, the application layer data transmission device may also include a second retransmission module, which is used to determine whether the current data packet is successfully stored in the buffer according to the return value. If not, the current data packet is stored in the retransmission queue, and periodically queries the buffer status until the buffer is in an idle state, and calls a setting interface to send the current data packet in the retransmission queue to the buffer.

[0091] Optionally, the application layer data transmission device may further include a result judgment module, which is used to periodically obtain the buffer status after sending the current data packet in the buffer to the cloud through the transport layer; if the buffer status is found to be idle within the timeout period, it is determined that the current data packet has been sent successfully; if the buffer status is found to be continuously occupied within the timeout period, it is determined that the current data packet has failed to be sent.

[0092] The application layer data transmission device provided in the embodiment of the present invention can execute the application layer data transmission method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0093] Embodiment 4

[0094] Figure 4 A schematic diagram of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0095] like Figure 4As shown, the electronic device 410 includes at least one processor 420, and a memory connected to the at least one processor 420 in communication, such as a read-only memory (ROM) 430, a random access memory (RAM) 440, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 420 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 430 or the computer program loaded from the storage unit 490 to the random access memory (RAM) 440. In the RAM 440, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 420, the ROM 430, and the RAM 440 are connected to each other via a bus 450. An input / output (I / O) interface 460 is also connected to the bus 450.

[0096] Multiple components in the electronic device 410 are connected to the I / O interface 460, including: an input unit 470, such as a keyboard, a mouse, etc.; an output unit 480, such as various types of displays, speakers, etc.; a storage unit 490, such as a disk, an optical disk, etc.; and a communication unit 4100, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 4100 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0097] The processor 420 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 420 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 420 performs the various methods and processes described above, such as an application layer data transmission method.

[0098] The method includes:

[0099] Obtaining a buffer state, and if the buffer is in an idle state, determining that the last target data packet in the sending queue is successfully sent to the cloud;

[0100] Calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing up the current data packet to the retransmission queue;

[0101] Obtaining a return value of the interface call operation, and determining whether the current data packet is successfully stored in the buffer according to the return value;

[0102] If so, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer;

[0103] If the transmission is successful, the buffer state is modified to an idle state, and the current data packet in the retransmission queue is deleted;

[0104] If the transmission fails, the current data packet in the retransmission queue is stored back into the buffer, and the buffer state remains occupied.

[0105] In some embodiments, the application layer data transmission method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 490. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 430 and / or the communication unit 4100. When the computer program is loaded into the RAM 440 and executed by the processor 420, one or more steps of the application layer data transmission method described above may be performed. Alternatively, in other embodiments, the processor 420 may be configured to perform the application layer data transmission method in any other appropriate manner (e.g., by means of firmware).

[0106] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0107] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0108] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 foregoing.

[0109] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0110] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0111] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0112] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0113] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An application layer data transmission method, characterized in that: include: Obtaining a buffer state, and if the buffer is in an idle state, determining that the last target data packet in the sending queue is successfully sent to the cloud; Calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing up the current data packet to the retransmission queue; Obtaining a return value of the interface call operation, and determining whether the current data packet is successfully stored in the buffer according to the return value; If so, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through the transport layer; If the transmission is successful, the buffer state is modified to an idle state, and the current data packet in the retransmission queue is deleted; If the transmission fails, the current data packet in the retransmission queue is stored back into the buffer, and the buffer state remains occupied.

2. The method according to claim 1, characterized in that Before changing the buffer state to an occupied state, the method further includes: Recording the backup time of the current data packet backed up to the retransmission queue; Correspondingly, if the transmission fails, the current data packet in the retransmission queue is stored again in the buffer, including: If the backup time exceeds the preset time, the current data packet in the backup queue is stored in the buffer again.

3. The method according to claim 1, characterized in that The step of judging whether the current data packet is successfully stored in the buffer according to the return value includes: If the return value of the interface call operation is a positive number, it is determined that the current data packet is successfully stored in the buffer; If the return value of the interface call operation is zero or a negative number, it is determined that the current data packet is not successfully stored in the buffer.

4. The method according to claim 3, characterized in that Also includes: If the return value of the interface call operation is a positive number, it is determined that the transport layer connection between the vehicle terminal and the cloud is normal; If the return value of the interface call operation is zero or a negative number, it is determined that the transport layer connection between the vehicle terminal and the cloud is abnormal; And, sending the current data packet in the buffer to the cloud through the transport layer includes: If the transport layer connection between the vehicle-mounted terminal and the cloud is normal, a transport layer data packet having a one-to-one mapping relationship with the current data packet is generated, and the transport layer data packet is sent to the cloud through the transport layer.

5. The method according to claim 1, characterized in that After getting the buffer status, also include: If the buffer is in an occupied state, the current data packet is stored in a retransmission queue, and the buffer state is periodically queried until the buffer is in an idle state, and a setting interface is called to send the current data packet in the retransmission queue to the buffer.

6. The method according to claim 1, characterized in that After judging whether the current data packet is successfully stored in the buffer according to the return value, the method further includes: If not, the current data packet is stored in the retransmission queue, and the buffer state is periodically queried until the buffer is in an idle state, and a setting interface is called to send the current data packet in the retransmission queue to the buffer.

7. The method according to claim 1, characterized in that After sending the current data packet in the buffer to the cloud through the transport layer, the method further includes: Periodically obtaining the buffer state; If the buffer state is found to be idle within the timeout period, it is determined that the current data packet is sent successfully; If it is found within the timeout period that the buffer state is continuously occupied, it is determined that the current data packet has failed to be sent.

8. An application layer data transmission device, characterized in that: include: A status acquisition module, used to acquire the buffer status, and if the buffer is in an idle state, it is determined that the last target data packet was successfully sent to the cloud; A data cache module, used for calling a setting interface to send the next target data packet in the sending queue as the current data packet to the buffer, and backing up the current data packet to the retransmission queue; A cache status judgment module, used to obtain the return value of the interface call operation, and judge whether the current data packet is successfully stored in the buffer according to the return value; A data transmission module, configured to, if yes, modify the buffer state to an occupied state, and send the current data packet in the buffer to the cloud through a transport layer; A first result module, configured to set the buffer state to an idle state and delete the current data packet in the retransmission queue if the transmission is successful; The second result module is used for re-storing the current data packet in the retransmission queue into the buffer if the transmission fails, and the buffer state remains in an occupied state.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application layer data transmission method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application layer data transmission method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Data communication method and system

    CN107018087A

  • Data transmission method, device and system, terminal equipment and storage medium

    CN112771821A