Graphic data treatment method, electronic equipment, readable storage medium and program product
By calculating the confidence of nodes and edges in the knowledge graph, identifying main nodes, generating and filtering potential connection relationships, and using the multi-head self-attention model for prediction, we solve the problem of the lack of global governance and prediction capabilities in the existing technology, and achieve Effective prediction of knowledge graph structure and improvement of data governance.
Patent Information
- Application Number
- CN202411418257.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-21
AI Technical Summary
The existing knowledge graph data governance technology lacks a global governance mechanism, making it difficult to predict the connection between nodes and edges, and fails to make full use of high confidence nodes and edges to improve the overall quality of the knowledge graph.
By obtaining the node and edge data in the knowledge graph, calculating the confidence of each node and edge, using the K-means clustering algorithm to identify the main nodes, generating potential connection relationships, filtering and processing these relationships, and finally using the multi-head self-attention model Make predictions.
It achieves effective prediction of the knowledge graph structure, improves the efficiency and accuracy of data governance, and ensures the accuracy and effectiveness of prediction results.
Smart Images

Figure CN119337980A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph data management technology, and in particular to a graph data management method, electronic device, readable storage medium and program product. Background Art
[0002] Knowledge graph is an important branch of big data technology. Knowledge graph represents entities and their relationships in the form of nodes and edges. However, as the scale of knowledge graph continues to expand, data quality issues are becoming increasingly prominent, including inaccurate and incomplete node and edge data. These problems not only reduce the effectiveness of knowledge graph, but may also have a negative impact on intelligent applications based on knowledge graph.
[0003] Existing knowledge graph data governance technologies lack a global governance mechanism for data quality, often focusing on optimization in one aspect and failing to globally manage the data quality of nodes and edges. Existing knowledge graph governance solutions lack a systematic processing method when mining potential relationships, making it difficult to predict possible node and edge connections. Existing solutions fail to fully utilize high-confidence nodes and edges to further improve the overall quality of knowledge graphs. Summary of the invention
[0004] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method for managing graphic data, an electronic device, a readable storage medium and a program product, which solve the technical problem of how to provide effective prediction of the future development of the knowledge graph structure while ensuring data quality.
[0005] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0006] In a first aspect, an embodiment of the present invention provides a method for managing graphic data, including:
[0007] S1. Obtain the data of each node and each edge in the specified knowledge graph;
[0008] S2. Based on a preset node inspection rule, a preset edge inspection rule, the node data, and the edge data, respectively obtain the confidence of each node data and the confidence of each edge data;
[0009] S3, using the K-means clustering algorithm to divide the confidence set into two clusters, and based on the two clusters, determining the main nodes in the specified knowledge graph;
[0010] The confidence set includes the confidence of each node data and the confidence of each edge data in the specified knowledge graph;
[0011] S4. Based on the main nodes in the specified knowledge graph, generate options corresponding to each main node in the specified knowledge graph;
[0012] Any optional item corresponding to any main node includes a potential connection relationship between the main node and other main nodes according to a predefined rule;
[0013] S5. Filter the options corresponding to the main nodes in the specified knowledge graph according to the pre-set filtering rules to obtain the filtered options;
[0014] S6. Use the trained multi-head self-attention model to process each selected option to obtain the final confidence level corresponding to each selected option;
[0015] S7. Determine the prediction result based on the final confidence level corresponding to each selected option.
[0016] Preferably,
[0017] Among them, each node data includes: node ID, node type, node name, node attribute information, node label;
[0018] Node attribute information includes: date of birth, address, policy number, insurance amount, and start date;
[0019] The node label is any one of the labels of the policyholder, the insured, and the beneficiary;
[0020] Each edge data includes: edge ID, starting node ID, end node ID, edge type, edge attribute, and edge label;
[0021] Edge attributes include the relationship between the starting node and the ending node and the corresponding weight value.
[0022] Preferably, the S2 specifically includes:
[0023] S21, based on the pre-set node inspection rules and node data, respectively use formula (1) to obtain the confidence of each node data;
[0024] The formula (1) is:
[0025] C i =w1×S i1 +w2×S i2 +w3×S i3 ;
[0026] Among them, C i is the confidence of the i-th node data; w1, w2, w3 are pre-set weight coefficients, and w1+w2+w3=1;
[0027] Among them, S i1 =s i1 +s i2 +s i3 +s i4 +s i5 ;
[0028] s i1 is the score of the birth date in the node attribute information in the i-th node data. If the birth date is within the first specified time range, then s i1 is 1; otherwise s i1 is 0;s i2 is the score of the address in the node attribute information in the i-th node data. If the address is within the specified address range, then s i2 is 1; otherwise s i2 is 0;s i3 is the score of the policy number in the node attribute information in the i-th node data. If the policy number format is correct, then s i3 is 1; otherwise s i1 is 0;s i4 is the score of the insurance amount in the node attribute information in the i-th node data. If the insurance amount is within the specified amount range, then s i4 is 1; otherwise s i4 is 0;s i5 is the score of the start date in the node attribute information in the i-th node data. If the start date is within the second specified time range, then s i5 is 1; otherwise s i5 is 0;
[0029] S i2 =N p-i / 9;N p-i is the number of first attributes actually provided in the i-th node data; the first attributes include: node ID, node type, node name, date of birth, address, policy number, insurance amount, start date, node label;
[0030] S i3 = Actual number of connections of the ith node / expected number of connections of the ith node;
[0031] S22, based on the preset edge inspection rules and edge data, respectively use formula (2) to obtain the confidence of each edge data;
[0032] The formula (2) is:
[0033] D e =w4×C e1 ;
[0034] D eis the confidence of the e-th edge data; w4 is a pre-set coefficient;
[0035] C e1 =c e1 +c e2 +c e3 ; Among them, c e1 is the score of the edge type in the e-th edge data. If the edge type meets the preset standard, then c e1 is 1, otherwise c e1 is 0; c e2 is the score of the edge attribute in the e-th edge data, where a e c e2 is the weight value of the edge attribute in the e-th edge data, a min is the preset minimum weight value, a max is the preset maximum weight value;
[0036] c e3 is the score of the edge label in the e-th edge data. If the edge label matches the expected label, then c e3 is 1, otherwise c e3 is 0.
[0037] Preferably, the S3 specifically includes:
[0038] S31, using a K-means clustering algorithm to divide the confidence set into a first cluster and a second cluster;
[0039] The centroid of the confidence of the first cluster is higher than the centroid of the confidence of the second cluster;
[0040] S32, taking the first type of nodes as the main nodes in the specified knowledge graph;
[0041] The first type of nodes are the nodes remaining after removing the second type of nodes from the nodes in the specified knowledge graph;
[0042] The second type of node is a node to which the node data corresponding to the confidence in the second cluster belongs.
[0043] Preferably, the S5 specifically includes:
[0044] The optional items corresponding to the main nodes in the specified knowledge graph that do not meet the preset filtering rules are deleted to obtain the filtered optional items.
[0045] Preferably,
[0046] wherein, a first knowledge graph of the same type as the specified knowledge graph obtained in advance is used to train the multi-head self-attention model to obtain a trained multi-head self-attention model;
[0047] Each node and each edge in the first knowledge graph has a corresponding label set;
[0048] The label is a label that identifies whether a node or edge with the label data should exist.
[0049] Preferably, S7 specifically includes: taking the option corresponding to the final confidence with the highest value as the prediction result.
[0050] In a second aspect, this embodiment further provides an electronic device, including:
[0051] processor;
[0052] a memory for storing processor-executable instructions;
[0053] Wherein, the processor is configured to execute the executable instructions to implement the steps of the method described in the first aspect.
[0054] In a third aspect, this embodiment further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when executed by a processor.
[0055] In a fourth aspect, this embodiment further provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect when executed by a processor.
[0056] The beneficial effects of the present invention are as follows: a method for managing graph data of the present invention systematically identifies the main nodes in the knowledge graph by clustering confidence through the K-means clustering algorithm, which makes the focus of data management more concentrated and saves processing time and resources for irrelevant or minor nodes. Based on the main nodes, options for potential connection relationships are generated, and the most likely connection relationships are screened out through predefined rules, which helps to mine and predict potential connections in the graph and further enrich the structure of the knowledge graph. Finally, a multi-head self-attention model is used to further process the screened options, and based on the model training capabilities, the confidence of each potential connection is accurately predicted to ensure the accuracy and effectiveness of the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A flowchart of a method for managing graphic data of the present invention;
[0058] Figure 2 The figure is a schematic diagram of the structure of an electronic device of the present invention. DETAILED DESCRIPTION
[0059] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0060] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0061] See also Figure 1 This embodiment provides a method for managing graphic data, including:
[0062] S1. Obtain the data of each node and each edge in the specified knowledge graph;
[0063] S2. Based on a preset node inspection rule, a preset edge inspection rule, the node data, and the edge data, respectively obtain the confidence of each node data and the confidence of each edge data;
[0064] S3, using the K-means clustering algorithm to divide the confidence set into two clusters, and based on the two clusters, determining the main nodes in the specified knowledge graph;
[0065] The confidence set includes the confidence of each node data and the confidence of each edge data in the specified knowledge graph;
[0066] S4. Based on the main nodes in the specified knowledge graph, generate options corresponding to each main node in the specified knowledge graph;
[0067] Any optional item corresponding to any main node includes a potential connection relationship between the main node and other main nodes according to a predefined rule;
[0068] In this embodiment, in graph data management, generating connection relationships between nodes is a key step. In this embodiment, options (i.e., connection relationships) can be generated through different standards. The following is a detailed explanation and example showing how to apply rules to generate connection relationships between nodes:
[0069] 1. Direct connection between nodes
[0070] Connection condition: There is an actual connection or a possible logical connection between node A and node B.
[0071] Connection type: based on similarity of node types, matching of node attributes, or business rules.
[0072] Example: policyholders and insured persons in the insurance industry
[0073] Nodes: Policyholder A, Insured Person X;
[0074] Generate a connection:
[0075] Rule application: If the business rules dictate that there should be a connection between the policyholder and the insured, a connection is generated.
[0076] Result: A connection relationship is generated between policyholder A and insured X, indicating that policyholder A has insured insured X.
[0077] 2. Connection based on attribute matching
[0078] The predefined rule is an attribute matching condition: certain attribute values of node A and node B match or are within a certain range.
[0079] Example, address matching in the insurance industry;
[0080] node:
[0081] Insured A (Address: Z Region)
[0082] Insured X (Address: Z Region)
[0083] Generate a connection:
[0084] Rule application: The addresses of policyholder A and insured X match and are both in region Z.
[0085] Result: The connection relationship between policyholder A and insured person X is generated, indicating that they may belong to the same region or the same insurance plan.
[0086] 3. Connection driven by business logic
[0087] Predefined rules are business logic conditions: potential connections are generated based on business logic and rules. For example, connection relationships are generated between nodes that are usually associated in a business process.
[0088] For example, policy and claim records in insurance business;
[0089] Node: Insurance policy A; Claim record X;
[0090] Rule application: In the business process, insurance policies are usually associated with claim records.
[0091] Result: A connection relationship Insurance Policy A Claim Record X is generated, indicating that Insurance Policy A may have a related Claim Record X.
[0092] S5. Filter the options corresponding to the main nodes in the specified knowledge graph according to the pre-set filtering rules to obtain the filtered options;
[0093] S6. Use the trained multi-head self-attention model to process each selected option to obtain the final confidence level corresponding to each selected option;
[0094] S7. Determine the prediction result based on the final confidence level corresponding to each selected option.
[0095] Among them, each node data includes: node ID, node type, node name, node attribute information, node label;
[0096] Node attribute information includes: date of birth, address, policy number, insurance amount, and start date;
[0097] The node label is any one of the labels of the policyholder, the insured, and the beneficiary;
[0098] Each edge data includes: edge ID, starting node ID, end node ID, edge type, edge attribute, and edge label;
[0099] Edge attributes include the relationship between the starting node and the ending node and the corresponding weight value.
[0100] For example, Node ID: a number that uniquely identifies each node. Node type: a classification of a node, such as policyholder, insured, beneficiary. Node name: a name of a node, such as a personal name. Node attribute information: Date of birth: the node's date of birth. Address: the node's address information. Policy number: the unique number of the policy. Insurance amount: the insurance amount of the policy. Start date: the effective start date of the policy. Node label: a label of a node, such as policyholder label, insured label, beneficiary label.
[0101] Edge ID: A number that uniquely identifies each edge. Start node ID: The ID of the start node of the edge. End node ID: The ID of the end node of the edge. Edge type: The type of edge, such as insurance relationship, claim relationship. Edge attributes: Relationship: Describes the relationship between the start node and the end node, such as "insurance" or "claim". Weight value: The weight or importance of the relationship, such as the claim amount. Edge label: The label of the edge, such as "insurance relationship" or "claim record".
[0102] Example: Node ID of node A: 1; Node type: Policyholder; Node name: Zhang San; Node attribute information: Date of birth: 1980-05-15; Address: Chaoyang District, Beijing; Policy number: P123456; Insurance amount: 500000; Start date: 2024-01-01; Node label: Policyholder label;
[0103] Node ID of Node B: 2; Node type: insured person; Node name: Li Si; Node attribute information: Date of birth: 1975-09-20; Address: Haidian District, Beijing; Node label: insured person label;
[0104] Node ID of node C: 3; Node type: Beneficiary; Node name: Wang Wu; Node attribute information: Date of birth: 1985-12-10; Address: Changping District, Beijing; Node label: Beneficiary label;
[0105] Edge ID of edge X: 101; Starting node ID: 1 (Zhang San); End node ID: 2 (Li Si); Edge type: Insurance relationship; Edge attributes: Relationship: Zhang San insures Li Si; Weight value: 500000 (insurance amount); Edge label: Insurance record;
[0106] Edge ID of edge Y: 102; Starting node ID: 2 (Li Si); End node ID: 3 (Wang Wu); Edge type: Beneficiary relationship; Edge attributes: Relationship: The beneficiary of Li Si's insurance policy is Wang Wu; Weight value: None (usually the beneficiary relationship does not require a weight value); Edge label: Beneficiary record;
[0107] This embodiment can ensure that the data structure of each element in the knowledge graph is clear and concise by describing the attribute information of nodes and edges in detail, which is helpful for data management and query. The definition of node attributes and edge attributes makes the relationship between nodes clearer. For example, the insurance relationship between the policyholder and the insured is reflected by the weight value of the edge, so that the insurance information of the policyholder and its impact can be better analyzed. Defining the type, attributes and labels of the edges helps to quickly retrieve and filter specific connection relationships, such as finding all insured and beneficiary records related to a specific policyholder. Clear node and edge definitions help to integrate data from different sources into a unified knowledge graph, and intuitively display the relationships and attributes between nodes through visualization tools, thereby improving the efficiency of data analysis.
[0108] In this embodiment, S2 specifically includes:
[0109] S21, based on the pre-set node inspection rules and node data, respectively use formula (1) to obtain the confidence of each node data;
[0110] The formula (1) is:
[0111] C i =w1×S i1 +w2×S i2 +w3×S i3 ;
[0112] Among them, C iis the confidence of the i-th node data; w1, w2, w3 are pre-set weight coefficients, and w1+w2+w3=1;
[0113] Among them, S i1 =s i1 +s i2 +s i3 +s i4 +s i5 ;
[0114] s i1 is the score of the birth date in the node attribute information in the i-th node data. If the birth date is within the first specified time range, then s i1 is 1; otherwise s i1 is 0;s i2 is the score of the address in the node attribute information in the i-th node data. If the address is within the specified address range, then s i2 is 1; otherwise s i2 is 0;s i3 is the score of the policy number in the node attribute information in the i-th node data. If the policy number format is correct, then s i3 is 1; otherwise s i1 is 0;s i4 is the score of the insurance amount in the node attribute information in the i-th node data. If the insurance amount is within the specified amount range, then s i4 is 1; otherwise s i4 is 0;s i5 is the score of the start date in the node attribute information in the i-th node data. If the start date is within the second specified time range, then s i5 is 1; otherwise s i5 is 0;
[0115] S i2 =N p-i / 9;N p-i is the number of first attributes actually provided in the i-th node data; the first attributes include: node ID, node type, node name, date of birth, address, policy number, insurance amount, start date, node label;
[0116] S i3 = Actual number of connections of the ith node / expected number of connections of the ith node;
[0117] For example, suppose there is a node in an insurance knowledge graph, which represents an insured person, and the node data is as follows:
[0118] Node ID: 1001; Node type: Policyholder; Node name: Mr. Li; Date of birth: 1985-04-23; Address: Chaoyang District, Beijing; Policy number: P20240001; Insurance amount: 200000; Start date: 2024-03-01; Node label: Policyholder label;
[0119] Assume that there are the following inspection rules and weight coefficients: First, the specified time range: 1980-01-01 to 1990-01-01; the specified address range: Chaoyang District, Beijing; the policy number format: the correct format is P+year+6-digit number; the specified amount range: 100000 to 500000; the second specified time range: 2024-01-01 to 2024-12-31; the weight coefficients: w1=0.4, w2=0.3, w3=0.3;
[0120] s i1 (Score of date of birth): Li's date of birth is within the specified time range, so si1 = 1. i2 (Address score): The address is within the specified range, so s i2 =1.s i3 (Rating of policy number): The policy number format is correct, so s i3 =1.s i4 (Insurance amount score): The insurance amount is within the specified range, so s i4 =1.s i5 (Start date rating): The start date is within the specified time range, so s i5 =1.
[0121] S i1 =s i1 +s i2 +s i3 +s i4 +s i5 =1+1+1+1+1=5;
[0122] Calculate S i2 (Number of attributes score): The number of first attributes actually provided by the node (N p-i ): 8 (node ID, node type, node name, date of birth, address, policy number, insurance amount, start date); total number of first attributes: 9; S i2 =N p-i / 9=8 / 9≈0.89;
[0123] S i3 (Connection score), assuming the actual number of connections of the node is 2 and the expected number of connections is 3
[0124] S i3=Actual number of connections / expected number of connections=2 / 3≈0.67;
[0125] Then, C i =0.4×5+0.3×0.89+0.3×0.67;
[0126] C i =2.0+0.267+0.201=2.468;
[0127] S22, based on the preset edge inspection rules and edge data, respectively use formula (2) to obtain the confidence of each edge data;
[0128] The formula (2) is:
[0129] D e =w4×C e1 ;
[0130] D e is the confidence of the e-th edge data; w4 is a pre-set coefficient;
[0131] C e1 =c e1 +c e2 +c e3 ; Among them, c e1 is the score of the edge type in the e-th edge data. If the edge type meets the preset standard, then c e1 is 1, otherwise c e1 is 0; c e2 is the score of the edge attribute in the e-th edge data, where a e c e2 is the weight value of the edge attribute in the e-th edge data, a min is the preset minimum weight value, a max is the preset maximum weight value;
[0132] c e3 is the score of the edge label in the e-th edge data. If the edge label matches the expected label, then c e3 is 1, otherwise c e3 is 0.
[0133] For example, suppose there is an edge data in an insurance knowledge graph, which connects the insured node and the insured node. The edge data is as follows:
[0134] Edge ID: E001; Starting node ID: 1001 (policyholder); End node ID: 2001 (insured); Edge type: insurance relationship; Edge attribute: insurance amount 200000; Edge label: insurance relationship; Weight coefficient: w4 = 0.7 (the weighting coefficient of edge type, edge attribute and edge label in edge data confidence calculation); Edge type meets the preset standard: Yes; Edge attribute weight range: minimum weight value = 100000, maximum weight value = 500000; Edge label matches the expected label: Yes;
[0135] c e1 (Edge type score): The edge type "insurance relationship" meets the preset criteria, so c e1 =1.
[0136] c e2 (Edge attribute score): The insurance amount 200000 in the edge attribute is within the specified range [100000, 500000], so c e2 =1.
[0137] c e3 (Edge label score): The edge label "insurance relationship" matches the expected label, so c e3 =1.
[0138] C e1 =c e1 +c e2 +c e3 =1+1+1=3;
[0139] De=0.7×3=2.1
[0140] This embodiment can systematically evaluate the edge data quality by scoring the type, attributes, and labels of edge data. The confidence score provides a quantitative indicator to represent the accuracy and reliability of edge data. The confidence calculation of edge data helps identify and screen problems or inconsistencies in the data. High-confidence edges generally indicate high data quality, while low-confidence edges may require further review or correction. High-confidence edges help enhance the overall accuracy and completeness of the knowledge graph, ensuring that the relationships and connections in the graph reflect real business logic and actual conditions. This is crucial for subsequent data analysis, reasoning, and decision-making. Confidence scoring can be used to automate data processing processes, such as automatically identifying and marking potential erroneous edges or inconsistent connections, thereby reducing manual intervention and improving processing efficiency.
[0141] In this embodiment, S3 specifically includes:
[0142] S31, using a K-means clustering algorithm to divide the confidence set into a first cluster and a second cluster;
[0143] The centroid of the confidence of the first cluster is higher than the centroid of the confidence of the second cluster;
[0144] S32, taking the first type of nodes as the main nodes in the specified knowledge graph;
[0145] The first type of nodes are the nodes remaining after removing the second type of nodes from the nodes in the specified knowledge graph;
[0146] The second type of node is a node to which the node data corresponding to the confidence in the second cluster belongs.
[0147] For example, suppose there is an insurance knowledge graph, in which the nodes contain data such as policyholders, insured persons, and insurance policies. The confidence level has been calculated for each node, which reflects the quality and reliability of the node data. Now we need to identify the main nodes based on these confidence levels.
[0148] Node 1 (policyholder): confidence = 0.8;
[0149] Node 2 (insured person): confidence = 0.6;
[0150] Node 3 (insurance policy): confidence = 0.9;
[0151] Node 4 (insured person): confidence = 0.7;
[0152] Node 5 (policyholder): confidence = 0.5;
[0153] S31: K-means clustering
[0154] Perform K-means clustering: Set K=2, which means dividing the nodes into two clusters.
[0155] Through the K-means algorithm, these nodes are divided into two clusters according to their confidence.
[0156] Assume that the results are: First cluster (higher confidence): node 1 (0.8), node 3 (0.9), node 4 (0.7);
[0157] Second cluster (lower confidence): node 2 (0.6), node 5 (0.5);
[0158] The centroid of the first cluster = (0.8 + 0.9 + 0.7) / 3 = 0.8; the centroid of the second cluster = (0.6 + 0.5) / 2 = 0.55;
[0159] Since the centroid of the first cluster (0.8) is higher than the centroid of the second cluster (0.55), the first cluster is defined as the node set with higher confidence.
[0160] S32: Determine the main node
[0161] First type nodes: According to the clustering results, the first type nodes are nodes belonging to the first cluster, and these nodes have a higher confidence level. First type nodes: Node 1 (policyholder), Node 3 (insurance policy), Node 4 (insured person);
[0162] Second type of nodes: The second type of nodes are nodes belonging to the second cluster, i.e. nodes with lower confidence. Second type of nodes: Node 2 (insured person), Node 5 (policyholder);
[0163] Determine the main nodes: The main nodes are the first type of nodes, excluding the second type of nodes. Main nodes: Node 1 (policyholder), Node 3 (insurance policy), Node 4 (insured)
[0164] In this embodiment, the K-means clustering algorithm is used to separate nodes with higher confidence (main nodes) from nodes with lower confidence (non-main nodes), which can ensure that the data quality of attention and utilization is high. Main nodes are nodes with higher confidence, and these nodes usually contain more valid information in the knowledge graph. Therefore, using these nodes as main nodes can help optimize subsequent data analysis and decision-making processes. Main nodes usually reflect the most important and reliable information in the graph. Focusing on these nodes can improve the overall accuracy and practicality of the knowledge graph. In practical applications, main nodes may represent key business entities or important relationships. Focusing resources and energy on these nodes can improve the quality of business decisions and application effects.
[0165] Specifically, the S5 specifically includes:
[0166] The optional items corresponding to the main nodes in the specified knowledge graph that do not meet the preset filtering rules are deleted to obtain the filtered optional items.
[0167] For example, suppose that the main nodes have been identified in an insurance knowledge graph, and the options related to these main nodes have been generated. Now, these options need to be filtered according to the preset filtering rules, and the options that meet the rules are retained.
[0168] Assume that the following main nodes have been identified: Main node A: Policyholder A; Main node B: Insured B; Main node C: Insurance policy C;
[0169] Based on these main nodes, some potential connection relationships with other main nodes are generated (optional):
[0170] Option 1: Policyholder A-Insured B (complies with business rules and screening rules);
[0171] Option 2: Policyholder A-Insurance Policy C (meets the business rules but does not meet the screening rules);
[0172] Option 3: Insured B-Insurance Policy C (does not meet the business rules, meets the screening rules);
[0173] Pre-set screening rules may include:
[0174] Connection type rules: The options must conform to the preset business logic connection type.
[0175] Attribute matching rules: Optional node attributes need to be within a specified range, such as address or policy amount.
[0176] Business process rules: Optional items must conform to common connection relationships in actual business processes.
[0177] Check whether each option meets the preset filtering rules and delete the options that do not meet the rules.
[0178] In this example:
[0179] Option 1 (Policyholder A-Insured B) meets all the rules and is therefore retained.
[0180] Option 2 (Policyholder A-Insurance Policy C) meets the business rules but does not meet the screening rules (for example, the policy amount is not within the specified range), so it is deleted.
[0181] Option 3 (Insured Person B-Insurance Policy C) meets the screening rules but does not meet the business rules, so it is deleted.
[0182] Options after screening: Option 1: Policyholder A, Insured B;
[0183] In this embodiment, by applying preset screening rules, it is ensured that the retained optional items meet the business logic and actual needs, thereby improving data quality and accuracy. Deleting optional items that do not meet the screening rules can reduce the interference of incorrect connections and invalid data, making subsequent analysis and processing results more reliable and valuable. By screening out optional items that do not meet the rules, the subsequent data processing and decision-making process can be simplified, and focus can be placed on more meaningful data. Retaining optional items that meet the rules can better reflect the actual business situation and help make more accurate business decisions and policy adjustments. Through the application of screening rules, it can be ensured that the application of knowledge graphs is more in line with actual business needs, thereby enhancing the overall practicality and benefits of the system.
[0184] wherein, a first knowledge graph of the same type as the specified knowledge graph obtained in advance is used to train the multi-head self-attention model to obtain a trained multi-head self-attention model;
[0185] Each node and each edge in the first knowledge graph has a corresponding label set;
[0186] The label is a label that identifies whether a node or edge with the label data should exist.
[0187] For example, suppose we are processing a knowledge graph for the insurance industry. In order to improve the quality and accuracy of the knowledge graph, we use the first knowledge graph of the same type for training to obtain an optimized multi-head self-attention model.
[0188] The first knowledge graph (used for training) includes: Node 1: policyholder; label: policyholder label; Node 2: insured; label: insured label; Node 3: insurance policy; label: insurance policy label; Edge 1: policyholder-insurance policy; label: connection that should exist; Edge 2: insured-insurance policy; label: connection that may exist (to be verified);
[0189] The data of each node and edge is extracted from the first knowledge graph, and each node and edge is ensured to have a label indicating whether the node or edge should exist.
[0190] A multi-head self-attention model is trained using a pre-acquired first knowledge graph of the same type as the specified knowledge graph. The goal of model training is to enable it to identify and predict the correct connection relationships in the knowledge graph based on the labels of nodes and edges.
[0191] The model learns how to adjust its internal attention mechanism based on the label information of nodes and edges, thereby improving its ability to identify different types of connections. For example, the model can learn that the connection between the policyholder and the insurance policy should exist, while the connection between the insured and the insurance policy may need further verification. By training with the first knowledge graph of the same type as the specified knowledge graph, the model can more accurately understand and predict the connection relationship between nodes and edges. The setting of labels helps the model identify which connections are required and which are to be verified, thereby improving the accuracy of predictions. The trained model can more effectively identify and process the actual connection relationship in the knowledge graph based on the label information. For example, it can identify that there should be a connection between the policyholder and the insurance policy, while the connection between the insured and the insurance policy may need further data support or verification. By using the trained model to process the specified knowledge graph, connections that do not meet the label requirements can be filtered out, ensuring that the connection relationship in the final knowledge graph is more in line with the actual business logic and data standards, thereby improving the overall quality and practicality of the graph. The trained multi-head self-attention model not only improves the accuracy of the knowledge graph, but also improves the intelligence level of the system, and can better handle complex node and edge connection relationships, making the knowledge graph more valuable and operational in practical applications. Automated model training and prediction reduce dependence on manual intervention and can more efficiently process large amounts of data and complex relationships, thereby saving time and costs.
[0192] When we input a new knowledge graph into the trained multi-head self-attention, the model processes the new graph based on the learned knowledge. Multi-head self-attention outputs the confidence of each edge. A high confidence means that the multi-head self-attention believes that the edge is likely to exist and is valid in the new knowledge graph; a low confidence means that the model believes that the existence or validity of the edge is low.
[0193] In the actual application of this embodiment, S7 specifically includes: taking the option corresponding to the final confidence with the highest value as the prediction result.
[0194] In this embodiment, the final confidence of each option after being processed by the multi-head self-attention model is compared, and the option with the highest confidence is selected as the prediction result. For example, suppose we are processing an insurance knowledge graph, where each main node (such as the insured, the insured, and the insurance policy) generates some options (potential connection relationships). After processing by the multi-head self-attention model, we get the following final confidence:
[0195] Option 1: The connection between policyholder A and policy C, with a final confidence of 0.85; Option 2: The connection between policy C and insured B, with a final confidence of 0.78; Option 3: The connection between policyholder A and insured B, with a final confidence of 0.92;
[0196] Calculate the final confidence: The final confidence of option 1 is 0.85; the final confidence of option 2 is 0.78; the final confidence of option 3 is 0.92;
[0197] The highest confidence level is 0.92, and the corresponding option is the connection between policyholder A and insured person B.
[0198] The prediction result is: there is a valid connection between policyholder A and insured B. By selecting the highest confidence option as the prediction result, it can be ensured that the prediction is based on the model's best estimate of the data, thereby improving the accuracy of the prediction. Selecting the result with the highest confidence simplifies the processing process, avoids the complexity of evaluating all options one by one, and makes the result clearer and more direct. Automatically selecting high-confidence results saves manual review time, improves overall work efficiency, and enables the system to respond quickly and process large amounts of data. When users need to get recommendations or decisions quickly (such as recommendation systems, smart assistants), being able to provide high-confidence results can significantly improve user experience and satisfaction.
[0199] See also Figure 2 This embodiment also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute the executable instructions to implement the steps of a graphic data management method described in the embodiment.
[0200] This embodiment also provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of a method for managing graphic data described in the embodiment are implemented.
[0201] This embodiment also provides a computer program product, characterized in that it includes a computer program, which, when executed by a processor, implements the steps of a method for managing graphic data described in the embodiment.
[0202] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0203] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0204] In the present invention, unless otherwise clearly specified and limited, when a first feature is “on” or “below” a second feature, it may be that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Moreover, when a first feature is “above”, “above” or “above” a second feature, it may be that the first feature is directly above or obliquely above the second feature, or it may simply mean that the first feature is higher in level than the second feature. When a first feature is “below”, “below” or “below” a second feature, it may be that the first feature is directly below or obliquely below the second feature, or it may simply mean that the first feature is lower in level than the second feature.
[0205] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0206] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for managing graphic data, characterized in that: include: S1. Obtain the data of each node and each edge in the specified knowledge graph; S2. Based on a preset node inspection rule, a preset edge inspection rule, the node data, and the edge data, respectively obtain the confidence of each node data and the confidence of each edge data; S3, using the K-means clustering algorithm to divide the confidence set into two clusters, and based on the two clusters, determining the main nodes in the specified knowledge graph; The confidence set includes the confidence of each node data and the confidence of each edge data in the specified knowledge graph; S4. Based on the main nodes in the specified knowledge graph, generate options corresponding to each main node in the specified knowledge graph; Any optional item corresponding to any main node includes a potential connection relationship between the main node and other main nodes according to a predefined rule; S5. Filter the options corresponding to the main nodes in the specified knowledge graph according to the pre-set filtering rules to obtain the filtered options; S6. Use the trained multi-head self-attention model to process each selected option to obtain the final confidence level corresponding to each selected option; S7. Determine the prediction result based on the final confidence level corresponding to each selected option.
2. The method for managing graphic data according to claim 1, It is characterized in that in, Each node data includes: node ID, node type, node name, node attribute information, node label; Node attribute information includes: date of birth, address, policy number, insurance amount, and start date; The node label is any one of the labels of the policyholder, the insured, and the beneficiary; Each edge data includes: edge ID, starting node ID, end node ID, edge type, edge attribute, and edge label; Edge attributes include the relationship between the starting node and the ending node and the corresponding weight value.
3. The method for managing graphic data according to claim 2, characterized in that: The S2 specifically includes: S21, based on the pre-set node inspection rules and node data, respectively use formula (1) to obtain the confidence of each node data; The formula (1) is: C i =w1×S i1 +w2×S i2 +w3×S i3 ; Among them, C i is the confidence of the i-th node data; w1, w2, w3 are pre-set weight coefficients, and w1+w2+w3=1; Among them, S i1 =s i1 +s i2 +s i3 +s i4 +s i5 ; s i1 is the score of the birth date in the node attribute information in the i-th node data. If the birth date is within the first specified time range, then s i1 is 1; otherwise s i1 is 0; s i2 is the score of the address in the node attribute information in the i-th node data. If the address is within the specified address range, then s i2 is 1; otherwise s i2 is 0; s i3 is the score of the policy number in the node attribute information in the i-th node data. If the policy number format is correct, then s i3 is 1; otherwise s i1 is 0;s i4 is the score of the insurance amount in the node attribute information in the i-th node data. If the insurance amount is within the specified amount range, then s i4 is 1; otherwise s i4 is 0; s i5 is the score of the start date in the node attribute information in the i-th node data. If the start date is within the second specified time range, then s i5 is 1; otherwise s i5 is 0; S i2 =N p-i / 9;N p-i is the number of first attributes actually provided in the i-th node data; the first attributes include: node ID, node type, node name, date of birth, address, policy number, insurance amount, start date, node label; S i3 = Actual number of connections of the ith node / expected number of connections of the ith node; S22, based on the preset edge inspection rules and edge data, respectively use formula (2) to obtain the confidence of each edge data; The formula (2) is: D e =w4×C e1 ; D e is the confidence of the e-th edge data; w4 is a pre-set coefficient; C e1 =c e1 +c e2 +c e3 ; Among them, c e1 is the score of the edge type in the e-th edge data. If the edge type meets the preset standard, then c e1 is 1, otherwise c e1 is 0; c e2 is the score of the edge attribute in the e-th edge data, where a e c e2 is the weight value of the edge attribute in the e-th edge data, a min is the preset minimum weight value, a max is the preset maximum weight value; c e3 is the score of the edge label in the e-th edge data. If the edge label matches the expected label, then c e3 is 1, otherwise c e3 is 0.
4. The method for managing graphic data according to claim 3, characterized in that: The S3 specifically includes: S31, using a K-means clustering algorithm to divide the confidence set into a first cluster and a second cluster; The centroid of the confidence of the first cluster is higher than the centroid of the confidence of the second cluster; S32, taking the first type of nodes as the main nodes in the specified knowledge graph; The first type of nodes are the nodes remaining after removing the second type of nodes from the nodes in the specified knowledge graph; The second type of node is a node to which the node data corresponding to the confidence in the second cluster belongs.
5. The method for managing graphic data according to claim 4, characterized in that: The S5 specifically includes: The optional items corresponding to the main nodes in the specified knowledge graph that do not meet the preset filtering rules are deleted to obtain the filtered optional items.
6. The method for managing graphic data according to claim 5, characterized in that: in, Using a pre-acquired first knowledge graph of the same type as the specified knowledge graph to train the multi-head self-attention model to obtain a trained multi-head self-attention model; Each node and each edge in the first knowledge graph has a corresponding label set; The label is a label that identifies whether a node or edge with the label data should exist.
7. The method for managing graphic data according to claim 6, characterized in that: The S7 specifically includes: taking the option corresponding to the final confidence level with the highest value as the prediction result.
8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.