A data cascade transmission method, device, equipment and medium
Through the data cascade transmission method, the sending node processes large data packets in segments and splices small data packets, which solves the problem of low utilization of the data transmission capability of the sending node in the wireless network and improves resource utilization and data transmission efficiency.
Patent Information
- Application Number
- CN202210141452.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-02-16
AI Technical Summary
In wireless networks, the data transmission capability utilization of the sending node is low, resulting in maximum unutilization of resources.
Through the data cascade transmission method, the sending node processes large data packets in segments and splices small data packets to improve the utilization of sending resources. Specific steps include constructing a data packet structure when detecting data to be sent, adding node identifiers, and extracting target data fragments based on the amount of single data transmission to form target data packets for sending. The receiving node detects the data packet, obtains and combines the fragments to complete the reception of the data packet.
It improves the utilization rate of sending resources of the sending node, enhances the efficiency of data transmission and the accuracy of data reception of the receiving node.
Smart Images

Figure CN114501548B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer data processing technology, and in particular to a data cascade transmission method, device, equipment and medium. Background Art
[0002] In a wireless network, a sending node can send data to multiple destination nodes when performing data transmission services. When a sending node obtains a sending opportunity, the sending node's sending capacity is limited.
[0003] During the invention process, the inventors discovered that the defects of the prior art are: the ability of a sending node to send data at one time is limited. Since the size of the sent data is uncertain, the utilization rate of the sending node's sending capacity is low, reducing the ability to maximize resource utilization. Summary of the invention
[0004] The embodiments of the present invention provide a data cascade transmission method, device, equipment and medium to achieve the problem of segmenting large data packets and splicing small data packets, thereby improving the utilization rate of the sending resources of the sending node.
[0005] In a first aspect, an embodiment of the present invention provides a data cascade transmission method, which is performed by a sending node and includes:
[0006] When detecting that there is data to be sent, constructing a data package structure, and adding a node identifier of the sending node to the data package structure;
[0007] According to the single data transmission amount of the sending node, at least one target data fragment is extracted from the data to be sent and filled into the data packet structure to form a target data packet, where the target data fragment is a complete or truncated data packet;
[0008] Packaging the target data and sending the data through a data sending port;
[0009] The target data group packet includes: at least one data block organized in a cascade manner, and each data block includes at least one target data fragment corresponding to the same receiving node address.
[0010] In a second aspect, an embodiment of the present invention provides a data cascade transmission method, which is performed by a receiving node and includes:
[0011] When receiving a target data group packet sent by a sending node, detecting whether the target data group packet includes a target data block corresponding to the local node address;
[0012] If yes, then obtaining the receiving node increment sequence number and the total number of data fragments recorded in the target data block;
[0013] If it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received, then sequentially obtaining a currently processed data fragment in the target data block;
[0014] If it is determined that the currently processed data segment is a complete data packet, the currently processed data segment is regarded as a data packet, and it is determined that the data packet is successfully received;
[0015] If it is determined that the currently processed data fragment is a truncated data packet, then continue to determine whether the currently processed data fragment is the last data fragment of the target complete data packet;
[0016] When it is determined to be the last data fragment, combining the last data fragment with the cached fragments for the target complete data packet to obtain the target complete data packet;
[0017] When it is determined that the data slice is not the last one, cache processing is performed on the currently processed data slice;
[0018] Return to execute the operation of sequentially obtaining a currently processed data slice in the target data block until the processing of all the data slices matching the total number of data slices is completed.
[0019] In a third aspect, an embodiment of the present invention further provides a data cascade transmission device, the data cascade transmission device comprising:
[0020] A node identification adding module is used to construct a data package structure when detecting the existence of data to be sent, and add the node identification of the sending node to the data package structure;
[0021] A target data packet forming module is used to extract at least one target data fragment from the data to be sent and fill it into the data packet structure to form a target data packet according to the single data transmission amount of the sending node, wherein the target data fragment is a complete or truncated data packet;
[0022] A data sending module, used for sending the target data group package through a data sending port;
[0023] The target data group packet includes: at least one data block organized in a cascade manner, and each data block includes at least one target data fragment corresponding to the same receiving node address.
[0024] In a fourth aspect, an embodiment of the present invention further provides a data cascade transmission device, the data cascade transmission device comprising:
[0025] A target data block detection module is used to detect whether the target data group packet includes a target data block corresponding to the local node address when receiving the target data group packet sent by the sending node;
[0026] A module for acquiring the increasing sequence number of receiving nodes and the total number of data fragments, for acquiring the increasing sequence number of receiving nodes and the total number of data fragments recorded in the target data block if the target data group package includes a target data block corresponding to the local node address;
[0027] a currently processed data fragment acquisition module, configured to sequentially acquire a currently processed data fragment in the target data block if it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received;
[0028] A complete data packet processing module, configured to treat the currently processed data fragment as a data packet if it is determined that the currently processed data fragment is a complete data packet, and determine that the data packet is successfully received;
[0029] A truncated data packet processing module, configured to, if it is determined that the currently processed data fragment is a truncated data packet, continue to determine whether the currently processed data fragment is the last data fragment of the target complete data packet;
[0030] A module for obtaining a target complete data packet, for combining the last data fragment with the cached fragments for the target complete data packet to obtain the target complete data packet when the last data fragment is determined to be the last data fragment;
[0031] A cache processing module, used for caching the currently processed data fragment when it is determined that it is not the last data fragment;
[0032] The processing completion module is used to return to execute the operation of sequentially obtaining a currently processed data slice in the target data block until the processing of all the data slices matching the total number of data slices is completed.
[0033] In a fifth aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data cascade transmission method as described in any embodiment of the present invention is implemented.
[0034] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data cascade transmission method as described in any embodiment of the present invention.
[0035] The technical solution provided by the embodiment of the present invention constructs a data packet structure when detecting the existence of data to be sent, and adds the node identifier of the sending node to the data packet structure; extracts at least one target data fragment from the data to be sent and fills it into the data packet structure according to the single data sending amount of the sending node to form a target data packet, and the target data fragment is a complete or truncated data packet; and sends the target data packet through a data sending port. The segmentation processing of large data packets and the splicing processing of small data packets are realized, and the utilization rate of the sending resources of the sending node is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flow chart of a data cascade transmission method provided in Embodiment 1 of the present invention;
[0037] Figure 2a A flowchart of another data cascade transmission method provided in Embodiment 2 of the present invention;
[0038] Figure 2b A schematic diagram of the structure of a target data packet in another data cascade transmission method provided in Embodiment 2 of the present invention;
[0039] Figure 3 A flowchart of another data cascade transmission method provided in Embodiment 3 of the present invention;
[0040] Figure 4 It is a structural schematic diagram of a data cascade transmission device provided in Embodiment 4 of the present invention;
[0041] Figure 5 is a structural schematic diagram of another data cascade transmission device provided in Embodiment 5 of the present invention;
[0042] Figure 6 It is a structural diagram of a computer device provided in Embodiment 6 of the present invention. DETAILED DESCRIPTION
[0043] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention.
[0044] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0045] The terms "first" and "second" and the like in the description, claims and drawings of the embodiments of the present invention are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0046] Embodiment 1
[0047] Figure 1 A flowchart of a data cascade transmission method provided in Embodiment 1 of the present invention. This embodiment is applicable to a case where a sending node sends data to a receiving node. The method of this embodiment can be executed by a data cascade transmission device, which can be implemented by software and / or hardware, which can be configured in a server, and which can be executed by a sending node.
[0048] Accordingly, the method specifically comprises the following steps:
[0049] S110: When it is detected that there is data to be sent, a data packet structure is constructed, and a node identifier of the sending node is added to the data packet structure.
[0050] The data packet structure may be a structure of data packet to be sent according to certain data frame rules. The node identifier may be information about the sending node, which can easily determine from which sending node the data to be sent is sent.
[0051] Exemplarily, assuming that the header file of the data packet structure is represented by hdr, when it is detected that there is data to be sent, the node identifier of the sending node is obtained, represented by src, and then hdr and src are added to the data packet structure. The data packet structure at this time contains two pieces of fragmentation information, hdr and src.
[0052] S120. Extract at least one target data shard from the data to be sent according to the single - time data sending volume of the sending node, and fill it into the data packet structuring to form a target data packet. The target data shard is a complete or truncated data packet.
[0053] Among them, the single - time data sending volume can be the ability of the sending node to send data at a single time, that is, the maximum number of bytes of data sent at a single time. The target data shard can be in the form of a data shard obtained after sharding the data to be sent. The target data packet can be a data packet structuring obtained by filling the target data in the form of the data packet structuring.
[0054] Among them, the complete data packet can be a complete data packet when the target data is packetized, without being sharded and stored. The truncated data packet can be an incomplete data packet when the target data is packetized, and is sharded and stored, which can be the first data shard, the middle data shard or the last data shard.
[0055] Exemplarily, assume that the single - time data sending volume of the sending node is N bytes, and assume that the length of the target data packet is M bytes. If N > M, it means that the sending node can send the target data packet in one go, that is, the target data shard is a complete data packet; if N < M, it means that the sending node cannot send the target data packet in one go, that is, the target data shard is a truncated data packet.
[0056] S130. Send the target data packet through the data sending port.
[0057] Among them, the target data packet includes: at least one data block organized in a cascading manner, and each data block includes at least one target data shard corresponding to the address of the same receiving node.
[0058] Among them, the cascading method can refer to the mapping relationship between multiple objects in computer science, which is a way to establish the cascading relationship between data to improve management efficiency. The data block can be a set of records or several sets of records arranged continuously in sequence, and is the data unit for transmission between the main memory and the input device, output device or external memory.
[0059] The technical solution provided by the embodiment of the present invention constructs a data packet structure when detecting the existence of data to be sent, and adds the node identifier of the sending node to the data packet structure; extracts at least one target data fragment from the data to be sent and fills it into the data packet structure according to the single data sending amount of the sending node to form a target data packet, and the target data fragment is a complete or truncated data packet; and sends the target data packet through a data sending port. The segmentation processing of large data packets and the splicing processing of small data packets are realized, and the utilization rate of the sending resources of the sending node is improved.
[0060] Embodiment 2
[0061] Figure 2a A flow chart of another data cascade transmission method provided in Embodiment 2 of the present invention. This embodiment is based on the above embodiments and is further refined by extracting at least one target data fragment from the data to be sent and filling it into the data packet structure according to the single data transmission amount of the sending node to form a target data packet.
[0062] Accordingly, the method specifically comprises the following steps:
[0063] S210: When it is detected that there is data to be sent, a data packet structure is constructed, and a node identifier of the sending node is added to the data packet structure.
[0064] S220. Obtain the remaining data transmission amount of the sending node, and initialize the remaining data transmission amount to the single data transmission amount.
[0065] The remaining data transmission amount may be the transmission amount of the sending node minus the fixed number of bytes occupied by the header file of the data packet structure and the node identifier of the sending node, to obtain the actual data amount that the sending node can send at one time.
[0066] For example, assume that the sending amount of the sending node is N 总 The number of bytes occupied by the header file of the data packet structure and the node identifier of the sending node is N. 消 , that is, the single data transmission amount is N = N 总 -N 消 .
[0067] S230 , sequentially obtaining currently processed data packets from the data to be sent, and detecting whether the currently processed data packets meet a new data block storage condition.
[0068] The currently processed data packet may be a data packet that is obtained from the data to be sent and needs to be processed. The new data block storage condition may be to determine whether the destination node of the currently processed data packet is the same as the destination node of the previously processed data packet. If they are the same, the new data block storage condition is not met; if they are not the same, the new data block storage condition is met.
[0069] Exemplarily, assuming that the destination node of the previously processed data packet is dst1, if the destination node of the currently processed data packet is dst1, the currently processed data packet does not meet the new data block storage condition; if the destination node of the currently processed data packet is dst2, the currently processed data packet meets the new data block storage condition.
[0070] S240: If yes, then create a new target data block in the data package structure.
[0071] S250. Fill in the receiving node address of the current data packet, the receiving node increment sequence number and the total number of initialized data fragments in the target data block, and update the remaining data transmission amount.
[0072] The receiving node address of the current data packet may be the address of the corresponding receiving node from which the current data packet needs to send data. The receiving node increment sequence number may be the number of single data transmissions of the sending node that the current data packet needs to increase by 1. The total number of data fragments may be the number of data to be sent after the target data block contains the data to be sent and the fragmentation process is performed.
[0073] For example, assuming that the receiving node address of the current data packet is represented by dst, the receiving node increment sequence number is represented by cnt, and the total number of initialized data fragments is represented by num, assuming that the header file of the data packet structure is represented by hdr, and the node identifier of the sending node is represented by src, hdr, src, dst, cnt and num are added to the data packet structure.
[0074] Furthermore, assuming that the sending amount of the sending node is N 总 The fixed number of bytes occupied by the header file of the data packet structure, the node identification of the sending node, the receiving node address of the current data packet, the receiving node increment sequence number, and the total number of initialized data fragments is N. 消 , that is, the single data transmission amount is N = N 总 -N 消 , that is, the remaining data sending amount needs to be updated.
[0075] S260. When it is determined that the data volume of the currently processed data packet is less than or equal to the remaining data sending volume, fill in at least one item of fragment description information corresponding to the currently processed data packet in the target data block, fill the currently processed data packet as a target data fragment in the target data block, and update the total number of data fragments.
[0076] Exemplarily, assuming that the data volume of the currently processed data packet is M, and the remaining data transmission volume is N, and assuming that M≤N, it means that at least one item of fragment description information corresponding to the currently processed data packet can be filled in the target data block, and the total number of data fragments needs to be updated.
[0077] Optionally, at least one item of fragment description information corresponding to the currently processed data packet is: the segment length of the data packet, the location information of the data packet and the incremental serial number of the data packet; in the target data block, at least one item of fragment description information corresponding to the currently processed data packet is filled, including: if it is determined that the currently processed data packet is a complete data packet, then the segment length of the data packet is determined to be the data volume of the currently processed data packet, the location information of the data packet is the whole packet without segmentation, and the incremental serial number of the data packet is increased by 1; if it is determined that the currently processed data packet is a truncated data packet, then the segment length of the data packet is determined to be the data volume of the currently processed data packet, the location information of the data packet is the last packet of the segment, and the incremental serial number of the data packet is increased by 1.
[0078] The segment length of the data packet may be the length of the currently processed data packet, that is, the size of the specific number of bytes. The location information of the data packet may be the specific location of the currently processed data packet in the data packet, which may include the whole packet without segmentation, the first packet of the segment, the middle packet of the segment, and the last packet of the segment. The incremental sequence number of the data packet may be the sequence number of the currently processed data packet, that is, the sequence numbers of different segment packets belonging to the same data packet are the same.
[0079] Exemplarily, assume that the data volume of the currently processed data packet is M, and the remaining data transmission volume is N. When M≤N, it is necessary to determine whether the currently processed data packet is a complete data packet. If the currently processed data packet is a complete data packet, the segment length of the data packet is determined to be the data volume M of the currently processed data packet, the location information of the data packet is the whole packet without segmentation, and the incremental sequence number of the data packet is increased by 1. If the currently processed data packet is not a complete data packet, that is, the currently processed data packet is a truncated data packet, the segment length of the data packet is determined to be the data volume M of the currently processed data packet, the location information of the data packet is the last packet of the segment, and the incremental sequence number of the data packet is increased by 1.
[0080] The advantage of this arrangement is that by judging whether the currently processed data packet is a complete data packet, the segment length of the data packet, the location information of the data packet and the incremental sequence number of the data packet can be further determined. Therefore, after the data is sent from the sending node, the receiving node receives the data and can accurately perform the data packaging operation, thereby avoiding errors caused by missing received data.
[0081] S270, after updating the remaining data transmission amount according to the fragment description information and the data amount of the currently processed data packet, return to execute the operation of sequentially obtaining the currently processed data packets from the data to be sent.
[0082] Continuing with the previous example, since M≤N, it means that the sending node is still capable of sending data, so the remaining data sending amount needs to be updated, that is, the remaining data sending amount at this time is N', that is, N'=NM.
[0083] S280. When it is determined that the data volume of the currently processed data packet is greater than the remaining data transmission volume, a target shortened data packet matching the remaining data transmission volume is intercepted from the currently processed data packet, and the intercepted currently processed data packet is stored again as the data to be sent.
[0084] Exemplarily, assuming that the data volume of the currently processed data packet is M and the remaining data transmission volume is N, and assuming that M>N, it means that the target shortened data packet matching the remaining data transmission volume can be intercepted from the currently processed data packet, and the intercepted and processed currently processed data packet can be stored again as the data to be sent.
[0085] Optionally, the at least one item of fragment description information corresponding to the target truncated data packet is: the segment length of the data packet, the location information of the data packet and the incrementing sequence number of the data packet; in the target data block, at least one item of fragment description information corresponding to the target truncated data packet is filled, including: if it is determined that the currently processed data packet is a complete data packet, then the segment length of the data packet is determined to be the remaining data transmission amount, the location information of the data packet is the first packet of the segment and the incrementing sequence number of the data packet remains unchanged; if it is determined that the currently processed data packet is a truncated data packet, then the segment length of the data packet is determined to be the remaining data transmission amount, the location information of the data packet is the middle packet of the segment and the incrementing sequence number of the data packet remains unchanged.
[0086] Exemplarily, assume that the data volume of the currently processed data packet is M, and the remaining data transmission volume is N. When M>N, it is necessary to determine whether the currently processed data packet is a complete data packet. If the currently processed data packet is a complete data packet, the segment length of the data packet is determined to be the data volume N of the currently processed data packet, the location information of the data packet is the first packet of the segment, and the incrementing sequence number of the data packet remains unchanged. If the currently processed data packet is not a complete data packet, that is, the currently processed data packet is a truncated data packet, the segment length of the data packet is determined to be the data volume N of the currently processed data packet, the location information of the data packet is the middle packet of the segment, and the incrementing sequence number of the data packet remains unchanged.
[0087] The advantage of this arrangement is that by judging whether the currently processed data packet is a complete data packet, the segment length of the data packet, the location information of the data packet and the incremental sequence number of the data packet can be further determined. Therefore, after the data is sent from the sending node, the receiving node receives the data and can accurately perform the data packet operation, reducing the errors caused by the receiving node when assembling the data.
[0088] S290. Fill in at least one item of fragment description information corresponding to the target truncated data packet in the target data block, and fill the target truncated data packet as a target data fragment in the target data block, and after updating the total number of data fragments, determine the data package structure currently filled as the target data package.
[0089] Figure 2b is a schematic diagram of the structure of the target data packet, such as Figure 2b As shown, the data packet consists of hdr, src, dst1, cnt, num, ind, data1, etc., where hdr, src, dst1, cnt and num are fixed byte losses during data transmission, and data1 and data2 are obtained by data slicing operation of the target data packet.
[0090] S2100, group the target data into packets and send the data through a data sending port.
[0091] The target data group packet includes: at least one data block organized in a cascade manner, and each data block includes at least one target data fragment corresponding to the same receiving node address.
[0092] The technical solution provided by the embodiment of the present invention is as follows: when detecting the existence of data to be sent, constructing a data packet structure and adding the node identifier of the sending node to the data packet structure; obtaining the remaining data sending amount of the sending node, and initializing the remaining data sending amount to the single data sending amount; obtaining the currently processed data packet from the data to be sent in sequence, and detecting whether the currently processed data packet meets the new data block storage condition; if so, creating a new target data block in the data packet structure; filling in the receiving node address of the current data packet, the receiving node increment sequence number and the total number of initialized data fragments in the target data block, and updating the remaining data sending amount; when determining that the data amount of the currently processed data packet is less than or equal to the remaining data sending amount, filling in at least one fragment description information corresponding to the currently processed data packet in the target data block, and using the currently processed data packet as a target data fragment. Fill in the target data block and update the total number of data fragments; after updating the remaining data transmission amount according to each of the fragment description information and the data amount of the currently processed data packet, return to execute the operation of sequentially obtaining the currently processed data packet from the data to be sent; when it is determined that the data amount of the currently processed data packet is greater than the remaining data transmission amount, intercept the target shortened data packet matching the remaining data transmission amount in the currently processed data packet, and store the intercepted currently processed data packet again as the data to be sent; fill in at least one fragment description information corresponding to the target shortened data packet in the target data block, and fill the target shortened data packet as a target data fragment in the target data block, and after updating the total number of data fragments, determine the data grouping structure obtained by the current filling as the target data grouping; and send the target data grouping through the data sending port. The utilization rate of the sending resource of the sending node is improved, and the data transmission efficiency of the sending node and the accuracy of the data receiving of the receiving node are increased.
[0093] Optionally, after detecting whether the currently processed data packet meets the new data block storage condition, it also includes: if not, when it is determined that the data volume of the currently processed data packet is less than or equal to the remaining data transmission volume, in the target data block, fill in at least one fragment description information corresponding to the currently processed data packet, and fill the currently processed data packet as a target data fragment in the target data block, and update the total number of data fragments; after updating the remaining data transmission volume according to each of the fragment description information and the data volume of the currently processed data packet, return to execute, and obtain the currently processed data from the data to be sent in sequence. processing data packets; when it is determined that the data volume of the currently processed data packet is greater than the remaining data transmission volume, intercepting a target shortened data packet that matches the remaining data transmission volume in the currently processed data packet, and storing the intercepted and processed currently processed data packet again as the data to be sent; filling at least one fragment description information corresponding to the target shortened data packet in the target data block, and filling the target shortened data packet as a target data fragment in the target data block, and after updating the total number of data fragments, determining the data grouping structure obtained by the current filling as the target data grouping.
[0094] Exemplarily, since the currently processed data packet does not meet the storage condition of the new data block, that is, the receiving node address dst of the currently processed data packet is consistent with that of the previously processed data packet. Assuming that the data volume of the currently processed data packet is M, and the remaining data transmission volume is N, when M≤N, the fragment description information is filled in the target data block, and the currently processed data packet is filled in the target data block as a target data fragment, and the total number of data fragments num and the remaining data transmission volume are updated. Accordingly, the operation of obtaining the currently processed data packet in sequence from the data to be sent is returned.
[0095] Furthermore, when M>N, a target shortened data packet matching the remaining data transmission amount is intercepted from the currently processed data packet, that is, the length of the target shortened data packet is N bytes. The intercepted currently processed data packet is then stored again as data to be sent, and the fragment description information is filled in the target data block, and the target shortened data packet is filled in the target data block as a target data fragment, and the total number of data fragments num is updated, and the data packet structure obtained by the current filling is determined as the target data packet.
[0096] The advantage of this setting is that by determining that the currently processed data packet does not meet the storage conditions of the new data block, the relationship between the data volume of the currently processed data packet and the remaining data transmission volume is further determined, thereby obtaining the corresponding target data grouping. In this way, the data grouping operation can be performed more accurately and concisely, thereby improving resource utilization.
[0097] Embodiment 3
[0098] Figure 3 A flowchart of another data cascade transmission method provided in Embodiment 3 of the present invention. This embodiment is applicable to a case where a receiving node receives data sent by a sending node. The method of this embodiment can be executed by a data cascade transmission device, which can be implemented by software and / or hardware, which can be configured in a server, and which can be executed by a receiving node.
[0099] Accordingly, the method specifically comprises the following steps:
[0100] S310. When receiving a target data group packet sent by a sending node, detect whether the target data group packet includes a target data block corresponding to the local node address.
[0101] The local node address may be a specific destination address of the receiving node.
[0102] Exemplarily, assuming that the target data block corresponding to the local node address includes dst1 and dst2, when the information of the target data block in the target data group packet is dst1, it indicates that the target data group packet includes the target data block corresponding to the local node address. When the information of the target data block in the target data group packet is dst3, it indicates that the target data group packet does not include the target data block corresponding to the local node address.
[0103] S320: If yes, obtain the increasing sequence number of the receiving nodes and the total number of data fragments recorded in the target data block.
[0104] Continuing with the previous example, when the target data group packet includes a target data block corresponding to the local node address, the receiving node increment sequence number cnt and the total number of data fragments num are obtained.
[0105] S330: If it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received, then sequentially obtain a currently processed data fragment in the target data block.
[0106] S340: If it is determined that the currently processed data segment is a complete data packet, the currently processed data segment is regarded as a data packet, and it is determined that the data packet is successfully received.
[0107] S350: If it is determined that the currently processed data fragment is a truncated data packet, continue to determine whether the currently processed data fragment is the last data fragment of the target complete data packet.
[0108] The last data fragment may be the last data packet of a complete data packet.
[0109] S360: When it is determined to be the last data fragment, combine the last data fragment with the cached fragments for the target complete data packet to obtain the target complete data packet.
[0110] S370: When it is determined that the data fragment is not the last data fragment, cache the currently processed data fragment.
[0111] S380, returning to execute the operation of sequentially acquiring a currently processed data slice in the target data block until the processing of all the data slices matching the total number of data slices is completed.
[0112] Continuing with the previous example, the receiving node increment sequence number cnt and the total number of data fragments num are obtained. First, it is determined whether the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data packet received. If so, a currently processed data fragment is obtained in the target data block in sequence.
[0113] Further, it is determined whether the currently processed data segment is a complete data packet, if so, the currently processed data segment is regarded as a data packet, and it is determined that the data packet is successfully received. If not, the currently processed data segment is a truncated data packet.
[0114] Next, it is determined whether the currently processed data fragment is the last data fragment of the target complete data packet. If so, the last data fragment is combined with the cached fragments for the target complete data packet to obtain the target complete data packet; if not, the currently processed data fragment is cached.
[0115] Finally, the operation of obtaining a currently processed data shard in the target data block is returned to be executed in sequence until the processing of all data shards matching the total number of data shards is completed.
[0116] The technical solution provided by the embodiment of the present invention is to detect whether the target data group packet sent by the sending node includes a target data block corresponding to the local node address when the target data group packet is received; if so, obtain the receiving node increment sequence number and the total number of data fragments recorded in the target data block; if it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received, then obtain a current processing data fragment in the target data block in sequence; if it is determined that the current processing data fragment is a complete data packet, the current processing data fragment is used as a data The method comprises the following steps: first, the receiving node receives a data packet and determines that the data packet is successfully received; if the currently processed data fragment is determined to be a truncated data packet, then the determination is continued as to whether the currently processed data fragment is the last data fragment of the target complete data packet; when it is determined to be the last data fragment, the last data fragment is combined with the cached fragment for the target complete data packet to obtain the target complete data packet; when it is determined not to be the last data fragment, the currently processed data fragment is cached; and the operation of obtaining a currently processed data fragment in the target data block is returned to perform in turn until the processing of all data fragments matching the total number of data fragments is completed. The accuracy and efficiency of receiving data at the receiving node are achieved, thereby making more effective use of resources.
[0117] Optionally, after obtaining the receiving node increment sequence number and the total number of data fragments recorded in the target data block, it also includes: if it is determined that the receiving node increment sequence number is not continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received, then sequentially obtaining a currently processed data fragment in the target data block; obtaining the increment sequence number of the data packet of the currently processed data fragment; if it is determined that the increment sequence number of the data packet is continuous with the increment sequence number of the data packet of the data fragment, discarding the target data block and clearing the data blocks corresponding to the increment sequence number of the data packet; if it is determined that the increment sequence number of the data packet is not continuous with the increment sequence number of the data packet of the data fragment, clearing the unprocessed data fragment; Complete the corresponding data block for packetization; wherein, if it is determined that the currently processed data slice is a complete data packet, the currently processed data slice is taken as a data packet, and it is determined that the data packet is successfully received; if it is determined that the currently processed data slice is a truncated data packet, continue to judge whether the currently processed data slice is the first data slice of the target complete data packet; when it is determined to be the first data slice, cache the first data slice and wait for the next data to be packetized; when it is determined not to be the first data slice, discard the currently processed data block; return to execute the operation of obtaining a currently processed data slice in the target data block in turn, until the processing of all the data slices that match the total number of data slices is completed.
[0118] For example, if the received node increment sequence number cnt is not continuous, it is necessary to continue to determine whether the increment sequence number sn of the data packet is continuous. If sn is continuous, the target data block is discarded, and the data blocks corresponding to the increment sequence number of the data packet are cleared.
[0119] If sn is not continuous, the corresponding data blocks of the unfinished packet are cleared; and further, it is determined whether the currently processed data fragment is a complete data packet. If so, the currently processed data fragment is regarded as a data packet, and it is determined that the data packet is successfully received; if not, it is further determined whether the currently processed data fragment is the first data fragment of the target complete data packet.
[0120] Furthermore, if the currently processed data fragment is the first data fragment of the target complete data packet, the first data fragment is cached and waits for the next data to be packaged; if the currently processed data fragment is not the first data fragment of the target complete data packet, the currently processed data block is discarded.
[0121] Correspondingly, the operation of obtaining a currently processed data slice in the target data block in sequence is returned to be executed until the processing of all the data slices matching the total number of data slices is completed.
[0122] The advantage of this setting is that by judging whether the increasing sequence number of the data packet is continuous, the processing method of the target data block can be further determined. In this way, data can be received more accurately and orderly, and the accuracy of data transmission can be improved.
[0123] Embodiment 4
[0124] Figure 4 1 is a schematic diagram of the structure of a data cascade transmission device provided in the fourth embodiment of the present invention. The data cascade transmission device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a server to implement a data cascade transmission method in the embodiment of the present invention. Figure 4 As shown, the device may specifically include: a node identification adding module 410, a target data package forming module 420 and a data sending module 430.
[0125] The node identification adding module 410 is used to construct a data package structure when detecting the existence of data to be sent, and add the node identification of the sending node to the data package structure;
[0126] The target data packet forming module 420 is used to extract at least one target data fragment from the data to be sent and fill it into the data packet structure to form a target data packet, wherein the target data fragment is a complete or truncated data packet;
[0127] A data sending module 430 is used to send the target data group through a data sending port;
[0128] The target data group packet includes: at least one data block organized in a cascade manner, and each data block includes at least one target data fragment corresponding to the same receiving node address.
[0129] The technical solution provided by the embodiment of the present invention constructs a data packet structure when detecting the existence of data to be sent, and adds the node identifier of the sending node to the data packet structure; extracts at least one target data fragment from the data to be sent and fills it into the data packet structure according to the single data sending amount of the sending node to form a target data packet, and the target data fragment is a complete or truncated data packet; and sends the target data packet through a data sending port. The segmentation processing of large data packets and the splicing processing of small data packets are realized, and the utilization rate of the sending resources of the sending node is improved.
[0130] Based on the above embodiments, the target data package forming module 420 may specifically include:
[0131] a single data transmission amount determination unit, used to obtain the remaining data transmission amount of the sending node, and the remaining data transmission amount is initialized to the single data transmission amount; a new data block storage condition detection unit, used to obtain the currently processed data packet from the data to be sent in sequence, and detect whether the currently processed data packet meets the new data block storage condition; a target data block creation unit, used to create a new target data block in the data packet structure if the currently processed data packet meets the new data block storage condition; a remaining data transmission amount update unit, used to fill the receiving node address of the current data packet, the receiving node increment sequence number and the total number of initialized data fragments in the target data block, and update the remaining data transmission amount; a total number of data fragments update unit, used to fill at least one fragment description information corresponding to the currently processed data packet in the target data block when it is determined that the data amount of the currently processed data packet is less than or equal to the remaining data transmission amount, and use the currently processed data packet as a target The data slices are filled in the target data block, and the total number of data slices is updated; the remaining data sending amount updating unit is used to update the remaining data sending amount according to the description information of each slice and the data amount of the currently processed data packet, and then return to execute the operation of sequentially obtaining the currently processed data packets from the data to be sent; the data to be sent storage unit is used to intercept the target shortened data packet matching the remaining data sending amount in the currently processed data packet when it is determined that the data amount of the currently processed data packet is greater than the remaining data sending amount, and store the currently processed data packet after interception and processing as the data to be sent again; the target data grouping determination unit is used to fill in at least one slice description information corresponding to the target shortened data packet in the target data block, fill the target shortened data packet as a target data slice in the target data block, and after updating the total number of data slices, determine the data grouping structure obtained by the current filling as the target data grouping.
[0132] On the basis of the above embodiments, the total number of data fragments updating unit can be specifically used for: at least one item of fragment description information corresponding to the currently processed data packet is: the segment length of the data packet, the location information of the data packet and the incremental serial number of the data packet; in the target data block, filling at least one item of fragment description information corresponding to the currently processed data packet includes: if it is determined that the currently processed data packet is a complete data packet, then the segment length of the data packet is determined to be the data volume of the currently processed data packet, the location information of the data packet is the whole packet without segmentation, and the incremental serial number of the data packet is increased by 1; if it is determined that the currently processed data packet is a truncated data packet, then the segment length of the data packet is determined to be the data volume of the currently processed data packet, the location information of the data packet is the last packet of the segment, and the incremental serial number of the data packet is increased by 1.
[0133] On the basis of the above embodiments, the data storage unit to be sent can be specifically used for: the at least one fragment description information corresponding to the target truncated data packet is: the segment length of the data packet, the position information of the data packet and the incremental sequence number of the data packet; in the target data block, fill in at least one fragment description information corresponding to the target truncated data packet, including: if it is determined that the currently processed data packet is a complete data packet, then the segment length of the data packet is determined to be the remaining data transmission amount, the position information of the data packet is the first packet of the segment, and the incremental sequence number of the data packet remains unchanged; if it is determined that the currently processed data packet is a truncated data packet, then the segment length of the data packet is determined to be the remaining data transmission amount, the position information of the data packet is the middle packet of the segment, and the incremental sequence number of the data packet remains unchanged.
[0134] On the basis of the above embodiments, it also includes a target data block filling unit, which can be specifically used to: after detecting whether the currently processed data packet meets the new data block storage condition, determine that the currently processed data packet does not meet the new data block storage condition, then when it is determined that the data volume of the currently processed data packet is less than or equal to the remaining data transmission volume, fill in at least one fragment description information corresponding to the currently processed data packet in the target data block, fill the currently processed data packet as a target data fragment in the target data block, and update the total number of data fragments; update the remaining data transmission volume according to each of the fragment description information and the data volume of the currently processed data packet. After that, return to execute the operation of obtaining the currently processed data packets in sequence from the data to be sent; when it is determined that the data volume of the currently processed data packet is greater than the remaining data sending volume, intercept the target shortened data packet matching the remaining data sending volume in the currently processed data packet, and store the intercepted and processed currently processed data packet again as the data to be sent; fill in at least one fragment description information corresponding to the target shortened data packet in the target data block, and fill the target shortened data packet as a target data fragment in the target data block, and after updating the total number of data fragments, determine the data grouping structure obtained by the current filling as the target data grouping.
[0135] The above-mentioned data cascade transmission device can execute the data cascade transmission method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0136] Embodiment 5
[0137] Figure 51 is a schematic diagram of the structure of a data cascade transmission device provided in Embodiment 5 of the present invention. The data cascade transmission device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a server to implement a data cascade transmission method in an embodiment of the present invention. Figure 5 As shown, the device may specifically include: a target data block detection module 510, a receiving node increment sequence number and a total number of data fragments acquisition module 520, a current processing data fragment acquisition module 530, a complete data packet processing module 540, a truncated data packet processing module 550, a target complete data packet acquisition module 560, a cache processing module 570 and a processing completion module 580.
[0138] The target data block detection module 510 is used to detect whether the target data group packet includes the target data block corresponding to the local node address when receiving the target data group packet sent by the sending node;
[0139] The receiving node increment sequence number and the total number of data fragments acquisition module 520 is used to acquire the receiving node increment sequence number and the total number of data fragments recorded in the target data block if the target data group package includes a target data block corresponding to the local node address;
[0140] The currently processed data fragment acquisition module 530 is used to sequentially acquire a currently processed data fragment in the target data block if it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received;
[0141] The complete data packet processing module 540 is used to treat the currently processed data fragment as a data packet if it is determined that the currently processed data fragment is a complete data packet, and determine that the data packet is successfully received;
[0142] A truncated data packet processing module 550 is used to, if it is determined that the currently processed data fragment is a truncated data packet, continue to determine whether the currently processed data fragment is the last data fragment of the target complete data packet;
[0143] A module 560 for obtaining a target complete data packet, configured to combine the last data fragment with the cached fragments for the target complete data packet to obtain the target complete data packet when the last data fragment is determined to be the last data fragment;
[0144] A cache processing module 570, configured to cache the currently processed data slice when it is determined that the currently processed data slice is not the last data slice;
[0145] The processing completion module 580 is used to return to execute the operation of sequentially obtaining a currently processed data slice in the target data block until the processing of all the data slices matching the total number of data slices is completed.
[0146] The technical solution provided by the embodiment of the present invention is to detect whether the target data group packet sent by the sending node includes a target data block corresponding to the local node address when the target data group packet is received; if so, obtain the receiving node increment sequence number and the total number of data fragments recorded in the target data block; if it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received, then obtain a current processing data fragment in the target data block in sequence; if it is determined that the current processing data fragment is a complete data packet, the current processing data fragment is used as a data The method comprises the following steps: first, the receiving node receives a data packet and determines that the data packet is successfully received; if the currently processed data fragment is determined to be a truncated data packet, then the determination is continued as to whether the currently processed data fragment is the last data fragment of the target complete data packet; when it is determined to be the last data fragment, the last data fragment is combined with the cached fragment for the target complete data packet to obtain the target complete data packet; when it is determined not to be the last data fragment, the currently processed data fragment is cached; and the operation of obtaining a currently processed data fragment in the target data block is returned to perform in turn until the processing of all data fragments matching the total number of data fragments is completed. The accuracy and efficiency of receiving data at the receiving node are achieved, thereby making more effective use of resources.
[0147] On the basis of the above embodiments, it also includes a receiving node incremental sequence number discontinuity module, which can be specifically used to: after obtaining the receiving node incremental sequence number and the total number of data fragments recorded in the target data block, if it is determined that the receiving node incremental sequence number is discontinuous with the receiving node incremental sequence number recorded in the previous data block in the previous data group packet received, then obtain a currently processed data fragment in the target data block in turn; obtain the incremental sequence number of the data packet of the currently processed data fragment; if it is determined that the incremental sequence number of the data packet is continuous with the incremental sequence number of the data packet of the data fragment, discard the target data block, and clear the data blocks corresponding to the incremental sequence number of the data packet; if it is determined that the incremental sequence number of the data packet is continuous with the data packet of the data fragment If the increasing sequence number of the packet is not continuous, the corresponding data block of the unfinished packetization is cleared; wherein, if it is determined that the currently processed data fragment is a complete data packet, the currently processed data fragment is taken as a data packet, and it is determined that the data packet is successfully received; if it is determined that the currently processed data fragment is a truncated data packet, it is further determined whether the currently processed data fragment is the first data fragment of the target complete data packet; when it is determined to be the first data fragment, the first data fragment is cached and the next data is waited for packetization; when it is determined not to be the first data fragment, the currently processed data block is discarded; and the operation of obtaining a currently processed data fragment in the target data block in turn is returned to execute until the processing of all the data fragments that match the total number of data fragments is completed.
[0148] The above-mentioned data cascade transmission device can execute the data cascade transmission method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0149] Embodiment 6
[0150] Figure 6 Schematic diagram of the structure of a computer device provided by Embodiment 6 of the present invention. Figure 6 As shown, the device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of processors 610 in the device can be one or more. Figure 6 A processor 610 is taken as an example; the processor 610, memory 620, input device 630 and output device 640 in the device can be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0151] The memory 620, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the data cascade transmission method in the embodiment of the present invention (for example, the node identification adding module 410, the target data grouping module 420 and the data sending module 430). The processor 610 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 620, that is, to implement the above-mentioned data cascade transmission method, the method comprising: when detecting the existence of data to be sent, constructing a data grouping structure, and adding the node identification of the sending node to the data grouping structure; according to the single data transmission amount of the sending node, extracting at least one target data segment from the data to be sent and filling it into the data grouping structure to form a target data grouping, the target data segment is a complete or truncated data packet; the target data grouping is sent through the data sending port.
[0152] The memory 620, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the data cascade transmission method in the embodiment of the present invention (for example, a target data block detection module 510, a receiving node increment sequence number and a total number of data fragments acquisition module 520, a current processing data fragment acquisition module 530, a complete data packet processing module 540, a truncated data packet processing module 550, a target complete data packet acquisition module 560, a cache processing module 570 and a processing completion module 580). The processor 610 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 620, that is, realizing the above-mentioned data cascade transmission method, which includes: when receiving the target data group packet sent by the sending node, detecting whether the target data group packet includes the target data block corresponding to the local node address; if so, obtaining the receiving node increment sequence number and the total number of data fragments recorded in the target data block; if it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group received, obtaining a currently processed data fragment in the target data block in turn; if it is determined that the currently processed data fragment is If the processed data fragment is a complete data packet, the currently processed data fragment is regarded as a data packet, and it is determined that the data packet is successfully received; if it is determined that the currently processed data fragment is a truncated data packet, it is further determined whether the currently processed data fragment is the last data fragment of the target complete data packet; when it is determined to be the last data fragment, the last data fragment is combined with the cached fragment for the target complete data packet to obtain the target complete data packet; when it is determined not to be the last data fragment, the currently processed data fragment is cached; and the operation of obtaining a currently processed data fragment in the target data block in sequence is returned to be executed until the processing of all the data fragments that match the total number of data fragments is completed.
[0153] The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 620 may further include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0154] The input device 630 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 640 may include a display device such as a display screen.
[0155] Embodiment 7
[0156] Embodiment 7 of the present invention also provides a computer-readable storage medium, wherein the computer-readable instructions are used to execute a data cascade transmission method when executed by a computer processor, the method comprising: when detecting the presence of data to be sent, constructing a data packet structure, and adding the node identifier of the sending node to the data packet structure; according to the single data sending amount of the sending node, extracting at least one target data fragment from the data to be sent and filling it into the data packet structure to form a target data packet, the target data fragment being a complete or truncated data packet; and sending the target data packet through a data sending port.
[0157] Alternatively, the method includes: upon receiving a target data packet sent by a sending node, detecting whether the target data packet includes a target data block corresponding to the local node address; if so, obtaining the receiving node increment sequence number and the total number of data fragments recorded in the target data block; if it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data packet received, obtaining a currently processed data fragment in the target data block in sequence; if it is determined that the currently processed data fragment is a complete data packet, treating the currently processed data fragment as a data packet, and confirming that The method further comprises the steps of: determining that the data packet is successfully received; if it is determined that the currently processed data fragment is a truncated data packet, continuing to determine whether the currently processed data fragment is the last data fragment of the target complete data packet; when it is determined to be the last data fragment, combining the last data fragment with the cached fragment for the target complete data packet to obtain the target complete data packet; when it is determined not to be the last data fragment, caching the currently processed data fragment; returning to execute the operation of obtaining a currently processed data fragment in the target data block in turn, until the processing of all the data fragments that match the total number of data fragments is completed.
[0158] Of course, the storage medium containing computer-readable instructions provided in an embodiment of the present invention is not limited to the method operations described above, and can also execute related operations in the data cascade transmission method provided in any embodiment of the present invention.
[0159] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0160] It is worth noting that in the embodiment of the above-mentioned data cascade transmission device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific name of each functional unit is only for the convenience of distinguishing each other, and is not used to limit the scope of protection of the present invention.
[0161] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data cascade transmission method, executed by a sending node, characterized in that: include: When detecting that there is data to be sent, constructing a data package structure, and adding a node identifier of the sending node to the data package structure; According to the single data transmission amount of the sending node, at least one target data fragment is extracted from the data to be sent and filled into the data packet structure to form a target data packet, where the target data fragment is a complete or truncated data packet; Packaging the target data and sending the data through a data sending port; The target data group package includes: at least one data block organized in a cascade manner, each data block includes at least one target data fragment corresponding to the same receiving node address; According to the single data transmission amount of the sending node, at least one target data fragment is extracted from the data to be sent and filled into the data packet structure to form a target data packet, including: Acquire the remaining data transmission amount of the sending node, where the remaining data transmission amount is initialized to the single data transmission amount; Sequentially obtain currently processed data packets from the data to be sent, and detect whether the currently processed data packets meet the new data block storage condition; If yes, then creating a new target data block in the data group packaging structure; Fill in the target data block with the receiving node address of the currently processed data packet, the receiving node increment sequence number and the total number of initialized data fragments, and update the remaining data transmission amount; When it is determined that the data volume of the currently processed data packet is less than or equal to the remaining data transmission volume, at least one item of fragment description information corresponding to the currently processed data packet is filled in the target data block, and the currently processed data packet is filled in the target data block as a target data fragment, and the total number of data fragments is updated; After updating the remaining data transmission amount according to the fragment description information and the data amount of the currently processed data packet, returning to execute the operation of sequentially acquiring the currently processed data packets from the data to be sent; When it is determined that the data volume of the currently processed data packet is greater than the remaining data transmission volume, intercepting a target shortened data packet matching the remaining data transmission volume from the currently processed data packet, and storing the intercepted currently processed data packet again as the data to be transmitted; In the target data block, fill in at least one item of fragment description information corresponding to the target truncated data packet, and fill the target truncated data packet as a target data fragment in the target data block, and after updating the total number of data fragments, determine the data package structure currently filled as the target data package.
2. The method according to claim 1, characterized in that The at least one item of fragment description information corresponding to the currently processed data packet is: the segment length of the data packet, the location information of the data packet and the increasing sequence number of the data packet; Filling at least one item of fragment description information corresponding to the currently processed data packet in the target data block includes: If it is determined that the currently processed data packet is a complete data packet, then the segment length of the data packet is determined to be the data volume of the currently processed data packet, the location information of the data packet is the entire packet without segmentation, and the incremental sequence number of the data packet is increased by 1; If it is determined that the currently processed data packet is a truncated data packet, the segment length of the data packet is determined to be the data volume of the currently processed data packet, the location information of the data packet is the last packet of the segment, and the incremental sequence number of the data packet is increased by 1.
3. The method according to claim 1, characterized in that The at least one item of fragment description information corresponding to the target shortened data packet is: the segment length of the data packet, the location information of the data packet and the increasing sequence number of the data packet; Filling at least one item of fragment description information corresponding to the target shortened data packet in the target data block includes: If it is determined that the currently processed data packet is a complete data packet, then determining that the segment length of the data packet is the remaining data transmission amount, the location information of the data packet is the first packet of the segment, and the incrementing sequence number of the data packet remains unchanged; If it is determined that the currently processed data packet is a truncated data packet, the segment length of the data packet is determined to be the remaining data transmission amount, the location information of the data packet is a segmented middle packet, and the incremented sequence number of the data packet remains unchanged.
4. The method according to claim 1, characterized in that: After detecting whether the currently processed data packet meets the new data block storage condition, the method further includes: If not, when it is determined that the data volume of the currently processed data packet is less than or equal to the remaining data transmission volume, at least one item of fragment description information corresponding to the currently processed data packet is filled in the target data block, and the currently processed data packet is filled in the target data block as a target data fragment, and the total number of data fragments is updated; After updating the remaining data transmission amount according to the fragment description information and the data amount of the currently processed data packet, returning to execute the operation of sequentially acquiring the currently processed data packets from the data to be sent; When it is determined that the data volume of the currently processed data packet is greater than the remaining data transmission volume, intercepting a target shortened data packet matching the remaining data transmission volume from the currently processed data packet, and storing the intercepted currently processed data packet again as the data to be transmitted; In the target data block, fill in at least one item of fragment description information corresponding to the target truncated data packet, and fill the target truncated data packet as a target data fragment in the target data block, and after updating the total number of data fragments, determine the data package structure currently filled as the target data package.
5. A data cascade transmission method, executed by a receiving node, characterized in that: include: Upon receiving a target data group packet sent by a sending node in the data concatenation transmission method according to claim 1, detecting whether the target data group packet includes a target data block corresponding to the local node address; If yes, then obtaining the receiving node increment sequence number and the total number of data fragments recorded in the target data block; If it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received, then sequentially obtaining a currently processed data fragment in the target data block; If it is determined that the currently processed data segment is a complete data packet, the currently processed data segment is regarded as a data packet, and it is determined that the data packet is successfully received; If it is determined that the currently processed data fragment is a truncated data packet, then continue to determine whether the currently processed data fragment is the last data fragment of the target complete data packet; When it is determined to be the last data fragment, combining the last data fragment with the cached fragments for the target complete data packet to obtain the target complete data packet; When it is determined that the data slice is not the last one, cache processing is performed on the currently processed data slice; Return to execute the operation of sequentially obtaining a currently processed data slice in the target data block until the processing of all data slices matching the total number of data slices is completed.
6. The method according to claim 5, characterized in that After obtaining the receiving node increment sequence number and the total number of data fragments recorded in the target data block, the method further includes: If it is determined that the receiving node increment sequence number is not continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received, then sequentially obtaining a currently processed data fragment in the target data block; Obtaining an incrementing sequence number of the data packet of the currently processed data fragment; If it is determined that the increasing sequence number of the data packet is continuous with the increasing sequence number of the data packet of the data fragment, the target data block is discarded, and the data blocks corresponding to the increasing sequence number of the data packet are cleared; If it is determined that the increasing sequence number of the data packet is not continuous with the increasing sequence number of the data packet of the data fragment, then clearing the corresponding data block of the incomplete packet assembly; If it is determined that the currently processed data fragment is a complete data packet, the currently processed data fragment is regarded as a data packet, and it is determined that the data packet is successfully received; If it is determined that the currently processed data fragment is a truncated data packet, then continue to determine whether the currently processed data fragment is the first data fragment of the target complete data packet; When it is determined to be the first data fragment, cache the first data fragment and wait for the next data to be packaged; When it is determined that the data fragment is not the first data fragment, the currently processed data fragment is discarded; Return to execute the operation of sequentially obtaining a currently processed data slice in the target data block until the processing of all the data slices matching the total number of data slices is completed.
7. A data cascade transmission device, executed by a sending node, characterized in that: include: A node identification adding module is used to construct a data package structure when detecting the existence of data to be sent, and add the node identification of the sending node to the data package structure; A target data packet forming module is used to extract at least one target data fragment from the data to be sent and fill it into the data packet structure to form a target data packet according to the single data transmission amount of the sending node, wherein the target data fragment is a complete or truncated data packet; A data sending module, used for sending the target data group package through a data sending port; The target data group package includes: at least one data block organized in a cascade manner, each data block includes at least one target data fragment corresponding to the same receiving node address; The target data package consists of modules, including: a single data transmission amount determining unit, configured to obtain a remaining data transmission amount of the transmitting node, wherein the remaining data transmission amount is initialized as the single data transmission amount; A new data block storage condition detection unit, used to sequentially obtain currently processed data packets from the data to be sent, and detect whether the currently processed data packets meet the new data block storage condition; A target data block creation unit, configured to create a target data block in the data packet structure if the currently processed data packet meets a new data block storage condition; A remaining data transmission amount updating unit, used for filling the receiving node address of the currently processed data packet, the receiving node increment sequence number and the total number of initialized data fragments in the target data block, and updating the remaining data transmission amount; a total number of data fragments updating unit, configured to fill at least one item of fragment description information corresponding to the currently processed data packet in the target data block when determining that the data amount of the currently processed data packet is less than or equal to the remaining data transmission amount, fill the currently processed data packet as a target data fragment in the target data block, and update the total number of data fragments; a remaining data transmission amount updating unit, configured to update the remaining data transmission amount according to the fragment description information and the data amount of the currently processed data packet, and then return to execute the operation of sequentially acquiring the currently processed data packets from the data to be transmitted; The data storage unit for to-be-sent is used to intercept a target shortened data packet matching the remaining data transmission amount from the currently processed data packet when it is determined that the data amount of the currently processed data packet is greater than the remaining data transmission amount, and store the intercepted currently processed data packet again as the data to-be-sent; A target data packet determination unit is used to fill in at least one item of fragment description information corresponding to the target truncated data packet in the target data block, and fill the target truncated data packet as a target data fragment in the target data block, and after updating the total number of data fragments, determine the data packet structure currently filled as the target data packet.
8. A data cascade transmission device, executed by a receiving node, characterized in that: include: a target data block detection module, configured to detect whether the target data block corresponding to the local node address is included in the target data group packet when receiving the target data group packet sent by the sending node in the transmission method for executing the data cascade according to claim 1; A module for acquiring the increasing sequence number of receiving nodes and the total number of data fragments, for acquiring the increasing sequence number of receiving nodes and the total number of data fragments recorded in the target data block if the target data group package includes a target data block corresponding to the local node address; a currently processed data fragment acquisition module, configured to sequentially acquire a currently processed data fragment in the target data block if it is determined that the receiving node increment sequence number is continuous with the receiving node increment sequence number recorded in the previous data block in the previous data group packet received; A complete data packet processing module, configured to treat the currently processed data fragment as a data packet if it is determined that the currently processed data fragment is a complete data packet, and determine that the data packet is successfully received; A truncated data packet processing module, configured to, if it is determined that the currently processed data fragment is a truncated data packet, continue to determine whether the currently processed data fragment is the last data fragment of the target complete data packet; A module for obtaining a target complete data packet, for combining the last data fragment with the cached fragments for the target complete data packet to obtain the target complete data packet when the last data fragment is determined to be the last data fragment; A cache processing module, used for caching the currently processed data fragment when it is determined that it is not the last data fragment; The processing completion module is used to return to execute the operation of sequentially obtaining a currently processed data slice in the target data block until the processing of all data slices matching the total number of data slices is completed.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for transmitting the data cascade as described in any one of claims 1 to 4 is implemented, or the method for transmitting the data cascade as described in any one of claims 5 to 6 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for transmitting the data cascade as claimed in any one of claims 1 to 4 is implemented, or the method for transmitting the data cascade as claimed in any one of claims 5 to 6 is implemented.
Citation Information
Patent Citations
Data processing method and device, equipment and storage medium
CN112333238A
