Knowledge graph construction method, device, medium and product

By constructing a multi-level knowledge graph and dynamically adjusting the mapping relationship between entity clusters and hierarchical labels, the problem of the inability to respond to new entity additions in existing technologies is solved, and the real-time updating and accuracy of the knowledge graph are achieved.

CN121562750BActive Publication Date: 2026-05-01BEIJING SCI & TECH PATENT OFFICE
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SCI & TECH PATENT OFFICE
Filing Date
2025-11-14
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing knowledge graph construction technologies cannot respond to new entity additions in real time, resulting in knowledge lag and affecting accuracy and practicality.

Method used

A multi-level initial knowledge graph is constructed. By updating the matching and mapping relationship between entity clusters and hierarchical labels, the knowledge graph structure is dynamically adjusted to respond to entity addition events.

Benefits of technology

It enables real-time updates of the knowledge graph, ensuring its real-time performance and accuracy, and avoiding the computational cost of full graph reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121562750B_ABST
    Figure CN121562750B_ABST
Patent Text Reader

Abstract

The application discloses a knowledge graph construction method, device, medium and product, relates to the fields of knowledge engineering and graph data processing, and comprises the following steps: constructing an initial knowledge graph with multiple levels, wherein each level comprises multiple initial level labels, each initial level label comprises multiple entity clusters, and each entity cluster comprises multiple entities; updating the initial knowledge graph when multiple new entities are added to the initial knowledge graph; wherein the step of updating the initial knowledge graph comprises the following steps: integrating the multiple new entities into corresponding entity clusters to obtain multiple new entity clusters; adding a level label corresponding to the new entity cluster when the new entity cluster does not match the initial level label; and adjusting the mapping relationship between the new entity cluster and the level when the new entity cluster matches the initial level label. The application can update the initial knowledge graph in response to event driving of new entities, thereby guaranteeing the real-time performance of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Knowledge graph construction methods, equipment, media and products Technical Field

[0001] This application relates to the fields of knowledge engineering and graph data processing, and in particular to a method, device, medium, and product for constructing a knowledge graph. Background Technology

[0002] A knowledge graph is a semantic network used to represent and store structured knowledge; essentially, it is a powerful data model that reveals the relationships between entities. Specifically, knowledge graphs combine theories from applied mathematics, computer graphics, information visualization techniques, and information science, using visual graphs to vividly display the core structure, development history, cutting-edge fields, and overall knowledge architecture of disciplines, thereby achieving multidisciplinary integration.

[0003] However, most existing knowledge graph construction technologies build fixed graphs through batch processing, which cannot respond in real time to entity changes such as the addition of new entities. This results in knowledge lag in the knowledge graph, reducing its accuracy and practicality. Summary of the Invention

[0004] The purpose of this application is to provide a knowledge graph construction method, device, medium and product that can solve the problem mentioned above that "most existing knowledge graph construction technologies construct fixed graphs through batch processing, which cannot respond in real time to entity changes such as the addition of new entities, resulting in knowledge lag in the knowledge graph".

[0005] To achieve the above objectives, this application provides the following solution:

[0006] In a first aspect, this application provides a knowledge graph construction method, comprising: constructing an initial knowledge graph having multiple levels, wherein each level includes multiple initial level labels, each initial level label includes multiple entity clusters, and each entity cluster includes multiple entities;

[0007] When multiple entities are added to the initial knowledge graph, the initial knowledge graph is updated.

[0008] The step of updating the initial knowledge graph includes: integrating the newly added entities into the corresponding entity clusters to obtain multiple newly added entity clusters;

[0009] When the newly added entity cluster does not match the initial hierarchical label, a hierarchical label corresponding to the newly added entity cluster is added. When the newly added entity cluster matches the initial hierarchical label, the mapping relationship between the newly added entity cluster and the hierarchy is adjusted.

[0010] In one embodiment, the step of adding a hierarchical label corresponding to the newly added entity cluster specifically includes:

[0011] Calculate the semantic scope of the newly added entity cluster, add a corresponding level label based on the semantic scope, and classify the newly added entity cluster into the newly added level label.

[0012] In one embodiment, the step of adjusting the mapping relationship between the newly added entity cluster and the hierarchy specifically includes:

[0013] Calculate the average cluster weight of all entities within the newly added entity cluster, and adjust the mapping relationship between the newly added entity cluster and the level based on the matching result of the average cluster weight and the preset level threshold.

[0014] In one embodiment, the newly added entity cluster includes the original portion and the newly added portion;

[0015] The step of calculating the average cluster weight of all entities within the newly added entity cluster specifically includes:

[0016] Calculate the entity weight of each entity in the original part, and sum them up to obtain the total original entity weights;

[0017] Calculate the entity weight of each entity in the newly added part, and sum them up to obtain the total weight of the newly added entities;

[0018] The average weight of the cluster is obtained based on the sum of the original entity weights, the sum of the newly added entity weights, and the total number of entities in the cluster.

[0019] In one embodiment, the step of calculating the entity weight of the entity specifically includes:

[0020] The entity weight is calculated based on the entity's activity level, relationship strength, user attention, and feature weight coefficients.

[0021] In one embodiment, after updating the initial knowledge graph, the method further includes:

[0022] Calculate the entity weight of each entity in the updated initial knowledge graph, and sort the entities under each level according to their entity weights to obtain the sorting result;

[0023] Based on the sorting results and the preset level threshold, the entities at each level are divided into core sub-communities or peripheral sub-communities.

[0024] In one embodiment, the step of constructing an initial knowledge graph with multiple levels specifically includes:

[0025] Obtain initial data and preprocess the initial data;

[0026] Multiple entities are extracted from the preprocessed initial data, and the entity metadata set for each entity is determined.

[0027] Calculate the feature vector of the entity metadata set;

[0028] Aggregate based on the similarity of the feature vectors of the entity metadata set to output multiple entity clusters;

[0029] A hierarchical architecture is constructed, and the entity clusters are matched to the initial hierarchical labels corresponding to the corresponding hierarchical levels to obtain an initial knowledge graph.

[0030] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.

[0031] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.

[0032] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0033] According to the specific embodiments provided in this application, the following technical effects are disclosed:

[0034] This application provides a knowledge graph construction method, device, medium, and product. It constructs an initial knowledge graph with multiple levels, each level including multiple initial level labels, each initial level label including multiple entity clusters, and each entity cluster including multiple entities, thus establishing a structured initial knowledge graph framework with clear semantic granularity. Simultaneously, when multiple entities are added to the initial knowledge graph, the initial knowledge graph can be updated. Based on the matching between the newly added entity clusters and the initial level labels, the application can select to add level labels corresponding to the newly added entity clusters, or adjust the mapping relationship between the newly added entity clusters and levels. It can respond to event-driven updates of the initial knowledge graph in response to the addition of entities, classifying the newly added entity clusters into the existing structure, ensuring the real-time performance of the knowledge graph. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 is a flowchart of a knowledge graph construction method according to an embodiment of this application;

[0037] Figure 2 is a schematic diagram of the initial knowledge graph construction process of a knowledge graph construction method according to an embodiment of this application;

[0038] Figure 3 is a schematic diagram of the initial knowledge graph update process of a knowledge graph construction method according to an embodiment of this application;

[0039] Figure 4 is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0041] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] Referring to Figure 1, this application provides a knowledge graph construction method, including the following steps:

[0043] Step 100: Construct an initial knowledge graph with multiple levels, where each level includes multiple initial level labels, each initial level label includes multiple entity clusters, and each entity cluster includes multiple entities.

[0044] Step 200: When multiple entities are added to the initial knowledge graph, update the initial knowledge graph. The steps for updating the initial knowledge graph include: integrating the multiple new entities into the corresponding entity clusters to obtain multiple new entity clusters; when the new entity clusters do not match the initial hierarchical labels, add hierarchical labels corresponding to the new entity clusters; when the new entity clusters match the initial hierarchical labels, adjust the mapping relationship between the new entity clusters and the hierarchical levels.

[0045] In step 100, the initial knowledge graph serves as the basic framework for subsequent dynamic adjustments. For example, in this application, the initial knowledge graph uses a three-level hierarchical architecture, namely the macro layer, the meso layer, and the micro layer.

[0046] Specifically, the steps for constructing an initial knowledge graph with multiple levels include: acquiring initial data and preprocessing the initial data; extracting multiple entities from the preprocessed initial data and determining the entity metadata set for each entity; calculating the feature vector of the entity metadata set; aggregating based on the similarity of the feature vectors of the entity metadata set to output multiple entity clusters; constructing a hierarchical architecture and matching the entity clusters to the initial level labels of the corresponding levels to obtain the initial knowledge graph.

[0047] For example, referring to Figure 2, the initial knowledge graph construction process includes four stages: data preprocessing, entity relationship extraction, initial aggregation of entity clusters, and hierarchical label extraction and initial layering. This is the basic process when the knowledge graph is first constructed, and its main purpose is to generate a structured initial graph framework from the raw data.

[0048] 1) Data preprocessing: Cleaning and standardizing unstructured texts such as technical documents and science and technology news, semi-structured data such as tables and JSON (Lightweight Data Interchange Format), and structured data such as database tables.

[0049] 2) Entity Relation Extraction: Based on LLM (Large Language Model) or domain pre-trained models, entities, relations, and attributes are extracted from the preprocessed data. Metadata is then extracted for each entity using LLM, including the entity's semantic scope, domain affiliation, and initial importance score. The final output is a set of triples and a set of entity metadata. For example, the triple set might be: (E1: Dynamic load balancing algorithm, optimization; E2: Beehive scheduling efficiency); the entity metadata set might be: E1. Metadata: {Entity semantic scope: "specific technology", domain affiliation: "Artificial intelligence → multi-agent technology", initial importance score: 0.7}.

[0050] 3) Preliminary Entity Cluster Aggregation: Based on the entity metadata set (semantic scope, domain affiliation, association strength) generated in the above steps, a feature vector is generated for each entity. This feature vector contains a fusion of semantic vectors, relational features, and entity attribute features. A community detection algorithm (such as the Louvain algorithm) is used to aggregate entities based on the similarity of their feature vectors, outputting a set of entity clusters. For each entity cluster, core semantic tags are extracted using LLM. Simultaneously, the average value of all entity feature vectors within the cluster is taken to generate an entity cluster feature vector. In this step, the final output is the entity cluster (represented as a list of member entities [E1, E2…En]), the cluster's core semantic tags, and the cluster feature vector.

[0051] 4) Hierarchical Label Extraction and Initial Layering: Initial hierarchical labels are extracted by performing topic clustering on the preprocessed domain data using expert annotation or LLM. This application uses a three-level hierarchical architecture, primarily based on entity semantic association strength and domain knowledge, dividing the layers from wide to narrow granularity. The definitions and examples of each layer are as follows:

[0052]

[0053] Table 1. Definition of Three-Level Hierarchy

[0054] By calculating semantic vector similarity, entity clusters are matched to initial hierarchical labels, and finally, initial hierarchical results are generated: a four-level mapping relationship between the macro level, meso level, micro level, and entity clusters.

[0055] In step 200, specifically, the step of adding a hierarchical label corresponding to the newly added entity cluster includes: calculating the semantic range of the newly added entity cluster, adding a corresponding level hierarchical label based on the semantic range, and assigning the newly added entity cluster to the newly added hierarchical label. The step of adjusting the mapping relationship between the newly added entity cluster and the hierarchy specifically includes: calculating the average cluster weight of all entities within the newly added entity cluster, and adjusting the mapping relationship between the newly added entity cluster and the hierarchy based on the matching result of the average cluster weight and a preset hierarchy threshold.

[0056] More specifically, the newly added entity cluster includes the original part and the newly added part; the step of calculating the average cluster weight of all entities in the newly added entity cluster specifically includes: calculating the entity weight of each entity in the original part and summing them to obtain the total weight of the original entities; calculating the entity weight of each entity in the newly added part and summing them to obtain the total weight of the newly added entities; and obtaining the average cluster weight based on the total weight of the original entities, the total weight of the newly added entities, and the total number of entities in the cluster.

[0057] For example, the step of determining whether a newly added entity cluster matches the initial hierarchical label includes: if the semantic range exceeds the existing initial hierarchical label, then the newly added entity does not match the initial hierarchical label; if the semantic range does not exceed the existing initial hierarchical label, then the newly added entity matches the initial hierarchical label.

[0058] Changes in entity relationships within a knowledge graph are the primary events triggering adjustments. In this embodiment, an update to the initial knowledge graph is triggered when multiple entities are added. In other embodiments, events triggering adjustments may include: changes (deletions) in the number of entities or relationships in the knowledge graph exceeding a preset threshold; the occurrence of a significant event in a specific domain (such as an industry standard update); or frequent user queries for entities not explicitly identified as belonging to a particular community. This application only describes the scenario of adding multiple entities; other scenarios are not described in detail.

[0059] In this application, referring to Figure 3, the process of updating the initial knowledge graph is also the process of dynamic adjustment of the hierarchy. The dynamic adjustment of the hierarchy includes the dynamic adjustment of the hierarchy labels and the dynamic adjustment of the mapping relationship between entity clusters and the hierarchy.

[0060] a. Dynamic adjustment of hierarchical labels

[0061] When an event is detected, such as the addition of a large number of cross-domain entities, if the semantic scope of the newly added entity cluster (by calculating the similarity of the meaning vectors of the core semantic labels of the newly added entity cluster and the existing hierarchical labels) exceeds all existing hierarchical labels, then new hierarchical labels are generated through LLM.

[0062] If the semantic scope is broad (e.g., spanning multiple meso-levels), then add a macro-level label;

[0063] If the semantic scope belongs to a new subdomain under a certain macro level, add a meso level label;

[0064] If the semantic scope belongs to a specific knowledge unit under a certain meso-level, add a micro-level label.

[0065] b. Dynamically adjust the mapping relationship between entity clusters and hierarchies.

[0066] If the newly added entity cluster can match the existing tags (similarity ≥ 0.7), then there is no need to add new tags, and the process can directly proceed to the mapping relationship adjustment stage.

[0067] The average entity weight needs to be recalculated for entity clusters (existing clusters or new clusters) that contain newly added entities.

[0068] The average weight of the cluster is calculated as follows: (Sum of existing entity weights + Sum of new entity weights) / Total number of entities in the cluster. The weight of new entities is calculated by the attention mechanism GNN using the following formula:

[0069] Entity weight = α × activity level + β × relationship strength + γ × user attention level, where α, β, and γ are dynamic coefficients for event adaptation.

[0070] Adjust the mapping relationship based on the matching result of the cluster average weight and the hierarchical threshold:

[0071] For example, if the average weight of a cluster is ≥0.8 and its similarity to a certain macro-level label is ≥0.7, then map it to that macro-level.

[0072] If the average weight of the cluster is ≥0.6 and the similarity with a certain meso-level label is ≥0.7, it is mapped to that meso-level (if the macro-level threshold is also met, the matching is prioritized according to the level with higher similarity).

[0073] If the average weight of a cluster is ≥0.4 and its similarity to a certain micro-layer label is ≥0.7, then map it to that micro-layer.

[0074] If an existing entity cluster experiences a change in average weight or similarity due to the addition of a new entity, it triggers cross-level migration. For example, if a cluster originally belonging to the micro-level (average weight 0.5) has its average weight rise to 0.7 due to the addition of a high-weight entity, and its similarity to the meso-level label "multi-agent technology" reaches 0.8, it will automatically migrate from the micro-level to the meso-level.

[0075] In this embodiment of the application, the step of calculating the entity weight specifically includes: calculating the entity weight based on the entity's activity level, relationship strength, user attention, and feature weight coefficient.

[0076] When an event triggering mechanism is detected, the importance weights of entity features are dynamically learned through the attention mechanism GNN (Graph Neural Network). Specific weight factors may include entity activity, entity association strength, and user attention.

[0077] The entity weight can be calculated using the following formula:

[0078] Entity weight = α × Activity (number of mentions in the last 24 hours) + β × Relationship strength (co-occurrence frequency with core entities) + γ × User attention (query volume)

[0079] Among them, the feature weight coefficients (α, β, γ) can explain the importance of each feature in the event scenario and are output in real time by the attention mechanism; the core entity can be determined according to semantics. In the process of using the community discovery algorithm, the node that has the most connections with other entity nodes is the core entity.

[0080] The input data for Attention GNNs includes data strongly correlated with events, providing a basis for dynamic weight calculation. Specifically, this includes event details that trigger the event, the relationship network of entities in the knowledge graph, entity attributes, and initial feature data such as activity, relationship strength, and user attention. The output of Attention GNNs includes dynamic entity weight values ​​and feature weight coefficients.

[0081] In this embodiment of the application, after updating the initial knowledge graph, the method further includes: calculating the entity weight of each entity in the updated initial knowledge graph, and sorting the entities under each level according to their entity weights to obtain a sorting result; based on the sorting result and a preset level threshold, dividing the entities of each level into core sub-communities or peripheral sub-communities.

[0082] The sub-community division is based on the "dynamic entity weights output by the attention GNN" as the core basis, and is combined with the threshold of the level to which the entity belongs to ensure that the division results not only conform to the entity importance in the event scenario, but also adapt to the semantic granularity of the level.

[0083] In the specific partitioning process, all entities within the same level of an entity cluster are sorted from high to low according to their dynamic weights. For example, when selecting core sub-communities, entities with a weight greater than or equal to the corresponding level's threshold are prioritized. If more than 30% of these entities meet the threshold, the top 30% are selected as core sub-communities. If less than 30% meet the threshold, all entities are included in the core sub-communities. Entities not included in the core sub-communities are automatically relegated to peripheral sub-communities.

[0084] The divided sub-communities play different roles in the knowledge graph, and are maintained differently through attribute tagging and management strategies. The core sub-community, tagged with "core=True", forms the skeleton of the knowledge graph, carrying core domain knowledge and serving as the priority for query responses and knowledge reasoning. The peripheral sub-communities, tagged with "core=False", supplement the knowledge graph. Both core and peripheral sub-communities are dynamically adjusted and deeply integrated with the event-driven mechanism.

[0085] In this application, the incremental update of the knowledge graph focuses on "minimizing computational cost," updating only newly added or changed entities, relationships, and community structures without reconstructing the entire graph. The specific steps are as follows:

[0086] 1) Entity Feature Update: The "Entity Relationship Extraction" process described above includes extracting basic information, generating entity metadata, and constructing an entity feature vector that integrates "semantic vector + relation features + attribute features." If the entity changes, only the features of the changed fields need to be updated.

[0087] 2) Hierarchical label localization: Calculate the cosine similarity between the feature vector of the new entity and the feature vector of all entity clusters, select the cluster with the highest similarity and greater than or equal to the threshold (e.g., 0.7) as the target cluster, and synchronously call the latest result of "hierarchical dynamic adjustment" to obtain the current hierarchical affiliation of the target cluster, thus completing the hierarchical label localization of the new entity.

[0088] 3) Sub-community positioning: Calculate the weight of the new entity: Based on the dynamic coefficients α, β, and γ output by the attention GNN in the above steps, calculate according to the formula (entity weight = α activity + β × relationship strength + γ × user attention); Compare the weight of the new entity with the weights of all entities in the target cluster: If the ranking is in the top 30% (or the weight is ≥ the core sub-community threshold of this level, such as ≥ 0.6 in the meso level), mark it as a core sub-community (core=True); otherwise mark it as a peripheral sub-community (core=False).

[0089] 4) Relationship update: If a new entity has a new relationship with an existing entity, an edge is added to the graph database, the "relationship strength" of the related entities is updated, and the feature vector of the related entities is updated synchronously (only the relationship feature part is updated).

[0090] 5) Community structure fine-tuning: If the newly added entity is a member of the core sub-community, recalculate the proportion of core entities in the target cluster (number of core entities / total number of entities in the cluster): If the proportion exceeds 30%, the entity with the lowest weight in the original core sub-community will be downgraded to the peripheral sub-community; if multiple new entities continue to join a cluster, causing the average weight of the cluster to be ≥ the threshold of the higher level (e.g., the average weight of the micro-level cluster rises to ≥ 0.6), and the semantic similarity with the higher level label is ≥ 0.7, then the "dynamic adjustment of the level" in the above steps will be triggered to determine whether the cluster needs to be migrated to a higher level.

[0091] 6) Graph database storage: Update the attributes, feature vectors, and sub-community tags of newly added entities in the graph database, add relation edges and relation strengths of related entities; at the same time, update the mapping index between hierarchical labels and clusters to ensure that subsequent queries can quickly locate the hierarchical affiliation.

[0092] After the knowledge graph in this application is constructed, its quality can be checked periodically through steps such as expert sampling, consistency verification, and user feedback. Expert sampling: Domain experts randomly check the hierarchical affiliation and sub-community division of 10% of entities; Consistency verification: Abnormal data is filtered through a rule engine (e.g., "the relationship strength of core sub-community entities must be ≥0.6"); User feedback: User feedback is collected periodically, and entity weight calculation factors are adjusted in reverse (e.g., if a user frequently marks an entity as "important," its weight percentage is increased).

[0093] This application breaks through the limitations of traditional static community division and enhances the semantic relevance of domain knowledge by dividing it into hierarchical tags. It constructs a core-peripheral sub-community division mechanism, using a multi-dimensional dynamic weight model (entity weight = α × activity + β × relationship strength + γ × user attention) to divide core and peripheral sub-communities. This not only accurately reflects the actual value of entities within the community but also solves the semantic fragmentation problem caused by traditional "globally unified division" through its linkage design with hierarchical tags. Simultaneously, it constructs an incremental update mechanism, using an incremental local update strategy to update only newly added or changed entities, relationships, and community structures, avoiding full graph reconstruction, improving efficiency, and ensuring global consistency.

[0094] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram is shown in Figure 4. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communication with external terminals via a network connection.

[0095] Those skilled in the art will understand that the structure shown in Figure 4 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.

[0096] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0097] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0098] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0099] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0100] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0101] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0102] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0103] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for constructing a knowledge graph, characterized in that, include: An initial knowledge graph with multiple levels is constructed, wherein each level includes multiple initial level labels, each initial level label includes multiple entity clusters, and each entity cluster includes multiple entities. The construction process of the initial knowledge graph includes data preprocessing, entity relationship extraction, preliminary aggregation of entity clusters, and extraction and initialization of level labels. Data preprocessing includes cleaning and standardization operations on unstructured text, semi-structured data, and structured data. When multiple entities are added to the initial knowledge graph, the initial knowledge graph is updated. The steps of updating the initial knowledge graph include: integrating the multiple newly added entities into the corresponding entity clusters to obtain multiple newly added entity clusters; when the newly added entity clusters do not match the initial level labels, adding level labels corresponding to the newly added entity clusters; when the newly added entity clusters match the initial level labels, adjusting the mapping relationship between the newly added entity clusters and the levels. The step of adjusting the mapping relationship between the newly added entity cluster and the level specifically includes: calculating the average cluster weight of all entities in the newly added entity cluster, and adjusting the mapping relationship between the newly added entity cluster and the level based on the matching result of the average cluster weight and the preset level threshold; the newly added entity cluster includes an original part and a newly added part; the step of calculating the average cluster weight of all entities in the newly added entity cluster specifically includes: calculating the entity weight of each entity in the original part and summing them to obtain the total original entity weight; calculating the entity weight of each entity in the newly added part and summing them to obtain the total newly added entity weight; obtaining the average cluster weight based on the total original entity weight, the total newly added entity weight, and the total number of entities in the cluster; the step of calculating the entity weight of an entity specifically includes: calculating the entity weight based on the entity's activity level, relationship strength, user attention, and feature weight coefficient.

2. The knowledge graph construction method according to claim 1, characterized in that, The step of adding hierarchical labels corresponding to the newly added entity cluster specifically includes: calculating the semantic range of the newly added entity cluster, adding hierarchical labels of corresponding levels based on the semantic range, and classifying the newly added entity cluster into the newly added hierarchical labels.

3. The knowledge graph construction method according to claim 1, characterized in that, After updating the initial knowledge graph, the method further includes: calculating the entity weight of each entity in the updated initial knowledge graph, and sorting the entities under each level according to the entity weight to obtain a sorting result; based on the sorting result and a preset level threshold, classifying the entities of each level into a core sub-community or a peripheral sub-community.

4. The knowledge graph construction method according to claim 1, characterized in that, The steps for constructing an initial knowledge graph with multiple levels specifically include: acquiring initial data and preprocessing the initial data; extracting multiple entities from the preprocessed initial data and determining the entity metadata set for each entity; calculating the feature vector of the entity metadata set; aggregating the entity metadata set based on the similarity of the feature vectors to output multiple entity clusters; constructing a hierarchical architecture and matching the entity clusters to the initial level labels corresponding to the levels to obtain the initial knowledge graph.

5. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the knowledge graph construction method according to any one of claims 1-4.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the knowledge graph construction method as described in any one of claims 1-4.

7. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the knowledge graph construction method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Analysis method and device for screening target customer group, equipment and medium

    CN120561625A

  • Sleep health dynamic evaluation method and system based on user feedback driving and medium

    CN120727303A