Message passing based graph data updating method, device, equipment and medium

By updating the node features of graph data in the Internet of Things and utilizing the features and weights of neighboring nodes, the problem of large data volume in graph data storage and transmission is solved, resource optimization and flexible updating of graph data are achieved, and the effective execution of downstream tasks is supported.

CN115510077BActive Publication Date: 2026-02-06CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211183320.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2026-02-06
Estimated Expiration
2042-09-27

AI Technical Summary

Technical Problem

In IoT scenarios, the storage and transmission of graph data is too large. The node feature update logic of existing graph convolutional networks is simple and inflexible, resulting in high resource consumption and difficulty in optimization.

Method used

By acquiring interaction data of devices in the IoT topology, the feature states of nodes in the graph data are updated, the features of neighboring nodes and the number of neighbors of the node to be updated are extracted, and the features of the updated node are calculated using normalization and weighting, thereby reducing the amount of real-time data collection.

Benefits of technology

It enables optimized graph data processing without real-time data collection, reduces the amount of data stored and transmitted, ensures the availability of graph data, and supports the effective use of downstream tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510077B_ABST
    Figure CN115510077B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of Internet of Things, and particularly relates to a graph data updating method and device based on message passing, equipment and medium. The method obtains interaction data of devices in the Internet of Things topology at the current time, updates the features of nodes of corresponding devices in the current graph data based on the interaction data, extracts the feature states of all nodes in the graph data, determines nodes with un-updated feature states as to-be-updated nodes, obtains all adjacent nodes of the to-be-updated nodes, extracts the node features and neighbor numbers of each adjacent node, normalizes the neighbor numbers of all adjacent nodes to obtain weights, updates the node features of the to-be-updated nodes based on the weights and the node features of the adjacent nodes, obtains updated graph data, and updates the graph data based on the interaction data at the current time, without long-time and real-time collection of interaction data to update the graph data, so that the data volume can be reduced, and the availability of the graph data can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application is suitable for the technical field of Internet of Things, and particularly relates to a graph data updating method and device based on message passing, equipment and medium. BACKGROUND

[0002] At present, the outstanding performance of deep learning in many fields makes it the mainstream direction of artificial intelligence research today, such as face recognition, voice assistants, machine translation, etc. But the data involved in these fields is single-structure data, while graph data has a broader application scenario in the industry, for example, in social networks, electronic shopping, Internet of Things, etc. Graph data can better reflect the network topology relationship. In this context, graph neural networks for processing graph data can effectively combine graph data and deep learning technology, thereby improving deep learning. Among them, the most widely used is graph convolutional network. The core idea of graph convolutional network is to update the features of each data node and use these updated features to train downstream tasks. However, the current logic of updating node features of graph convolutional network is relatively simple and has poor flexibility. In the use scenario of Internet of Things (IoT), there are a large number of sensors, sensors, systems or platform devices, and the communication between devices forms a huge topology network. These devices will generate a large amount of data every second. For this complex scenario, real-time data collection will cause the data volume to increase dramatically, requiring a higher storage library. Data transmission during use will also occupy a large amount of resources, which is not conducive to the use of downstream tasks based on this scenario. Therefore, how to optimize the processing of graph data under the Internet of Things topology during use to reduce the data volume of storage and transmission under the condition of ensuring the availability of graph data has become a problem to be solved. SUMMARY

[0003] Therefore, the embodiments of the present application provide a graph data updating method and device based on message passing, equipment and medium to solve the problem of how to optimize the processing of graph data under the Internet of Things topology during use to reduce the data volume of storage and transmission under the condition of ensuring the availability of graph data.

[0004] In a first aspect, the embodiments of the present application provide a graph data updating method based on message passing, which comprises:

[0005] Obtaining the interaction data of the devices in the Internet of Things topology at the current time, updating the features of the nodes of the corresponding devices in the existing graph data based on the interaction data, extracting the feature states of all nodes in the graph data, and determining the nodes with un-updated feature states as the nodes to be updated;

[0006] Obtaining all neighbor nodes of the nodes to be updated, extracting the node features and neighbor numbers of each neighbor node;

[0007] normalizing the neighbor quantity of all neighbor nodes, calculating a normalized value corresponding to each neighbor node, and determining the normalized value of each neighbor node as the weight of the corresponding neighbor node;

[0008] multiplying the node feature of each neighbor node with the weight of the corresponding neighbor node, summing all multiplied results, and updating the node feature of the to-be-updated node using the summed result to obtain updated graph data.

[0009] In an embodiment, extracting the node feature of each neighbor node includes:

[0010] detecting the feature state of each neighbor node;

[0011] If the feature state of a neighbor node is detected as updated, the current node feature of the neighbor node is determined as the node feature of the neighbor node.

[0012] In an embodiment, after detecting the feature state of each neighbor node, the method further includes:

[0013] If the feature state of the neighbor node is detected as not updated, the node feature of the neighbor node is determined as empty.

[0014] In an embodiment, obtaining all neighbor nodes of the to-be-updated node includes:

[0015] obtaining message data of the to-be-updated node, and analyzing the sending node of the message data of the to-be-updated node;

[0016] taking the sending node as a neighbor node of the to-be-updated node.

[0017] In an embodiment, extracting the neighbor quantity of each neighbor node includes:

[0018] For any neighbor node, obtaining the message data of the neighbor node, and determining all sending nodes corresponding to the message data of the neighbor node;

[0019] counting the number of all sending nodes, wherein the sending nodes representing the same node in all sending nodes are counted as 1.

[0020] In an embodiment, normalizing the neighbor quantity of all neighbor nodes, and calculating the normalized value corresponding to each neighbor node includes:

[0021] using a Softmax function to normalize the neighbor quantity of all neighbor nodes, and calculating the normalized value of each neighbor node.

[0022] In a second aspect, an embodiment of the present application provides a graph data updating device based on message passing, the graph data updating device includes:

[0023] The node determination module is configured to acquire interaction data of devices in the Internet of Things topology at a current time, update features of nodes of corresponding devices in existing graph data based on the interaction data, extract feature states of all nodes in the graph data, and determine nodes with an unupdated feature state as to-be-updated nodes;

[0024] The neighbor node acquisition module is configured to acquire all neighbor nodes of the to-be-updated node, and extract node features and neighbor numbers of each neighbor node.

[0025] The weight determination module is configured to normalize the neighbor numbers of all neighbor nodes, calculate a normalized value corresponding to each neighbor node, and determine the normalized value of each neighbor node as a weight of the corresponding neighbor node.

[0026] The feature update module is configured to multiply the node features of each neighbor node by the weight of the corresponding neighbor node, sum all multiplication results, and update the node features of the to-be-updated node using the sum result to obtain updated graph data.

[0027] In an embodiment, the neighbor node acquisition module comprises:

[0028] The state detection unit is configured to detect the feature state of each neighbor node.

[0029] The first feature determination unit is configured to, if it is detected that the feature state of a neighbor node is updated, determine the current node feature of the neighbor node as the node feature of the neighbor node.

[0030] In an embodiment, the neighbor node acquisition module further comprises:

[0031] The second feature determination unit is configured to, after detecting the feature state of each neighbor node, if it is detected that the feature state of a neighbor node is unupdated, determine the node feature of the neighbor node as empty.

[0032] In an embodiment, the neighbor node acquisition module comprises:

[0033] The analysis unit is configured to acquire message data of the to-be-updated node, and analyze sending nodes of the message data of the to-be-updated node.

[0034] The neighbor node determination unit is configured to take the sending nodes as neighbor nodes of the to-be-updated node.

[0035] In an embodiment, the neighbor node acquisition module comprises:

[0036] The sending node determination unit is configured to, for any neighbor node, acquire message data of the neighbor node, and determine all sending nodes corresponding to the message data of the neighbor node.

[0037] a statistics unit configured to count the number of all sending nodes, wherein the sending nodes that are represented as the same node are counted as one.

[0038] In an embodiment, the weight determination module comprises:

[0039] a normalization unit configured to normalize the neighbor number of all neighbor nodes using a Softmax function to obtain a normalized value of each neighbor node.

[0040] In a third aspect, an embodiment of the present application provides a computer device, which comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the graph data updating method according to the first aspect when executing the computer program.

[0041] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the graph data updating method according to the first aspect.

[0042] Compared with the prior art, the embodiment of the present application has the beneficial effects that: the embodiment of the present application obtains the interaction data of the devices in the Internet of Things topology at the current time, updates the features of the nodes corresponding to the devices in the current graph data based on the interaction data, extracts the feature states of all nodes in the graph data, determines the nodes whose feature states are not updated as to-be-updated nodes, obtains all neighbor nodes of the to-be-updated nodes, extracts the node features and neighbor numbers of each neighbor node, normalizes the neighbor numbers of all neighbor nodes to obtain the normalized values corresponding to each neighbor node, determines the normalized values of each neighbor node as the weights of the corresponding neighbor nodes, multiplies the node features of each neighbor node and the weights of the corresponding neighbor nodes, sums all the multiplied results, uses the summed result to update the node features of the to-be-updated nodes, obtains the updated graph data, and updates the graph data based on the interaction data at the current time, without the need for long-time and real-time collection of the interaction data to update the graph data, so that the data volume can be reduced, the usability of the graph data can be ensured, the features of a node in the graph data are updated through the association of neighbor nodes, the relationship between the node and the neighbor nodes is known through the message passing method to update the graph data, and the use of downstream tasks can be ensured. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0044] Figure 1 is an application environment schematic diagram of a message passing-based graph data updating method provided by an embodiment of the present application;

[0045] Figure 2 is a flow schematic diagram of a message passing-based graph data updating method provided by an embodiment of the present application;

[0046] Figure 3 is a flow schematic diagram of a message passing-based graph data updating method provided by an embodiment of the present application;

[0047] Figure 4 is a structure schematic diagram of a message passing-based graph data updating device provided by an embodiment of the present application;

[0048] Figure 5 is a structure schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0049] In the following description, for the purpose of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

[0050] It should be understood that the term "comprising" as used in the specification and in the claims indicates the presence of the recited features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0051] It should also be understood that the term "and / or" as used in the specification and in the claims indicates any combination of one or more of the associated listed items and all possible combinations of those items.

[0052] As used in the specification and the appended claims, the term "if' can be interpreted as meaning "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.

[0053] In addition, in the description of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0054] In the present application, the reference "one embodiment" or "some embodiments" and the like means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in further some embodiments" and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "include", "contain", "have" and their variants mean "include but not limited to", unless otherwise specifically emphasized.

[0055] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (AI) is to use digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain the best results.

[0056] The basic technology of artificial intelligence generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The software technology of artificial intelligence mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0057] It should be understood that the size of the serial number of each step in the following embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0058] In order to illustrate the technical solutions of the present application, the following will be described by specific embodiments. In order to illustrate the technical solutions of the present application, the following will be described by specific embodiments.

[0059] The embodiment one of the application provides a message passing based graph data updating method, which can be applied to the application environment as shown in Figure 1 The client can be a computer device such as a palm computer, a desktop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud computer device, a personal digital assistant (PDA) and the like. The server can be implemented by an independent server or a server cluster composed of multiple servers.

[0060] Referring to Figure 2 is a flowchart of a message passing based graph data updating method provided by the embodiment two of the application, and the message passing based graph data updating method is applied to a server in Figure 1 The computer device corresponding to the server is connected to a corresponding database to obtain corresponding graph data in the database, and the data in the database is historical graph data. The computer device can also be connected to a corresponding client, and the client is operated by a user. The user can provide real-time original data for forming graph data to the server through the client. As shown in Figure 2 The message passing based graph data updating method can include the following steps:

[0061] In step S201, interaction data of devices in the Internet of Things topology at a current time is obtained, features of nodes corresponding to the devices in current graph data are updated based on the interaction data, feature states of all nodes in the graph data are extracted, and nodes with an un-updated feature state are determined as to-be-updated nodes.

[0062] In the application, devices in the Internet of Things topology interact with each other through messages, and the content of the interaction can constitute data of the corresponding devices. When the data format is used to represent the Internet of Things topology, each device is regarded as a node in graph data, and the corresponding interaction data is the feature of the node.

[0063] Under normal circumstances, the update of the features of the nodes needs to obtain new features of all nodes. However, it is impossible to obtain interaction data of all devices at a time. The use of long-time collection can obtain the interaction data of all devices, but long-time collection will collect a large amount of data, which is not conducive to storage and transmission.

[0064] The interaction data of the devices at the current time is collected, which is used to update the features of the nodes corresponding to the devices in the current graph data. After the update, the feature state of the node is set to updated, and the nodes that are not updated are updated by using the process of steps S202 to S204.

[0065] The message passing can refer to interaction between any two objects. The objects can be actual objects such as mobile phones, servers, and the like, or virtual objects such as nodes of a process or a service in a system. The graph data is data in a form similar to a graph table, and includes at least one data node. The data node has its own node data or node features, and is connected to other data nodes through edges. The edges represent the relationship between the data nodes, and the two data nodes with message passing can be represented by one edge. The connection between the data nodes forms a topological network graph similar to a node, that is, the graph data.

[0066] The node in the graph data is the data node described above. The data node can include data information, data feature information, and some attribute information. The attribute information can include attribute information representing the state of the data node features. The attribute information can determine whether the features in the corresponding data node have been updated. For example, if the feature state of the node is updated, the attribute information can be marked as 1, and if the feature state of the node is not updated, the attribute information can be marked as 0.

[0067] The graph data update instruction can be issued by a client. A user uses a client to connect to a server, and determines whether the graph data needs to be updated according to the demand, and then issues an update instruction when the graph data needs to be updated. In addition, the graph data update instruction can also be the server. The server triggers the update of the graph data when executing a corresponding process, and then generates an update instruction and executes subsequent steps.

[0068] In step S202, all adjacent nodes of the node to be updated are obtained, and the node features and the number of adjacent nodes of each adjacent node are extracted.

[0069] In this application, the adjacent node is the adjacent node, which can refer to a node associated with the current node. For example, two nodes connected by an edge in the graph data can be adjacent nodes of each other.

[0070] After determining the node to be updated, the edges of the node to be updated are identified. Specifically, the edge data of the node to be updated is analyzed, the identification information of the corresponding node such as the number and name of the node is determined from the edge data, and the adjacent nodes are confirmed according to the identification information.

[0071] Each adjacent node has its own data information, data feature information, and some attribute information. As a node, the adjacent node also has adjacent nodes, and the analysis method of the current node is the same as described above, that is, the edge data of the adjacent node is analyzed, the identification information of the node connected to the adjacent node by the edge is determined from the edge data, and the adjacent nodes are confirmed according to the identification information.

[0072] Thus, for any neighbor node, the neighbor nodes corresponding to the neighbor node are counted, and the sum of the counted neighbor nodes is the number of neighbors. Further, the number of neighbors can not include the to-be-updated node.

[0073] The node feature can refer to data information, data feature information, etc. in the node, and can also refer to an encoded feature after some data is encoded, for example, a vector representation of the data.

[0074] In an embodiment, extracting the node feature of each neighbor node includes:

[0075] detecting the feature state of each neighbor node;

[0076] If the feature state of a neighbor node is detected to be updated, the current node feature of the neighbor node is determined as the node feature of the neighbor node.

[0077] In the embodiment, after the neighbor node is determined, attribute information of the feature state representing the node feature of the neighbor node is obtained. If the feature state of the node is updated, the attribute information can be marked as 1, and if the feature state of the node is not updated, the attribute information can be marked as 0, so that the feature state of the neighbor node can be determined.

[0078] If the feature state of the neighbor node is updated, it can be indicated that the current node feature of the neighbor node is the latest node feature, which can be used for subsequent updating. If the feature state of the neighbor node is not updated, it can be indicated that the node feature of the neighbor node is the old node feature, and according to the user's demand, the old node feature can be set to be used for updating the node feature of other nodes.

[0079] In an embodiment, after detecting the feature state of each neighbor node, the method further includes:

[0080] If the feature state of the neighbor node is detected to be not updated, the node feature of the neighbor node is determined to be empty.

[0081] In the embodiment, when the node feature of other nodes is updated subsequently, the old node feature can be set to be avoided, that is, if the node feature of the neighbor node is not updated, the node feature of the neighbor node is defined to be empty, which is used for subsequent updating. At this time, the node feature of the neighbor node is not updated, so that the role of the node feature in subsequent calculation of the node feature of other nodes is zero.

[0082] In an embodiment, obtaining all neighbor nodes of the to-be-updated node includes:

[0083] Obtaining the message data of the to-be-updated node, and analyzing the sending node of the message data of the to-be-updated node;

[0084] The sending node is a neighbor node of the node to be updated.

[0085] In a real-time application scenario, the node can be any device in the topology network. For a current node, when all neighbor nodes of the node are obtained, message data of the node can be obtained and analyzed to determine the sender of the message data, and the device corresponding to the node to which the sender belongs is a neighbor node.

[0086] The analysis of the message data obtains the neighbor nodes, which is essentially the same as the analysis of the edge data. Both use the message passing mechanism, that is, the two nodes have interacted. In the graph data, there are historical data and real-time data. The real-time data is analyzed by using the message data, and the historical data is analyzed by using the edge data.

[0087] In an embodiment, extracting the number of neighbors of each neighbor node includes:

[0088] For any neighbor node, the message data of the neighbor node is obtained, and all sending nodes corresponding to the message data of the neighbor node are determined.

[0089] The number of all sending nodes is counted, wherein the sending nodes representing the same node in all sending nodes are counted as 1.

[0090] For the number of neighbors, when the real-time data is counted, the method used is similar to the method of analyzing the neighbor nodes, that is, when all neighbor nodes of the node are obtained, the message data of the node can be obtained and analyzed to determine the sender of the message data, and the device corresponding to the node to which the sender belongs is a neighbor node.

[0091] After the sending nodes are determined, for the same node, that is, the device representing the same node, although there are multiple message data, it can only be counted as one neighbor node, so it can only be counted as 1 when counting.

[0092] For example, if node v1 is a node to be updated, the neighbor nodes of the node v1 are node v2, node v3, and node v4. Through analysis of the message data, the neighbor nodes of node v2 are node v 21 (interacted with two message data), node v 22 , node v 23 , the neighbor nodes of node v3 are node v 31 , node v 32 , node v 33 , node v 34 , and the neighbor nodes of node v4 are node v 41(node v exchanged five pieces of message data), node v 42 , node v 43 The number of neighbors of node v2 is 3, the number of neighbors of node v3 is 4, and the number of neighbors of node v4 is 3. It can be seen that the same node corresponding to the message data is the number 1.

[0093] In step S203, the number of neighbors of all adjacent nodes is normalized, and the normalized value corresponding to each adjacent node is calculated to determine the weight of each adjacent node.

[0094] In this application, each adjacent node corresponds to a number of neighbors, for example, a node v i , the corresponding number of neighbors k i , the normalization is to process k i , and the weight is allocated according to the size of k i .

[0095] Among them, the normalization can be zero-mean normalization (z-score standardization) and minimum-maximum normalization (0-1 normalization), of course, other methods such as recursive method can also be used.

[0096] 0-1 normalization is the simplest normalization method, which maps data values to [0, 1]. The disadvantage is that if the values are concentrated and one value is very large, the normalized values will be close to 0 and will not differ much. In different use scenarios, different normalization methods can be used according to the size of the data, the calculation efficiency or the requirement for accuracy.

[0097] It can be seen that when the number of neighbors of an adjacent node is larger, the corresponding weight is larger, and when the number of neighbors of an adjacent node is smaller, the corresponding weight is smaller, that is, the more neighbors of an adjacent node, the more "right to speak" it should have, which can be used in subsequent node updates.

[0098] After normalization, the normalized value corresponding to each adjacent node is obtained, which can be used as the weight of the adjacent node.

[0099] In step S204, the node features of each adjacent node are multiplied by the weight of the corresponding adjacent node, and the sum of all multiplied results is calculated to update the node features of the node to be updated, and the updated graph data is obtained.

[0100] In this application, in order to seek the node features used for updating the node to be updated, the node features are generally artificially assigned, and the adjacent nodes are used to obtain the node features used for updating in this application.

[0101] The node features of the neighbor nodes are multiplied by the weights of the neighbor nodes, and the multiplication results of each neighbor node are added, and the final result can be used as the node feature for updating the to-be-updated node, so that the to-be-updated node is updated by the neighbor nodes, and the updated graph data is obtained, without uninterrupted use of real-time collected data for updating the graph data, long-time data collection can be avoided, and the amount of collected data is reduced.

[0102] For a node v1, all neighbor nodes of the node v1 are found, and the features of the neighbor nodes are added and averaged to obtain a new feature of the node v1.

[0103] The given graph data is G(V, E), the node set is V = {v1, v2,..., vn}, the node feature set is X = {x1, x2,..., xn}, and at this time, n n

[0104] For a node v i in the graph data G(V, E), a neighbor set of the node v i is found. The neighbor set contains neighbor nodes. i l i The neighbor nodes contain neighbor numbers Count(v l ) = [k1, k2,..., kn]. The normalized value corresponding to each k is obtained by normalizing Count(v l ), that is, the weight of the corresponding neighbor node .

[0105] The feature of each neighbor node is multiplied by the weight to update the update feature of the node v i , and the formula is as follows:

[0106]

[0107] For example, when the graph data is used in the training of the graph convolution network, the graph data can be updated or generated. When updating, the node feature of a node in the graph data is changed, so that the node features of all nodes in the graph data are updated. When generating, a new node is generated and neighbor nodes of the new node are defined. According to the neighbor nodes of the new node, the node feature for updating the new node can be obtained.

[0108] The embodiment of the application extracts the feature states of all nodes in the graph data when the graph data update instruction is acquired, determines the nodes with the feature states not updated as the nodes to be updated, acquires all adjacent nodes of the nodes to be updated, extracts the node features and the neighbor numbers of each adjacent node, normalizes the neighbor numbers of all adjacent nodes, calculates the normalized values corresponding to each adjacent node, determines the normalized values of each adjacent node as the weights of the corresponding adjacent nodes, multiplies the node features of each adjacent node and the weights of the corresponding adjacent nodes, and sums all the multiplied results, uses the summed result to update the node features of the nodes to be updated, obtains the updated graph data, and can realize the update of the graph data based on the interaction data at the current moment, without long-time and real-time collection of the interaction data to update the graph data, so that the data volume can be reduced, the usability of the graph data can be ensured, and the feature update of a node in the graph data through the association of adjacent nodes is realized, the relationship between the node and the adjacent nodes is known through the message passing manner, the update of the graph data is realized, and the use of downstream tasks can be ensured.

[0109] Referring to Figure 3 , it is a flowchart of a graph data update method based on message passing provided by the embodiment three of the application, as Figure 3 shown, the graph data update method based on message passing can include the following steps:

[0110] Step S301, acquiring the interaction data of devices in the Internet of Things topology at the current moment, updating the features of nodes corresponding to the devices in the current graph data based on the interaction data, extracting the feature states of all nodes in the graph data, and determining the nodes with the feature states not updated as the nodes to be updated.

[0111] Step S302, acquiring all adjacent nodes of the nodes to be updated, and extracting the node features and the neighbor numbers of each adjacent node.

[0112] Among them, the steps S301 to S302 are the same as the contents of the steps S201 to S202 described above, and the description of the steps S201 to S202 can be referred to, and will not be repeated here.

[0113] Step S303, normalizing the neighbor numbers of all adjacent nodes using the Softmax function, and calculating the normalized values of each adjacent node.

[0114] In the application, the neighbor numbers are normalized in a recursive manner, wherein the neighbor numbers of all adjacent nodes can be represented as Count(v i )=[k1,k2,...,k i ], and the normalization can be calculated using the Softmax function, and the formula is as follows:

[0115] α v= Softmax(Count(v i )),

[0116] wherein, a v characterizes the weight of any adjacent node.

[0117] In this application, the basic idea is that low-degree nodes (i.e. few neighbors) will have a greater impact on the neighbor nodes, while high-degree nodes (i.e. many neighbors) will have a lower impact.

[0118] The value of the Softmax function is between 0-1, and is centered symmetric at 0.5, and the closer to x=0, the greater the slope. An important prediction model in machine learning, logistic regression (LR), is based on the Softmax function. The main task of the LR model is to give some historical {X, Y}, where X is the sample n feature value, and the value of Y is {0, 1} representing positive and negative examples, through the learning of these historical samples, a mathematical model is obtained, which can predict Y given a new X. The LR model is a binary classification model, that is, for an X, it predicts whether it occurs or not. However, in fact, for an event, it is not possible to get 100% prediction, so LR can get the probability of an event, and if it is more than 50%, it is considered to occur, and if it is less than 50%, it is considered not to occur. From the purpose of LR, there are two conditions that must be met when selecting a function:

[0119] 1. The value range is between 0 and 1.

[0120] 2. For an event, 50% is the watershed of its result, and the selected function should be centered symmetric at 0.5.

[0121] Based on this, the weight obtained is more accurate, which is helpful in subsequent application environment.

[0122] Step S304, determining the normalized value of each adjacent node as the weight of the corresponding adjacent node.

[0123] Step S305, multiplying the node features of each adjacent node with the weight of the corresponding adjacent node, and summing all the multiplied results, and updating the node features of the node to be updated using the summing result to obtain updated graph data.

[0124] Among them, steps S304 to S305 are the same as part of the above steps S203 to S204, and the description of steps S203 to S204 can be referred to, and will not be repeated here.

[0125] For example, the node updating feature process described above can be used in the data filling or data completion scenario. Many knowledge graphs represent each piece of information in the form of a triple (h, r, t), which includes two entity elements, i.e., the head entity h and the tail entity t, and a relationship element, i.e., the relationship r. A knowledge graph contains a large number of such triples, but some of these triples are often incomplete, lacking one or more elements. At this time, it is necessary to complete the triple, that is, to predict the missing elements in the triple, and to complete the knowledge graph is to complete all incomplete triples in the knowledge graph. In the real world, there are long-tail relationships in knowledge graphs, that is, a large part of the data has only a few training instances. For sparse long-tail relationships, the lack of sufficient training triples greatly limits the effective development of knowledge graph completion work. Based on this, after the knowledge graph is constructed, some of the completed data can be updated using the node updating method in this application.

[0126] When the graph data updating instruction is obtained, the feature state of all nodes in the graph data is extracted, the nodes whose feature state is not updated are determined as to-be-updated nodes, all neighbor nodes of the to-be-updated nodes are obtained, the node features and neighbor numbers of each neighbor node are extracted, the neighbor numbers of all neighbor nodes are normalized using a Softmax function, the normalized values of each neighbor node are calculated, the normalized value of each neighbor node is determined as the weight of the corresponding neighbor node, the node features of each neighbor node are multiplied by the weight of the corresponding neighbor node, and the sum of all multiplied results is calculated. The node features of the to-be-updated nodes are updated using the sum result, the feature of a node in the graph data is updated through the association of neighbor nodes, the relationship between the node and the neighbor node is known through the message passing method, so that the node feature updating can be flexibly realized, which can be used in a complex relationship scenario and helps to improve the accuracy of training downstream tasks of the graph convolution network in a complex scenario.

[0127] The graph data updating method based on message passing corresponding to the above embodiment, Figure 4 The structure block diagram of the graph data updating device based on message passing provided by the fourth embodiment of the present application is shown. The above-mentioned graph data updating device is applied to Figure 1 The computer device corresponding to the server is connected to the corresponding database to obtain the corresponding graph data in the database. The data in the database is historical graph data. The above-mentioned computer device can also be connected to the corresponding client, and the client is operated by the user. The user can provide real-time original data for forming graph data to the server through the client. For ease of illustration, only the parts related to the embodiments of the present application are shown.

[0128] Referring to Figure 4 The graph data updating device comprises:

[0129] The node determination module 41 is configured to acquire interaction data of devices in the Internet of Things topology at a current time, update features of nodes corresponding to the devices in current graph data based on the interaction data, extract feature states of all nodes in the graph data, and determine nodes with the feature states being not updated as to-be-updated nodes;

[0130] The neighbor node acquisition module 42 is configured to acquire all neighbor nodes of the to-be-updated node, and extract node features and neighbor numbers of each neighbor node.

[0131] The weight determination module 43 is configured to normalize the neighbor numbers of all the neighbor nodes, calculate a normalized value corresponding to each neighbor node, and determine the normalized value of each neighbor node as a weight of the corresponding neighbor node.

[0132] The feature update module 44 is configured to multiply the node features of each neighbor node by the weight of the corresponding neighbor node, sum all the multiplication results, and update the node features of the to-be-updated node using the sum result to obtain updated graph data.

[0133] In an embodiment, the neighbor node acquisition module 42 includes:

[0134] The state detection unit is configured to detect the feature state of each neighbor node.

[0135] The first feature determination unit is configured to, if it is detected that the feature state of a neighbor node is updated, determine the current node feature of the neighbor node as the node feature of the neighbor node.

[0136] In an embodiment, the neighbor node acquisition module 42 further includes:

[0137] The second feature determination unit is configured to, after detecting the feature state of each neighbor node, if it is detected that the feature state of a neighbor node is not updated, determine the node feature of the neighbor node as empty.

[0138] In an embodiment, the neighbor node acquisition module 42 includes:

[0139] The analysis unit is configured to acquire message data of the to-be-updated node, and analyze sending nodes of the message data of the to-be-updated node.

[0140] The neighbor node determination unit is configured to determine the sending nodes as neighbor nodes of the to-be-updated node.

[0141] In an embodiment, the neighbor node acquisition module 42 includes:

[0142] The sending node determination unit is configured to, for any neighbor node, acquire message data of the neighbor node, and determine all sending nodes corresponding to the message data of the neighbor node.

[0143] The statistics unit is used to count the number of all sending nodes, where sending nodes that are represented as the same node are counted as 1.

[0144] In one embodiment, the weight determination module 43 includes:

[0145] The normalization unit is used to normalize the number of neighbors of all neighboring nodes using the Softmax function, and calculates the normalized value of each neighboring node.

[0146] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0147] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of this application. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, which, when executed by the processor, implements the steps in any of the above-described embodiments of the message-passing-based graph data update method.

[0148] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.

[0149] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0150] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory can be a memory of the computer device, and the internal memory provides an environment for running of the operating system and the computer-readable instructions in the readable storage medium. The readable storage medium can be a hard disk of the computer device, and in other embodiments, can also be an external storage device of the computer device, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory can include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a BootLoader, data, and other programs, such as program codes of computer programs, etc. The memory can also be used to temporarily store data that has been output or will be output.

[0151] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above device can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here. If the integrated unit is realized in the form of software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of the above method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium at least includes any entity or device that can carry computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, computer readable medium cannot be electrical carrier signal and telecommunication signal.

[0152] The above embodiment methods can also be implemented by a computer program product, which can be run on a computer device to make the computer device execute the steps of the above method embodiments.

[0153] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0154] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0155] In the embodiments provided by the present application, it should be understood that the disclosed apparatus / computer device and method can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely schematic. The division of the modules or units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0156] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0157] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A message passing based graph data update method, characterized by, The graph data updating method comprises: obtaining interaction data of devices in the Internet of Things topology at the current moment, updating the features of nodes corresponding to the devices in the current graph data based on the interaction data, extracting the feature states of all nodes in the graph data, and determining nodes with an un-updated feature state as to-be-updated nodes; obtaining all adjacent nodes of the to-be-updated nodes, and extracting the node features and the number of neighbors of each adjacent node; normalizing the number of neighbors of all adjacent nodes, calculating the normalization value corresponding to each adjacent node, and determining the normalization value of each adjacent node as the weight of the corresponding adjacent node, wherein when the number of neighbors of an adjacent node is larger, the corresponding weight is larger, and when the number of neighbors of an adjacent node is smaller, the corresponding weight is smaller; multiplying the node features of each adjacent node by the weight of the corresponding adjacent node, summing all the multiplied results, and updating the node features of the to-be-updated nodes using the summed result to obtain updated graph data.

2. The graph data update method according to claim 1, characterized in that, The extraction of the node features of each adjacent node comprises: detecting the feature state of each adjacent node; if it is detected that the feature state of an adjacent node is updated, determining the current node features of the adjacent node as the node features of the adjacent node.

3. The graph data update method according to claim 2, characterized in that, After detecting the feature state of each adjacent node, the method further comprises: if it is detected that the feature state of the adjacent node is un-updated, determining the node features of the adjacent node as empty.

4. The graph data update method of claim 1, wherein, The obtaining of all adjacent nodes of the to-be-updated nodes comprises: obtaining the message data of the to-be-updated nodes, and analyzing the sending nodes of the message data of the to-be-updated nodes; regarding the sending nodes as the adjacent nodes of the to-be-updated nodes.

5. The graph data update method of claim 1, wherein, The extraction of the number of neighbors of each adjacent node comprises: for any adjacent node, obtaining the message data of the adjacent node, and determining all sending nodes corresponding to the message data of the adjacent node; counting the number of all sending nodes, wherein all sending nodes representing the same node are counted as 1.

6. The graph data update method of any one of claims 1 to 5, characterized in that, The normalization of the number of neighbors of all adjacent nodes and the calculation of the normalization value corresponding to each adjacent node comprise: normalizing the number of neighbors of all adjacent nodes using a Softmax function to calculate the normalization value of each adjacent node.

7. A message passing based graph data update apparatus, characterized by comprising: The graph data updating device comprises: a node determination module configured to obtain interaction data of devices in the Internet of Things topology at the current moment, update the features of nodes corresponding to the devices in the existing graph data based on the interaction data, extract the feature states of all nodes in the graph data, and determine nodes with an un-updated feature state as to-be-updated nodes; an adjacent node obtaining module configured to obtain all adjacent nodes of the to-be-updated nodes, and extract the node features and the number of neighbors of each adjacent node; a weight determination module configured to normalize the number of neighbors of all adjacent nodes, calculate the normalization value corresponding to each adjacent node, and determine the normalization value of each adjacent node as the weight of the corresponding adjacent node, wherein when the number of neighbors of an adjacent node is larger, the corresponding weight is larger, and when the number of neighbors of an adjacent node is smaller, the corresponding weight is smaller; and The feature updating module is configured to multiply the node feature of each neighbor node by the weight of the corresponding neighbor node, sum all the multiplied results, and update the node feature of the node to be updated using the summed result to obtain updated graph data.

8. The graph data update apparatus according to claim 7, characterized in that, The neighbor node obtaining module comprises: A state detection unit configured to detect the feature state of each neighbor node; A first feature determination unit configured to determine the current node feature of a neighbor node as the node feature of the neighbor node if it is detected that the feature state of the neighbor node is updated.

9. A computer device, comprising: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the graph data updating method according to any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executable on the processor to implement the graph data updating method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data classification method and device, computer equipment and storage medium

    CN113590720A

  • Graph neural network method, device and equipment capable of keeping similarity transformation invariance

    CN114239802A