Data retransmission methods, apparatus, electronic devices and storage media
By retransmitting lost command data separately in cloud gaming, the latency and lag issues caused by network jitter are resolved, ensuring the timeliness and reliability of data transmission and improving the user's gaming experience.
Patent Information
- Application Number
- CN202310575502.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2043-05-19
AI Technical Summary
In cloud gaming scenarios, data transmission delays and lags caused by network jitter cannot be addressed in a timely manner by existing data retransmission methods, affecting the user's gaming experience.
By identifying lost packet command data based on the response status at the user end and retransmitting each lost packet command data separately, and by utilizing timeout detection and response message analysis, the timeliness and reliability of data transmission are improved.
It enables timely and reliable retransmission of lost command data to the server within millisecond-level latency, solving the latency and lag problems caused by network jitter and improving the data transmission efficiency of the user end.
Smart Images

Figure CN116566552B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a data retransmission method, apparatus, electronic device, and storage medium. Background Technology
[0002] In cloud gaming applications, user response latency is a crucial indicator of service quality. WebRTC (Web Real-Time Communication) provides excellent technical support for real-time audio and video data transmission in cloud gaming. Cloud gaming involves user input; the client needs to collect control commands, such as screen touch on mobile devices or mouse and keyboard input on PCs. These commands are transmitted via the WebRTC data channel to the WebRTC transport layer on the server, where they are then extracted and executed in the game. However, in cloud gaming, frequent or significant network fluctuations can lead to packet loss or timeouts. Existing methods include selective acknowledgment of multiple data packets at the server; if several packets fail to reach the server, they are retransmitted together. Another method involves retransmitting all lost packets after a certain period. Both of these retransmission methods result in significant delays and lags, potentially causing the server to miss instructions and execute them in the game, greatly degrading the user's gaming experience. Summary of the Invention
[0003] In view of this, embodiments of this application provide a data retransmission method, apparatus, electronic device, and storage medium, aiming to solve the problem of significant delay and lag in data retransmission at the user end due to network jitter.
[0004] A first aspect of this application provides a data retransmission method, comprising: after initiating transmission of target data, determining packet loss instruction data in the target data according to the response status, wherein the target data is represented as an instruction data sequence; and performing retransmission processing on each packet loss instruction data separately.
[0005] In some possible implementations, the step of determining the packet loss instruction data in the target data based on the response status includes: determining the packet loss instruction data in the target data based on the instruction identifier sequence carried in the response message.
[0006] In some possible implementations, the step of determining the packet loss instruction data in the target data based on the instruction identifier sequence carried in the response message includes: determining the missing instruction identifier based on the instruction identifiers recorded in the instruction identifier sequence, and determining the instruction data corresponding to the missing instruction identifier as the packet loss instruction data in the target data, wherein the instruction identifiers recorded in the instruction identifier sequence include the consecutive maximum instruction identifier, the current maximum instruction identifier, and the instruction identifier located between the consecutive maximum instruction identifier and the current maximum instruction identifier determined by the server from the received instruction data.
[0007] In some possible implementations, the step of determining the lost instruction data in the target data based on the response status includes: if it is detected that instruction data has exceeded the timeout period and no response message has been received, the instruction data is determined as lost instruction data in the target data, wherein the timeout period is determined based on the data transmission round-trip delay value.
[0008] In some possible implementations, the step of identifying the instruction data as lost instruction data in the target data when an instruction data is detected to have exceeded the timeout period without receiving a response message includes: at the timeout detection point, performing timeout detection on the instruction data that has been transmitted in sequence, and identifying the instruction data that has exceeded the timeout period without receiving a response message in the transmitted instruction data as lost instruction data in the target data.
[0009] In some possible implementations, before the step of performing timeout detection on the instruction data that has been transmitted according to the time sequence at the timeout detection time point, the step further includes setting the timeout detection time point as: the time point obtained by adding a timeout period to the transmission time point corresponding to the first instruction data that was transmitted in the target data; or the time point obtained by adding a timeout period to the transmission time point corresponding to the first instruction data that was transmitted after each timeout detection.
[0010] In some possible implementations, the step of performing timeout detection on the initiated instruction data according to the timeout detection time point includes: if the timeout detection time point is the first timeout detection time point in the data transmission process, taking the first initiated instruction data in the target data as the detection starting point, performing timeout detection on each of the initiated instruction data according to the timeout sequence until the first non-timeout instruction data is detected, and then stopping the timeout detection; if the timeout detection time point is not the first timeout detection time point in the data transmission process, taking the non-timeout instruction data detected at the previous timeout detection time point as the detection starting point, performing timeout detection on the initiated instruction data again according to the timeout sequence until non-timeout instruction data is detected again, and then stopping the timeout detection.
[0011] In one possible implementation, the method further includes: determining the timeout period as 9 / 8 * data transmission round-trip delay value.
[0012] In some possible implementations, the method further includes: for each instruction data, initiating transmission of the instruction data and performing redundant transmission processing on the instruction data after a preset delay value.
[0013] A second aspect of this application provides a data retransmission apparatus, comprising: a determining module, configured to determine packet loss instruction data in the target data based on the response status after initiating transmission of target data; and a retransmission module, configured to perform individual retransmission processing on each packet loss instruction data.
[0014] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the electronic device, wherein the processor executes the computer program to implement the steps of the data retransmission method provided in the first aspect.
[0015] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the data retransmission method provided in the first aspect.
[0016] The fifth aspect of this application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the steps of the data retransmission method provided in the first aspect.
[0017] The data retransmission method, apparatus, electronic device, and storage medium provided in this application have the following beneficial effects:
[0018] This application identifies lost command data within the target data after initiating transmission, based on the response status, and then retransmits each lost command data individually. In cloud gaming scenarios, by performing timeout detection on the transmitted command data or analyzing the received response messages on the user end, the client can promptly obtain information about packet loss and timeouts in data transmission. Furthermore, for each lost command data, individual retransmission processing can be performed, increasing the likelihood of successful server reception. This ensures that data retransmission reaches the server more reliably and quickly from the user end with millisecond-level latency requirements, resolving the issue of significant delays and lags in data retransmissions on the user end due to network jitter. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating the implementation of a data retransmission method provided in this application embodiment;
[0021] Figure 2 This is a schematic diagram illustrating an interaction between the user terminal and the server during data transmission in the data retransmission method provided in this application embodiment.
[0022] Figure 3 This is another interactive diagram illustrating data transmission between the user terminal and the server in the data retransmission method provided in this application embodiment;
[0023] Figure 4 A basic structural block diagram of a data retransmission device provided in an embodiment of this application;
[0024] Figure 5 This is a basic structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] Please see Figure 1 , Figure 1 The flowchart of a data retransmission method provided in this application embodiment may specifically include steps S11 to S12.
[0027] S11: After initiating transmission of the target data, determine the packet loss instruction data in the target data according to the response status, and the target data is represented as an instruction data sequence.
[0028] The implementation process of cloud gaming involves users inputting various game control commands on their devices. The user terminal then sends data representing these commands to the server's WebRTC transport layer via the WebRTC data channel. The server then extracts the control commands from the received data and executes them in the game. In cloud gaming applications, hundreds of control commands can be transmitted from the user terminal to the server per second, with each command having a relatively small data size and an overall transmission rate below 30kbps. However, high timeliness is required, with a desired latency in the millisecond range. In this embodiment, the target data is the sequence of command data that the user terminal needs to send to the server, and the command data is ordered according to the time of its generation.
[0029] On the user end, after initiating transmission of target data, lost packet instruction data within the target data can be determined based on the response status. The response status refers to the client's current determination of the server's reception status of the instruction data, including situations where the client is certain the instruction data has been received by the server and situations where the client cannot determine whether the instruction data has been received by the server after a timeout period. In this embodiment, the response status can be a response message received by the user end, or the detection result obtained by the timeout detection mechanism set in the user end.
[0030] S12: Retransmit each lost packet command data separately.
[0031] On the user side, after identifying the packet loss command data in the target data, data retransmission can be performed based on these command data. Specifically, each packet loss command data is retransmitted individually. "Individually" means that the data information corresponding to each packet loss command data is split into individual packets, so that each packet loss command data corresponds to a separate set of data information. In this embodiment, the retransmission process can be as follows: generating retransmission data packets from the packet loss command data and sending the retransmission data packets to the server. In some specific embodiments, depending on the response, if it is determined that there are more than one packet loss command data in the target data, then for each packet loss command data, a separate retransmission data packet can be generated, thereby achieving individual retransmission processing for each packet loss command data. It can be understood that when there are more than one packet loss command data, the retransmission data packets generated for each packet loss command data can be sent to the server simultaneously. Since a retransmission data packet only contains one packet loss command data, the probability of successful reception by the server can be increased. Furthermore, by retransmitting separately, if only a portion of the command data that needs to be retransmitted is received by the server, the user can then initiate a new retransmission of the command data that was not received by the server by receiving the server's response. If all the command data that needs to be retransmitted is received by the server, there is no need to retransmit it again. This avoids the problem of significant retransmission delays and lags on the user's end when all control commands that need to be retransmitted are placed in a single retransmission data packet and any control commands that are not received by the server need to be retransmitted.
[0032] The data retransmission method provided in the above embodiments can, in cloud gaming scenarios, enable users to promptly learn about packet loss and timeout situations in data transmission by performing timeout detection on the transmitted command data or analyzing the received response messages. Furthermore, for each lost command data, retransmission processing can be performed separately, which can increase the probability of successful reception by the server and ensure that data retransmission reaches the server more reliably and quickly from the user to the server with millisecond-level latency requirements, thus solving the problem of significant delay and lag in data retransmission at the user end due to network jitter.
[0033] In some specific embodiments, after the user initiates the transmission of target data, if the server receives the target data, it will notify the user by sending an acknowledgment message. In this embodiment, the user can monitor the message receiving interface to obtain the acknowledgment message, and then determine the lost instruction data in the target data based on the acknowledgment message. Specifically, the server will immediately respond to each received instruction data, such as a sack (selective acknowledgment) response, sending an acknowledgment message about the instruction data to the user. The user can then compare and analyze the currently initiated instruction data transmission with the received acknowledgment messages to determine if there are any cases where instruction data has been initiated for transmission but no corresponding acknowledgment message has been received. If so, the instruction data is identified as lost instruction data. In this embodiment, the server does not need to wait to receive multiple instruction data before responding, allowing the user to receive acknowledgment messages more promptly, thereby determining whether packet loss has occurred and effectively solving the problem of significant delay and lag in data retransmission on the user side.
[0034] In some specific embodiments, the server can generate a sequence of instruction identifiers representing the server's instruction data reception status based on the instruction identifier corresponding to the currently received instruction data. This sequence of instruction identifiers is then sent to the client in a response message. Upon receiving the response message, the client can determine the lost instruction data in the target data based on the sequence of instruction identifiers carried in the response message.
[0035] In some specific embodiments, when the server generates the instruction identifier sequence, the sequence records the consecutive maximum instruction identifier, the current maximum instruction identifier, and the instruction identifiers located between the consecutive maximum instruction identifier and the current maximum instruction identifier, all determined by the server from the received instruction data. After obtaining the instruction identifier sequence, the client can determine the missing instruction identifier based on the consecutive maximum instruction identifier, the current maximum instruction identifier, and the instruction identifiers located between the consecutive maximum instruction identifier and the current maximum instruction identifier recorded in the sequence. The client can then identify the instruction data corresponding to the missing instruction identifier as the lost packet instruction data in the target data.
[0036] For example, in some specific embodiments, if the current maximum instruction identifier in the instruction data currently received by the server is 10, and there are instruction identifiers 1, 2, 3, 4, 5, 6, 7, 8, and 9 before 10, and the server has received instruction data corresponding to all instruction identifiers before 10, then the server determines from the received instruction data that the consecutive maximum instruction identifier is 10, and the current maximum instruction identifier is also 10. There are no instruction identifiers between the consecutive maximum instruction identifiers and the current maximum instruction identifier. Therefore, the instruction identifier sequence generated by the server is sack 10...10. After receiving this instruction identifier sequence, the client can determine based on this sequence that there are no missing instruction identifiers between the consecutive maximum instruction identifiers and the current maximum instruction identifier, thereby determining that there is no lost instruction data in the target data.
[0037] For example, in some specific embodiments, if the current instruction identifier in the instruction data currently received by the server is 10, and there are instruction identifiers 1, 2, 3, 4, 5, 6, 7, 8, and 9 before 10, and if instruction data with instruction identifiers 3 and 4 were not received by the server before 10, then the server determines the largest consecutive instruction identifier from the received instruction data as 2, the current largest instruction identifier as 10, and the instruction identifiers between the largest consecutive instruction identifier and the current largest instruction identifier include 5, 6, 7, 8, and 9. Therefore, the instruction identifier sequence generated by the server is sack2...5,6,7,8,9,10. In some specific embodiments, for the case where there is only one missing instruction identifier, the instruction identifiers between the instruction identifier of the first record after the missing instruction identifier and the current largest instruction identifier can be omitted, that is, the instruction identifier sequence generated by the server is sack2...5,10.
[0038] For example, in some specific embodiments, when there are multiple missing instruction identifiers, for cases where there are two adjacent missing instruction identifiers, the instruction identifiers between the instruction identifier of the first record after the first missing instruction and the instruction identifier of the last record before the second missing instruction identifier can be omitted. For example, if the current instruction identifier in the instruction data currently received by the server is 10, and there are instruction identifiers 1, 2, 3, 4, 5, 6, 7, 8, and 9 before 10, and if the instruction data with instruction identifiers 3, 5, and 8 before 10 has not been received by the server, then the server determines the largest consecutive instruction identifier from the received instruction data as 2, the current largest instruction identifier as 10, and the instruction identifiers between the largest consecutive instruction identifier and the current largest instruction identifier include 4, 6, 7, and 9. Therefore, the instruction identifier sequence generated by the server can be sack2...4...6,7...9,10.
[0039] For example, please refer to the following: Figure 2 , Figure 2 This is a schematic diagram illustrating an interaction between the user terminal and the server during data transmission in the data retransmission method provided in this application embodiment. The target data is a sequence of instruction data consisting of multiple instruction data, which are sent to the server sequentially according to their generation time. Figure 2 As shown, Client represents the cloud gaming user, Server represents the cloud gaming server, Ta, Ta+T, Tb, Tc, Tc+T, Td, Td+T, Te, Te1, Te1+T, Tf, Tf+T, and Tg represent time points, da, db, dc, and dd represent the instruction data initiated by the user, and sack da...da, sackda...dc, and sack dd...dd represent the response messages returned by the server. An "×" indicates that the user initiated the transmission but did not receive the corresponding response message. A dashed line indicates that a retransmission was initiated, and the retransmitted data packet contains the db instruction data.
[0040] In some specific embodiments, the user terminal can also perform timeout detection during data transmission using a pre-defined timeout detection mechanism to obtain corresponding detection results, and then determine the lost packet command data in the target data based on the detection results. Specifically, after initiating transmission of the target data, the user terminal activates the timeout detection mechanism to perform timeout detection on the command data that has already been transmitted in the target data, and obtains the detection results. If the detection results show that command data has exceeded the timeout period without receiving a response message, then the command data that has exceeded the timeout period without receiving a response message is determined as the lost packet command data in the target data. In this embodiment, the timeout period can be determined based on the data transmission round-trip time delay value, and the timeout period is greater than or equal to the data transmission round-trip time delay value.
[0041] For example, please refer to the following: Figure 3 , Figure 3 This is another interactive diagram illustrating data transmission between the user terminal and the server in the data retransmission method provided in this application embodiment. When determining lost packet instruction data in the target data through timeout detection, such as... Figure 3As shown, Client represents the cloud gaming user, Server represents the cloud gaming server, Ta, Ta+T, Tb, Tc, Tc+T, Td, Td+T, Te, Te+T, Tc+rto, Tc+rto+T represent time points, da, db, dc, dd represent the command data initiated by the user, sack da...da represents the sack response message from the server to the received command data, an "×" indicates that the user initiated the transmission of command data but did not receive a response message, rto represents the timeout retransmission time, and the dashed line indicates that when the user does not receive a response message from the server at time Tc+rto, and both the db and dc command data are detected to have timed out at time Tc+rto, two retransmissions are initiated. One retransmission data packet contains the db command data, and the other retransmission data packet contains the dc command data.
[0042] In some specific embodiments, the timeout detection process on the user end can be as follows: After initiating transmission of target data, a timeout detection time point is set according to the timeout duration. By monitoring the time, when the monitored time reaches the timeout detection time point, timeout detection is performed on each of the transmitted command data in the target data according to the time sequence until a command data that has not timed out is detected. If a command data is detected that has exceeded the timeout duration without receiving a response message, the command identifier of the command data that has exceeded the timeout duration without receiving a response message is output as the detection result. Then, based on the detection result, the command data that has exceeded the timeout duration without receiving a response message can be identified as packet loss command data in the target data according to the command identifier recorded in the detection result. In this embodiment, the timeout duration can be determined based on the data transmission round-trip time delay value, and the timeout duration is greater than or equal to the data transmission round-trip time delay value.
[0043] In some specific embodiments, the time when the instruction data is generated is the time when the instruction data is initiated for transmission, i.e., the transmission time point. The instruction data is sent to the server sequentially according to the order in which it is generated. In this embodiment, when setting the timeout detection time point based on the timeout period, it can be specifically as follows: at the start of transmission of the target data, based on the transmission time point corresponding to the first instruction data initiated for transmission in the target data, a timeout period is added to that transmission time point to obtain a corresponding time point. This obtained time point is set as the first timeout detection time point for data transmission. When the time reaches the first timeout detection time point and a timeout is detected, based on the transmission time point corresponding to the first instruction data initiated for transmission after the timeout detection, a timeout period is added to that transmission time point to obtain the second timeout detection time point. It can be understood that the transmission time point corresponding to the first instruction data initiated for transmission after the timeout detection can be the same as the first timeout detection time point, or it can be any time point after the first timeout detection time point. Similarly, any timeout detection point after the second timeout detection point can be set to the transmission time point corresponding to the first instruction data transmitted after the previous timeout detection, by adding a timeout period to the transmission time point corresponding to the first instruction data transmitted after the previous timeout detection.
[0044] In some specific embodiments, during data transmission, for the first timeout detection point, when performing timeout detection, the first instruction data that has been initiated for transmission in the target data is taken as the detection starting point, and timeout detection is performed on each of the instruction data that has been initiated for transmission in sequence, checking whether each instruction data that has been initiated for transmission has exceeded the timeout period, until the first instruction data that has not timed out is detected, and then the timeout detection stops.
[0045] For example, if the first timeout detection point is reached, and 10 instruction data have been initiated for transmission, with transmission times of 1.001 seconds, 1.007 seconds, 1.011 seconds, 1.023 seconds, 2.036 seconds, 2.254 seconds, 2.255 seconds, 3.039 seconds, 4.338 seconds, and 4.809 seconds respectively, and assuming the timeout period is set to 5 seconds, the first timeout detection point is at 6.001 seconds. Starting at 6.001 seconds, the 10 instruction data are checked for timeout sequentially. Assume the first instruction data receives an acknowledgment message at 5.003 seconds, the second and third instructions do not receive an acknowledgment message, the fourth instruction data receives an acknowledgment message at 5.033 seconds, and instructions 5 through 10 do not receive acknowledgment messages. When checking whether each initiated transmission of command data has exceeded the timeout period, the first command data is checked at 6.010 seconds. The result shows that the first command data received an acknowledgment message at 5.003 seconds, confirming that the first command data was not a lost packet. The second command data is checked at 6.020 seconds. Since the second command data did not receive an acknowledgment message before 6.001 seconds, the difference is 5.013 seconds. This difference of 5.013 seconds is compared with the timeout period of 5 seconds. Since 5.013 seconds > 5 seconds, the result is that the second command data has exceeded the timeout period and has not received an acknowledgment message. If no response message is received for the third command data before 6.001 seconds, the transmission time of the third command data (1.011 seconds) is subtracted from the time point of detection (6.030 seconds) to obtain a difference of 5.019 seconds. This difference is compared to the timeout period of 5 seconds. Since 5.019 seconds > 5 seconds, the detection result is that the third command data has exceeded the timeout period and still has not received a response message. The fourth command data is detected at 6.040 seconds, and the detection result shows that a response message was received for the fourth command data at 5.033 seconds. Therefore, it can be determined that the fourth command data is not a lost packet command data. If no response message is received for the 5th instruction data before 6.001 seconds, the transmission time of the 5th instruction data (2.036 seconds) is subtracted from the time point 6.050 seconds used to detect whether the 5th instruction data has timed out, resulting in a difference of 4.014 seconds. This difference of 4.014 seconds is compared with the timeout period of 5 seconds. Since 4.014 seconds < 5 seconds, the detection result is that the 5th instruction data has not timed out, and timeout detection is stopped. That is, timeout detection is not performed for the 6th to 10th instruction data. Based on the detection results, the 2nd and 3rd instruction data are determined to be packet loss instruction data.Immediately after stopping the timeout detection, the second and third instruction data should be retransmitted separately.
[0046] In this embodiment, during data transmission, for the second timeout detection point and any subsequent timeout detection point, when performing timeout detection, the non-timeout instruction data detected at the previous timeout detection point is used as the detection starting point. The instruction data that has been transmitted is then timed out one by one according to the time sequence until non-timeout instruction data is detected again, at which point the timeout detection stops.
[0047] For example, if the second timeout detection point is reached, 20 instruction data have been initiated for transmission. The transmission times of these 20 instruction data are as follows: 1.001 seconds, 1.007 seconds, 1.011 seconds, 1.023 seconds, 2.036 seconds, 2.254 seconds, 2.255 seconds, 3.039 seconds, 4.338 seconds, 4.809 seconds, 6.319 seconds, 6.319 seconds, 6.320 seconds, 6.324 seconds, 6.325 seconds, 6.453 seconds, 8.911 seconds, 8.993 seconds, 9.013 seconds, and 11.041 seconds. The first timeout detection point is 6.001 seconds. The transmission time corresponding to the first instruction data transmitted after 6.001 seconds is 6.319 seconds. Therefore, based on 6.319 seconds, the second timeout detection point can be set to 11.319 seconds, meaning a new round of timeout detection begins at 11.319 seconds. Specifically, starting from the 5th instruction data, timeout detection is performed sequentially until the first non-timeout instruction data is detected in this round of timeout detection, at which point timeout detection stops. Based on the detection results, lost instruction data is identified among all instruction data between the 5th instruction data and the first non-timeout instruction data detected in this round of timeout detection. Then, immediately after stopping timeout detection, each identified lost instruction data is retransmitted individually.
[0048] In one specific embodiment, after the user sends instruction data to the server, the server will send a response message to the user upon receiving the instruction data, thus informing the user that the instruction data has been successfully delivered to the server. The timeout period can be calculated using the following formula: Timeout period = 9 / 8 * Data transmission round-trip delay. In this embodiment, compared to the standard calculation method, the preset duration value calculated by the formula used in this application has a constant relationship with the data transmission round-trip delay value. It does not require reference to historical data, and fluctuations in the data transmission round-trip delay value have a smaller impact on the preset duration value, enabling more accurate timeout detection and more timely retransmission if a timeout occurs. The calculation formula in this application refers to the detection timeout calculation method pto=max(kTimeThreshold*max(smoothed_rtt,latest_rtt),kGranularity), where kGranularity is 1ms, the coefficient kTimeThreshold uses 9 / 8, smoothed_rtt represents the smoothed data transmission round-trip delay value, and latest_rtt represents the most recently measured data transmission round-trip delay value.
[0049] Based on the above embodiments, by setting the timeout period to 9 / 8 * data transmission round-trip time, it can be ensured that the instruction data that has been transmitted has already experienced one data transmission round-trip time by the timeout detection time. This avoids the situation where the instruction data is transmitted normally but is detected as timeout because the response message is still being sent to the client, thus causing the normally transmitted instruction data to be mistakenly judged as packet-lost instruction data, ensuring the accuracy of data retransmission. Based on the transmission time corresponding to the first instruction data transmitted after the previous timeout detection time, adding a timeout period to that transmission time to obtain the next timeout detection time ensures that the instruction data transmitted after the previous timeout detection time has already experienced one data transmission round-trip time by the next timeout detection time. This avoids the situation where the instruction data transmitted after the previous timeout detection time may be transmitted normally but is detected as timeout because the response message is still being sent to the client, thus causing the instruction data transmitted after the previous timeout detection time to be mistakenly judged as packet-lost instruction data by the next timeout detection time, ensuring the accuracy of data retransmission.
[0050] In one specific embodiment, such as Figure 2 and Figure 3As shown, for each instruction data in the target data, time monitoring can be performed after the instruction data is sent. After a preset delay value T, the instruction data is then redundantly sent, thereby improving the reliability of the server receiving instruction data. It is understandable that the preset delay value is set very short, typically a few milliseconds (e.g., 2 milliseconds), much shorter than the timeout period.
[0051] It is understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0052] For some specific embodiments, please refer to Figure 4 , Figure 4 This is a basic structural block diagram of a data retransmission device provided in an embodiment of this application. In this embodiment, the device includes units used to perform the steps in the above-described method embodiments. Please refer to the relevant descriptions in the above-described method embodiments for details. For ease of explanation, only the parts relevant to this embodiment are shown. Figure 4 As shown, the data retransmission device includes a determination module 41 and a retransmission module 42. The determination module 41, after initiating transmission of target data, determines the packet loss instruction data within the target data based on the response status. The target data is represented as a sequence of instruction data. The retransmission module 42 performs retransmission processing on each packet loss instruction data individually.
[0053] It should be understood that the data retransmission device corresponds one-to-one with the data retransmission method described above, and will not be elaborated further here.
[0054] In some embodiments of this application, please refer to Figure 5 , Figure 5 This is a basic structural block diagram of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and executable on the processor 51, such as a program for a data retransmission method. When the processor 51 executes the computer program 53, it implements the steps in each embodiment of the above-described data retransmission method. Alternatively, when the processor 51 executes the computer program 53, it implements the functions of each module in the embodiment corresponding to the above-described data retransmission device. Please refer to the relevant descriptions in the embodiments for details, which will not be repeated here.
[0055] For example, the computer program 53 may be divided into one or more modules (units), which are stored in the memory 52 and executed by the processor 51 to complete this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 53 in the electronic device 5. For example, the computer program 53 may be divided into a determination module and a retransmission module, the functions of which are as described above.
[0056] The electronic device may include, but is not limited to, a processor 51 and a memory 52. Those skilled in the art will understand that... Figure 5 This is merely an example of electronic device 5 and does not constitute a limitation on electronic device 5. It may include more or fewer components than shown, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0057] The processor 51 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0058] The memory 52 can be an internal storage unit of the electronic device 5, such as a hard disk or memory. The memory 52 can also be an external storage device of the electronic device 5, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 52 can include both internal and external storage units of the electronic device 5. The memory 52 is used to store the computer program and other programs and data required by the electronic device. The memory 52 can also be used to temporarily store data that has been output or will be output.
[0059] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0060] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above. In this embodiment, the computer-readable storage medium can be either non-volatile or volatile.
[0061] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described method embodiments.
[0062] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0063] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0064] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0065] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A data retransmission method, characterized by, The method comprises the following steps: After initiating transmission of target data, determining missing packet instruction data in the target data according to a response condition, wherein the target data is represented as a sequence of instruction data; Separately performing retransmission processing on each piece of missing packet instruction data, wherein the separation means that data information corresponding to the missing packet instruction data is split piece by piece, so that one piece of missing packet instruction data corresponds to one piece of data information; The step of determining the missing packet instruction data in the target data according to the response condition comprises: According to instruction identifiers recorded in an instruction identifier sequence, determining a missing instruction identifier, and determining instruction data corresponding to the missing instruction identifier as the missing packet instruction data in the target data, wherein the instruction identifiers recorded in the instruction identifier sequence include a maximum continuous instruction identifier determined by a server from received instruction data, a current maximum instruction identifier, and instruction identifiers located between the maximum continuous instruction identifier and the current maximum instruction identifier.
2. The data retransmission method of claim 1, wherein, The step of determining the missing packet instruction data in the target data according to the response condition comprises: In a case where it is detected that instruction data that has exceeded a timeout time still does not receive a response message, the instruction data is determined as the missing packet instruction data in the target data, wherein the timeout time is determined according to a data transmission round-trip delay value.
3. The data retransmission method of claim 2, wherein, The step of determining the missing packet instruction data in the target data according to the response condition comprises: At a timeout detection time point, performing timeout detection on instruction data that has initiated transmission in a time sequence, and determining instruction data that has exceeded a timeout time and still does not receive a response message in the instruction data that has initiated transmission as the missing packet instruction data in the target data.
4. The data retransmission method of claim 3, wherein, Before the step of performing timeout detection on the instruction data that has initiated transmission in the time sequence at the timeout detection time point, the timeout detection time point is further set as: a time point obtained by adding a timeout time to a transmission time point corresponding to a first instruction data that has initiated transmission in the target data; or a time point obtained by adding a timeout time to a transmission time point corresponding to a first instruction data that has initiated transmission after each timeout detection.
5. The data retransmission method of claim 3 or 4, characterized by, The step of performing timeout detection on the instruction data that has initiated transmission in the time sequence at the timeout detection time point comprises: In a case where the timeout detection time point is a first timeout detection time point in a data transmission process, taking a first instruction data that has initiated transmission in the target data as a detection starting point, performing timeout detection on the instruction data that has initiated transmission in a time sequence one by one until a first instruction data that does not exceed the timeout time is detected, and stopping the timeout detection; In a case where the timeout detection time point is not a first timeout detection time point in the data transmission process, taking instruction data that does not exceed the timeout time detected at a previous timeout detection time point as a detection starting point, performing timeout detection on the instruction data that has initiated transmission again in a time sequence until instruction data that does not exceed the timeout time is detected again, and stopping the timeout detection.
6. The data retransmission method of any of claims 2-4, wherein, The method further comprises: determining the timeout time as 9 / 8*data transmission round-trip delay value.
7. The data retransmission method according to any one of claims 1 to 4, characterized by, The method further comprises: For each instruction data, initiating transmission of the instruction data and after a preset delay value, performing redundant transmission processing on the instruction data.
8. A data retransmission apparatus characterized by comprising: The data retransmission device comprises: A determination module configured to determine lost packet instruction data in the target data according to a response condition after initiating transmission of the target data; A retransmission module configured to perform separate retransmission processing on each lost packet instruction data; wherein separate means that data information corresponding to the lost packet instruction data is split piece by piece, so that one lost packet instruction data corresponds to one piece of data information; The step of determining the lost packet instruction data in the target data according to the response condition comprises: determining a missing instruction identifier according to an instruction identifier recorded in an instruction identifier sequence, and determining instruction data corresponding to the missing instruction identifier as the lost packet instruction data in the target data, wherein the instruction identifier recorded in the instruction identifier sequence comprises a continuous maximum instruction identifier determined by a server from received instruction data, a current maximum instruction identifier, and an instruction identifier located between the continuous maximum instruction identifier and the current maximum instruction identifier.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Data packet processing method and device, electronic equipment and readable storage medium
CN111818005A
Data message transmission method and device, electronic equipment and computer storage medium
CN113992307A