Connectivity detection method and device, electronic equipment, storage medium and computer program product
By constructing topology diagrams and determining detection instructions, the efficiency of connectivity detection between devices is improved, and the problem of time-consuming analysis of a large number of data packets in the prior art is solved.
Patent Information
- Application Number
- CN202510072843.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-01-16
AI Technical Summary
The connectivity detection efficiency between existing source-target devices is low, and it requires analyzing a large number of data packets, which takes a long time and is difficult to summarize and feedback.
By constructing a topology diagram, the detection instructions corresponding to each device, including communication related information of the device and other connected devices, are determined, and the instructions are sent to each device for connectivity detection.
Reduces the workload of analyzing data, saves time, and improves the efficiency of connectivity detection.
Smart Images

Figure CN119922104A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud network technology, and in particular to a connectivity detection method, device, electronic device, storage medium and computer program product. Background Art
[0002] In the related technology, the existing connectivity detection between source and destination devices mainly determines the network connectivity through the analysis of data packets, which requires a large number of data packets and takes a long time. At the same time, it is difficult to summarize and feedback the results, which reduces the efficiency of connectivity detection between source and destination devices. Summary of the invention
[0003] The embodiments of the present application provide a connectivity detection method, device, electronic device, storage medium, and computer program product, which can improve the efficiency of connectivity detection between source and destination devices.
[0004] The technical solution of this application is implemented as follows:
[0005] The present application provides a connectivity detection method, including:
[0006] 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 and communication related information between each of the devices and other devices; the detection instruction includes: the communication related information of each of the devices and the other connected devices;
[0007] The detection instruction is sent to each of the devices, so that each of the devices performs connectivity detection based on the detection instruction.
[0008] In the above solution, before determining the detection instruction corresponding to each device based on the constructed topology map, the method further includes:
[0009] Acquire a policy set for connectivity detection; wherein the policy set includes: a plurality of policies; each of the policies includes: the communication related information between the corresponding device and the other connected devices;
[0010] The topology map is constructed based on a plurality of the strategies.
[0011] In the above solution, the communication-related information includes: source address information of the corresponding device and destination address information of other devices connected to the device; and constructing the topology map based on the multiple strategies includes:
[0012] Transforming the source address information and the destination address information included in each of the strategies to determine the data points corresponding to each of the devices and the data points corresponding to the other connected devices;
[0013] Performing cluster analysis on the plurality of data points to determine K central data points; wherein K is an integer greater than 0;
[0014] Building 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;
[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] In the above scheme, the method further comprises:
[0017] A new first strategy is obtained, and the topology map is updated based on the first strategy.
[0018] In the above solution, 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; and updating the topology map based on the first strategy includes:
[0019] Transforming the source address information and the destination address information included in the first policy to determine a first data point corresponding to the first device and a first data point corresponding to a first other device connected to the first device;
[0020] Matching 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 a matching result;
[0021] The topology map is updated based on the matching result.
[0022] In the above solution, the updating of the topology map 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 topological map, adding the first data point to the topological map based on the number of noise data points in the topological map to update the topological map;
[0024] 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 a detection result of whether the first policy exists in the policy set.
[0025] In the above solution, the step of adding the first data point to the topological map to update the topological map based on the number of noise data points in the topological map includes any one of the following:
[0026] If the number of the noise data points is less than a preset threshold, the first data point is added to the topological map, and a connection relationship between the data point and the first data point is established based on the first strategy, and the topological map is updated;
[0027] If the number of the noise data points is not less than the preset threshold, the first strategy is added to a plurality of the strategies, and the topology map is updated and constructed based on the plurality of the strategies.
[0028] In the above scheme, each of the communication-related information includes: source address information of each of the devices, destination address information of the other devices connected to each of the devices, destination port information and network command information; the detection instruction corresponding to each device is determined based on the constructed topology map, including:
[0029] Based on the source address information of each device between each data point and the connected data points in the topology diagram, the destination address information of the other devices connected to each device, the destination port information and the network command information, the detection instructions for each device are determined.
[0030] In the above scheme, the method further comprises:
[0031] Receiving a connectivity detection result sent by each of the devices in response to the detection instruction; wherein the connectivity detection result is used to indicate whether each of the devices is connected or not connected to the other devices connected thereto, and whether each of the devices is connected or not connected to the ports of the other devices connected thereto;
[0032] Based on the connectivity detection result, the connection relationship between each of the devices in the topology diagram and the other connected devices is marked.
[0033] The present application also provides a connectivity detection device, including:
[0034] A determination unit, configured to determine a detection instruction corresponding to each device based on a constructed topology map; wherein the topology map is used to characterize a connection relationship and communication-related information between each of the devices and other devices; and the detection instruction includes the communication-related information of each of the devices and the other connected devices;
[0035] The sending unit is used to send the detection instruction to each of the devices, so that each of the devices performs connectivity detection based on the detection instruction.
[0036] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps in the above method when executing the computer program.
[0037] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are implemented.
[0038] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps in the above method when executed by a processor.
[0039] In the embodiment of the present application, 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 between each device and other devices and communication related information; the detection instruction includes: communication related information of each device and other connected devices; the detection instruction is sent to each device, so that each device can perform connectivity detection based on the detection instruction. In this way, the process of determining the detection instruction corresponding to each device through the constructed topology map only needs to consider the communication related information of each device and other connected devices in the topology map. Compared with the solution of analyzing a large number of data packets in the related technology, the workload of analyzing data is reduced, time is saved, and the efficiency of connectivity detection is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0041] Figure 2 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0042] Figure 3 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0043] Figure 4 An optional effect diagram of the connectivity detection method provided in the embodiment of the present application;
[0044] Figure 5 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0045] Figure 6 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0046] Figure 7 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0047] Figure 8 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0048] Fig. 9 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0049] Fig.10 An optional flowchart of a connectivity detection method provided in an embodiment of the present application;
[0050] Fig.11 An optional effect diagram of the connectivity detection method provided in the embodiment of the present application;
[0051] Fig.12 A schematic diagram of the structure of a connectivity detection device provided in an embodiment of the present application;
[0052] Fig.13 A hardware entity schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0054] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be 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 similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present 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 those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0057] Disadvantages of existing network connectivity detection technology:
[0058] 1. Judging network connectivity by analyzing data packets between source and destination devices requires analyzing a large number of data packets, which is time-consuming and difficult to summarize and feedback the results.
[0059] 2. Register the subnetwork controller in the global controller based on the network structure information, and then the subnetwork controller further trains the local model based on the local training set, and finally completes the abnormal detection of local network traffic. This technology verifies the connectivity of local network traffic. If the network terminal range is further expanded, the function will be limited.
[0060] 3. The network range scene simulates the real environment to the maximum extent to generate a simulated range environment. The construction of this environment requires the use of various virtualization technologies and some virtual-real combination technologies, which is very difficult. At the same time, after the range environment is available, it is necessary to further analyze the range scene data to further determine the network connectivity. This analysis process requires too high a quality of the actual operator.
[0061] In order to solve the above technical problems, the present application embodiment provides a connectivity detection method, please refer to Figure 1 , is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, which will be combined with Figure 1 The steps shown are explained:
[0062] S101. Determine the detection instructions corresponding to each device based on the constructed topology map; wherein the topology map is used to characterize the connection relationship and communication-related information between each of the devices and other devices; the detection instructions include: the communication-related information of each of the devices and the other connected devices.
[0063] In the embodiment of the present application, a topology map needs to be constructed before performing connectivity detection. The detection device can establish the connection relationship between each device and other connected devices based on the connection relationship between each device and the communication related information between each device and other connected devices, and mark the corresponding communication related information to form a topology map. The detection device can extract the communication related information corresponding to each device and other connected devices in the topology map, and determine the detection instruction corresponding to each device based on the extracted communication related information.
[0064] In the embodiment of the present application, the detection device can perform conversion according to 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 a data point cluster, and 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 topological map.
[0065] Each 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 may be a server, a cloud server or a terminal connected to each device and used to manage each device.
[0067] S102: Send the detection instruction to each of the devices, so that each of the devices performs connectivity detection based on the detection instruction.
[0068] In the embodiment of the present application, the detection device sends a detection instruction corresponding to each determined device to each device, and each device performs connectivity detection on other connected devices according to the communication related information in the detection instruction. Determine a connectivity detection result.
[0069] In an embodiment of the present application, after each device determines the connectivity test result, the detection device receives the connectivity test result fed back by each device, and based on the connectivity test result, represents whether it is connected, and marks the connection relationship between each device in the topology diagram and other connected devices accordingly.
[0070] In the embodiment of the present application, the detection device can adopt a density-based spatial clustering method (Density-Based Spatial Clustering of Applications with Noise DBSCAN), generate a network topology map based on the policy library, and then automatically verify the network policy based on the network topology map, and simultaneously feed back the verification results on the topology map, so as to solve the problems of inefficient policy verification, lack of result feedback information and difficulty in maintaining the overall network policy. The problem of cumbersome and complex network connectivity verification and network policy maintenance is solved, and the network connectivity is accurately and quickly verified, while making the verification results intuitive, easy to understand and highly maintainable.
[0071] In the embodiment of the present application, 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 between each device and other devices and communication related information; the detection instruction includes: communication related information of each device and other connected devices; the detection instruction is sent to each device, so that each device can perform connectivity detection based on the detection instruction. In this way, the process of determining the detection instruction corresponding to each device through the constructed topology map only needs to consider the communication related information of each device and other connected devices in the topology map. Compared with the solution of analyzing a large number of data packets in the related technology, the workload of analyzing data is reduced, time is saved, and the efficiency of connectivity detection is improved.
[0072] See also Figure 2 , which is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, will be described in combination with the steps:
[0073] S201. Acquire a policy set for connectivity detection; wherein the policy set includes: a plurality of policies; each of the policies includes: the communication related information between the corresponding device and the other connected devices.
[0074] In the embodiment of the present application, the detection device may obtain a policy set for performing connectivity detection on each device, wherein the policy set includes: a plurality of policies; each policy includes: the communication related information between the corresponding device and the other connected devices.
[0075] Exemplarily, multiple policy templates are formulated as shown in Table 1. Each policy should contain the following four fields (communication related information), namely sourceIP (source IP), destinationIP (destination IP), Port (destination port), 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 map based on the multiple strategies.
[0079] In the embodiment of the present application, the detection device can convert the source and destination addresses included in each strategy, determine the data point corresponding to each device, perform cluster analysis on multiple data points, and form a topology map.
[0080] In the embodiment of the present application, a policy set for connectivity detection is obtained; and the topology map is constructed based on a plurality of the policies. In this way, a topology map for characterizing the connection relationship between each device and the connected devices can be quickly determined based on the policy set. When determining the detection instruction for each device, it is only necessary to traverse each device and other connected devices in the topology map. Compared with the solutions in the related art, there is no need to analyze a large number of data packets, which improves the efficiency of determining the detection instruction, thereby improving the efficiency of connectivity detection.
[0081] See also Figure 3 , is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, Figure 2 The illustrated S202 can also be implemented through S301 to S303, which will be described in conjunction with the steps:
[0082] S301. Convert the source address information and the destination address information included in each of the policies to determine data points corresponding to each of the devices and data points corresponding to the other connected devices.
[0083] In the embodiment of the present application, 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 vectorization conversion of the source address information and the destination address information included in each strategy in four-dimensional space to determine the vector of the data point corresponding to each device.
[0084] S302: Perform cluster analysis on the plurality of data points to determine K central data points.
[0085] In the embodiment of the present application, the detection device can perform cluster analysis on the vectors of multiple data points, and determine K central data points from the multiple data points. K is an integer greater than 0.
[0086] S303: 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.
[0087] In an embodiment of the present application, the detection device can determine other connected devices in the policy 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, thereby constructing an initial topology map.
[0088] S304: Mark the communication-related information between each of the devices and the other connected devices between the corresponding data points in the initial topology map to form the topology map.
[0089] In an embodiment of the present 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 communication-related information of each device and other connected devices, thereby forming a topology map.
[0090] Exemplarily, the detection device obtains N strategies. IPV4 format: XXX.XXX.XXX.XXX, the source and destination IP addresses in each strategy can be converted into vectors corresponding to data points through four-dimensional space transformation, and the classic density-based clustering algorithm (DBSCAN) is used to process multiple data points, and K core points are determined as the central data points of the topology graph, that is, the middle points of the K clusters. Then, based on the connection relationship between the source and destination addresses in the N strategies, the relationship between other nodes and the central data points is improved and supplemented to further complete the generation of the network topology graph. Combined with Figure 4 , a strategy includes the source address IP1 of the source device, the destination address IP2 of the destination device, and the destination ports port1, port2 and portN. The detection device converts the source address and destination address in the strategy into corresponding data points, and then forms a cluster connection. Figure 4The connection relationship between data point IP1 and data point IP2. Figure 4 In the figure, data point IP1 is the source IP, data point IP2 is the destination IP, the solid line between IP1 and IP2 is used to represent the verification results of IP1 and IP2 under network commands (ping, telnet, etc.), and the lines between IP2 and port1, port2, portN are dotted lines, which means they are not necessary. Only when the network command is telnet, the lines between IP2 and port1, port2, portN will become solid lines.
[0091] In an embodiment of the present application, the source address information 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. A topology map is constructed based on each central data point and the data points of other devices connected to the device corresponding to each central data point. Since the connection relationship between the data points in the topology map is used to characterize the connection relationship between the devices, when performing connectivity detection, it is only necessary to determine the communication-related information between the corresponding data points in the topology map, and the amount of data to be processed is small, which improves the efficiency of connectivity detection.
[0092] See also Figure 5 , which is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, will be described in combination with the steps:
[0093] S401: Acquire a new first strategy, and update the topology map based on the first strategy.
[0094] In the embodiment of the present application, the detection device obtains a new first strategy. The first strategy includes source address information of the first device and destination address information of the 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 the data points in the topology map based on the first data point.
[0095] In the embodiment of the present application, a new first strategy is obtained, and the topology map is updated based on the first strategy. In this way, after the connection relationship of the network device changes, the topology map can be quickly and timely updated based on the corresponding first strategy, providing a relatively accurate connection relationship of the network device, and then the accurate topology map of the relationship network can be used to determine a relatively accurate detection instruction, thereby achieving accurate detection of connectivity.
[0096] See also Figure 6 , is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, Figure 5S401 in the embodiment can also be implemented through S501 to S503, which will be described in combination with the steps:
[0097] S501. Convert the source address information and the destination address information included in the first policy to determine a first data point corresponding to a corresponding first device and a first data point corresponding to a first other device connected to the first device.
[0098] In an embodiment of the present application, the detection device performs four-dimensional space vector conversion on the source address information corresponding to the first device included in the first strategy, and the destination address information of the first other device connected to the first device, 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 vector.
[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 a matching result.
[0100] In the embodiment of the present application, the detection device may 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 a newly added data point.
[0101] The IP address corresponding to the determined first data point may be matched with the IP address of the data point in the topology map to determine a matching result.
[0102] S503: Update the topology map based on the matching result.
[0103] In the embodiment of the present application, the detection device can adopt different strategies to update the topology map using the first data point according to whether the first data point represented by the matching result is a newly added data point.
[0104] In the embodiment of the present application, the source address information and the 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 and the first data point of the first other device are matched with the data points in the topology map to determine the matching result; the topology map is updated based on the matching result. In this way, after the connection relationship of the network device changes, the topology map can be quickly and timely updated based on the corresponding first data point, providing a relatively accurate connection relationship of the network device, and then the accurate topology map of the relationship network can be used to determine a relatively accurate detection instruction, so as to achieve accurate detection of connectivity.
[0105] See also Figure 7 , is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, Figure 6 S503 in the above can also be implemented by S601, which will be described in combination with the steps:
[0106] S601: If the matching result indicates that the first data point does not match the data point in the topological map, based on the number of noise data points in the topological map, the first data point is added to the topological map to update the topological map.
[0107] In an embodiment of the present application, if the detection device determines that the matching result indicates that the first data point does not match the data point in the topological map, that is, that the first data point is a newly added node, the detection device adds the first data point to the topological map based on the number of noise data points in the determined topological map to update the topological map.
[0108] In an embodiment of the present application, the detection device forms a topological map based on DBSCAN algorithm clustering. The DBSCAN algorithm is based on a set of neighborhoods to describe the compactness of the sample set, and is based on parameters (∈, MinPts) to describe the compactness of the data point distribution in the neighborhood. Among them, ∈ is used to characterize the area range neighborhood value, and MinPts is used to characterize the minimum number of sample points. Among them, 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. The upper limit of the number of noise points is defined as Ns in this application.
[0109] If the number of the noise data points is less than a preset threshold, the first data point is added to the topological map, and a connection relationship between the data point and the first data point is established based on the first strategy, and the topological map is updated.
[0110] In an embodiment of the present application, if the number of noise data points is less than a preset threshold, a corresponding point is established in the topology map according to the first data point in the first strategy, and a connection relationship is established for the newly created point in the topology map 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 other connected devices.
[0111] If the number of the noise data points is not less than the preset threshold, the first strategy is added to a plurality of the strategies, and the topology map is updated and constructed based on the plurality of the strategies.
[0112] In the embodiment of the present application, if the number of noise 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 the multiple strategies to form a new topology map.
[0113] In the embodiment of the present application, when the new first strategy single is entered, it is determined whether there are new data points. If there are new data points, it is determined through training and learning whether the number of noise points in the current topology map reaches the upper limit (Ns). If it does not reach the upper limit, it is directly added to the network topology map NT, and the relationship between the new node and the current node is updated. If it has reached the upper limit, it is re-clustered and the relationship between the new node and the current node is updated.
[0114] In the embodiment of the present application, if the matching result indicates that the first data point does not match the data point in the topology map, the first data point is added to the topology map based on the number of noise data points in the topology map to update the topology map. In this way, when the first strategy includes a new device, the topology map can be updated in a timely manner based on the number of noise points in the topology map, thereby ensuring the accuracy of the topology map, and then ensuring the accuracy of the detection instruction, providing a guarantee for accurately detecting the connectivity between devices.
[0115] See also Figure 8 , is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, Figure 6 S503 in the above can also be implemented by S602, which will be described in combination with the steps:
[0116] S602: If the matching result indicates that the first data point matches the data point in the topology map, update the topology map based on a detection result of whether the first policy exists in the policy set.
[0117] In an embodiment of the present application, if the detection device determines that the matching result indicates that the first data point matches the data point in the topology map, that is, the first data point is not a newly added node, the detection device will perform a matching detection on the first strategy and multiple strategies, and based on the detection result indicating whether the first strategy exists in the strategy set, update the topology map.
[0118] In the embodiment of the present application, if the detection result indicates that the first policy exists in the policy set, the topology map is not updated. If the detection result indicates that the first policy does not exist in the policy set, the first policy is added to the policy set, and steps S301 to S304 are re-executed for multiple policies to form a new topology map.
[0119] In the embodiment of the present application, 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 policy exists in the policy set. In this way, when the first policy does not include a newly added device, the topology map can be updated in a timely manner based on whether the first policy exists in the policy set, thereby ensuring the accuracy of the topology map, and then ensuring the accuracy of the detection instruction, providing a guarantee for accurately detecting the connectivity between devices.
[0120] See also Fig. 9 , is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, Figure 1 S101 in the example can also be implemented by S701, which will be described in combination with the steps:
[0121] S701, determine the detection instruction for each device based on the source address information of each device between each data point and the connected data point in the topology diagram, the destination address information of the other devices connected to each device, the destination port information and the network command information.
[0122] In an embodiment of the present application, there is 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 through the communication-related information including 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 the embodiment of the present application, the detection instruction of each device is determined based on the source address information of each device in the topology map, the destination address information of other devices connected to each device, the destination port information and the network command information. In this way, the process of determining the detection instruction corresponding to each device through the constructed topology map only needs to consider the communication related information between each data point in the topology map and other connected data points. Compared with the solution of analyzing a large number of data packets in the related art, the workload of analyzing data is reduced, time is saved, and the efficiency of connectivity detection is improved.
[0124] See also Fig.10 , which is an optional flow chart of the connectivity detection method provided in the embodiment of the present application, will be described in combination with the steps:
[0125] S801. Receive a connectivity test result sent by each of the devices in response to the test instruction; wherein the connectivity test result is used to characterize whether each of the devices is connected or not connected to the other connected devices, and whether each of the devices is connected or not connected to the ports of the other connected devices.
[0126] In the embodiment of the present application, after each device receives the detection instruction, 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 instruction. After each device is detected, the determined connectivity detection result is sent to the detection device. The connectivity detection result is used to characterize whether each of the devices is connected or not connected to the other devices connected thereto, and whether each of the devices is connected or not connected to the ports of the other devices connected thereto.
[0127] S802: Based on the connectivity detection result, mark the connection relationship between each device in the topology diagram and the other connected devices.
[0128] In the embodiment of the present application, the detection device can use different identifiers to mark the connection relationship between the data points of each device in the topology map and the data points of other connected devices according to different results represented by the connectivity detection result.
[0129] Among them, different logos may include: lines of different colors, lines of different formats, text logos and other suitable logos.
[0130] In an embodiment of the present application, the above-mentioned topology diagram is used to automatically verify the connectivity between related devices. Because the topology diagram contains the information required for policy verification, source IP, destination IP, destination port (optional), and network command information. In an embodiment of the present application, connectivity detection can be automatically triggered based on the topology diagram, and the connectivity detection results determined by each device can be received. Exemplarily, in the current topology diagram, when the connectivity test passes, the line between the two data points is green; when the connectivity test fails, the line between the two data points is red. Exemplarily, combined with Fig.11 :
[0131] 1. When the connectivity test between IP1 (data point) and IP3 (data point) fails, the line connecting IP1 and IP3 is a thin line. If the connectivity test passes, the line connecting IP1 and IP3 is a thick line.
[0132] 2. When the connectivity test of port1 from IP1 to telnet IP2 (data point) is passed, the corresponding line between IP1 and IP2 is a thick line, and the line between IP2 and port1 is a thick line.
[0133] 3. When the connectivity test of telnet IP4 (data point) port1 from IP1 fails, the corresponding line between IP1 and IP4 is a thick line, but the line between IP4 and port1 is a thin line.
[0134] 4. When the connectivity test of telnet IP4 port2 from IP1 passes, the corresponding line between IP1 and IP4 is a thick line, and the line between IP4 and port2 is a thick line.
[0135] In the embodiment of the present application, the connectivity test result sent by each device in response to the detection instruction is received; wherein the connectivity test result is used to characterize whether each device is connected or not connected to other connected devices, and whether each device is connected or not connected to the ports of other connected devices. Based on the connectivity test result, the connection relationship between each device and other connected devices in the topology diagram is marked. In this way, the connectivity between each device can be more intuitively and conveniently displayed in the topology diagram, which is convenient for the maintenance of each device. When there is a disconnection, the corresponding disconnected line can be accurately found, and a timely warning can be issued to ensure the reliability of the entire network equipment.
[0136] See also Fig.12 , is a schematic diagram of the structure of the connectivity detection device provided in an embodiment of the present application.
[0137] The embodiment of the present application provides a connectivity detection device 800 , including: a determining unit 801 and a sending 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 and communication related information between each of the devices and other devices; the detection instruction includes the communication related information of each of the devices and the other connected devices;
[0139] The sending unit 802 is configured to send the detection instruction to each of the devices, so that each of the devices performs connectivity detection based on the detection instruction.
[0140] In the embodiment of the present application, the determination unit 801 in the connectivity detection device 800 is used to obtain a policy set for connectivity detection; wherein the policy set includes: a plurality of policies; each of the policies includes: the communication related information between the corresponding device and the other connected devices;
[0141] The topology map is constructed based on a plurality of the strategies.
[0142] In the embodiment of the present application, 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 determination unit 801 in the connectivity detection device 800 is used to transform the source address information and the destination address information included in each of the policies, and determine the data points corresponding to each of the devices, and the data points corresponding to the other connected devices;
[0143] Performing cluster analysis on the plurality of data points to determine K central data points; wherein K is an integer greater than 0;
[0144] Building 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;
[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 the embodiment of the present application, the determining 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 the embodiment of the present 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 transform the source address information and the destination address information included in the first strategy, and 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] Matching 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 a matching result;
[0149] The topology map is updated based on the matching result.
[0150] In the embodiment of the present application, the determination unit 801 in the connectivity detection device 800 is used to add the first data point to the topological map and update the topological map based on the number of noise data points in the topological map if the matching result indicates that the first data point does not match the data point in the topological map;
[0151] 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 a detection result of whether the first policy exists in the policy set.
[0152] In the embodiment of the present application, the determination unit 801 in the connectivity detection device 800 is used to add the first data point to the topology map if the number of the noise data points is less than a preset threshold, and establish a connection relationship between the data point and the first data point based on the first strategy, and update the topology map;
[0153] If the number of the noise data points is not less than the preset threshold, the first strategy is added to a plurality of the strategies, and the topology map is updated and constructed based on the plurality of the strategies.
[0154] In an embodiment of the present application, the determination 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 device between each data point and the connected data point in the topology diagram, the destination address information of the other devices connected to each device, the destination port information and the network command information.
[0155] In the embodiment of the present application, the determination 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 instruction; wherein the connectivity detection result is used to indicate whether each of the devices is connected to or not connected to the other devices connected thereto, and whether each of the devices is connected to or not connected to the ports of the other devices connected thereto;
[0156] Based on the connectivity detection result, the connection relationship between each of the devices in the topology diagram and the other connected devices is marked.
[0157] It should be noted that in the embodiments of the present application, if the above-mentioned connectivity detection method is implemented in the form of a software function 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 the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions for enabling a connectivity detection device (which can be a personal computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0158] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the method on the connectivity detection device side are implemented.
[0159] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0160] It should be noted that Fig.13 A hardware entity diagram of an electronic device provided in an embodiment of the present application, such as Fig.13 As shown, an embodiment of the present application provides an electronic device 900, including a memory 902 and a processor 901, wherein the memory 902 stores a computer program that can be run on the processor 901, and the processor 901 implements the steps in the above method when executing the program, wherein;
[0161] The processor 901 generally controls the overall operations of the 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 processed by the processor 901 and various modules in the electronic device 900 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0163] Correspondingly, an embodiment of the present application further provides a computer program product, including a computer program, which can be executed by a processor 901 of an electronic device 900 to complete the steps in the method on the side of the connectivity detection device 800.
[0164] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and 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 the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0165] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0166] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0167] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0168] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0169] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a magnetic disk or an optical disk, and other media that can store program codes.
[0170] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function 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 embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a mobile storage device, a ROM, a magnetic disk, or an optical disk.
[0171] The above is only an implementation method 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.
Claims
1. A connectivity detection method, characterized in that: include: 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 and communication related information between each of the devices and other devices; the detection instruction includes: the communication related information of each of the devices and the other connected devices; The detection instruction is sent to each of the devices, so that each of the devices performs connectivity detection based on the detection instruction.
2. The connectivity detection method according to claim 1, characterized in that: Before determining the detection instruction corresponding to each device based on the constructed topology map, the method further includes: Acquire a policy set for connectivity detection; wherein the policy set includes: a plurality of policies; each of the policies includes: the communication related information between the corresponding device and the other connected devices; The topology map is constructed based on a plurality of the strategies.
3. The connectivity detection method according to claim 2, characterized in that: The communication-related information includes: source address information of the corresponding device, and destination address information of other devices connected to the device; and constructing the topology map based on the multiple strategies includes: Transforming the source address information and the destination address information included in each of the strategies to determine the data points corresponding to each of the devices and the data points corresponding to the other connected devices; Performing cluster analysis on the plurality of data points to determine K central data points; wherein K is an integer greater than 0; Building 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; 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.
4. The connectivity detection method according to claim 3, characterized in that: The method further comprises: A new first strategy is obtained, and the topology map is updated based on the first strategy.
5. The connectivity detection method according to claim 4, 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 device connected to the first device; and updating the topology map based on the first strategy includes: Transforming the source address information and the destination address information included in the first policy to determine a first data point corresponding to the first device and a first data point corresponding to a first other device connected to the first device; Matching 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 a matching result; The topology map is updated based on the matching result.
6. The connectivity detection method according to claim 5, characterized in that: The updating of the topology map 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 topological map, adding the first data point to the topological map based on the number of noise data points in the topological map to update the topological map; 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 a detection result of whether the first policy exists in the policy set.
7. The connectivity detection method according to claim 6, characterized in that: The step of adding the first data point to the topological map and updating the topological map based on the number of noise data points in the topological map includes any one of the following: If the number of the noise data points is less than a preset threshold, the first data point is added to the topological map, and a connection relationship between the data point and the first data point is established based on the first strategy, and the topological map is updated; If the number of the noise data points is not less than the preset threshold, the first strategy is added to a plurality of the strategies, and the topology map is updated and constructed based on the plurality of the strategies.
8. The connectivity detection method according to any one of claims 1 to 7, characterized in that: Each of the communication related information includes: source address information of each of the devices, destination address information of the other devices connected to each of the devices, destination port information and network command information; the detection instruction corresponding to each device is determined based on the constructed topology map, including: Based on the source address information of each device between each data point and the connected data points in the topology diagram, the destination address information of the other devices connected to each device, the destination port information and the network command information, the detection instructions for each device are determined.
9. The connectivity detection method according to any one of claims 1 to 7, characterized in that: The method further comprises: Receiving a connectivity detection result sent by each of the devices in response to the detection instruction; wherein the connectivity detection result is used to indicate whether each of the devices is connected or not connected to the other devices connected thereto, and whether each of the devices is connected or not connected to the ports of the other devices connected thereto; Based on the connectivity detection result, the connection relationship between each of the devices in the topology diagram and the other connected devices is marked.
10. A connectivity detection device, characterized in that: include: A determination unit, configured to determine a detection instruction corresponding to each device based on a constructed topology map; wherein the topology map is used to characterize a connection relationship and communication-related information between each of the devices and other devices; and the detection instruction includes the communication-related information of each of the devices and the other connected devices; The sending unit is used to send the detection instruction to each of the devices, so that each of the devices performs connectivity detection based on the detection instruction.
11. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, comprising a computer program, characterized in that The computer program implements the steps of the method according to any one of claims 1 to 9 when executed by a processor.
Citation Information
Patent Citations
Test method and device for blockchain network structure, terminal and storage medium
CN112134762A
Network fault diagnosis method and device
CN115225462A
Access control strategy configuration method and electronic equipment
CN115514586A
Atlas construction method and device and storage medium
CN116955631A
Intelligent analysis and application system and method for wireless communication network knowledge graph
WO2023155481A1