A Method for Distributed Cognitive Graph Construction and Dynamic Update
By constructing a unified structured knowledge graph and combining incremental update, distributed consistency, and query optimization modules, the problems of data consistency and query performance in a distributed environment are solved, achieving efficient incremental updates and conflict resolution, and enhancing the intelligent upgrading of the fashion industry.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies struggle to achieve efficient incremental updates and conflict resolution in a distributed environment, fail to guarantee data consistency, and have insufficient query performance.
The graph construction module transforms multi-source, multi-modal, heterogeneous fashion data into a unified, structured knowledge graph. The incremental update module enables dynamic maintenance and real-time performance of the knowledge graph, the distributed consistency module ensures data consistency, and the query optimization module provides efficient and flexible query capabilities. The Raft consensus algorithm and edge-level version vector mechanism ensure consistency, and the query is optimized by combining heuristic path pruning strategies.
A distributed cognitive graph adapted to the complex semantics of the fashion industry has been constructed, supporting efficient incremental updates, ensuring strong data consistency, and possessing intelligent conflict resolution capabilities. It provides efficient querying and real-time data interaction, thereby improving the intelligence level of the apparel AI industry.
Smart Images

Figure CN121542268B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and knowledge graph technology, and in particular to a method for constructing and dynamically updating a distributed cognitive graph. Background Technology
[0002] With the rapid development of artificial intelligence technology and its deep integration into various industries, the fashion industry is actively exploring the use of advanced technologies to drive a comprehensive upgrade in design, production, marketing, and consumer experience. Against this backdrop, constructing a cognitive graph that can accurately depict fashion elements, styles, trends, and their interrelationships has become a core infrastructure for promoting the intelligentization of the apparel AI industry. Patent CN116304104A, entitled "Knowledge Graph Construction Method, Knowledge Graph Construction Device, Medium, and Electronic Equipment," describes a method for acquiring multiple visual tags and determining the relationships between them. It generates nodes based on the visual tags and edges between nodes based on the relationships between the visual tags to construct a visual tag knowledge graph. Node attributes are added to nodes according to the characteristics of the visual tags, and edge attributes are added to edges according to the types of relationships between the visual tags. This method can construct a visual tag knowledge graph for visual tag processing through a simple and convenient process, and has a wide range of applications.
[0003] However, the above-mentioned technical solutions can adapt to the complex semantics of the fashion industry, support efficient incremental updates, ensure strong data consistency in a distributed environment, and have intelligent conflict resolution capabilities. Therefore, it is necessary to develop a newer technical design that can achieve efficient incremental updates and conflict resolution, and to address the issues of how to ensure data consistency in a distributed environment and how to optimize the query performance of large-scale graph data. Summary of the Invention
[0004] The purpose of this invention is to provide a method for constructing and dynamically updating a distributed cognitive graph, in order to solve the problems in the background art such as how to achieve efficient incremental updates and conflict resolution, how to ensure data consistency in a distributed environment, and how to optimize the query performance of large-scale graph data.
[0005] This invention provides the following technical solution: a method for constructing and dynamically updating a distributed cognitive graph, comprising a graph construction module, an incremental update module, a distributed consistency module, and a query optimization module;
[0006] The graph construction module is used to transform multi-source, multi-modal heterogeneous fashion data into a unified, structured knowledge graph;
[0007] The incremental update module is used to achieve dynamic maintenance and real-time performance of the knowledge graph.
[0008] The distributed consistency module is used to ensure strong consistency, high availability, and traceability of changes to knowledge graph data across multiple nodes.
[0009] The query optimization module is used to provide efficient and flexible knowledge graph query capabilities for rapid retrieval and complex analysis of fashion knowledge.
[0010] The query optimization module is equipped with a query interface, which includes a GraphQL interface, a REST interface, and a WebSocket interface.
[0011] Includes the following steps:
[0012] S1. Data Ingestion and Preprocessing: Ingest raw data from the data source layer;
[0013] S2. Graph Construction: The graph construction module preprocesses the input raw data to construct a unified domain ontology based on "brand level - style classification - material system - process flow - application scenario". The preprocessing includes data extraction and entity relationship construction, thereby constructing the graph.
[0014] S3. Incremental Update: The incremental update module continuously monitors the changes in the original data, performs change detection on the changes in the original data, and generates a change log. A bidirectional differential patching mechanism is used to capture addition, modification, and deletion operations. The difference between the previous and current versions of the graph is calculated based on the change log, and then a patch is generated. The patch includes a forward patch and a reverse patch. A set of strategies combining rule priority, semantic embedding similarity scoring, and hybrid decision-making is applied to intelligently resolve data conflicts.
[0015] S4. Consistency Guarantee: Through the distributed consistency module, the Raft consensus algorithm is used to ensure that all nodes in the cluster achieve strong consistency on the state of the knowledge graph data. The lease mechanism is used to prevent the "split-brain" problem in the distributed environment, and bounded stale reads are supported to balance consistency and read performance. At the same time, the edge-level version vector mechanism is used to accurately record and track the causal order and change history of each relation edge.
[0016] S5. Query Optimization: The query optimization module reduces redundant calculations and accelerates query response by maintaining a subgraph cache for hot queries, and uses a heuristic path pruning strategy to terminate invalid search paths in advance during graph traversal.
[0017] Preferably, step S2. Preprocessing the raw data in map construction includes the following steps:
[0018] S21. Entity Standardization: The input raw data is processed by text segmentation, part-of-speech tagging, named entity recognition based on a deep learning sequence labeling model, and data type conversion; a standardized dictionary containing core concepts in the fashion field and their synonyms and near-synonyms is established and maintained; the maintenance of the standardized dictionary is achieved through a combination of human expert annotation and a semi-automatic learning mechanism, which uses the co-occurrence frequency of words in a large-scale corpus, contextual similarity, and semantic embedding vector distance to generate candidate mappings; the standardization process uses hash table lookup and fuzzy matching algorithms to ensure that the same concepts obtain a unified representation.
[0019] S22. Name Alignment: A hybrid method is used to achieve high-precision name alignment. The method combines string similarity algorithm and semantic embedding technology. The semantic embedding technology uses a large-scale fashion text corpus to train word vectors or sentence vectors, and calculates the cosine similarity of the semantic vectors corresponding to different naming expressions to identify semantically similar entities. When the string similarity or semantic vector similarity exceeds a preset threshold, it is determined that they point to the same entity.
[0020] S23. Name Disambiguation: By analyzing the contextual information of the name's appearance and the attribute characteristics of the candidate entities, a classification model is used to calculate the confidence level of each candidate entity, and the entity with the highest confidence level is selected as the disambiguation result. If the confidence level is insufficient or there is competition for the results, manual review is initiated or the user is requested to provide more information for confirmation.
[0021] S24. Attribute Merging: For numerical attributes, the system calculates a weighted average based on the confidence level of each data source. The confidence level depends on the reliability, timeliness, and consistency of the data source. For non-numerical attributes, the majority voting principle is preferred. If a majority cannot be reached, predefined expert rules are used for decision-making. If the conflict still cannot be resolved, it is submitted for manual review to ensure the quality of the knowledge graph data.
[0022] Preferably, the string similarity algorithm includes Levenshtein distance, Jaccard similarity, cosine similarity based on N-gram vectors, or cosine similarity based on TF-IDF vectors.
[0023] Preferably, the change detection in step S3. incremental update includes the following steps:
[0024] Changes to structured database data sources are captured using database triggers or CDC technology. For unstructured or semi-structured data sources, changes are detected through periodic data crawling, log parsing, or real-time event subscription based on message queues, and a structured change log is generated. Each record in the change log contains a unique transaction identifier, an affected entity identifier, a changed attribute name, values before and after the change, an operation type, a timestamp, and a data source identifier.
[0025] Preferably, the forward patch describes all atomic graph modification instructions required to update the current graph state to a new state, and the atomic graph modification instructions include adding nodes, updating nodes, deleting nodes, adding edges, updating edges, and deleting edges; the reverse patch is the set of inverse operations of the forward patch, and its function is to restore the graph from the new state to the state before the change.
[0026] Preferably, the data conflict resolution in step S3. incremental update includes the following steps:
[0027] The hybrid decision-making method combines the rule priority and the semantic embedding similarity score for weighted calculation. The rule priority predefines a detailed rule weight system to evaluate the authority and credibility of different data sources. The semantic embedding similarity score is calculated by converting the conflicting text descriptions into pre-trained fashion domain word vectors and / or sentence vectors, and calculating the cosine similarity between the fashion domain word vectors and / or sentence vectors. The final conflict resolution result is obtained by normalizing and weighting the sum of the rule priority and the semantic similarity score, and selecting the candidate value with the highest confidence score as the final attribute value.
[0028] Preferably, the edge-level version vector includes a source node, a target node, a relation type, a timestamp, a user identifier for the update operation, and a sequence number. The edge-level version vector is used to accurately record and track the causal order and change history of each relation edge. The edge-level version vector determines the sequence of events and causal dependencies by comparing the timestamps and sequence numbers in different version vectors, thereby providing fine-grained historical version control and auditing capabilities for the graph.
[0029] Preferably, step S5. Query optimization, which maintains a subgraph cache for hot queries to reduce redundant calculations and accelerate query response, includes the following steps:
[0030] The subgraph cache is managed using an LRU strategy and supports a cache invalidation mechanism that intelligently identifies and invalidates affected cache items. The query optimization module adopts a heuristic path pruning strategy, which uses a heuristic function to estimate the value of the current search path or the probability of reaching the target node in real time during graph traversal, and combines it with a pre-computed reachability matrix to terminate invalid search paths in advance.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] 1. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention includes a graph construction module, an incremental update module, a distributed consistency module, and a query optimization module. The graph construction module is used to transform multi-source, multi-modal heterogeneous fashion data into a unified, structured knowledge graph. The incremental update module is used to achieve dynamic maintenance and real-time performance of the knowledge graph. The distributed consistency module is used to ensure strong consistency, high availability, and traceability of changes in knowledge graph data across multiple nodes. The query optimization module is used to provide efficient and flexible knowledge graph query capabilities for rapid retrieval and complex analysis of fashion knowledge. Through the collaborative work of the graph builder module, the incremental update module, the distributed consistency guarantee module, and the query optimization module, a distributed cognitive graph construction and dynamic update system is constructed that can adapt to the complex semantics of the fashion field, support efficient incremental updates, ensure strong data consistency in a distributed environment, and possess intelligent conflict resolution capabilities. This system demonstrates significant advantages in solving the core technical challenges of knowledge representation, dynamic updating, and consistency guarantee in the current apparel AI industry, providing solid technical support for the intelligent upgrading of the fashion industry.
[0033] 2. The distributed cognitive graph construction and dynamic update method of the present invention includes a query interface on the query optimization module, which includes a GraphQL interface, a REST interface, and a WebSocket interface. By providing multiple query interfaces, it supports flexible and efficient graph data querying and real-time data interaction; the GraphQL interface allows clients to precisely specify the required data structure through a single request, avoiding over- or under-acquiring data; the REST interface provides a traditional HTTP API interface, exposing a series of resources and supporting standard HTTP methods; the WebSocket interface supports real-time push and bidirectional communication, suitable for application scenarios requiring real-time updates or high-frequency interaction.
[0034] 3. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention includes the following steps: S1. Data ingestion and preprocessing, S2. Graph construction, S3. Incremental update, S4. Consistency guarantee, and S5. Query optimization. Through the above steps, heterogeneous data can be successfully transformed into a semantically rich knowledge graph, supporting its efficient incremental update and query.
[0035] 4. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention includes the following steps in step S2. Preprocessing of the original data during graph construction: S21. Entity standardization, S22. Name alignment, S23. Homoname disambiguation, and S24. Attribute merging. Through the bidirectional differential patching mechanism and an intelligent conflict resolution strategy in the above steps, the graph data can be ensured to quickly and accurately reflect changes in the external world.
[0036] 5. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention uses string similarity algorithms including Levenshtein distance, Jaccard similarity, cosine similarity based on N-gram vectors, or cosine similarity based on TF-IDF vectors. The surface similarity between named representations is evaluated using the above algorithms.
[0037] 6. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention includes the following steps in step S3. Change detection during incremental updates: Capturing changes in structured database data sources using database triggers or CDC technology; for unstructured or semi-structured data sources, detecting changes through periodic data scraping, log parsing, or real-time event subscription based on message queues, and generating a structured change log. Each record in the change log includes a unique transaction identifier, an affected entity identifier, a changed attribute name, values before and after the change, operation type, timestamp, and data source identifier. These steps effectively monitor changes in the data source and capture add, modify, and delete operations.
[0038] 7. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention includes a forward patch that describes all atomic graph modification instructions required to update the current graph state to a new state. These atomic graph modification instructions include adding nodes, updating nodes, deleting nodes, adding edges, updating edges, and deleting edges. A reverse patch is the set of inverse operations of the forward patch, and its function is to restore the graph from the new state to the state before the change. The generation of the reverse patch is synchronized with the forward patch, ensuring that all update operations are traceable and reversible. This setting provides the graph with powerful version rollback capabilities, supporting rapid recovery to any historical version in case of data errors or strategy adjustments.
[0039] 8. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention, step S3. Resolving data conflicts in incremental updates includes the following steps: a hybrid decision method combines rule priority and semantic embedding similarity score for weighted calculation; rule priority predefines a detailed rule weight system to evaluate the authority and credibility of different data sources; semantic embedding similarity score is calculated by converting the conflicting text description into pre-trained fashion domain word vectors and / or sentence vectors, and calculating the cosine similarity between fashion domain word vectors and / or sentence vectors; the final conflict resolution result is obtained by normalizing and weighting the sum of rule priority and semantic similarity score, and selecting the candidate value with the highest confidence score as the final attribute value. During the incremental update process, when multiple data sources or concurrent operations provide different information for the same entity or attribute in the knowledge graph, the incremental update module will activate the intelligent conflict resolution strategy; through the above steps, high-accuracy conflict resolution is achieved.
[0040] 9. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention includes an edge-level version vector comprising a source node, a target node, a relation type, a timestamp, a user identifier for the update operation, and a sequence number. The edge-level version vector is used to accurately record and track the causal order and change history of each relation edge. By comparing the timestamps and sequence numbers in different version vectors, the edge-level version vector determines the sequence of events and causal dependencies, thereby providing fine-grained historical version control and auditing capabilities for the graph. When any relation edge in the knowledge graph undergoes a creation, modification, or deletion operation, its version vector is automatically updated. By comparing the timestamps and sequence numbers in different version vectors, the system can determine the sequence of events and causal dependencies. If multiple version vectors conflict on the timestamp and the user identifier for the update operation, the sequence number can provide further sorting criteria, solving the problem of precise sorting in distributed concurrent updates.
[0041] 10. The method for constructing and dynamically updating a distributed cognitive graph according to the present invention, step S5. Maintaining a subgraph cache for hot queries in query optimization to reduce redundant computation and accelerate query response includes the following steps: the subgraph cache is managed using an LRU strategy and supports a cache invalidation mechanism that intelligently identifies affected cache items and invalidates them; the query optimization module adopts a heuristic path pruning strategy, using a heuristic function to estimate the value of the current search path or the probability of reaching the target node in real time during graph traversal, and combining it with a pre-computed reachability matrix to terminate invalid search paths in advance. Subgraph caching can significantly improve the response speed of hot queries and reduce redundant computation, while path pruning can avoid unnecessary computation and accelerate queries, suitable for queries that search for specific relationship paths in depth-first or breadth-first traversal. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art 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.
[0043] Figure 1 This is a flowchart illustrating the method for constructing and dynamically updating a distributed cognitive graph according to the present invention.
[0044] Figure 2 This is a schematic diagram of the incremental update process of the distributed cognitive graph construction and dynamic update method of the present invention;
[0045] Figure 3 This is an architecture diagram of the distributed consistency module of the distributed cognitive graph construction and dynamic update method of the present invention. Detailed Implementation
[0046] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0047] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0048] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation" and "connection" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, an electrical connection, or a connection that allows communication between the components; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication between two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0049] In the description of this application, it should be understood that the terms "upper", "lower", "side", "front", "rear", etc., indicate the orientation or positional relationship based on the installation orientation or positional relationship, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0050] In the description of this application, it should be noted that the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0051] It should also be noted that in the embodiments of this application, the same reference numerals are used to represent the same component or part. For the same part in the embodiments of this application, the reference numerals may only be used to mark one part or component as an example. It should be understood that the reference numerals are also applicable to other identical parts or components.
[0052] Furthermore, in this application, the technical features described in an open-ended manner include both closed technical solutions composed of the listed features and open technical solutions that include the listed features.
[0053] To further understand the invention's content, features, and effects, the following embodiments are provided, along with detailed descriptions in conjunction with the accompanying drawings:
[0054] like Figure 1-3 As shown, the method for constructing and dynamically updating a distributed cognitive graph includes a graph construction module, an incremental update module, a distributed consistency module, and a query optimization module.
[0055] The graph construction module is used to transform multi-source, multimodal heterogeneous fashion data into a unified, structured knowledge graph;
[0056] The incremental update module is used to achieve dynamic maintenance and real-time performance of the knowledge graph;
[0057] The distributed consistency module is used to ensure strong consistency, high availability, and change traceability of knowledge graph data across multiple nodes;
[0058] The query optimization module provides efficient and flexible knowledge graph query capabilities for rapid retrieval and complex analysis of fashion knowledge.
[0059] In this embodiment, through the collaborative work of the graph construction module, incremental update module, distributed consistency module, and query optimization module, a distributed cognitive graph construction and dynamic update system is built. This system can adapt to the complex semantics of the fashion industry, support efficient incremental updates, ensure strong data consistency in a distributed environment, and possess intelligent conflict resolution capabilities. Its significant advantages in solving the core technical challenges of knowledge representation, dynamic updates, and consistency guarantees in the current apparel AI industry provide solid technical support for the intelligent upgrading of the fashion industry. Of course, this is not limited to this; any other distributed cognitive graph construction and dynamic update system with intelligent conflict resolution capabilities can be used.
[0060] Specifically, the query optimization module provides query interfaces, including GraphQL, REST, and WebSocket interfaces. These multiple interfaces support flexible and efficient graph data querying and real-time data interaction. The GraphQL interface allows clients to precisely specify the required data structure in a single request, avoiding over- or under-data retrieval. The REST interface provides a traditional HTTP API, exposing a range of resources and supporting standard HTTP methods. The WebSocket interface supports real-time push and bidirectional communication, suitable for applications requiring real-time updates or high-frequency interactions. Of course, this is not a limitation; other interfaces capable of supporting flexible and efficient graph data querying and real-time data interaction are also acceptable.
[0061] Specifically, it includes the following steps:
[0062] S1. Data Ingestion and Preprocessing: Raw data is ingested from the data source layer. In this embodiment, the data source layer includes product descriptions from e-commerce platforms, designer blog posts, fashion media reports, user comments, trendy images and videos. Of course, it is not limited to these; it can be any other raw data that can provide information related to the fashion and apparel industry.
[0063] S2. Graph Construction: The graph construction module preprocesses the input raw data to construct a unified domain ontology based on "brand hierarchy—style classification—material system—process flow—application scenario." Preprocessing includes data extraction and entity relationship construction, thereby constructing the graph. In this embodiment, the brand hierarchy dimension includes luxury brands, high-end brands, mass-market brands, and fast fashion brands; the style classification dimension includes clothing type, sub-style, and design elements; the material system dimension includes natural fibers, synthetic fibers, blended materials, and functional fabrics; the process flow dimension includes design, pattern making, cutting, sewing, and finishing; and the application scenario dimension includes formal occasions, casual occasions, sports occasions, and special occasions. The five-dimensional knowledge structure of "brand hierarchy—style classification—material system—process flow—application scenario" can model complex knowledge in the fashion field with high accuracy and high coverage. Of course, the above dimensions are not limited to these; any other dimension that can model complex knowledge in the fashion field with high accuracy and high coverage can be used.
[0064] S3. Incremental Update: The incremental update module continuously monitors changes to the original data, performs change detection on these changes, generates a change log, and employs a bidirectional differential patching mechanism to capture addition, modification, and deletion operations. Based on the change log, it calculates the differences between the graph versions and generates patches, including forward and reverse patches. A strategy combining rule priority, semantic embedding similarity scoring, and hybrid decision-making is applied to intelligently resolve data conflicts. In this embodiment, the above steps ensure that the graph can respond to changes in the data source at near real-time speed, while providing technical support for flexible rollback operations. However, this is not limited to this; any other mechanism capable of responding to changes in the data source at near real-time speed and providing technical support for flexible rollback operations can be used.
[0065] S4. Consistency Guarantee: Through the distributed consistency module, the Raft consensus algorithm is used to ensure strong consistency of the knowledge graph data state among all nodes in the cluster. The lease mechanism prevents the "split-brain" problem in the distributed environment and supports bounded stale reads to balance consistency and read performance. At the same time, the edge-level version vector mechanism is used to accurately record and track the causal order and change history of each relation edge. In this embodiment, through the Raft consensus algorithm (meaning a consensus algorithm designed for managing replication logs), the Leader node (meaning the node responsible for handling all transactional requests) receives positive patches, appends them as log entries to its own persistent log, and replicates these log entries in parallel to all Follower nodes (meaning nodes that handle non-transactional requests). Follower nodes receive the logs and write them to local persistent storage. Once a majority of Followers confirm successful replication, the Leader marks the batch of logs as committed. Nodes then apply the committed log entries to their respective knowledge graph data stores, ensuring strong consistency of the new brand, products, and their relationships across all nodes in the cluster. A lease mechanism prevents the "split-brain" problem in a distributed environment; a lease is a time-limited exclusive right, and the Leader node must acquire and hold a currently valid lease before processing any request that might modify the knowledge graph data. Bounded aging reads, while pursuing strong data consistency, also address the system's needs for high throughput and low latency read performance. Query requests can read data from Follower nodes without always accessing the Leader node. Follower nodes can provide slightly older data that is guaranteed to be consistent within certain "boundaries," thus reducing the load on the Leader node. Each newly created relationship edge is assigned a unique edge-level version vector; however, this is not limited to this and can be achieved through other methods that can perform the same function.
[0066] S5. Query Optimization: The query optimization module reduces redundant calculations and accelerates query response by maintaining a subgraph cache for hot queries. It employs a heuristic path pruning strategy to terminate invalid search paths early during graph traversal. In this embodiment, when querying a brand's products for the first time, since the brand is new data and not yet in the cache, the query optimization module executes the underlying graph storage query and caches the query result as a subgraph. Subsequent queries for that brand's products will be retrieved directly from the cache, significantly accelerating the response. By terminating invalid or low-value search paths early during graph search through path pruning, the search space is greatly reduced. This effectively avoids unnecessary calculations and accelerates queries when performing complex graph traversal or pattern matching queries. Of course, any other method capable of query optimization and improving query response speed can be used.
[0067] Specifically, step S2. Preprocessing of the raw data in map construction includes the following steps:
[0068] S21. Entity Standardization: The input raw data undergoes text segmentation, part-of-speech tagging, named entity recognition based on a deep learning sequence labeling model, and data type conversion. A standardized dictionary containing core concepts in the fashion field and their synonyms and near-synonyms is established and maintained. The maintenance of the standardized dictionary is achieved through a combination of human expert annotation and a semi-automatic learning mechanism. The semi-automatic learning mechanism uses the co-occurrence frequency of words in a large-scale corpus, contextual similarity, and semantic embedding vector distance to generate candidate mappings. The standardization process uses hash table lookup and fuzzy matching algorithms to ensure that the same concepts obtain a unified representation. In this embodiment, for the input term, a precise hash lookup is performed first. If no precise match is found, a string fuzzy matching algorithm is used to calculate the similarity with existing terms in the standardized dictionary. If the similarity exceeds a preset threshold, the match is considered successful and standardization is performed. This setting ensures that all the same concepts obtain a unified and standardized representation in the graph, thereby effectively eliminating semantic ambiguity and data redundancy. Of course, it is not limited to this; any other method that can achieve a unified and standardized representation for all the same concepts in the graph is acceptable.
[0069] S22. Name Alignment: A hybrid approach is employed to achieve high-precision name alignment, combining string similarity algorithms and semantic embedding techniques. Semantic embedding utilizes a large-scale fashion text corpus to train word or sentence vectors, and identifies semantically similar entities by calculating the cosine similarity of the semantic vectors corresponding to different names. When the string similarity or semantic vector similarity exceeds a preset threshold, it is determined that they point to the same entity. In this embodiment, the string similarity algorithm applies multiple string similarity algorithms to evaluate the surface similarity between names. Semantic embedding utilizes a large-scale fashion text corpus to train word or sentence vectors. Through the hybrid decision-making and output of string similarity algorithms and semantic embedding techniques, semantic similarity provides a deeper level of judgment. If the string similarity is low but the semantic similarity is extremely high, the semantic judgment is prioritized. Conversely, if the string similarity is high but the semantic similarity is low, it needs to be handled with caution. The final output of the naming alignment process is an entity alias table. This table records in detail each standardized entity and all its identified naming variants. When importing data into the graph, all these aliases will be mapped to the unique identifier of the entity, thereby ensuring seamless integration and efficient querying of multi-source data. Of course, it is not limited to this; it can be any other method that can ensure seamless integration and efficient querying of multi-source data.
[0070] S23. Name Disambiguation: By analyzing the contextual information of the name and the attribute features of the candidate entities, a classification model is used to calculate the confidence level of each candidate entity, and the one with the highest confidence level is selected as the disambiguation result. If the confidence level is insufficient or there is competition for results, manual review is initiated or the user is requested to provide more information for confirmation. In this embodiment, for each entity name instance to be disambiguated, the system first extracts its contextual information. Simultaneously, the system collects attribute features of all possible entities corresponding to the name from existing knowledge bases or external data sources. Using the aforementioned contextual feature vector and attribute feature vector as input, the system predicts the entity most likely to which the name instance points. The training dataset is constructed by manually labeling a large number of ambiguous name instances and their correctly pointed-to entities. During the classification process, for each possible entity, the model outputs a confidence score between 0 and 1. The system selects the entity with the highest confidence level as the final disambiguation result. If the highest confidence level is lower than this threshold, or if multiple entities have similar and high confidence levels, the case will be marked as "uncertain" and a manual review process will be triggered, or the user will be asked for further information for confirmation interactively. This effectively ensures that the system maintains high accuracy even in complex or ambiguous situations. Of course, this is not limited to this; other methods that ensure high accuracy even in complex or ambiguous situations are acceptable.
[0071] S24. Attribute Merging: For numerical attributes, the system calculates a weighted average based on the confidence levels of each data source. Confidence levels depend on the reliability, timeliness, and consistency of the data sources. For non-numerical attributes, the majority voting principle is prioritized. If a majority cannot be reached, predefined expert rules are invoked for decision-making. If the conflict still cannot be resolved, it is submitted for manual review to ensure the quality of the knowledge graph data. In this embodiment, for numerical attributes, a confidence-weighted average method is used. Each attribute value provided by a data source is assigned a confidence score. The confidence score reflects the reliability, timeliness, and consistency of the data source. The confidence score can be dynamically calculated using a historical data quality assessment model or pre-assigned by domain experts based on experience. The final merged attribute value is obtained by calculating a weighted average of all source values. For non-numerical attributes, when a conflict occurs, the support of each conflicting attribute value is first calculated, i.e., the number of data sources providing that attribute value. If the support of a certain attribute value exceeds a preset majority threshold, the majority voting principle is adopted. If there is no obvious majority, or if a more refined judgment is required, the expert rule decision-making mechanism is invoked. The expert rules predefine a set of priority and condition judgments based on domain knowledge, encoded in a format parsable by a logic programming language or rule engine. In special cases, if the rule engine cannot completely resolve conflicts, the system will automatically mark the attribute as "pending review" and submit it to domain experts for manual review and adjudication, thereby ensuring the data quality and authority of the graph. Of course, it is not limited to this; any other method that can guarantee the data quality and authority of the graph can be used.
[0072] Specifically, string similarity algorithms include Levenshtein distance, Jaccard similarity, and cosine similarity based on N-gram vectors or TF-IDF vectors. In this embodiment, Levenshtein distance is used to calculate the minimum number of single-character edits (insertion, deletion, replacement) required to convert one string into another; Jaccard similarity is the ratio of the intersection to the union of N-gram sets (Chinese language model); cosine similarity based on N-gram vectors or TF-IDF vectors involves converting the string into an N-gram feature vector (meaning converting the text into a vector space model composed of combinations of N consecutive words (or bytes) by statistically analyzing their frequency) or a TF-IDF vector (meaning evaluating the contribution of words to a document by combining word frequency and inverse document frequency), and then calculating the cosine similarity of these vectors.
[0073] Specifically, step S3. Change detection in incremental updates includes the following steps:
[0074] This method employs database triggers or Change Data Capture (CDC) technology to capture changes in structured database data sources. For unstructured or semi-structured data sources, changes are detected through periodic data scraping, log parsing, or real-time event subscription based on message queues, generating a structured change log. Each record in the change log includes a unique transaction identifier, an affected entity identifier, a changed attribute name, values before and after the change, the operation type, a timestamp, and a data source identifier. In this embodiment, CDC technology refers to the technique of monitoring and recording changes such as additions, deletions, and modifications in databases and other data sources in real time. Through the above steps, changes in the data source are effectively monitored, and addition, modification, and deletion operations are captured. Of course, this is not limited to this; other technologies that can achieve the same function can be used.
[0075] Specifically, the forward patch describes all atomic graph modification instructions required to update the current graph state to the new state. These atomic instructions include adding nodes, updating nodes, deleting nodes, adding edges, updating edges, and deleting edges. The reverse patch is the set of inverse operations of the forward patch, and its function is to restore the graph from the new state to the state before the change. In this embodiment, this setting provides the graph with powerful version rollback capabilities, supporting rapid restoration to any historical version in case of data errors or policy adjustments. Of course, it is not limited to this; other methods capable of achieving the same function can be used.
[0076] Specifically, step S3. Resolving data conflicts during incremental updates includes the following steps:
[0077] The hybrid decision-making method combines rule priority and semantic embedding similarity score for weighted calculation. Rule priority predefines a detailed rule weight system to evaluate the authority and credibility of different data sources. Semantic embedding similarity score converts the conflicting text description into pre-trained fashion domain word vectors and / or sentence vectors, and calculates the cosine similarity between these vectors. The final conflict resolution result is obtained by normalizing and weighting the rule priority and semantic similarity score, selecting the candidate value with the highest confidence score as the final attribute value. In this embodiment, rule priority is managed through a configurable rule engine (e.g., based on Drools), allowing domain experts to dynamically adjust it according to actual business needs. When a conflict occurs, the system first adopts the data pointed to by the rule with higher priority. For conflicts that are difficult to determine using simple rules, the system converts the conflicting text description into pre-trained fashion domain word vectors or sentence vectors through semantic embedding similarity score. These vectors are obtained through fine-tuning unsupervised learning on a large fashion corpus, capturing the deep semantic relationships of words and phrases within the fashion domain. Then, the cosine similarity between these vectors is calculated. The final conflict resolution result is weighted by combining rule priority and semantic similarity scores, forming a refined decision-making process. For each conflicting attribute and all its candidate values, the system first assigns an initial weight based on the priority rules of its source data source. Next, for non-numerical attributes, the semantic similarity between each candidate value and existing values of that attribute in the current graph or with other high-priority candidate values is calculated. This similarity score is used as an auxiliary weight, superimposed on or adjusted from the initial weights. All weights are normalized and weighted summed to obtain the final confidence score for each candidate value. The system selects the candidate value with the highest confidence score as the final attribute value. To ensure decision quality, this invention sets a minimum confidence threshold. If multiple candidate values have similar scores, or the highest score does not reach the preset minimum confidence threshold, the conflict will be marked by the system and sent to a manual review queue. Domain experts will make the final decision on these complex conflicts. This hybrid strategy significantly reduces the data conflict rate and improves the data accuracy and global consistency of the graph. Of course, it is not limited to this; it can be any other method that significantly reduces the data conflict rate and improves the data accuracy and global consistency of the map.
[0078] Specifically, the edge-level version vector includes the source node, target node, relation type, timestamp, user identifier of the update operation, and sequence number. The edge-level version vector is used to accurately record and track the causal order and change history of each relation edge. By comparing the timestamps and sequence numbers in different version vectors, the edge-level version vector determines the sequence of events and causal dependencies, thus providing fine-grained historical version control and auditing capabilities for the graph. In this embodiment, the source node and target node identify the start and end nodes of the relation, ensuring the uniqueness of the edge; the relation type identifies the type of relation and defines the semantic connection between nodes; the timestamp records the most recent creation or modification time of the relation edge, accurate to the microsecond level, providing information on the time of the change; it is a monotonically increasing integer used to distinguish the order of different change events under the same timestamp or the same user identifier of the update operation. In a distributed system, due to clock synchronization issues or concurrent writes, multiple operations may occur within the same microsecond, and the sequence number provides the precise ordering basis. When any relation edge in the graph undergoes a creation, modification, or deletion operation, the version vector of that relation edge will be automatically updated. By comparing timestamps and sequence numbers in different version vectors, the system can determine the chronological order and causal dependencies of events. If multiple version vectors conflict on timestamps and user identifiers of update operations, the sequence number can provide further sorting criteria, thus solving the problem of precise ordering in distributed concurrent updates. Of course, it is not limited to this; any other method capable of solving the problem of precise ordering in distributed concurrent updates can be used.
[0079] Specifically, step S5. Query optimization, which maintains a subgraph cache for hot queries to reduce redundant calculations and accelerate query response, includes the following steps:
[0080] The subgraph cache is managed using an LRU (Least Recently Used) strategy and supports a cache invalidation mechanism that intelligently identifies and invalidates affected cached items. The query optimization module employs a heuristic path pruning strategy, using heuristic functions to estimate the value of the current search path or the probability of reaching the target node in real time during graph traversal, and combining this with a pre-computed reachability matrix to terminate invalid search paths early. In this embodiment, when a query request arrives, the query optimization module first checks the subgraph cache for cached results that meet the conditions using the query signature. If a result exists and the cached item is not invalid, it is directly retrieved from the cache and returned without accessing the underlying graph storage or performing time-consuming graph traversal calculations. The cache space is managed using an LRU (Least Recently Used) strategy. When the cache space is insufficient, the least recently used subgraph will be evicted to make room for new query results. Each cached item contains a timestamp to record the time of its most recent access, and the LRU manager makes eviction decisions based on this timestamp. Cache invalidation mechanism: When the incremental update module submits a new change patch and updates the knowledge graph, the query optimization module intelligently identifies and invalidates the affected cached items. The path pruning strategy uses heuristic functions to estimate the value of the current search path or the probability of reaching the target node in real time during graph traversal, leveraging local topological features of the graph to evaluate path importance. When the score falls below a preset pruning threshold, the current search path is terminated early. A pre-computed reachability matrix is used: approximate reachability queries or reachability prediction based on graph embeddings are employed. These graph embeddings map nodes to a low-dimensional vector space, predicting reachability through vector distance. At query initiation, if, based on the pre-computed reachability information, the target node and the current search node are shown as unreachable or have an extremely low reachability probability in the pre-computed reachability matrix, the search path is immediately terminated, significantly pruning invalid search branches. However, this is not limited to this; other methods capable of pruning invalid search branches can also be used.
[0081] 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.
[0082] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for constructing and dynamically updating a distributed cognitive graph, characterized in that: It includes a graph construction module, an incremental update module, a distributed consistency module, and a query optimization module; The graph construction module is used to transform multi-source, multi-modal heterogeneous fashion data into a unified, structured knowledge graph; The incremental update module is used to achieve dynamic maintenance and real-time performance of the knowledge graph. The distributed consistency module is used to ensure strong consistency, high availability, and traceability of changes to knowledge graph data across multiple nodes. The query optimization module is used to provide efficient and flexible knowledge graph query capabilities for rapid retrieval and complex analysis of fashion knowledge. The query optimization module is equipped with a query interface, which includes a GraphQL interface, a REST interface, and a WebSocket interface. Includes the following steps: S1. Data Ingestion and Preprocessing: Ingest raw data from the data source layer; S2. Graph Construction: The graph construction module preprocesses the input raw data to construct a unified domain ontology based on "brand level - style classification - material system - process flow - application scenario". The preprocessing includes data extraction and entity relationship construction, thereby constructing the graph. S3. Incremental Update: The incremental update module continuously monitors the changes in the original data, performs change detection on the changes in the original data, and generates a change log. A bidirectional differential patching mechanism is used to capture addition, modification, and deletion operations. The difference between the previous and current versions of the graph is calculated based on the change log, and then a patch is generated. The patch includes a forward patch and a reverse patch. A set of strategies combining rule priority, semantic embedding similarity scoring, and hybrid decision-making is applied to intelligently resolve data conflicts. S4. Consistency Guarantee: Through the distributed consistency module, the Raft consensus algorithm is used to ensure that all nodes in the cluster achieve strong consistency on the state of the knowledge graph data. The lease mechanism is used to prevent the "split-brain" problem in the distributed environment, and bounded stale reads are supported to balance consistency and read performance. At the same time, the edge-level version vector mechanism is used to accurately record and track the causal order and change history of each relation edge. S5. Query Optimization: The query optimization module reduces redundant calculations and accelerates query response by maintaining a subgraph cache for hot queries, and uses a heuristic path pruning strategy to terminate invalid search paths in advance during graph traversal.
2. The method for constructing and dynamically updating a distributed cognitive graph according to claim 1, characterized in that: Step S2. Preprocessing the raw data in map construction includes the following steps: S21. Entity Standardization: The input raw data is processed by text segmentation, part-of-speech tagging, named entity recognition based on a deep learning sequence labeling model, and data type conversion; a standardized dictionary containing core concepts in the fashion field and their synonyms and near-synonyms is established and maintained; the maintenance of the standardized dictionary is achieved through a combination of human expert annotation and a semi-automatic learning mechanism, which uses the co-occurrence frequency of words in a large-scale corpus, contextual similarity, and semantic embedding vector distance to generate candidate mappings; the standardization process uses hash table lookup and fuzzy matching algorithms to ensure that the same concepts obtain a unified representation. S22. Name Alignment: A hybrid method is used to achieve high-precision name alignment. The method combines string similarity algorithm and semantic embedding technology. The semantic embedding technology uses a large-scale fashion text corpus to train word vectors or sentence vectors, and calculates the cosine similarity of the semantic vectors corresponding to different naming expressions to identify semantically similar entities. When the string similarity or semantic vector similarity exceeds a preset threshold, it is determined that they point to the same entity. S23. Name Disambiguation: By analyzing the contextual information of the name and the attribute characteristics of the candidate entities, a classification model is used to calculate the confidence level of each candidate entity, and the one with the highest confidence level is selected as the disambiguation result; if the confidence level is insufficient or there is competition for the results, manual review is initiated or the user is requested to provide more information for confirmation; S24. Attribute Merging: For numerical attributes, the system calculates a weighted average based on the confidence level of each data source. The confidence level depends on the reliability, timeliness, and consistency of the data source. For non-numerical attributes, the majority voting principle is preferred. If a majority cannot be reached, predefined expert rules are used for decision-making. If the conflict still cannot be resolved, it is submitted for manual review to ensure the quality of the knowledge graph data.
3. The method for constructing and dynamically updating a distributed cognitive graph according to claim 2, characterized in that: The string similarity algorithms include Levenshtein distance, Jaccard similarity, cosine similarity based on N-gram vectors, or cosine similarity based on TF-IDF vectors.
4. The method for constructing and dynamically updating a distributed cognitive graph according to claim 3, characterized in that: The change detection in step S3, incremental update, includes the following steps: Changes to structured database data sources are captured using database triggers or CDC technology. For unstructured or semi-structured data sources, changes are detected through periodic data crawling, log parsing, or real-time event subscription based on message queues, and a structured change log is generated. Each record in the change log contains a unique transaction identifier, an affected entity identifier, a changed attribute name, values before and after the change, an operation type, a timestamp, and a data source identifier.
5. The method for constructing and dynamically updating a distributed cognitive graph according to claim 4, characterized in that: The forward patch describes all atomic graph modification instructions required to update the current graph state to a new state. The atomic graph modification instructions include adding nodes, updating nodes, deleting nodes, adding edges, updating edges, and deleting edges. The reverse patch is the set of inverse operations of the forward patch, and its function is to restore the graph from the new state to the state before the change.
6. The method for constructing and dynamically updating a distributed cognitive graph according to claim 5, characterized in that: The data conflict resolution process in step S3, incremental update, includes the following steps: The hybrid decision-making method combines the rule priority and the semantic embedding similarity score for weighted calculation. The rule priority predefines a detailed rule weight system to evaluate the authority and credibility of different data sources. The semantic embedding similarity score is calculated by converting the conflicting text descriptions into pre-trained fashion domain word vectors and / or sentence vectors, and calculating the cosine similarity between the fashion domain word vectors and / or sentence vectors. The final conflict resolution result is obtained by normalizing and weighting the sum of the rule priority and the semantic similarity score, and selecting the candidate value with the highest confidence score as the final attribute value.
7. The method for constructing and dynamically updating a distributed cognitive graph according to any one of claims 4-6, characterized in that: The edge-level version vector includes source node, target node, relation type, timestamp, user identifier and sequence number of update operation. The edge-level version vector is used to accurately record and track the causal order and change history of each relation edge. The edge-level version vector determines the chronological relationship and causal dependency of events by comparing the timestamps and sequence numbers in different version vectors, thereby providing fine-grained historical version control and auditing capabilities for the graph.
8. The method for constructing and dynamically updating a distributed cognitive graph according to claim 7, characterized in that: Step S5. Maintaining a subgraph cache for hot queries in query optimization to reduce redundant calculations and accelerate query response includes the following steps: The subgraph cache is managed using an LRU strategy and supports a cache invalidation mechanism that intelligently identifies and invalidates affected cache items. The query optimization module adopts a heuristic path pruning strategy, which uses a heuristic function to estimate the value of the current search path or the probability of reaching the target node in real time during graph traversal, and combines it with a pre-computed reachability matrix to terminate invalid search paths in advance.
Citation Information
Patent Citations
Knowledge graph construction method, knowledge graph construction device, medium and electronic equipment
CN116304104A
Incremental knowledge graph updating and consistency verification system for industrial field
CN119862195A
Label-based digital equipment model dynamic creation method and system
CN120336291A