Network detection method and device, equipment and storage medium

By dividing network addresses into packets and using coroutines to perform network detection, the problem of excessive resource consumption in the prior art is solved, and fast and accurate network detection under multiple network addresses is achieved.

CN119892682APending Publication Date: 2025-04-25HANGZHOU NETEASE ZHIQI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998303.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When conducting network detection of multiple network addresses in the prior art, multiple processes need to be run concurrently, resulting in excessive resource consumption and inability to ensure timeliness and accuracy.

Method used

By dividing large-scale network addresses into multiple network address packets, each packet is associated with a coroutine, the network detection process is performed concurrently by using coroutines, sending a detection request message and receiving a response message, and determining the network detection result based on the detection sequence number.

Benefits of technology

It realizes fast network detection under multiple network addresses, reduces resource consumption, ensures the timeliness and accuracy of network detection, and improves network detection performance and timeliness of fault detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892682A_ABST
    Figure CN119892682A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a network detection method and device, equipment and a storage medium. The method comprises the steps that through a first coroutine corresponding to each network address group, a detection request message of each network address in the network address group is sent, and the detection request message of each network address at least comprises a detection serial number of the network address; receiving a detection response message fed back to each detection request message through a second coroutine, wherein the detection response message at least comprises a detection serial number carried in the detection request message corresponding to the detection response message; and determining a network detection result of the network address according to the detection request message and the detection response message under the detection serial number of each network address. According to the embodiment of the invention, resource consumption during network detection under multiple network addresses can be reduced, network detection timeliness and accuracy under the multiple network addresses are ensured, and network detection performance and network fault discovery timeliness under the multiple network addresses are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and specifically to a network detection method, device, equipment and storage medium. Background Art

[0002] With the rapid development of distributed architecture, the number of host nodes in the computer room network has also grown rapidly. In order to ensure the efficiency and security of the computer room network, the ping program can usually be started to use the Internet Control Message Protocol (ICMP) to send the corresponding ICMP request message to the target end, and the target end will feedback the corresponding ICMP response message, so as to detect the network delay, packet loss and other performance of the target end's network address.

[0003] However, since the ping program is a serial process, when performing network detection on the network addresses of multiple target ends, it is usually necessary to run multiple processes concurrently to implement network detection under multiple network addresses, which greatly reduces the network detection performance and cannot guarantee the timeliness of network detection. Summary of the invention

[0004] The embodiments of the present application provide a network detection method, apparatus, device and storage medium to reduce resource consumption when performing network detection under multiple network addresses, ensure the timeliness and accuracy of network detection under multiple network addresses, and improve network detection performance under multiple network addresses.

[0005] In a first aspect, an embodiment of the present application provides a network detection method, the method comprising:

[0006] Sending, through the first coroutine corresponding to each network address group, a detection request message for each network address in the network address group, wherein the detection request message for each network address at least includes a detection sequence number of the network address;

[0007] Receiving, through the second coroutine, a probe response message for each probe request message feedback, wherein the probe response message includes at least a probe sequence number carried in the probe request message corresponding to the probe response message;

[0008] The network detection result of each network address is determined according to the detection request message and the detection response message under the detection sequence number of the network address.

[0009] In a second aspect, an embodiment of the present application provides a network detection device, the device comprising:

[0010] A detection request module, used to send a detection request message of each network address in the network address group through a first coroutine corresponding to each network address group, wherein the detection request message of each network address at least includes a detection sequence number of the network address;

[0011] A detection response module, configured to receive, through a second coroutine, a detection response message for each detection request message feedback, wherein the detection response message includes at least a detection sequence number carried in a detection request message corresponding to the detection response message;

[0012] The network detection module is used to determine the network detection result of each network address according to the detection request message and the detection response message under the detection sequence number of each network address.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0014] A processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the network detection method provided in the first aspect of the present application.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the network detection method provided in the first aspect of the present application.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the network detection method provided in the first aspect of the present application.

[0017] The technical solution provided by the embodiment of the present application can divide large-scale network addresses into multiple network address groups for network detection under large-scale network addresses. Thus, the detection request message of each network address in the network address group is sent through the first coroutine corresponding to each network address group, and the detection request message of each network address at least includes the detection sequence number of the network address. Then, the detection response message for each detection request message feedback is received through the second coroutine, and the detection response message at least includes the detection sequence number carried in the detection request message corresponding to the detection response message. Furthermore, according to the detection request message and the detection response message under the detection sequence number of each network address, the network detection result of the network address can be determined, so that the fast network detection under multiple network addresses can be realized with high performance through a first coroutine and a second coroutine, reducing the resource consumption when performing network detection under multiple network addresses, ensuring the timeliness and accuracy of network detection under multiple network addresses, and improving the network detection performance under multiple network addresses and the timeliness of network fault discovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A flowchart of a network detection method provided in an embodiment of the present application;

[0020] Figure 2 A flowchart of another network detection method provided in an embodiment of the present application;

[0021] Figure 3 An exemplary message format of a probe request message and a probe response message for each network address provided in an embodiment of the present application;

[0022] Figure 4 A functional block diagram of a network detection device provided in an embodiment of the present application;

[0023] Figure 5 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] 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 only 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 making creative work are within the scope of protection of this application.

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

[0026] Considering that when using the ping program to perform network detection on multiple network addresses, it is usually necessary to run multiple processes concurrently, resulting in a huge consumption of computing resources and reducing the network detection performance. To this end, the embodiment of the present application designs a new network detection scheme, which can divide large-scale network addresses into multiple network address groups for network detection under large-scale network addresses, and associate each network address group with a coroutine. Then, for each network address group, a coroutine corresponding to the network address group can complete the network detection under multiple network addresses in the network address group, thereby realizing fast network detection under multiple network addresses, reducing resource consumption when performing network detection under multiple network addresses, and ensuring the timeliness and high efficiency and accuracy of network detection under multiple network addresses.

[0027] Figure 1 A flowchart of a network detection method provided in an embodiment of the present application. The method can be performed by a network detection device provided in the present application. Among them, the network detection device can be implemented by any software and / or hardware. Exemplarily, the network detection device can be applied to any electronic device, which may include but is not limited to tablet computers, mobile phones (such as folding screen mobile phones, large screen mobile phones, etc.), wearable devices, vehicle-mounted devices, laptops, ultra-mobile personal computers (ultra-mobile personal computers, UMPC), netbooks, personal digital assistants (personal digital assistants, PDAs), smart TVs, smart screens, high-definition TVs, 4K TVs, smart speakers, smart projectors and other types of computing devices. The present disclosure does not impose any restrictions on the specific types of electronic devices.

[0028] Specifically, Figure 1 As shown, the method may include the following steps:

[0029] S110, sending a detection request message of each network address in the network address group through the first coroutine corresponding to the network address group, wherein the detection request message of each network address at least includes the detection sequence number of the network address.

[0030] Normally, for network detection under any network address, a process is run to send a detection request packet to the network address and wait for the corresponding response packet to complete the network detection under the network address. Therefore, when performing network detection on a large scale of network addresses, a large number of processes need to be run concurrently to send a detection request packet to each network address and wait for the corresponding response packet of each network address, resulting in a huge consumption of computing resources and loss of network detection performance.

[0031] A process is a program with certain independent functions running on a certain data set, and is an independent unit for resource allocation and scheduling of the operating system. Each process is relatively heavy and occupies an independent memory space. Different processes communicate through inter-process communication, which makes the switching overhead between context processes (such as stacks, registers, virtual memory, file handles, etc.) relatively large. There can be multiple threads in a process. As a lightweight process, a thread is the smallest unit of scheduling and execution of the operating system, and shares all the resources owned by the process with other threads belonging to the same process. Communication between threads is mainly through shared memory, and the context switching overhead of thread switching is smaller than that of process switching. A coroutine is a user-mode lightweight thread. The scheduling of the coroutine is completely controlled by the user, and it has its own register context and stack. When the coroutine is scheduled and switched, the register context and stack will be saved to other places. When switching back, the previously saved register context and stack will be restored. Directly operating the stack basically has no thread switching overhead, and global variables can be accessed without locking, ensuring the speed of context switching.

[0032] From the above content, we can know that as a user-mode lightweight thread, a coroutine can share all resources owned by the process with other threads belonging to the same process, and can also have its own register context and stack. Then, when multiple coroutines are switched to execute multiple subroutines, they can be controlled by the subroutines themselves without the need for thread switching, so there is no thread switching overhead, and the shared resources are controlled without locking in the coroutine, so that the execution efficiency of the subroutines can be ensured extremely high.

[0033] Therefore, in order to improve the network detection performance under large-scale network addresses, this application can use coroutines to execute the network detection process under each network address to reduce the consumption of computing resources when performing network detection under multiple network addresses and improve the efficiency of network detection.

[0034] Moreover, considering that multiple coroutines can concurrently execute the network detection process under each network address. Then, in order to further improve the network detection performance of each coroutine for the corresponding network address, the present application can also group large-scale network addresses to obtain multiple network address groups. For example, by dividing large-scale network addresses according to a preset number of groups (such as every 100), multiple network address groups can be obtained, so that the number of network addresses in each network address group is at most the preset number of groups.

[0035] Then, the present application can configure a corresponding first causal procedure for each network address group, which is used to execute the network detection process under each network address in the network address group. Thus, by running multiple first causal procedures concurrently, fast network detection under each network address in multiple network address groups can be achieved.

[0036] Specifically, for each network address group after the large-scale network address division, the present application will first concurrently run the first coroutine corresponding to each network address group on the local machine. Then, for the first coroutine corresponding to each network address group, through the first coroutine, the local machine can send corresponding detection request messages to each network address in the network address group in turn, so as to perform network detection on each network address in the network address group.

[0037] Wherein, the detection request message of each network address can be an ICMP message, and the ICMP message format can be composed of a message type, a code, a checksum, and a message identifier (recorded as a message id). Wherein, the message type can occupy one byte to indicate the specific type of the ICMP message. The code can occupy one byte to indicate the specific execution code of the ICMP message. The checksum can be a checksum of the entire ICMP datagram including the data part of the ICMP message to verify whether an error occurs in the transmission process of the ICMP message. The message identifier can be the specific id information of the ICMP message.

[0038] Moreover, considering that the first coroutine corresponding to each network address group can send corresponding detection request messages to multiple network addresses in the network address group. Then, in order to ensure the accuracy of network detection under each network address, for each network address, the present application can also pre-set a corresponding detection sequence number (denoted as seq) for each network address. Then, when the first coroutine corresponding to each network address group is used to send the corresponding detection request message from the local machine to each network address in the network address group in turn, the detection sequence number of the network address can be added to the detection request message of each network address, so that the detection request message of each network address can at least include the detection sequence number of the network address, thereby avoiding the failure of network detection of each network address due to confusion of multiple detection request messages.

[0039] S120, receiving, through the second coroutine, a probe response message for each probe request message feedback, wherein the probe response message at least includes a probe sequence number carried in the probe request message corresponding to the probe response message.

[0040] For each network address group, after the corresponding probe request message is sent from the local machine to each network address in the network address group in sequence through the first coroutine corresponding to the network address group, the target end represented by each network address in the network address group will receive the corresponding probe request message sent by the local machine. Then, in order to ensure accurate network detection under each network address, when the target end represented by each network address in the network address group receives the corresponding probe request message sent by the local machine, it will generate a corresponding probe response message for the received probe request message and feed the probe response message back to the local machine.

[0041] It is understandable that the probe response message fed back to each probe request message in the present application may also be an ICMP message.

[0042] In the present application, for the network detection process under each network address in each network address group, a second coroutine can be globally run on the local machine to receive a detection response message for each detection request message feedback.

[0043] It can be seen that the present application can receive the detection response message fed back by the target end represented by each network address in each network address group through the second coroutine. Then, in order to ensure the accuracy of network detection under each network address, the target end represented by each network address in each network address group will parse out the detection sequence number carried in the detection request message when generating a corresponding detection response message for the corresponding detection request message received, and add the detection sequence number to the generated detection response message, so that each detection response message can at least include the detection sequence number carried in the detection request message corresponding to the detection response message, so that the local machine can accurately analyze the detection request message and detection response message of each network address in the future to realize the network detection under the network address.

[0044] S130, determining a network detection result of each network address according to the detection request message and the detection response message under the detection sequence number of the network address.

[0045] After each detection response message is received through the second coroutine, the present application will first parse the detection response message to obtain the detection sequence number carried in the detection response message. Then, the detection request messages that have been sent to each network address in sequence through multiple first coroutines are parsed to determine the detection sequence number carried in each detection request message, so as to determine the detection request message corresponding to the detection response message received each time. According to the above method, by comparing the detection sequence number carried in each detection request message and each received detection response message, the detection request message and detection response message related to each network address can be obtained.

[0046] It is understandable that when performing network detection on each network address, when sending a detection request message of the network address through the first goroutine, the sending time of the detection request message is usually recorded. Moreover, when receiving a detection response message of the network address through the second goroutine, the receiving time of the detection response message is usually recorded.

[0047] Then, after determining the detection request message and detection response message related to each network address, the present application can compare and analyze the sending status of the detection request message related to the network address and the receiving status of the detection response message related to the network address to judge the specific network performance under the network address, thereby determining the network detection result of the network address, thereby realizing rapid network detection under each network address and improving the network detection performance under multiple network addresses.

[0048] In some possible implementations, it is considered that there may be network packet loss when detecting and probing some network addresses. Therefore, in order to ensure the accuracy of network detection under multiple network addresses, the present application can determine the network detection result of each network address in the following manner: for each network address, determine the target detection request message and target detection response message under the detection sequence number of the network address; if the target detection response message is empty, record the packet loss information of the network address to analyze the network packet loss rate of the network address; if the target detection response message is not empty, determine the network delay of the network address according to the sending time of the target detection request message and the receiving time of the target detection response message.

[0049] Specifically, for each network address, the present application can obtain the detection sequence number carried in each detection request message by parsing each detection request message sent by the first coroutine. Moreover, by parsing each detection response message received by the second coroutine, the detection sequence number carried in each detection response message can be obtained.

[0050] Then, by comparing the detection sequence number carried in each detection request message with the detection sequence number carried in each detection response message, the detection request message and the detection response message under the same detection sequence number are determined. Then, by analyzing which network address the detection sequence number of the same detection sequence number is, the target detection request message and the target detection response message related to the network address can be determined. According to the above method, the target detection request message and the target detection response message related to each network address can be obtained.

[0051] Therefore, for each network address, if the target detection response message related to the network address is empty, it means that there is packet loss from the local machine to the target end represented by the network address. Then, the present application can record the current packet loss information of the network address. Subsequently, after multiple network detections are performed on the network address, the network packet loss rate of the network address can be determined by analyzing the historical packet loss of the network address under multiple network detections, so as to analyze the network performance under the network address.

[0052] If the target detection response message related to the network address is not empty, then the present application will first determine the sending time of the target detection request message related to the network address and the receiving time of the target detection response message related to the network address. Then, by analyzing the time difference between the above sending time and the above receiving time, the network delay of the network address is determined, so as to analyze the network performance under the network address.

[0053] The technical solution provided by the embodiment of the present application can divide large-scale network addresses into multiple network address groups for network detection under large-scale network addresses. Thus, the detection request message of each network address in the network address group is sent through the first coroutine corresponding to each network address group, and the detection request message of each network address at least includes the detection sequence number of the network address. Then, the detection response message for each detection request message feedback is received through the second coroutine, and the detection response message at least includes the detection sequence number carried in the detection request message corresponding to the detection response message. Furthermore, according to the detection request message and the detection response message under the detection sequence number of each network address, the network detection result of the network address can be determined, so that the fast network detection under multiple network addresses can be realized with high performance through a first coroutine and a second coroutine, reducing the resource consumption when performing network detection under multiple network addresses, ensuring the timeliness and accuracy of network detection under multiple network addresses, and improving the network detection performance under multiple network addresses and the timeliness of network fault discovery.

[0054] As an optional implementation scheme in the present application, when a probe request message is sent from the local machine to the target end represented by each network address through the first coroutine, each probe request message does not directly reach the target end represented by the corresponding network address from the local machine, but usually passes through multiple intermediate nodes, and the probe request message is routed and forwarded by multiple intermediate nodes. Moreover, when a probe response message fed back to the local machine from the target end represented by each network address is received through the second coroutine, each probe response message does not directly reach the local machine from the target end represented by the corresponding network address, but usually passes through multiple intermediate nodes, and the probe response message is routed and forwarded by multiple intermediate nodes.

[0055] It can be seen that in the network detection process of each network address, the network performance of each intermediate node in the detection request message path and each intermediate node in the detection response message path will affect the network detection result of the network address. Then, in order to ensure full-link network detection under multiple network addresses, the present application can detect the full-link network performance under the network address by analyzing the network delay when the detection request message related to each network address passes through each intermediate node and the network delay when the detection request message related to the network address passes through each intermediate node, so as to ensure the comprehensiveness of network detection under multiple network addresses and realize accurate detection and troubleshooting of full-link network faults under multiple network addresses.

[0056] Next, the present application may provide a detailed explanation of the entire network detection process under multiple network addresses.

[0057] Figure 2 A flowchart of another network detection method provided in an embodiment of the present application. Figure 2 As shown, the method may specifically include the following steps:

[0058] S210, sending a detection request message of each network address in the network address group through the first coroutine corresponding to the network address group, wherein the detection request message of each network address at least includes the detection sequence number of the network address.

[0059] S220, establish a corresponding communication pipe queue according to the maintained target mapping table, so as to obtain the parsing information of the detection response message fed back by the detection request message for each network address in the network address group through the first coroutine corresponding to each network address group, and the target mapping table includes the mapping relationship between each network address and the communication pipe.

[0060] Based on the content of the above embodiments, it can be known that for network detection under each network address in each network address group, the first coroutine corresponding to the network address group will be used to send detection request messages for each network address in the network address group, and a second coroutine will be used globally to receive detection response messages for each detection request message feedback.

[0061] Different coroutines usually need to communicate through communication channels to achieve data synchronization and exchange between different coroutines. Then, in order to ensure the comprehensive data acquisition of the detection request message and detection response message related to each network address when performing network detection under each network address, the present application can pre-configure a corresponding communication channel for each network address to achieve data synchronization and exchange of the detection request message and detection response message related to the network address between the first coroutine and the second coroutine.

[0062] Therefore, according to the mapping relationship between each network address and the communication pipe configured for it, the present application can maintain a target mapping table, which may include the mapping relationship between each network address and the communication pipe, so as to realize data synchronization and exchange of the detection request message and detection response message related to the network address between different coroutines through the corresponding communication pipe during the network detection process under each network address.

[0063] In the present application, in order to ensure accurate network detection under each network address, for each network address group, when sending a detection request message for each network address in the network address group through the first coroutine corresponding to the network address group, the present application can also determine the communication channel corresponding to each network address in the network address group by searching the maintained target mapping table, thereby establishing a corresponding communication channel queue for the network address group, so that when the detection response message fed back to the detection request message for each network address in the network address group is subsequently received through the second coroutine, the first coroutine corresponding to the network address group can be used to use the established communication channel queue to further obtain the parsing information of the detection response message fed back to the detection request message for each network address in the network address group from the second coroutine.

[0064] S230, receiving, through the second coroutine, a probe response message for each probe request message feedback, wherein the probe response message at least includes a probe sequence number carried in the probe request message corresponding to the probe response message.

[0065] S240, for each probe response message, according to the target network address and the target mapping table corresponding to the probe sequence number carried in the probe response message, determine the target communication pipe after the target network address is mapped from the communication pipe queue.

[0066] For each network address group, after receiving the probe response message fed back to the probe request message for each network address in the network address group through the second coroutine, for each probe response message received, the present application will first parse the probe response message to obtain the probe sequence number carried in the probe response message, so as to determine the target network address corresponding to the probe response message.

[0067] Then, by searching the maintained target mapping table for the mapping relationship between the target network address corresponding to each probe response message and the communication pipe, the target communication pipe mapped to the target network address corresponding to each probe response message can be determined from the communication pipe queue established for the network address group.

[0068] S250, using the target communication channel through the second coroutine to distribute the detection response message to the first coroutine corresponding to the network address group where the target network address is located, so that the first coroutine obtains the parsing information of the detection response message.

[0069] For each detection response message after the detection request message feedback of each network address in each network address group, after determining the target communication pipeline after the target network address corresponding to each detection response message is mapped, the present application can first determine the first coroutine corresponding to the network address group where the target network address corresponding to the detection response message is located, and directly use the target communication pipeline to distribute the detection response message to the first coroutine determined above through the second coroutine, so that the first coroutine corresponding to each network address group can receive the detection response message related to each network address in the distributed network address group. Thus, the first coroutine corresponding to each network address group can parse each detection response message it receives to obtain the resolution information of the detection response message related to each network address in the network address group.

[0070] It can be seen that according to the above method, the detection request message and detection response message related to the same network address can be obtained by the first coroutine corresponding to the network address group where the same network address is located, so as to detect the network performance under the same network address.

[0071] S260: For each network address, determine a target detection request message and a target detection response message under the detection sequence number of the network address.

[0072] Specifically, for each network address, the present application can obtain the detection sequence number carried in each detection request message by parsing each detection request message sent by the first coroutine. Moreover, the detection sequence number carried in each detection response message is obtained by analyzing the parsing information of the detection response message fed back by each detection request message sent by the first coroutine.

[0073] Then, by comparing the detection sequence number carried in each detection request message with the detection sequence number carried in each detection response message, the detection request message and the detection response message under the same detection sequence number are determined. Then, by analyzing which network address the detection sequence number of the same detection sequence number is, the target detection request message and the target detection response message related to the network address can be determined. According to the above method, the target detection request message and the target detection response message related to each network address can be obtained.

[0074] S270: Determine the full-link network delay of the network address according to the sending time of the target detection request message and the associated timestamps of the first type of intermediate nodes and the second type of intermediate nodes carried in the target detection response message.

[0075] During the network detection process of each network address, the network performance of each intermediate node in the detection request message path and each intermediate node in the detection response message path will affect the network detection result of the network address.

[0076] In the present application, in order to accurately distinguish between the various intermediate nodes in the path of the probe request message and the various intermediate nodes in the path of the probe response message, for each network address in each network address group, the present application may treat the various intermediate nodes in the path of the probe request message related to each network address during the sending process as the first type of intermediate nodes, and treat the various intermediate nodes in the path of the probe response message related to each network address during the feedback process as the second type of intermediate nodes.

[0077] Therefore, in order to ensure the comprehensiveness of network detection at each network address, for each network address, the present application needs to accurately analyze the full-link network performance when performing network detection at the network address, that is, it is necessary to accurately analyze the network delay when the detection request message related to the network address passes through each first-class intermediate node and the network delay when the detection request message related to the network address passes through each second-class intermediate node.

[0078] Therefore, the present application can further customize the associated timestamp and intermediate node identifier when passing through the corresponding intermediate node in the probe request message and the probe response message on the basis of the fixed message format of the probe request message and the probe response message by expanding the message content of the probe request message and the probe response message of each network address. Among them, the associated timestamp when any message in the probe request message and the probe response message of each network address passes through the corresponding intermediate node may include the reception time and forwarding time of the message by the intermediate node, so as to analyze the network delay when the message passes through the intermediate node.

[0079] For example, it is assumed that the probe request message and the probe response message of each network address are an ICMP message. Figure 3 As shown, for any message in the probe request message and the probe response message of each network address, the ICMP message format adopted by the message can not only include the message type, code, checksum, message id and probe sequence number seq, but also include the customized intermediate node identifiers of each intermediate node in the message path and the associated timestamp composed of the reception time and forwarding time of the message by the intermediate node when the message passes through each intermediate node.

[0080] Then, for each probe request message and probe response message related to the network address, in addition to the probe sequence number of the network address, the probe request message may also include an associated timestamp dynamically updated toward the first-class intermediate node when passing through each first-class intermediate node during the sending process. The associated timestamp may include the receiving time and forwarding time of the probe request message by the first-class intermediate node when the probe request message passes through the first-class intermediate node.

[0081] Moreover, considering that if the detection response message fed back by each detection request message only records the associated timestamp when it passes through the second-class intermediate node, then the local machine will not be able to understand the impact of the first-class intermediate node on the network detection result of the network address when each detection request message passes through each first-class intermediate node. Therefore, in order to ensure full-link network detection under each network address, for the detection response message related to each network address, the detection response message may also include the dynamically updated associated timestamp of each first-class intermediate node carried in the detection request message corresponding to the detection response message and the dynamically updated associated timestamp of the detection response message facing each second-class intermediate node when passing through each second-class intermediate node during the feedback process. Among them, the dynamically updated associated timestamp of the detection response message facing each second-class intermediate node when passing through each second-class intermediate node during the feedback process may include the reception time and forwarding time of the second-class intermediate node for the detection response message.

[0082] Therefore, after determining the target detection request message and the target detection response message of each network address, the present application can first determine the sending time of the target detection request message and the receiving time of the target detection response message. Moreover, by analyzing the parsing information of the target detection response message, the associated timestamp for each first-class intermediate node and the associated timestamp for each second-class intermediate node carried in the target detection response message can be determined.

[0083] Then, for the target detection request message and target detection response message of each network address, based on the sending time of the target detection request message, the receiving time and forwarding time in the associated timestamp facing each first-class middleware node, the receiving time and forwarding time in the associated timestamp facing each second-class intermediate node, and the receiving time of the target detection response message, the network delay of the network address towards each intermediate node and the target end represented by the network address during the entire network detection process can be analyzed, so as to determine the full-link network delay of the network address and realize full-link network troubleshooting under each network address.

[0084] S280, for each network address, determine the detection running time of the network address in the user state and the kernel state according to the throughput time of the target detection request message and the target detection response message under the detection sequence number of the network address in the user state and the kernel state.

[0085] Among them, user state and kernel state are the core concepts of the operating system, which respectively limit and protect operations at different levels. Kernel state has full access rights and performs key tasks such as setting clocks and memory management, while user state limits direct access to sensitive resources to prevent system crashes. Then, during the entire network detection process of each network address, when the network detection process of each network address is executed by a coroutine, for the target detection request message and target detection response message under the detection sequence number of the network address, the system processing operation of the target detection request message and the target detection response message passing through each intermediate node can be executed in the kernel state to systematically analyze the associated timestamps of the target detection request message and the target detection response message passing through each intermediate node. Moreover, the associated timestamps of the target detection request message and the target detection response message passing through each intermediate node can be spit out to the user state in an asynchronous manner, so that the associated timestamps of the target detection request message and the target detection response message passing through each intermediate node can be directly saved in the user state and access is supported. Therefore, when the target detection request message and the target detection response message pass through the next intermediate node, the target detection request message and the target detection response message can be swallowed back to the kernel state in an asynchronous manner to continue to execute the system processing operations when the target detection request message and the target detection response message pass through the next intermediate node in the kernel state, and the cycle continues.

[0086] It can be seen from the above content that during the entire network detection process of each network address, the throughput time of the target detection request message and the target detection response message related to the network address in the user state and the kernel state is recorded by analyzing the continuous throughput of the target detection request message and the target detection response message related to the network address in the user state and the kernel state. Based on this, the overall running time of the target detection request message and the target detection response message related to each network address in the user state and the overall running time in the kernel state can be analyzed to determine the detection running time of the network address in the user state and the kernel state, thereby realizing comprehensive network performance detection under each network address.

[0087] The technical solution provided by the embodiment of the present application can divide large-scale network addresses into multiple network address groups for network detection under large-scale network addresses. Thus, the detection request message of each network address in the network address group is sent through the first coroutine corresponding to each network address group, and the detection request message of each network address at least includes the detection sequence number of the network address. Then, the detection response message for each detection request message feedback is received through the second coroutine, and the detection response message at least includes the detection sequence number carried in the detection request message corresponding to the detection response message. Furthermore, according to the detection request message and the detection response message under the detection sequence number of each network address, the network detection result of the network address can be determined, so that the fast network detection under multiple network addresses can be realized with high performance through a first coroutine and a second coroutine, reducing the resource consumption when performing network detection under multiple network addresses, ensuring the timeliness and accuracy of network detection under multiple network addresses, and improving the network detection performance under multiple network addresses and the timeliness of network fault discovery.

[0088] Figure 4 This is a functional block diagram of a network detection device provided in an embodiment of the present application. Figure 4 As shown, the apparatus 400 may include:

[0089] The detection request module 410 is used to send a detection request message of each network address in the network address group through the first coroutine corresponding to each network address group, wherein the detection request message of each network address at least includes a detection sequence number of the network address;

[0090] A detection response module 420 is used to receive, through a second coroutine, a detection response message for each detection request message feedback, wherein the detection response message at least includes a detection sequence number carried in the detection request message corresponding to the detection response message;

[0091] The network detection module 430 is used to determine the network detection result of each network address according to the detection request message and the detection response message under the detection sequence number of the network address.

[0092] In some implementations, the network detection module 430 may be specifically used to:

[0093] For each network address, determine a target detection request message and a target detection response message under a detection sequence number of the network address;

[0094] If the target detection response message is empty, record the current packet loss information of the network address to analyze the network packet loss rate of the network address;

[0095] If the target detection response message is not empty, the network delay of the network address is determined according to the sending time of the target detection request message and the receiving time of the target detection response message.

[0096] In some implementations, the network detection device 400 may further include:

[0097] A communication pipe establishment module is used to establish a corresponding communication pipe queue according to a maintained target mapping table, so as to obtain the parsing information of the detection response message feedback for the detection request message for each network address in the network address group through the first coroutine corresponding to each network address group, wherein the target mapping table includes the mapping relationship between each network address and the communication pipe.

[0098] In some implementations, the network detection device 400 may further include a response message distribution module. The response message distribution module may be used to:

[0099] For each probe response message, according to the target network address corresponding to the probe sequence number carried in the probe response message and the target mapping table, determine the target communication pipe after the target network address is mapped from the communication pipe queue;

[0100] The second coroutine uses the target communication channel to distribute the probe response message to the first coroutine corresponding to the network address group where the target network address is located, so that the first coroutine obtains the parsing information of the probe response message.

[0101] In some possible implementations, the detection request message also includes an association timestamp that is dynamically updated toward each first-class intermediate node when passing through each first-class intermediate node during the sending process, and the detection response message also includes an association timestamp that is dynamically updated toward each first-class intermediate node carried in the detection request message corresponding to the detection response message and an association timestamp that is dynamically updated toward each second-class intermediate node when the detection response message passes through each second-class intermediate node during the feedback process.

[0102] In some implementations, the network detection module 430 may also be specifically used to:

[0103] For each network address, determine a target detection request message and a target detection response message under a detection sequence number of the network address;

[0104] The full-link network delay of the network address is determined according to the sending time of the target detection request message and the associated timestamps of the first-type intermediate nodes and the second-type intermediate nodes carried in the target detection response message.

[0105] In some implementations, the network detection device 400 may further include:

[0106] The detection running time determination module is used to determine the detection running time of each network address in user state and kernel state according to the throughput time of the target detection request message and the target detection response message under the detection sequence number of the network address in user state and kernel state.

[0107] In an embodiment of the present application, for network detection under a large-scale network address, the large-scale network address can be divided into multiple network address groups. Thus, a detection request message for each network address in the network address group is sent through the first coroutine corresponding to each network address group, and the detection request message of each network address at least includes the detection sequence number of the network address. Then, a detection response message for each detection request message feedback is received through the second coroutine, and the detection response message at least includes the detection sequence number carried in the detection request message corresponding to the detection response message. Furthermore, according to the detection request message and the detection response message under the detection sequence number of each network address, the network detection result of the network address can be determined, so that a first coroutine and a second coroutine can realize high-performance fast network detection under multiple network addresses, reduce resource consumption when performing network detection under multiple network addresses, ensure the timeliness and accuracy of network detection under multiple network addresses, and improve the network detection performance under multiple network addresses and the timeliness of network fault discovery.

[0108] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Figure 4 The device 400 shown can execute any method embodiment provided in the present application, and the aforementioned and other operations and / or functions of each module in the device 400 are respectively for implementing the corresponding processes in each method of the embodiment of the present application. For the sake of brevity, they will not be repeated here.

[0109] The above describes the device 400 of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0110] Figure 5 A schematic block diagram of an electronic device provided in an embodiment of the present application.

[0111] like Figure 5 As shown, the electronic device 500 may include:

[0112] The memory 510 and the processor 520, the memory 510 is used to store the computer program and transmit the program code to the processor 520. In other words, the processor 520 can call and run the computer program from the memory 510 to implement the method in the embodiment of the present application.

[0113] For example, the processor 520 may be configured to execute the above method embodiments according to instructions in the computer program.

[0114] In some embodiments of the present application, the processor 520 may include but is not limited to:

[0115] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0116] In some embodiments of the present application, the memory 510 includes but is not limited to:

[0117] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0118] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 510 and executed by the processor 520 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0119] like Figure 5 As shown, the electronic device may also include:

[0120] The transceiver 530 may be connected to the processor 520 or the memory 510 .

[0121] The processor 520 may control the transceiver 530 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 530 may include a transmitter and a receiver. The transceiver 530 may further include an antenna, and the number of antennas may be one or more.

[0122] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0123] The embodiment of the present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the embodiment of the present application also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0124] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0125] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0126] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0127] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0128] The above are only specific implementations 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 changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A network detection method, characterized in that: include: Sending, through the first coroutine corresponding to each network address group, a detection request message for each network address in the network address group, wherein the detection request message for each network address at least includes a detection sequence number of the network address; Receiving, through the second coroutine, a probe response message for each probe request message feedback, wherein the probe response message includes at least a probe sequence number carried in the probe request message corresponding to the probe response message; The network detection result of each network address is determined according to the detection request message and the detection response message under the detection sequence number of the network address.

2. The method according to claim 1, characterized in that Determining the network detection result of each network address according to the detection request message and the detection response message under the detection sequence number of each network address includes: For each network address, determine a target detection request message and a target detection response message under a detection sequence number of the network address; If the target detection response message is empty, record the current packet loss information of the network address to analyze the network packet loss rate of the network address; If the target detection response message is not empty, the network delay of the network address is determined according to the sending time of the target detection request message and the receiving time of the target detection response message.

3. The method according to claim 1, characterized in that When sending a detection request message for each network address in the network address group through the first coroutine corresponding to each network address group, it also includes: According to the maintained target mapping table, a corresponding communication pipe queue is established to obtain the parsing information of the detection response message feedback for the detection request message for each network address in the network address group through the first coroutine corresponding to each network address group. The target mapping table includes the mapping relationship between each network address and the communication pipe.

4. The method according to claim 3, characterized in that After receiving the detection response message for each detection request message feedback through the second coroutine, it also includes: For each probe response message, according to the target network address corresponding to the probe sequence number carried in the probe response message and the target mapping table, determine the target communication pipe after the target network address is mapped from the communication pipe queue; The second coroutine uses the target communication channel to distribute the probe response message to the first coroutine corresponding to the network address group where the target network address is located, so that the first coroutine obtains the parsing information of the probe response message.

5. The method according to claim 1, characterized in that The detection request message also includes an association timestamp that is dynamically updated toward each first-class intermediate node when passing through each first-class intermediate node during the sending process. The detection response message also includes an association timestamp that is dynamically updated toward each first-class intermediate node carried in the detection request message corresponding to the detection response message and an association timestamp that is dynamically updated toward each second-class intermediate node when the detection response message passes through each second-class intermediate node during the feedback process.

6. The method according to claim 5, characterized in that Determining the network detection result of each network address according to the detection request message and the detection response message under the detection sequence number of each network address includes: For each network address, determine a target detection request message and a target detection response message under a detection sequence number of the network address; The full-link network delay of the network address is determined according to the sending time of the target detection request message and the associated timestamps of the first-type intermediate nodes and the second-type intermediate nodes carried in the target detection response message.

7. The method according to claim 1, characterized in that The method further comprises: For each network address, the detection running time of the network address in user state and kernel state is determined according to the throughput time of the target detection request message and the target detection response message under the detection sequence number of the network address in user state and kernel state.

8. A network detection device, characterized in that: include: A detection request module, used to send a detection request message of each network address in the network address group through a first coroutine corresponding to each network address group, wherein the detection request message of each network address at least includes a detection sequence number of the network address; A detection response module, configured to receive, through a second coroutine, a detection response message for each detection request message feedback, wherein the detection response message includes at least a detection sequence number carried in a detection request message corresponding to the detection response message; The network detection module is used to determine the network detection result of each network address according to the detection request message and the detection response message under the detection sequence number of each network address.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the network detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program enables a computer to execute the network detection method according to any one of claims 1 to 7.