A communication node connectivity analysis method based on knowledge graph

Through the communication node connectivity analysis method based on knowledge graph, the graph database and breadth-first search algorithm are used to solve the problem that traditional methods cannot efficiently analyze the connectivity between nodes in large-scale and dynamic network environments, and fast and accurate connectivity analysis and dynamic topological adjustments are achieved, which is suitable for complex communication networks.

CN119966834BActive Publication Date: 2025-08-12THE 54TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORPORATION

Patent Information

Application Number
CN202510443646.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-08-12
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

Traditional communication network topology analysis methods cannot efficiently and in real time analyze the connectivity between nodes in large-scale and dynamic network environments. Especially in multi-dimensional and multi-attribute network environments, it is difficult to deal with complex relationships and dynamic changes between nodes, and cannot fully reflect the overall structure and topological changes of the network.

Method used

The communication node connectivity analysis method based on knowledge graph is adopted, and the graph database is used to store and manage nodes and relationships, combined with the breadth-first search algorithm, and dynamically process the relationships and network types between nodes and time attributes, the connectivity components in each network are identified.

Benefits of technology

It realizes rapid and accurate analysis of connectivity between nodes in large-scale and complex communication networks, supports dynamic analysis of multiple network topology structures, meets the needs of real-time network environments, and improves processing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119966834B_ABST
    Figure CN119966834B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for analyzing the connectivity of communication nodes based on a knowledge graph, and relates to the field of communication network analysis. The present invention manages communication nodes and the relationships between them through a graph database, and dynamically screens the node relationships in combination with time attributes and communication types. The specific steps include: first, obtaining all nodes and relationships that meet the specified time conditions, and grouping them by communication type; then, constructing a graph for each communication type and applying a breadth-first search algorithm to identify connected components; finally, processing the relationships between nodes based on the attributes of the communication type, and identifying the set of interconnected nodes under each communication type. The present invention aims to efficiently analyze the connectivity between nodes in a communication network. The present invention can efficiently process large-scale network topologies, is flexible, and is particularly suitable for dynamic and real-time changing communication network environments. It has broad application value, especially in communication network modeling and analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication network analysis, and more specifically, to a method for analyzing the connectivity of communication nodes based on a knowledge graph. This method is primarily used in communication networks, particularly in complex and dynamically changing network environments, to analyze the connectivity between communication nodes in different network topologies. Background Art

[0002] With the rapid development of information technology, communication networks are increasingly used across various industries, especially in the military, aviation, and the Internet of Things. The reliability and efficiency of communication networks are crucial to the stable operation of these systems. As network scale continues to expand, network topology becomes increasingly complex. Traditional network topology analysis methods are no longer able to meet the management and optimization needs of large-scale, highly complex networks.

[0003] In the patent application for "Inter-provincial Power Trading Path Search Method, System, Device, and Storage Medium," filed by the China Electric Power Research Institute Co., Ltd. and with authorization publication number CN115600766B, while it is possible to retrieve the connectivity of each node with other nodes and form a connectivity matrix based on transmission channel information, thus providing a method for searching for the shortest path between nodes, this method is limited in that it focuses solely on the shortest path between nodes and fails to analyze the overall network structure from a global perspective. First, the patent focuses on calculating the shortest path between nodes. While it can provide optimal path selection for a single node, it does not delve into how to form a complete network topology based on node connectivity on a global scale. This means that it fails to identify all possible connection paths in the network, thus failing to fully assess important characteristics such as clustering, connectivity, and redundant paths between different nodes. Second, the invention fails to consider the overall network structure between nodes from a global perspective, failing to provide an in-depth analysis of the overall network connectivity and topology. In complex power transmission systems, in particular, the connectivity between nodes in the network is not simply a matter of the shortest path; it also involves deeper information such as the network's topological structure, grouping, and connected components. In summary, although this patent provides an efficient way to select paths between nodes, it has shortcomings in global network structure analysis, dynamic topology changes, and identification of more complex relationships between nodes.

[0004] In the patent "A Network Detection Method and Device, Electronic Device and Storage Medium" applied for by China Mobile (Suzhou) Software Technology Co., Ltd. and with authorization announcement number CN114629819B, the connectivity between the tested node and the detection node in the network is detected based on the interface information in the message. Although this method can provide connectivity information between nodes and effectively evaluate whether the nodes in the network are interoperable, this method relies on the interface information in the network message for detection and mainly focuses on the message exchange level. Although this method can detect the physical connectivity between nodes, it lacks the analysis of the entire network topology, the deep relationship between nodes, and the complexity modeling of the network layer. Therefore, it cannot fully reflect the overall structure and topology changes of the network, nor can it reveal redundant connections or potential structural problems between nodes.

[0005] Currently, topological analysis of communication networks mostly relies on traditional database systems or simple algorithms based on graph theory. However, these methods have limitations. First, traditional database structures often cannot fully capture the complex relationships and dynamic changes between nodes in communication networks, especially in multi-dimensional, multi-attribute network environments. Second, network analysis based on traditional methods often struggles to handle dynamic, real-time network states. This is especially true when considering temporal variations and varying network attributes (such as network type and communication quality), which traditional static graphs struggle to effectively support. To address these issues, graph databases, as a solution for graph data storage, have been widely used in complex network analysis due to their inherent graph structure. Graph databases can flexibly handle multiple attributes between nodes and relationships and support efficient graph traversal and query operations. However, while graph databases provide excellent support in certain scenarios, efficiently and dynamically analyzing node connectivity in large-scale networks, particularly filtering by attributes such as time and network type in multi-dimensional networks, remains a pressing challenge. Summary of the Invention

[0006] In view of this, the present invention addresses the technical problem that traditional methods cannot efficiently and in real time filter and analyze the connectivity between communication nodes by time and network type in a large-scale, dynamic network environment. It proposes a communication node connectivity analysis method based on a knowledge graph, which aims to effectively identify the connected components in each network by dynamically processing the relationship between nodes and network type, combined with time attributes. This method utilizes the powerful storage and query capabilities of the graph database, combined with the breadth-first search algorithm, to achieve efficient connectivity analysis in a large-scale, dynamic network environment, providing a new technical means for the optimization and troubleshooting of communication networks. Specifically, it includes the following steps.

[0007] A method for analyzing the connectivity of communication nodes based on a knowledge graph comprises the following steps:

[0008] Step 1: Input communication node and relationship data and save them as data files for persistent storage;

[0009] Step 2: Configure the graph data connection information and initialize the graph database after connecting to it; store the communication nodes and relationship data;

[0010] Step 3: Back up the original node and relationship information and update their timestamps to the specified time value;

[0011] Step 4: Cut out the relationships that do not meet the communication distance conditions;

[0012] Step 5: Divide and analyze the connectivity of nodes based on the communication type value;

[0013] Step 6: Map the node ID to a name to facilitate intuitive understanding of the connectivity analysis results;

[0014] Step 7: Repeat steps 1 to 6 to complete the communication node connectivity analysis based on the knowledge graph.

[0015] Furthermore, in step 1, the communication node and relationship data are input and saved as a data file for persistent storage. The specific method is as follows:

[0016] Step 1-1: Enter the information of the communication nodes one by one, including the node label Label and properties. The properties include name, distance position x, azimuth position y and time label time. After completion, save the node information data as a data file nodes.npy;

[0017] Step 1-2: Enter the relationships between communication nodes one by one, including the label of node 1, the attribute name of node 1, the label of node 2, the attribute name of node 2, the relationship name, and the relationship attributes. The relationship attributes include the communication distance, the communication type, and the time tag. After completion, save the node relationship data as a data file called relationships.npy.

[0018] Furthermore, in step 2, the graph data connection information is configured, and the graph database is initialized after being connected, specifically in the following manner:

[0019] Step 2-1: Create a graph database connection: Provide database connection information, including database address, username, and password, and connect to the Neo4j graph database. After the connection is successful, a graph database driver object will be created, which will be used to perform subsequent database operations.

[0020] Step 2-2: Graph database initialization: Clear all existing data in the graph database to avoid data redundancy and ensure that new data is not affected by old data when it is loaded;

[0021] Step 2-3: Define the node data storage function: Use Cypher language to build the node data storage function so that the dictionary type data read from nodes.npy can be converted into the node data structure of neo4j and stored in the graph database;

[0022] Step 2-4: Define the relationship data storage function: Use Cypher language to build the node data storage function so that the dictionary type data read from relationships.npy can be converted into the neo4j relational data structure and stored in the graph database;

[0023] Step 2-5: Data storage: Load the stored node data nodes.npy and relationship data relationships.npy into memory, and then create nodes and relationships in batches based on the loaded data; batch processing is achieved by looping through the array and calling the node data storage function and relationship data storage function method.

[0024] Furthermore, in step 3, the original node and relationship information is backed up and its timestamp is updated to the specified time value, specifically as follows:

[0025] Step 3-1: Traverse each node and create a new node data copy for each node. The timestamp of each node data copy will be updated to the input time_value;

[0026] Step 3-2: Traverse each relational data and export it, delete the time attribute of the exported relational data, and then set a new time attribute with the value of time_value; replace the node information in the exported relational data with the corresponding node data copy in step 3-1, and then put the exported relational data back into the database to obtain the relational data copy.

[0027] Furthermore, in step 4, the relationships that do not meet the communication distance condition are cut off in the following manner:

[0028] Step 4-1: Query all relational data copies based on time_value;

[0029] Step 4-2: Traverse each relationship data copy and record the node data copy and related attributes corresponding to the relationship data copy. The related attributes include the distance position x1 and azimuth position y1 of node 1, the distance position x2 and azimuth position y2 of node 2, the relationship data copy ID generated by the graph database, and the communication distance distance in the relationship attribute.

[0030] Step 4-3: Determine whether to delete the relationship based on the relationship between the communication distance and the node distance; Compare with the communication distance distance in the relationship attribute. If the distance between the nodes is greater than the distance, the relationship data copy is considered to be unqualified and deleted according to the relationship data copy id.

[0031] Furthermore, in step 5, the connectivity of the nodes is divided and analyzed based on the communication type value, specifically in the following manner:

[0032] Step 5-1: Under the premise that the relationship attribute time is time_value, extract all different net attribute values and store them in net_types. Use set to ensure that net_types stores all unique net attribute values.

[0033] Step 5-2: Traverse the elements in net_types to obtain different net attribute values;

[0034] Step 5-3: Use Cypher statements to query all copies of relational data that match the net, traverse each record in the query result, extract nodes a and b, use the ID of node a as the key of the dictionary data graph, and store the ID of node b as the value of the corresponding key in the list;

[0035] Step 5-4: Check each node in the dictionary data graph to see if it has been visited. If a node has not been visited, it will be used as the starting node and the breadth-first search algorithm will be called to find all connected nodes starting from this node. These connected nodes are added to the components list as a connected component. Ultimately, the components list will contain all the connected components of the graph data of the Neo4j graph database. Each connected component is composed of a group of interconnected nodes.

[0036] Step 5-5: Store the connected components of each net in the connected_components dictionary, where the key is net and the value is a list of connected components of that type;

[0037] Step 5-6: Repeat steps 5-2 to 5-5 until all elements in net_types are traversed.

[0038] Furthermore, in step 6, the node ID is mapped to the name name to facilitate intuitive understanding of the connectivity analysis results. The specific method is to query the node ID corresponding to the name relationship, build a node ID and name name dictionary, and then replace all IDs in connected_components with name.

[0039] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the background technology:

[0040] 1. The present invention can quickly and accurately analyze the connectivity between communication nodes through dynamic screening based on time and network type, thereby improving processing efficiency and being applicable to large-scale and complex communication networks.

[0041] 2. The present invention supports dynamic analysis of various network topologies and can be flexibly adjusted according to different network types and time conditions to meet the needs of real-time network environments.

[0042] 3. The present invention utilizes a graph database to store and manage nodes and relationships, and combines a breadth-first search algorithm to perform connected component analysis, thereby ensuring accurate processing of relationships between nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 Flowchart of a method according to an embodiment of the present invention.

[0044] Figure 2 This is the knowledge graph node management diagram of an embodiment of the present invention.

[0045] Figure 3 This is a knowledge graph relationship data management diagram of an embodiment of the present invention.

[0046] Figure 4 A graph structure generated for an embodiment of the present invention.

[0047] Figure 5 This is the graph structure backed up by the embodiment of the present invention.

[0048] Figure 6 This is the structure of the image after cropping according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0050] A node clustering method based on communication network connectivity analysis, the overall process is as follows Figure 1 The specific steps are as follows.

[0051] Step 1: Communication node and relationship data are input and saved as data files for persistent storage.

[0052] Step 1-1: Enter the information of the communication nodes one by one, including the node label Label and properties. The properties include name, distance position x, azimuth position y and time label time, such as Figure 2 After completion, save the node information data as a data file nodes.npy, the content is:

[0053] [{'label': 'node', 'properties': {'name': 'A', 'x': '0', 'y': '3', 'time': '0'}}

[0054] {'label': 'node', 'properties': {'name': 'B', 'x': '1', 'y': '4', 'time': '0'}}

[0055] {'label': 'node', 'properties': {'name': 'C', 'x': '2', 'y': '3', 'time': '0'}}

[0056] {'label': 'node', 'properties': {'name': 'D', 'x': '3', 'y': '1', 'time': '0'}}

[0057] {'label': 'node', 'properties': {'name': 'F', 'x': '6', 'y': '1', 'time': '0'}}

[0058] {'label': 'node', 'properties': {'name': 'G', 'x': '5', 'y': '2', 'time': '0'}}

[0059] {'label': 'node', 'properties': {'name': 'H', 'x': '4', 'y': '4', 'time': '0'}}

[0060] {'label': 'node', 'properties': {'name': 'E', 'x': '4', 'y': '1', 'time': '0'}}

[0061] {'label': 'node', 'properties': {'name': 'I', 'x': '5', 'y': '5', 'time': '0'}}

[0062] {'label': 'node', 'properties': {'name': 'J', 'x': '6', 'y': '4', 'time': '0'}}

[0063] {'label': 'node', 'properties': {'name': 'K', 'x': '6', 'y': '6', 'time': '0'}}];

[0064] Step 1-2: Enter the relationship between the communication nodes one by one, including the label of node 1, the attribute name of node 1, the label of node 2, the attribute name of node 2, the relationship name and the relationship attributes. The relationship attributes include the communication distance, the communication type, and the time label. Figure 3 After completion, save the node relationship data as a data file relationships.npy, the content is:

[0065] [{'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'D'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0066] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'H'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0067] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'G'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0068] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'D'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0069] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'D'}, 'properties2': {'name': 'E'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0070] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'E'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0071] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'E'}, 'properties2': {'name': 'F'}, 'relationship_properties': {'distance': '4', 'net': '3', 'time': '0'}}

[0072] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'F'}, 'properties2': {'name': 'E'}, 'relationship_properties': {'distance': '4', 'net': '3', 'time': '0'}}

[0073] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'F'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0074] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'G'}, 'properties2': {'name': 'F'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0075] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'E'}, 'properties2': {'name': 'F'}, 'relationship_properties': {'distance': '4', 'net': '3', 'time': '0'}}

[0076] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'F'}, 'properties2': {'name': 'E'}, 'relationship_properties': {'distance': '4', 'net': '3', 'time': '0'}}

[0077] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'D'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0078] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'G'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0079] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'G'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0080] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'H'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0081] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'F'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0082] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'G'}, 'properties2': {'name': 'F'}, 'relationship_properties': {'distance': '3.1', 'net': '2', 'time': '0'}}

[0083] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'G'}, 'properties2': {'name': 'E'}, 'relationship_properties': {'distance': '4', 'net': '3', 'time': '0'}}

[0084] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'E'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'distance': '4', 'net': '3', 'time': '0'}}

[0085] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'H'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'net': '2', 'distance': '3.1', 'time': '0'}}

[0086] {'label1': 'node', 'label2': 'node', 'relationship': 'net2', 'properties1': {'name': 'D'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'net': '2', 'distance': '3.1', 'time': '0'}}

[0087] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'G'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0088] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'H'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0089] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'H'}, 'properties2': {'name': 'I'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0090] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'I'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0091] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'I'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0092] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'K'}, 'properties2': {'name': 'I'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0093] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'K'}, 'properties2': {'name': 'I'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0094] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'I'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0095] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'J'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0096] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'K'}, 'properties2': {'name': 'J'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0097] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'K'}, 'properties2': {'name': 'J'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0098] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'J'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0099] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'J'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0100] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'H'}, 'properties2': {'name': 'J'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0101] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'K'}, 'properties2': {'name': 'J'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0102] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'J'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0103] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'I'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0104] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'K'}, 'properties2': {'name': 'I'}, 'relationship_properties': {'net': '1', 'distance': '1.7', 'time': '0'}}

[0105] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'K'}, 'properties2': {'name': 'I'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0106] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'I'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0107] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'J'}, 'properties2': {'name': 'K'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0108] {'label1': 'node', 'label2': 'node', 'relationship': 'net3', 'properties1': {'name': 'K'}, 'properties2': {'name': 'J'}, 'relationship_properties': {'net': '3', 'distance': '4', 'time': '0'}}

[0109] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'A'}, 'properties2': {'name': 'B'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0110] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'B'}, 'properties2': {'name': 'A'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0111] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'D'}, 'properties2': {'name': 'A'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0112] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'A'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0113] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'B'}, 'properties2': {'name': 'A'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0114] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'A'}, 'properties2': {'name': 'B'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0115] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'C'}, 'properties2': {'name': 'B'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0116] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'B'}, 'properties2': {'name': 'C'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0117] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'B'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0118] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'H'}, 'properties2': {'name': 'B'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0119] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'C'}, 'properties2': {'name': 'B'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0120] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'B'}, 'properties2': {'name': 'C'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0121] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'D'}, 'properties2': {'name': 'C'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0122] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'C'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0123] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'A'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0124] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'D'}, 'properties2': {'name': 'A'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0125] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'D'}, 'properties2': {'name': 'C'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0126] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'C'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0127] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'H'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0128] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'D'}, 'properties2': {'name': 'H'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0129] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'D'}, 'properties2': {'name': 'G'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0130] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'G'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0131] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'E'}, 'properties2': {'name': 'D'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}

[0132] {'label1': 'node', 'label2': 'node', 'relationship': 'net1', 'properties1': {'name': 'D'}, 'properties2': {'name': 'E'}, 'relationship_properties': {'distance': '1.7', 'net': '1', 'time': '0'}}].

[0133] Step 2: Configure the graph data connection information, and then initialize the database after connecting to the graph database;

[0134] Step 2-1: Create a graph database connection

[0135] Provide the database connection information, including the database address, username, and password, to connect to the Neo4j graph database. Once connected, a graph database driver object will be created, which will be used to perform subsequent database operations. The command is: GraphDatabase.driver(uri, auth=(user, password)) , where uri = "bolt: / / localhost:7687" is the Neo4j address, user="neo4j" is the username, and password="12345678" is the database password.

[0136] Step 2-2: Initialize the graph database

[0137] Clear all existing data in the graph database to avoid data redundancy and ensure that new data is not affected by old data when it is loaded. The command is:

[0138] query = "MATCH (n) DETACH DELETE n"

[0139] with self.driver.session() as session:

[0140] session.run(query);

[0141] Step 2-3: Define the node data storage function

[0142] Use Cypher language to build a node data storage function so that the dictionary type data read from nodes.npy can be converted into the neo4j node data structure and stored in the graph database. The command is:

[0143] query = f"CREATE (n:{label} $properties)"

[0144] with self.driver.session() as session:

[0145] session.run(query, properties= properties)

[0146] Where label is the label of the node, and properties are the properties of the node;

[0147] Step 2-4: Define the relational data storage function

[0148] Use Cypher language to build a node data storage function so that the dictionary type data read from relationships.npy can be converted into neo4j relational data structure and stored in the graph database. The command is:

[0149] query = f"""

[0150] MATCH (a:{label1}), (b:{label2})

[0151] WHERE {node1_match} AND {node2_match}

[0152] CREATE (a)-[r:{relationship} {relationship_properties_query}]->(b)

[0153] RETURN type(r)

[0154] """

[0155] with self.driver.session() as session:

[0156] result = session.run(query, **parameters)

[0157] Among them, parameters are the attribute variables of the relationship;

[0158] Steps 2-5: Data Storage

[0159] Load the stored node and relationship data (nodes.npy and relationships.npy) into memory, and then batch create nodes and relationships based on the loaded data. nodes.npy contains the label, name, location, and time information of each node, while relationships.npy contains the relationship attributes between each pair of nodes (such as relationship type, communication distance, timestamp, etc.). Batch processing is achieved by looping through the array and calling the node data storage function and relationship data storage function method. The generated graph structure is Figure 4 shown.

[0160] Step 3: Back up the original node and relationship information and update their timestamps to the specified time value;

[0161] Step 3-1: Traverse each node, obtain the node's attributes and other information, and create a new data copy for each node. The timestamp of each node will be updated to the input time_value;

[0162] Step 3-2: Traverse each relationship data, delete the time attribute of the original relationship, and then set a new time attribute for the new relationship with the value of time_value. Based on the new node generated in step 3-1, a new relationship copy is created after matching the new node. The backup graph structure is Figure 5 shown.

[0163] Step 4: Cut out the relationships that do not meet the communication distance conditions;

[0164] Step 4-1: Query all relationships based on time_value;

[0165] Step 4-2: Traverse each relationship and record the corresponding nodes and relationship attributes. Node attributes include node 1's distance position x1 and azimuth position y1, node 2's distance position x2 and azimuth position y2, relationship ID, and relationship attributes including communication distance.

[0166] Step 4-3: Determine whether to delete the relationship based on the relationship between the communication distance and the node distance. Compare with the communication distance in the relationship attribute. If the distance between the nodes is greater than the distance, the relationship is considered not to meet the requirements and the relationship is deleted according to the relationship id. The graph structure after trimming is as follows Figure 6 shown.

[0167] Step 5: Divide and analyze the connectivity of nodes based on the communication type value;

[0168] Step 5-1: Extract all distinct net attribute values, assuming the relationship attribute time is time_value. Use set to ensure that net_types stores all unique net attribute values, such as ['1', '2', '3'].

[0169] Step 5-2: Traverse the elements in net_types to obtain different net attribute values;

[0170] Step 5-3: Get the connected components for each net. Use Cypher statements to query all relationships that match the net. Traverse each record in the query result and extract nodes a and b. Use the ID of node a as the key of the dictionary data graph and store the ID of node b as the value of the corresponding key in a list.

[0171] Step 5-4: Find each connected component. Check each node in the dictionary data graph to see if it has been visited. If a node has not been visited, it will be used as the starting node, and the breadth-first search (BFS) algorithm will be called to find all connected nodes starting from that node. These connected nodes will be added as a connected component to the components list. Ultimately, the components list will contain all the connected components of the Neo4j graph database, and each connected component is composed of a set of interconnected nodes.

[0172] Step 5-5: Store the connected components of each net in the connected_components dictionary, where the key is net and the value is a list of connected components of that type. The list content is {'3': [[13, 58, 14, 39], [26, 69,70]], '2': [[13, 58, 39, 68, 14]], '1': [[13, 69, 26], [14, 68], [33, 34,67]]}.

[0173] Step 6: Map node IDs to names to facilitate intuitive understanding of connectivity analysis results. Query the node IDs and map them to names, then construct a dictionary of node IDs and names. Then, replace all IDs in connected_components with names. The resulting dictionary is {'3': [['H', 'G', 'E', 'F'], ['K', 'I', 'J']], '2': [['H','G', 'F', 'D', 'E']], '1': [['H', 'I', 'K'], ['E', 'D'], ['A', 'B', 'C']]}. For example, using communication type '3', nodes ['H', 'G', 'E', 'F'] and ['K', 'I', 'J'] can be connected to each other using communication type '3'. To sum up, it can be seen that the method of this patent can realize the connectivity analysis of communication nodes based on the knowledge graph.

[0174] Those skilled in the art will appreciate that the embodiments described are intended to help readers understand the principles of the present invention and should be understood that the scope of protection of the present invention is not limited to the embodiments described. It will be apparent to those skilled in the art that various modifications and variations are possible in the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.

Claims

1. A communication node connectivity analysis method based on knowledge graph, characterized in that: The following steps are involved: Step 1: Input communication node and relationship data and save them as data files for persistent storage; Step 2: Configure graph data connection information and initialize the graph database after connecting to the Neo4j graph database; store communication node and relationship data; the relationship data includes relationship attributes, including communication distance, communication type net, and time tag time; Step 3: Back up the original node and relationship information and update its timestamp to the specified time value time_value to obtain a copy of the relationship data; Step 4: Cut out the relationships that do not meet the communication distance conditions; Step 5: Divide and analyze the connectivity of nodes based on the communication type value; specifically, the following steps are included: Step 5-1: Under the premise that the relationship attribute time is time_value, extract all different net attribute values and store them in net_types. Use set to ensure that net_types stores all unique net attribute values. Step 5-2: Traverse the elements in net_types to obtain different net attribute values; Step 5-3: Use Cypher statements to query all copies of relational data that match the net, traverse each record in the query result, extract nodes a and b, use the ID of node a as the key of the dictionary data graph, and store the ID of node b as the value of the corresponding key in the list; Step 5-4: Check each node in the dictionary data graph to see if it has been visited. If a node has not been visited, it will be used as the starting node and the breadth-first search algorithm will be called to find all connected nodes starting from this node. These connected nodes are added to the components list as a connected component. Ultimately, the components list will contain all the connected components of the graph data of the Neo4j graph database. Each connected component is composed of a group of interconnected nodes. Step 5-5: Store the connected components of each net in the connected_components dictionary, where the key is net and the value is a list of connected components of that type; Step 5-6: Repeat steps 5-2 to 5-5 above until all elements in net_types are traversed; Step 6: Map the node ID to a name to facilitate intuitive understanding of the connectivity analysis results; Step 7: Repeat steps 1 to 6 to complete the communication node connectivity analysis based on the knowledge graph.

2. A method for analyzing the connectivity of communication nodes based on a knowledge graph according to claim 1, characterized in that: In step 1, enter the communication node and relationship data and save them as data files for persistent storage. The specific method is as follows: Step 1-1: Enter the information of the communication nodes one by one, including the node label Label and properties. The properties include name, distance position x, azimuth position y and time label time. After completion, save the node information data as a data file nodes.npy; Step 1-2: Enter the relationships between communication nodes one by one, including the label of node 1, the attribute name of node 1, the label of node 2, the attribute name of node 2, the relationship name, and the relationship attributes. The relationship attributes include the communication distance, the communication type, and the time tag. After completion, save the node relationship data as a data file called relationships.npy.

3. A method for analyzing the connectivity of communication nodes based on a knowledge graph according to claim 2, characterized in that: In step 2, configure the graph data connection information and initialize the graph database after connecting to it. The specific method is as follows: Step 2-1: Create a graph database connection: Provide database connection information, including database address, username, and password, to connect to the Neo4j graph database. Once the connection is successful, a graph database driver object will be created, which will be used to perform subsequent database operations. Step 2-2: Initialize the graph database: Clear all existing data in the graph database to avoid data redundancy and ensure that new data is not affected by old data when it is loaded; Step 2-3: Define the node data storage function: The Cypher language is used to build a node data storage function, so that the dictionary type data read from nodes.npy can be converted into the node data structure of neo4j and stored in the graph database; Step 2-4: Define the relational data storage function: Use Cypher language to build node data storage function, so that the dictionary type data read from relationships.npy can be converted into neo4j relational data structure and stored in the graph database; Step 2-5: Data storage: The stored node data nodes.npy and relationship data relationships.npy are loaded into memory, and then nodes and relationships are created in batches based on the loaded data; batch processing is achieved by looping through the array and calling the node data storage function and relationship data storage function method.

4. A method for analyzing the connectivity of communication nodes based on a knowledge graph according to claim 3, characterized in that: In step 3, back up the original node and relationship information and update their timestamps to the specified time value. The specific method is as follows: Step 3-1: Traverse each node and create a new node data copy for each node. The timestamp of each node data copy will be updated to the input time_value; Step 3-2: Traverse each relational data to export, delete the time attribute of the exported relational data, and then set a new time attribute with the value of time_value; The node information in the exported relational data is replaced with the corresponding node data copy in step 3-1, and then the exported relational data is put back into the database to obtain the relational data copy.

5. The method for analyzing the connectivity of communication nodes based on a knowledge graph according to claim 4, characterized in that: In step 4, the relationships that do not meet the communication distance conditions are trimmed as follows: Step 4-1: Query all relational data copies based on time_value; Step 4-2: Traverse each relationship data copy and record the node data copy and related attributes corresponding to the relationship data copy. The related attributes include the distance position x1 and azimuth position y1 of node 1, the distance position x2 and azimuth position y2 of node 2, the relationship data copy ID generated by the graph database, and the communication distance distance in the relationship attribute. Step 4-3: Determine whether to delete the relationship based on the relationship between the communication distance and the node distance; Compare with the communication distance distance in the relationship attribute. If the distance between the nodes is greater than the distance, the relationship data copy is considered to be unqualified and deleted according to the relationship data copy id.

6. A method for analyzing the connectivity of communication nodes based on a knowledge graph according to claim 5, characterized in that: In step 6, the node ID is mapped to the name name to facilitate intuitive understanding of the connectivity analysis results. The specific method is to query the node ID corresponding to the name relationship, build a dictionary of node ID and name name, and then replace all IDs in connected_components with name.

Citation Information

Patent Citations

  • A network detection method and device, electronic equipment and storage medium

    CN114629819B

  • Methods, systems, equipment, and storage media for cross-provincial and regional power trading path search.

    CN115600766B

  • Power-grid GIS topology analysis method based on graph database and storage medium

    CN108228724A

  • Asset connection relation configuration processing method and device in network asset surveying and mapping

    CN117579472A

Cited By

  • Information transmission path generation method based on reinforcement learning

    CN122204756A

  • A method for generating an information transmission path based on reinforcement learning

    CN122204756B