Method, device, system, equipment and storage medium for sending data packets
By storing the key identification information of the data packet in the network proxy module and obtaining the data packet from the storage space, the problem of data packet sending failure and loss caused by batch starting network diagnostic tools in the same terminal device is solved, and the data packet sending efficiency of network diagnosis is improved.
Patent Information
- Application Number
- CN202211697012.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-12-28
AI Technical Summary
When multiple network diagnostic tools are launched in batches on the same host device, an excessive number of data packets sent may result in insufficient message queue storage space, causing data packet sending failure or loss, thereby reducing network diagnostic efficiency.
By receiving and storing key identification information of the data packet in the message queue in the network proxy module, the data packet is stored in the storage space, and the identification information of the target data packet is obtained from the message queue to obtain and send the data packet from the storage space, thereby avoiding directly occupying the queue storage space.
It effectively solves the problems of data packet sending failure and abnormality, and improves the efficiency of data packet sending during network diagnosis.
Smart Images

Figure CN116319997B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, system, device, and storage medium for sending a data packet. Background Art
[0002] Currently, when performing network diagnosis, a ping (Packet Internet Groper) tool is commonly used as a network diagnostic tool to test whether data packets can be successfully exchanged (sent and received) between a local host and another host, the network transmission time required for successful data packet exchange, and other network diagnostic information.
[0003] However, in the actual network diagnosis process, multiple network diagnostic tools may be started in batches at the same time in the same host device. At this time, since multiple network diagnostic tools send data packets at the same time, there may be a problem of insufficient storage space in the message queue due to the excessive number of data packets sent, which may easily cause a large number of data packets to fail to be sent or be lost, thereby reducing the efficiency of data packet sending. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method, device, system, equipment and storage medium for sending data packets, which effectively solves the problems of data packet sending failure, sending abnormality, etc. caused by batch startup of network diagnostic tools in the same terminal device, and improves the efficiency of data packet sending during network diagnosis.
[0005] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings.
[0006] In a first aspect, an embodiment of the present application provides a method for sending a data packet, the method being applied to a network proxy module in a first terminal device, the method comprising:
[0007] In response to batch activation of multiple network diagnostic tools in the first terminal device, receiving a first data packet sent by each of the network diagnostic tools;
[0008] storing the first key identification information corresponding to each first data packet in a message queue, and storing each first data packet in a storage space of the network proxy module;
[0009] Obtain the target first key identification information corresponding to the target first data packet currently to be sent from the message queue, and obtain the target first data packet from the storage space based on the obtained target first key identification information, and send the target first data packet to the second terminal device; wherein, the second terminal device and the first terminal device are located in the same network.
[0010] In a second aspect, an embodiment of the present application provides a device for sending a data packet, the device being applied to a network proxy module in a first terminal device, the device comprising:
[0011] a responding unit, configured to receive a first data packet sent by each of the network diagnostic tools in response to batch activation of the plurality of network diagnostic tools in the first terminal device;
[0012] a storage unit, configured to store the first key identification information corresponding to each first data packet in a message queue, and store each first data packet in a storage space of the network proxy module;
[0013] A sending unit is used to obtain the target first key identification information corresponding to the target first data packet currently to be sent from the message queue, so as to obtain the target first data packet from the storage space based on the obtained target first key identification information, and send the target first data packet to the second terminal device; wherein, the second terminal device and the first terminal device are located in the same network.
[0014] In a third aspect, an embodiment of the present application provides a data packet sending system, the sending system comprising a first terminal device and a second terminal device; wherein the second terminal device and the first terminal device are located in the same network; and a network proxy module in the first terminal device is configured to:
[0015] In response to batch activation of multiple network diagnostic tools in the first terminal device, receiving a first data packet sent by each of the network diagnostic tools;
[0016] storing the first key identification information corresponding to each first data packet in a message queue, and storing each first data packet in a storage space of the network proxy module;
[0017] The target first key identification information corresponding to the target first data packet currently to be sent is obtained from the message queue, and the target first data packet is obtained from the storage space based on the obtained target first key identification information, and the target first data packet is sent to the second terminal device.
[0018] In a fourth aspect, an embodiment of the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for sending data packets when executing the computer program.
[0019] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for sending a data packet are executed.
[0020] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0021] The embodiment of the present application provides a method, apparatus, system, device and storage medium for sending a data packet. In response to the batch startup of multiple network diagnostic tools in a first terminal device, the method receives the first data packet sent by each network diagnostic tool; stores the first key identification information corresponding to each first data packet in a message queue, and stores each first data packet in the storage space of a network proxy module; obtains the target first key identification information corresponding to the target first data packet to be sent from the message queue, and obtains the target first data packet from the storage space based on the obtained target first key identification information, and sends the target first data packet to the second terminal device. In this way, the present application effectively solves the problems of data packet sending failure, sending abnormality, etc. caused by batch startup of network diagnostic tools in the same terminal device, and improves the efficiency of data packet sending during network diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 A schematic diagram showing a flow chart of a method for sending a data packet provided in an embodiment of the present application is shown;
[0024] Figure 2 A schematic diagram showing a flow chart of a method for receiving a data packet provided in an embodiment of the present application is shown;
[0025] Figure 3 A flow chart of a method for determining a reception status of a target first data packet provided by an embodiment of the present application is shown;
[0026] Figure 4A schematic diagram showing the structure of a device for sending a data packet provided in an embodiment of the present application is shown;
[0027] Figure 5 A schematic diagram illustrating the structure of a data packet sending system provided in an embodiment of the present application is shown;
[0028] Figure 6 A schematic diagram of the structure of a computer device 600 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of illustration and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art, under the guidance of the contents of this application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0030] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0031] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0032] Currently, during the actual network diagnosis process, multiple network diagnostic tools may be launched simultaneously in batches on the same host device. At this time, since multiple network diagnostic tools send data packets at the same time, there may be a problem of insufficient storage space in the message queue due to the excessive number of data packets sent, which may easily cause a large number of data packets to fail to be sent or be lost, reducing the efficiency of data packet sending.
[0033] Based on this, the embodiment of the present application provides a method, apparatus, system, device and storage medium for sending data packets, which responds to the batch startup of multiple network diagnostic tools in a first terminal device, receives the first data packet sent by each network diagnostic tool; stores the first key identification information corresponding to each first data packet in a message queue, and stores each first data packet in the storage space of a network proxy module; obtains the target first key identification information corresponding to the target first data packet currently to be sent from the message queue, and obtains the target first data packet from the storage space based on the obtained target first key identification information, and sends the target first data packet to the second terminal device. In this way, the present application effectively solves the problems of data packet sending failure, sending abnormality, etc. caused by batch startup of network diagnostic tools in the same terminal device, and improves the efficiency of data packet sending during network diagnosis.
[0034] To facilitate understanding of the embodiments of the present application, the following is a detailed introduction to a method, apparatus, system, device, and storage medium for sending a data packet provided in the embodiments of the present application.
[0035] Reference Figure 1 As shown, Figure 1 A flow chart of a method for sending a data packet provided in an embodiment of the present application is shown, wherein the sending method is applied to a network proxy module in a first terminal device, and the sending method includes steps S101-S103; specifically:
[0036] S101 , in response to batch activation of multiple network diagnostic tools in the first terminal device, receiving a first data packet sent by each of the network diagnostic tools.
[0037] Here, the first terminal device includes multiple network diagnostic tools and at least one network agent module; wherein, in the first terminal device, multiple network diagnostic tools can be started in batches at the same time. The embodiment of the present application does not impose any limitation on the specific number of network diagnostic tools started in batches.
[0038] Specifically, after starting multiple network diagnostic tools in batches, the network proxy module is used to receive the first data packet sent by each network diagnostic tool, and send each received first data packet in sequence to other terminal devices (i.e., terminal devices that exchange data with the first terminal device) in the order of sending time, so as to realize the network diagnostic function of each network diagnostic tool through the sending and receiving of data packets between the first terminal device and other terminal devices.
[0039] It should be noted that the above-mentioned network diagnostic tool can be a ping tool, or other types of network diagnostic tools such as a traceroute tool; the embodiment of the present application does not impose any limitation on the specific tool type of the above-mentioned network diagnostic tool.
[0040] It should be noted that when multiple network diagnostic tools are started in batches, each network diagnostic tool can send one first data packet or multiple first data packets. The embodiment of the present application does not impose any limitation on the specific number of the above-mentioned first data packets received.
[0041] It should be noted that the above-mentioned first data packet is only used to represent the data packet sent by the network diagnostic tool for network diagnosis; the specific data packet type of the above-mentioned first data packet can be determined according to the tool type of the network diagnostic tool. For example, when the network diagnostic tool is a ping tool, the first data packet can be an ICMP (Internet Control Message Protocol) data packet; the embodiment of the present application does not impose any limitation on the specific data packet type to which the above-mentioned first data packet belongs.
[0042] S102: Store the first key identification information corresponding to each first data packet in a message queue, and store each first data packet in a storage space of the network proxy module.
[0043] Here, in the network diagnosis process, the data packet is equivalent to the data unit transmitted between the first terminal device and the other terminal devices (wherein the first terminal device sends the first data packet to the other terminal devices, and the other terminal devices feed back other data packets to the first terminal device), wherein, on the side of the first terminal device, the above-mentioned message queue is equivalent to a container for storing the first data packet in the process of the first terminal device sending the first data packet in sequence.
[0044] Specifically, considering that the storage space of the message queue is limited, when a large number of first data packets are directly stored in the message queue, it is easy for a large number of first data packets to fail to be sent or be lost due to insufficient storage space in the message queue. Therefore, in an embodiment of the present application, for each first data packet received, the first data packet itself is not directly stored in the message queue. The message queue only stores the first key identification information that can identify the identity of each first data packet, and the first data packet that occupies more storage space is stored in the storage space of the network proxy module (wherein, the network proxy module belongs to the first terminal device, and the first data packet is also equivalent to being stored in the first terminal device), so that the first data packet does not occupy the storage resources in the message queue, greatly saving the storage space of the message queue, and is conducive to increasing the information capacity that can be stored in the message queue. Therefore, compared with the existing technology (i.e. directly storing the first data packet in the message queue), when using a message queue with the same storage capacity, the embodiment of the present application can receive a larger number of first data packets, effectively improving the sending efficiency of the first data packets.
[0045] It should be noted that the above-mentioned first key identification information is used to represent the key information that can identify the identity of different first data packets (for example, it can be the sender information, sending time information, etc. of different first data packets), and the first key identification information corresponding to different first data packets is different; the embodiment of this application does not impose any restrictions on the specific information content included in the above-mentioned first key identification information.
[0046] It should be noted that, unlike the above-mentioned first key identification information, although the senders (i.e., specific network diagnostic tools) and sending times corresponding to different first data packets may be different, since the function of the first data packet is to implement network diagnosis at the first terminal device, the actual packet content corresponding to different first data packets is the same. The embodiment of the present application is equivalent to storing the actual packet content corresponding to each first data packet outside the message queue (i.e., storing it in the storage space of the network proxy module).
[0047] S103, obtaining the target first key identification information corresponding to the target first data packet currently to be sent from the message queue, obtaining the target first data packet from the storage space based on the obtained target first key identification information, and sending the target first data packet to the second terminal device.
[0048] Here, in combination with the aforementioned step S102, it can be seen that the different first key identification information stored in the message queue is used to determine the specific identities of different first data packets. Therefore, when the network processing module processes the received first data packets in sequence through the message queue (that is, in accordance with the order of the reception time of the first data packets, the first data packets with earlier reception time are processed in sequence), it is only necessary to obtain the target first key identification information corresponding to the target first data packet currently to be sent from the message queue, and then, based on the obtained target first key identification information, the previously stored target first data packet (that is, the actual packet content of the target first data packet) can be called out from the storage space of the network proxy module, and the called out target first data packet can be sent to the second terminal device (that is, the other terminal devices used for data transmission with the first terminal device in the above S101-S102).
[0049] It should be noted that the second terminal device and the first terminal device are located in the same network, wherein the first terminal device and the second terminal device can be located in the Internet or in other networks other than the Internet (such as the visual network). The embodiments of this application do not impose any restrictions on the specific network in which the first terminal device and the second terminal device are located.
[0050] The specific implementation process of each of the above steps in the embodiment of this application is described in detail below:
[0051] Regarding the data packet sending method provided in the above steps S101-S103, when the first terminal device and the second terminal device are located in the Internet, the first terminal device can send the first data packet to the second terminal device based on the IP (Internet Protocol Address) address of the second terminal device. Correspondingly, the second terminal device can also feed back the second data packet in reply to the first data packet to the first terminal device based on the IP address of the first terminal device.
[0052] Regarding the data packet sending method provided in steps S101-S103 above, when the first terminal device and the second terminal device are located in a first network different from the Internet, before batch-activating multiple network diagnostic tools in the first terminal device (i.e., before executing step S101 above), the network proxy module needs to execute the method described in step a1 below to perform a network access operation in the first network, so that the first terminal device and the second terminal device can perform data transmission in the first network. Specifically:
[0053] Step a1: In the first network, a target communication identifier is allocated to the first terminal device.
[0054] Here, the above-mentioned target communication identifier is used to determine the corresponding communication address of the first terminal device in the first network; wherein, the above-mentioned target communication identifier can be the MAC (Media Access Control) address of the first terminal device in the first network or the device communication identifier, etc., which can uniquely determine the communication address of the first terminal device in the first network; the embodiment of this application does not impose any limitation on the specific identification type of the above-mentioned target communication identifier.
[0055] Specifically, taking the first network as the visual network as an example, the above-mentioned target communication identifier can be the visual network MAC address and visual network number corresponding to the first terminal; wherein, the visual network MAC address and the visual network number correspond one-to-one to the visual network device, the visual network MAC address can be obtained through pre-configuration, and the visual network number can be automatically obtained during the network access protocol driving process, and this embodiment of the application does not impose any limitations on this.
[0056] It should be noted that when the first terminal device and the second terminal device are located in a first network different from the Internet, the second terminal device also needs to perform a network access operation before transmitting data with the first terminal device, just like the first terminal device, that is, it is also necessary to configure a communication identifier for the second terminal device in the first network; the communication identifier is also used to determine the corresponding communication address of the second terminal device in the first network; the repetitions will not be repeated here.
[0057] Regarding the specific implementation process of step S102, it can be seen from the above step S102 that the embodiment of the present application does not limit the specific information content of the first key identification information corresponding to each first data packet; wherein, in a preferred embodiment, taking a first data packet as an example, the first key identification information corresponding to the first data packet includes at least one of the following:
[0058] 1. The message number corresponding to the first data packet in the message queue.
[0059] Here, after receiving the first data packets sent by multiple network diagnostic tools, the network agent module will sort the first data packets according to the reception time of each first data packet to obtain the above-mentioned message number corresponding to each first data packet; at this time, the above-mentioned message number can also be used to determine the specific number position of the first key identification information corresponding to the first data packet in the message queue.
[0060] For example, if the receiving time of the first data packets is arranged as follows: the receiving time of the first data packet x1 is earlier than that of the first data packet x2, it can be determined that the message number corresponding to the first data packet x1 is p1 and the message number corresponding to the first data packet x2 is p2.
[0061] 2. The process ID corresponding to the first data packet.
[0062] Here, the process ID is used to identify the network diagnostic tool that sends the first data packet, that is, the process ID is used to identify the specific sender of the first data packet.
[0063] For example, taking the case where all of the multiple network diagnostic tools in the first terminal device are ping tools, when the process ID corresponding to the first data packet x1 is ping-v1, it indicates that the first data packet x1 is the first data packet sent by the network diagnostic tool v1.
[0064] 3. The packet sending sequence number corresponding to the first data packet.
[0065] Here, similar to the above-mentioned message number, the packet sending sequence number is used to determine the packet sending order corresponding to the first data packet among all first data packets.
[0066] For example, taking the packet sending sequence as: first data packet x1, first data packet x2...first data packet x200 as an example, the packet sending sequence number corresponding to first data packet x3 is 3, indicating that first data packet x3 is located at the third position in the packet sending sequence.
[0067] 4. The sending time of the first data packet.
[0068] Here, during the network diagnosis process, the network transmission time needs to be determined based on the sending time of the first data packet and the receiving time of the second data packet (that is, the data packet that the second terminal device replies to the same first data packet). Therefore, in order to improve the calculation efficiency of the network transmission time, the specific sending time corresponding to each first data packet can also be stored in the message queue.
[0069] 5. The packet size corresponding to the first data packet.
[0070] Here, the packet sizes corresponding to different first data packets may be different. When the first data packet is actually sent, if the packet size of the first data packet is stored in the message queue, the network proxy module can predict in advance the data transmission resources required to send the first data packet based on the obtained packet size of the first data packet before sending the first data packet, so as to improve the allocation efficiency of data transmission resources. Based on this, the packet size corresponding to the first data packet can also be stored in the message queue.
[0071] It should be noted that, in addition to the first key identification information described in 1-5 above, other types of information can also be stored in the message queue as the first key identification information according to different network diagnostic needs. For example, when the data packet transmission involves encryption and decryption steps, the encryption key of each first data packet can also be stored in the message queue so that the network proxy module can encrypt the first data packet more conveniently before sending the first data packet. The embodiments of this application do not impose any restrictions on the specific information content of the above-mentioned first key identification information.
[0072] Regarding the data packet sending method provided in the above steps S101-S103, after executing the above step S103, the network proxy module also needs to receive a second data packet fed back by the second terminal device to determine the network transmission status between the first terminal device and the second terminal device based on the sending status of the first data packet and the receiving status of the second data packet.
[0073] Based on this, in an optional implementation, Figure 2 A flow chart of a method for receiving a data packet provided in an embodiment of the present application is shown. Figure 2 As shown, the receiving method includes steps S201-S203, specifically:
[0074] S201: Receive a second data packet sent by the second terminal device.
[0075] Here, it should be noted that the above-mentioned second data packet is a data packet that the second terminal device replies to the received first data packet. The embodiment of the present application also does not impose any limitation on the specific data packet type to which the above-mentioned second data packet belongs.
[0076] Specifically, the above-mentioned second data packet is a data packet that the second terminal device replies to the received first data packet. Since the second terminal device may receive all the sent first data packets, or may only receive part of the sent first data packets, the specific number of second data packets received by the network proxy module may be the same as the number of sent first data packets, or may be different from the number of sent first data packets. The embodiment of the present application also does not impose any limitation on the specific number of received second data packets.
[0077] S202: According to the second key identification information corresponding to the second data packet, determine from the message queue the first key identification information that matches the second key identification information as the target key identification information, and delete the target key identification information from the message queue.
[0078] Here, the second key identification information corresponding to the second data packet can refer to the first key identification information corresponding to the first data packet described in the aforementioned steps; the repeated parts are not repeated here.
[0079] It should be noted that the second terminal device will not modify the first key identification information corresponding to the received first data packet, but will only determine the corresponding reply content as the content of the second data packet based on the actual content of the first data packet.
[0080] For example, taking the example of the first key identification information of the first data packet x1 including the message number p1, if the second terminal device receives the first data packet x1, the second data packet fed back by the second terminal device for the first data packet x1 is y1, and the second key identification information corresponding to the second data packet y1 also includes the message number p1. At this time, after receiving the second data packet y1, the network proxy device can determine that the second data packet y1 corresponds to the first data packet x1 based on the matching message number p1, thereby determining that the first data packet x1 is sent successfully, and delete the first key identification information of the first data packet x1 from the message queue to indicate that no related processing operations are required for the first data packet x1.
[0081] S203 determines a network diagnosis result corresponding to the target network diagnosis tool according to the sending time of the first data packet and the receiving time of the second data packet corresponding to the target key identification information.
[0082] Here, the first data packet sent by the target network diagnostic tool is the first data packet corresponding to the target key identification information.
[0083] Specifically, the above-mentioned second data packet is the data packet that the second terminal device replies to the first data packet corresponding to the target key identification information. At this time, the network proxy module can determine the network transmission time of the first data packet based on the time difference between the sending time of the first data packet and the receiving time of the above-mentioned second data packet, that is, determine the network diagnostic result corresponding to the target network diagnostic tool (the sender of the first data packet).
[0084] As an example, taking the case where the first data packet sent by the network diagnostic tool v1 is x1 and the first data packet sent by the network diagnostic tool v2 is x2, if the second data packet y1 fed back by the second terminal device in response to the first data packet x1 and the second data packet y2 fed back in response to the first data packet x2 are received, then based on the time difference t2 between the sending time t1 of the first data packet x1 and the receiving time t2 of the second data packet y1, it can be determined that the network diagnostic result corresponding to the network diagnostic tool v1 is: the network transmission time is t2-t1; based on the time difference t3 between the sending time t3 of the first data packet x2 and the receiving time t4 of the second data packet y2, it can be determined that the network diagnostic result corresponding to the network diagnostic tool v2 is: the network transmission time is t4-t3.
[0085] Regarding the data packet receiving method provided in the above steps S201-S203, considering that after sending the target first data packet, the second terminal device may or may not receive the target first data packet, therefore, in an embodiment of the present application, a confirmation mechanism is also provided so that the network proxy module can pre-determine the reception status of the second terminal device for each first data packet before actually receiving the second data packet fed back by the second terminal device based on whether the second terminal device replies with confirmation reception information for the target first data packet within a preset detection period.
[0086] Based on this, in an optional implementation, Figure 3 FIG. 1 shows a flow chart of a method for determining the reception status of a target first data packet provided by an embodiment of the present application, such as Figure 3 As shown, after executing the above step S103, the method includes steps S301-S303, specifically:
[0087] S301, determining whether target confirmation information fed back by the second terminal device for the target first data packet is received within a preset detection period.
[0088] Here, the specific time length of the above-mentioned preset detection period can be set according to actual network diagnosis requirements. The embodiment of the present application does not impose any limitation on the specific time length of the above-mentioned preset detection period.
[0089] Here, the above-mentioned target confirmation information is only used to indicate that the second terminal device confirms that it has received the target first data packet. The embodiment of the present application does not impose any limitation on the specific information content of the above-mentioned target confirmation information.
[0090] Specifically, in a preferred embodiment, the above-mentioned target confirmation information received may be sent by the second terminal device in an asynchronous manner; wherein the asynchronous manner is used to characterize that the sending process of the target confirmation information and the sending process of the target first data packet belong to different processes; for example, if the network proxy module sends the target first data packet to the second terminal device through the first transmission channel, the second terminal device may feedback the above-mentioned target confirmation information to the network proxy module through the second transmission channel, so as to improve the reception efficiency of the target confirmation information in an asynchronous manner.
[0091] S302: If the target confirmation information is received within the preset detection period, it is determined that the second terminal device has successfully received the target first data packet.
[0092] Specifically, if the above-mentioned target confirmation information is received within the preset detection period, it can be determined that the second terminal device has successfully received the target first data packet. At this time, the network proxy device only needs to wait for the second terminal device to feedback a reply data packet for the target first data packet (that is, the second data packet corresponding to the target first data packet).
[0093] S303: If the target confirmation information is not received within the preset detection period, resend the target first data packet to the second terminal device.
[0094] Here, if the target confirmation information is not received within the preset detection period, the network proxy module can resend the target first data packet to the second terminal device to reduce the packet loss rate of the first data packet; wherein, the number of resending can be 1 time or multiple times, and the embodiment of the present application does not impose any limitation on the specific number of resending times.
[0095] Specifically, if the number of retransmissions of the target first data packet to the second terminal device exceeds a preset frequency threshold, then in an optional implementation, the network proxy module can determine that the target first data packet is a data packet that failed to be sent, and delete the first key identification information corresponding to the target first data packet from the message queue to indicate that no further processing operations are required on the target first data packet.
[0096] Based on the same inventive concept, the present application also provides a sending device corresponding to the above-mentioned data packet sending method. Since the principle of solving the problem by the sending device in the embodiment of the present application is similar to the above-mentioned data packet sending method in the embodiment of the present application, the implementation of the sending device can refer to the implementation of the above-mentioned sending method, and the repeated parts will not be repeated.
[0097] Reference Figure 4 As shown, Figure 4A schematic diagram of the structure of a data packet sending device provided in an embodiment of the present application is shown. The sending device is applied to a network proxy module in a first terminal device, and the sending device includes:
[0098] The responding unit 401 is configured to receive a first data packet sent by each of the network diagnostic tools in response to batch activation of the plurality of network diagnostic tools in the first terminal device;
[0099] The storage unit 402 is configured to store the first key identification information corresponding to each first data packet in a message queue, and store each first data packet in a storage space of the network proxy module;
[0100] The sending unit 403 is used to obtain the target first key identification information corresponding to the target first data packet currently to be sent from the message queue, so as to obtain the target first data packet from the storage space based on the obtained target first key identification information, and send the target first data packet to the second terminal device; wherein, the second terminal device and the first terminal device are located in the same network.
[0101] In an optional implementation, the first key identification information includes at least one of the following:
[0102] The message number corresponding to the first data packet in the message queue;
[0103] The process ID corresponding to the first data packet; wherein the process ID is used to identify the network diagnostic tool that sends the first data packet;
[0104] The packet sending sequence number corresponding to the first data packet;
[0105] The sending time corresponding to the first data packet;
[0106] The packet size corresponding to the first data packet.
[0107] In an optional implementation, after sending the target first data packet to the second terminal device, the sending unit 403 is further configured to:
[0108] Determining whether target confirmation information fed back by the second terminal device for the target first data packet is received within a preset detection period;
[0109] If the target confirmation information is received within the preset detection period, it is determined that the second terminal device has successfully received the target first data packet;
[0110] If the target confirmation information is not received within the preset detection period, the target first data packet is resent to the second terminal device.
[0111] In an optional implementation, the sending device further includes:
[0112] a receiving unit, configured to receive a second data packet sent by the second terminal device;
[0113] a matching unit, configured to determine, from the message queue, first key identification information that matches the second key identification information according to the second key identification information corresponding to the second data packet as target key identification information, and delete the target key identification information from the message queue;
[0114] A determination unit is used to determine the network diagnostic result corresponding to the target network diagnostic tool based on the sending time of the first data packet corresponding to the target key identification information and the receiving time of the second data packet; wherein, the first data packet sent by the target network diagnostic tool is the first data packet corresponding to the target key identification information.
[0115] In an optional implementation, when the first terminal device is located in a first network different from the Internet, before batch starting the multiple network diagnostic tools in the first terminal device, the response unit 401 is further configured to:
[0116] In the first network, a target communication identifier is allocated to the first terminal device; wherein the target communication identifier is used to determine a corresponding communication address of the first terminal device in the first network.
[0117] In an optional embodiment, the target confirmation information received by the sending unit 403 is sent by the second terminal device in an asynchronous manner; wherein the asynchronous manner is used to indicate that the sending process of the target confirmation information and the sending process of the target first data packet belong to different processes.
[0118] Based on the same inventive concept, the present application also provides a data packet sending system corresponding to the above-mentioned data packet sending method. Since the principle of solving the problem by the sending system in the embodiment of the present application is similar to the above-mentioned sending method in the embodiment of the present application, the implementation of the sending system can refer to the implementation of the above-mentioned sending method, and the repeated parts will not be repeated.
[0119] Reference Figure 5 As shown, Figure 5 A schematic diagram of the structure of a data packet sending system provided in an embodiment of the present application is shown. The sending system includes a first terminal device 501 and a second terminal device 502. The second terminal device 502 and the first terminal device 501 are located in the same network. The network proxy module 500 in the first terminal device 501 is configured to:
[0120] In response to batch activation of multiple network diagnostic tools in the first terminal device 501, receiving a first data packet sent by each of the network diagnostic tools;
[0121] storing the first key identification information corresponding to each first data packet in a message queue, and storing each first data packet in a storage space of the network proxy module 500;
[0122] The target first key identification information corresponding to the target first data packet currently to be sent is obtained from the message queue, and the target first data packet is obtained from the storage space based on the obtained target first key identification information, and the target first data packet is sent to the second terminal device 502.
[0123] In an optional implementation, the first key identification information includes at least one of the following:
[0124] The message number corresponding to the first data packet in the message queue;
[0125] The process ID corresponding to the first data packet; wherein the process ID is used to identify the network diagnostic tool that sends the first data packet;
[0126] The packet sending sequence number corresponding to the first data packet;
[0127] The sending time corresponding to the first data packet;
[0128] The packet size corresponding to the first data packet.
[0129] In an optional implementation, after sending the target first data packet to the second terminal device, the network proxy module 500 is further configured to:
[0130] Determine whether target confirmation information fed back by the second terminal device 502 for the target first data packet is received within a preset detection period;
[0131] If the target confirmation information is received within the preset detection period, it is determined that the second terminal device 502 has successfully received the target first data packet;
[0132] If the target confirmation information is not received within the preset detection period, the target first data packet is resent to the second terminal device 502.
[0133] In an optional embodiment, the network proxy module 500 is further configured to:
[0134] receiving a second data packet sent by the second terminal device 502;
[0135] According to the second key identification information corresponding to the second data packet, determining, from the message queue, first key identification information that matches the second key identification information as target key identification information, and deleting the target key identification information from the message queue;
[0136] The network diagnostic result corresponding to the target network diagnostic tool is determined according to the sending time of the first data packet corresponding to the target key identification information and the receiving time of the second data packet; wherein the first data packet sent by the target network diagnostic tool is the first data packet corresponding to the target key identification information.
[0137] In an optional embodiment, when the first terminal device 501 is located in a first network different from the Internet, before batch starting the multiple network diagnostic tools in the first terminal device 501, the network agent module 500 is further configured to:
[0138] In the first network, a target communication identifier is allocated to the first terminal device 501; wherein the target communication identifier is used to determine the corresponding communication address of the first terminal device 501 in the first network.
[0139] In an optional embodiment, the target confirmation information received by the network proxy module 500 is sent by the second terminal device 502 in an asynchronous manner; wherein the asynchronous manner is used to indicate that the sending process of the target confirmation information and the sending process of the target first data packet belong to different processes.
[0140] like Figure 6 As shown, an embodiment of the present application provides a computer device 600 for executing the steps of any of the methods for sending data packets described in the present application. The device includes a memory 601, a processor 602, and a computer program stored on the memory 601 and executable on the processor 602, wherein the processor 602 implements the steps of any of the methods for sending data packets described above when executing the computer program.
[0141] Specifically, the above-mentioned memory 601 and processor 602 can be general-purpose memory and processor, which are not specifically limited here. When the processor 602 runs the computer program stored in the memory 601, it can execute the steps of any of the above-mentioned data packet sending methods.
[0142] Corresponding to the method for sending data packets in the present application, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for sending data packets are executed.
[0143] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, it can execute the steps of any of the above-mentioned data packet sending methods.
[0144] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of the system or unit, which may be electrical, mechanical or other forms.
[0145] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0146] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0147] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0148] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0149] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present application, or make equivalent replacements for some of the technical features thereof. However, these modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for sending a data packet, characterized in that: The sending method is applied to a network proxy module in a first terminal device, and the method includes: In response to batch activation of multiple network diagnostic tools in the first terminal device, receiving a first data packet sent by each of the network diagnostic tools; Storing the first key identification information corresponding to each first data packet in a message queue, and storing each first data packet in a storage space of the network proxy module; wherein the storage space occupied by the first key identification information is smaller than the storage space occupied by the first data packet; Obtaining, from the message queue, target first key identification information corresponding to a target first data packet currently to be sent, obtaining the target first data packet from the storage space based on the obtained target first key identification information, and sending the target first data packet to a second terminal device; wherein the second terminal device and the first terminal device are located in the same network; The sending method further includes: receiving a second data packet sent by the second terminal device; According to the second key identification information corresponding to the second data packet, determining, from the message queue, first key identification information that matches the second key identification information as target key identification information, and deleting the target key identification information from the message queue; The network diagnostic result corresponding to the target network diagnostic tool is determined according to the sending time of the first data packet corresponding to the target key identification information and the receiving time of the second data packet; wherein the first data packet sent by the target network diagnostic tool is the first data packet corresponding to the target key identification information.
2. The sending method according to claim 1, wherein: The first key identification information includes at least one of the following: The message number corresponding to the first data packet in the message queue; The process ID corresponding to the first data packet; wherein the process ID is used to identify the network diagnostic tool that sends the first data packet; The packet sending sequence number corresponding to the first data packet; The sending time corresponding to the first data packet; The packet size corresponding to the first data packet.
3. The sending method according to claim 1, wherein: After sending the target first data packet to the second terminal device, the sending method further includes: Determining whether target confirmation information fed back by the second terminal device for the target first data packet is received within a preset detection period; If the target confirmation information is received within the preset detection period, it is determined that the second terminal device has successfully received the target first data packet; If the target confirmation information is not received within the preset detection period, the target first data packet is resent to the second terminal device.
4. The sending method according to claim 1, wherein: When the first terminal device is located in a first network different from the Internet, before batch starting the multiple network diagnostic tools in the first terminal device, the sending method further includes: In the first network, a target communication identifier is allocated to the first terminal device; wherein the target communication identifier is used to determine a corresponding communication address of the first terminal device in the first network.
5. The sending method according to claim 3, wherein: The received target confirmation information is sent by the second terminal device in an asynchronous manner; wherein the asynchronous manner is used to indicate that the sending process of the target confirmation information and the sending process of the target first data packet belong to different processes.
6. A device for sending a data packet, characterized in that: The sending device is applied to a network proxy module in the first terminal device, and the sending device includes: a responding unit, configured to receive a first data packet sent by each of the network diagnostic tools in response to batch activation of the plurality of network diagnostic tools in the first terminal device; a storage unit, configured to store the first key identification information corresponding to each first data packet in a message queue, and store each first data packet in a storage space of the network proxy module; wherein the storage space occupied by the first key identification information is smaller than the storage space occupied by the first data packet; a sending unit, configured to obtain, from the message queue, target first key identification information corresponding to the target first data packet currently to be sent, obtain the target first data packet from the storage space based on the obtained target first key identification information, and send the target first data packet to a second terminal device; wherein the second terminal device and the first terminal device are located in the same network; Wherein, the sending device further includes: a receiving unit, configured to receive a second data packet sent by the second terminal device; a matching unit, configured to determine, from the message queue, first key identification information that matches the second key identification information according to the second key identification information corresponding to the second data packet as target key identification information, and delete the target key identification information from the message queue; A determination unit is used to determine the network diagnostic result corresponding to the target network diagnostic tool based on the sending time of the first data packet corresponding to the target key identification information and the receiving time of the second data packet; wherein, the first data packet sent by the target network diagnostic tool is the first data packet corresponding to the target key identification information.
7. A data packet sending system, characterized in that: The sending system includes a first terminal device and a second terminal device; wherein the second terminal device and the first terminal device are located in the same network; and the network proxy module in the first terminal device is configured to: In response to batch activation of multiple network diagnostic tools in the first terminal device, receiving a first data packet sent by each of the network diagnostic tools; Storing the first key identification information corresponding to each first data packet in a message queue, and storing each first data packet in a storage space of the network proxy module; wherein the storage space occupied by the first key identification information is smaller than the storage space occupied by the first data packet; Obtaining, from the message queue, target first key identification information corresponding to the target first data packet currently to be sent, obtaining the target first data packet from the storage space according to the obtained target first key identification information, and sending the target first data packet to the second terminal device; Wherein, the network proxy module is further used for: receiving a second data packet sent by the second terminal device; According to the second key identification information corresponding to the second data packet, determining, from the message queue, first key identification information that matches the second key identification information as target key identification information, and deleting the target key identification information from the message queue; The network diagnostic result corresponding to the target network diagnostic tool is determined according to the sending time of the first data packet corresponding to the target key identification information and the receiving time of the second data packet; wherein the first data packet sent by the target network diagnostic tool is the first data packet corresponding to the target key identification information.
8. An electronic device, characterized in that: include: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the steps of the method for sending a data packet as described in any one of claims 1 to 5 are performed.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for sending a data packet according to any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
TCP sending algorithm based on sending window and reciprocating time
CN101052043A
Content filtering gateway realizing method based on network filter
CN101068229A
Storm attack resisting method and apparatus
CN101286996A