Method, apparatus, device, storage medium and program product for data transmission
By adjusting the MTU value in real time, this technology addresses the problem that existing technologies cannot adapt to real-time changes in the network environment. It achieves matching of data slice size with the current network environment and improves data transmission quality.
Patent Information
- Application Number
- CN202411720242.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-11-27
AI Technical Summary
In existing technologies, fixed MTU values cannot adapt to real-time changing network environments, resulting in data slice sizes that are unsuitable for current network conditions and affecting data transmission quality.
By adjusting the MTU value in real time and dynamically calculating the target sampling frequency based on network resource information such as packet loss rate, CPU utilization, and transmission latency, data transmission can be achieved.
This technology improves network transmission quality by adjusting the MTU value in real time based on network resource information.
Smart Images

Figure CN119520425B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data transmission, and particularly relates to a data transmission method, device, equipment, storage medium and program product. BACKGROUND
[0002] In the data transmission process, in order to reduce the transmission delay and the packet loss rate in the transmission process, the sending node in the communication network can segment a large data packet to obtain a plurality of small data slices, and transmit the segmented slices.
[0003] Specifically, the sending node can segment the data packet according to a pre-configured maximum transmission unit (MTU). However, since the network environment is changing in real time, the network quality is unstable, and the segmented slices obtained by segmenting the data packet according to the pre-configured MTU will have the problem of being too large or too small relative to the real-time network environment, thereby causing the data transmission quality to deteriorate. SUMMARY
[0004] The embodiments of the present application provide a data transmission method, device, equipment, storage medium and program product. The MTU value can be adjusted in real time, and the data transmission quality is improved.
[0005] In a first aspect, the embodiments of the present application provide a data transmission method applied to a sending node, and the method comprises:
[0006] obtaining network resource information of the sending node according to a preset sampling frequency, wherein the network resource information is used to represent the network quality corresponding to the network to which the sending node belongs, and the preset sampling frequency is calculated by the sending node according to historical network resource information of the sending node;
[0007] calculating a maximum transmission unit (MTU) value corresponding to the sending node according to the network resource information;
[0008] performing slice processing on the data to be transmitted according to the MTU to obtain a first data slice;
[0009] sending the first data slice to a receiving node.
[0010] In a possible implementation manner, after the network resource information of the sending node is obtained according to the preset sampling frequency, the method further comprises:
[0011] calculating a target sampling frequency corresponding to the sending node according to the network resource information;
[0012] taking the target sampling frequency as the preset sampling frequency.
[0013] In one possible implementation, the network resource information includes packet loss rate and CPU utilization; calculating the target sampling frequency corresponding to the sending node according to the network resource information includes:
[0014] Calculate the baseline sampling function based on the packet loss rate;
[0015] Calculate the sampling discount function based on the CPU utilization rate;
[0016] The target sampling frequency is obtained by calculating the product of the baseline sampling function and the sampling discount function.
[0017] In one possible implementation, calculating the baseline sampling function based on the packet loss rate includes:
[0018] The reference sampling function is calculated according to the following formula:
[0019]
[0020] in, or,
[0021] Where T1(r) is the reference sampling function, r is the packet loss rate, and t l t is the lower limit threshold of the target sampling frequency. u This is the upper limit threshold of the target sampling frequency. This is the preset packet loss rate threshold.
[0022] In one possible implementation, calculating the sampling discount function based on the CPU utilization includes:
[0023] The sampling discount function is calculated according to the following formula:
[0024]
[0025] Where T2(c) is the sampling discount function, and c is the CPU utilization rate. λ is a preset parameter. This is a preset CPU utilization threshold.
[0026] In one possible implementation, the network resource information includes packet loss rate, CPU utilization, and transmission latency; the step of calculating the maximum transmission unit (MTU) value corresponding to the sending node based on the network resource information includes:
[0027] Calculate the baseline function based on the packet loss rate;
[0028] Calculate the first discount function based on the CPU utilization rate;
[0029] calculating a second discount function according to the transmission delay;
[0030] calculating a product of the reference sampling function, the first discount function and the second discount function to obtain the MTU value.
[0031] In a possible implementation, the calculating the reference function according to the packet loss rate comprises:
[0032] The reference function is calculated according to the following formula:
[0033]
[0034] wherein M1(r) is the reference function, L represents a preset threshold, L is a preset packet loss rate threshold, r is the packet loss rate, and U is the size of the data to be transmitted.
[0035] In a possible implementation, the calculating the first discount function according to the CPU usage rate comprises:
[0036] The first discount function is calculated according to the following formula:
[0037]
[0038] wherein, or
[0039] wherein M2(c) is the first discount function, L is a preset CPU usage rate threshold, and c is the CPU usage rate.
[0040] In a possible implementation, the calculating the second discount function according to the transmission delay comprises:
[0041] The second discount function is calculated according to the following formula:
[0042]
[0043]
[0044] wherein M3(t) is the second discount function, and t is the transmission delay.
[0045] In a possible implementation, the first data slice quantity is a plurality of; after the data slice is obtained by performing the slicing processing on the data to be transmitted according to the MTU, the method further comprises:
[0046] receiving a retransmission instruction fed back by the receiving node, the retransmission instruction comprising a target data slice identifier;
[0047] in a case where target data corresponding to the target data slice identifier is greater than the MTU value, slicing the target data corresponding to the target data slice identifier according to the MTU value to obtain retransmission data slices;
[0048] sending the retransmission data slices to the receiving node.
[0049] In a possible implementation, the method further comprises:
[0050] receiving a plurality of second data slices sent by nodes other than the sending node in a network to which the sending node belongs;
[0051] obtaining data block identifiers in each second data slice;
[0052] for each data block identifier, constructing a storage queue and an aggregation queue corresponding to the data block identifier;
[0053] storing each second data slice into a storage queue corresponding to a data block identifier of the second data slice according to the data block identifier of the second data slice;
[0054] for each storage queue, obtaining slice identifiers in each second data slice in the storage queue;
[0055] for each storage queue, storing second data slices in the storage queue into the aggregation queue in an order of the slice identifiers in each second data slice;
[0056] for each aggregation queue, obtaining slice quantity information in second data slices in the aggregation queue;
[0057] for each aggregation queue, in a case where the slice quantity information and a maximum value of slice identifiers in the aggregation queue are the same, aggregating the second data slices in the aggregation queue to obtain transmission data.
[0058] In a second aspect, an embodiment of the present application provides a data transmission apparatus applied to a sending node, the apparatus comprising:
[0059] an obtaining module configured to obtain network resource information of the sending node according to a preset sampling frequency, the network resource information being used to represent network quality of a network to which the sending node belongs, and the preset sampling frequency being calculated by the sending node according to historical network resource information of the sending node;
[0060] a calculation module, configured to calculate a maximum transmission unit (MTU) value corresponding to the sending node according to the network resource information;
[0061] a slicing module, configured to slice the data to be transmitted according to the MTU, to obtain a first data slice;
[0062] a sending module, configured to send the first data slice to a receiving node.
[0063] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a processor and a memory storing computer program instructions;
[0064] The processor implements the method of data transmission according to any one of the first aspect when executing the computer program instructions.
[0065] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method of data transmission according to any one of the first aspect.
[0066] In a fifth aspect, an embodiment of the present application provides a computer program product, and instructions in the computer program product are executed by a processor of an electronic device to enable the electronic device to perform the method of data transmission according to any one of the first aspect.
[0067] The method, device, equipment, storage medium and program product provided by the embodiments of the present application, the sending node obtains network resource information of the sending node according to a preset sampling frequency, wherein the network resource information can reflect network quality corresponding to a network where the sending node is located, and then the MTU value corresponding to the sending node can be calculated according to the network resource information. In this way, since the preset sampling frequency is calculated by the sending node according to historical network resource information, that is, the sending node dynamically updates the MTU value of the sending node according to the network resource information according to the preset sampling frequency. Therefore, it is ensured that the dynamically updated MTU value can conform to the network environment of the current sending node. The sending node slices the data to be transmitted according to the calculated MTU value, and the size of the obtained first data slice conforms to the network environment where the sending node is located, thereby improving the data transmission quality of the network. BRIEF DESCRIPTION OF DRAWINGS
[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. For those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0069] Figure 1is a flowchart of a method for data transmission provided by an embodiment of the present application;
[0070] Figure 2 is a flowchart of a method for preset sampling frequency calculation provided by an embodiment of the present application;
[0071] Figure 3 is a function diagram of a reference sampling function provided by an embodiment of the present application;
[0072] Figure 4 is a function diagram of a sampling discount function provided by an embodiment of the present application;
[0073] Figure 5 is a function diagram of a reference function provided by an embodiment of the present application;
[0074] Figure 6 is a function diagram of a first discount function provided by an embodiment of the present application;
[0075] Figure 7 is a function diagram of a second discount function provided by an embodiment of the present application;
[0076] Figure 8 is an exemplary diagram of a data slice provided by an embodiment of the present application;
[0077] Figure 9 is a flowchart of a method for data retransmission provided by an embodiment of the present application;
[0078] Figure 10 is an exemplary diagram of a retransmission data slice provided by an embodiment of the present application;
[0079] Figure 11 is a flowchart of a method for data aggregation provided by an embodiment of the present application;
[0080] Figure 12 is an exemplary diagram of a method for data aggregation provided by an embodiment of the present application;
[0081] Figure 13 is an exemplary diagram of another method for data aggregation provided by an embodiment of the present application;
[0082] Figure 14 is an exemplary diagram of a method for data transmission provided by an embodiment of the present application;
[0083] Figure 15 is a structural diagram of a device for data transmission provided by an embodiment of the present application
[0084] Figure 16 is a structural diagram of an electronic device provided by yet another embodiment of the present application. Detailed Implementation
[0085] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0086] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0087] Currently, researchers pre-set the MTU value based on the network environment and equipment characteristics. Nodes in the communication network divide large data packets according to the set MTU value to obtain data slices, and then send the data slices in a sequential transmission manner.
[0088] However, sequential transmission is inefficient, and the network environment is constantly changing, making a fixed MTU value unsuitable. When the network environment is unstable, the size of data slices may be too large or too small relative to the current network conditions. If the data slice is too small, the header information occupies a larger proportion of bytes, resulting in more network overhead for transmitting the same amount of data, thus limiting network throughput. Conversely, if the data slice is too large, the limited number of slices leads to a higher retransmission rate.
[0089] To address the problems existing in the prior art, embodiments of this application provide a method, apparatus, device, storage medium, and program product for data transmission, firstly based on... Figure 1 This application introduces a data transmission method provided by an embodiment, which is applied to a sending node, such as... Figure 1 As shown, the method includes:
[0090] S101、According to the preset sampling frequency, the network resource information of the sending node is obtained.
[0091] The network resource information is used to represent the network quality corresponding to the network to which the sending node belongs, and the preset sampling frequency is calculated by the sending node according to historical network resource information of the sending node. The preset sampling frequency is used to represent the time interval for the sending node to obtain network resource information.
[0092] Specifically, after the sending node obtains network resource information each time, the preset sampling frequency is calculated according to the network resource information obtained this time, and then the next network resource information is obtained according to the preset sampling frequency calculated this time, that is, after the sending node obtains network resource information each time, the time interval for obtaining network resource information next time is calculated according to the network resource information obtained this time.
[0093] It should be noted that each node in the communication network is pre-configured with a dynamic information acquisition module, which can obtain network resource information according to a preset sampling frequency.
[0094] S102, according to the network resource information, the maximum transmission unit MTU value corresponding to the sending node is calculated.
[0095] It can be understood that the network resource information can represent the network quality corresponding to the network to which the sending node belongs, therefore, the MTU value calculated according to the current obtained network resource information is suitable for the network environment where the current sending node is located, and the subsequent sending node performs data transmission according to the calculated MTU value, which can effectively improve the network transmission quality.
[0096] S103, the to-be-transmitted data is sliced according to the MTU to obtain a first data slice.
[0097] S104, the first data slice is sent to the receiving node.
[0098] By using the above method, the sending node obtains network resource information of the sending node according to a preset sampling frequency, wherein the network resource information can reflect the network quality corresponding to the network where the sending node is located, and then the MTU value corresponding to the sending node can be calculated according to the network resource information. In this way, since the preset sampling frequency is calculated by the sending node according to historical network resource information, that is, the sending node dynamically updates the MTU value of the sending node according to the preset sampling frequency. Therefore, it is ensured that the dynamically updated MTU value can conform to the network environment of the current sending node. The sending node slices the to-be-transmitted data according to the calculated MTU value, and the size of the obtained first data slice conforms to the network environment where the current sending node is located, thereby improving the data transmission quality of the network.
[0099] For the above S101, the network resource information of the sending node is obtained according to the preset sampling frequency. The dynamic information collection module can monitor the network devices in the network, obtain the parameters of each network device, and then calculate the network resource information according to the parameters.
[0100] In one example, the dynamic information collection module detects the total number of data packets sent by the sending node, the number of retransmitted data packets, the data packet sending time, and the data packet receiving time carried in the return information of the receiving node. The dynamic information collection module calculates the packet loss rate based on the total number of data packets and the number of retransmitted data packets. Specifically, Wherein, a represents the number of retransmitted data packets, and b represents the total number of data packets sent by the sending node. The dynamic information collection module calculates the transmission delay based on the data packet sending time and the data packet receiving time carried in the return information of the receiving node. Specifically, the transmission delay = c-d, where c represents the data packet receiving time, and d represents the data packet sending time.
[0101] It should be noted that the above preset sampling frequency is updated by the sending node in real time based on the obtained network resource information. Specifically, the following will be introduced in combination with Figure 2 The updating method of the preset sampling frequency is introduced, as shown in Figure 2 The method comprises the following steps:
[0102] S201, calculating the target sampling frequency corresponding to the sending node according to the network resource information.
[0103] S202, taking the target sampling frequency as the preset sampling frequency.
[0104] By using the method provided in the embodiments of the present application, the target sampling frequency is calculated based on the real-time collected network resource information, and then the target sampling frequency is used to update the preset sampling frequency. The preset sampling frequency can be adjusted in time, which facilitates subsequent collection of network resource information according to the preset sampling frequency in time, so as to realize timely adjustment of the MTU value.
[0105] In some embodiments of the present application, the network resource information includes the packet loss rate and the CPU usage rate. For the above S201, the target sampling frequency corresponding to the sending node is calculated according to the network resource information, which can be specifically implemented as:
[0106] Step 1, calculating a reference sampling function based on the packet loss rate.
[0107] It can be understood that the packet loss rate is an important indicator for measuring the quality of network transmission, and in the case of increasing packet loss rate, the sampling frequency should be adjusted in time to collect network resource information and adjust the MTU value. In the case of increasing packet loss rate, the sampling frequency should be reduced to shorten the time interval of collecting network resource information, so as to ensure timely adjustment of the MTU value, that is, the preset sampling frequency should be reduced with the increase of the packet loss rate, so as to reduce the time for the sending node to recover the higher transmission throughput.
[0108] In the formula, the reference sampling function is a monotonic non-increasing function of the packet loss rate, and the packet loss rate determines the time interval of the sending node collecting network resource information, therefore, in order to ensure that the target sampling frequency fluctuates within a reasonable range, upper and lower threshold values are set for the reference sampling function. Specifically, when the packet loss rate is 0, the value of the reference sampling function is the preset upper threshold value, and when the packet loss rate is 1, the value of the reference sampling function is the preset lower threshold value.
[0109] In actual implementation, when the packet loss rate is higher than a certain threshold value, that is, it belongs to a higher packet loss rate, in order to ensure the quality of network transmission, the preset sampling frequency can be directly set to the preset lower threshold value to adjust the MTU value as soon as possible and improve the network transmission quality in time. The larger the threshold value is, the higher the tolerance of the network to the packet loss rate is.
[0110] Specifically, the reference sampling function can be calculated according to the following formula:
[0111]
[0112] In the formula, r is the packet loss rate, t or,
[0113] In the formula, T1(r) is the reference sampling function, r is the packet loss rate, t l is the lower threshold value of the target sampling frequency, t u is the upper threshold value of the target sampling frequency, and is the preset packet loss rate threshold value.
[0114] It should be noted that the function forms of the above two can be determined according to actual business requirements.
[0115] Specifically, the function graph of the above reference sampling function is as shown in Figure 3 . In the formula, the dotted function graph is the function graph of the reference sampling function in the case of the above , and the solid function graph is the function graph of the reference sampling function in the case of the above
[0116] In the case that the packet loss rate is greater than the preset packet loss rate threshold, the reference sampling function is directly set to the lower threshold by the sending node.
[0117] Step 2, calculating a sampling discount function according to the CPU usage rate.
[0118] It can be understood that the preset sampling frequency is mainly affected by the packet loss rate, and in actual implementation, as the preset sampling frequency rises, the CPU usage rate of the sending node also rises, which will cause the CPU load to be too high. Therefore, after the reference sampling function is calculated as described above, a sampling discount function is calculated based on the CPU usage rate to calibrate the reference sampling function.
[0119] The definition domain of the sampling discount function is the value range [0, 1] of the CPU usage rate, and the value domain is In the case that the CPU usage rate is 1, the value of the sampling discount function is 1; and in the case that the CPU usage rate is 0, the value of the sampling discount function is In the case that the CPU usage rate of the sending node is high, the value of the sampling discount function should remain high. In this way, as the CPU usage rate of the sending node decreases, the sampling time interval can be appropriately reduced on the basis of the time interval calculated by the reference sampling function.
[0120] Specifically, the sampling discount function can be calculated according to the following formula:
[0121]
[0122] T2(c) is the sampling discount function, c is the CPU usage rate, λ is a preset parameter, is a preset CPU usage rate threshold.
[0123] It should be noted that the function graph of the sampling discount function is centrally symmetric, and the centrally symmetric point is the preset CPU usage rate threshold. In the case that the CPU usage rate is less than the preset CPU usage rate threshold, the function graph presents a marginal decreasing decreasing trend; and in the case that the CPU usage rate is greater than the preset CPU usage rate threshold, the function graph presents a marginal decreasing increasing trend.
[0124] In addition, the value of λ determines the steepness of the function graph of the sampling discount function, and the value of λ reflects the user's tolerance to the occupation of the CPU resources of the sending node by the transmission task. That is, as λ gradually increases, the CPU usage rate approaches the threshold boundary, and the user's tolerance presents a change trend from slow decrease to sharp decrease, thereby causing the discount effect to gradually increase from slow to fast.
[0125] In actual implementation, the user can calculate the value of λ according to actual demand, for example, by inversely solving the sampling discount function to obtain λ. In one example, λ is set to 0.55, q is set to 0.3, and the sampling discount function is as follows: The preset value is 0.55, q is set to 0.3, and the sampling discount function is as follows: The preset value is 0.3, q is set to 0.3, and the sampling discount function is as follows:
[0126]
[0127] In addition, the user can also calculate the value of λ by other solving methods, which are not limited in the embodiments of the present application.
[0128] Specifically, for different values of λ, the function image of the calculated sampling discount function is as shown in FIG. 2, and it can be known from FIG. 2 that, as the value of λ increases, the steepness of the trend of the sampling discount function increases. Figure 4 Figure 4
[0129] Step 3, calculating the product of the reference sampling function and the sampling discount function to obtain the target sampling frequency.
[0130] Specifically, based on the embodiments shown in FIG. 3 and FIG. 4, the calculation formula of the target sampling frequency is as follows: Figure 3 Figure 4 T(r, c) = T1(r)T2(c)
[0131] T(r, c) = T1(r)T2(c)
[0132] Wherein, T(r, c) is the target sampling frequency.
[0133] By using the method provided in the embodiments of the present application, the packet loss rate can reflect the data transmission quality between the sending node and the receiving node, and the CPU usage rate can reflect the computing performance of the sending node itself. Moreover, since the packet loss rate is the main index for measuring network transmission quality, the reference sampling function calculated by the packet loss rate can accurately reflect the data transmission performance in the current network environment, and the sampling discount function calculated by the CPU usage rate can accurately reflect the best performance of the current sending node, and finally the target sampling frequency is obtained by calculating the product of the reference sampling function and the sampling discount function, thereby improving the accuracy of the calculation result.
[0134] In addition, in the case that the network resource information is collected by the dynamic information collection module, the collected network resource information is cached in time. In this way, in the case of sudden network failure or subsequent network resource information collection failure, the sending node can calculate the target sampling frequency and the subsequent MTU value by using the historical network resource information.
[0135] In one example, the sending node can obtain historical network resource information in a preset time window, and then calculate a mean value of the historical network resource information, and use the mean value to calculate a preset sampling frequency and an MTU value.
[0136] In some embodiments of the present application, due to the limitation of the transport protocol layer, when using the User Datagram Protocol (UDP) for data transmission, the number of bytes actually used to carry data in the protocol is 65507 bytes, and the upper limit of the MTU value is 65507. Moreover, due to the limitation of the data link layer, when the size of the Internet Protocol (IP) packet is greater than the maximum transmission unit of the link, the packet is sliced into multiple smaller data segments at the IP layer, wherein the maximum IP packet of the sliced data segment is the maximum transmission unit of the Ethernet, which is 1500 bytes, including a 20-byte IP packet header, and thus the number of bytes used to carry data of the IP packet is 1480 bytes, and the lower limit of the MTU value is 1490. Therefore, the sending node can adjust the MTU value between the upper limit and the lower limit, adjust the MTU value to adapt to the current network environment, and thus ensure the data transmission quality.
[0137] The network resource information includes a packet loss rate, a central processing unit (CPU) usage rate, and a transmission delay. The S102 of calculating the maximum transmission unit (MTU) value corresponding to the sending node according to the network resource information can be implemented as follows:
[0138] Step A: calculating a reference function according to the packet loss rate.
[0139] It should be noted that in the embodiments of the present application, the influence of the packet loss rate, the CPU usage rate, and the transmission delay on the MTU value is gradually reduced. Therefore, the sending node mainly determines the MTU value through the packet loss rate.
[0140] It can be understood that, in order to optimize the transmission throughput, the size of the data packet should be reduced, i.e., the MTU value should be reduced, when the packet loss rate is too large. When the packet loss rate is too small, the MTU value should be increased.
[0141] In the case where the MTU value is M1(r), the number of data slices obtained by the sending node by slicing the data according to the MTU value is which means rounding up.
[0142] For a data packet with a size of M1(r), the transmission success rate of any data slice obtained by the sending node by slicing the data packet is 1-r, and thus the transmission success rate of the data packet in the case where no packet is lost is Correspondingly, the expected packet loss rate of the sending node can be represented as: Wherein, r is the actual obtained packet loss rate.
[0143] In order to ensure the transmission throughput, the packet loss rate calculated above should be less than or equal to the preset packet loss rate threshold. In case, the expected packet loss rate p f is greater than or equal to The sending node can directly adjust the MTU value to the lower threshold L, that is, M1(r) = L; when r ≤ r', the data packet size is U, and the maximum value of the number of slices is ), the expected packet loss rate p f is less than or equal to The sending node can directly adjust the MTU value to the upper threshold, that is, M1(r) = U. r' should satisfy:
[0144]
[0145] Then In the case of the packet loss rate of the sending node being less than r', the packet loss rate of the sending node is always less than the preset packet loss rate threshold.
[0146] When , M1(r) satisfies the following expression:
[0147]
[0148] The specific derivation process is as follows:
[0149]
[0150] Wherein is the floor function. In order to improve the data transmission efficiency, let
[0151] Specifically, based on the above derivation process, the reference function can be expressed as:
[0152]
[0153] Wherein, M1(r) is the reference function, L represents the MTU lower threshold, is the preset packet loss rate threshold, r is the packet loss rate, and U is the size of the data to be transmitted.
[0154] Specifically, the function graph of the above reference function is as Figure 5 shown.
[0155] Step B, calculating the first discount function according to the CPU usage.
[0156] The first discount function is a monotonic non-increasing function of CPU usage, the domain is the CPU usage range [0, 1], and the value range is In the case of 0 CPU usage, the value of the first discount function is 1, and in the case of 1 CPU usage, the value of the first discount function is
[0157] In addition, in the case of less than the preset CPU usage threshold, it indicates that the computing resources of the current sending node are sufficient, and the sending node can temporarily not consider the impact of CPU usage on the MTU value, in the case of greater than or equal to the preset CPU usage threshold, in the case of preliminary increase of CPU usage, the MTU value is maintained at a high level to ensure network transmission throughput, and in the case of high CPU usage, the sending node quickly reduces the MTU value to reduce the resource occupation of data transmission to other processes.
[0158] Specifically, the first discount function can be calculated according to the following formula:
[0159]
[0160] Wherein, Or
[0161] Wherein, M2(c) is the first discount function, is a preset CPU usage threshold, and c is the CPU usage.
[0162] Specifically, the above two function forms can be determined by the user according to the actual business requirements. For example Figure 6 As shown in Figure 6 Exemplarily shows the function graph of the first discount function in the case of the above two function forms. Wherein, the solid line function graph is the function graph of the first discount function in the case of , and the dashed line function graph is the function graph of the first discount function in the case of .
[0163] Step C, calculating a second discount function according to the transmission delay.
[0164] It can be understood that the second discount function is a monotonic non-increasing function of the transmission delay, the domain is the value range of the transmission delay [0, +∞], and the range is Since the instantaneous delay of message transmission has volatility, the sending node can determine the impact on the MTU value based on the relationship between the instantaneous delay and the average delay.
[0165] Specifically, the second discount function can be calculated according to the following formula:
[0166]
[0167] wherein M3(t) is a second discount function, t is a transmission delay, is an average delay, clip is a clipping function, and the value of is limited to between 0 and 1.
[0168] Specifically, a function graph of the second discount function is as shown in Figure 7
[0169] Step D, calculating the product of the reference sampling function, the first discount function and the second discount function to obtain the MTU value.
[0170] Specifically, the calculation formula of the MTU value calculated by the sending node is as follows:
[0171] M(r, c, t) = M1(r)M2(c)M3(t)
[0172] It can be understood that the sending node dynamically calculates the MTU value according to the network resource information after obtaining the network resource information, i.e., after obtaining the packet loss rate, CPU usage and transmission delay.
[0173] The packet loss rate can accurately reflect the network transmission quality by using the method provided in the application, and therefore, the reference function calculated by the packet loss rate can accurately reflect the optimal MTU value supported by the current network environment. The CPU usage can accurately reflect the computing performance of the sending node, and therefore, the first discount function calculated by the CPU usage can accurately reflect the optimal MTU value supported by the current sending node. The transmission delay can reflect the network transmission quality to a certain extent, and therefore, the second discount function can reflect the influence of the transmission delay on the network transmission quality under the current network environment. In this way, the MTU value is obtained by calculating the product of the reference sampling function, the first discount function and the second discount function, and the accuracy of the calculation result is improved.
[0174] According to S103, the sending node divides the data packet of the to-be-transmitted data into a plurality of data slices, each data slice being a Frame, wherein the protocol header information in the Frame occupies 8 bytes, and therefore, the actual effective transmission data in each Frame is (MTU value-8) bytes.
[0175] It should be noted that the header information of the Frame includes a block ID (BlockID), a data slice number (TotalNumber), a data slice sequence number (FrameID), a data slice data amount (FrameSize) and type information (maxSliceIndex).
[0176] After the sending node slices the data to be transmitted according to the MTU value, the first data slice obtained by slicing is sent to the receiving node through the sending queue. Specifically, as shown in Figure 8 , Figure 8 Three data packets are exemplarily shown, which are Block1, Block2 and Block3. After the sending node slices Block1, data slice 1:1, data slice 1:2 and data slice 1:3 are obtained, wherein data slice 1:1 represents the first data slice of Block1, data slice 1:2 represents the second data slice of Block1, and data slice 1:3 represents the third data slice of Block1.
[0177] After the sending node slices Block2, data slice 2:1, data slice 2:2 and data slice 2:3 are obtained; after the sending node slices Block3, data slice 3:1, data slice 3:2 and data slice 3:3 are obtained.
[0178] Among them, Figure 8 Exemplarily shown is the information included in data slice 1, BlockID of data slice 1 is 1, FrameID is 1, FrameSize is xxx, TotalNumber is xxx, FrameHeader and FrameBody.
[0179] After the sending node obtains the data slice by slicing as described above, the sending node pushes the data slice into the sending queue, and transmits the data slice in parallel through multiple sending queues to ensure the data transmission efficiency. In this way, the parallel transmission mechanism can also be used to transmit multiple data packets simultaneously, thereby effectively improving the transmission flexibility and transmission efficiency. In addition, new data packets can be added in the sending node according to actual business requirements, thereby improving the system resource utilization rate and reducing the thread waiting time.
[0180] It should be noted that the number of data slices obtained by the sending node slicing according to the calculated MTU value is multiple, and there can be packet loss in the data slice transmission process. The sending node needs to retransmit the data slice of the lost packet. Therefore, as shown in Figure 9 After the above S104, the method further includes:
[0181] S901, receiving the retransmission instruction fed back by the receiving node.
[0182] Among them, the retransmission instruction includes a target data slice identifier.
[0183] Specifically, after receiving the data slice, the receiving node extracts the packet header information of the data slice, uses the packet header information to check the data carried in the data slice, and stores the target data slice identifier of the data slice in the retransmission instruction for the data slice that fails the check. For the data slice that passes the check, the data slice is stored locally and waits for the subsequent reception of the full amount of data slice corresponding to the data packet to aggregate the data to obtain the data to be transmitted.
[0184] It should be noted that the method for checking the data slice by the embodiments of the present application is not limited.
[0185] S902, in the case where the target data corresponding to the target data slice identifier is greater than the MTU value, the target data corresponding to the target data slice identifier is sliced according to the MTU value to obtain the retransmission data slice.
[0186] Specifically, the method for slicing the target data is as shown in Figure 10 , wherein the sending node obtains the total amount of data of the Frame from the packet header information of the target data, and then judges the size of the total amount of data and the MTU value. In the case where the total amount of data is greater than the MTU value, the Frame is sliced according to the MTU value to obtain a plurality of SliceBody as shown in Figure 10 , and each Slice is assigned a SliceID according to the slicing order.
[0187] The amount of data in each SliceBody is (MTU value-8), and the amount of data of each SliceBody calculated is 10000 bytes. The amount of data of the last SliceBody is 1168 bytes. The packet header information of each Slice includes the FrameID to which the data slice belongs, the data size SliceSize, and the sequence number SliceID.
[0188] In another embodiment of the present application, in the case where the target data corresponding to the target data slice identifier is less than the MTU value, the sending node directly sends the target data to the receiving node.
[0189] It can be understood that the MTU value in the sending node is real-time changing, and therefore, when the target data is retransmitted, the MTU value of the current sending node may have changed, and the target data is sliced and retransmitted according to the MTU value of the current sending node.
[0190] S903, the retransmission data slice is sent to the receiving node.
[0191] By adopting the method provided in the embodiments of the present application, after receiving the retransmission instruction, the sending node acquires the target data according to the target data slice identifier in the retransmission instruction. Then, in the case that the target data is larger than the MTU value, the sending node cannot directly transmit the target data, and therefore, the target data is sliced according to the MTU value, so as to transmit the retransmission data slice to the receiving node. In this way, the integrity of the data packet received by the receiving node is ensured, so as to ensure the accuracy of data transmission.
[0192] In some embodiments of the present application, other nodes in the communication network to which the sending node belongs can send data to the sending node. Based on this, the following introduces the process of the sending node aggregating the data to obtain the original data packet after receiving the data, as shown in Figure 11 Figure 11 The method comprises the following steps.
[0193] S1101, receiving a plurality of second data slices sent by other nodes in the network to which the sending node belongs except the sending node.
[0194] It should be noted that any node in the network can be a sending node or a receiving node, that is, any node in the network can send data to other nodes, and can also receive data sent by other nodes.
[0195] S1102, acquiring the data block identifier in each second data slice.
[0196] The data block identifier is included in the header information in the data slice.
[0197] S1103, for each data block identifier, constructing a storage queue and an aggregation queue corresponding to the data block identifier.
[0198] The sending node extracts the header information in the second data slice after receiving the second data slice, so as to acquire the data block identifier, and traverses the locally stored storage queue and aggregation queue, wherein each storage queue and aggregation queue corresponds to a data block identifier. In the case that the data block identifier of the second data slice is not found in the data block identifier corresponding to the locally stored storage queue, the storage queue and the aggregation queue corresponding to the data block identifier of the second data slice are constructed.
[0199] In the case that the data block identifier of the second data slice is found in the data block identifier corresponding to the locally stored storage queue, the second data slice is stored in the corresponding storage queue.
[0200] S1104, according to the data block identifier of each second data slice, storing the second data slice in the storage queue corresponding to the data block identifier.
[0201] S1105, for each storage queue, obtaining a slice identifier in each second data slice in the storage queue.
[0202] It should be noted that since other nodes in the network use the parallel transmission method to transmit the second data slice, the sending node stores multiple second data slices in the storage queue according to the time sequence of receiving the second data slice.
[0203] S1106, for each storage queue, storing the second data slice in the storage queue to the aggregation queue according to the order of the slice identifier in each second data slice.
[0204] Wherein, the second data slice is stored in the aggregation queue in order.
[0205] S1107, for each aggregation queue, obtaining slice quantity information in the second data slice in the aggregation queue.
[0206] Specifically, as shown in Figure 12 , it is an exemplary schematic diagram of a storage queue and an aggregation queue provided by an embodiment of the present application. Figure 12
[0207] Wherein, after obtaining the second data slice, the sending node stores the second data slice into the storage queue corresponding to the data block identifier according to the data block identifier in the data slice. If the sending node has not constructed the storage queue corresponding to the data block identifier, the sending node constructs the storage queue corresponding to the data block identifier and the aggregation queue, and stores the second data slice into the storage queue.
[0208] Further, the sending node obtains the slice identifier of each data slice in the storage queue, then compares the slice identifier with the expected identifier of the aggregation queue, and in the case that the slice identifier of the storage queue is the same as the expected identifier, stores the data slice corresponding to the slice identifier into the aggregation queue.
[0209] Wherein, the expected identifier of the aggregation queue is the slice identifier of the top data slice of the current queue plus one, and in the case that no data slice has been stored in the aggregation queue, the expected identifier of the storage queue is one.
[0210] As shown in Figure 12 , the storage queue stores multiple data slices in the time sequence of receiving the second data slice by the sending node, wherein, Figure 12 The order of the stored data slices in the storage queue is shown as data slice 1:1, data slice 1:2, data slice 1:5, data slice 1:6, data slice 1:8, data slice 1:3, data slice 1:4 and data slice 1:7. The data slices are stored in the aggregation queue in the order of the slice identifiers, and the order from the head to the tail is data slice 1:1 to data slice 1:8.
[0211] S1108, for each aggregation queue, in a case where the slice quantity information and the maximum value of the slice identifiers in the aggregation queue are the same, aggregating the second data slice in the aggregation queue to obtain transmission data.
[0212] As shown in Figure 13 the sending node stores the data slices in the storage queue into the aggregation queue according to the order of the slice identifiers. Figure 12 The method provided by the embodiments stores the data slices in the storage queue into the aggregation queue, and in a case where the slice identifier of the aggregation queue and the slice quantity information in the second data slice are the same, it indicates that the aggregation queue stores the full-amount data slices of the data packet. The sending node aggregates each aggregation queue, and the original transmission data can be obtained.
[0213] Specifically, Figure 13 Exemplarily, three storage queues and three aggregation queues are shown.
[0214] In a case where the slice identifier of the data slice in the aggregation queue and the slice quantity information in the slice identifier are the same, the data slice in the aggregation queue is aggregated.
[0215] By using the method provided by the embodiments, the sending node constructs a storage queue and an aggregation queue for each data block identifier. After receiving the second data slice, the sending node stores the data slice into the corresponding storage queue according to the data block identifier of the second data slice, and then stores the data slice into the aggregation queue in the order of the slice identifier in the data slice. In this way, the data slices arranged in the order of the slice identifier are stored in the aggregation queue. Then, the sending node traverses the slice identifier in the aggregation queue, and in a case where the maximum value of the slice identifier and the slice quantity information are the same, it indicates that the sending node has received the full-amount data slice corresponding to the data block identifier. Thus, the sending node aggregates the data slices in the aggregation queue to obtain the transmission data sent by other nodes, and the integrity of the data is ensured.
[0216] It should be noted that in the second data slice is retransmission data, and the retransmission data is obtained after the other nodes are sliced according to the current MTU value, the slice identifier of the retransmission data includes FrameID and SliceID. Among them, the data packet corresponding to SliceID is a sub-data packet of the data packet corresponding to FrameID. The sending node constructs a storage queue and an aggregation queue for each SliceID, and then aggregates the data packet corresponding to FrameID based on the aggregation method in the above embodiment, and then stores the data packet corresponding to FrameID as a data slice in the storage queue corresponding to FrameID, and then aggregates the transmission data by the aggregation method in the above embodiment.
[0217] The following will be described in combination with Figure 14 The complete process of slicing and parallel transmission of big data is introduced, as shown in FIG. 1, the method comprises the steps of: Figure 14
[0218] S1401, configuring an initial MTU value.
[0219] Among them, the user sets the MTU value to the maximum value under the current network quality according to the current network quality and device parameters, in order to reduce the network transmission overhead.
[0220] Specifically, the theoretical data limit of the UDP data packet is 65535 bytes, since the message header of the data packet occupies 8 bytes and the message header of the IP packet occupies 20 bytes, the initial MTU value can be set to (65535-8-20=65507) bytes. In this way, the transmission throughput can be maximized.
[0221] S1402, configuring a transmission protocol layer MTU value.
[0222] S1403, collecting network and resource information.
[0223] Among them, the network and resource information is the network resource information in the above embodiment.
[0224] S1404, calculating the MTU value for different network environments.
[0225] Specifically, the method for calculating the MTU value is described in the above embodiment, which will not be repeated here.
[0226] S1405, the sending node configures the data packet size.
[0227] Among them, the data packet is the data slice in the above embodiment.
[0228] S1406, whether it is the first sending.
[0229] If yes, S1407 is executed, and if no, S1408 is executed.
[0230] S1407, dividing the data packet into Frame according to the MTU value.
[0231] S1408, whether the Frame is larger than the MTU value.
[0232] If yes, S1409 is executed, and if no, S1410 is executed.
[0233] S1409, dividing the Frame into Slice according to the MTU value.
[0234] S1410, adding the data packet into the sending queue.
[0235] S1411, sending the data packet in parallel.
[0236] S1412, receiving the data packet by the receiving node.
[0237] Specifically, the packet header information of the data packet contains maxSliceIndex, and the receiving node judges the type of the data packet according to the value of maxSliceIndex. In the case that the value of maxSliceIndex is 0, it indicates that the type of the data packet is Frame, and in the case that the value of maxSliceIndex is not 0, it indicates that the type of the data packet is Slice.
[0238] S1413, whether the data packet is verified successfully.
[0239] If yes, S1414 is executed, and if no, S1415 is executed.
[0240] S1414, processing the sub-data packet.
[0241] Specifically, in the case that the receiving node verifies the data packet successfully, the receiving node stores the received data packet into the corresponding storage queue.
[0242] S1415, constructing the failure return information.
[0243] Among them, in the case that the receiving node fails to verify the data packet, the receiving node constructs the acknowledgement character (Acknowledgement, ACK) information containing FrameID and SliceID, so as to be used for the retransmission of the corresponding data packet by the sending node according to the FrameID and SliceID in the ACK information.
[0244] S1416, whether the sub-data packet is lost.
[0245] If yes, S1415 is executed, and if no, S1417 is executed.
[0246] S1417, aggregate the sub-packets.
[0247] Specifically, the method for aggregating the data slices by using the storage queue and the aggregation queue can refer to the related description in the above embodiments, which will not be repeated here.
[0248] S1418, the sending node obtains the corresponding sub-packet according to the failure return information.
[0249] The sub-packet is the target data in the above embodiments.
[0250] By using the method provided in the embodiments of the present application, the sending node collects network resource information, and modifies the MTU value in a timely manner based on the collected network resource information, so that the modified MTU value is more suitable for the current network environment. Then the sending node divides the data packet according to the modified MTU value, obtains a plurality of data slices, and sends the data slices to the receiving node in a parallel transmission manner, thereby improving the data transmission efficiency. The receiving node checks the data slices after receiving the data slices, and aggregates the data slices in the case of passing the check, thereby obtaining the complete transmission data. In this way, the reliability and accuracy of data transmission are improved.
[0251] Based on the same concept, a data transmission device is applied to a sending node, as shown in Figure 15 The device comprises:
[0252] The acquisition module 1501 is configured to acquire network resource information of the sending node according to a preset sampling frequency, wherein the network resource information is used to represent the network quality of the network to which the sending node belongs, and the preset sampling frequency is calculated by the sending node according to historical network resource information of the sending node.
[0253] The calculation module 1502 is configured to calculate a maximum transmission unit (MTU) value corresponding to the sending node according to the network resource information.
[0254] The slicing module 1503 is configured to perform slicing processing on the data to be transmitted according to the MTU, to obtain a first data slice.
[0255] The sending module 1504 is configured to send the first data slice to a receiving node.
[0256] In a possible implementation manner, the device further comprises:
[0257] The calculation module 1502 is configured to calculate a target sampling frequency corresponding to the sending node according to the network resource information.
[0258] The determining module is configured to determine the target sampling frequency as the preset sampling frequency.
[0259] In a possible implementation, the network resource information includes a packet loss rate and a central processing unit (CPU) usage rate; and the calculating module 1502 is specifically configured to:
[0260] calculate a reference sampling function according to the packet loss rate;
[0261] calculate a sampling discount function according to the CPU usage rate;
[0262] calculate a product of the reference sampling function and the sampling discount function to obtain the target sampling frequency.
[0263] In a possible implementation, the calculating module 1502 is specifically configured to:
[0264] calculate the reference sampling function according to the following formula:
[0265]
[0266] wherein, or,
[0267] wherein, T1(r) is the reference sampling function, r is the packet loss rate, t l is a lower threshold of the target sampling frequency, t u is an upper threshold of the target sampling frequency, is a preset packet loss rate threshold.
[0268] In a possible implementation, the calculating module 1502 is specifically configured to:
[0269] calculate the sampling discount function according to the following formula:
[0270]
[0271] wherein, T2(c) is the sampling discount function, c is the CPU usage rate, λ is a preset parameter, is a preset CPU usage rate threshold.
[0272] In a possible implementation, the network resource information includes a packet loss rate, a central processing unit (CPU) usage rate and a transmission delay; and the calculating module 1502 is specifically configured to:
[0273] calculate a reference function according to the packet loss rate;
[0274] calculate a first discount function according to the CPU usage rate;
[0275] calculating a second discount function according to the transmission delay;
[0276] calculating a product of the reference sampling function, the first discount function and the second discount function to obtain the MTU value.
[0277] In a possible implementation, the calculating module 1502 is specifically configured to:
[0278] The reference function is calculated according to the following formula:
[0279]
[0280] wherein M1(r) is the reference function, L represents an MTU lower threshold value, is a preset packet loss rate threshold value, r is the packet loss rate, and U is the size of the data to be transmitted.
[0281] In a possible implementation, the calculating module 1502 is specifically configured to:
[0282] The first discount function is calculated according to the following formula:
[0283]
[0284] wherein, or
[0285] wherein M2(c) is the first discount function, is a preset CPU usage threshold value, and c is the CPU usage.
[0286] In a possible implementation, the calculating module 1502 is specifically configured to:
[0287] The second discount function is calculated according to the following formula:
[0288]
[0289] wherein M3(t) is the second discount function, and t is the transmission delay.
[0290] In a possible implementation, the first data slice quantity is a plurality of; the apparatus further includes:
[0291] The receiving module is configured to receive a retransmission instruction fed back by the receiving node, wherein the retransmission instruction includes a target data slice identifier.
[0292] The slicing module 1503 is further configured to slice the target data corresponding to the target data slice identifier according to the MTU value to obtain retransmission data slices in a case where the target data corresponding to the target data slice identifier is greater than the MTU value.
[0293] The sending module 1504 is further configured to send the retransmission data slices to the receiving node.
[0294] In a possible implementation, the apparatus further includes:
[0295] The receiving module is configured to receive a plurality of second data slices sent by nodes other than the sending node in a network to which the sending node belongs.
[0296] The obtaining module 1501 is further configured to obtain a data block identifier in each second data slice.
[0297] The constructing module is configured to construct, for each data block identifier, a storage queue and an aggregation queue corresponding to the data block identifier.
[0298] The storage module is configured to store, according to the data block identifier of each second data slice, the second data slice into the storage queue corresponding to the data block identifier.
[0299] The obtaining module 1501 is further configured to obtain, for each storage queue, a slice identifier in each second data slice in the storage queue.
[0300] The storage module is further configured to store, for each storage queue, the second data slice in the storage queue into the aggregation queue according to an order of the slice identifiers in each second data slice.
[0301] The obtaining module 1501 is further configured to obtain, for each aggregation queue, slice quantity information in the second data slice in the aggregation queue.
[0302] The aggregation module is configured to aggregate, for each aggregation queue, the second data slice in the aggregation queue to obtain transmission data in a case where the slice quantity information and a maximum value of the slice identifiers in the aggregation queue are the same.
[0303] It should be noted that the apparatus for data transmission is a device corresponding to the method for data transmission applied to the sending node, and all implementation manners in the above method embodiments are applicable to the embodiments of the apparatus, and the same technical effects can be achieved.
[0304] Figure 16 A hardware structure schematic diagram of an electronic device provided by an embodiment of the present application is shown.
[0305] The electronic device can include a processor 1601 and a memory 1602 having stored computer program instructions.
[0306] In particular, the processor 1601 described above can include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or can be configured to implement one or more integrated circuits that embody the embodiments of the present application.
[0307] The memory 1602 can include a mass storage that is used for data or instructions. By way of example, and not limitation, the memory 1602 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc, a magneto-optical disc, magnetic tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. The memory 1602 can include removable or non-removable (or fixed) media, where appropriate. The memory 1602 can be internal or external to the integrated gateway disaster recovery device, where appropriate. In particular embodiments, the memory 1602 is non-volatile, solid-state memory.
[0308] The memory can include read-only memory (ROM), random-access memory (RAM), magnetic disk storage mediums, optical storage mediums, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software that, when executed (by one or more processors), is operable to access the data and / or instructions that enable the operations described with respect to the methods according to the aspects of the present disclosure.
[0309] The processor 1601 implements the method of any one of the above-described embodiments of data transmission by reading and executing the computer program instructions stored in the memory 1602.
[0310] In one example, the electronic device can further include a communication interface 1603 and a bus 1604. As shown, the processor 1601, the memory 1602, and the communication interface 1603 are connected through the bus 1604 and complete communication therebetween. Figure 16
[0311] The communication interface 1603 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the present application.
[0312] Bus 1604 includes hardware, software, or both, to couple electronic devices to each other in a manner that allows information to be passed between or among the coupled devices. Although embodiments of the application are not limited to a particular bus implementation, examples of a bus include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 1604 can include one or more buses. Although the present application is described and illustrated with a particular bus implementation, it is understood that other bus implementations can be used in accordance with the teachings of the present application.
[0313] In addition, the embodiments of the present application can provide a computer storage medium to implement the method of data transmission in the above embodiments. The computer storage medium stores computer program instructions; the computer program instructions are executed by a processor to implement any one of the methods of data transmission in the above embodiments.
[0314] In addition, the embodiments of the present application can provide a computer program product, the instructions in the computer program product are executed by the processor of the electronic device to make the electronic device execute any one of the methods of data transmission in the above embodiments.
[0315] It needs to be clear that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of well-known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the present application.
[0316] The functions indicated in the structural block diagrams described above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine-readable medium" can include any medium that can store or transfer information. Examples of the machine-readable medium include an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an erasable ROM (EROM), a floppy diskette, a CD-ROM, an optical disk, a hard disk, a fiber optic medium, a radio frequency (RF) link, and the like. The code segments can be downloaded via computer networks such as the Internet, an intranet, and the like.
[0317] It is also noted that the examples mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the steps mentioned above, that is, the steps can be performed in the order mentioned in the examples, or in an order different from the examples, or several steps can be performed simultaneously.
[0318] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing device to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks.
[0319] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A method of data transmission, characterized by, The method applied to a sending node comprises: obtaining network resource information of the sending node according to a preset sampling frequency, the network resource information being used to represent network quality of a network to which the sending node belongs, and the preset sampling frequency being calculated by the sending node according to historical network resource information of the sending node; calculating a maximum transmission unit (MTU) value corresponding to the sending node according to the network resource information; performing slice processing on to-be-transmitted data according to the MTU to obtain a first data slice; sending the first data slice to a receiving node; the network resource information comprises a packet loss rate and a central processing unit (CPU) usage rate; before the step of obtaining the network resource information of the sending node according to the preset sampling frequency, the method further comprises: calculating a reference sampling function according to the packet loss rate; calculating a sampling discount function according to the CPU usage rate; calculating a product of the reference sampling function and the sampling discount function to obtain the target sampling frequency; the step of calculating the reference sampling function according to the packet loss rate comprises: calculating the reference sampling function according to the following formula: wherein or Wherein, T1(r) is the reference sampling function, r is the packet loss rate, t l is the lower threshold of the target sampling frequency, t u is the upper threshold of the target sampling frequency, is a preset packet loss rate threshold, is the reference sampling function between the upper threshold and the lower threshold.
2. The method of claim 1, wherein, after the step of obtaining the network resource information of the sending node according to the preset sampling frequency, the method further comprises: calculating a target sampling frequency corresponding to the sending node according to the network resource information; and taking the target sampling frequency as the preset sampling frequency.
3. The method of claim 1, wherein, the step of calculating the sampling discount function according to the CPU usage rate comprises: calculating the sampling discount function according to the following formula: Wherein, T2(c) is the sampling discount function, c is the CPU usage rate, λ is a preset parameter, is a preset CPU usage rate threshold.
4. The method of claim 1, wherein, the network resource information comprises a packet loss rate, a central processing unit (CPU) usage rate and a transmission delay; and the step of calculating a maximum transmission unit (MTU) value corresponding to the sending node according to the network resource information comprises: calculating a reference function according to the packet loss rate; calculating a first discount function according to the CPU usage rate; calculating a second discount function according to the transmission delay; calculating a product of the reference function, the first discount function and the second discount function to obtain the MTU value.
5. The method of claim 4, wherein, the step of calculating the reference function according to the packet loss rate comprises: calculating the reference function according to the following formula: Wherein, M1(r) is the reference function, L represents the MTU lower threshold, is a preset packet loss rate threshold, r is the packet loss rate, and U is the size of the data to be transmitted.
6. The method of claim 4, wherein, the step of calculating the first discount function according to the CPU usage rate comprises: calculating the first discount function according to the following formula: wherein or wherein M2(c) is the first discount function, is a preset CPU usage threshold, and c is the CPU usage.
7. The method of claim 4, wherein, the step of calculating the second discount function according to the transmission delay comprises: calculating the second discount function according to the following formula: wherein M3(t) is the second discount function, and t is the transmission delay.
8. The method of claim 1, wherein, the number of the first data slices is multiple; after the step of performing slice processing on to-be-transmitted data according to the MTU to obtain a data slice, the method further comprises: receiving a retransmission instruction fed back by the receiving node, the retransmission instruction comprising a target data slice identifier; in a case where target data corresponding to the target data slice identifier is greater than the MTU value, performing slice processing on the target data corresponding to the target data slice identifier according to the MTU value to obtain a retransmission data slice; and sending the retransmission data slice to the receiving node.
9. The method of claim 1, wherein, the method further comprises: receive a plurality of second data slices sent by nodes other than the sending node in a network to which the sending node belongs; obtain data block identifiers in each second data slice; for each data block identifier, construct a storage queue and an aggregation queue corresponding to the data block identifier; store the second data slice into the storage queue corresponding to the data block identifier of the second data slice according to the data block identifier of the second data slice; for each storage queue, obtain slice identifiers in each second data slice in the storage queue; for each storage queue, store the second data slices in the storage queue into the aggregation queue in an order of the slice identifiers in each second data slice; for each aggregation queue, obtain slice quantity information in the second data slices in the aggregation queue; for each aggregation queue, in a case where the slice quantity information and a maximum value of the slice identifiers in the aggregation queue are the same, aggregate the second data slices in the aggregation queue to obtain transmission data.
10. An apparatus for data transmission, characterized by An apparatus applied to a sending node, the apparatus comprising: an obtaining module configured to obtain network resource information of the sending node according to a preset sampling frequency, the network resource information being used to represent network quality of a network to which the sending node belongs, and the preset sampling frequency being calculated by the sending node according to historical network resource information of the sending node; a calculating module configured to calculate a maximum transmission unit (MTU) value corresponding to the sending node according to the network resource information; a slicing module configured to slice processing of to-be-transmitted data according to the MTU to obtain first data slices; a sending module configured to send the first data slices to a receiving node; the network resource information comprises a packet loss rate and a central processing unit (CPU) usage rate; the calculating module is further configured to: calculate a reference sampling function according to the packet loss rate; calculate a sampling discount function according to the CPU usage rate; calculate a product of the reference sampling function and the sampling discount function to obtain the target sampling frequency; the calculating of the reference sampling function according to the packet loss rate comprises: calculating the reference sampling function according to the following formula: wherein or wherein T1(r) is the reference sampling function, r is the packet loss rate, t l is a lower threshold value of the target sampling frequency, t u is an upper threshold value of the target sampling frequency, is a preset packet loss rate threshold value, is a reference sampling function between the upper threshold value and the lower threshold value.
11. An electronic device, comprising: the device comprises a processor and a memory storing computer program instructions; the processor implements the method for data transmission according to any one of claims 1-9 when executing the computer program instructions.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the method for data transmission according to any one of claims 1-9.
13. A computer program product, characterised in that, The instructions in the computer program product are executed by the processor of the electronic device, so that the electronic device executes the method for data transmission according to any one of claims 1-9.
Citation Information
Patent Citations
Traffic sampling method, device and equipment and readable storage medium
CN114285773A
Data transmission method and equipment
CN117834549A