Data transmission methods and electronic devices
By segmenting data into sub-data and sending them step by step after successful confirmation at the receiving end, and retransmitting only when confirmation fails, the high retransmission cost problem in existing technologies is solved, achieving efficient and low-cost data transmission.
Patent Information
- Application Number
- CN202611140257.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, automatic retransmission has high retransmission costs, and traditional hardware retransmission is inefficient and consumes a lot of resources.
The data to be sent is divided into multiple sub-data as transmission units, and sent step by step after the receiving end confirms the success. Sub-data is retransmitted only when the confirmation fails, and the retransmission cost is reduced by using a hardware retransmission mechanism.
It improves data transmission efficiency, reduces retransmission costs, reduces reliance on external large-capacity memory, simplifies hardware retransmission logic, and reduces resource consumption.
Smart Images

Figure CN123123281A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and in particular to a data transmission method and electronic device. Background Technology
[0002] Automatic retransmission (ATR) is a mechanism that ensures reliable data transmission by detecting errors and requesting retransmissions. Typically, the sender waits for an acknowledgment signal from the receiver after each data transmission to confirm successful delivery before sending the next data.
[0003] In related technologies, data to be sent is pre-stored in a buffer as the data basis for retransmission. During retransmission, the buffer is retrieved and resent to the receiver, thus achieving retransmission.
[0004] However, the relevant technologies suffer from high retransmission costs when using automatic retransmission. Summary of the Invention
[0005] In view of this, the present disclosure provides a data transmission method and an electronic device.
[0006] One aspect of this disclosure provides a data transmission method applied at a transmitting end, comprising: responding to a data transmission command, obtaining the storage address of data to be transmitted from the data transmission command and obtaining the data to be transmitted from the storage address; dividing the data to be transmitted based on a first preset length to obtain N sub-data, where N is an integer greater than 1; transmitting the N sub-data to a receiving end in the following manner: for the nth sub-data, dividing the nth sub-data based on a second preset length to obtain M target data, where M is an integer greater than or equal to 1, n=1,…,N; sequentially transmitting the M target data and a data sequence number indicating the transmission order of the target data to the receiving end; upon receiving an nth acknowledgment signal and an nth acknowledgment data sequence number from the receiving end for the nth sub-data, transmitting the (n+1)th sub-data to the receiving end, wherein the nth acknowledgment signal indicates that the nth sub-data was successfully transmitted, and the nth acknowledgment data sequence number indicates the data sequence number of the most recently successfully transmitted target data in the nth sub-data.
[0007] According to an embodiment of this disclosure, M target data and a data sequence number indicating the transmission order of the target data are sequentially transmitted to the receiving end, including: transmitting a start signal indicating the start of target data transmission to the receiving end; transmitting M target data and a data sequence number indicating the transmission order of the target data to the receiving end; and transmitting an end signal indicating the end of target data transmission to the receiving end.
[0008] According to embodiments of this disclosure, the method further includes: upon receiving an nth failure signal and an nth failure data sequence number from the receiving end for the nth sub-data, repeatedly sending the nth sub-data to the receiving end until receiving an nth acknowledgment signal and an nth acknowledgment data sequence number from the receiving end for the nth sub-data, wherein the nth failure signal indicates that the nth sub-data transmission failed and the nth failure data sequence number indicates the data sequence number of the first target data of the nth sub-data; and sending the (n+1)th sub-data to the receiving end.
[0009] According to embodiments of this disclosure, the method further includes: if, within a predetermined time period from the last target data of the nth sub-data being sent to the receiving end, no acknowledgment signal and nth acknowledgment data sequence number for the nth sub-data are received from the receiving end, or if no failure signal and nth failure data sequence number for the nth sub-data are received from the receiving end within the predetermined time period, repeatedly sending the nth sub-data to the receiving end until the acknowledgment signal and nth acknowledgment data sequence number for the nth sub-data are received from the receiving end; and sending the (n+1)th sub-data to the receiving end.
[0010] Another aspect of this disclosure provides a data transmission method applied at a receiving end, comprising: in response to receiving an nth sub-data from a sending end, and M target data and a data sequence number indicating the transmission order of the target data from the sending end, sequentially determining the expected sequence number of the (m+1)th target data according to the data sequence number of the mth target data, where m=1, ...,M, the target data represents data segmented by the sending end based on a second preset length, where M is an integer greater than or equal to 1; matching the expected sequence number of the (m+1)th target data with the data sequence number of the (m+1)th target data, and if a match is found, sending an nth acknowledgment signal and an nth acknowledgment data sequence number to the sending end for the nth sub-data, where the nth acknowledgment signal indicates successful transmission of the nth sub-data, and the nth acknowledgment data sequence number represents the data sequence number of the latest successfully transmitted target data in the nth sub-data, the sending end segmenting the data to be transmitted into N sub-data segments based on a first preset length, where n=1, ...,N, and the sending end, in response to a data transmission command, obtaining the storage address of the data to be transmitted from the data transmission command and obtaining the data to be transmitted from the storage address.
[0011] According to embodiments of this disclosure, the method further includes: receiving a start signal indicating the start of transmission of target data; receiving M target data from a transmitter and a data sequence number indicating the transmission order of the target data; and receiving an end signal indicating the end of transmission of the target data.
[0012] According to embodiments of this disclosure, the method further includes: if the expected sequence number of the (m+1)th target data and the data sequence number of the (m+1)th target data do not match, sending to the transmitter an nth failure signal and an nth failure data sequence number for the nth sub-data, wherein the nth failure signal indicates that the nth sub-data transmission failed, and the nth failure data sequence number indicates the data sequence number of the first target data of the nth sub-data; and using the data sequence number of the first target data for the nth sub-data as an updated expected sequence number, wherein the updated expected sequence number indicates that the data sequence number of the first target data for the nth sub-data is expected to be repeatedly received from the transmitter.
[0013] According to embodiments of this disclosure, the method further includes: in response to receiving the nth sub-data from the transmitter, and M target data and a data sequence number indicating the transmission order of the target data from the transmitter, if the data sequence number of the first target data of the nth sub-data matches the updated expected sequence number, then the expected sequence number of the (m+1)th target data is determined sequentially based on the data sequence number of the mth target data, m=1,...,M; the expected sequence number of the (m+1)th target data is matched with the data sequence number of the (m+1)th target data, and if they match, the nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data are sent to the transmitter.
[0014] According to embodiments of this disclosure, the method further includes: upon receiving the nth sub-data from the transmitter, and receiving K target data and data sequence numbers indicating the transmission order of the target data from the transmitter, if the data sequence number of the first target data of the nth sub-data matches the expected update sequence number, then sequentially determining the expected sequence number of the (m+1)th target data based on the data sequence number of the mth target data, where m = 1, ..., K, and K is less than M; sequentially matching the expected sequence number of the (m+1)th target data with the data sequence number of the (m+1)th target data, and if a match is found and upon receiving the nth sub-data from the transmitter, and M target data and data sequence numbers indicating the transmission order of the target data from the transmitter, discarding target data whose data sequence number precedes the expected sequence number of the Kth target data; sequentially determining the expected sequence number of the (k+1)th target data based on the data sequence number of the kth target data, where k = K, ..., M; matching the expected sequence number of the (k+1)th target data with the data sequence number of the (k+1)th target data, and if a match is found, sending the nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data to the transmitter.
[0015] According to an embodiment of this disclosure, the method further includes: if multiple nth sub-data are received from the sender when sending an nth acknowledgment signal and an nth acknowledgment data sequence number for the nth sub-data to the sender, discarding the received nth sub-data from the sender; and sending the nth acknowledgment signal and an nth acknowledgment data sequence number for the nth sub-data to the sender again.
[0016] Another aspect of this disclosure provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the method described above.
[0017] The above one or more embodiments have the following technical effects: dividing the data to be sent into multiple sub-data as the unit of data transmission not only improves the transmission efficiency, but also allows for retransmission of sub-data when retransmission is required, thereby reducing retransmission costs.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0019] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 The illustration schematically depicts a scenario of a data transmission method according to an embodiment of the present disclosure;
[0021] Figure 2 A flowchart illustrating a data transmission method according to an embodiment of the present disclosure is shown schematically;
[0022] Figure 3 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically;
[0023] Figure 4 A schematic diagram of data to be transmitted according to an embodiment of the present disclosure is shown.
[0024] Figure 5 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically;
[0025] Figure 6 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically;
[0026] Figure 7 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically;
[0027] Figure 8 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically;
[0028] Figure 9 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically;
[0029] Figure 10 A schematic block diagram of an electronic device that can be used to implement the methods of embodiments of the present disclosure is shown. Detailed Implementation
[0030] The embodiments of this disclosure will now be described with reference to the accompanying drawings. Various details of the embodiments of this disclosure are included to aid understanding and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0031] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.
[0032] First, let's explain the terms used in this application:
[0033] Direct Memory Access (DMA) engine: A hardware control unit that manages direct data transfer between memory and peripherals.
[0034] Traditional automatic retransmission technology, if based on software, is far less efficient than hardware-based retransmission due to the need for software intervention. Secondly, hardware-based retransmission, if relying on a DMA engine, typically requires complex control logic and context information when dealing with multiple DMA engines, resulting in latency and area overhead. Furthermore, if hardware retransmission stores all data in a dedicated buffer, it consumes significant area resources.
[0035] Figure 1 The illustration depicts a scenario of a data transmission method according to an embodiment of the present disclosure.
[0036] like Figure 1 As shown, chip 110 and chip 120 transmit data via a network.
[0037] Chip 110 includes a central processing unit 111, a direct memory access engine 112, a memory 113, an on-chip network 114, and an interconnect input / output module 115, wherein the interconnect input / output module 115 includes a media access control layer, a physical coding sublayer, and a physical layer.
[0038] Chip 120 includes a central processing unit 121, a direct memory access engine 122, a memory 123, an on-chip network 124, and an interconnect input / output module 125, wherein the interconnect input / output module 125 includes a media access control layer, a physical coding sublayer, and a physical layer.
[0039] The central processing unit 111 of chip 110 sends a data transmission command to the direct memory access engine 112 via the on-chip network 114, instructing the direct memory access engine 112 to perform data transmission. The direct memory access engine 112 obtains the storage address of the data to be transmitted from the data transmission command, and after obtaining the data from the storage address, it divides the data to be transmitted into N sub-data, using each sub-data as the basis for transmission. Data transmission between chip 110 and chip 120 relies on the interconnect input / output module 115, the network, and the interconnect input / output module 125. The data to be transmitted is stored in the memory 113 of chip 110, and the received data is stored in the memory 123 of chip 120.
[0040] Specifically, the interconnect input / output module consists of a media access control layer supporting preset rates, a physical coding sublayer, and a physical layer. In the transmission direction, the media access control layer is mainly responsible for encapsulating the data transmitted from the direct memory access engine 112 into frame formats conforming to relevant protocols and transmitting it to the physical layer.
[0041] In the receiving direction, the Media Access Control (Media Access Control) layer is primarily responsible for unpacking the data received from the Physical Layer and sending it to the Direct Memory Access Engine 122. The Media Access Control layer handles data reception, decoding, and line status detection, ensuring efficient and stable data transmission at the Physical Layer to meet the requirements for long-distance data transmission between chips.
[0042] For data transmission, the central processing unit (CPU) prepares the data to be transmitted, along with relevant information, including the data's address and length. This information is then transmitted to the direct memory access engine (DMI) via the on-chip network. The DMI is responsible for reading the data to be transmitted based on this information, converting it, and then issuing it. Inter-chip data transmission is handled by the interconnect input / output module.
[0043] This reduces the probability of packet loss during interconnect input / output at the hardware level. When packet loss occurs, the Direct Memory Access Engine (DME) automatically triggers a hardware-based retransmission mechanism to maintain data integrity without operating system intervention. Hardware retransmission avoids interruptions and software intervention, thereby reducing latency caused by the operating system running the network protocol stack.
[0044] Figure 2 A flowchart illustrating a data transmission method according to an embodiment of the present disclosure is shown schematically.
[0045] like Figure 2 As shown, the data transmission method of this embodiment includes operations S210 to S250. This method is applied at the sending end.
[0046] In operation S210, in response to the data transmission command, the storage address of the data to be transmitted is obtained from the data transmission command, and the data to be transmitted is obtained from the storage address.
[0047] The data transmission command indicates an instruction to send data from the sending end to the receiving end. The data transmission command includes the storage address of the data to be sent, from which the sending end can retrieve the data.
[0048] In operation S220, the data to be sent is divided into N sub-data based on the first preset length.
[0049] The first preset length refers to the length used to divide the data to be sent.
[0050] N is an integer greater than 1.
[0051] It should be understood that when data retransmission is required, only shorter sub-data is retransmitted, avoiding the burden on the transmission line caused by retransmitting the complete data to be sent.
[0052] In operation S230, N sub-data are sent to the receiving end in the following manner: For the nth sub-data, the nth sub-data is divided based on the second preset length to obtain M target data.
[0053] The second preset length refers to the length used to divide the nth sub-data.
[0054] M is an integer greater than or equal to 1, n=1, ...,N.
[0055] It should be understood that, in order to further reduce the burden on the transmission line when transmitting data, the nth sub-data is divided into multiple target data when sending the nth sub-data, which can also improve the transmission efficiency.
[0056] In operation S240, M target data and the data sequence number indicating the sending order of the target data are sent to the receiving end in sequence.
[0057] The data sequence number is used to distinguish the transmission order of the target data. For example, when the first target data in the first sub-data is transmitted, the data sequence number starts from 0 and increments until the last sub-data is transmitted. If there are three sub-data, and each sub-data includes three target data, then the data sequence numbers of the target data in the first sub-data are 0, 1, and 2; the data sequence numbers of the target data in the second sub-data are 3, 4, and 5; and the data sequence numbers of the target data in the third sub-data are 6, 7, and 8.
[0058] In operation S250, upon receiving the nth acknowledgment signal and the sequence number of the nth acknowledgment data from the receiving end, the (n+1)th sub-data is sent to the receiving end.
[0059] The nth confirmation signal indicates that the nth sub-data was successfully transmitted.
[0060] The sequence number of the nth acknowledgment data indicates the sequence number of the most recently successfully transmitted target data within the nth sub-data set. For example, if there are three sub-data sets: the first sub-data set includes target data with sequence numbers 0 and 1; the second sub-data set includes target data with sequence numbers 2 and 3; and the third sub-data set includes target data with sequence numbers 4 and 5 respectively, and these three sub-data sets are successfully transmitted sequentially, then the received third acknowledgment data sequence number is 5, indicating that the most recently successfully transmitted target data within the third sub-data set is sequence number 5.
[0061] According to embodiments of this disclosure, the data to be sent is divided into sub-data segments according to a first preset length, and sent as sub-data segments, saving the cost of retransmission. When data loss occurs and retransmission is required, only the sub-data segments need to be retransmitted, and the receiving end also confirms the data segment by sending the sub-data segment. This eliminates the need for external large-capacity memory to achieve data transmission, reducing retransmission costs.
[0062] In some exemplary embodiments, a start signal indicating the start of target data transmission is sent to the receiving end; M target data items and data sequence numbers indicating the transmission order of the target data are sequentially sent to the receiving end; and an end signal indicating the end of target data transmission is sent to the receiving end.
[0063] The start and end signals are used to mark the start and end of sub-data transmission.
[0064] In practical applications, a start signal can be added to the data packet of the first target data, and an end signal can be added to the data packet of the last target data, so that the receiving end receives signals indicating the start and end of sub-data transmission.
[0065] According to embodiments of this disclosure, adding start and end signals to the transmission of sub-data helps the receiving end to distinguish when the transmission of the sub-data begins and ends.
[0066] In some exemplary embodiments, upon receiving the nth failure signal and the nth failure data sequence number for the nth sub-data from the receiving end, the nth sub-data is repeatedly transmitted to the receiving end until the nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data are received from the receiving end. Then, the (n+1)th sub-data is transmitted to the receiving end.
[0067] Here, the nth failure signal indicates that the nth sub-data transmission failed, and the nth failure data sequence number indicates the data sequence number of the first target data of the nth sub-data.
[0068] It should be understood that when the receiving end sends back the nth failure signal and the sequence number of the nth failure data, it means that the transmission of the nth sub-data is incorrect, and the retransmission of the nth sub-data should be triggered at this time.
[0069] According to embodiments of this disclosure, when a failure signal is received from the receiving end, a retransmission is triggered, and all target data in the failed sub-data is retransmitted to ensure the integrity of data transmission.
[0070] In some exemplary embodiments, if no acknowledgment signal and acknowledgment number for the nth sub-data are received from the receiving end within a predetermined time period from the last target data of the nth sub-data to the receiving end, or if no failure signal and failure number for the nth sub-data are received from the receiving end within the predetermined time period, the nth sub-data is repeatedly sent to the receiving end until the acknowledgment signal and acknowledgment number for the nth sub-data are received from the receiving end. Then, the (n+1)th sub-data is sent to the receiving end.
[0071] It should be understood that after the sending end sends the last target data of a certain sub-data to the receiving end, under normal reception conditions, the receiving end will receive an acknowledgment signal and acknowledgment data signal corresponding to that sub-data, or a failure signal and failure data signal corresponding to that sub-data. However, to avoid the sending end not receiving either success or failure signals and thus being unable to receive feedback, a predetermined time period needs to be set at the sending end. When the predetermined time period is exceeded, it is determined that a retransmission will be automatically triggered.
[0072] In practical applications, the transmitting end needs to set a timeout counter. After the transmission ends, the timeout counter is enabled. When the counter reaches the threshold configured in the register, it is considered as receiving failure feedback from the receiving end, and a retransmission is executed. The retransmission starts from the sequence number of the first target data in the sub-data, to avoid deadlock at the transmitting end caused by lost feedback from the receiving end.
[0073] Simultaneously, the retransmission count needs to be recorded. It should be reset upon receiving a successful response, incremented by 1 upon each retransmission, and reported as an interrupt when the count reaches a threshold. For the transmission of a single data packet, if the sender receives both a successful and a failed response, it is considered a successful response, because even if a retransmission is triggered, the sender will send duplicate packets, which the receiver will discard.
[0074] According to embodiments of this disclosure, if the sending end does not receive success or failure feedback within a predetermined time period, it automatically triggers retransmission, which can avoid deadlock due to lack of feedback and improve transmission efficiency.
[0075] Figure 3 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically.
[0076] like Figure 3 As shown, the data transmission method of this embodiment includes operations S310 to S320, and the method is applied to the receiving end.
[0077] In operation S310, in response to receiving the nth sub-data from the transmitter, as well as M target data and data sequence numbers indicating the transmission order of the target data from the transmitter, the expected sequence number of the (m+1)th target data is determined sequentially based on the data sequence number of the mth target data.
[0078] The expected sequence number represents the expected sequence number of the next target data to be sent to the receiving end, and is used by the receiving end to verify whether the received target data is correct. For example, if data loss occurs, the sequence number of the data received by the receiving end will not match the expected sequence number, and the receiving end can detect that data loss has occurred.
[0079] Where m = 1, ..., M, and M is an integer greater than or equal to 1.
[0080] The target data represents the data that the sending end divides into the nth sub-data based on the second preset length.
[0081] In operation S320, the expected sequence number of the (m+1)th target data is matched with the data sequence number of the (m+1)th target data. If a match is found, the nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data are sent to the sending end.
[0082] The nth confirmation signal indicates that the nth sub-data was successfully transmitted, and the nth confirmation data sequence number indicates the data sequence number of the latest successfully transmitted target data in the nth sub-data.
[0083] The sending end divides the data to be sent into N sub-data based on a first preset length, n=1, ...,N. In response to the data sending command, the sending end obtains the storage address of the data to be sent from the data sending command and obtains the data to be sent from the storage address.
[0084] According to embodiments of this disclosure, the sequence number of the next target data to be received is predicted sequentially based on the sequence number of the received data, and this prediction is used as the basis for determining whether the data has been received correctly. This helps to promptly send back messages of successful reception and failure to the sending end, thereby improving the efficiency of data transmission.
[0085] In some exemplary embodiments, a start signal indicating the start of target data transmission is received; M target data items and data sequence numbers indicating the transmission order of the target data are received from the transmitting end; and an end signal indicating the end of target data transmission is received.
[0086] According to embodiments of this disclosure, receiving start and end signals helps the receiving end determine the start and end of each sub-data transmission, improving transmission efficiency and accuracy.
[0087] In some exemplary embodiments, if the expected sequence number of the (m+1)th target data and the data sequence number of the (m+1)th target data do not match, the nth failure signal and the nth failure data sequence number for the nth sub-data are sent to the sending end. Then, the data sequence number of the first target data for the nth sub-data is used as the updated expected sequence number.
[0088] Here, the nth failure signal indicates that the nth sub-data transmission failed, and the nth failure data sequence number indicates the data sequence number of the first target data of the nth sub-data.
[0089] The updated expected sequence number indicates the expected sequence number of the first target data for the nth sub-data to be repeatedly received from the transmitter. It is used to compare with the data signal of the first target data to be repeatedly received to confirm whether it is the expected target data.
[0090] According to embodiments of this disclosure, by comparing the expected sequence number and the data sequence number, the receiving end can promptly identify whether a transmission error exists in the data, thereby promptly providing feedback to the sending end and triggering retransmission in case of an error. Updating the expected sequence number can be used to identify whether the newly received target data is the first data in the required retransmitted sub-data, that is, as a determination of whether the expected sub-data has been received, thereby improving the accuracy of retransmission.
[0091] If a transmission failure signal is sent back to the sending end, a retransmission will be triggered. In some exemplary embodiments, in response to receiving the nth sub-data from the sending end, as well as M target data and data sequence numbers indicating the transmission order of the target data from the sending end, if the data sequence number of the first target data of the nth sub-data matches the updated expected sequence number, then the expected sequence number of the (m+1)th target data is determined sequentially based on the data sequence number of the mth target data. Next, the expected sequence number of the (m+1)th target data is matched with the data sequence number of the (m+1)th target data; if a match is found, the nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data are sent to the sending end.
[0092] Where m = 1, ..., M.
[0093] It should be understood that when the receiving end reports a failure in the transmission of the nth sub-data, it expects to receive a retransmitted nth sub-data. If M target data items and their corresponding sequence numbers are received at this point, the receiving end needs to verify whether the sequence number of the first target data item matches the updated expected sequence number. If they match, it means the nth sub-data has been received. Then, if all M target data items match the expected sequence number, the receiving end sends a message to the sending end indicating successful transmission of that sub-data.
[0094] According to embodiments of this disclosure, a failure signal and a failure data sequence number are used to trigger retransmission at the sending end to address transmission errors of sub-data. After the receiving end receives a retransmission of the sub-data, it needs to verify whether it is the expected data to prevent the transmission of erroneous data. After verification, the sequence number of each received target data is compared again to ensure the correct reception of each target data, thereby guaranteeing the accuracy of the retransmitted data.
[0095] In practical applications, the receiving end reports a data transmission failure, but this signal may be lost due to congestion or unstable transmission. The sending end does not receive this feedback, and in this case, the sending end will time out and trigger a retransmission because it has not received feedback. In some exemplary embodiments, when the nth sub-data and K target data and their sequence numbers indicating the transmission order of the target data are received from the sending end, if the sequence number of the first target data of the nth sub-data matches the updated expected sequence number, then the expected sequence number of the (m+1)th target data is determined sequentially based on the sequence number of the mth target data. Next, the expected sequence number of the (m+1)th target data is matched with its data sequence number. If a match is found, and the nth sub-data and M target data and their sequence numbers indicating the transmission order of the target data are received from the sending end, the target data whose sequence number precedes the expected sequence number of the Kth target data is discarded. Then, the expected sequence number of the (k+1)th target data is determined sequentially based on the sequence number of the kth target data. Finally, the expected sequence number of the (k+1)th target data is matched with the data sequence number of the (k+1)th target data. If a match is found, the nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data are sent to the sending end.
[0096] Where m = 1, ..., K, and K is less than M.
[0097] k = K, ..., M.
[0098] It should be understood that if the failure signal and failure data sequence number are lost due to congestion or unstable transmission, causing the sender to fail to receive the data in time, a timeout will trigger an automatic retransmission. Since the retransmitted data is the data the receiver expects to receive again, the receiver will accept the received target data and verify its correctness using the expected sequence number. However, if a complete sub-data segment is not received completely (i.e., m is less than K), and the sender receives another transmission for that sub-data segment, it indicates that the sender has received a congestion failure signal and failure data sequence number, triggering a retransmission. To ensure the integrity of the sub-data received by the receiver, all target data before the expected sequence number of the Kth target data segment is discarded; only the data after the expected sequence number is received and verified using the expected sequence number.
[0099] According to the embodiments of this disclosure, when the receiving end faces two retransmissions of the same sub-data, it needs to combine the data from the two retransmissions and store only one complete sub-data at the receiving end. This can prevent confusion in the retransmission triggering logic of the sending end, and the sending end can retransmit when the triggering condition for retransmission is required.
[0100] In practical applications, the receiving end reports successful data transmission, but this signal may be lost due to congestion or unstable transmission. Since the sending end does not receive this feedback, it will time out and trigger a retransmission. In some exemplary embodiments, when sending the nth acknowledgment signal and the nth acknowledgment data sequence number to the sending end for the nth sub-data, if the nth sub-data is received multiple times from the sending end, the received nth sub-data is discarded. The nth acknowledgment signal and the nth acknowledgment data sequence number are then sent to the sending end again.
[0101] It should be understood that the sending end will trigger retransmission due to timeout, meaning that retransmission will be triggered even if an acknowledgment signal and acknowledgment data sequence number are not received. In this case, the receiving end, having already received the complete sub-data, must discard the newly received sub-data and resend an acknowledgment feedback message to the sending end.
[0102] According to embodiments of this disclosure, after confirming the complete reception of the sub-data, the receiving end receives the sub-data again and discards the newly received duplicate sub-data to save its own storage space. At the same time, it reports the successful reception of the sub-data again to prevent the sending end from deadlocking, thereby improving the efficiency of data transmission.
[0103] Figure 4 A schematic diagram of data to be transmitted according to an embodiment of the present disclosure is shown.
[0104] like Figure 4 As shown, the data to be sent represents the data between the start address and the end address. The data to be sent is divided into the first sub-data, the second sub-data, ..., the nth sub-data based on the first preset length.
[0105] For each sub-data, the sub-data is divided into target data in the above embodiments based on a second preset length.
[0106] It should be understood that for retransmissions triggered in the embodiments of this disclosure, the retransmission length is the length of each sub-data. If a transmission error occurs, the erroneous sub-data is retransmitted until all sub-data is successfully transmitted. This results in smaller transmitted data packets, improving retransmission efficiency and reducing the cost of retransmissions. Finally, this design is simpler and more scalable than traditional hardware retransmission mechanisms, and can support multi-channel DMA engines or switch hardware transmission mechanisms depending on the use case, as well as reliable transmission over different distances.
[0107] Figure 5 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically.
[0108] like Figure 5As shown, the data to be sent in this embodiment is divided into the first sub-data, ..., the (n-1)th sub-data, and the nth sub-data.
[0109] For the transmission of the first sub-data, the transmitting end 510 first sends a data packet including write data, a start signal, and a data sequence number of 0. Next, it sends a data packet including write data and a data sequence number of 1. Finally, it sends a data packet including write data, an end signal, and a data sequence number of 2. Here, the start signal 512 is represented by SOI, the end signal 511 by EOI, the data sequence number 513 by seqid, and the write data represents the data to be transmitted, i.e., the target data in the above embodiment.
[0110] For the reception of the first sub-data, receiver 520 receives data packets with sequence numbers 0, 1, and 2 respectively. For data packets including an end signal, receiver 520 identifies it as the last target data and sends a first acknowledgment signal and an ack packet with the first acknowledgment data sequence number 2 to sender 510. The acknowledgment signal 521 is represented by ack, and the acknowledgment data sequence number 522 is represented by seqid.
[0111] For transmitting the (n-1)th sub-data, transmitter 510 first transmits a data packet containing write data, a start signal, and data sequence number 3. Next, it transmits a data packet containing write data and data sequence number 4. Finally, it transmits a data packet containing write data, a stop signal, and data sequence number 5.
[0112] For the reception of the (n-1)th sub-data, the receiver 520 receives data packets with sequence numbers 3, 4, and 5 respectively. For data packets that include an end signal, the receiver 520 identifies them as the last target data and sends the (n-1)th acknowledgment signal and an ACK packet with sequence number 5 of the (n-1)th acknowledgment data to the sender 510.
[0113] For transmitting the nth sub-data, transmitter 510 first transmits a data packet containing write data, a start signal, and data sequence number 6. Next, it transmits a data packet containing write data and data sequence number 7. Finally, it transmits a data packet containing write data, a stop signal, and data sequence number 8.
[0114] For the reception of the nth sub-data, the receiver 520 receives data packets with sequence numbers 6, 7, and 8 respectively. For data packets that include an end signal, the receiver 520 identifies them as the last target data and sends the nth acknowledgment signal and an ACK packet with sequence number 8 of the nth acknowledgment data to the sender 510.
[0115] It should be understood that the data packets corresponding to sub-data are segmented into multiple data packets for execution, with a start signal (SOI) and an end signal (EOI) carried in the first and last data packets. After the transmitter 510 sends all the sub-data packets, it waits for feedback of success or failure, indicated by ack (acknowledgment) and nack (noac). When the transmitter 510 receives ack, it processes the next sub-data; if it receives nack, it triggers retransmission and reprocesses the current sub-data. This process is repeated until all sub-data has been processed, at which point the transmitter can notify the central processing unit of the completion signal for the data to be sent.
[0116] Figure 6 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically.
[0117] like Figure 6 As shown, this embodiment addresses the retransmission of a specific sub-data. In this case, the retransmission occurs because the sending end receives a failure feedback from the receiving end.
[0118] For a specific sub-data segment, the transmitting end 610 first sends a data packet containing write data, a start signal, and a data sequence number of 0. Next, it sends a data packet containing write data and a data sequence number of 1. Then, it sends a data packet containing write data and a data sequence number of 2. Finally, it sends a data packet containing write data, an end signal, and a data sequence number of 3. Upon receiving a failure signal 621 and a failure data sequence number 622 from the receiving end 620 for this sub-data segment, the transmitting end 610 triggers a retransmission, repeatedly sending data packets for this sub-data segment to the receiving end 620 until it receives an acknowledgment signal and an acknowledgment data sequence number from the receiving end 620, thus completing the transmission of this sub-data segment.
[0119] Receiver 620 first successfully receives a data packet with sequence number 0 and sets the expected sequence number to 1. When packet loss is detected, the expected sequence number is set back to 0, which is the sequence number of the first target data in that sub-data packet, and a failure signal and a nack packet with a failure data sequence number of 0 are sent to sender 610 to trigger retransmission. After this, all received data packets that do not match the expected sequence number are discarded until a data packet with the expected sequence number is received again from sender 610. Here, the expected sequence number 623 is represented by Eseqid, the failure signal 621 by nack, and the failure data sequence number 622 by seqid.
[0120] For a received data packet that meets expectations, the receiving end 620 receives it and uses the expected sequence number to match it to verify its correctness. For a data packet with a data sequence number of 0, the expected sequence number is set to 1. For a data packet with a data sequence number of 1, it matches the expected sequence number of 0, and so on, verifying each data packet in turn. After all data packets are verified to be correct, feedback is sent to the sending end 610.
[0121] In this embodiment, after receiving a data transmission command, the transmitting end 610 configures the corresponding registers, retrieves the data, and transmits it. Assume a sub-data segment is split into four data packets with sequence numbers seqid 0-3. The initial data packet 0 carries a start signal SOI, and the final data packet 3 carries an end signal EOI. When the receiving end 620 successfully receives data packet 0 but detects a packet loss error, it sends ncak along with the sequence number seqid = 0 of the data that should have been received. After triggering a retransmission, the receiving end 620 discards all subsequent data packets until it receives the correct data packet; that is, it discards data packets with sequence numbers 1, 2, and 3 until it receives the data packet with sequence number 0.
[0122] In practical applications, the receiver 620 triggers a retransmission and simultaneously enables the retransmission in progress state `replay_en`. When this state is enabled, the receiver 620 discards all subsequent data packets until it receives the correct data packet.
[0123] In this embodiment, when the sending end 610 is sending data normally and does not receive success or failure feedback, it increments the sequence number of the next target data by 1 for each target data sent. When failure feedback is received, the sequence number is updated to the sequence number of the first segment of target data in the sub-data that the receiving end 620 requests to be retransmitted, and retransmission is performed.
[0124] When the receiving end 620 receives a data packet with the correct sequence number, it cancels the replay_en status flag indicating that retransmission is in progress and completes the retransmission. After receiving a data packet carrying the EOI identifier from the sending end 610 and correctly storing the data in memory, the receiving end 620 sends an ACK packet carrying the sequence number (seqid) of the last data packet, which is 3. Upon receiving the ACK packet, the sending end 610 terminates the transmission of the current sub-data and begins the transmission of the next sub-data.
[0125] It should be understood that during data transmission, the receiving end needs to record and maintain the following transmission states: start signal received, sequence number of the data packet corresponding to the start signal received, end signal received, retransmission in progress, and expected sequence number of the next retransmitted data packet. By comparing the sequence number of the received retransmitted data packet with the expected sequence number, it is determined whether it is a correct packet, a duplicate packet, or a packet loss has occurred. If retransmission is required, the retransmission in progress indication must be enabled, and a retransmission signal must be sent until a correct data packet with a sequence number equal to the expected sequence number is received.
[0126] Figure 7 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically.
[0127] like Figure 7As shown, this embodiment addresses retransmission triggered by a timeout at the sending end. In this case, the timeout occurs because the sending end has not successfully received a success response.
[0128] For a specific data segment, sender 710 first sends a data packet containing write data, a start signal, and a data sequence number of 0. Next, it sends a data packet containing write data and a data sequence number of 1. Then, it sends a data packet containing write data and a data sequence number of 2. Finally, it sends a data packet containing write data, a stop signal, and a data sequence number of 3. If sender 810 fails to receive feedback within the predetermined time period, it triggers a retransmission, repeatedly sending data packets for that specific data segment to receiver 720 until it receives an acknowledgment signal and acknowledgment sequence number from receiver 720, thus completing the transmission of that data segment.
[0129] The receiver 720 successfully receives data packets with sequence numbers 0, 1, 2, and 3. Upon recognizing the end-of-data-time (EOI) signal, it sends an ACK packet to the sender 710. However, if the receiver receives the same data packet again from the sender 710, it discards the received data packet and sends another ACK packet to the sender 710 for that data packet.
[0130] It should be understood that when the sender 710 transmits normally, it enables the timeout counter after sending the last data packet. After the receiver 720 receives the data packet normally, it sends an ACK packet carrying the sequence number (seqid) of the last data packet. However, this ACK packet is blocked during its return journey, triggering a retransmission after the sender 710 times out. At this point, the sender 710's reconnection will retransmit this sub-data. The receiver 720, based on the newly received data sequence number (seqid) and SOI identifier, detects that the sender 710 has timed out. The receiver 720 will discard the retransmitted packet, and the eseqid will not change. However, to avoid a deadlock caused by the sender 710 not receiving an ACK packet, after fully receiving the retransmission packet carrying the EOI, it will still send an ACK packet to the sender 710, thus ending the transmission of this sub-data and proceeding to the transmission of the next sub-data.
[0131] In practical applications, the blocking of ACK packets can occur in two different ways depending on the time it takes for the packet to return to the sender:
[0132] In the first scenario, when the blocked ACK packet returns to the sender only after the retransmission is complete, the sender will receive two identical ACK packets for the same sub-data: one from the blocked ACK packet and the other from the retransmitted ACK packet sent by the receiver. Regardless of the source, upon receiving the first ACK packet, the sender begins processing the next sub-data and ignores the subsequent ACK packet.
[0133] In the second scenario, when the blocked ACK packet returns to the sending chip before the sending end completes the retransmission, the sending end immediately terminates the retransmission, considers it as having received a correct ACK packet, and begins processing the next sub-data. The receiving end will not generate a retransmission ACK packet in this case.
[0134] Figure 8 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically.
[0135] like Figure 8 As shown, this embodiment is for retransmission triggered by a timeout at the sending end 810. The timeout occurs because the sending end 810 has not successfully received the failure feedback.
[0136] For a specific data segment, transmitter 810 first sends a data packet containing write data, a start signal, and a data sequence number of 0. Next, it sends a data packet containing write data and a data sequence number of 1. Then, it sends a data packet containing write data and a data sequence number of 2. Finally, it sends a data packet containing write data, a stop signal, and a data sequence number of 3. However, if transmitter 810 does not receive feedback within the predetermined time period, it triggers a retransmission, sending a data packet containing write data, a start signal, and a data sequence number of 0, followed by a data packet containing write data and a data sequence number of 1.
[0137] Next, the sending end 810 receives a nack packet from the receiving end 820, including a failure signal and a failure data sequence number for the sub-data, thus triggering the sending end 810 to retransmit the sub-data again. It then retransmits a data packet containing write data, a start signal, and a data packet with sequence number 0; a data packet containing write data and a data packet with sequence number 1; a data packet containing write data and a data packet with sequence number 2; and a data packet containing write data, a stop signal, and a data packet with sequence number 3. Finally, it receives an acknowledgment signal and an acknowledgment data sequence number for the sub-data from the receiving end 820.
[0138] For the reception of this sub-data, the receiving end 820 successfully received data packets with sequence numbers 0, 1, and 2, but detected that the data packet with sequence number 3 was lost. Therefore, the expected sequence number was changed to 0, and a nack packet for this sub-data was sent to the sending end 810. The nack packet includes a failure signal and the sequence number of the first target data that is expected to be received for this sub-data.
[0139] However, the ACK packet was blocked on its return journey, and the receiver 820 received the sub-data that was automatically retransmitted due to the timeout of the sender 810. The receiver 820 received the retransmitted sub-data and verified it using the expected sequence number, successfully receiving the data packets with sequence number 0 and sequence number 1.
[0140] Then, the receiver 810 receives the same sub-data again, indicating that it has received the previously blocked NACK packet. To avoid duplicate target data occupying the storage space of the receiver 820, the previously received target data before the expected sequence number 2 is discarded, and only the data after that is retained, thus ensuring that the receiver 820 retains complete and non-duplicate target data. That is, data packets with duplicate sequence numbers 0 and 1 are discarded, and data packets with sequence numbers 2 and 3 are received. When the sequence number of the received data packet matches the expected sequence number, an acknowledgment signal and acknowledgment data sequence number are sent to the receiver 810 for that sub-data.
[0141] It should be understood that when the sender 810 transmits normally and enables the timeout counter, if the receiver 820 fails to receive the data packet correctly, its eseqid reverts to the seqid carried by the data packet containing the SOI, and it simultaneously sends a nack packet to the sender 810. However, during the return process, a blockage occurs, triggering a retransmission by the sender 810. When the blocked nack packet returns to the sender 810 before the retransmission ends, the retransmission will restart. The receiver 820 will discard the already received retransmitted data packets, retain the unreceived retransmitted data packets, and send an ack packet after receiving the data.
[0142] When returning to sender 810 after the retransmission is complete, sender 810 reads the seqid of the nack packet and finds that it is a retransmission request for the sub-data that has been sent. It will ignore it and will not trigger a retransmission again.
[0143] Figure 9 A flowchart illustrating a data transmission method according to another embodiment of this disclosure is shown schematically.
[0144] like Figure 9 As shown, this embodiment addresses retransmission triggered by a timeout at the sending end. The timeout occurs because the sending end failed to receive a success feedback, and this success feedback was lost on the return journey.
[0145] For a specific data segment, sender 910 first sends a data packet containing write data, a start signal, and a data sequence number of 0. Next, it sends a data packet containing write data and a data sequence number of 1. Then, it sends a data packet containing write data and a data sequence number of 2. Finally, it sends a data packet containing write data, a stop signal, and a data sequence number of 3. However, because the predetermined time period has expired without receiving feedback, sender 910 triggers a retransmission, sending data packets with sequence numbers 0, 1, 2, and 3 again. Once again, sender 910 triggers a retransmission because the predetermined time period has expired without receiving feedback, sending data packets with sequence numbers 0 and 1 again. Upon receiving an ACK packet from receiver 920, indicating successful transmission of the data segment, sender 910 terminates the transmission of that data segment.
[0146] Receiver 920 successfully received data packets with sequence numbers 0, 1, 2, and 3 for this sub-data. It then sent an ACK packet to sender 910 containing an acknowledgment signal and the acknowledgment sequence number for this sub-data. However, this ACK packet was lost en route. Based on the expected sequence number, receiver 920 determined that it had received a duplicate of this sub-data. Therefore, it discarded the received sub-data and, after discarding it, resent an acknowledgment signal and the acknowledgment sequence number for this sub-data to sender 910.
[0147] It should be understood that packet loss of ACK packets can be further divided into two situations: The first is that there is a problem with the data link, such as the physical connection being broken. In this case, the sending end will be triggered to retransmit multiple times. After the retransmission limit is reached, the CPU will be forcibly interrupted to remind the user to check the physical link.
[0148] The second scenario involves a limited number of lost ACK packets, such as those due to insufficient buffer space. In this case, the sender transmits normally, enables the timeout counter, and the receiver correctly receives the data packet and sends a correct ACK packet back to the sender, but the packet is lost during the return process. The sender will then time out due to the prolonged absence of ACK / NACK packets and retransmit the entire data packet in sequence. Since the receiver has correctly received the data packet, it will discard the newly received packet. After completely receiving the retransmitted packet carrying the EOI, the receiver sends an ACK packet back to the sender, signaling the sender to end the processing of that data segment.
[0149] In practical applications, NACK packet loss can occur, which can be categorized into two scenarios: The first is a problem with the data link, such as a physical connection failure. In this case, the sending end will trigger multiple retransmissions. Once the retransmission limit is reached, a CPU interrupt will be forcibly triggered to alert the system to check the physical link. The second is a limited number of NACK packet losses, such as those caused by insufficient buffer space. This is handled similarly to the previous ACK packet loss process.
[0150] Figure 10 A schematic block diagram of an electronic device that can be used to implement the methods of embodiments of the present disclosure is shown.
[0151] like Figure 10As shown, an electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage portion 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0152] RAM 1003 stores various programs and data required for the operation of electronic device 1000. Processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Processor 1001 executes various operations of the method flow according to embodiments of this disclosure by executing programs in ROM 1002 and / or RAM 1003. It should be noted that programs may also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 may also implement the methods provided in embodiments of this disclosure by executing programs stored in one or more memories.
[0153] According to embodiments of this disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to a bus 1004. The electronic device 1000 may also include one or more of the following components connected to the I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.
[0154] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0155] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1002 and / or RAM 1003 and / or one or more memories other than ROM 1002 and RAM 1003 described above.
[0156] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.
[0157] When the computer program is executed by the processor 1001, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0158] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1009, and / or installed from a removable medium 1011. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0159] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by processor 1001, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0160] It should be noted that the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information in this disclosed technical solution comply with relevant laws and regulations, necessary confidentiality measures have been taken, and it does not violate public order and good morals. In this disclosed technical solution, user authorization or consent has been obtained before acquiring or collecting user personal information.
[0161] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0163] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0164] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A data transmission method, applied at a sending end, characterized in that, The method includes: In response to a data transmission command, the storage address of the data to be transmitted is obtained from the data transmission command, and the data to be transmitted is obtained from the storage address; The data to be sent is divided into N sub-data based on a first preset length, where N is an integer greater than 1; Send N sub-data to the receiving end in the following manner: For the nth sub-data, the nth sub-data is divided based on the second preset length to obtain M target data, where M is an integer greater than or equal to 1, and n = 1, ..., N; M target data items and their sequence numbers, representing the order in which the target data is sent, are sequentially sent to the receiving end. Upon receiving the nth acknowledgment signal and the nth acknowledgment data sequence number from the receiving end for the nth sub-data, the (n+1)th sub-data is sent to the receiving end. The nth acknowledgment signal indicates that the nth sub-data was successfully sent, and the nth acknowledgment data sequence number indicates the data sequence number of the latest successfully sent target data in the nth sub-data.
2. The method according to claim 1, characterized in that, The step of sequentially sending M target data items and data sequence numbers indicating the sending order of the target data to the receiving end includes: A start signal indicating the commencement of transmission of the target data is sent to the receiving end; M target data items and their sequence numbers, representing the order in which the target data is sent, are sequentially sent to the receiving end. A termination signal indicating the end of transmission of the target data is sent to the receiving end.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Upon receiving the nth failure signal and the nth failure data sequence number for the nth sub-data from the receiving end, the nth sub-data is repeatedly sent to the receiving end until the nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data are received from the receiving end. The nth failure signal indicates that the nth sub-data has failed to be sent, and the nth failure data sequence number indicates the data sequence number of the first target data of the nth sub-data. Send the (n+1)th sub-data to the receiving end.
4. The method according to claim 1, characterized in that, The method further includes: If, within a predetermined time period from the transmission of the last target data of the nth sub-data to the receiving end, no acknowledgment signal and no acknowledgment data sequence number are received from the receiving end for the nth sub-data, or if no failure signal and no failure data sequence number are received from the receiving end for the nth sub-data within the predetermined time period, The nth sub-data is repeatedly sent to the receiving end until the nth acknowledgment signal and the nth acknowledgment data sequence number are received from the receiving end for the nth sub-data. Send the (n+1)th sub-data to the receiving end.
5. A data transmission method, applied at a receiving end, characterized in that, The method includes: In response to receiving the nth sub-data from the sender, and M target data and a data sequence number indicating the transmission order of the target data from the sender, The expected sequence number of the (m+1)th target data is determined sequentially based on the data sequence number of the mth target data, where m = 1, ..., M. The target data represents the data that the sending end divides into the nth sub-data based on the second preset length, and M is an integer greater than or equal to 1. The expected sequence number of the (m+1)th target data is matched with the data sequence number of the (m+1)th target data. If a match is found, the nth confirmation signal and the nth confirmation data sequence number for the nth sub-data are sent to the sending end. The nth confirmation signal indicates that the nth sub-data has been successfully sent, and the nth confirmation data sequence number indicates the data sequence number of the latest successfully sent target data in the nth sub-data. The sending end divides the data to be sent into N sub-data based on a first preset length, n=1, ...,N. In response to the data sending command, the sending end obtains the storage address of the data to be sent from the data sending command and obtains the data to be sent from the storage address.
6. The method according to claim 5, characterized in that, The method further includes: Receive a start signal indicating that the target data has begun to be transmitted; Receive the M target data from the sending end and the data sequence number indicating the transmission order of the target data; Receive an end signal indicating that the target data transmission has ended.
7. The method according to claim 5 or 6, characterized in that, The method further includes: If the expected sequence number of the (m+1)th target data and the data sequence number of the (m+1)th target data do not match, the nth failure signal and the nth failure data sequence number for the nth sub-data are sent to the sending end. The nth failure signal indicates that the nth sub-data has failed to be sent, and the nth failure data sequence number indicates the data sequence number of the first target data of the nth sub-data. The data sequence number of the first target data for the nth sub-data is used as the expected update sequence number, which indicates that the expected data sequence number of the first target data for the nth sub-data is expected to be received repeatedly from the sending end.
8. The method according to claim 7, characterized in that, The method further includes: In response to receiving the nth sub-data from the sender, and M target data from the sender and a data sequence number indicating the transmission order of the target data, If the data sequence number of the first target data of the nth sub-data matches the expected update sequence number, then the expected sequence number of the (m+1)th target data is determined sequentially based on the data sequence number of the mth target data, where m = 1, ..., M; Match the expected sequence number of the (m+1)th target data with the data sequence number of the (m+1)th target data. If a match is found, the nth confirmation signal and the sequence number of the nth confirmation data are sent to the sending end.
9. The method according to claim 7, characterized in that, The method further includes: Given the nth sub-data received from the sender, and K target data and sequence numbers indicating the transmission order of the target data received from the sender, If the data sequence number of the first target data of the nth sub-data matches the expected update sequence number, then the expected sequence number of the (m+1)th target data is determined sequentially based on the data sequence number of the mth target data, where m=1, ..., K, and K is less than M; The expected sequence number of the (m+1)th target data and the data sequence number of the (m+1)th target data are matched sequentially. If a match is found and the nth sub-data is received from the sender, along with M target data and a data sequence number indicating the sending order of the target data, the target data whose data sequence number precedes the expected sequence number of the Kth target data is discarded. The expected sequence number of the (k+1)th target data is determined sequentially based on the data sequence number of the kth target data, where k = K, ..., M; Match the expected sequence number of the (k+1)th target data with the data sequence number of the (k+1)th target data. If a match is found, the nth confirmation signal and the sequence number of the nth confirmation data are sent to the sending end.
10. The method according to claim 6, characterized in that, The method further includes: If the nth acknowledgment signal and the sequence number of the nth acknowledgment data are sent to the sending end, and the nth sub-data is received from the sending end multiple times, the received nth sub-data from the sending end is discarded. The nth acknowledgment signal and the nth acknowledgment data sequence number for the nth sub-data are sent to the sending end again.
11. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 10.
