Data slicing control method and device, storage medium and electronic device

By calculating the first slice length and the second slice length, combining the transmission properties of the target switching channel and the reception time interval of the data packet, the problem of low load balancing accuracy in the switching channel in the prior art is solved, and the data transmission efficiency is improved.

CN116418748BActive Publication Date: 2025-05-23NANJING CENTCO COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111670366.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-05-23
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In the prior art, the load balancing of the switching channel has low accuracy, resulting in a decrease in data transmission efficiency.

Method used

By determining the first shard length and the second shard length, combining the transmission attributes of the target switching channel and the reception time interval of the data packet, the target transmission status of the data stream in the switching channel is calculated, and whether to allow the continued transmission of the data packet.

Benefits of technology

Accurate load balancing of the data streams transmitted by the switching channel is realized, and data transmission efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116418748B_ABST
    Figure CN116418748B_ABST
Patent Text Reader

Abstract

The present invention discloses a control method and device for data slicing, a storage medium and an electronic device, wherein the method comprises: distributing the first data packet currently received and belonging to the target data stream to the target switching channel for transmission; determining the first slicing length according to the receiving time interval between the first data packet and the second data packet and the transmission attribute of the target switching channel; adding the first slicing length and the target slicing length to obtain the second slicing length; determining the target transmission state of the data stream in the target switching channel according to the relationship between the sum of the second slicing length and the data volume of the first data packet and the slicing length threshold corresponding to the target data stream. The above technical solution solves the problem of low accuracy in load balancing the data stream transmitted by the switching channel in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a method and device for controlling data slicing, a storage medium and an electronic device. Background Art

[0002] In order to improve the transmission efficiency of Ethernet switches, it is necessary to ensure load balancing of each switching channel so that the transmission efficiency will not be reduced due to congestion of some switching channels. Based on this, all data streams need to dynamically switch switching channels according to the maximum fragment length to ensure load balancing between each switching channel.

[0003] In the prior art, the commonly used implementation method of switching switching channels is to terminate the fragment length of the data stream through a counter or a timestamp to achieve the switching of the switching channel. On the one hand, if the data flow is large, a large number of counters are required, and this method has the disadvantages of consuming more logic resources and high maintenance costs; on the other hand, switching the switching channel through a timestamp or a counter may cause a large deviation in the system setting length of the switched data stream in the switching channel, affecting the normal function of the data stream exchange.

[0004] In summary, in the prior art, the switching of switching channels in load balancing is mainly achieved through simple calculations in the time domain. This method may not reflect the actual length of data on the switching channel, and the existing data in a switching channel may affect the calculation of the fragment length of other data streams, which may cause the switching channel to be switched incorrectly or not switched at all, affecting the normal transmission of data.

[0005] In view of the problems in the related art such as low accuracy in load balancing of data streams transmitted by switching channels, no effective solution has been proposed. Summary of the invention

[0006] The embodiments of the present invention provide a method and device for controlling data sharding, a storage medium, and an electronic device, so as to at least solve the problems of controlling data sharding in the related art.

[0007] According to an embodiment of the present invention, there is provided a method for controlling data fragmentation, comprising: distributing a currently received first data packet belonging to a target data stream to a target switching channel for transmission;

[0008] Determine a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel;

[0009] Adding the first fragment length and the target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate the historical accumulated data volume of the target switching channel;

[0010] According to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data stream, a target transmission state of the data stream in the target switching channel is determined, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data stream.

[0011] Optionally, determining the first fragment length according to a reception time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel includes:

[0012] Calculating the candidate fragment length according to the receiving time interval, the clock cycle of the target switching channel and the port rate of the target switching channel, wherein the transmission attributes of the target switching channel include: the clock cycle and the port rate;

[0013] The maximum value between the candidate fragment length and the data volume of the second data packet is determined as the first fragment length.

[0014] Optionally, the calculating the candidate fragment length according to the receiving time interval, the clock cycle of the target switching channel and the port rate of the target switching channel includes:

[0015] Obtaining a first timestamp from a packet descriptor of the first data packet, and obtaining a second timestamp from a packet descriptor of the second data packet;

[0016] Determine a time difference between the first timestamp and the second timestamp as the receiving time interval;

[0017] The product of the receiving time interval, the clock cycle and the port rate is determined as the candidate fragment length.

[0018] Optionally, determining the target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and a fragment length threshold corresponding to the target data flow includes:

[0019] In the case where the sum is less than the fragment length threshold, determining the target transmission state to indicate that the target switching channel is allowed to continue transmitting data packets for the target data flow;

[0020] In a case where the sum is greater than or equal to the fragment length threshold, determining the target transmission state is used to indicate that the target switching channel is not allowed to continue transmitting data packets for the target data flow.

[0021] Optionally, before determining the target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data flow, the method further includes:

[0022] Acquire a maximum fragment length preset for the target data stream in the target switching channel and a starting fragment length corresponding to the target data stream, wherein the starting fragment length is used to indicate a cumulative data volume when a starting data packet of the target data stream is transmitted on the target switching channel;

[0023] The sum of the maximum fragment length and the starting fragment length is determined as a fragment length threshold corresponding to the target data stream.

[0024] Optionally, after determining the target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data flow, the method further includes:

[0025] In a case where the target transmission state is used to indicate that the target switching channel is allowed to continue transmitting data packets for the target data flow, updating the target fragment length to the second fragment length;

[0026] In a case where the target transmission state is used to indicate that the target switching channel is not allowed to continue transmitting data packets for the target data flow, the target segment length is cleared.

[0027] Optionally, distributing the currently received first data packet belonging to the target data flow to the target switching channel for transmission includes:

[0028] receiving the first data packet, and determining the target data flow to which the first data packet belongs;

[0029] Acquire a switching channel for transmitting a third data packet as a candidate switching channel, wherein the third data packet is a data packet transmitted before the first data packet on the target data flow;

[0030] When the transmission state corresponding to the target data flow on the candidate switching channel allows the target switching channel to continue transmitting data packets for the target data flow, the first data packet is distributed to the target switching channel for transmission.

[0031] According to another embodiment of the present invention, there is also provided a control device for data slicing, comprising: a transmission module, configured to distribute a currently received first data packet belonging to a target data stream to a target switching channel for transmission;

[0032] A first determining module, configured to determine a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel;

[0033] A processing module, configured to add the first fragment length and a target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate a historical accumulated data volume of the target switching channel;

[0034] A second determining module is used to determine a target transmission state of the data flow in the target switching channel according to a relationship between a sum of the second fragment length and the data volume of the first data packet and a fragment length threshold corresponding to the target data flow, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data flow.

[0035] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned data segmentation control method when running.

[0036] According to another aspect of an embodiment of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the data slicing control method through the computer program.

[0037] In an embodiment of the present invention, a first data packet currently received and belonging to a target data stream is distributed to a target switching channel for transmission; a first slice length is determined according to a receiving time interval between the first data packet and a second data packet and a transmission attribute of the target switching channel, wherein the first slice length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel; the first slice length is added to the target slice length to obtain a second slice length, wherein the target slice length is used to indicate the historical accumulated data amount of the target switching channel; a target transmission state of the data stream in the target switching channel is determined according to a relationship between a sum of the second slice length and the amount of data of the first data packet and a slice length threshold corresponding to the target data stream, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data stream, The first data packet belonging to the target data stream that is to be received is distributed to the target switching channel for transmission, and then the amount of data allowed to be transmitted by the target switching channel within the receiving time interval is determined as the first slice length according to the receiving time interval of the first data packet and the previous data packet of the first data packet transmitted by the target switching channel, the first slice length and the historical accumulated data volume of the target switching channel are accumulated to obtain the second slice length, and according to the relationship between the sum of the second slice length and the data stream of the first data packet and the slice length threshold corresponding to the target data stream, it is determined whether to allow the target switching channel to continue to transmit data packets for the target data stream, so as to realize the conversion of the receiving time interval of two consecutive packet descriptors in the target switching channel to the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, consider the mutual influence between the data volumes of each data stream in the switching channel, and accurately realize the load balancing of the data stream transmitted by the switching channel. The above technical scheme solves the problems of low accuracy of load balancing of the data stream transmitted by the switching channel in the related technology, and realizes the technical effect of improving the accuracy of load balancing of the data stream transmitted by the switching channel. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0039] Figure 1 It is a hardware structure block diagram of a computer terminal of a data slicing control method according to an embodiment of the present invention;

[0040] Figure 2 is a flow chart of a method for controlling data sharding according to an embodiment of the present invention;

[0041] Figure 3is a schematic diagram of a data sharding method process according to an embodiment of the present invention;

[0042] Figure 4 is a schematic diagram of a time-to-byte converter according to an embodiment of the present invention;

[0043] Figure 5 It is a structural block diagram of a data slicing device according to an embodiment of the present invention. DETAILED DESCRIPTION

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

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

[0046] The method embodiments provided in the embodiments of the present invention can be executed in a computer terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal of a data slicing control method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.

[0047] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the control method of data slicing in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 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.

[0048] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0049] In this embodiment, a data slicing control method is provided, which is applied to the above-mentioned computer terminal. Figure 2 1 is a flow chart of a method for controlling data sharding according to an embodiment of the present invention, and the flow chart includes the following steps:

[0050] Step S202, distributing the currently received first data packet belonging to the target data flow to the target switching channel for transmission;

[0051] Step S204, determining a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel;

[0052] Step S206, adding the first fragment length and the target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate the historical accumulated data volume of the target switching channel;

[0053] Step S208: determining a target transmission state of the data stream in the target switching channel according to a relationship between a sum of the second fragment length and the data volume of the first data packet and a fragment length threshold corresponding to the target data stream, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data stream.

[0054] Through the above steps, the received first data packet belonging to the target data flow is distributed to the target switching channel for transmission, and then the amount of data allowed to be transmitted by the target switching channel within the receiving time interval is determined as the first slice length according to the receiving time interval of the first data packet and the previous data packet of the first data packet transmitted by the target switching channel, the first slice length and the historical accumulated data volume of the target switching channel are accumulated to obtain the second slice length, and according to the relationship between the sum of the second slice length and the data flow of the first data packet and the slice length threshold corresponding to the target data flow, it is determined whether to allow the target switching channel to continue to transmit data packets for the target data flow, so as to realize the conversion of the receiving time interval of two consecutive packet descriptors in the target switching channel to the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, consider the mutual influence between the data volumes of each data flow in the switching channel, and accurately realize the load balancing of the data flow transmitted by the switching channel. The above technical scheme solves the problems of low accuracy of load balancing of the data flow transmitted by the switching channel in the related technology, and realizes the technical effect of improving the accuracy of load balancing of the data flow transmitted by the switching channel.

[0055] In the technical solution provided in the above step S202, if a first data packet to be transmitted is received, the target data stream to which the first data packet belongs can be determined first but is not limited to, and then the first data packet is distributed to the target switching channel of the last transmission target data stream for transmission.

[0056] In an exemplary embodiment, the currently received first data packet belonging to the target data stream can be distributed to the target switching channel for transmission in the following manner, but is not limited to: receiving the first data packet and determining the target data stream to which the first data packet belongs; obtaining a switching channel for transmitting a third data packet as a candidate switching channel, wherein the third data packet is a data packet transmitted before the first data packet on the target data stream; and distributing the first data packet to the target switching channel for transmission when the transmission state corresponding to the target data stream on the candidate switching channel is to allow the target switching channel to continue transmitting data packets for the target data stream.

[0057] Optionally, in this embodiment, if a first data packet belonging to a target data stream is received, and the target switching channel last transmitted a data packet belonging to the target data stream, if the target switching channel is allowed to continue transmitting data packets of the target data stream, the first data packet may be distributed to the target switching channel for transmission, but is not limited to.

[0058] In the technical solution provided in the above step S204, the amount of data allowed to be transmitted by the target switching channel within the receiving time interval can be determined, but is not limited to, based on the receiving time interval between the first data packet and the previous data packet of the first data packet transmitted by the target switching channel and the transmission attribute of the target switching channel.

[0059] In an exemplary embodiment, the first fragment length can be determined in the following manner, but is not limited to: calculating a candidate fragment length according to the receiving time interval, the clock cycle of the target switching channel, and the port rate of the target switching channel, wherein the transmission attributes of the target switching channel include: the clock cycle and the port rate; and determining the maximum value between the candidate fragment length and the data volume of the second data packet as the first fragment length.

[0060] Optionally, in this embodiment, the product of the receiving time interval between the first data packet and the second data packet, the clock cycle of the target switching channel, and the port rate of the target switching channel can be used as a candidate fragmentation length, but is not limited to it. Then, the candidate fragmentation length is compared with the data volume of the previous data packet transmitted by the target switching channel, and the maximum of the two is taken as the first fragmentation length.

[0061] In an exemplary embodiment, the candidate fragment length can be calculated by, but is not limited to, the following method: obtaining a first timestamp from a packet descriptor of the first data packet, and obtaining a second timestamp from a packet descriptor of the second data packet; determining the time difference between the first timestamp and the second timestamp as the receiving time interval; and determining the product of the receiving time interval, the clock cycle, and the port rate as the candidate fragment length.

[0062] Optionally, in this embodiment, the packet descriptor of the data packet may include, but is not limited to, a timestamp of when the data packet is received, and a first timestamp of the first data packet and a second timestamp of the second data packet are subtracted to obtain the time difference between the two timestamps as the receiving time interval, and then the product of the receiving time interval, the clock cycle, and the port rate is determined as the candidate fragment length.

[0063] In the technical solution provided in the above step S206, the second fragment length can be obtained by adding the first fragment length and the historical cumulative data volume of the target switching channel, but is not limited to, the historical cumulative data volume of the target switching channel can include but is not limited to the data volume of each data stream cumulatively transmitted from the start of data packet transmission to the present.

[0064] In the technical solution provided in the above step S208, it is possible but not limited to determine whether to allow the target switching channel to continue transmitting data packets for the target data stream as the target transmission state of the target data stream based on the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data stream.

[0065] In an exemplary embodiment, the target transmission state of the data flow in the target switching channel may be determined in the following manner, but is not limited to: when the sum value is less than the fragment length threshold, the target transmission state is determined to indicate that the target switching channel is allowed to continue to transmit data packets for the target data flow; when the sum value is greater than or equal to the fragment length threshold, the target transmission state is determined to indicate that the target switching channel is not allowed to continue to transmit data packets for the target data flow.

[0066] Optionally, in this embodiment, if the sum of the second fragment length and the data volume of the first data packet is less than the fragment length threshold, the target switching channel is allowed to continue transmitting data packets for the target data stream. In this case, the target switching channel is still capable of transmitting data packets of the target data stream. If a data packet belonging to the target data stream is received next time, the data packet will be directly distributed to the target switching channel for transmission.

[0067] Optionally, in this embodiment, if the sum of the second fragment length and the data volume of the first data packet is greater than or equal to the fragment length threshold, the target switching channel is not allowed to continue transmitting data packets for the target data stream, and the target switching channel is no longer able to continue transmitting data packets for the target data stream. If a data packet of the target data stream is received next time, the data packet will be distributed to switching channels other than the target switching channel for transmission, thereby achieving load balancing of the transmission data streams between the various switching channels.

[0068] In an exemplary embodiment, the fragment length threshold corresponding to the target data stream can be determined in the following manner, but is not limited to: obtaining a maximum fragment length preset for the target data stream in the target switching channel and a starting fragment length corresponding to the target data stream, wherein the starting fragment length is used to indicate the cumulative data volume when the starting data packet of the target data stream is transmitted on the target switching channel; and determining the sum of the maximum fragment length and the starting fragment length as the fragment length threshold corresponding to the target data stream.

[0069] Optionally, in this embodiment, the maximum fragment length preset for each data stream in the target switching channel may be, but is not limited to, a consistent, partially identical or different absolute value. For example, the maximum fragment length of data stream 1 may be, but is not limited to, 10,000 bytes, and the maximum fragment length of data stream 2 may be, but is not limited to, 13,000 bytes. The sum of the maximum fragment length of each data stream and the cumulative data volume when the start data packet of each data stream is transmitted on the target switching channel is used as the fragment length threshold of each data stream.

[0070] In an exemplary embodiment, the target fragment length may be updated in the following manner, but is not limited to: when the target transmission state is used to indicate that the target switching channel is allowed to continue to transmit data packets for the target data stream, the target fragment length is updated to the second fragment length; when the target transmission state is used to indicate that the target switching channel is not allowed to continue to transmit data packets for the target data stream, the target fragment length is cleared.

[0071] Optionally, in this embodiment, if the target switching channel is allowed to continue transmitting data packets for the target data stream, the target fragment length may be updated to a second fragment length, but is not limited to, to calculate and determine whether to allow the target switching channel to continue transmitting the next data packet for the target data stream when a data packet of the target data stream is subsequently received.

[0072] Optionally, in this embodiment, if the target switching channel is not allowed to continue transmitting data packets for the target data stream, the target fragment length may be cleared to zero, and an end mark may be added to the data stream. If a data packet of the target data stream is subsequently received, the data packet may be directly distributed to switching channels other than the target switching channel for transmission, without having to determine again through the above algorithm whether the target switching channel is allowed to continue transmitting data packets for the target data stream, thereby achieving load balancing among the switching channels.

[0073] In order to better understand the process of the above data sharding method, the implementation method flow of the above data sharding is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present invention.

[0074] In this embodiment, a data sharding method is provided. Figure 3 Schematic diagram of a data sharding method according to an embodiment of the present invention. Figure 3 As shown, the specific steps include:

[0075] Step S301: Based on the data flow Flow Id (Flow Identity document) of the packet descriptor, the switching state of the data flow is obtained by looking up the table. If the data packet is the first packet of the current data flow N fragments, the packet length and timestamp of the current data packet are recorded (the timestamp can be but is not limited to nanoseconds) as the starting point for calculating the fragment length of the current data flow N, and the data packet is marked as SoF (Start of Fragment). If it is not the first packet, only the packet length and timestamp of the current data packet need to be recorded for use in the descriptor calculation of the next packet in the switching channel;

[0076] Step S302: Calculate the conversion of time domain to byte domain. When there is a packet descriptor of the second data packet in the switching channel M, record the timestamp of the data packet. The timestamp can be but not limited to nanoseconds. Subtract the timestamp of the current data packet from the timestamp of the previous packet descriptor in the switching channel M. The obtained time domain can represent the time interval between the two packet descriptors in the switching channel M. The time interval can be converted from the time domain to the byte domain in the following manner, but not limited to: the actual link rate of the switching channel M can be but not limited to 100 Gbps, and the port rate of the switching channel can be but not limited to 100 Gbps. Then the formula for converting the above time interval from the time domain to the number of bytes can be but not limited to: (T1-T0)*clock cycle (nanoseconds)*port rate of the switching channel (bits) / (nanoseconds), wherein the clock cycle is the reciprocal of the data processing main frequency, the nanosecond in the brackets is the unit of the clock cycle, and the port rate of the switching channel can be but not limited to bits per nanosecond. The calculated result is the candidate fragment length;

[0077] Step S303: Calculate the time domain and packet descriptor length. Compare the result obtained after the time domain conversion in step S302 with the packet length of the previous packet descriptor in terms of bytes, and take the maximum value of the two as the actual link length in the switching channel M (i.e., the first fragment length). Figure 4 is a schematic diagram of a time-to-byte converter according to an embodiment of the present invention, such as Figure 4As shown, two consecutive packet descriptors from T0 to T1 in the same switching channel M are packet descriptors numbered 1 of data flow Flow0 and packet descriptors numbered 1 of data flow FlowN. The packet length corresponding to the data packet numbered 1 of data flow Flow0 is 512 bytes, and the corresponding timestamp T0=1000 nanoseconds, the corresponding timestamp T1=1100 nanoseconds of data flow N, the data processing main frequency is 1GHz, then the clock cycle is 1 nanosecond, the port rate of the switching channel is 100Gbps, and the calculation formula for converting the time domain from T0 to T1 to the byte domain is: TBC (Time to Byte Converter)=(T1-T0)*clock cycle (nanoseconds)*port rate of the switching channel (bits) / (nanoseconds)=1250 bytes. Since the calculated value of the calculation result TBC from T0 to T1 is greater than the packet length of the data flow Flow0 at time T0, the TBC calculation result 1250 bytes is taken as the first fragment length, and the first fragment length 1250 bytes and the fragment length of each data flow are accumulated, which reflects that the various data flows in the switching channel affect each other. The first fragment length 1250 bytes and the target fragment length are accumulated to obtain the second fragment length. The above method is used to calculate the second fragment length value for two consecutive packet descriptors in the switching channel;

[0078] Step S304: the maximum fragmentation length termination fragmentation strategy, after completing the conversion from the time domain to the byte domain, by selecting the time interval and the number of bytes of the packet length actually expanded in the switching channel M, the sum of the second fragmentation length obtained in the above step S303 and the packet length of the packet descriptor of the current data packet is compared with the fragmentation length threshold to determine whether the fragmentation length threshold corresponding to the data flow is reached. If the sum of the second fragmentation length and the packet length in the packet descriptor of the current data flow is less than the fragmentation length threshold of the current data flow, the packet length of the current packet descriptor is not included in the target fragmentation length accumulated by the switching channel. If the sum of the second fragmentation length and the packet length in the packet descriptor of the current data flow is greater than or equal to the fragmentation length threshold, the packet descriptor of the current data flow is marked as EoF (End of Fragment, the last packet identifier of the maximum fragmentation length of the data flow);

[0079] Step S305: Scan and terminate the maximum fragment of the non-online data flow. The above step S304 can terminate the data fragmentation of the online data flow. The fragmentation status of N data flows in the switching channel M needs to be recorded by table entries. The maximum fragmentation length of other non-online data flows is terminated by adding a table entry scanning mechanism. The non-online data flows are calculated from the starting point SoF of each fragment. When the pointer scans the corresponding data flow, if the fragmentation length of the data flow has reached the fragmentation length threshold, the corresponding data flow will be marked with offline EoF. If a data packet of the data flow marked as offline EoF is received later, the switching channel is directly switched. If the fragmentation length of the data flow does not reach the fragmentation length threshold, the corresponding data flow will not be terminated.

[0080] Step S306: Aging the maximum fragment of all data streams in the termination channel. If there is no new data stream in the switching channel M for a period of time, the data fragments of all data streams in the current switching channel M can be terminated through but not limited to the aging mechanism, that is, the fragment lengths of all data streams in the switching channel M are reset to zero.

[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course 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 is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.

[0082] Figure 5 is a structural block diagram of a data slicing device according to an embodiment of the present invention; Figure 5 As shown, including:

[0083] The transmission module 52 is used to distribute the first data packet currently received and belonging to the target data flow to the target switching channel for transmission;

[0084] A first determining module 54 is configured to determine a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel;

[0085] A processing module 56, configured to add the first fragment length and a target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate a historical accumulated data volume of the target switching channel;

[0086] The second determining module 58 is used to determine the target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data flow, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue to transmit data packets for the target data flow.

[0087] Through the above embodiment, the received first data packet belonging to the target data flow is distributed to the target switching channel for transmission, and then the amount of data allowed to be transmitted by the target switching channel within the receiving time interval is determined as the first slice length according to the receiving time interval of the first data packet and the previous data packet of the first data packet transmitted by the target switching channel, the first slice length and the historical accumulated data volume of the target switching channel are accumulated to obtain the second slice length, and according to the relationship between the sum of the second slice length and the data flow of the first data packet and the slice length threshold corresponding to the target data flow, it is determined whether to allow the target switching channel to continue to transmit data packets for the target data flow, so as to realize the conversion of the receiving time interval of two consecutive packet descriptors in the target switching channel to the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, consider the mutual influence between the data volumes of each data flow in the switching channel, and accurately realize the load balancing of the data flow transmitted by the switching channel. The above technical scheme solves the problems of low accuracy of load balancing of the data flow transmitted by the switching channel in the related art, and realizes the technical effect of improving the accuracy of load balancing of the data flow transmitted by the switching channel.

[0088] In an exemplary embodiment, the first determining module includes:

[0089] A calculation unit, configured to calculate the candidate fragment length according to the receiving time interval, the clock cycle of the target switching channel and the port rate of the target switching channel, wherein the transmission attributes of the target switching channel include: the clock cycle and the port rate;

[0090] The first determining unit is used to determine the maximum value between the candidate fragment length and the data volume of the second data packet as the first fragment length.

[0091] In an exemplary embodiment, the computing unit is configured to:

[0092] Obtaining a first timestamp from a packet descriptor of the first data packet, and obtaining a second timestamp from a packet descriptor of the second data packet;

[0093] Determine a time difference between the first timestamp and the second timestamp as the receiving time interval;

[0094] The product of the receiving time interval, the clock cycle and the port rate is determined as the candidate fragment length.

[0095] In an exemplary embodiment, the second determining module includes:

[0096] a second determining unit, configured to determine, when the sum value is less than the fragment length threshold, that the target transmission state is used to indicate that the target switching channel is allowed to continue transmitting data packets for the target data stream;

[0097] The third determining unit is configured to determine, when the sum is greater than or equal to the fragment length threshold, that the target transmission state is used to indicate that the target switching channel is not allowed to continue transmitting data packets for the target data flow.

[0098] In an exemplary embodiment, the apparatus further comprises:

[0099] an acquisition module, configured to acquire a maximum fragment length preset for the target data stream in the target switching channel and a starting fragment length corresponding to the target data stream before determining the target transmission state of the data stream in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and a fragment length threshold corresponding to the target data stream, wherein the starting fragment length is used to indicate the cumulative data volume when the starting data packet of the target data stream is transmitted on the target switching channel;

[0100] The third determining module is used to determine the sum of the maximum fragment length and the starting fragment length as the fragment length threshold corresponding to the target data stream.

[0101] In an exemplary embodiment, the apparatus further comprises:

[0102] an updating module, configured to, after determining a target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data flow, update the target fragment length to the second fragment length if the target transmission state is used to indicate that the target switching channel is allowed to continue transmitting data packets for the target data flow;

[0103] The clearing module is used to clear the target fragment length when the target transmission state indicates that the target switching channel is not allowed to continue to transmit data packets for the target data flow.

[0104] In an exemplary embodiment, the transmission module includes:

[0105] a fourth determining unit, configured to receive the first data packet and determine the target data flow to which the first data packet belongs;

[0106] an acquiring unit, configured to acquire a switching channel for transmitting a third data packet as a candidate switching channel, wherein the third data packet is a data packet transmitted before the first data packet on the target data flow;

[0107] The transmission unit is configured to distribute the first data packet to the target switching channel for transmission when the transmission state corresponding to the target data flow on the candidate switching channel allows the target switching channel to continue transmitting data packets for the target data flow.

[0108] An embodiment of the present invention further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0109] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0110] S1, distribute the first data packet currently received belonging to the target data flow to the target switching channel for transmission;

[0111] S2, determining a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel;

[0112] S3, adding the first fragment length and the target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate the historical accumulated data volume of the target switching channel;

[0113] S4, determining a target transmission state of the data flow in the target switching channel according to a relationship between a sum of the second fragment length and the data volume of the first data packet and a fragment length threshold corresponding to the target data flow, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data flow.

[0114] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0115] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0116] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0117] S1, distribute the first data packet currently received belonging to the target data flow to the target switching channel for transmission;

[0118] S2, determining a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel;

[0119] S3, adding the first fragment length and the target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate the historical accumulated data volume of the target switching channel;

[0120] S4, determining a target transmission state of the data flow in the target switching channel according to a relationship between a sum of the second fragment length and the data volume of the first data packet and a fragment length threshold corresponding to the target data flow, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data flow.

[0121] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0122] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0123] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for controlling data sharding, It is characterized in that include: Distributing the currently received first data packet belonging to the target data stream to the target switching channel for transmission; Determine a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel; Adding the first fragment length and the target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate the historical accumulated data volume of the target switching channel; According to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data stream, a target transmission state of the data stream in the target switching channel is determined, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data stream.

2. The method according to claim 1, It is characterized in that The determining of the first fragment length according to the receiving time interval between the first data packet and the second data packet and the transmission attribute of the target switching channel includes: Calculating the candidate fragment length according to the receiving time interval, the clock cycle of the target switching channel and the port rate of the target switching channel, wherein the transmission attributes of the target switching channel include: the clock cycle and the port rate; The maximum value between the candidate fragment length and the data volume of the second data packet is determined as the first fragment length.

3. The method according to claim 2, It is characterized in that The calculating the candidate fragment length according to the receiving time interval, the clock cycle of the target switching channel and the port rate of the target switching channel comprises: Obtaining a first timestamp from a packet descriptor of the first data packet, and obtaining a second timestamp from a packet descriptor of the second data packet; Determine a time difference between the first timestamp and the second timestamp as the receiving time interval; The product of the receiving time interval, the clock cycle and the port rate is determined as the candidate fragment length.

4. The method according to claim 1, It is characterized in that Determining the target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data flow includes: In the case where the sum is less than the fragment length threshold, determining the target transmission state to indicate that the target switching channel is allowed to continue transmitting data packets for the target data flow; In a case where the sum is greater than or equal to the fragment length threshold, determining the target transmission state is used to indicate that the target switching channel is not allowed to continue transmitting data packets for the target data flow.

5. The method according to claim 1, It is characterized in that Before determining the target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data flow, the method further includes: Acquire a maximum fragment length preset for the target data stream in the target switching channel and a starting fragment length corresponding to the target data stream, wherein the starting fragment length is used to indicate a cumulative data volume when a starting data packet of the target data stream is transmitted on the target switching channel; The sum of the maximum fragment length and the starting fragment length is determined as a fragment length threshold corresponding to the target data stream.

6. The method according to claim 1, It is characterized in that After determining the target transmission state of the data flow in the target switching channel according to the relationship between the sum of the second fragment length and the data volume of the first data packet and the fragment length threshold corresponding to the target data flow, the method further includes: In a case where the target transmission state is used to indicate that the target switching channel is allowed to continue transmitting data packets for the target data flow, updating the target fragment length to the second fragment length; In a case where the target transmission state is used to indicate that the target switching channel is not allowed to continue transmitting data packets for the target data flow, the target segment length is cleared.

7. The method according to claim 1, It is characterized in that The step of distributing the currently received first data packet belonging to the target data flow to the target switching channel for transmission includes: receiving the first data packet, and determining the target data flow to which the first data packet belongs; Acquire a switching channel for transmitting a third data packet as a candidate switching channel, wherein the third data packet is a data packet transmitted before the first data packet on the target data flow; When the transmission state corresponding to the target data flow on the candidate switching channel allows the target switching channel to continue transmitting data packets for the target data flow, the first data packet is distributed to the target switching channel for transmission.

8. A data sharding control device, It is characterized in that include: A transmission module, used to distribute the currently received first data packet belonging to the target data flow to the target switching channel for transmission; A first determining module, configured to determine a first fragment length according to a receiving time interval between the first data packet and the second data packet and a transmission attribute of the target switching channel, wherein the first fragment length is used to indicate the amount of data allowed to be transmitted by the target switching channel within the receiving time interval, and the second data packet is a data packet preceding the first data packet transmitted by the target switching channel; A processing module, configured to add the first fragment length and a target fragment length to obtain a second fragment length, wherein the target fragment length is used to indicate a historical accumulated data volume of the target switching channel; A second determining module is used to determine a target transmission state of the data flow in the target switching channel according to a relationship between a sum of the second fragment length and the data volume of the first data packet and a fragment length threshold corresponding to the target data flow, wherein the target transmission state is used to indicate whether the target switching channel is allowed to continue transmitting data packets for the target data flow.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Data transmission method and device

    CN110636554A

  • Flow control method, device and system and storage medium

    CN113300983A