Method, apparatus and communication system for data transmission
By pre-storing the correspondence between payload data blocks and check data blocks at the sending and receiving ends, the problem of bandwidth waste in data transmission is solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202111544176.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-12-16
AI Technical Summary
In existing technologies, the transmission efficiency is reduced because the correspondence between the payload data block and the check data block occupies the effective bandwidth of the link during data transmission.
The sending and receiving ends pre-store the correspondence between payload data blocks and check data blocks. The sending end generates check data blocks according to the stored correspondence instead of randomly selecting them. The receiving end recovers the data according to the stored correspondence, reducing the transmission of the correspondence.
By reducing the transmission of corresponding data, the effective bandwidth of the link is saved, and the efficiency of data transmission is improved.
Smart Images

Figure CN116266777B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a data transmission method, device and communication system. BACKGROUND
[0002] With the continuous development of Internet services, the transmission rate of data transmission link is also increasing. Due to data transmission link loss, noise interference and other reasons, errors often occur in the transmission process of data. In order to recover the data with errors in the transmission process at the receiving end, the following method is usually used to transmit data in the related technology.
[0003] Suppose the sending end wants to send N payload data blocks, and the sending end generates M check data blocks corresponding to the N payload data blocks. Each check data block is calculated from at least one of the N payload data blocks, and at least one payload data block used to calculate the check data block is randomly selected. All that needs to be ensured is that each payload data block participates in the generation of at least one check data block. In addition, the sending end also generates the corresponding relationship between the payload data blocks and the check data blocks. The sending end sends the N payload data blocks, the M check data blocks and the corresponding relationship between the payload data blocks and the check data blocks to the receiving end. If the receiving end checks that there is an error in a certain payload data block, it can determine the check data block corresponding to the payload data block according to the corresponding relationship between the payload data blocks and the check data blocks, and then recover the payload data block through the check data block.
[0004] In the above method, the sending end needs to send the corresponding relationship between the payload data blocks and the check data blocks to the receiving end, so the transmission of the corresponding relationship also needs to occupy the effective bandwidth of the link, which affects the transmission efficiency of the payload data blocks. SUMMARY
[0005] The embodiments of the present application provide a data transmission method, device and communication system, which can solve the problem of wasting the effective bandwidth of the link in the related art due to the transmission of the corresponding relationship between the payload data blocks and the check data blocks. The technical solution is as follows:
[0006] In a first aspect, a data transmission method is provided, which includes: a sending end obtaining a first payload data block, generating a first check data block corresponding to the first payload data block according to the payload data of the first payload data block and a corresponding relationship between the payload data blocks and the check data blocks stored locally in advance, and sending the first payload data block and the first check data block to a receiving end.
[0007] In the scheme shown in the embodiments of the present application, the correspondence between the payload data blocks and the check data blocks is pre-agreed and stored in the sending end and the receiving end, that is, the correspondence between the payload data blocks and the check data blocks pre-stored in the sending end and the receiving end is the same. In this way, the sending end no longer randomly selects a payload data block to generate a check data block when generating the check data block, but determines the check data block that each payload data block needs to participate in generating according to the pre-stored correspondence between the payload data blocks and the check data blocks. In this way, because there is a clear correspondence between the payload data blocks and the check data blocks, the sending end no longer needs to send the correspondence between the check data block and the payload data block to the receiving end after generating each check data block, and the effective bandwidth of the link can be saved.
[0008] In a possible implementation, one first payload data block corresponds to one or more first check data blocks.
[0009] In the scheme shown in the embodiments of the present application, one payload data block can participate in the generation of multiple check data blocks, and one check data block can be generated according to multiple payload data blocks.
[0010] In a possible implementation, the pre-stored correspondence between the payload data blocks and the check data blocks locally can be the correspondence between the sending order of the payload data blocks and the sending order of the check data blocks. Correspondingly, the sending end can first determine the first sending order of the first payload data in the current payload data sending period after obtaining the first payload data. And according to the pre-stored correspondence between the sending order of the payload data blocks and the sending order of the check data blocks, the sending order of the check data block corresponding to the first sending order is determined as the second sending order. The first check data block with the second sending order in the current check data sending period is taken as the check data block corresponding to the first payload data, wherein each payload data sending period corresponds to one check data sending period.
[0011] In the scheme shown in the embodiments of the present application, the sending end can be pre-configured with a payload data sending period and a check data sending period. Every N consecutive sent payload data blocks are taken as one payload data sending period. Each payload data sending period corresponds to one check data sending period, and every M consecutive sent check data blocks are taken as one check data sending period. The M check data blocks in each check data period are generated by the N payload data blocks in the corresponding payload data sending period.
[0012] In a possible implementation, the correspondence between the locally pre-stored payload data block and the check data block can be a correspondence between a payload data identifier of the payload data block and a check data identifier of the check data block, the payload data identifier being carried in the payload data block, and the processing of determining the first check data block corresponding to the first payload data block can be as follows:
[0013] According to the pre-stored correspondence between the payload data identifier of the payload data block and the check data identifier of the check data block, the check data identifier corresponding to the first payload data identifier is determined as a second check data identifier. The check data block corresponding to the second check data identifier is taken as the check data block corresponding to the first payload data block.
[0014] In a second aspect, a data transmission method is provided, which includes: a receiving end receiving a payload data block sent by a sending end, checking the payload data block to obtain a check result of the payload data block, and receiving a first check data block. If the number of check failure data blocks in the payload data block corresponding to the first check data block is 1, data recovery is performed on the check failure data block, wherein the number is determined according to the check result of each payload data block and a locally pre-stored correspondence between the payload data block and the check data block.
[0015] In the scheme provided in the embodiments of the present application, the receiving end and the sending end store the same correspondence between the payload data block and the check data block, so that the receiving end can determine the corresponding payload data block according to the stored correspondence after receiving the check data block, or can determine the corresponding check data according to the stored correspondence after receiving the payload data block.
[0016] In a possible implementation, the number of check failure data blocks corresponding to each check data block can be recorded, and correspondingly, after receiving the payload data block and completing the checking of the payload data block, if the check result of the payload data block is a check failure, the payload data block is determined to be a check failure data block corresponding to a first check data block according to the locally pre-stored correspondence between the payload data block and the check data block. Then, the number of check failure data blocks corresponding to the first check data block recorded is increased by 1.
[0017] In a possible implementation, after the data recovery of the check failure data block, the number of check failure data blocks corresponding to the first check data block recorded is decreased by 1. In the case that the check failure data block also corresponds to a second check data block, the number of check failure data blocks corresponding to the second check data block recorded is decreased by 1. If the number of check failure data blocks corresponding to the second check data block is 1 after being decreased by 1, the data recovery is performed on the check failure data block corresponding to the second check data block.
[0018] In the scheme shown in the embodiments of the present application, one payload data block can participate in the generation of multiple check data blocks. After data recovery of the check failure data block, if the check failure data block also corresponds to other check data blocks, it can be determined whether the number of the current check failure data blocks corresponding to the other check data blocks is 1. If the number of the current check failure data blocks corresponding to the other check data blocks is 1, data recovery can be performed on the check failure data blocks of the other check data blocks.
[0019] In a possible implementation, the corresponding relationship between the payload data block and the check data block can be the corresponding relationship between the receiving order of the payload data block and the receiving order of the check data block. Correspondingly, the processing of determining the payload data block as the check failure data block corresponding to the first check data block can be as follows: determining the first receiving order of the payload data block in the current payload data sending period. According to the corresponding relationship between the receiving order of the payload data block and the receiving order of the check data block stored in advance locally, the second receiving order of the check data block corresponding to the first receiving order is determined, and the payload data block is taken as the check failure data block corresponding to the first check data block with the second receiving order in the current check data receiving period.
[0020] In the scheme shown in the embodiments of the present application, the sending end sends the payload data block according to a preset payload data sending period and sends the check data block according to a preset check data sending period, and one payload data sending period corresponds to one check data sending period.
[0021] Correspondingly, the receiving end can record the receiving order of the received payload data block in the current payload data sending period by using the first counter, and the receiving order of the received check data block in the current check data sending period can also be recorded by using the second counter.
[0022] When the count value of the first counter reaches the number of payload data blocks corresponding to one payload data sending period, the first counter is cleared, indicating that one payload data sending period ends and the next payload data sending period starts. Similarly, when the count value of the second counter reaches the number of check data blocks corresponding to one check data sending period, the second counter is cleared, indicating that one check data sending period ends and the next check data sending period starts.
[0023] In a possible implementation, the correspondence between the payload data block and the check data block can be the correspondence between the payload data identifier of the payload data block and the check data identifier of the check data block. Correspondingly, the process of determining that the payload data block is the check failure data block corresponding to the first check data block can be as follows: determining the first payload data identifier carried in the payload data block. According to the correspondence between the payload data identifier of the payload data block and the check data identifier of the check data block stored locally in advance, determining the first check data identifier corresponding to the first payload data identifier, and taking the payload data block as the check success data block corresponding to the first check data block corresponding to the first payload data identifier.
[0024] In a possible implementation, in order to implement the recovery of the check failure data block, for each check data block, the payload XOR result of the check success data block corresponding to the check data block can be recorded. Specifically, the process can be as follows: in the case that the payload data block is checked successfully, according to the correspondence between the payload data block and the check data block stored locally in advance, taking the payload data block as the check success data corresponding to the first check data block. According to the payload data block, updating the recorded payload XOR result of the check success data block corresponding to the first check data block.
[0025] In a possible implementation, the process of recovering the data of the check failure data block can be as follows: recovering the data of the check failure data block corresponding to the first check data block according to the first check data block and the recorded payload XOR result of the check success data block corresponding to the first check data block.
[0026] In a possible implementation, the number of check failure data blocks corresponding to each check data block can not be recorded, but after receiving the first check data block, the number of check failure data blocks in the payload data block corresponding to the first check data block can be determined according to the correspondence between the payload data block and the check data block stored locally in advance.
[0027] Correspondingly, when recovering the data of the check failure data block, the check success data block corresponding to the first check data block can be determined according to the correspondence between the payload data block and the check data block stored locally in advance. The payload XOR result of the check success data block corresponding to the first check data block is calculated. The data of the check failure data block corresponding to the first check data block is recovered according to the payload XOR result.
[0028] In a possible implementation, the check on the payload data block can have the following process: receiving the payload data block sent by the sending end, and checking the payload data carried in the payload data block according to the check data carried in the payload data block.
[0029] In a third aspect, a communication system is provided, the communication system comprising a sending end and a receiving end, and the sending end and the receiving end each prestore a correspondence between a same payload data block and a check data block, wherein
[0030] The sending end is configured to acquire a first payload data block, generate a first check data block corresponding to the first payload data block according to payload data of the first payload data block and the correspondence between the payload data block and the check data block, and send the first payload data block and the first check data block to the receiving end.
[0031] The receiving end is configured to receive the first payload data block, check the first payload data block to obtain a check result of the first payload data block, and perform data recovery on a check failure data block according to the received check data block if a number of check failure data blocks in the received check data block is one, wherein the number is determined according to the check result of each payload data block and the correspondence between the payload data block and the check data block.
[0032] In a possible implementation, the sending end is configured to:
[0033] Determine a first sending order of the first payload data block in a current payload data sending period.
[0034] According to a correspondence between a sending order of the payload data block and a sending order of the check data block pre-stored locally, determine that the sending order of the check data block corresponding to the first sending order is a second sending order.
[0035] Generate a first check data block with the second sending order in a current check data sending period according to the payload data of the first payload data block, wherein each payload data sending period corresponds to a check data sending period.
[0036] In a possible implementation, the sending end is configured to:
[0037] According to a correspondence between a payload data identifier of the payload data block and a check data identifier of the check data block pre-stored, determine that the check data identifier corresponding to the first payload data identifier is a second check data identifier.
[0038] Generate a check data block corresponding to the second check data identifier according to the payload data of the first payload data block.
[0039] In a fourth aspect, a data transmission apparatus is provided, the apparatus comprising:
[0040] An acquisition module is configured to acquire a first payload data block.
[0041] generating a first check data block corresponding to the first payload data block according to payload data of the first payload data block and a correspondence relationship between the locally pre-stored payload data block and the check data block;
[0042] sending the first payload data block and the first check data block to a receiving end.
[0043] In a possible implementation, the first payload data block corresponds to one or more first check data blocks.
[0044] In a possible implementation, the generating module is configured to:
[0045] determine a first sending order of the first payload data block in a current payload data sending period;
[0046] determine, according to a correspondence relationship between a sending order of the locally pre-stored payload data block and a sending order of the check data block, that a sending order of a check data block corresponding to the first sending order is a second sending order;
[0047] generate, according to payload data of the first payload data block, a first check data block with the second sending order in a current check data sending period, wherein each payload data sending period corresponds to one check data sending period.
[0048] In a possible implementation, the sending module is configured to:
[0049] send the first payload data block according to the sending order of the first payload data block in the current payload data sending period;
[0050] send the first check data block according to the first sending order of the first check data block in the current check data sending period.
[0051] In a possible implementation, the first payload data block carries a first payload data identifier, and the generating module is configured to:
[0052] determine, according to a correspondence relationship between a payload data identifier of a pre-stored payload data block and a check data identifier of a check data block, that a check data identifier corresponding to the first payload data identifier is a second check data identifier;
[0053] generate, according to payload data of the first payload data block, a check data block corresponding to the second check data identifier.
[0054] In a fifth aspect, a data transmission apparatus is provided, and the apparatus includes:
[0055] The check module is configured to receive the payload data block sent by the sending end, check the payload data block, and obtain a check result of the payload data block.
[0056] The receiving module is configured to receive the first check data block.
[0057] The recovery module is configured to perform data recovery on the check failed data block if the number of check failed data blocks in the payload data block corresponding to the first check data block satisfies a data recovery condition, wherein the number is determined according to the check result of each payload data block and the correspondence between the locally pre-stored payload data block and the check data block.
[0058] In a possible implementation, the recovery module is further configured to:
[0059] In a case where the check result of the payload data block is a check failure, the number of check failed data blocks corresponding to the first check data block is determined according to the correspondence between the locally pre-stored payload data block and the check data block.
[0060] In a possible implementation, the recovery module is further configured to:
[0061] The number of check failed data blocks corresponding to the first check data block recorded is increased by 1.
[0062] The recovery module is configured to:
[0063] If the number of check failed data blocks corresponding to the first check data block is 1, the check failed data block is recovered.
[0064] In a possible implementation, the recovery module is further configured to:
[0065] The number of check failed data blocks corresponding to the first check data block recorded is decreased by 1.
[0066] In a case where the check failed data block also corresponds to a second check data block, the number of check failed data blocks corresponding to the second check data block recorded is decreased by 1.
[0067] If the number of check failed data blocks corresponding to the second check data block is 1 after being decreased by 1, the check failed data block corresponding to the second check data block is recovered.
[0068] In a possible implementation, the recovery module is configured to:
[0069] The first receiving order of the payload data block in a current payload data sending period is determined.
[0070] According to a correspondence relationship between a receiving sequence of the payload data block and a receiving sequence of the check data block pre-stored locally, a second receiving sequence of the check data block corresponding to the first receiving sequence is determined, and the payload data block is taken as check failure data block corresponding to the first check data block with the second receiving sequence in a current check data receiving period.
[0071] In a possible implementation, the recovery module is configured to:
[0072] determine a first payload data identifier carried in the payload data block;
[0073] According to a correspondence relationship between a payload data identifier of the payload data block and a check data identifier of the check data block pre-stored locally, a first check data identifier corresponding to the first payload data identifier is determined, and the payload data block is taken as check failure data block corresponding to the first check data block corresponding to the first payload data identifier.
[0074] In a possible implementation, the recovery module is further configured to:
[0075] in a case where the payload data block passes the check, according to a correspondence relationship between the payload data block and the check data block pre-stored locally, the payload data block is taken as check success data block corresponding to the first check data block.
[0076] According to the payload data block, a payload XOR result of the check success data block corresponding to the first check data block recorded is updated.
[0077] In a possible implementation, the recovery module is configured to:
[0078] According to the first check data block and the payload XOR result of the check success data block corresponding to the first check data block recorded, data recovery is performed on the check failure data block corresponding to the first check data block.
[0079] In a possible implementation, the recovery module is further configured to:
[0080] According to a correspondence relationship between the payload data block and the check data block pre-stored locally, a number of check failure data blocks in the payload data block corresponding to the first check data block is determined.
[0081] In a possible implementation, the recovery module is configured to:
[0082] According to a correspondence relationship between the payload data block and the check data block pre-stored locally, a check success data block corresponding to the first check data block is determined.
[0083] calculating a payload XOR result of a check success data block corresponding to the first check data block;
[0084] recovering data of a check failure data block corresponding to the first check data block according to the payload XOR result.
[0085] In a sixth aspect, a sending end is provided, which includes a processor and a memory, and the memory stores at least one instruction, which is loaded and executed by the processor to implement the method for data transmission according to the first aspect.
[0086] In a seventh aspect, a receiving end is provided, which includes a processor and a memory, and the memory stores at least one instruction, which is loaded and executed by the processor to implement the method for data transmission according to the second aspect.
[0087] In an eighth aspect, a computer readable storage medium is provided, which stores at least one instruction, which is loaded and executed by a processor to implement the method for data transmission according to the first aspect or the second aspect. BRIEF DESCRIPTION OF DRAWINGS
[0088] Figure 1 is a schematic diagram of a communication system provided by an embodiment of the present application;
[0089] Figure 2 is a flowchart of a method for data transmission provided by an embodiment of the present application;
[0090] Figure 3 is a schematic diagram of a payload data block provided by an embodiment of the present application;
[0091] Figure 4 is a schematic diagram of an Ethernet architecture provided by an embodiment of the present application;
[0092] Figure 5 is a schematic diagram of a relationship between a MAC data frame and a payload data block provided by an embodiment of the present application;
[0093] Figure 6 is a schematic diagram of an apparatus for data transmission provided by an embodiment of the present application;
[0094] Figure 7 is a schematic diagram of an apparatus for data transmission provided by an embodiment of the present application;
[0095] Figure 8 is a schematic diagram of a communication device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0096] The embodiment of the present application provides a data transmission method, which can be used in a communication system, referring to Figure 1 The communication system can comprise a sending end and a receiving end. The sending end and the receiving end can be communication devices such as computers and servers.
[0097] In the data transmission method provided by the embodiment of the present application, the corresponding relationship between the payload data blocks and the check data blocks is pre-agreed and stored in the sending end and the receiving end, that is, the corresponding relationship between the payload data blocks and the check data blocks pre-stored in the sending end and the receiving end is the same. In this way, the sending end no longer randomly selects the payload data blocks to generate the check data blocks when generating the check data blocks, but selects the corresponding payload data blocks to generate the check data blocks according to the stored corresponding relationship between the payload data blocks and the check data blocks. Because the corresponding relationship between the payload data blocks and the check data blocks is also stored in the receiving end, the sending end no longer needs to send the corresponding relationship to the receiving end, and the effective bandwidth of the link can be saved.
[0098] Referring to Figure 2 The data transmission method provided by the embodiment of the present application can comprise the following processing steps.
[0099] Step 201, the sending end performs fixed-length processing on the to-be-sent data to obtain the payload data blocks corresponding to the to-be-sent data.
[0100] In implementation, the sending end obtains the to-be-sent data according to actual business requirements, and performs fixed-length processing on the to-be-sent data.
[0101] The fixed-length processing can be that the sending end can split the to-be-sent data into at least one piece of data with a preset length. When each piece of data with the preset length is obtained, the preset sub-length can be used for splitting. For example, the preset length is 62 bytes, and when the to-be-sent data is split, the preset sub-lengths of 16 bytes, 16 bytes, 16 bytes and 14 bytes can be used for splitting in turn to obtain one piece of 62-byte data.
[0102] In a possible case, the length of the to-be-sent data is not an integer multiple of the preset length, and when splitting, the to-be-sent data smaller than the preset length can be padded to the preset length. The specific padding manner is not limited in the present application, for example, zero can be padded at the end.
[0103] For each piece of data with the preset length, the sending end performs check encoding respectively to obtain the corresponding check data. Here, the check encoding can be cyclic redundancy check (CRC) encoding and the like.
[0104] In addition, identification data can be added to each piece of data of the preset length, and the identification data can have different functions in different implementations, which will be described in the following embodiments.
[0105] Through the above processing, each piece of data of the preset length corresponds to the check data and the identification data. The sending end assembles the preset length of data as the payload data, and combines the payload data, the corresponding identification data and the corresponding check data to obtain a corresponding payload data block according to the preset payload data block structure. In this way, referring to Figure 3 , a payload data block can include identification data, payload data and check data.
[0106] Referring to Table 1 below, the field division of several payload data blocks is exemplarily given.
[0107] Table 1
[0108]
[0109] In Table 1, the payload data length is the preset length described above, and the bracketed payload data length is the preset sub-length. For example, the first row of the payload data length indicates that the payload data length is 62 bytes, and the preset length is 16 bytes, 16 bytes, 16 bytes and 14 bytes.
[0110] In addition, it should be noted that the payload data block can also be referred to as a payload data frame, and the like, and the specific name thereof is not limited in the embodiments of the present application.
[0111] In a possible implementation, the embodiments of the present application introduce a shim layer in the standard Ethernet architecture. As shown in (a) of Figure 4 , the standard Ethernet architecture includes a physical medium dependent (PMD) sublayer, a physical medium attachment (PMA) sublayer, a physical coding sublayer (PCS), a media access control (MAC) sublayer and a higher layer. As shown in (b) of Figure 4 , the shim layer is located between the MAC sublayer and the PCS.
[0112] Correspondingly, the data to be sent in the step 201 can be a MAC data frame encapsulated by the MAC sublayer. The shim layer performs fixed-length processing on the MAC data frame.
[0113] Referring to Figure 5, shows a schematic diagram of a MAC data frame being divided into payload data blocks. The MAC data frame can include a frame token, a header, a payload, CRC data and a special format data segment (IDLE). The MAC data frame is divided into X payload data blocks, X being a positive integer, and the value of X is related to the length of the MAC data frame and a preset length. Each payload data block includes identification data, payload data and check data. The payload data includes U0, U1,..., U n-1 represents a preset sub-length. For example, if the length of the payload data is 62 bytes, the values of U0, U1,..., U n-1 may be: U0=16, U1=16, U2=16, U3=14.
[0114] Step 202, according to the pre-stored corresponding relationship between the payload data block and the check data block, the check data block corresponding to the payload data block is generated.
[0115] In implementation, the sending end can be pre-configured with a payload data sending period and a check data sending period. Every N consecutive sent payload data blocks are taken as a payload data sending period. Each payload data sending period corresponds to a check data sending period, and every M consecutive sent check data blocks are taken as a check data sending period. The M check data blocks in each check data period are generated by the N payload data blocks in the corresponding payload data sending period.
[0116] The corresponding relationship between the payload data block and the check data block represents the construction relationship between the check data block and the payload data block. It is assumed below that a payload data sending period includes 2n payload data blocks, and a check data sending period includes m check data blocks. Several possible construction relationships between the check data block and the payload data block are exemplarily listed.
[0117] Construction relationship one,
[0118]
[0119] Construction relationship two,
[0120]
[0121] wherein p0, p1,..., p m-1 respectively represent the payload data of the m check data blocks, d0, d1,..., d 2n-1 respectively represent the payload data of the 2n payload data blocks, represents an exclusive OR calculation.
[0122] The check data block can be calculated by XORing the payload data of multiple payload data blocks. In this case, after a payload data block is generated, the corresponding check data block of the payload data block can not be calculated. Therefore, the generation of the check data block can be as follows.
[0123] After the sender obtains a payload data block, the sender can determine the target check data block corresponding to the payload data block according to the correspondence between the payload data blocks and the check data blocks stored in advance. If the intermediate data of the target check data block is not buffered locally, the payload data of the payload data block is buffered as the intermediate data of the target check data block. If the intermediate data of the target check data block is buffered locally, the payload data of the payload data block is XORed with the intermediate data of the target check data block to update the intermediate data of the target check data block. In addition, for each check data block, the number of components of the intermediate data of the check data block currently buffered can be recorded, where the number of components indicates how many payload data blocks are used to obtain the intermediate data currently buffered.
[0124] When it is determined that the intermediate data of the target check data block currently buffered satisfies a completion condition, the intermediate data of the target check data block currently buffered is taken as the payload data of the target check data block. The completion condition means that the number of components of the intermediate data of the target check data block currently buffered is equal to the number of payload data blocks corresponding to the target check data block.
[0125] After the payload data of the check data block is obtained, the payload data of the check data block can be subjected to check encoding to generate corresponding check data. The check encoding can be CRC encoding, etc.
[0126] In addition, identification data can be added on the basis of the payload data. In different implementations, the identification data can have different functions, which will be described in the following embodiments.
[0127] In this way, the check data block including the identification data, the payload data, and the check data can be obtained through the above processing. In addition, when the check data block is generated, the payload data of the check data block can not be subjected to check encoding, that is, the check data can not be included in the generated check data block.
[0128] It should be noted that the correspondence between the payload data blocks and the check data blocks can have multiple possible implementations, which will be described below.
[0129] In one possible implementation, the correspondence between the payload data blocks and the check data blocks can be the correspondence between the sending order of the payload data blocks and the sending order of the check data blocks.
[0130] The sending order of the payload data block refers to the sending order of the payload data block in a payload data sending period, and the sending order of the check data block refers to the sending order of the check data block in a check data sending period. The sending end buffers the intermediate data of the check data block for each sending order of the check data block. The following describes the generation of the payload data of the check data block in this implementation mode through an example.
[0131] For example, one payload data sending period includes four payload data blocks, and one check data period includes three check data blocks. The correspondence between the sending order of the four payload data blocks and the sending order of the three check data blocks is shown in Table 2.
[0132] Table 2
[0133] Transmission order of payload data blocks Transmission order of check data blocks T0 S0, S1, S2 T1 S2 T2 S1, S2 T3 S2
[0134] Wherein, T0, T1, T2, T3 represent the sending order of the first, second, third, and fourth positions in turn. S0, S1, S2 represent the sending order of the first, second, and third positions in turn.
[0135] The first data row from top to bottom in Table 2 indicates that the payload data block with the first sending order participates in the generation of the check data blocks with the first, second, and third sending orders.
[0136] The second data row indicates that the payload data block with the second sending order participates in the generation of the check data block with the third sending order.
[0137] The third data row indicates that the payload data block with the third sending order participates in the generation of the check data blocks with the second and third sending orders.
[0138] The fourth data row indicates that the payload data block with the fourth sending order participates in the generation of the check data block with the third sending order.
[0139] In addition, it can be known from Table 2 that the check data block with the first sending order needs to be generated by one payload data block, which is the payload data block with the first sending order. The check data block with the second sending order needs to be generated by two payload data blocks, which are the payload data blocks with the first and third sending orders. The check data block with the third sending order needs to be generated by four payload data blocks, which are the payload data blocks with the first, second, third, and fourth sending orders.
[0140] Correspondingly, the construction relationship between the check data block and the payload data block is as follows:
[0141]
[0142] Where p0 is the payload data of the first parity data block sent in the order of transmission, p1 is the payload data of the second parity data block sent in the order of transmission, p2 is the payload data of the third parity data block sent in the order of transmission, d0 is the payload data of the first payload data block sent in the order of transmission, d1 is the payload data of the second payload data block sent in the order of transmission, d2 is the payload data of the third payload data block sent in the order of transmission, and d3 is the payload data of the fourth payload data block sent in the order of transmission.
[0143] After obtaining the payload data block with the first transmission order, based on the correspondence between the transmission order of the payload data blocks and the transmission order of the check data blocks, determine the check data blocks with the first, second, and third transmission orders corresponding to the payload data block with the first transmission order. Then, if it is determined that the intermediate data of the check data blocks with the first, second, and third transmission orders has not yet been cached locally, then d0 is used as the intermediate data of the check data blocks with the first, second, and third transmission orders, as shown in the following formula:
[0144]
[0145] Where p0', p1', and p2' represent the intermediate data of the check data blocks sent in the first, second, and third order, respectively.
[0146] In addition, it can also record that the number of components of the current cache p0' is 1, the number of components of the current cache p1' is 1, and the number of components of the current cache p2' is 1.
[0147] If the sending end determines that the number of components of p0' is 1, satisfying the corresponding completion condition, then p0' will be used as the payload data of the first parity data block in the transmission order. In this case, the number of components of the recorded p0' can be reset to zero.
[0148] After obtaining the payload data block with the second transmission order, based on the correspondence between the transmission order of the payload data blocks and the transmission order of the check data blocks, the check data block with the third transmission order corresponding to the payload data block with the second transmission order is determined. Then, d1 is XORed with the intermediate data of the currently buffered check data block with the third transmission order, as shown in the following formula:
[0149]
[0150] In addition, the number of components of each intermediate data in the record can be updated. Specifically, the number of components of the currently cached p2' can be updated to 2.
[0151] After obtaining the payload data block with the third sending order, the payload data block with the third sending order is determined to correspond to the check data blocks with the second and third sending orders according to the correspondence between the sending orders of the payload data blocks and the sending orders of the check data blocks. Then, d2 is XORed with the intermediate data of the check data blocks with the second and third sending orders currently buffered, as shown in the following formula:
[0152]
[0153] In addition, the composition number of each intermediate data recorded can be updated. Specifically, the composition number of p1' currently buffered can be updated to 2, and the composition number of p2' currently buffered can be updated to 3.
[0154] The sending end determines that the composition number of p1' is 2, satisfying the corresponding completion condition, and then takes p1' as the payload data of the check data block with the second sending order. In this case, the composition number of p1' recorded can be reset to 0.
[0155] After obtaining the payload data block with the fourth sending order, the payload data block with the fourth sending order is determined to correspond to the check data block with the third sending order according to the correspondence between the sending orders of the payload data blocks and the sending orders of the check data blocks. Then, d3 is XORed with the intermediate data of the check data block with the third sending order currently buffered, as shown in the following formula:
[0156]
[0157] In addition, the composition number of each intermediate data recorded can be updated. Specifically, the composition number of p2' currently buffered can be updated to 4.
[0158] The sending end determines that the composition number of p2' is 4, satisfying the corresponding completion condition, and then takes p2' as the payload data of the check data block with the third sending order. In this case, the composition number of p2' recorded can be reset to 0.
[0159] It should be noted that in this implementation, the identification data is used to identify the type of the data block, i.e., to distinguish whether the data block is a payload data block or a check data block. Correspondingly, the identification data in each payload data block is the same, the identification data in each check data block is the same, and the identification data in the payload data block is different from the identification data in the check data block.
[0160] In another possible implementation, the correspondence between the payload data block and the check data block can be the correspondence between the payload data identification of the payload data block and the check data identification of the check data block.
[0161] Assuming that every N continuous transmitted payload data blocks are as a payload transmission period, N different payload data identifiers can be set. Assuming that every M continuous transmitted check data blocks are as a check data transmission period, M different check data identifiers can be set.
[0162] In this case, the identifier data in the payload data block in step 201 can be the payload data identifier herein. Correspondingly, in a payload data transmission period, the corresponding payload data identifier can be selected according to the preset rule when each payload data block is generated.
[0163] For example, the N payload data identifiers correspond to the transmission order of the N payload data blocks included in a payload data transmission period one by one. When a payload data block is generated, according to the transmission order of the payload data block in the current payload data transmission period, the corresponding payload data identifier is selected from the N payload data identifiers according to the transmission order.
[0164] For another example, when a payload data block is generated, non-return random selection can be performed among the N payload data identifiers. The non-return random selection means that each selection is random selection, and if a payload data identifier has been selected in a payload data transmission period, the payload data identifier will not be selected again.
[0165] The following describes the generation of the payload data of the check data block in this implementation manner through an example.
[0166] For example, a payload data transmission period includes four payload data blocks, and a check data period includes three check data blocks. The corresponding relationship between the payload data identifiers of the four payload data blocks and the check data identifiers of the three check data blocks is shown in Table 3.
[0167] Table 3
[0168] Payload data identification of payload data blocks Check data identification of check data blocks D0 P0, P1, P2 D1 P2 D2 P1, P2 D3 P2
[0169] The first data row from top to bottom in Table 3 indicates that the payload data block with the payload data identifier D0 participates in the generation of the check data blocks with the check data identifiers P0, P1 and P2.
[0170] The second data row indicates that the payload data block with the payload data identifier D1 participates in the generation of the check data block with the check data identifier P2.
[0171] The third data row indicates that the payload data block with the payload data identifier D2 participates in the generation of the check data blocks with the check data identifiers P1 and P2.
[0172] The fourth data line indicates that the payload data block with the payload data identifier D3 participates in generating the check data block with the check data identifier P2.
[0173] In addition, it can be known from Table 3 that the check data block with the check data identifier P0 needs to be generated by one payload data block, which is the payload data block with the payload data identifier D0. The check data block with the check data identifier P1 needs to be generated by two payload data blocks, which are the payload data blocks with the payload data identifiers D0 and D2. The check data block with the check data identifier P2 needs to be generated by four payload data blocks, which are the payload data blocks with the payload data identifiers D0, D1, D2 and D3.
[0174] Correspondingly, the construction relationship between the check data blocks and the payload data blocks is as follows:
[0175]
[0176] In the formula, p0 is the payload data of the check data block with the check data identifier P0, p1 is the payload data of the check data block with the check data identifier P1, p2 is the payload data of the check data block with the check data identifier P0, d0 is the payload data of the payload data block with the payload data identifier D0, d1 is the payload data of the payload data block with the payload data identifier D1, d2 is the payload data of the payload data block with the payload data identifier D2, and d3 is the payload data of the payload data block with the payload data identifier D3.
[0177] After obtaining the payload data block with the payload data identifier D0, according to the correspondence between the payload data identifier of the payload data block and the check data identifier of the check data block, it is determined that the check data identifier corresponding to the payload data block D0 is P0, P1 and P2. Then, it is determined that the intermediate data of the check data blocks with the check data identifiers P0, P1 and P2 have not been cached locally, and then d0 is taken as the intermediate data of the check data blocks with the check data identifiers P0, P1 and P2, as shown in the following formula:
[0178]
[0179] In the formula, p0', p1' and p2' respectively represent the intermediate data of the check data blocks with the check data identifiers P0, P1 and P2 in the sending order.
[0180] In addition, it can be recorded that the number of components of the currently cached p0' is 1, the number of components of the currently cached p1' is 1, and the number of components of the currently cached p2' is 1.
[0181] The sending end determines that the constituent number of p0' is 1, and satisfies the corresponding completion condition, and then takes p0' as the payload data of the check data block identified as P0. In this case, the recorded constituent number of p0' can be zeroed.
[0182] After obtaining the payload data block identified as D1, according to the correspondence between the payload data identification of the payload data block and the check data identification of the check data block, it is determined that the check data identification corresponding to D1 is P2. Then, d1 is XORed with the intermediate data of the check data block identified as P2 in the current cache, as shown in the following formula:
[0183]
[0184] In addition, the constituent number of each intermediate data recorded can also be updated. Specifically, the constituent number of p2' in the current cache can be updated to 2.
[0185] After obtaining the payload data block identified as D2, according to the correspondence between the payload data identification of the payload data block and the check data identification of the check data block, it is determined that the check data identification corresponding to D2 is P1 and P2. Then, d2 is XORed with the intermediate data of the check data block identified as P1 and P2 in the current cache, as shown in the following formula:
[0186]
[0187] In addition, the constituent number of each intermediate data recorded can also be updated. Specifically, the constituent number of p1' in the current cache can be updated to 2, and the constituent number of p2' in the current cache can be updated to 3.
[0188] The sending end determines that the constituent number of p1' is 2, and satisfies the corresponding completion condition, and then takes p1' as the payload data of the check data block identified as P1. In this case, the recorded constituent number of p1' can be zeroed.
[0189] After obtaining the payload data block identified as D3, according to the correspondence between the payload data identification of the payload data block and the check data identification of the check data block, it is determined that the check data identification corresponding to D3 is P2. Then, d3 is XORed with the intermediate data of the check data block identified as P2 in the current cache, as shown in the following formula:
[0190]
[0191] In addition, the constituent number of each intermediate data recorded can also be updated. Specifically, the constituent number of p2' in the current cache can be updated to 4.
[0192] The sending end determines that the number of components of p2' is 4, and satisfies the corresponding completion condition, and then identifies p2' as the payload data of the check data block of P2. In this case, the number of components of the recorded p2' can be zeroed.
[0193] It should be noted that in this implementation, the identification data carried in the check data block is check data identification, and the check data identification carried in the check data block belonging to the same check data sending period is different. The identification data carried in the payload data block is payload data identification, and the payload data identification carried in the payload data block belonging to the same payload data sending period is different.
[0194] Step 203, the sending end sends the payload data block and the check data block.
[0195] In implementation, for the sending of the payload data block, after the payload data in the payload data block and the intermediate data of the corresponding check data block are XORed, the payload data block can be sent to the receiving end according to the sending order of the payload data block.
[0196] For the sending of the check data block, the check data block can be sent to the receiving end after being generated. Alternatively, the check data block can be sent to the receiving end when the link is idle. The link idle means that the link has no payload data block to be transmitted. It should be noted that in the case of sending the check data block when the link is idle, it is necessary to ensure that the check data block belonging to the check data sending period before the check data block has been sent before sending the check data block belonging to the check data sending period after the check data block.
[0197] Step 204, the receiving end checks the payload data block whenever the payload data block is received.
[0198] In implementation, the receiving end checks the payload data block after receiving the payload data block. The checking method can be as follows:
[0199] The payload data in the payload data block is checked and encoded to generate comparison check data. Then, the comparison check data is compared with the check data carried in the payload data block. If the comparison check data is inconsistent with the check data carried in the payload data block, it is determined that the check of the check data block fails, that is, there is an error code in the payload data of the check data block. If the comparison check data is consistent with the check data carried in the payload data block, it is determined that the check of the check data block is successful.
[0200] It should be noted that the check code used by the receiving end for checking is the same as the check code used by the sending end for generating the check data.
[0201] Step 205, the receiving end determines the check data block corresponding to the payload data block according to the corresponding relationship between the payload data block and the check data block stored locally in advance.
[0202] The correspondence between the payload data block and the check data block can be a correspondence between a receiving order of the payload data block and a receiving order of the check data block. Alternatively, the correspondence between the payload data block and the check data block can be a correspondence between a payload data identifier of the payload data block and a check data identifier of the check data block.
[0203] In implementation, the step 205 can be performed before the step 204 or after the step 204.
[0204] In the case where the correspondence between the payload data block and the check data block is a correspondence between a receiving order of the payload data block and a receiving order of the check data block, after receiving a payload data block, the receiving end determines the receiving order of the payload data block in the current payload data sending period. Then, according to the correspondence between the receiving order of the payload data block and the receiving order of the check data block stored locally, the receiving order of the payload data block corresponds to the receiving order of the check data block in the current check data sending period as the first receiving order. That is, the check data block with the first receiving order in the current check data sending period is the check data block corresponding to the payload data block.
[0205] In the case where the correspondence between the payload data block and the check data block is a correspondence between a payload data identifier of the payload data block and a check data identifier of the check data block, after receiving a payload data block, the receiving end obtains the target payload data identifier carried by the payload data block. Then, according to the correspondence between the payload data identifier of the payload data block and the check data identifier of the check data block stored locally in advance, the target check data identifier corresponding to the target payload data identifier is determined. That is, the check data corresponding to the target check data identifier is the check data block corresponding to the payload data block.
[0206] In a possible implementation, for each check data block in a check data sending period, the receiving end can record the related information of the check data block. In this way, after receiving each check data block, the check failed data block corresponding to the check data block can be recovered directly according to the recorded related information.
[0207] Referring to Table 4, the related information can include the number of check failed data blocks corresponding to each check data block, the identifier of the check failed data block corresponding to each check data block, and the payload XOR result of the check successful data block corresponding to each check data block.
[0208] In the case that the correspondence between the payload data block and the check data block is the correspondence between the receiving order of the payload data block and the receiving order of the check data block, the identification of the check failure data block is the identification of the receiving order of the check failure data block in the payload data sending period to which the check failure data block belongs. In the case that the correspondence between the payload data block and the check data block is the correspondence between the payload data identification of the payload data block and the check data identification of the check data block, the identification of the check failure data block is the carried payload data identification.
[0209] Table 4
[0210]
[0211] In the case that the correspondence between the payload data block and the check data block is the correspondence between the receiving order of the payload data block and the receiving order of the check data block, the identification of the check data block is the identification of the receiving order of the check data block in the check data sending period to which the check data block belongs. In the case that the correspondence between the payload data block and the check data block is the correspondence between the payload data identification of the payload data block and the check data identification of the check data block, the identification of the check data block is the carried check data identification.
[0212] The following describes the updating of the related information of the check data block according to different check results of the payload data block.
[0213] If it is judged that the payload data block fails in the check, the identification of the payload data block is recorded as the identification of the check failure data block of the corresponding check data block, and the number of the check failure data blocks of the corresponding check data block is increased by 1.
[0214] For example, the payload data block B3 corresponds to the check data block A0, and in the case that the payload data block B3 fails in the check, B3 is recorded as the identification of the check failure data block of the check data block A0. Moreover, the number of the check failure data blocks corresponding to the check data block A0 is increased by 1. The updated related information is shown in Table 5 as follows.
[0215] Table 5
[0216]
[0217] If it is judged that the payload data block succeeds in the check, the payload data block is recorded as the check success data block of the corresponding check data block, and the payload data of the payload data block and the check success data block of the corresponding check data block are XORed.
[0218] For example, the payload data block B4 corresponds to the check data block Al, and the payload data d4 of the payload data block B4 is XORed with the payload of the check success data block of the check data block Al in the case that the check of the payload data block B4 is successful. The updated relevant information is shown in Table 6 below.
[0219] Table 6
[0220]
[0221] Step 206: When the receiving end receives a check data block, if the number of check failure data blocks corresponding to the check data block satisfies the recovery condition, the receiving end performs data recovery on the check failure data blocks of the check data block.
[0222] In implementation, after receiving a check data block, the receiving end queries the relevant information of the check data block in the recorded relevant information of the check data block.
[0223] In one possible case, after receiving a check data block, the receiving end determines the target receiving order of the check data block in the current check data block receiving period. Then, the receiving end queries the relevant information corresponding to the identification of the target receiving order in the recorded relevant information of the check data block.
[0224] In another possible case, after receiving a check data block, the receiving end obtains the target check data identification carried in the check data block. Then, the receiving end queries the relevant information corresponding to the target check data identification in the recorded relevant information of the check data block.
[0225] After querying the relevant information, it is determined whether the number of check failure data blocks corresponding to the check data block is 1. If the number of check failure data blocks corresponding to the check data block is 1, the data recovery can be performed on the check failure data blocks corresponding to the check data block.
[0226] For example, after receiving the check data block Al, it is queried in the relevant information of the check data block recorded in Table 6 above that the number of check identification data blocks of the check data block Al is 1, and then the check failure data block B2 can be recovered.
[0227] If the number of check failure data blocks corresponding to the check data block is not 1, the check data block needs to be buffered first.
[0228] For example, after receiving the check data block A0, it is queried in the relevant information of the check data block recorded in Table 6 above that the number of check identification data blocks of the check data block Al is 2, i.e., not 1, and then the check data block A0 can be buffered first.
[0229] The data recovery processing of the failed check data block can be: XORing the payload data in the check data block with the XOR result of the payload of the check success data block corresponding to the check data block, to obtain the correct payload data of the failed check data block. Then, the error data in the check identification data block can be recovered according to the correct payload data block.
[0230] When the data recovery of a failed check data block is completed, the recorded identification of the failed check data block is deleted, and the number of failed check data blocks corresponding to the check data block is reduced by 1.
[0231] In addition, after the data recovery of a failed check data block is completed, if the failed check data block still corresponds to other check data blocks, the payload data of the failed check data block after data recovery is obtained, and the obtained payload data is XORed with the XOR result of the payload of the check success data block of the other check data blocks corresponding to the failed check data block.
[0232] For example, the failed check data block B2 completes data recovery, the B2 recorded in Table 6 is deleted, and the number of failed check data blocks corresponding to the check data block A0 is reduced by 1, and the number of failed check data blocks corresponding to the check data block A1 is reduced by 1. In addition, because the failed check data blocks of the check data block A1 have all been recovered, the XOR result of the payload of the check success data block corresponding to the check data block A1 can be deleted.
[0233] In addition, the failed check data block B2 also corresponds to the check data block A0, in which case, the payload data d2 of the failed check data block B2 after data recovery is obtained, and d2 is XORed with the XOR result d0 of the payload of the check success data block corresponding to the check data block A0. The updated related information is shown in Table 7 as follows.
[0234] Table 7
[0235]
[0236] In addition, after the above update is completed, if the number of failed check data blocks of a check data block becomes 1, and the check data block is locally cached, the failed check data block of the check data block is recovered.
[0237] For example, after the above update is completed, the number of failed check data blocks corresponding to the check data block A0 becomes 1, and the check data block A0 is locally cached, so the data recovery of the failed check data block B3 corresponding to the check data block A0 can be performed.
[0238] In addition, the receiving end can also record the total number of the failed-check data blocks, and add 1 to the total number each time a failed-check payload data block is received, and subtract 1 from the total number each time a failed-check data block completes data recovery. When the total number is 0, it indicates that all the failed-check data blocks of the receiving end have completed data recovery.
[0239] In a possible implementation, the steps 205 and 206 can be replaced by the following step 207.
[0240] Step 207: Each time a check data block is received, the number of the failed-check data blocks corresponding to the check data block is determined according to the pre-stored correspondence between the payload data blocks and the check data blocks, and data recovery is performed on the failed-check data blocks of the check data block in the case that the number of the failed-check data blocks corresponding to the check data block satisfies the recovery condition.
[0241] In implementation, after the payload data block is checked in step 204, if the payload data block fails the check, the payload data block is buffered as a failed-check data block, and the identification of the payload data block is recorded. If the payload data block passes the check, the payload data of the payload data block can be acquired for buffering, and the identification of the payload data block is recorded. In addition, the identification of the payload data block that passes the check and the identification of the payload data block that fails the check need to be recorded respectively. For the payload data block that fails the check, the correspondence between the identification of the payload data block and the storage location of the corresponding payload data block can be established, and for the payload data block that passes the check, the correspondence between the identification of the payload data block and the storage location of the payload data of the corresponding payload data block can be established.
[0242] For the identification of the payload data block, in the case that the correspondence between the payload data block and the check data block is the correspondence between the receiving order of the payload data block and the receiving order of the check data block, the identification of the payload data block is the identification of the receiving order of the payload data block in the payload data sending period to which the payload data block belongs. In the case that the correspondence between the payload data block and the check data block is the correspondence between the payload data identification of the payload data block and the check data identification of the check data block, the identification of the payload data block is the carried payload data identification.
[0243] After the check data block is received, the number of the failed-check data blocks corresponding to the check data block is determined according to the pre-stored correspondence between the payload data block and the check data block. If it is determined that the number of the failed-check data blocks corresponding to the check data block is 1, data recovery is performed on the failed-check data block corresponding to the check data block.
[0244] The processing herein is described below in different cases of the correspondence between the payload data block and the check data block.
[0245] Case one, the corresponding relationship between the payload data block and the check data block is the corresponding relationship between the receiving order of the payload data block and the receiving order of the check data block.
[0246] In this case, after receiving the check data block, the target receiving order of the check data block in the current check data sending period is determined first. Then, in the corresponding relationship between the receiving order of the payload data block and the receiving order of the check data block stored locally, the receiving order of the payload data block corresponding to the target receiving order is determined. Then, in the recorded receiving order of the check failure data block received in the current payload data sending period, the number of the same identification number of the receiving order of the payload data block corresponding to the target receiving order is determined as the number of the check failure data block corresponding to the check data block.
[0247] If it is determined that the number of the check failure data block corresponding to the check data block is 1, the target identification of the receiving order of the payload data block corresponding to the target receiving order is queried in the recorded receiving order of the check success data block received in the current payload data sending period. Then, the cached payload data in the payload data storage position corresponding to the target identification is obtained, and the correct payload data of the corresponding check failure data block is obtained by performing XOR operation on the obtained payload data and the check data carried in the check data block.
[0248] Case two, the corresponding relationship between the payload data block and the check data block is the corresponding relationship between the payload data identification of the payload data block and the check data identification of the check data block.
[0249] In this case, after receiving the check data block, the target check data identification carried in the check data block is obtained first. Then, in the corresponding relationship between the payload data identification of the payload data block and the check data identification of the check data block stored locally, the payload data identification corresponding to the target check data identification is determined. Then, in the recorded payload data identification of the check failure data block received in the current payload data sending period, the number of the same identification number of the payload data identification corresponding to the target check data identification is determined as the number of the check failure data block corresponding to the check data block.
[0250] If it is determined that the number of the check failure data block corresponding to the check data block is 1, the target payload data identification corresponding to the target check data identification is queried in the recorded payload data identification of the check success data block received in the current payload data sending period. Then, the cached payload data in the payload data storage position corresponding to the target payload data identification is obtained, and the correct payload data of the corresponding check failure data block is obtained by performing XOR operation on the obtained payload data and the check data carried in the check data block.
[0251] In the present application, the correspondence between the payload data block and the check data block is pre-agreed and stored in the sending end and the receiving end, that is, the correspondence between the payload data block and the check data block pre-stored in the sending end and the receiving end is the same. In this way, the sending end no longer randomly selects the payload data block to generate the check data block when generating the check data block, but selects the corresponding payload data block to generate the check data block according to the stored correspondence between the payload data block and the check data block. Therefore, the sending end no longer needs to send the correspondence to the receiving end, and the effective bandwidth of the link can be saved.
[0252] Based on the same technical concept, the embodiments of the present application also provide a data transmission device, as shown in the figure, the device comprises: Figure 6
[0253] The acquisition module 610 is configured to acquire first payload data. Specifically, the acquisition module 610 can implement the process of acquiring the payload data block in step 201.
[0254] The generation module 620 is configured to generate a first check data block corresponding to the first payload data block according to the payload data of the first payload data block and the correspondence between the payload data block and the check data block pre-stored locally. Specifically, the generation module 620 can implement the process of generating the check data block in step 202.
[0255] The sending module 630 is configured to send the first payload data block and the first check data block to the receiving end. Specifically, the sending module 630 can implement the sending function in step 203.
[0256] In a possible implementation, the first payload data block corresponds to one or more first check data blocks.
[0257] In a possible implementation, the generation module 620 is configured to:
[0258] Determine a first sending order of the first payload data block in a current payload data sending period.
[0259] According to the correspondence between the sending order of the payload data block and the sending order of the check data block pre-stored locally, determine that the sending order of the check data block corresponding to the first sending order is a second sending order.
[0260] Generate a first check data block with the second sending order in a current check data sending period according to the payload data of the first payload data block, wherein each payload data sending period corresponds to a check data sending period.
[0261] In a possible implementation, the sending module 630 is configured to:
[0262] sending the first payload data block according to a sending sequence of the first payload data block in the current payload data sending period;
[0263] sending the first check data block according to the first sending sequence of the first check data block in the current check data sending period.
[0264] In a possible implementation, the first payload data block carries a first payload data identifier, and the generating module 620 is configured to:
[0265] determine, according to a correspondence between a payload data identifier of a payload data block and a check data identifier of a check data block stored in advance, that the first payload data identifier corresponds to a second check data identifier;
[0266] generate a check data block corresponding to the second check data identifier according to payload data of the first payload data block.
[0267] It should be noted that the apparatus for data transmission provided in the above embodiments is only used as an example for the division of the above functional modules, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the communication device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus for data transmission provided in the above embodiments and the method for data transmission provided in the method embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0268] Based on the same technical concept, the embodiments of the present application also provide an apparatus for data transmission, as shown in Figure 7 The apparatus comprises:
[0269] The check module 710 is configured to receive a payload data block sent by a sending end, check the payload data block, and obtain a check result of the payload data block. Specifically, the receiving function and the checking function in step 204 can be implemented.
[0270] The receiving module 720 is configured to receive a first check data block. Specifically, the receiving function in step 206 can be implemented.
[0271] The recovery module 730 is configured to perform data recovery on a check failed data block if the number of check failed data blocks in a payload data block corresponding to the first check data block meets a data recovery condition, wherein the number is determined according to a check result of each payload data block and a correspondence between a payload data block and a check data block stored in advance. Specifically, the data recovery function in step 206 can be implemented.
[0272] In a possible implementation, the recovery module 730 is further configured to:
[0273] In a case where the check result of the payload data block is a check failure, the corresponding relationship between the locally pre-stored payload data block and the check data block is determined, and the payload data block is determined as a check failure data block corresponding to the first check data block.
[0274] In a possible implementation, the recovery module 730 is further configured to:
[0275] The number of check failure data blocks corresponding to the first check data block recorded is increased by 1;
[0276] The recovery module is configured to:
[0277] If the number of check failure data blocks corresponding to the first check data block is 1, data recovery is performed on the check failure data block.
[0278] In a possible implementation, the recovery module 730 is further configured to:
[0279] The number of check failure data blocks corresponding to the first check data block recorded is decreased by 1;
[0280] In a case where the check failure data block also corresponds to a second check data block, the number of check failure data blocks corresponding to the second check data block recorded is decreased by 1;
[0281] If the number of check failure data blocks corresponding to the second check data block is 1 after being decreased by 1, data recovery is performed on the check failure data block corresponding to the second check data block.
[0282] In a possible implementation, the recovery module 730 is configured to:
[0283] The first receiving order of the payload data block in the current payload data sending period is determined;
[0284] According to the corresponding relationship between the locally pre-stored receiving order of the payload data block and the receiving order of the check data block, the second receiving order of the check data block corresponding to the first receiving order is determined, and the payload data block is taken as a check failure data block corresponding to a first check data block with the second receiving order in the current check data receiving period.
[0285] In a possible implementation, the recovery module 730 is configured to:
[0286] The first payload data identifier carried in the payload data block is determined;
[0287] According to a correspondence relationship between the payload data identifier of the locally pre-stored payload data block and the check data identifier of the check data block, a first check data identifier corresponding to the first payload data identifier is determined, and the payload data block is taken as a check failure data block corresponding to the first check data block corresponding to the first payload data identifier.
[0288] In a possible implementation, the recovery module 730 is further configured to:
[0289] In a case where the payload data block passes the check, according to the correspondence relationship between the locally pre-stored payload data block and the check data block, the payload data block is taken as a check success data block corresponding to the first check data block.
[0290] According to the payload data block, a payload XOR result of the check success data block corresponding to the first check data block is updated.
[0291] In a possible implementation, the recovery module 730 is configured to:
[0292] According to the first check data block and the payload XOR result of the check success data block corresponding to the first check data block, data recovery is performed on the check failure data block corresponding to the first check data block.
[0293] In a possible implementation, the recovery module 730 is further configured to:
[0294] According to the locally pre-stored correspondence relationship between the payload data block and the check data block, a number of check failure data blocks in the payload data block corresponding to the first check data block is determined.
[0295] In a possible implementation, the recovery module is configured to:
[0296] According to the locally pre-stored correspondence relationship between the payload data block and the check data block, a check success data block corresponding to the first check data block is determined.
[0297] A payload XOR result of the check success data block corresponding to the first check data block is calculated.
[0298] According to the payload XOR result, data recovery is performed on the check failure data block corresponding to the first check data block.
[0299] It should be noted that the apparatus for data transmission provided in the above examples is only used for example to divide the above functions, and in actual application, the above functions can be completed by different function modules according to needs, that is, the internal structure of the communication device is divided into different function modules to complete all or part of the above described functions. In addition, the apparatus for data transmission and the method for data transmission provided in the above examples belong to the same concept, and the specific implementation process is detailed in the method examples, which will not be described here.
[0300] Referring to Figure 8 The embodiments of the present application also provide a communication device. The communication device 800 can be Figure 1The sending end or the receiving end in the illustrated communication system. The communication device 800 can include a processor 810, a memory 820 coupled to the processor 810, and a transceiver 830. The processor 810 can be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP. The processor can further include a hardware chip. The hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 810 can refer to one processor or include multiple processors. The memory 820 can include a volatile memory, such as a random access memory (RAM), and / or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state disk (SSD), or a combination thereof. The memory 820 can refer to one memory or include multiple memories. In an embodiment, the memory 820 stores computer readable instructions. The processor 810 executes the computer readable instructions in the memory 820 to perform the method of data transmission as illustrated in Figure 2 the illustrated method of data transmission.
[0301] In the above embodiments, all or part of the steps can be implemented by software, hardware, firmware or any combination thereof, when implemented by software, all or part of the steps can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions, when loaded and executed by a device, the computer program instructions generate the processes or functions described in the embodiments of the present application. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a device or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk and magnetic tape, etc.), optical media (such as digital video disk (Digital Video Disk, DVD), etc.), or semiconductor media (such as solid state disk, etc.).
[0302] Those skilled in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or by program to instruct relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be read only memory, magnetic disk or optical disk, etc.
[0303] The above only describes one embodiment of the present application and does not limit the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method of data transmission, characterized by, The method comprises: performing fixed-length processing on the data to be sent to obtain at least one first payload data block with the same length; determining a first check data block corresponding to the first payload data block according to a correspondence relationship between the payload data block and the check data block pre-stored locally, wherein the correspondence relationship is used to indicate a construction relationship between the check data block and the payload data block; if intermediate data of the first check data block is not cached locally, caching the payload data of the first payload data block as the intermediate data of the first check data block; if the intermediate data of the first check data block is cached locally, performing exclusive-OR operation on the payload data of the first payload data block and the intermediate data of the first check data block to update the intermediate data of the first check data block, and updating a constituent number of the intermediate data of the first check data block, wherein the constituent number represents how many payload data blocks are used to obtain the intermediate data currently cached; when the constituent number of the intermediate data of the first check data block currently cached is determined to be the number of the payload data blocks corresponding to the first check data block recorded in the correspondence relationship, caching the intermediate data of the first check data block currently cached as the payload data of the first check data block, and generating the first check data block according to the payload data of the first check data block; sending the first payload data block and the first check data block to a receiving end.
2. The method of claim 1, wherein, The first payload data block corresponds to one or more first check data blocks.
3. The method according to claim 1 or 2, characterized in that, The correspondence relationship between the sending order of the payload data block and the check data block is a correspondence relationship between the sending order of the payload data block and the sending order of the check data block.
4. The method according to claim 1 or 2, characterized in that, The correspondence relationship between the sending order of the payload data block and the check data block is a correspondence relationship between the payload data identifier of the payload data block and the check data identifier of the check data block.
5. A method of data transmission, characterized by, The method comprises: receiving a payload data block sent by a sending end, performing check on the payload data block to obtain a check result of the payload data block, wherein the payload data block is obtained by performing fixed-length processing on data to be sent by the sending end, and each payload data block has the same length; The method comprises the following steps: receiving a first check data block, and generating the first check data block comprises the following steps: the sender determines a first check data block corresponding to a first payload data block according to a corresponding relationship between a locally pre-stored payload data block and a check data block if the sender obtains the first payload data block, wherein the corresponding relationship is used to indicate a construction relationship between a check data block and a payload data block; if intermediate data of the first check data block is not cached locally, the payload data of the first payload data block is cached as the intermediate data of the first check data block; if the intermediate data of the first check data block is cached locally, the payload data of the first payload data block is XORed with the intermediate data of the first check data block to update the intermediate data of the first check data block, and the number of components of the intermediate data of the first check data block is updated, wherein the number of components represents that the intermediate data cached currently is obtained by how many payload data blocks; when the number of components of the intermediate data of the first check data block cached currently is determined to be the number of payload data blocks corresponding to the first check data block recorded in the corresponding relationship, the intermediate data of the first check data block cached currently is taken as the payload data of the first check data block, and the first check data block is generated according to the payload data of the first check data block; If the number of check failure data blocks in the payload data block corresponding to the first check data block is 1, data recovery is performed on the check failure data block.
6. The method of claim 5, wherein, The sender pre-stores the corresponding relationship between the payload data block and the check data block.
7. The method according to claim 5 or 6, characterized in that, Before the first check data block is received, the method further comprises the following steps: In the case that the check result of the payload data block is a check failure, the payload data block is determined to be a check failure data block corresponding to the first check data block according to the corresponding relationship between the locally pre-stored payload data block and the check data block.
8. The method of claim 7, wherein, After the payload data block is determined to be the check failure data block corresponding to the first check data block, the method further comprises the following steps: The number of check failure data blocks corresponding to the first check data block recorded is increased by 1.
9. The method of claim 8, wherein, After the data recovery is performed on the check failure data block, the method further comprises the following steps: The number of check failure data blocks corresponding to the first check data block recorded is decreased by 1. In the case that the check failure data block also corresponds to a second check data block, the number of check failure data blocks corresponding to the second check data block recorded is decreased by 1. If the number of check failure data blocks corresponding to the second check data block is 1 after being decreased by 1, data recovery is performed on the check failure data block corresponding to the second check data block.
10. The method according to any one of claims 7-9, characterized in that, The corresponding relationship between the locally pre-stored payload data block and the check data block comprises the following steps: The first receiving order of the payload data block in a current payload data sending period is determined. Based on the correspondence between the receiving order of payload data blocks and the receiving order of verification data blocks stored locally, the second receiving order of the verification data block corresponding to the first receiving order is determined, and the payload data block is regarded as the verification failure data block corresponding to the first verification data block whose receiving order is the second receiving order in the current verification data receiving cycle.
11. The method according to any one of claims 7-9, characterized in that, The step of determining the payload data block as the verification failure data block corresponding to the first verification data block based on the pre-stored correspondence between payload data blocks and verification data blocks includes: Determine the first payload data identifier carried in the payload data block; Based on the correspondence between the payload data identifier of the payload data block and the verification data identifier of the verification data block stored locally, the first verification data identifier corresponding to the first payload data identifier is determined, and the payload data block is regarded as the verification failure data block corresponding to the first verification data block corresponding to the first payload data identifier.
12. The method according to any one of claims 7-11, characterized in that, The method further includes: If the payload data block is successfully verified, the payload data block is used as the successfully verified data block corresponding to the first verification data block, based on the correspondence between the payload data block and the verification data block stored locally in advance. Based on the payload data block, update the payload XOR result of the successfully verified data block corresponding to the first verification data block.
13. The method of claim 12, wherein, The step of recovering the data from the failed verification data block corresponding to the first verification data block includes: Based on the XOR result of the first verification data block and the recorded successful verification data block corresponding to the first verification data block, data recovery is performed on the failed verification data block corresponding to the first verification data block.
14. The method of claim 5, wherein, After receiving the first verification data block, the method further includes: Based on the local preset correspondence between payload data blocks and verification data blocks, determine the number of verification failure data blocks in the payload data block corresponding to the first verification data block.
15. The method of claim 14, wherein, The step of recovering the data from the failed verification data block corresponding to the first verification data block includes: Based on the correspondence between the payload data block and the verification data block pre-stored locally, determine the verification success data block corresponding to the first verification data block; Calculate the payload XOR result of the successfully verified data block corresponding to the first verification data block; Based on the net payload XOR result, data recovery is performed on the data block corresponding to the first verification data block that failed verification.
16. The method according to any one of claims 5-15, characterized in that, The receiving end sends a payload data block, and verifies the payload data block, including: The receiver receives a payload data block sent by the transmitter and verifies the payload data carried in the payload data block based on the verification data carried in the payload data block.
17. A communication system, characterized by The communication system includes a transmitter and a receiver. Both the transmitter and the receiver pre-store the same correspondence between payload data blocks and check data blocks. The sending end is configured to perform fixed-length processing on the data to be sent to obtain at least one first payload data block with the same length, determine a first check data block corresponding to each first payload data block according to a correspondence relationship between the payload data block and the check data block pre-stored locally, wherein the correspondence relationship is used to indicate a construction relationship between the check data block and the payload data block, cache the payload data of the first payload data block as intermediate data of the first check data block if the intermediate data of the first check data block is not cached locally, perform exclusive OR operation on the payload data of the first payload data block and the intermediate data of the first check data block to update the intermediate data of the first check data block and the number of components of the intermediate data of the first check data block if the intermediate data of the first check data block is cached locally, wherein the number of components represents the number of payload data blocks from which the intermediate data is obtained, and cache the intermediate data of the first check data block as payload data of the first check data block when the number of components of the intermediate data of the first check data block is determined to be the number of payload data blocks corresponding to the first check data block recorded in the correspondence relationship, generate the first check data block according to the payload data of the first check data block, and send the first payload data block and the first check data block to the receiving end. The receiving end is configured to receive the first payload data block, perform check on the first payload data block to obtain a check result of the first payload data block, determine a first receiving order of the first payload data block in a current payload data sending period, determine a second receiving order of a check data block corresponding to the first receiving order according to a correspondence relationship between the receiving order of the payload data block and the receiving order of the check data block pre-stored locally, and take the first payload data block as a check failure data block corresponding to a check data block with the second receiving order in a current check data receiving period. The receiving end is configured to receive the first check data block, and perform data recovery on the check failure data block corresponding to the first check data block if the number of check failure data blocks in the payload data block corresponding to the first check data block is one.
18. An apparatus for data transmission, the apparatus comprising: The apparatus comprises: an acquisition module configured to perform fixed-length processing on the data to be sent to obtain at least one first payload data block with the same length; The generating module is configured to determine a first check data block corresponding to a first payload data block according to a correspondence relationship between the locally pre-stored payload data block and the check data block, if an intermediate data of the first check data block is not cached locally, cache the payload data of the first payload data block as the intermediate data of the first check data block, if the intermediate data of the first check data block is cached locally, exclusive-OR the payload data of the first payload data block with the intermediate data of the first check data block to update the intermediate data of the first check data block, update a constituent number of the intermediate data of the first check data block, wherein the constituent number indicates how many payload data blocks are used to obtain the intermediate data, and when the constituent number of the intermediate data of the first check data block cached currently is equal to a number of payload data blocks corresponding to the first check data block recorded in the correspondence relationship, cache the intermediate data of the first check data block as the payload data of the first check data block, and generate the first check data block according to the payload data of the first check data block. The sending module is configured to send the first payload data block and the first check data block to a receiving end.
19. An apparatus for data transmission, the apparatus comprising: The device comprises: The checking module is configured to receive a payload data block sent by a sending end, check the payload data block, and obtain a check result of the payload data block, wherein the payload data block is obtained by performing fixed-length processing on to-be-sent data by the sending end, and the length of each payload data block is the same. receive a first check data block, wherein a generation method of the first check data block comprises: determining, by the sending end, a first check data block corresponding to a first payload data block according to a correspondence relationship between the payload data block and the check data block pre-stored locally, if the sending end obtains the first payload data block; wherein the correspondence relationship is used to indicate a construction relationship between the check data block and the payload data block; if intermediate data of the first check data block is not cached locally, caching payload data of the first payload data block as the intermediate data of the first check data block; if the intermediate data of the first check data block is cached locally, performing exclusive or operation on the payload data of the first payload data block and the intermediate data of the first check data block to update the intermediate data of the first check data block, and updating a composition number of the intermediate data of the first check data block, wherein the composition number represents that the intermediate data cached currently is obtained by how many payload data blocks; when the composition number of the intermediate data of the first check data block cached currently is determined to be the number of the payload data blocks corresponding to the first check data block recorded in the correspondence relationship, taking the intermediate data of the first check data block cached currently as payload data of the first check data block, and generating the first check data block according to the payload data of the first check data block; a recovery module configured to perform data recovery on a check failed data block if a number of the check failed data block in the payload data block corresponding to the first check data block satisfies a data recovery condition.
20. A transmitting end, comprising: The sending end comprises a processor and a memory, and the memory stores at least one instruction, which is loaded and executed by the processor to implement the method for data transmission according to any one of claims 1 to 4.
21. A receiving end, characterized by The sending end comprises a processor and a memory, and the memory stores at least one instruction, which is loaded and executed by the processor to implement the method for data transmission according to any one of claims 5 to 16.
22. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the method for data transmission according to any one of claims 1 to 16.
Citation Information
Patent Citations
A method and system for transmitting data
CN109274720A
Data transmission method and device
CN111385058A
Data transmission method and device
CN113078980A