Data uploading method and device, network speed detection method and internetwork connector

CN119276804APending Publication Date: 2025-01-07ZTE CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310802657.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

当文件上传时,数据将被分拆成很多的数据报文,且每个报文都需要完整的经过协议栈的转发,导致使用linux系统的产品报文传输效率很低,影响文件上传性能

Benefits of technology

[0038]综上,本申请实施例提供一种数据上传方法、装置、网速检测方法及网间连接器,本申请实施例提供的数据上传方法包括:获取待上传至服务器的数据报文队列,并从数据报文队列中获取样本报文;根据样本报文确定数据报文队列的第一特征参数与报文长度标准;根据预设的组装规则对数据报文队列中的数据报文进行组装处理以生成数据合并包,其中,数据合并包由至少一个数据报文组成;当检测出数据合并包中具有与第一特征参数相匹配的第二特征参数时,对数据合并包进行封装处理以生成封装合并包;根据报文长度标准拆分封装合并包以生成目标报文,并向服务器输出目标报文,从而提升文件数据的上传速度性能,尤其是将本地文件上传至服务器。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276804A_ABST
    Figure CN119276804A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data uploading method and device, a network speed detection method and an inter-network connector, and the data uploading method provided by the embodiment of the invention comprises the steps: obtaining a data message queue to be uploaded to a server, and obtaining a sample message from the data message queue; determining a first characteristic parameter and a message length standard of the data message queue according to the sample message; the data messages in the data message queue are assembled according to a preset assembly rule to generate a data merging packet, and the data merging packet is composed of at least one data message; when it is detected that the data merging packet has a second feature parameter matched with the first feature parameter, packaging the data merging packet to generate a packaged merging packet; and splitting, packaging and merging the packet according to the message length standard to generate the target message, and outputting the target message to the server, thereby improving the uploading speed performance of the file data, especially uploading the local file to the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data network technology, and in particular to a data uploading method, device, network speed detection method and network connector. Background Art

[0002] In the scenario of data transmission through the Linux system, users can use the TCP protocol stack to upload or forward messages. However, since the MSS in the real network is generally small, less than 1500, and each message must go through the entire protocol stack, when uploading files, the data will be split into many data messages, and each message needs to be completely forwarded through the protocol stack, resulting in low message transmission efficiency for products using the Linux system, affecting file upload performance.

[0003] Therefore, how to effectively improve the file data uploading performance is a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to provide a data uploading method, device, network speed detection method and network connector, aiming to improve the upload speed performance of file data, especially uploading local files to a server.

[0005] In a first aspect, an embodiment of the present application provides a data uploading method, including:

[0006] Obtain a data message queue to be uploaded to the server, and obtain a sample message from the data message queue;

[0007] Determine a first characteristic parameter and a message length standard of a data message queue according to the sample message;

[0008] Assembling the data packets in the data packet queue according to a preset assembly rule to generate a data merging package, wherein the data merging package is composed of at least one data packet;

[0009] When it is detected that the data merged package has a second characteristic parameter matching the first characteristic parameter, encapsulating the data merged package to generate an encapsulated merged package;

[0010] The target message is generated by splitting, encapsulating and merging packets according to the message length standard, and then outputting the target message to the server.

[0011] In some implementations, obtaining a sample message from a data message queue includes:

[0012] The data packets in the data packet queue are forwarded sequentially through a preset protocol stack;

[0013] The first forwarded data packet is used as the sample packet.

[0014] In some implementations, assembling the data packets in the data packet queue according to a preset assembly rule includes:

[0015] Sequentially capture individual data packets from the data packet queue, and in the process of capturing any data packet, calculate the total data length of the captured data packets;

[0016] When the total data length exceeds the preset length threshold, the last captured data packet is put back into the data packet queue;

[0017] Assemble the captured data packets into a data merge package.

[0018] In some implementations, splitting the encapsulation and merging packets according to the message length standard to generate the target message includes:

[0019] The encapsulated and merged packet is split according to a message length standard to obtain at least one target message, wherein the data length of the target message does not exceed the message length standard.

[0020] In some implementations, encapsulating the data merged package to generate an encapsulated merged package includes:

[0021] Find the TCP data segment in the data merging package, and encapsulate the MAC header information and IP header information for the TCP data segment to generate an encapsulation merging package.

[0022] In some embodiments, the method further comprises:

[0023] When it is detected that the data merging packet does not have a second characteristic parameter matching the first characteristic parameter, the data merging packet is input into a preset network layer, and IP header information is encapsulated for the data merging packet at the network layer;

[0024] Input the data merging packet encapsulated with the IP header information into the preset Ethernet layer, and encapsulate the MAC header information for the data merging packet at the preset Ethernet layer to obtain the target data packet;

[0025] The target data packet is output to the server through the preset physical device driver.

[0026] In some implementations, the first characteristic parameter includes at least one of the TCP protocol of the server, source port information of the data packet queue, and destination port information of the data packet queue.

[0027] In a second aspect, an embodiment of the present application further provides a data uploading device, wherein the computer device includes a memory and a processor;

[0028] Memory for storing computer programs;

[0029] A processor is used to execute a computer program and implement any one of the data uploading methods provided in the specification of this application when executing the computer program.

[0030] In a third aspect, the embodiment of the present application further provides a network speed detection method, the method comprising:

[0031] Execute any one of the data uploading methods provided in the specification of this application, and record the total data size of the data message queue and the total upload time of uploading the data message queue to the server;

[0032] Calculate the target network speed based on the total data size and total upload time.

[0033] In a fourth aspect, an embodiment of the present application further provides an inter-network connector, the inter-network connector comprising a protocol stack module and a device driver packet sending module, the protocol stack module comprising a large packet assembly unit and a fast forwarding unit, the device driver packet sending module comprising a sample processing unit and a large packet processing unit;

[0034] The sample processing unit is used to obtain a data message queue to be uploaded to the server, obtain a sample message from the data message queue, and determine a first characteristic parameter and a message length standard of the data message queue according to the sample message;

[0035] The large packet assembly unit is used to assemble the data packets in the data packet queue according to a preset assembly rule to generate a data merging packet, wherein the data merging packet is composed of at least one data packet;

[0036] The fast forwarding unit is used for encapsulating the data merged packet to generate an encapsulated merged packet when detecting that the data merged packet has a second characteristic parameter matching the first characteristic parameter;

[0037] The large packet processing unit is used to split, encapsulate and merge packets according to the message length standard to generate target messages, and output the target messages to the server.

[0038] In summary, the embodiments of the present application provide a data upload method, device, network speed detection method and network connector. The data upload method provided by the embodiments of the present application includes: obtaining a data packet queue to be uploaded to a server, and obtaining a sample packet from the data packet queue; determining a first characteristic parameter and a message length standard of the data packet queue according to the sample message; assembling the data packets in the data packet queue according to a preset assembly rule to generate a data merge package, wherein the data merge package is composed of at least one data packet; when it is detected that the data merge package has a second characteristic parameter matching the first characteristic parameter, encapsulating the data merge package to generate an encapsulated merge package; splitting the encapsulated merge package according to the message length standard to generate a target message, and outputting the target message to the server, thereby improving the upload speed performance of file data, especially uploading local files to the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0040] Figure 1 This is a flowchart of the steps of uploading file data through the Linux system in the prior art;

[0041] Figure 2 A flowchart of a method for uploading data provided in an embodiment of the present application;

[0042] Figure 3 A schematic diagram of a working environment of a data uploading method provided in an embodiment of the present application;

[0043] Figure 4 A flowchart of the steps of assembling a data message in a data uploading method provided in an embodiment of the present application;

[0044] Figure 5 A logical judgment diagram for assembling data messages in a data uploading method provided in an embodiment of the present application;

[0045] Figure 6 A schematic block diagram of the structure of a data uploading device provided in an embodiment of the present application;

[0046] Figure 7 A flowchart of a method for detecting network speed provided in an embodiment of the present application;

[0047] Figure 8 A schematic block diagram of the structure of an internetwork connector provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0050] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0051] Please refer to Figure 1 , Figure 1 The following is a flowchart of the steps for uploading file data through a Linux system in the prior art.

[0052] like Figure 1 As shown, the Linux system, full name GNU / Linux, is a set of Unix-like operating systems that are free to use and freely disseminated. It is a multi-user, multi-tasking, multi-threaded and multi-CPU operating system based on POSIX (Portable Operating System Interface). In the prior art, the process of uploading file data of a local terminal device to a server using a Linux system mounted on a gateway specifically includes: the gateway and the server perform a TCP (Transmission Control Protocol) three-way handshake pairing, and then perform a TCP packet sending process through the Linux system's protocol stack, wherein, during the TCP three-way handshake pairing process, the gateway and the server will mutually confirm the MSS (Maximum Segment Size) information of the gateway and the server.

[0053] Specifically, the TCP packet sending process through the Linux system protocol stack includes: each TCP data segment passes through the transport layer, network layer and link layer of the internetwork connector in sequence to reach the device driver, and then forwards the data segment to the server through the device driver.

[0054] It should be understood that when file data is uploaded, the file data will be split into many data packets, and each data packet needs to be completely forwarded through the protocol stack, resulting in very low message transmission efficiency for products using the Linux system, affecting file upload performance, and repeated forwarding processing actions consume a large amount of CPU (Central Processing Unit) resources of the network connector, reducing forwarding efficiency.

[0055] Based on this, the embodiments of the present application provide a data uploading method, device, network speed detection method and network connector. The following is a detailed description of some embodiments of the present application in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0056] Please refer to Figure 2 and Figure 3 , Figure 2 A flowchart of a method for uploading data provided in an embodiment of the present application is provided. Figure 3 A schematic diagram of the working environment of a data uploading method provided in an embodiment of the present application.

[0057] like Figure 2 and Figure 3 As shown, an embodiment of the present application provides a data uploading method for uploading file data of a terminal device configured locally to a server via an internetwork connector (gateway).

[0058] Specifically, the process of the data uploading method includes steps 1 to 5:

[0059] Step 1: Obtain a data message queue to be uploaded to the server, and obtain a sample message from the data message queue.

[0060] Exemplarily, the local terminal device includes but is not limited to a PC (personal computer), an intelligent robot, an independent server or a server cluster, etc., and the internet connector (gateway) is set between the terminal device and the server to realize the forwarding of data between the two.

[0061] In the embodiment of the present application, the example of uploading file data configured on a personal PC to a server through a gateway is used for specific description. For example, the user can first upload the file data configured locally to a gateway equipped with a Linux system, and then the physical device driver of the gateway forwards the file data to the server.

[0062] It should be noted that before obtaining the sample message from the data message queue, the gateway connector needs to be paired with the server through handshake. In some implementations, the gateway connector and the server need to be paired through at least three handshakes.

[0063] Specifically, the data packets transmitted to the gateway are arranged in the form of a queue to form a data packet queue to be uploaded to the server, and the data packet queue includes a plurality of ordered data packets. The sample packet is at least a part of the data packets in the data packet queue.

[0064] In some implementations, obtaining a sample message from a data message queue includes:

[0065] The data packets in the data packet queue are forwarded sequentially through a preset protocol stack;

[0066] The first forwarded data packet is used as the sample packet.

[0067] It should be understood that the data packet queue includes multiple ordered data packets. In the process of forwarding the data packet queue to the server, the multiple data packets in the data packet queue are forwarded to the server in sequence, that is, the first data packet in the data packet queue is first forwarded to the server through the preset protocol stack.

[0068] Specifically, in this implementation, after the first data message is forwarded by the preset protocol stack, the first data message forwarded by the protocol stack is used as a sample message, wherein the first data message forwarded by the protocol stack is also called a first packet.

[0069] It should be understood that the first forwarded data packet in the data packet queue is used as a sample packet so that the network connector can learn the first data packet to optimize the forwarding mode of the remaining data packets based on the learned first characteristic parameters and the packet length standard.

[0070] Step 2: Determine the first characteristic parameter of the data message queue and the message length standard according to the sample message.

[0071] It should be understood that after obtaining the sample message, the sample message needs to be learned, specifically, the first characteristic parameter and message length standard of the sample message are obtained for subsequent assembly, encapsulation and splitting of data messages.

[0072] Specifically, the message length standard is the maximum length of TCP data in a fragmented message, namely, MSS, which is the maximum message length that can be sent and received by the internetwork connector and the server.

[0073] In some implementations, the first characteristic parameter includes at least one of the TCP protocol of the server, source port information of the data packet queue, and destination port information of the data packet queue.

[0074] It should be noted that the source port information of the data message queue is the IP header information, which is used to indicate the source port of the data upload. It should be noted that in this embodiment, the source port of the data upload is the port of the internet connector. The destination port information of the data message queue is the MAC header information, which is also called the Ethernet header information, which is used to indicate the destination port of the data upload. It should be noted that in this embodiment, the destination port of the data upload is the port of the server.

[0075] It should be noted that by learning the sample messages, the first characteristic parameters and message length standards of the data message queue can be determined and recorded for subsequent assembly, encapsulation and splitting of data messages. Therefore, the forwarding mode of the remaining data messages can be optimized based on the learned first characteristic parameters and message length standards.

[0076] Step 3: assembling the data messages in the data message queue according to a preset assembly rule to generate a data merging package, wherein the data merging package is composed of at least one data message.

[0077] Specifically, the data packets in the data packet queue are assembled to generate a data merged packet, which is composed of at least one data packet. It is easy to know that the number of data merged packets generated by assembly does not exceed the number of data packets, and each data merged packet contains one or more data packets.

[0078] See also Figure 4 and Figure 5 , Figure 4 A flowchart of the steps of assembling a data message in a data uploading method provided in an embodiment of the present application, Figure 5 A logical judgment diagram for assembling data messages in a data uploading method provided in an embodiment of the present application.

[0079] In some implementations, in step 3, the data packets in the data packet queue are assembled according to a preset assembly rule, specifically including steps 31 to 33:

[0080] Step 31: Sequentially capture individual data packets from the data packet queue, and in the process of capturing any data packet, calculate the total data length of the captured data packets;

[0081] Step 32: When the total data length exceeds a preset length threshold, the last captured data message is put back into the data message queue;

[0082] Step 33: Assemble the captured data packets into a data merge package.

[0083] Specifically, individual data packets are captured from the data packet queue in sequence, and the total data length of the captured data packets is calculated each time a data packet is captured; when the total data length exceeds a preset length threshold, the last captured data packet is put back into the data packet queue, and the remaining captured data packets are assembled into a data merge package.

[0084] The following combination Figure 5 The process of capturing and merging each data message in the data message is described in detail:

[0085] Taking a data packet queue including ordered data packets a, data packets b, data packets c, etc. as an example, first grab data packet a from the data packet queue, then grab data packet b, merge data packet a and data packet b into a large packet, and calculate the total data length of data packet a and data packet b.

[0086] If the total data length of data message a and data message b exceeds the length threshold, data message b is put back to the front end of the data message queue, and the captured data message a is assembled into a data merge package.

[0087] On the other hand, if the total data length of data message a and data message b does not exceed the length threshold, continue to grab data message c from the data message queue, merge data message a, data message b and data message c into a large packet, and calculate the total data length of data message a, data message b and data message c.

[0088] If the total data length of data message a, data message b and data message c exceeds the length threshold, data message c is put back to the front end of the data message queue, and the large packet consisting of data message a, data message b and data message c is output as a data merged packet.

[0089] If the total data length of data packets a, data packets b and data packets c still does not exceed the length threshold, continue to grab the front data packet from the data packet queue, and repeat the steps of calculating the total length of the grabbed data packets and judging and processing according to the total length of the data packets until all data packets in the data packet queue are traversed.

[0090] It should be noted that the total data length is specifically the sum of the data lengths of the captured data packets. It should also be noted that the length threshold specifically includes a first threshold and a second threshold, wherein the first threshold is the length threshold of the data packet limited by the preset TCP available window, which is generally half of the TCP packet window length, and the second threshold is the maximum value of two bytes, i.e. 65535. In fact, when the total data length exceeds at least one of the first threshold and the second threshold, it is regarded as the total data length exceeds the preset length threshold.

[0091] It is easy to know that the number of data merge packages generated by assembly does not exceed the number of data messages, and each data merge package contains one or even multiple data messages. Therefore, in the subsequent forwarding process, the entire data merge package can be encapsulated and split accordingly, thereby avoiding separate processing of each data message, that is, it is not necessary for each data message to go through the complete protocol stack forwarding process, thereby improving the message transmission efficiency, especially the data message upload process using the Linux system. It should also be noted that if each data message is required to go through the complete protocol stack forwarding process, the repeated and cumbersome forwarding processing actions will consume a large amount of CPU (Central Processing Unit) resources of the network connector, reducing the forwarding efficiency. Therefore, the embodiment of the present application effectively simplifies the TCP packet sending process.

[0092] Step 4: When it is detected that the data merged package has a second characteristic parameter that matches the first characteristic parameter, the data merged package is encapsulated to generate an encapsulated merged package.

[0093] Specifically, after the data merge package is assembled and generated, the content in the data merge package is first detected to find out whether the data merge package has a second characteristic parameter that matches the first characteristic parameter.

[0094] It should be noted that the first characteristic parameter includes at least one of the server TCP protocol, the source port information of the data packet queue, and the destination port information of the data packet queue, and the second characteristic parameter corresponds to the first characteristic parameter and may include the server TCP protocol, the source port information of the data packet queue, and the destination port information of the data packet queue that are the same as or similar to the first characteristic parameter. When the second characteristic parameter is detected from the data merging packet, the data merging packet is encapsulated to generate an encapsulated merging packet.

[0095] On the other hand, if it is detected that the data merging packet does not contain the second characteristic parameter, the data merging packet is not encapsulated and the abnormal condition is reported. It should be noted that the data merging packet does not contain the second characteristic parameter, which may be due to insufficient memory of the network connector, abnormality of the data merging packet, or abnormality of the data message in the data merging packet itself.

[0096] In some implementations, encapsulating the data merged package to generate an encapsulated merged package includes:

[0097] Find the TCP data segment in the data merging package, and encapsulate the MAC header information and IP header information for the TCP data segment to generate an encapsulation merging package.

[0098] It should be noted that the data merging package includes at least one data message, and the data message has a TCP data segment. By searching the TCP data segment in the data merging package and encapsulating the MAC header information and IP header information for the TCP data segment, an encapsulated merging package is obtained.

[0099] Step 5: Split the encapsulated and merged packets according to the message length standard to generate the target message, and output the target message to the server.

[0100] Specifically, after encapsulating the data merged packet to generate an encapsulated merged packet, the encapsulated merged packet is split according to a message length standard to generate a target message, and the target message is output to the server through a physical device driver of the gateway.

[0101] In some implementations, splitting the encapsulation and merging packets according to the message length standard to generate the target message includes:

[0102] The encapsulated and merged packet is split according to a message length standard to obtain at least one target message, wherein the data length of the target message does not exceed the message length standard.

[0103] It should be understood that, limited by the port attributes of the gateway and the server, the length of the message that can be sent and received between the gateway and the server cannot exceed the message length standard, i.e., MSS, and therefore it is necessary to split the encapsulated merged packet according to the message length standard to obtain the target message. For example, splitting the encapsulated merged packet according to the message length standard to obtain at least one target message can be splitting from each identification string in the encapsulated merged packet, wherein the interval between adjacent identification strings does not exceed the message length standard.

[0104] It should be noted that in step 4, if it is detected that the data merging package does not contain the second characteristic parameter, the data merging package will not be encapsulated and the abnormal situation will be reported. It should be noted that the data merging package does not contain the second characteristic parameter, which may be due to insufficient memory of the network connector, abnormality of the data merging package, or abnormality of the data message itself in the data merging package.

[0105] In some implementations, the data uploading method provided by the present application further includes:

[0106] When it is detected that the data merging packet does not have a second characteristic parameter matching the first characteristic parameter, the data merging packet is input into a preset network layer, and IP header information is encapsulated for the data merging packet at the network layer;

[0107] Input the data merging packet encapsulated with the IP header information into the preset Ethernet layer, and encapsulate the MAC header information for the data merging packet at the preset Ethernet layer to obtain the target data packet;

[0108] The target data packet is output to the server through the preset physical device driver.

[0109] It should be understood that, in the scenario where it is detected that the data merging package does not have the second characteristic parameter that matches the first characteristic parameter, the data merging package can still be obtained through the preset network layer, Ethernet layer and physical device driver. Specifically, the data merging package is first input into the preset network layer, and the IP header information is encapsulated for the data merging package at the network layer. Then, the data merging package with the encapsulated IP header information is input into the preset Ethernet layer, and the MAC header information is encapsulated for the data merging package at the preset Ethernet layer to obtain the target data packet, and then the target data packet is output to the server through the preset physical device driver.

[0110] Therefore, the embodiment of the present application realizes the parallel operation of the optimized data message forwarding mode and the existing data message forwarding mode, and can realize the forwarding of data messages under the condition that the data merged packet has the second characteristic parameter or does not have the second characteristic parameter. Thus, the complete upload of the data message queue is ensured under the premise of improving the upload and forwarding efficiency.

[0111] See also Figure 6 , Figure 6 A schematic block diagram of the structure of a data uploading device provided in an embodiment of the present application.

[0112] like Figure 6 As shown, an embodiment of the present application also provides a data upload device 5, and the data upload device 5 includes an embodiment of the present application also provides a data upload device, and the data upload device includes at least a memory and a processor, wherein the memory is used to store computer programs, and the processor is used to execute computer programs and implement any one of the data upload methods provided in the specification of this application when executing the computer programs.

[0113] See also Figure 7 , Figure 7 A schematic block diagram of the structure of a network speed detection method provided in an embodiment of the present application.

[0114] like Figure 7 As shown, the network speed detection method provided in the embodiment of the present application includes:

[0115] Execute any one of the data uploading methods provided in the specification of this application, and record the total data size of the data message queue and the total upload time of uploading the data message queue to the server;

[0116] Calculate the target network speed based on the total data size and total upload time.

[0117] For example, the network speed detection method provided in the embodiment of the present application can be applied to the RMS (Rate Monotonic Scheduling) network management node of the network connector.

[0118] Specifically, any one of the data uploading methods provided in the specification of the present application is executed at the network connector, and during the uploading process, the total data size of the data packet queue and the total upload time of uploading the data packet queue to the server are recorded. Thus, the total data size can be divided by the total upload time to obtain the target network speed, thereby accurately calculating the actual network speed at which the local terminal device uploads the data packet queue (file data) to the server.

[0119] See also Figure 8 , Figure 8 A schematic block diagram of the structure of a data uploading device provided in an embodiment of the present application.

[0120] like Figure 8 As shown, the embodiment of the present invention further provides an internetwork connector 20, Figure 8 A schematic diagram of a module structure of a gateway 20 provided in an embodiment of the present invention, such as Figure 8 As shown, the gateway 20 includes a protocol stack module 21 and a device driver packet sending module 22. The protocol stack module 21 includes a large packet assembly unit 211 and a fast forwarding unit 212. The device driver packet sending module 22 includes a sample processing unit 221 and a large packet processing unit 222:

[0121] The sample processing unit 221 is used to obtain a data message queue to be uploaded to the server, obtain a sample message from the data message queue, and determine a first characteristic parameter and a message length standard of the data message queue according to the sample message;

[0122] The large packet assembling unit 211 is used to assemble the data packets in the data packet queue according to a preset assembly rule to generate a data merging packet, wherein the data merging packet is composed of at least one data packet;

[0123] The fast forwarding unit 212 is used for encapsulating the data merged packet to generate an encapsulated merged packet when detecting that the data merged packet has a second characteristic parameter matching the first characteristic parameter;

[0124] The large packet processing unit 222 is used to split the encapsulation and merging packets according to the message length standard to generate a target message, and output the target message to the server.

[0125] In some implementations, the sample processing unit 221 obtains a sample message from a data message queue, including:

[0126] The data packets in the data packet queue are forwarded sequentially through a preset protocol stack;

[0127] The first forwarded data packet is used as the sample packet.

[0128] In some implementations, the large packet assembling unit 211 assembles the data packets in the data packet queue according to a preset assembly rule, including:

[0129] Sequentially capture individual data packets from the data packet queue, and in the process of capturing any data packet, calculate the total data length of the captured data packets;

[0130] When the total data length exceeds the preset length threshold, the last captured data packet is put back into the data packet queue;

[0131] Assemble the captured data packets into a data merge package.

[0132] In some implementations, the large packet processing unit 222 splits, encapsulates and merges packets according to a packet length standard to generate a target packet, including:

[0133] The encapsulated and merged packet is split according to a message length standard to obtain at least one target message, wherein the data length of the target message does not exceed the message length standard.

[0134] In some implementations, encapsulating the data merged package to generate an encapsulated merged package includes:

[0135] Find the TCP data segment in the data merging package, and encapsulate the MAC header information and IP header information for the TCP data segment to generate an encapsulation merging package.

[0136] In some embodiments, the gateway 20 is further configured to:

[0137] When it is detected that the data merging packet does not have a second characteristic parameter matching the first characteristic parameter, the data merging packet is input into a preset network layer, and IP header information is encapsulated for the data merging packet at the network layer;

[0138] Input the data merging packet encapsulated with the IP header information into the preset Ethernet layer, and encapsulate the MAC header information for the data merging packet at the preset Ethernet layer to obtain the target data packet;

[0139] The target data packet is output to the server through the preset physical device driver.

[0140] In some implementations, the first characteristic parameter includes at least one of the TCP protocol of the server, source port information of the data packet queue, and destination port information of the data packet queue.

[0141] Those skilled in the art will understand that Figure 3 , Figure 6 and Figure 8 The structure shown is merely a block diagram of a partial structure related to the embodiment of the present application, and does not constitute a limitation on the data upload method, device, network speed detection method and network connector to which the embodiment of the present application is applied. The specific data upload device and network connector may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0142] In summary, the embodiments of the present application provide a data upload method, device, network speed detection method and network connector. The data upload method provided by the embodiments of the present application includes: obtaining a data packet queue to be uploaded to a server, and obtaining a sample packet from the data packet queue; determining a first characteristic parameter and a message length standard of the data packet queue according to the sample message; assembling the data packets in the data packet queue according to a preset assembly rule to generate a data merge package, wherein the data merge package is composed of at least one data packet; when it is detected that the data merge package has a second characteristic parameter matching the first characteristic parameter, encapsulating the data merge package to generate an encapsulated merge package; splitting the encapsulated merge package according to the message length standard to generate a target message, and outputting the target message to the server, thereby improving the upload speed performance of file data, especially uploading local files to the server.

[0143] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0144] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0145] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A data uploading method, characterized in that: The method comprises: Obtain a data message queue to be uploaded to the server, and obtain a sample message from the data message queue; Determine a first characteristic parameter and a message length standard of the data message queue according to the sample message; Assembling the data packets in the data packet queue according to a preset assembly rule to generate a data merging package, wherein the data merging package is composed of at least one of the data packets; When it is detected that the data merged package has a second characteristic parameter matching the first characteristic parameter, encapsulating the data merged package to generate an encapsulated merged package; The encapsulated and merged packet is split according to the message length standard to generate a target message, and the target message is output to a server.

2. The data uploading method according to claim 1, characterized in that: The acquiring of the sample message from the data message queue comprises: Forwarding the data packets in the data packet queue in sequence through a preset protocol stack; The first forwarded data message is used as the sample message.

3. The data uploading method according to claim 1, characterized in that: The assembling process of the data packets in the data packet queue according to the preset assembly rule includes: Sequentially capturing individual data packets from the data packet queue, and in the process of capturing any of the data packets, calculating the total data length of the captured data packets; When the total data length exceeds a preset length threshold, the last captured data message is put back into the data message queue; The captured data messages are assembled into the data merged package.

4. The data uploading method according to claim 1, characterized in that: The step of splitting the encapsulation and merging packet according to the message length standard to generate a target message includes: The encapsulated merged packet is split according to the message length standard to obtain at least one target message, wherein the data length of the target message does not exceed the message length standard.

5. The data uploading method according to any one of claims 1 to 4, characterized in that: The encapsulating the data merged package to generate an encapsulated merged package includes: Search the TCP data segment in the data merge package, and encapsulate the MAC header information and the IP header information for the TCP data segment to generate the encapsulated merge package.

6. The data uploading method according to any one of claims 1 to 4, characterized in that: The method further comprises: When it is detected that the data merging packet does not have a second characteristic parameter matching the first characteristic parameter, the data merging packet is input into a preset network layer, and IP header information is encapsulated for the data merging packet at the network layer; Input the data merging packet encapsulated with the IP header information into a preset Ethernet layer, and encapsulate the MAC header information for the data merging packet at the preset Ethernet layer to obtain a target data packet; The target data packet is output to the server through a preset physical device driver.

7. The data uploading method according to any one of claims 1 to 4, characterized in that: The first characteristic parameter includes at least one of the TCP protocol of the server, the source port information of the data packet queue, and the destination port information of the data packet queue.

8. A data uploading device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the data uploading method according to any one of claims 1 to 7 when executing the computer program.

9. A network speed detection method, characterized in that: The method comprises: Execute the data uploading method according to any one of claims 1 to 7, and record the total data size of the data message queue and the total uploading time of uploading the data message queue to the server; The target network speed is calculated according to the total data size and the total upload time.

10. A gateway, characterized in that: The gateway includes a protocol stack module and a device driver packet sending module, the protocol stack module includes a large packet assembly unit and a fast forwarding unit, and the device driver packet sending module includes a sample processing unit and a large packet processing unit; The sample processing unit is used to obtain a data message queue to be uploaded to the server, obtain a sample message from the data message queue, and determine a first characteristic parameter and a message length standard of the data message queue according to the sample message; The large packet assembly unit is used to assemble the data packets in the data packet queue according to a preset assembly rule to generate a data merging packet, wherein the data merging packet is composed of at least one of the data packets; The fast forwarding unit is used for encapsulating the data merging packet to generate an encapsulated merging packet when detecting that the data merging packet has a second characteristic parameter matching the first characteristic parameter; The large packet processing unit is used to split the encapsulated and merged packet according to the message length standard to generate a target message, and output the target message to the server.

Citation Information

Cited By

  • Alarm message processing method, storage medium and electronic device

    CN120416003A