Connectivity detection method and apparatus, electronic device, storage medium, and computer program product
By constructing a topology graph and using density clustering to generate detection instructions, the problem of long processing time and difficulty in providing results in existing technologies is solved, achieving efficient connectivity detection and intuitive result display.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
- Filing Date
- 2025-01-16
- Publication Date
- 2026-05-19
AI Technical Summary
Existing connectivity detection between source and destination devices is time-consuming through packet analysis and difficult to summarize and report results, thus reducing detection efficiency.
By constructing a topology map, the connection relationships and communication-related information between devices are determined, detection instructions are generated, and a network topology map is generated based on a density clustering method. The network strategy is automatically verified and the results are fed back.
It improves the efficiency of connectivity detection, reduces the workload of data analysis, saves time, and the results are intuitive, easy to understand, and highly maintainable.
Smart Images

Figure CN119922104B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud network technology, and in particular to a connectivity detection method, apparatus, electronic device, storage medium, and computer program product. Background Technology
[0002] In related technologies, existing connectivity detection between source and destination devices mainly relies on the analysis of data packets to determine network connectivity. This requires analyzing a large number of data packets, which is time-consuming, and the results are difficult to summarize and report, thus reducing the efficiency of connectivity detection between source and destination devices. Summary of the Invention
[0003] The present application provides a connectivity detection method, apparatus, electronic device, storage medium, and computer program product that can improve the efficiency of connectivity detection between source and destination devices.
[0004] The technical solution of this application is implemented as follows:
[0005] This application provides a connectivity detection method, including:
[0006] The detection instruction corresponding to each device is determined based on the constructed topology map; wherein, the topology map is used to characterize the connection relationship and communication-related information between each device and other devices; the detection instruction includes: the communication-related information of each device and the other connected devices;
[0007] The detection command is sent to each of the devices, so that each device can perform connectivity detection based on the detection command.
[0008] In the above scheme, before determining the detection command corresponding to each device based on the constructed topology map, the method further includes:
[0009] Obtain a set of strategies for connectivity detection; wherein the set of strategies includes: multiple strategies; each strategy includes: communication-related information between the corresponding device and the other connected devices;
[0010] The topology graph is constructed based on multiple of the aforementioned strategies.
[0011] In the above scheme, the communication-related information includes: the source address information of the corresponding device, and the destination address information of the other devices connected to the device; the construction of the topology map based on multiple strategies includes:
[0012] The source address information and destination address information included in each of the strategies are transformed to determine the data point corresponding to each device and the data point corresponding to the other connected devices.
[0013] Cluster analysis is performed on the multiple data points to determine K center data points; where K is an integer greater than 0.
[0014] An initial topology map is constructed based on each of the central data points and the data points of the other devices connected to the device corresponding to each of the central data points;
[0015] The communication-related information between each of the devices and the other connected devices is marked between the corresponding data points in the initial topology map to form the topology map.
[0016] The method in the above scheme further includes:
[0017] Obtain a new first strategy and update the topology graph based on the first strategy.
[0018] In the above scheme, the first strategy includes: the source address information corresponding to the first device, and the destination address information corresponding to the first other devices connected to the first device; updating the topology map based on the first strategy includes:
[0019] The source address information and destination address information included in the first strategy are transformed to determine the first data point corresponding to the first device and the first data point corresponding to the first other device connected to the first device;
[0020] The first data point of the first device, the first data point of the first other device, and the data points in the topology map are matched to determine the matching result;
[0021] The topology graph is updated based on the matching results.
[0022] In the above scheme, updating the topology graph based on the matching result includes any one of the following:
[0023] If the matching result indicates that the first data point does not match the data point in the topology graph, then based on the number of noisy data points in the topology graph, the first data point is added to the topology graph to update the topology graph;
[0024] If the matching result indicates that the first data point matches the data point in the topology graph, then the topology graph is updated based on the detection result of whether the first strategy exists in the strategy set.
[0025] In the above scheme, the step of adding the first data point to the topology graph and updating the topology graph based on the number of noisy data points in the topology graph includes any one of the following:
[0026] If the number of noise data points is less than a preset threshold, the first data point is added to the topology graph, and a connection relationship between the data points and the first data point is established based on the first strategy, and the topology graph is updated.
[0027] If the number of noisy data points is not less than the preset threshold, then the first strategy is added to multiple strategies, and the topology graph is updated and constructed based on the multiple strategies.
[0028] In the above scheme, each of the communication-related information includes: source address information of each device, destination address information of the other devices connected to each device, destination port information, and network command information; the step of determining the detection command corresponding to each device based on the constructed topology map includes:
[0029] Based on the source address information of each data point in the topology and each device connected to the data point, the destination address information, destination port information, and network command information of other devices connected to each device, the detection instruction for each device is determined.
[0030] The method in the above scheme further includes:
[0031] Receive connectivity detection results sent by each of the devices in response to the detection command; wherein the connectivity detection results are used to characterize whether each of the devices is connected or not connected to the other connected devices, and whether the ports of each device are connected or not connected to the other connected devices.
[0032] Based on the connectivity detection results, the connection relationships between each device in the topology graph and the other connected devices are marked.
[0033] This application also provides a connectivity detection device, including:
[0034] A determining unit is configured to determine a detection instruction corresponding to each device based on a constructed topology map; wherein the topology map is used to characterize the connection relationships and communication-related information between each device and other devices; the detection instruction includes the communication-related information of each device and the other connected devices;
[0035] The sending unit is used to send the detection command to each of the devices, so that each device can perform connectivity detection based on the detection command.
[0036] This application also provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the steps in the above-described method.
[0037] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the above-described method.
[0038] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the above-described method.
[0039] In this embodiment, a detection instruction corresponding to each device is determined based on a constructed topology graph. The topology graph represents the connection relationships and communication-related information between each device and other devices. The detection instruction includes communication-related information for each device and other connected devices. The detection instruction is sent to each device, allowing it to perform connectivity detection. Thus, the process of determining the detection instruction for each device using the constructed topology graph only requires considering the communication-related information of each device and other connected devices in the topology graph. Compared to related technologies that analyze large amounts of data packets, this reduces the workload of data analysis, saves time, and improves the efficiency of connectivity detection. Attached Figure Description
[0040] Figure 1 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0041] Figure 2 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0042] Figure 3 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0043] Figure 4 A schematic diagram illustrating an optional effect of the connectivity detection method provided in this application embodiment;
[0044] Figure 5 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0045] Figure 6 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0046] Figure 7 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0047] Figure 8 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0048] Figure 9 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0049] Figure 10 A schematic flowchart of an optional connectivity detection method provided in an embodiment of this application;
[0050] Figure 11 A schematic diagram illustrating an optional effect of the connectivity detection method provided in this application embodiment;
[0051] Figure 12 This is a schematic diagram of the connectivity detection device provided in the embodiments of this application;
[0052] Figure 13 This is a schematic diagram of a hardware entity of an electronic device provided in an embodiment of this application. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application are further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0055] If the application documents contain similar descriptions such as "first / second", the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0057] Disadvantages of existing network connectivity detection technologies:
[0058] 1. Determining network connectivity by analyzing data packets between source and destination devices requires analyzing a large number of data packets, which is time-consuming, and the results are difficult to summarize and report.
[0059] 2. By registering subnet controllers in the global controller based on network structure information, and then further training local models using local training sets, anomaly detection of local network traffic is finally achieved. This technology verifies the connectivity of local network traffic; its functionality is limited if the range of network terminals is further expanded.
[0060] 3. A network target range scenario is a simulated target range environment generated by maximally mimicking the real environment. Constructing this environment requires various virtualization technologies and some virtual-real integration techniques, making it highly challenging. Furthermore, after the target range environment is established, the target range scenario data needs to be further analyzed to determine network connectivity. This analysis process demands extremely high skill levels from the operators.
[0061] To address the aforementioned technical problems, this application provides a connectivity detection method. Please refer to [link to relevant documentation]. Figure 1 This is an optional flowchart illustrating the connectivity detection method provided in this application embodiment, which will be combined with... Figure 1 The steps shown are explained below:
[0062] S101. Determine the detection instruction corresponding to each device based on the constructed topology map; wherein, the topology map is used to characterize the connection relationship between each device and other devices and communication-related information; the detection instruction includes: the communication-related information of each device and the other connected devices.
[0063] In this embodiment, a topology graph needs to be constructed before connectivity detection. The detection device can establish the connection relationships between each device and its connected counterparts based on the connection relationships between the devices and the communication-related information between each device and other connected devices, and mark the corresponding communication-related information to form a topology graph. The detection device can extract the communication-related information between each device and its connected counterparts from the topology graph, and determine the detection command corresponding to each device based on the extracted communication-related information.
[0064] In this embodiment, the detection device can convert the address information of each device to determine the data point information corresponding to the address information of each device. Based on the determined data point information, clustering is performed to form data point clusters. Based on the connection relationship between the device corresponding to each data point and other connected devices, the connection relationship between the data points is established to form a topology graph.
[0065] The communication-related information may include: source address information of each device, destination address information of other devices connected to each device, destination port information, and network command information.
[0066] The detection device can be a server, cloud server, or terminal connected to each device for managing each device.
[0067] S102. Send the detection command to each of the devices, so that each device can perform connectivity detection based on the detection command.
[0068] In this embodiment, the detection device sends a detection command corresponding to each device to each device, and each device performs connectivity detection on other connected devices based on the communication-related information in the detection command. The connectivity detection result is then determined.
[0069] In this embodiment of the application, after each device determines the connectivity detection result, the detection device receives the connectivity detection result fed back by each device, and based on the connectivity detection result representing whether the devices are connected, marks the connection relationship between each device in the topology graph and other connected devices accordingly.
[0070] In this embodiment, the detection device can employ a density-based spatial clustering of applications (DBSCAN) method to generate a customized network topology map based on a policy library. It then automatically verifies network policies according to the network topology map and simultaneously feeds the verification results back onto the topology map. This solves the problems of inefficient policy verification, insufficient result feedback information, and high difficulty in maintaining the overall network policy. It addresses the cumbersome and complex issues of network connectivity verification and network policy maintenance, achieving accurate and rapid network connectivity verification while making the verification results intuitive, easy to understand, and highly maintainable.
[0071] In this embodiment, a detection instruction corresponding to each device is determined based on a constructed topology graph. The topology graph represents the connection relationships and communication-related information between each device and other devices. The detection instruction includes communication-related information for each device and other connected devices. The detection instruction is sent to each device, allowing it to perform connectivity detection. Thus, the process of determining the detection instruction for each device using the constructed topology graph only requires considering the communication-related information of each device and other connected devices in the topology graph. Compared to related technologies that analyze large amounts of data packets, this reduces the workload of data analysis, saves time, and improves the efficiency of connectivity detection.
[0072] Please see Figure 2 The following is an optional flowchart of the connectivity detection method provided in the embodiments of this application, which will be described in conjunction with the steps:
[0073] S201. Obtain a set of strategies for connectivity detection; wherein the set of strategies includes: multiple strategies; each strategy includes: communication-related information between the corresponding device and the other connected devices.
[0074] In this embodiment, the detection device can acquire a set of strategies for performing connectivity detection for each device. The set of strategies includes multiple strategies; each strategy includes communication-related information between the corresponding device and other connected devices.
[0075] For example, multiple policy templates are shown in Table 1. Each policy should include the following four fields (communication-related information): sourceIP, destinationIP, port, and network command (ping, telnet, etc.).
[0076] sourceIP destinationIP Port Network commands 190.20.30.2 128.23.12.7 80 Telnet 10.20.30.2 172.63.12.3 ping XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX XX XX
[0077] Table 1
[0078] S202. Construct the topology graph based on multiple of the strategies.
[0079] In this embodiment of the application, the detection device can convert the source and destination addresses included in each strategy, determine the data points corresponding to each device, perform cluster analysis on multiple data points, and form a topology map.
[0080] In this embodiment, a set of strategies for connectivity detection is obtained; and the topology graph is constructed based on multiple strategies. This allows for the rapid determination of a topology graph representing the connection relationships between each device and its connected devices based on the strategy set. When determining the detection command for each device, it is only necessary to traverse each device and its connected devices in the topology graph. Compared to related technologies, this eliminates the need to analyze a large number of data packets, improving the efficiency of determining detection commands and thus enhancing the efficiency of connectivity detection.
[0081] Please see Figure 3 This is a schematic diagram of an optional flowchart of the connectivity detection method provided in an embodiment of this application. Figure 2 The shown S202 can also be implemented by S301 to S303, which will be explained in conjunction with the steps:
[0082] S301. The source address information and destination address information included in each of the strategies are converted to determine the data point corresponding to each device and the data point corresponding to the other connected devices.
[0083] In this embodiment, the communication-related information in each strategy includes: the source address information of the corresponding device, and the destination address information of the other devices connected to the device. The detection device can perform a four-dimensional vectorization transformation on the source address information and destination address information included in each strategy to determine the vector of the data point corresponding to each device.
[0084] S302. Perform cluster analysis on the multiple data points to determine K central data points.
[0085] In this embodiment, the detection device can perform cluster analysis on the vectors of multiple data points to determine K center data points among the multiple data points. K is an integer greater than 0.
[0086] S303. Based on each of the central data points and the data points of the other devices connected to the device corresponding to each of the central data points, an initial topology map is constructed.
[0087] In this embodiment of the application, the detection device can determine other connected devices in the strategy set based on the device corresponding to each central data point, and then connect the data points of the determined other connected devices with the central data point to form an initial topology map.
[0088] S304. The communication-related information between each of the devices and the other connected devices is marked between the corresponding data points in the initial topology map to form the topology map.
[0089] In this embodiment of the application, after forming an initial topology map, the detection device can mark the connection relationship between corresponding data points in the topology map based on the communication-related information of each device and other connected devices, thereby forming a topology map.
[0090] For example, the detection device acquires N strategies. IPv4 format: XXX.XXX.XXX.XXX. Through four-dimensional space transformation, the source and destination IP addresses in each strategy are converted into vectors corresponding to data points. The classic density-based clustering algorithm (DBSCAN) is used to process multiple data points, determining K core points as the center data points of the topology graph, i.e., the middle points of the K clusters. Then, based on the connection relationships between the source and destination addresses in the N strategies, the relationships between other nodes and the center data points are refined and supplemented, further completing the generation of the network topology graph. Combined with... Figure 4 A strategy includes the source address IP1 and destination address IP2 of the source device, as well as the destination ports port1, port2, and portN. The detection device converts the source and destination addresses in the strategy into corresponding data points, and then performs clustering and joining to form... Figure 4The connection relationship between data point IP1 and data point IP2. Figure 4 In this diagram, IP1 is the source IP and IP2 is the destination IP. The solid line between IP1 and IP2 represents the verification result of IP1 and IP2 under network commands (ping, telnet, etc.). The lines between IP2 and port1, port2, and portN are dashed lines, indicating that they are not required. Only when the network command is telnet will the lines between IP2 and port1, port2, and portN become solid lines.
[0091] In this embodiment, the source and destination address information included in each strategy are transformed to determine the data points corresponding to each device and the data points corresponding to other connected devices. Cluster analysis is performed on multiple data points to determine K central data points. Based on each central data point and the data points of other devices connected to the device corresponding to each central data point, a topology graph is constructed. Since the connection relationships between the data points in the topology graph represent the connection relationships between devices, connectivity detection only requires determining the communication-related information between corresponding data points in the topology graph, reducing the amount of data processed and improving the efficiency of connectivity detection.
[0092] Please see Figure 5 The following is an optional flowchart of the connectivity detection method provided in the embodiments of this application, which will be described in conjunction with the steps:
[0093] S401. Obtain a new first strategy and update the topology graph based on the first strategy.
[0094] In this embodiment, the detection device acquires a new first strategy. The first strategy includes source address information of a first device and destination address information of a first other device connected to the first device. The detection device can determine the first data point corresponding to the source and destination devices based on the address information included in the first strategy, and update the connection relationship between data points in the topology graph based on the first data point.
[0095] In this embodiment, a new first strategy is obtained, and the topology map is updated based on the first strategy. This allows for rapid and timely updates to the topology map based on the corresponding first strategy after changes in network device connectivity, providing a more accurate understanding of network device connectivity. Furthermore, the accurate topology map can be used to determine more precise detection commands, enabling accurate connectivity detection.
[0096] Please see Figure 6 This is a schematic diagram of an optional flowchart of the connectivity detection method provided in an embodiment of this application. Figure 5S401 can also be implemented through S501 to S503, which will be explained in conjunction with the steps:
[0097] S501. The source address information and destination address information included in the first strategy are converted to determine the first data point corresponding to the first device and the first data point corresponding to the first other device connected to the first device.
[0098] In this embodiment of the application, the detection device performs a four-dimensional spatial vector transformation on the source address information corresponding to the first device and the destination address information of the first other device connected to the first device in the first strategy, to determine the vector of the first data point corresponding to the first device and the vector of the first data point of the first other device connected to the first device.
[0099] S502. Match the first data point of the first device, the first data point of the first other device, and the data points in the topology map to determine the matching result.
[0100] In this embodiment of the application, the detection device can match the first data point determined according to the first strategy with the data points in the topology map to determine whether the first data point determined according to the first strategy is a matching result of the newly added data point.
[0101] In this process, the IP address corresponding to the first data point can be matched with the IP addresses of the data points in the topology diagram to determine the matching result.
[0102] S503. Update the topology graph based on the matching result.
[0103] In this embodiment, the detection device can adopt different strategies to update the topology map using the first data point based on whether the first data point represented by the matching result is a newly added data point.
[0104] In this embodiment, the source address information and destination address information included in the first strategy are transformed to determine the first data point corresponding to the first device and the first data point corresponding to the first other devices connected to the first device. The first data point of the first device and the first data point of the first other devices are matched with the data points in the topology diagram to determine the matching result. The topology diagram is updated based on the matching result. In this way, after the connection relationship of network devices changes, the topology diagram can be updated quickly and timely based on the corresponding first data point, providing a relatively accurate connection relationship of network devices. Therefore, a relatively accurate detection command can be determined using the accurate topology diagram of the relationship network, thereby achieving accurate connectivity detection.
[0105] Please see Figure 7 This is a schematic diagram of an optional flowchart of the connectivity detection method provided in an embodiment of this application. Figure 6 S503 in the above can also be implemented through S601, which will be explained in conjunction with the steps:
[0106] S601. If the matching result indicates that the first data point does not match the data point in the topology graph, then based on the number of noisy data points in the topology graph, the first data point is added to the topology graph to update the topology graph.
[0107] In this embodiment of the application, if the detection device determines that the matching result indicates that the first data point does not match the data point in the topology graph, that is, the first data point is a newly added node, the detection device adds the first data point to the topology graph and updates the topology graph based on the determined number of noisy data points in the topology graph.
[0108] In this embodiment, the detection device is based on the DBSCAN algorithm to form a topology map through clustering. The DBSCAN algorithm describes the density of a sample set based on a set of neighborhoods, using parameters (∈, MinPts) to describe the density of data point distribution within the neighborhood. ∈ represents the neighborhood value of the region, and MinPts represents the minimum number of sample points. Some abnormal sample points or a small number of sample points outside the cluster, which are not around any core object, are defined as noise points. In this application, the upper limit for the number of noise points is defined as Ns.
[0109] If the number of noise data points is less than a preset threshold, the first data point is added to the topology graph, and a connection relationship between the data points and the first data point is established based on the first strategy, thereby updating the topology graph.
[0110] In this embodiment of the application, if the number of noise data points is less than a preset threshold, a corresponding point is established in the topology graph according to the first data point in the first strategy, and a connection relationship is established in the topology graph for the newly created point according to the first data point corresponding to the first device in the first strategy and the connection relationship between the first data points of the first connected first other devices.
[0111] If the number of noise data points is not less than the preset threshold, then the first strategy is added to multiple strategies, and the topology graph is updated and constructed based on the multiple strategies.
[0112] In this embodiment of the application, if the number of noisy data points is not less than a preset threshold, the first strategy is added to multiple strategies, and steps S301 to S304 are re-executed for multiple strategies to form a new topology map.
[0113] In this embodiment, upon entering a new first strategy node, it is determined whether there are any new data points. If there are new data points, the number of noise points in the current topology graph is determined through training to see if it has reached the upper limit (Ns). If it has not reached the upper limit, the nodes are directly added to the network topology graph NT, and the relationship between the new nodes and the current nodes is updated. If the upper limit has been reached, the nodes are re-clustered, and the relationship between the new nodes and the current nodes is updated.
[0114] In this embodiment, if the matching result indicates that the first data point does not match the data point in the topology graph, the first data point is added to the topology graph to update the topology graph based on the number of noisy data points in the topology graph. Thus, when a new device is added in the first strategy, the topology graph can be updated promptly based on the number of noisy points, ensuring the accuracy of the topology graph and consequently the accuracy of the detection instructions, thereby guaranteeing accurate detection of connectivity between devices.
[0115] Please see Figure 8 This is a schematic diagram of an optional flowchart of the connectivity detection method provided in an embodiment of this application. Figure 6 S503 in the above can also be implemented through S602, which will be explained in conjunction with the steps:
[0116] S602. If the matching result indicates that the first data point matches the data point in the topology map, then the topology map is updated based on the detection result of whether the first strategy exists in the strategy set.
[0117] In this embodiment of the application, if the detection device determines that the matching result indicates that the first data point matches the data point in the topology graph, that is, the first data point is not a newly added node, the detection device will perform matching detection on the first strategy and multiple strategies, and update the topology graph based on the detection result indicating whether the first strategy exists and the strategy set.
[0118] In this embodiment, if the detection result indicates that the first strategy exists in the strategy set, the topology graph is not updated. If the detection result indicates that the first strategy does not exist in the strategy set, the first strategy is added to the strategy set, and steps S301 to S304 are re-executed for multiple strategies to form a new topology graph.
[0119] In this embodiment, if the matching result indicates that the first data point matches the data point in the topology map, the topology map is updated based on the detection result of whether the first strategy exists in the strategy set. Thus, even when the first strategy does not include newly added devices, the existence of the first strategy in the strategy set can still be used to update the topology map in a timely manner, ensuring the accuracy of the topology map and consequently the accuracy of the detection instructions, thereby guaranteeing accurate detection of connectivity between devices.
[0120] Please see Figure 9 This is a schematic diagram of an optional flowchart of the connectivity detection method provided in an embodiment of this application. Figure 1 S101 in the above can also be implemented through S701, which will be explained in conjunction with the steps:
[0121] S701. Based on the source address information of each data point in the topology diagram and each device connected to the data point, the destination address information, destination port information, and network command information of other devices connected to each device, determine the detection instruction for each device.
[0122] In this embodiment of the application, there is a corresponding communication-related information between each data point in the topology map and other connected data points. The detection device can extract the communication-related information between each data point and other connected data points in the topology map, and determine the detection instruction of each device by using the source address information of each device (the device corresponding to each data point), the destination address information of the other devices connected to each device (the devices corresponding to the other data points connected to each data point), the destination port information, and the network command information.
[0123] In this embodiment, the detection command for each device is determined based on the source address information of each device in the topology graph, the destination address information of other devices connected to each device, the destination port information, and the network command information. Thus, the process of determining the detection command corresponding to each device through the constructed topology graph only needs to consider the communication-related information between each data point in the topology graph and other connected data points. Compared to related technologies that analyze a large number of data packets, this reduces the workload of data analysis, saves time, and thereby improves the efficiency of connectivity detection.
[0124] Please see Figure 10 The following is an optional flowchart of the connectivity detection method provided in the embodiments of this application, which will be described in conjunction with the steps:
[0125] S801. Receive connectivity detection results sent by each of the devices in response to the detection command; wherein the connectivity detection results are used to characterize whether each device is connected or not connected to the other connected devices, and whether the ports of each device are connected or not connected to the other connected devices.
[0126] In this embodiment, after each device receives a detection command, it can perform connectivity detection on the destination device or the destination port of the destination device based on the destination address information, destination port information, and network command information in the detection command. After each device completes the detection, it sends the determined connectivity detection result to the detection device. The connectivity detection result is used to characterize whether each device is connected or not connected to the other connected devices, and whether the ports of each device are connected or not connected to the other connected devices.
[0127] S802. Based on the connectivity detection results, mark the connection relationship between each device in the topology graph and the other connected devices.
[0128] In this embodiment of the application, the detection device can use different identifiers to mark the connection relationship between the data points of each device and the data points of other connected devices in the topology map according to the different results represented by the connectivity detection results.
[0129] Different symbols can include lines of different colors, lines of different formats, text symbols, and other similar symbols.
[0130] In this embodiment, the connectivity between associated devices is automatically verified using the aforementioned topology diagram. Because the topology diagram contains information required for policy verification, including source IP, destination IP, destination port (optional), and network command information, this embodiment can automatically trigger connectivity detection based on the topology diagram and receive the connectivity detection result determined by each device. For example, in the current topology diagram, when the connectivity detection passes, the line connecting two data points is green; when the connectivity detection fails, the line connecting two data points is red. For example, combined with… Figure 11 :
[0131] 1. When IP1 (data point) fails the connectivity test by pinging IP3 (data point), the connection between IP1 and IP3 will be a thin line; if the connectivity test passes, the connection between IP1 and IP3 will be a thick line.
[0132] 2. When the connectivity test of telnet IP2 (data point) port1 from IP1 passes, the connection between IP1 and IP2 will be a thick line, and the connection between IP2 and port1 will also be a thick line.
[0133] 3. When the connectivity test fails when telneting IP4 (data point) port1 from IP1, the connection between IP1 and IP4 is a thick line, but the connection between IP4 and port1 is a thin line.
[0134] 4. When the connectivity test from IP1 to IP4 port2 passes, the connection between IP1 and IP4 is a thick line, and the connection between IP4 and port2 is also a thick line.
[0135] In this embodiment, the connectivity detection result sent by each device in response to the detection command is received. The connectivity detection result indicates whether each device is connected or disconnected from other connected devices, and whether the ports of each device are connected or disconnected from other connected devices. Based on the connectivity detection result, the connection relationships between each device and other connected devices in the topology diagram are marked. This allows for a more intuitive and convenient display of the connectivity between devices in the topology diagram, facilitating the maintenance of each device. When a disconnection occurs, the corresponding disconnected line can be accurately located, providing timely warnings and ensuring the reliability of the entire network.
[0136] Please see Figure 12 This is a schematic diagram of the connectivity detection device provided in the embodiments of this application.
[0137] This application provides a connectivity detection device 800, including: a determination unit 801 and a transmission unit 802.
[0138] The determining unit 801 is used to determine the detection instruction corresponding to each device based on the constructed topology map; wherein, the topology map is used to characterize the connection relationship between each device and other devices and communication-related information; the detection instruction includes the communication-related information of each device and the other connected devices;
[0139] The sending unit 802 is used to send the detection command to each of the devices, so that each device can perform connectivity detection based on the detection command.
[0140] In this embodiment of the application, the determining unit 801 in the connectivity detection device 800 is used to obtain a set of strategies for connectivity detection; wherein, the set of strategies includes: multiple strategies; each strategy includes: communication-related information between the corresponding device and the connected other devices;
[0141] The topology graph is constructed based on multiple of the aforementioned strategies.
[0142] In this embodiment of the application, the communication-related information includes: the source address information of the corresponding device and the destination address information of the other devices connected to the device; the determination unit 801 in the connectivity detection device 800 is used to convert the source address information and the destination address information included in each strategy to determine the data point corresponding to each device and the data point corresponding to the other connected devices.
[0143] Cluster analysis is performed on the multiple data points to determine K center data points; where K is an integer greater than 0.
[0144] An initial topology map is constructed based on each of the central data points and the data points of the other devices connected to the device corresponding to each of the central data points;
[0145] The communication-related information between each of the devices and the other connected devices is marked between the corresponding data points in the initial topology map to form the topology map.
[0146] In this embodiment of the application, the determination unit 801 in the connectivity detection device 800 is used to obtain a new first strategy and update the topology map based on the first strategy.
[0147] In this embodiment of the application, the first strategy includes: the source address information corresponding to the first device, and the destination address information corresponding to the first other device connected to the first device; the determination unit 801 in the connectivity detection device 800 is used to convert the source address information and the destination address information included in the first strategy to determine the first data point corresponding to the first device, and the first data point corresponding to the first other device connected to the first device.
[0148] The first data point of the first device, the first data point of the first other device, and the data points in the topology map are matched to determine the matching result;
[0149] The topology graph is updated based on the matching results.
[0150] In this embodiment of the application, the determining unit 801 in the connectivity detection device 800 is used to add the first data point to the topology graph and update the topology graph based on the number of noisy data points in the topology graph if the matching result indicates that the first data point does not match the data point in the topology graph.
[0151] If the matching result indicates that the first data point matches the data point in the topology graph, then the topology graph is updated based on the detection result of whether the first strategy exists in the strategy set.
[0152] In this embodiment of the application, the determining unit 801 in the connectivity detection device 800 is used to add the first data point to the topology graph if the number of noise data points is less than a preset threshold, and to establish a connection relationship between the data point and the first data point based on the first strategy, and update the topology graph.
[0153] If the number of noisy data points is not less than the preset threshold, then the first strategy is added to multiple strategies, and the topology graph is updated and constructed based on the multiple strategies.
[0154] In this embodiment of the application, the determining unit 801 in the connectivity detection device 800 is used to determine the detection instruction of each device based on the source address information of each data point in the topology graph and each device connected to the data point, the destination address information of the other devices connected to each device, the destination port information, and the network command information.
[0155] In this embodiment of the application, the determining unit 801 in the connectivity detection device 800 is used to receive the connectivity detection result sent by each of the devices in response to the detection command; wherein, the connectivity detection result is used to characterize whether each of the devices is connected or not connected to the other connected devices, and whether the ports of each device are connected or not connected to the other connected devices.
[0156] Based on the connectivity detection results, the connection relationships between each device in the topology graph and the other connected devices are marked.
[0157] It should be noted that, in the embodiments of this application, if the above-described connectivity detection method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a connectivity detection device (which may be a personal computer, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a magnetic disk, or an optical disk. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0158] Correspondingly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the method on one side of the connectivity detection device.
[0159] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0160] It should be noted that, Figure 13 A schematic diagram of a hardware entity of an electronic device provided in an embodiment of this application, such as... Figure 13 As shown, this application embodiment provides an electronic device 900, including a memory 902 and a processor 901. The memory 902 stores a computer program that can run on the processor 901. When the processor 901 executes the program, it implements the steps in the above-described method, wherein;
[0161] Processor 901 typically controls the overall operation of electronic device 900.
[0162] The memory 902 is configured to store instructions and applications executable by the processor 901, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data and video communication data) in the processor 901 and various modules in the electronic device 900. It can be implemented by flash memory or random access memory (RAM).
[0163] Correspondingly, this application also provides a computer program product, including a computer program that can be executed by the processor 901 of the electronic device 900 to complete the steps in the method of the connectivity detection device 800.
[0164] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0165] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0166] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the apparatus or units can be electrical, mechanical, or other forms.
[0167] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0168] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0169] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0170] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0171] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A connectivity detection method, characterized in that, include: Obtain a set of strategies for connectivity detection; wherein the set of strategies includes: multiple strategies; each strategy includes: communication-related information between the corresponding device and other connected devices; the communication-related information includes: source address information of the corresponding device, and destination address information of the other devices connected to the device; The source address information and destination address information included in each strategy are transformed to determine the data point corresponding to each device, as well as the data points corresponding to other connected devices. Cluster analysis is performed on the multiple data points to determine K center data points; where K is an integer greater than 0. An initial topology map is constructed based on each of the central data points and the data points of the other devices connected to the device corresponding to each of the central data points; The communication-related information between each of the aforementioned devices and the other connected devices is marked between the corresponding data points in the initial topology map to form a topology map; The detection instruction corresponding to each device is determined based on the constructed topology map; wherein, the topology map is used to characterize the connection relationship and communication-related information between each device and other devices; the detection instruction includes: the communication-related information of each device and the other connected devices; The detection command is sent to each of the devices, so that each device can perform connectivity detection based on the detection command.
2. The connectivity detection method according to claim 1, characterized in that, The method further includes: Obtain a new first strategy and update the topology graph based on the first strategy.
3. The connectivity detection method according to claim 2, characterized in that, The first strategy includes: the source address information corresponding to the first device, and the destination address information corresponding to the first other devices connected to the first device; updating the topology map based on the first strategy includes: The source address information and destination address information included in the first strategy are transformed to determine the first data point corresponding to the first device and the first data point corresponding to the first other device connected to the first device; The first data point of the first device, the first data point of the first other device, and the data points in the topology map are matched to determine the matching result; The topology graph is updated based on the matching results.
4. The connectivity detection method according to claim 3, characterized in that, Updating the topology graph based on the matching result includes any one of the following: If the matching result indicates that the first data point does not match the data point in the topology graph, then based on the number of noisy data points in the topology graph, the first data point is added to the topology graph to update the topology graph; If the matching result indicates that the first data point matches the data point in the topology graph, then the topology graph is updated based on the detection result of whether the first strategy exists in the strategy set.
5. The connectivity detection method according to claim 4, characterized in that, The step of adding the first data point to the topology graph and updating the topology graph based on the number of noisy data points in the topology graph includes any one of the following: If the number of noise data points is less than a preset threshold, the first data point is added to the topology graph, and a connection relationship between the data points and the first data point is established based on the first strategy, and the topology graph is updated. If the number of noisy data points is not less than the preset threshold, then the first strategy is added to multiple strategies, and the topology graph is updated and constructed based on the multiple strategies.
6. The connectivity detection method according to any one of claims 1 to 5, characterized in that, Each of the aforementioned communication-related information includes: source address information of each device, destination address information of other devices connected to each device, destination port information, and network command information; the determination of the detection command corresponding to each device based on the constructed topology map includes: Based on the source address information of each data point in the topology and each device connected to the data point, the destination address information, destination port information, and network command information of other devices connected to each device, the detection instruction for each device is determined.
7. The connectivity detection method according to any one of claims 1 to 5, characterized in that, The method further includes: Receive connectivity detection results sent by each of the devices in response to the detection command; wherein the connectivity detection results are used to characterize whether each of the devices is connected or not connected to the other connected devices, and whether the ports of each device are connected or not connected to the other connected devices. Based on the connectivity detection results, the connection relationships between each device in the topology graph and the other connected devices are marked.
8. A connectivity detection device, characterized in that, include: A determining unit is configured to acquire a set of strategies for connectivity detection; wherein the set of strategies includes: multiple strategies; each strategy includes: communication-related information between the corresponding device and other connected devices; the communication-related information includes: source address information of the corresponding device, and destination address information of the other devices connected to the device; The determining unit is used to convert the source address information and destination address information included in each strategy, and determine the data point corresponding to each device, as well as the data points corresponding to other connected devices. A determining unit is used to perform cluster analysis on multiple data points to determine K center data points; where K is an integer greater than 0. A determining unit is configured to construct an initial topology map based on each of the central data points and the data points of the other devices connected to the device corresponding to each of the central data points; A determining unit is used to mark the communication-related information between each of the devices and the other connected devices in the initial topology map between the corresponding data points to form a topology map; A determining unit is configured to determine a detection instruction corresponding to each device based on a constructed topology map; wherein the topology map is used to characterize the connection relationships and communication-related information between each device and other devices; the detection instruction includes the communication-related information of each device and the other connected devices; The sending unit is used to send the detection command to each of the devices, so that each device can perform connectivity detection based on the detection command.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that can run on the processor, the processor executing the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.