Data processing method, database construction method and electronic equipment

By constructing and vectorizing graph structure data, the problem of existing RAG systems ignoring structured knowledge in complex problems is solved, and more accurate answer generation is achieved.

CN121722947APending Publication Date: 2026-03-24LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing question-answering systems based on retrieval augmentation generation (RAG) are prone to insufficient retrieval accuracy when dealing with complex questions due to neglecting the structured knowledge in the document, which affects the accuracy of the answer.

Method used

By obtaining the images and functional attributes of interface elements, we construct graph structure data and quantize it. We then use vectorized data to match and retrieve data in the graph database, generating structured knowledge response results. Finally, we combine this with a large language model to generate answers.

Benefits of technology

It improves the retrieval accuracy and answer precision of the question-answering system for complex questions, and ensures the preservation and utilization of structured knowledge during the retrieval process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121722947A_ABST
    Figure CN121722947A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method, a database construction method and electronic equipment, and relates to the technical field of artificial intelligence. The data processing method comprises the steps of obtaining first atlas structure data corresponding to target input; obtaining first vectorized data corresponding to the first map structure data; matching the first vectorized data to obtain second vectorized data; and based on the second vectorized data, determining second atlas structure data, and taking the second atlas structure data as data for generating a response result corresponding to the target input.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a data processing method, a database construction method and an electronic device. BACKGROUND

[0002] With the development of artificial intelligence technology, retrieval-augmented generation (RAG) based question and answer systems are widely used in intelligent customer service, knowledge question and answer and other scenarios. Existing RAG systems mainly use vector similarity retrieval technology to convert user input questions into vectors, retrieve semantically similar document fragments in the vector database, and provide the retrieval results to a large language model to generate answers. However, this pure vector retrieval method is prone to insufficient retrieval accuracy when dealing with complex problems due to the neglect of structured knowledge in the document, thereby affecting the accuracy of the final answer. SUMMARY

[0003] Therefore, the present application provides a data processing method, a database construction method and an electronic device.

[0004] According to a first aspect of the present application, a data processing method is provided, comprising: obtaining a first image of a first interface in response to obtaining a first instruction; the first interface comprising a plurality of interface elements; determining a second image of each interface element in the first interface, so that a model outputs first content based on at least each second image and the first image; the first content representing the functional attributes of each interface element; and executing the interface element indicated by the first instruction based on the first content.

[0005] A second aspect of the present application provides a database construction method, comprising: obtaining initial data; obtaining an initial graph structure corresponding to the initial data; the initial graph structure comprising at least two initial entity objects and the relationships between the entities; vectorizing the initial entity structure to obtain a second vector data set; constructing a database based on the initial graph structure and the second vector data set; the database being used to match a first vectorized data corresponding to a target input and a second vectorized data.

[0006] In a third aspect, the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs; and the one or more processors execute the one or more computer programs to: obtain first graph structure data corresponding to a target input; obtain first vectorization data corresponding to the first graph structure data; match the first vectorization data to obtain second vectorization data; determine second graph structure data based on the second vectorization data, and use the second graph structure data as data for generating a response result corresponding to the target input; or the one or more processors execute the one or more computer programs to further: obtain initial data; obtain an initial graph structure corresponding to the initial data; the initial graph structure comprises at least two initial entity objects and relationships between the entities; vectorize the initial entity structure to obtain a second vector data set; and construct a database based on the initial graph structure and the second vector data set; and the database is used to match first vectorization data corresponding to a target input and second vectorization data.

[0007] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0008] The above and other objects, features and advantages of the present application will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:

[0009] Figure 1 An application scenario diagram of a data processing method, a database construction method and an electronic device provided by an embodiment of the present application is schematically shown;

[0010] Figure 2 A flowchart of a data processing method provided by an embodiment of the present application is schematically shown;

[0011] Figure 3 An application process diagram of a data processing method provided by an embodiment of the present application in an actual application scenario is schematically shown;

[0012] Figure 4 A flowchart of a database construction method provided by an embodiment of the present application is schematically shown;

[0013] Figure 5 A system architecture diagram of a database construction and retrieval process provided by an embodiment of the present application is schematically shown;

[0014] Figure 6 A block diagram of an electronic device provided by an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0015] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0016] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0017] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0018] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0019] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.

[0020] Figure 1 The illustration shows an application scenario of a data processing method, a database construction method, and an electronic device provided in the embodiments of this application.

[0021] like Figure 1As shown, the application scenario according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0022] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send data processing requests, query requests, etc. Various applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as intelligent question-and-answer applications, knowledge retrieval applications, document management applications, intelligent customer service applications, browser applications, etc.

[0023] In one application scenario, when a user inputs a target input through a terminal device, the application sends the target input to server 105. Server 105 obtains first graph structure data corresponding to the target input, acquires first vectorized data corresponding to the first graph structure data, and matches the first vectorized data to obtain second vectorized data. Server 105 determines second graph structure data based on the second vectorized data, and uses the second graph structure data as data to generate the response result corresponding to the target input, and finally returns the response result to the terminal device for display.

[0024] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays that support content display and interactive operation, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0025] Server 105 can be a server providing data processing services, such as a backend processing server containing a graph database, a vector database, and a large language model. Server 105 receives target input from a terminal device, obtains the first graph structure data corresponding to the target input, acquires its corresponding first vectorized data, performs matching using the first vectorized data to obtain second vectorized data, determines the second graph structure data based on the second vectorized data, and sends the second graph structure data as data for generating the response result to the large language model. Finally, the generated response result is sent back to the terminal device for display. Server 105 can also use different matching strategies to determine the second graph structure data according to different target input types.

[0026] It should be noted that the data processing method provided in this application embodiment can be executed by the server 105, executed locally by the terminal device, or executed collaboratively by the terminal device and the server 105. For example, the parsing of the target input and the acquisition of the first graph structure data can be executed by the terminal device, while the matching of the first vectorized data, the determination of the second graph structure data, and the generation of the response result can be executed by the server 105.

[0027] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included. Furthermore, server 105 can also be a server cluster to provide stronger data processing capabilities and higher service availability.

[0028] The following will be based on Figure 1 The following describes the data processing method of the embodiments of this application in detail, based on the described scenario.

[0029] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application is shown.

[0030] like Figure 2 As shown, the data processing method may specifically include the following operations.

[0031] Operation S210 obtains the first map structure data corresponding to the target input;

[0032] Operation S220: Obtain the first vectorized data corresponding to the first map structure data;

[0033] Operation S230: Match the first vectorized data to obtain the second vectorized data;

[0034] Operation S240: Based on the second vectorized data, determine the second spectrogram structure data, and use the second spectrogram structure data as data for generating the response result corresponding to the target input.

[0035] In operation S210, the target input refers to the query request or question statement initiated by the user through the terminal device. It can be understood as natural language text that needs to be processed and responded to by the system, which is used to trigger the subsequent data retrieval and result generation process.

[0036] For example, target inputs include, but are not limited to, question queries, keyword searches, entity relationship queries, and attribute queries. Examples include, "Which companies has Company A acquired?", "What is the rated power of equipment X?", and "What is the relationship between Company A and Company B?"

[0037] Similarly, the first graph structure data corresponding to the target input refers to the structured knowledge representation obtained based on the parsing of the target input, which can be understood as graph-form data of entity objects and their relationships extracted from the target input.

[0038] For example, the first graph structure data can be represented in various forms, including but not limited to entity nodes, relationship edges between entities, entity attribute information, and graph structure patterns.

[0039] Optionally, the first graph structure data can be a combination of structured data containing two or more elements, such as a triple form of entity-relation-entity, an incomplete triple form of entity-relation-unknown object, an incomplete triple form of entity-unknown relation-entity, or a triple form of entity-attribute-attribute value. It can also be a complex graph structure containing multiple entities and multiple relations, or a single-element form containing only entity objects or a binary form of entity-relation.

[0040] For example, when the target input is "Which companies did Company A acquire?", the corresponding first graph structure data could be (Company A, Acquisition, ?), where "?" represents an unknown entity to be queried; it could also contain only the entity "Company A" and the relationship "Acquisition". When the target input is "The relationship between Company A and Company B", the corresponding first graph structure data could be (Company A, ?, Company B), where "?" represents an unknown relationship to be queried. When the target input involves multiple entities and multiple relationships, the first graph structure data can contain combinations of multiple structured elements, such as a tuple form of (Company A, Acquisition, Company B, Time, 2023, Amount, 1 billion yuan).

[0041] In one feasible implementation, the target input can be parsed by calling a large language model to extract entity objects and relation words, and a first graph structure data can be constructed. Specifically, the target input is sent to the large language model, which, based on its pre-trained semantic understanding capabilities, identifies entity names, relation types, and attribute information in the target input, and outputs the first graph structure data according to a predetermined graph structure format.

[0042] In another feasible implementation, the target input can be processed using a pre-defined entity recognition model and a relation extraction model to obtain the first graph structure data. Specifically, firstly, a named entity recognition model is used to label all entity objects in the target input, then a relation extraction model is used to identify the types of relationships between entities, and finally, the recognition results are organized into a graph structure.

[0043] Optionally, the first graph structure data can contain multiple graph structures simultaneously. For example, when the target input is "query the time and amount of Company A's acquisition of Company B", multiple first graph structure data can be extracted: (Company A, acquisition, Company B), (acquisition event, time, ?), (acquisition event, amount, ?). The above first graph structure data collectively represent the complete semantics of the target input.

[0044] Optionally, before obtaining the first graph structure data, the target input can be subjected to query rewriting. Query rewriting can include operations such as synonym replacement, entity name standardization, and completion of implicit information, thereby improving the accuracy of subsequent entity recognition and relation extraction. Query rewriting can be implemented using a large language model or a pre-defined rewriting rule base.

[0045] Optionally, the entity objects in the first graph structure data can be specific entities or entity categories. For example, for the target input "What are the electric vehicle manufacturers?", the extracted first graph structure data could be (?, belongs to, electric vehicle manufacturers), where "electric vehicle manufacturer" is an entity category rather than a specific entity.

[0046] In operation S220, the first vectorized data refers to the numerical vector representation obtained after the first graph structure data has been vectorized. It can be understood as a numerical expression that maps the graph structure data to a high-dimensional vector space, which is used for vector similarity calculation and matching retrieval in subsequent steps.

[0047] In one feasible implementation, the first spectral structure data can be vectorized in real time to obtain the first vectorized data.

[0048] Specifically, the first graph structure data is input into a pre-trained vectorization model, which converts the entity objects, relation types, and attribute information in the graph structure data into corresponding numerical vectors. The vectorization model can be a deep learning-based text encoder, for example, an encoder that converts the text representation of the graph structure data into fixed-dimensional vectors.

[0049] In another feasible implementation, the first vectorized data corresponding to the first graph structure data can be found and retrieved in a pre-constructed second vector dataset based on the identifier of the first graph structure data. Specifically, each element contained in the first graph structure data has a unique identifier in the graph database, and the pre-calculated and stored vectorized data is retrieved in the second vector dataset using this unique identifier. The second vector dataset is a vector index library established after the various graph structure data in the graph database have been vectorized in advance during the database construction phase.

[0050] Optionally, when the first graph structure data contains multiple graph structure elements, the vectorized data corresponding to each graph structure element can be obtained separately, thereby obtaining multiple first vectorized data. For example, when the first graph structure data includes two structure elements (Company A, Acquisition, ?) and (Acquisition Event, Time, ?), the vectorized representations corresponding to these two structure elements can be obtained separately.

[0051] Optionally, the dimension of the first vectorized data can be configured according to actual application requirements. A higher vector dimension can express richer semantic information, but the computational and storage costs also increase accordingly. In practical applications, the dimension can be determined based on the complexity of the graph data, retrieval accuracy requirements, and system resource limitations.

[0052] It should be noted that incomplete first-order graph structure data can also be vectorized. For example, for graph structure data that only contains entity objects and relation types but lacks some elements, the vectorization model can generate vector representations based on known elements, while unknown elements can be represented by special labels or masked during the vectorization process.

[0053] In operation S230, the second vectorized data refers to the vectorized data related to the first vectorized data obtained through vector matching retrieval. It can be understood as a vector representation in the pre-constructed vector dataset that is semantically similar to or related to the first vectorized data.

[0054] In one feasible implementation, vector similarity calculation can be performed on the second vector dataset to obtain second vectorized data that matches the first vectorized data. Specifically, the first vectorized data is used as the query vector, and the similarity between the query vector and each candidate vector is calculated in the second vector dataset. The vectors are then sorted according to their similarity scores, and one or more vectors with the highest similarity scores are selected as the second vectorized data. Similarity calculation can employ vector distance metrics such as cosine similarity, Euclidean distance, and dot product.

[0055] In another feasible implementation, an approximate nearest neighbor search algorithm can be used to quickly retrieve the second vectorized data from the second vector dataset. Specifically, the second vector dataset is organized using a vector index structure, such as a hash index or a tree index. During the matching process, the approximate nearest neighbor search algorithm is used to quickly locate the candidate vector most similar to the first vectorized data in the index structure, thereby obtaining the second vectorized data.

[0056] Optionally, when the first vectorized data contains multiple vectors, each of the first vectorized data can be matched separately to obtain multiple sets of second vectorized data.

[0057] Optionally, a similarity threshold can be set during the matching process, and only vectors with similarity exceeding the threshold can be used as the second vectorized data.

[0058] Optionally, the number of second vectorized data points can be configured according to the application scenario. In some application scenarios, only the second vectorized data point with the highest similarity can be obtained for precise matching; in other application scenarios, multiple second vectorized data points with the highest similarity can be obtained to provide multiple candidate results or for subsequent comprehensive analysis.

[0059] In operation S240, the second graph structure data refers to the graph structure data corresponding to the second vectorized data. It can be understood as the structured knowledge related to the semantics of the target input retrieved from the graph database, which is used to provide answer basis or knowledge support for the target input.

[0060] The difference between the second graph structure data and the first graph structure data is that the first graph structure data is a structured representation of the query intent obtained by parsing and extracting from the target input, which usually contains unknown elements or information to be queried, while the second graph structure data is a complete knowledge structure retrieved from the graph database, which includes the completion of unknown elements in the first graph structure data or the answer to the query question.

[0061] For example, when the target input is "Which companies has Company A acquired?", the first graph structure data could be (Company A, Acquisition, ?), representing the query intent; while the corresponding second graph structure data could be complete knowledge triples such as (Company A, Acquisition, Company B) or (Company A, Acquisition, Company C), representing the factual information actually stored in the graph database. As another example, when the target input is "The relationship between Company A and Company B", the first graph structure data could be (Company A, ?, Company B), while the second graph structure data could be specific relationship data such as (Company A, Investment, Company B) or (Company A, Cooperation, Company B).

[0062] In one feasible implementation, the corresponding second graph structure data can be found and obtained in the graph database using the identification information of the second vectorized data. Specifically, each vector in the second vector dataset has a one-to-one mapping relationship with the graph structure data in the graph database, and each second vectorized data is associated with a unique graph structure identifier. By performing an index query in the graph database using this identifier, the corresponding second graph structure data can be obtained.

[0063] In another feasible implementation, multiple second graph structure data can be obtained in batches based on the vector index information corresponding to the second vectorized data. Specifically, when the second vectorized data contains multiple vectors, the graph structure identifiers corresponding to these vectors can be submitted in batches to the graph database for querying, thereby obtaining multiple second graph structure data at once.

[0064] Optionally, the second graph structure data can be directly used as data to generate the response result corresponding to the target input. Specifically, the information such as entity objects, relationship types, and attribute values ​​contained in the second graph structure data are organized into natural language form as a response to the target input. For example, when the second graph structure data is (Company A, acquisition, Company B, time, 2023, amount, 1 billion yuan), the response result "Company A acquired Company B for 1 billion yuan in 2023" can be generated.

[0065] Optionally, the second-level graph structure data can also be combined with other data to jointly generate the response result corresponding to the target input. Specifically, the second-level graph structure data can be used as contextual information input into a large language model, which can then generate a more natural and fluent response text based on the second-level graph structure data. Alternatively, multiple sets of second-level graph structure data can be aggregated and analyzed to extract key information before generating the response result.

[0066] By adopting the technical solution of this application, a first graph structure data corresponding to the target input is obtained, which enables the extraction of a structured knowledge representation from the target input; obtaining the first vectorized data corresponding to the first graph structure data enables the conversion of structured knowledge into a computable vector form, allowing the structured information to both maintain its semantic expression and participate in similarity matching; matching the first vectorized data to obtain the second vectorized data enables the identification of candidate data related to the target input at the semantic level, ensuring the recall range of the retrieval; determining the second graph structure data based on the second vectorized data enables the restoration of the matching result into a structured knowledge form, thus when the second graph structure data is used to generate the response result corresponding to the target input, it utilizes the semantic matching capability of vector retrieval while retaining the structured knowledge in the document, solving the problem of insufficient retrieval accuracy caused by ignoring structured knowledge in existing pure vector retrieval methods, thereby improving the accuracy of the generated answer.

[0067] Based on the above embodiments, as an optional embodiment, in order to narrow down the range of candidate data before vector retrieval, improve the accuracy and efficiency of retrieval, and avoid the problems of excessive computational overhead and insufficient relevance of results caused by global search in the entire graph dataset, the above operation S210 may further include the following operations.

[0068] Operation S310 obtains first atlas structure data corresponding to the target input; the first atlas structure data includes at least one target entity object.

[0069] Operation S320 matches multiple first entity objects in the first graph dataset based on the target entity object;

[0070] Operate S330 to obtain the first graph structure data of each first entity object;

[0071] Correspondingly, the above operation S230 may also include the following operations.

[0072] Operation S340: Match each first vectorized data with the target vectorized data, and determine the second vectorized data with a similarity higher than the first similarity among the first vectorized data; the target vectorized data is the vectorized data corresponding to the target map structure data.

[0073] In operation S310, the target entity object refers to the entity node contained in the first graph structure data obtained from the target input. It can be understood as the anchor point entity used to delineate the range in the graph dataset, and is used to search for other related entity objects in the graph later.

[0074] For example, when the target input is "Which companies did Company A acquire?", the corresponding first graph structure data is (Company A, Acquisitions, ?), which contains the target entity "Company A". When the target input is "The relationship between Company A and Company B", the corresponding first graph structure data is (Company A, ?, Company B), which contains the two target entities "Company A" and "Company B".

[0075] Optionally, when the first graph structure data contains multiple target entity objects, subsequent matching operations can be performed based on each target entity object separately, or multiple target entity objects can be treated as a whole for joint matching.

[0076] In operation S320, the first entity object refers to the entity node in the first graph dataset that has a relationship with the target entity object. It can be understood as the neighbor node of the target entity object in the graph or the related entity that can be reached through the relationship path. It is used to construct a local subgraph range centered on the target entity object.

[0077] Similarly, the first graph dataset refers to a pre-built knowledge graph database containing entity nodes, relation edges, and attribute information. It can be understood as a graph index library that stores structured knowledge extracted from the initial data.

[0078] In one feasible implementation, entity nodes directly connected to the target entity object can be found in the first graph dataset and used as the first entity object. Specifically, the node corresponding to the target entity object is located in the graph dataset, all outgoing and incoming edges of the node are traversed, and all neighboring nodes directly connected to the node through an edge are obtained. These neighboring nodes are used as the first entity object.

[0079] In another feasible implementation, entity nodes reachable from the target entity object within a specified number of hops can be found in the first graph dataset and designated as the first entity object. Specifically, starting from the node corresponding to the target entity object, an extended search is performed in the graph using a graph traversal algorithm to obtain all entity nodes reachable within a preset number of hops. The preset number of hops can be one hop, two hops, or more hops; a larger number of hops covers a wider range of entities, but the computational complexity also increases accordingly.

[0080] For example, when the target entity is "Company A", searching for entity nodes directly connected to "Company A" in the first graph dataset can yield multiple entities including "Company B", "Company C", "Founder of Company A", and "Industry of Company A". When using a two-hop search, indirectly related entities such as "Investors of Company B" and "Partners of Company C" can be further obtained.

[0081] Optionally, during the matching of the first entity object, relationship type filtering conditions can be set to retrieve only entity nodes connected through specific relationship types. For example, only the first entity object connected to the target entity object through specific relationships such as "acquisition," "investment," or "cooperation" can be retrieved, while entity nodes connected through other unrelated relationships can be filtered out.

[0082] Optionally, during the matching of the first entity object, entity type filtering conditions can be set to retrieve only nodes belonging to a specific entity category. For example, when querying a business acquisition relationship, only the first entity object with the entity type "company" or "enterprise" can be retrieved, while filtering out entity nodes of other types such as "person" and "place".

[0083] It should be noted that the number of first entity objects obtained after matching can vary depending on the size and complexity of the graph. In some cases, a single target entity object may correspond to dozens or even hundreds of first entity objects. To control the amount of data processed subsequently, an upper limit can be set on the number of first entity objects, or the entities can be sorted according to the strength of their associations and the top-ranked first entity objects can be selected.

[0084] In operation S330, the first graph structure data of each first entity object refers to the structured knowledge representation of the first entity object in the graph dataset, which can be understood as triples or multi-tuples with the first entity object as the constituent element.

[0085] In one feasible implementation, all triples of each first entity object as a subject or object can be obtained. Specifically, in the first graph dataset, all relation triples with the first entity object as the head or tail entity are queried, including the forms (first entity object, relation, other entities) and (other entities, relation, first entity object), as well as attribute triples (first entity object, attribute, attribute value).

[0086] In another feasible implementation, graph structure data corresponding to the relationship paths between each first entity object and the target entity object can be obtained. Specifically, the relationship edge information connecting the target entity object and the first entity objects is extracted, and triples of the form (target entity object, relationship, first entity object) are constructed, or multi-hop path structure data containing intermediate nodes is obtained.

[0087] For example, when the first entity is "Company B", the corresponding first graph structure data may include multiple triples such as (Company A, Acquisition, Company B), (Company B, Establishment Date, 2010), and (Company B, Industry, Internet). When the first entity is "Company C", the corresponding first graph structure data may include triples such as (Company A, Investment, Company C) and (Company C, Main Business, Artificial Intelligence).

[0088] Optionally, the obtained first graph structure data of each first entity object may contain duplicate triples. For example, when multiple first entity objects are associated with the same target entity object, the same triple data may be extracted.

[0089] In operation S340, matching each first vectorized data with the target vectorized data means calculating the similarity with the target vectorized data within the candidate range consisting of the vectorized data corresponding to the first graph structure data of each first entity object. This can be understood as performing vector semantic matching within the local data range that has been filtered through the graph structure, in order to further determine the semantic similarity results while ensuring structural relevance.

[0090] The target vectorized data is the vectorized data corresponding to the target map structure data, where the target map structure data is the first map structure data obtained in operation S310.

[0091] In one feasible implementation, similarity calculations can be performed on each first vectorized data and the target vectorized data to obtain various similarity values. Then, the first vectorized data with similarity values ​​higher than a first similarity threshold can be selected as the second vectorized data. Specifically, for each first vectorized data corresponding to the first graph structure data of each first entity object, the cosine similarity or other distance metric between the vector and the target vectorized data is calculated. The calculated similarity is compared with a preset first similarity threshold, and only vectors with similarity values ​​exceeding the threshold are retained as the second vectorized data for subsequent use.

[0092] In another feasible implementation, the similarity between each first vectorized data and the target vectorized data can be sorted, and the first vectorized data with the highest similarity can be selected as the second vectorized data. Specifically, after calculating the similarity between all the first vectorized data and the target vectorized data, they are sorted from high to low similarity, and the top N vectors are selected as the second vectorized data, where N is a positive integer, which can be a preset fixed value or dynamically adjusted according to the application scenario.

[0093] Optionally, when the target vectorized data contains multiple vectors, each target vectorized data can be matched with each first vectorized data to obtain multiple sets of second vectorized data, and then these second vectorized data can be merged, deduplicated, or weighted.

[0094] By employing the embodiments of this application, multiple first entity objects are matched in the first graph dataset based on the target entity object. This allows for the delineation of local subgraph ranges related to the target input at the graph structure level, avoiding blind searching in the full graph data. Obtaining the first graph structure data of each first entity object enables the collection of candidate knowledge triples within the local subgraph range, providing structured pre-screened data for subsequent vector matching. Matching each first vectorized data with the target vectorized data and filtering second vectorized data with similarity higher than the first similarity allows for further semantic matching within the structurally related local range. This ensures both the correlation between the retrieval results and the target input in the graph structure and leverages the flexibility of vector semantic matching. It solves the semantic drift problem caused by the lack of structural constraints in pure vector retrieval and the insufficient recall problem caused by the lack of semantic understanding in pure graph retrieval, thereby improving the accuracy and relevance of retrieval results while ensuring retrieval efficiency.

[0095] Based on the above embodiments, as an optional implementation, in order to generate vector representations in real time in scenarios with high real-time requirements or dynamically changing graph structures, and to quickly call pre-stored vector data in scenarios with limited system resources or frequent queries, the above operation S220 may further include any of the following operations:

[0096] Operation S410 is used to vectorize the first spectral structure data to obtain the first vectorized data;

[0097] Operation S420 retrieves the first vectorized data corresponding to the first graph structure data from the second vector dataset based on the identifier of the first graph structure data.

[0098] In operation S410, the first graph structure data can be converted into natural language text, and then vectorized by a text encoder. Specifically, the entity objects, relation types, and attribute information in the first graph structure data are concatenated into natural language sentences according to a predetermined template. For example, the triple (Company A, Acquisition, ?) is converted into text expressions such as "Company A acquired a certain enterprise" or "Query the acquisition targets of Company A". This text is then input into a pre-trained text encoder to obtain the corresponding vector representation.

[0099] In another feasible implementation, the structured representation of the first graph structure data can be directly input into a dedicated graph encoder for vectorization. Specifically, the graph encoder can identify the semantic role of each element in the first graph structure data, such as distinguishing between subject entities, relation types, object entities, or attribute values, and after encoding each element separately, they are fused to generate an overall vector representation. The graph encoder can be an encoding model specifically trained for knowledge graph data, which can better preserve the semantic information of the graph structure.

[0100] Optionally, when the first graph structure data is an incomplete triplet, the unknown elements can be processed during vectorization. For example, for an incomplete triplet of the form (Company A, Acquisition, ?), the unknown position "?" can be represented by a special symbol, or replaced with placeholders such as "unknown object" or "entity to be queried" during textualization, so that the vectorization model can identify the uncertain parts in the query intent.

[0101] In operation S420, the identifier of the first graph structure data refers to the identification information that can uniquely determine the graph structure data, which can be understood as the unique index key or hash value of the graph structure data in the database.

[0102] For example, the identifier of the first graph structure data can be a composite identifier generated by combining the unique identifier of the entity object and the unique identifier of the relation type. For instance, for a triple (Company A, Acquisition, ?), a composite identifier can be generated based on the entity ID of "Company A" and the relation ID of the "Acquisition" relation, and this composite identifier corresponds to the pre-stored vector data in the second vector dataset.

[0103] In one feasible implementation, the first vectorized data can be quickly located in the second vector dataset using a hash mapping method.

[0104] In another feasible implementation, the first vectorized data can be found in the second vector dataset using a key-value storage method.

[0105] Optionally, when the first graph structure data does not have a corresponding pre-stored vector in the second vector dataset, operation S410 can be triggered to perform real-time vectorization processing on the first graph structure data and store the generated vector in the second vector dataset for subsequent querying.

[0106] Optionally, operation S410 or operation S420 can be dynamically selected based on query frequency statistics. Specifically, for frequently occurring first-spectrum structure data, operation S420 is preferred to retrieve it from the pre-stored vector library to improve efficiency; for first-time or low-frequency first-spectrum structure data, operation S410 is used for real-time vectorization to avoid pre-stored large amounts of low-frequency vector data occupying storage space.

[0107] It should be noted that operations S410 and S420 can coexist in the same system, and can be flexibly selected according to the actual situation. For example, for standard triplet structures that already exist in the graph dataset, operation S420 can be used to directly obtain the pre-stored vectors; for graph structure data that appears newly in the user query or has been rewritten, operation S410 can be used for real-time vectorization.

[0108] Figure 3 The illustration shows a schematic diagram of the application process of a data processing method provided in this application embodiment in a practical application scenario.

[0109] like Figure 3 As shown, user Tom initiates a query request to the knowledge question-answering system 302 through client device 301, with the target input 303 being "What industry does Company A belong to?". After the query request is processed by the language parsing module 304, the first graph structure data 305 is generated, with the structure of (Company A, ?, ?), which contains the target entity object 307 "Company A".

[0110] During the retrieval phase, the system first performs entity matching based on the target entity object 307 "Company A" in the first graph dataset 306, locating the first entity object 308 containing "Company A". Subsequently, it acquires multiple first graph structure data 309 related to this entity, including triple structures such as (Company A, Industry, Artificial Intelligence), (Company A, Establishment Time, 2015), and (Company A, Acquisition, Company B).

[0111] For the first graph structure data 309 obtained, the system queries the corresponding first vectorized data 312 in the second vector dataset 311 according to the identifier of each graph structure.

[0112] Simultaneously, the system vectorizes the target map structure data 305 to generate target vectorized data 313. During the vector matching stage, the system calculates the similarity between each first vectorized data 312 and the target vectorized data 313, obtains the similarity value of each vector, and determines the second vectorized data 314 with the highest similarity.

[0113] Based on the second vectorized data 314, the system backtracks through the mapping relationship to obtain the corresponding second graph structure data 311, namely (Company A, Industry, Artificial Intelligence). This graph structure data is extracted and transmitted to the response generation module. Combined with the first original data "Company A is a technology company focusing on the research and development of artificial intelligence technology" corresponding to the second graph structure data 311, the system generates the natural language response result 313: "Company A belongs to the artificial intelligence industry, and the company focuses on the research and development and application of artificial intelligence technology." This response result is presented to user Tom through the display interface of the client device 301, completing the entire query response process.

[0114] By adopting the technical solution of this application, two optional implementation paths are provided: vectorization of the first map structure data and acquisition of pre-stored vectorized data based on the identifier. The vector acquisition method can be flexibly selected according to the real-time requirements of the application scenario, system resource constraints and data distribution characteristics, so as to ensure the accuracy and consistency of vector data while taking into account the system's response speed and resource utilization efficiency.

[0115] Based on the above embodiments, as an optional embodiment, to further introduce constraints at the graph structure level on top of semantic similarity matching and improve the consistency of the retrieval results with the target input in terms of knowledge structure, the second vector data can be the first vectorized data with a similarity higher than the first similarity.

[0116] Correspondingly, the above operation S240 may also include the following operations.

[0117] Operation S510 determines the structural similarity between the first graph structure data and each third graph structure data; the third graph structure data is the graph structure data corresponding to each second vector data.

[0118] Operation S520: Based on the structural similarity of each first map structure data, determine the target vectorized data in the second vector data.

[0119] Operation S530 determines the second spectral structure data corresponding to the target vectorized data.

[0120] In operation S510, structural similarity refers to the degree of matching between the first and third graph structural data in terms of graph structural components. It can be understood as a quantitative indicator that measures the consistency of two graph structural data at the level of structured elements such as entity objects, relationship types, and attribute features.

[0121] Similarly, the third graph structure data refers to the graph structure data corresponding to each second vector data in the graph database.

[0122] In one feasible implementation, structural similarity can be determined by comparing the number of identical elements in the first graph structure data and each third graph structure data. Specifically, the entity objects and relationship types contained in the first graph structure data are extracted and compared one by one with the corresponding elements in each third graph structure data. The number of matching elements is counted, and the structural similarity value is calculated based on the number of matches.

[0123] In another feasible implementation, the matching degree can be calculated for different types of elements in the first graph structure data and each of the third graph structure data, and then a weighted sum can be performed to obtain the structural similarity. Specifically, the matching degree of entity objects and the matching degree of relationship types are calculated separately, and the two matching degrees are weighted and summed according to preset weights to obtain the structural similarity.

[0124] For example, when the first graph structure data is (Company A, Acquisition, ?), the third graph structure data includes multiple candidate triples such as (Company A, Acquisition, Company B), (Company A, Investment, Company C), and (Company D, Acquisition, Company E). When determining structural similarity, (Company A, Acquisition, Company B) matches the first graph structure data in both the entity object "Company A" and the relation type "Acquisition," indicating high structural similarity; (Company A, Investment, Company C) matches only the entity object "Company A," indicating slightly lower structural similarity; and (Company D, Acquisition, Company E) matches only the relation type "Acquisition," indicating low structural similarity.

[0125] Optionally, when determining structural similarity, known and unknown elements in the first graph structure data can be distinguished. Specifically, for explicitly specified entity objects or relation types in the first graph structure data, the corresponding elements in the third graph structure data must be completely matched; for unknown element positions in the first graph structure data, no constraints are imposed on the corresponding elements in the third graph structure data.

[0126] Optionally, when determining structural similarity, type matching of entity objects can be considered. Specifically, when an unknown element in the first graph structure data corresponds to a specific entity type, the entity object at the corresponding position in the third graph structure data can be required to belong to that type, and the type matching result can be included in the calculation of structural similarity.

[0127] Optionally, when the first spectral structure data contains multiple spectral structure elements, the structural similarity between each first spectral structure data and the corresponding third spectral structure data can be calculated separately to obtain multiple sets of structural similarity values.

[0128] In operation S520, a structural similarity threshold can be set, and the second vector data with a structural similarity higher than the threshold can be identified as the target vectorized data.

[0129] In another feasible implementation, the second vector data can be sorted according to structural similarity, and the second vector data with the highest structural similarity ranking can be selected as the target vectorized data.

[0130] Optionally, when there are multiple first-map structure data, the corresponding target vectorized data can be determined based on the structural similarity of each first-map structure data to obtain multiple sets of target vectorized data, and then these target vectorized data are merged.

[0131] It should be noted that the structural similarity threshold or the number of ranking items N can be adjusted according to the requirements of retrieval accuracy and recall. When high-precision retrieval is required, a higher structural similarity threshold or a smaller N value can be set to ensure the structural consistency of the returned results; when a larger recall is required, the threshold can be appropriately lowered or the N value increased to avoid over-constraint leading to the omission of relevant results.

[0132] In operation S530, the corresponding second map structure data can be directly queried in the map database by using the index identifier of the target vectorized data.

[0133] In another feasible implementation, second map structure data corresponding to multiple target vectorized data can be acquired in batches.

[0134] Optionally, the acquired second graph structure data may include complete triple information and related attribute data. Specifically, the second graph structure data not only includes basic entity-relation-entity triples, but may also include attribute information such as time, location, and value related to the triple, as well as the source location information of the triple in the original document.

[0135] By adopting the embodiments of this application, the structural similarity between the first graph structure data and each third graph structure data is determined, which can add graph structure-level verification on the basis of vector semantic matching and quantify the consistency between candidate results and query intent in knowledge structure; based on structural similarity, the target vectorized data is determined in the second vector data, which can further perform structural constraint screening on the candidate set obtained by vector retrieval and filter out interference results that are semantically similar but structurally inconsistent.

[0136] Based on the above embodiments, as an optional embodiment, in order to provide a more refined structural similarity calculation method, the contribution of different types of elements in the graph structure data to structural matching is differentiated and quantified. The above operation S510 may further include the following operations.

[0137] S610, for any first graph structure data, determine the first matching degree based on the number of first entity objects in the first graph structure data that match those in the third graph structure data;

[0138] S620, determine the second matching degree based on the number of attribute features in the first graph structure data that match those in the third graph structure data; the attribute features include relational attributes and / or functional attributes;

[0139] S630, the first matching degree and the second matching degree corresponding to the first spectrogram structure data are weighted and summed to obtain the structural similarity between the first spectrogram structure data and the third spectrogram structure data.

[0140] In operation S610, the first matching degree refers to the degree of matching between the first and third graph structure data at the entity object level. It can be understood as the proportion of the same entity objects in the two graph structure data or the matching score.

[0141] In one feasible implementation, the number of matching entity objects in the first and third graph structure data can be counted, and the first matching degree can be determined based on this number.

[0142] In another feasible implementation, the first matching degree can be determined based on the ratio of the number of matching entity objects to the total number of entity objects.

[0143] Optionally, when determining the first matching degree, known and unknown entity objects in the first graph structure data can be distinguished. Specifically, only explicitly specified entity objects in the first graph structure data are matched, and the positions of unknown entities are not included in the denominator of the matching degree calculation. For example, for first graph structure data in the form of (Company A, Acquisition, ?), only the matching of the main entity "Company A" is counted, and the positions of unknown objects are not included in the calculation base of the first matching degree.

[0144] Optionally, entity object matching can support synonym matching or matching after entity linking. Specifically, when the entity object representations in the first and third graph structure data are not completely identical but point to the same entity, a match can be determined through entity linking or a thesaurus. For example, "Company A" and "Group A" pointing to the same entity object after entity linking can be counted as matches.

[0145] In operation S620, attribute features refer to the characteristic information in the graph structure data that describes the relationships between entities or the properties of the entities themselves.

[0146] For example, attribute characteristics include relational attributes and functional attributes. Relational attributes refer to the type of relationship connecting two entity objects, such as "acquisition", "investment", "cooperation", "subordination" and other relationships; functional attributes refer to the inherent characteristics of an entity object, such as "establishment time", "registered capital", "industry", "rated power" and other attributes.

[0147] Similarly, the second matching degree refers to the degree of matching between the first and third graph structure data at the attribute feature level. It can be understood as the proportion or matching score of the same relation type or functional attribute in the two graph structure data.

[0148] In one feasible implementation, the number of matching relation attributes in the first and third graph structure data can be counted, and the second matching degree can be determined based on this number. Specifically, the relation types contained in the first graph structure data are extracted and compared with the relation types in the third graph structure data to determine whether the relation types are the same, and the number of the same relations is used as the basis for calculating the second matching degree.

[0149] In another feasible implementation, the number of matching relational attributes and functional attributes in the first and third graph structure data can be counted simultaneously, and the second matching degree can be determined based on the total number of both.

[0150] Optionally, when determining the second degree of matching, synonym matching can be performed on the relation attributes.

[0151] Optionally, the matching degree can be calculated separately for relational attributes and functional attributes, and then a weighted sum can be performed to obtain a second matching degree. Specifically, the matching degree of relational attributes and the matching degree of functional attributes are calculated separately, and a weighted sum is performed according to preset weights to obtain a comprehensive second matching degree value.

[0152] It should be noted that when the relation attributes in the first graph structure data are unknown, such as in the form of (Company A, ?, Company B), the position of the unknown relation can be left unconstrained when calculating the second matching degree, or the matching degree of that position can be set to a neutral value.

[0153] In operation S630, a weighted sum of the first and second matching degrees can be performed using a fixed weight coefficient.

[0154] In another feasible implementation, the weighting coefficients can be dynamically adjusted according to the query type. Specifically, when the target input focuses on entity relationship queries, the weighting coefficient of the second matching degree can be increased; when the target input focuses on entity recognition, the weighting coefficient of the first matching degree can be increased.

[0155] Optionally, before performing weighted summation, the first matching degree and the second matching degree can be normalized to ensure that their numerical ranges are consistent, thereby ensuring the rationality of weighted summation.

[0156] Optionally, other adjustment factors can be added to the weighted summation. Specifically, additional parameters such as entity type matching factor and path length factor can be introduced to modify the basic weighted summation result and obtain the final structural similarity.

[0157] It should be noted that the weighting coefficients for the weighted summation can be determined through experimental statistics or machine learning methods. For example, based on historical query data and user feedback, the search performance under different weighting configurations can be statistically analyzed, and the weighting combination that maximizes search accuracy can be selected as the system default configuration.

[0158] By adopting the technical solution of this application, the first matching degree is determined based on the number of matching entity objects, which can quantify the consistency between the first and third graph structure data at the entity level and ensure that the search results include the core entity objects of interest in the query. The second matching degree is determined based on the number of matching attribute features, which can quantify the consistency between the two at the relation type and functional attribute level, ensuring that the search results meet the relation constraints or attribute requirements specified by the query. The structural similarity is obtained by weighted summation of the first and second matching degrees, which can comprehensively consider the dual factors of entity matching and attribute matching, avoid the one-sidedness caused by single-dimensional evaluation, and improve the accuracy of structural similarity calculation and adaptability to different query scenarios.

[0159] Based on the above embodiments, as another optional embodiment, in order to improve the retrieval coverage in scenarios where the graph data is large or where there are long-distance association paths between the target entity and related knowledge nodes, and to avoid the problem of missing related knowledge due to the narrow scope of local subgraphs, the above operation S230 may further include the following operations.

[0160] Operation S710: Match the first vectorized data with the third vectorized dataset to determine the second vectorized data with a higher similarity than the second similarity.

[0161] Correspondingly, the above operation S240 may also include the following operations.

[0162] Operate S720 to obtain the second spectral structure data of the second vectorized data index.

[0163] In operation S710, the third vector dataset refers to a pre-built vector index library containing vectorized representations of all graph structure data in the graph database.

[0164] Optionally, the third vector dataset and the aforementioned second vector dataset can be the same dataset, or they can be independent datasets constructed for different data ranges or different vectorization granularities. When the third vector dataset and the second vector dataset are the same dataset, the matching process in operation S510 is performed across the entire vector data range, and is not limited to the local vector data range obtained through pre-screening via the graph structure.

[0165] In one feasible implementation, the first vectorized data can be used as the query vector, and the similarity between the first vector and each candidate vector can be calculated in the third vector dataset. Vectors with similarity higher than the second similarity threshold can be selected as the second vectorized data.

[0166] Specifically, a vector retrieval algorithm is used to traverse or index the third vector dataset, calculating the cosine similarity, Euclidean distance, or other vector distance metrics between the query vector and candidate vectors. The calculated similarity is then compared with a preset second similarity threshold, and vectors with similarity exceeding the threshold are retained. The second similarity threshold can be configured according to the different requirements of retrieval precision and recall in the application scenario.

[0167] In another feasible implementation, the second vectorized data can be quickly retrieved from the third vector dataset using a vector index structure.

[0168] Optionally, an upper limit can be set on the number of second vectorized data. After similarity ranking, the top K vectors are selected as the second vectorized data, where K is a positive integer. By limiting the number of returned results, the data scale and computational cost of subsequent processing can be controlled while ensuring retrieval quality.

[0169] Optionally, when the first vectorized data contains multiple vectors, each first vectorized data can be matched against the third vector dataset to obtain multiple sets of second vectorized data. These second vectorized data are then merged. The merging process may include deduplication or weighted summation based on the similarity scores of multiple query vectors.

[0170] It should be noted that when matching in the third vector dataset, since the retrieval scope covers the vector representation of the entire graph data, compared with the retrieval within the vector range corresponding to the local subgraph, it can discover knowledge triples that are semantically related to the target input but far away in the graph structure, thereby improving the retrieval recall. However, it may also introduce semantically similar but actually irrelevant noisy data.

[0171] In operation S720, obtaining the second graph structure data of the second vectorized data index refers to searching for and obtaining the corresponding graph structure data in the graph database through the index information associated with the second vectorized data. This can be understood as mapping the vector retrieval results back to the original structured knowledge representation, which is used to provide interpretable knowledge basis for the target input.

[0172] The second vectorized data index refers to the mapping relationship identifier between vector data and graph structure data, which can be understood as the association information that can uniquely determine the graph structure data corresponding to the vector.

[0173] In one feasible implementation, the corresponding second graph structure data can be directly queried in the graph database using the graph structure identifier carried by the second vectorized data.

[0174] Specifically, each vector data in the third vector dataset is associated with a unique identifier for its corresponding graph structure data. This identifier can be the ID of a triple, a combined identifier of an entity object, or a unique number of a relation edge. After obtaining the second vectorized data, its associated graph structure identifier is extracted, and this identifier is used as a query key to perform an index lookup in the graph database, thereby obtaining the complete second graph structure data.

[0175] In another feasible implementation, multiple second graph structure data can be obtained in batches through a mapping table between the vector dataset and the graph database.

[0176] By employing the embodiments of this application, matching and determining second vectorized data with a higher similarity than the second similarity in a third vector dataset using first vectorized data enables semantic retrieval within the vector representation range of the entire knowledge graph. This overcomes the limitations of local subgraph ranges and improves the recall capability for distant related knowledge and implicit semantic relationships. Obtaining the second graph structure data indexed by the second vectorized data allows for accurate mapping of vector retrieval results back to structured knowledge representations. This ensures retrieval coverage while providing interpretable knowledge basis for target input, solving the recall problem that may result from relying solely on graph structure retrieval. Consequently, it enhances the completeness and diversity of retrieval results in complex query scenarios.

[0177] Based on the above embodiments, in order to further transform the retrieved graph structure data into natural and fluent natural language responses to meet the user's actual response needs to the target input, the above processing method may also include the following operations.

[0178] At least the first original data corresponding to the second map structure data is used as the input to the target model in order to obtain the response results of the target model to the target input.

[0179] The first raw data refers to the original text content corresponding to the second graph structure data in the initial data. It can be understood as the document fragments or text blocks from which the graph structure data is extracted, which are used to provide the target model with knowledge basis containing complete contextual information.

[0180] The target model refers to the language generation model used to generate natural language response results. It can be understood as a model that generates text output that conforms to the language expression norms based on the input context, and is used to convert the retrieved knowledge data into natural language answers for the target input.

[0181] It should be noted that the target model can be a mature language generation model from related technologies such as large language models, generative pre-trained models, or sequence-to-sequence generation models. The training methods, network structure design, and parameter configuration of the above-mentioned target model can adopt mature solutions from related technologies, and will not be elaborated on in detail in the embodiments of this application.

[0182] In one feasible implementation, the first raw data corresponding to the second map structure data can be directly used as the input to the target model.

[0183] In another feasible implementation, the first raw data can be combined with the target input to construct the prompt text, which is then input into the target model.

[0184] Optionally, when there are multiple second-map structure data, the multiple first-source data corresponding to the multiple second-map structure data can be used as input to the target model simultaneously.

[0185] Optionally, the first raw data can be preprocessed before being input into the target model. Specifically, the raw text data can be formatted, redundant information removed, and key entities or relationships labeled to make the input data more consistent with the input requirements of the target model.

[0186] Optionally, multiple first original data can be sorted based on the structural similarity or vector similarity of the second graph structure data, and the first original data with the highest similarity ranking can be selected and input into the target model, thereby controlling the scale of the input data while ensuring the quality of the input.

[0187] Optionally, the structured representation of the second graph structure data itself can be used together with the first original data as input to the target model, so that the target model can obtain both the context of natural language description and the structured expression of knowledge, thereby generating more accurate response results.

[0188] It should be noted that the correspondence between the first original data and the second graph structure data is established during the database construction phase. Specifically, when constructing the knowledge graph and vector database, the original text block or document fragment from which each graph structure data is extracted is recorded, and an index mapping relationship is established. This allows the corresponding first original data to be quickly located based on the identifier of the second graph structure data during the retrieval phase.

[0189] By adopting the embodiments of this application, the first original data corresponding to the second graph structure data is used as the input of the target model, which can provide the target model with knowledge basis containing complete contextual information; by using the generation capability of the target model to process the first original data, the structured retrieval results can be transformed into fluent text that conforms to the expression habits of natural language, thereby improving the user interaction experience.

[0190] Based on the above embodiments, as an optional embodiment, in order to supplement the results of vectorized document retrieval while performing graph-based structural data retrieval, and to expand the coverage of knowledge sources, the above processing method may further include the following operations.

[0191] Operation S810 is based on the third vectorized data corresponding to the target input;

[0192] Operation S820: Match the third vector data with the fourth vector data in the third vector dataset that has a higher similarity to the third vector data.

[0193] Operation S830 takes at least the second original data corresponding to the fourth vector data as input to the target model to obtain the response result of the target model to the target input.

[0194] In operation S810, the third vectorized data refers to the vector representation obtained after the target input has undergone vectorization processing.

[0195] In one feasible implementation, the target input text content can be directly input into the text vectorization model to obtain third vectorized data.

[0196] In another feasible implementation, the target input can be preprocessed before vectorization.

[0197] Optionally, the vectorization model used when acquiring the third vectorized data can be consistent with the vectorization model used when constructing the third vector dataset, thereby ensuring that the vector representation of the target input and the document vector representation are comparable in the same vector space.

[0198] It should be noted that the difference between the third vectorized data and the aforementioned first vectorized data is that the first vectorized data is a vector representation of the first graph structure data, used for retrieval at the graph structure level, while the third vectorized data is a vector representation of the target input text, used for retrieval at the original document level.

[0199] In operation S820, the third vector dataset refers to a pre-built vector index library containing vectorized representations of the original documents. It can be understood as a vector database built after vectorizing document fragments or text blocks in the initial data, which is used to support document retrieval based on semantic similarity.

[0200] Similarly, fourth vectorized data refers to vector representations in the third vector dataset that are semantically similar to the third vectorized data. It can be understood as document vectors that are semantically related to the target input, obtained by calculating vector similarity, and used to locate original document fragments containing relevant knowledge.

[0201] In one feasible implementation, the similarity between each document vector and the third vectorized data can be calculated in the third vector dataset, and vectors with similarity higher than the third similarity threshold can be selected as the fourth vectorized data.

[0202] In another feasible implementation, an approximate nearest neighbor search algorithm can be used to quickly retrieve the fourth vectorized data in the third vector dataset.

[0203] Optionally, an upper limit can be set on the number of fourth vectorized data returned. Specifically, the number of results returned during the matching process can be limited, for example, only returning the document vectors of the top K documents with the highest similarity, where K is a positive integer, which can be set according to the context window size of the target model or the requirements of the application scenario.

[0204] It should be noted that the third vector dataset differs from the aforementioned second vector dataset in that the second vector dataset stores vectorized representations of graph structure data, used to support the retrieval of structured knowledge, while the third vector dataset stores vectorized representations of raw document fragments, used to support the retrieval of unstructured text. The two datasets can be constructed and stored independently, or they can share the same vector database in physical storage but be distinguished by different index identifiers.

[0205] In operation S830, the second raw data refers to the original document fragment corresponding to the fourth vectorized data in the initial data. It can be understood as a text block or document paragraph containing relevant knowledge obtained through document vector retrieval, which is used to provide unstructured contextual knowledge supplementation for the target model.

[0206] In one feasible implementation, the corresponding second original data can be found in the document database using the index identifier of the fourth vectorized data.

[0207] In another feasible implementation, the second original data corresponding to multiple fourth vectorized data can be acquired in batches, and these second original data can be summarized and input into the target model.

[0208] Optionally, the first original data corresponding to the second graph structure data and the second original data corresponding to the fourth vectorized data can be used as inputs to the target model, enabling the target model to generate response results by integrating structured knowledge sources and unstructured document sources.

[0209] Optionally, when merging the first and second raw data into the target model, the two types of data can be distinguished and labeled so that the target model can identify knowledge data from different sources.

[0210] Optionally, the first and second original data can be deduplicated. Specifically, when the first and second original data contain duplicate text content, only one copy of the data is input into the target model to avoid redundant information affecting the generation effect.

[0211] By adopting the technical solution of this application, the third vectorized data corresponding to the target input can be obtained, which can convert the user query into a vector form that can be used for document semantic matching; by matching the fourth vectorized data with the third vectorized data in the third vector dataset, text fragments related to the semantics of the target input can be retrieved at the original document level, thus expanding the coverage of knowledge sources; by using the second original data corresponding to the fourth vectorized data as the input of the target model, relevant document information that has not been extracted in a structured manner can be supplemented for the target model.

[0212] Figure 4A flowchart illustrating a database construction method provided in an embodiment of this application is shown.

[0213] like Figure 4 As shown in the illustration, this application also discloses a database construction method. This database construction method includes the following operations.

[0214] Operate S910 to obtain initial data;

[0215] Operate S920 to obtain the initial graph structure corresponding to the initial data; the initial graph structure includes at least two initial entity objects and the relationships between entities.

[0216] Operation S930 vectorizes the initial map structure to obtain the second vector dataset;

[0217] Operation S940 constructs a database based on the initial graph structure and the second vector dataset; the database is used to match the first vectorized data and the second vectorized data corresponding to the target input.

[0218] In operation S910, initial data refers to the original data source used to build the knowledge base, which can be understood as a collection of documents or text corpus containing knowledge information to be extracted.

[0219] For example, the initial data may include various types of structured or unstructured text data such as corporate announcement documents, news reports, technical documents, product manuals, legal contracts, and encyclopedia entries.

[0220] In operation S920, the initial graph structure refers to the structured knowledge representation extracted from the initial data. It can be understood as graph data that organizes knowledge in unstructured text in the form of entities and relations in a structured way.

[0221] Similarly, the initial entity object refers to the entity object identified and extracted from the initial data. The relationship between entities refers to the semantic connection between two entity objects, which is used as edge elements in the knowledge graph.

[0222] In operation S930, vectorization of the initial graph structure refers to converting structured graph data into a numerical representation in a vector space. This can be understood as the encoding process of mapping entity objects, relation types, or complete triples into high-dimensional vectors.

[0223] In one feasible implementation, entity objects in the initial graph structure can be vectorized.

[0224] In another feasible implementation, the complete triples of the initial map structure can be vectorized.

[0225] Optionally, a graph neural network can be used to vectorize the initial graph structure. Specifically, a graph structure containing entity nodes and relation edges is constructed, and a graph neural network is used to perform message passing and feature aggregation on the graph structure to generate entity vectors or triple vectors that incorporate graph structure information.

[0226] It should be noted that the construction of the second vector dataset may include vector generation, index structure establishment, and recording of the mapping relationship between vectors and the original graph structure. Specifically, while generating vector representations, a vector index is established to support efficient retrieval, and the original graph structure identifier corresponding to each vector is recorded so that the original data can be traced back during retrieval.

[0227] In operating S940, a graph database can be used to store the initial graph structure, and a vector database can be used to store the second vector dataset. The two databases can be accessed jointly through a unified query interface.

[0228] In another feasible implementation, a unified hybrid database system can be constructed to manage both graph structure data and vector data simultaneously. Specifically, a hybrid database architecture supporting graph structure storage and vector indexing is designed, maintaining the topological relationships and vectorized representations of the graph structure within the same database system.

[0229] Optionally, a bidirectional mapping relationship can be established between the initial graph structure and the second vector dataset when constructing the database.

[0230] It should be noted that the database is used to match the first vectorized data and the second vectorized data corresponding to the target input. Its specific function can be referred to the relevant description in the above embodiment regarding the retrieval of the second vector data in the second vector dataset based on the first vectorized data, which will not be elaborated on here.

[0231] By adopting the embodiments of this application, the initial graph structure corresponding to the initial data is obtained, which can convert unstructured text into a structured entity relation representation, facilitating accurate knowledge query and reasoning. The initial graph structure is vectorized to obtain a second vector dataset, which can endow the graph data with semantic vector representation, supporting flexible retrieval based on semantic similarity. A database is constructed based on the initial graph structure and the second vector dataset, which can establish a hybrid knowledge base with both structured query and vectorized retrieval capabilities. This realizes the combination of graph structure data and vector semantic data, solves the limitation of traditional knowledge bases that only support a single retrieval mode, and provides complete database support for the above data processing methods.

[0232] Figure 5 The diagram illustrates a system architecture diagram of a database construction and retrieval process provided in an embodiment of this application.

[0233] likeFigure 5 As shown, the technical solution provided in this application includes two core stages: a database construction stage (Ingestion) and a retrieval stage (Search). The database construction stage converts initial data into searchable graph structure data and vectorized data, while the retrieval stage performs a hybrid retrieval in the constructed database based on the target input and generates response results. The two stages achieve data storage and access through a shared graph dataset and vector database.

[0234] In the database construction phase, starting from input 501, the process proceeds sequentially through document segmentation 502, first entity relation extraction 503, and first vectorization processing 504, ultimately constructing a graph dataset 505 and a vector database 506.

[0235] Specifically, input 501 is the initial data for building the knowledge base.

[0236] Document chunking 502 splits the long document in input 501 into multiple shorter text fragments, and divides continuous text into independent processing units according to preset rules.

[0237] The first entity relation extraction 503 identifies and extracts entity objects, relationships between entities, and attribute information from the text blocks obtained from the document segmentation 502, converts unstructured text into structured graph elements, and constructs nodes and edges of the knowledge graph.

[0238] The first vectorization process 504 converts the text blocks obtained from document slicing 502 and the graph structure data obtained from the first entity relation extraction 503 into numerical representations in the vector space, respectively, to support vector similarity matching in the subsequent retrieval stage.

[0239] The graph dataset 505 constructs a knowledge graph storage structure based on the structured data obtained from the first entity relation extraction 503, supporting entity neighbor search and path traversal based on the graph structure during the retrieval stage.

[0240] The vector database 506 stores various types of vector data obtained from the first vectorization process 504. As a vector storage and retrieval system that supports efficient vector similarity retrieval, it supports vector matching based on semantic similarity during the retrieval stage.

[0241] The vector data stored in the vector database 506 includes the following information: vector representation 507, text content corresponding to the vector 508, metadata of the vector 509, and index mapping relationship 510 between the vector and the original data. Specifically, the numerical representation of the vector 507 is used for similarity calculation; the original text content 508 is displayed in the search results or used as input to the target model; the metadata information 509 includes auxiliary information such as document identifiers, text block identifiers, graph structure identifiers, and timestamps; and the index mapping relationship 510 realizes a bidirectional mapping between the vector data and the original documents, text blocks, and graph structure data.

[0242] It should be noted that there is a correlation between the graph dataset 505 and the vector database 506. Specifically, each graph structure data in the graph dataset 505 has a corresponding vectorized representation in the vector database 506, and each graph structure vector in the vector database 506 is located to its corresponding graph structure data in the graph dataset 505 through the index mapping relationship 510. This correlation allows the retrieval stage to utilize both graph structure for precise matching and vector semantics for similarity matching, and to fuse the two retrieval results.

[0243] In the retrieval phase, starting from query 511, the process proceeds sequentially through query rewriting 512, second entity relation extraction 513, searching for entity neighbor nodes in the graph dataset 505 514, second vectorization processing 515, vector matching in the vector database 506 516, triplet structure matching 517, and finally generating output 518.

[0244] Query 511 is a query request or question statement initiated by a user through a terminal device. As natural language text that requires system processing and response, it triggers the subsequent retrieval and result generation process. Query 511 is the same concept as the target input in the aforementioned embodiments.

[0245] The second entity relation extraction 513 parses the rewritten query obtained from query 511 or query rewriting 512, extracts the entity objects, relation types and incomplete triples, identifies the structured representation of the query intent, and performs structured retrieval in the graph dataset 505.

[0246] Searching for neighboring entity nodes 514 involves finding associated entity nodes and their relationship paths in the target entity object obtained from the second entity relationship extraction 513 in the graph dataset 505. Starting from the target entity object, the neighborhood is expanded in the knowledge graph to define the range of local subgraphs related to the query.

[0247] The triplet structure matching 517 performs structure pattern matching on the triplets corresponding to the local subgraph obtained by searching the entity neighbor nodes 514. The incomplete triplets obtained by extracting the second entity relation 513 are used as query patterns. Triplets that satisfy the pattern constraints are searched in the set of triplets of the local subgraph to achieve accurate matching based on the graph structure.

[0248] The second vectorization process 515 vectorizes the query structured representation obtained from the second entity relation extraction 513, converting the entity objects, triples, or query text in the query into numerical representations in the vector space, and performing semantic similarity matching in the vector database 506.

[0249] Vector similarity matching 516 uses the query vector obtained by the second vectorization process 515 in the vector database 506 to retrieve semantically similar candidate vectors. Vector retrieval is performed by calculating the similarity between the query vector and the candidate vectors to find data related to the query at the semantic level.

[0250] Output 518 combines the strong matching result obtained from triplet structure matching 517 and the semantic matching result obtained from vector similarity matching 516 to output the retrieval result. It combines the two retrieval methods of graph structure matching and vector semantic matching to obtain the final answer data, providing the knowledge basis for the target model to generate response results.

[0251] By adopting the collaborative processing flow of the database construction and retrieval stages provided in the embodiments of this application, a hybrid database with both graph structure and vector semantics is established in the construction stage to provide multimodal retrieval data support for the retrieval stage; in the retrieval stage, graph structure matching and vector semantic matching are used simultaneously to give full play to the advantages of the two retrieval methods; through the bidirectional mapping relationship between the graph dataset and the vector database, both structured knowledge representation and complete original text context are provided in the retrieval results, thereby realizing a complete closed loop from original document to knowledge base construction to intelligent retrieval, and thus providing efficient and accurate knowledge retrieval capabilities for intelligent question answering systems based on retrieval enhancement.

[0252] This application also discloses an electronic device, including:

[0253] One or more processors;

[0254] Memory, used to store one or more computer programs;

[0255] One or more processors execute one or more computer programs for: obtaining first spectrogram structure data corresponding to a target input; acquiring first vectorized data corresponding to the first spectrogram structure data; matching the first vectorized data to obtain second vectorized data; determining second spectrogram structure data based on the second vectorized data, and using the second spectrogram structure data as data for generating a response result corresponding to the target input; or

[0256] One or more processors execute one or more computer programs, which are further configured to: obtain initial data; obtain an initial graph structure corresponding to the initial data; the initial graph structure includes at least two initial entity objects and the relationships between the entities; vectorize the initial entity structure to obtain a second vector dataset; construct a database based on the initial graph structure and the second vector dataset; and use the database to match the first vectorized data and the second vectorized data corresponding to the target input.

[0257] Figure 6 This is a block diagram of an electronic device provided in an embodiment of this application. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0258] like Figure 6 As shown, an electronic device according to an embodiment of this application includes a display screen (not shown) and a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a memory 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.

[0259] RAM 603 stores various programs and data required for the operation of the electronic device. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0260] According to embodiments of this application, the electronic device may further include an input / output (I / O) interface 606, and an input / output (I / O) interface 605 is also connected to a bus 604. The electronic device may also include one or more of the following components connected to the input / output (I / O) interface 605: an input device 606 including a keyboard, mouse, etc.; an output device 607 including a cathode ray tube (CRT), liquid crystal display (LCD), display screen, etc., and a speaker, etc.; a memory 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the memory 608 as needed.

[0261] According to embodiments of this application, the method flow according to embodiments of this application can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by processor 601, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0262] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0263] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0264] For example, according to embodiments of this application, a computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0265] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this application. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the methods provided in the embodiments of this application.

[0266] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0267] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0268] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this application can be combined and / or combined in various ways, even if such combinations or combinations are not expressly stated in this application. In particular, the various embodiments and / or features described in the claims of this application may be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

[0269] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this application is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this application, and all such substitutions and modifications should fall within the scope of this application.

Claims

1. A data processing method, comprising: Obtain the first spectral structure data corresponding to the target input; Obtain the first vectorized data corresponding to the first graph structure data; The first vectorized data is matched to obtain the second vectorized data; Based on the second vectorized data, the second graph structure data is determined, and the second graph structure data is used as data to generate the response result corresponding to the target input.

2. The method according to claim 1, wherein obtaining the first spectral structure data corresponding to the target input includes: Obtain the first spectral structure data corresponding to the target input; The first map structure data includes at least one target entity object; Based on the target entity object, multiple first entity objects are matched in the first graph dataset; Obtain the first graph structure data of each of the first entity objects; The step of matching the first vectorized data to obtain the second vectorized data includes: Each of the first vectorized data is matched with the target vectorized data, and a second vectorized data with a similarity higher than the first similarity is determined in each of the first vectorized data; the target vectorized data is the vectorized data corresponding to the target map structure data.

3. The method according to claim 2, wherein obtaining the first vectorized data corresponding to the first spectral structure data comprises selecting one of the following combinations: The first spectral structure data is vectorized to obtain the first vectorized data; Based on the identifier of the first graph structure data, the first vectorized data corresponding to the first graph structure data is obtained from the second vector dataset.

4. The method according to claim 1, wherein matching the first vectorized data to obtain the second vectorized data comprises: The first vectorized data is matched in the third vector dataset to determine the second vectorized data with a similarity higher than the second similarity. The step of determining the second spectral structure data based on the second vectorized data includes: Obtain the second graph structure data of the second vectorized data index.

5. The method according to claim 2, wherein the second vector data is first vectorized data with a similarity higher than the first similarity, and the step of determining the second atlas structure data based on the second vectorized data includes: Determine the structural similarity between the first atlas structure data and each of the third atlas structure data; The third graph structure data is the graph structure data corresponding to each of the second vector data; Based on the structural similarity of each of the first graph structure data, the target vectorized data is determined in the second vector data. Determine the second graph structure data corresponding to the target vectorized data.

6. The method according to claim 5, wherein determining the structural similarity between the first atlas structure data and each of the third atlas structure data comprises: For any first graph structure data, a first matching degree is determined based on the number of first entity objects in the first graph structure data that match those in the third graph structure data; The second matching degree is determined based on the number of attribute features in the first graph structure data that match those in the third graph structure data; the attribute features include relational attributes and / or functional attributes. The first matching degree and the second matching degree corresponding to the first graph structure data are weighted and summed to obtain the structural similarity between the first graph structure data and the third graph structure data.

7. The method according to claim 1, further comprising: At least the first original data corresponding to the second map structure data is used as the input to the target model to obtain the response result of the target model to the target input.

8. The method according to any one of claims 1-7, further comprising: Based on the third vectorized data corresponding to the target input; The third vector data is used to match fourth vector data in the third vector dataset with a similarity higher than the third similarity. At least the second original data corresponding to the fourth vector data is used as the input to the target model to obtain the response result of the target model in response to the target input.

9. A database construction method, comprising: Obtain initial data; Obtain the initial map structure corresponding to the initial data; The initial graph structure includes at least two initial entity objects and the relationships between entities; The initial entity structure is vectorized to obtain a second vector dataset; A database is constructed based on the initial graph structure and the second vector dataset; the database is used to match the first vectorized data and the second vectorized data corresponding to the target input.

10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs; The one or more processors execute the one or more computer programs for: obtaining first atlas structure data corresponding to the target input; and acquiring first vectorized data corresponding to the first atlas structure data. The first vectorized data is matched to obtain the second vectorized data; Based on the second vectorized data, the second spectrogram structure data is determined, and the second spectrogram structure data is used as data to generate the response result corresponding to the target input. or The one or more processors execute the one or more computer programs and are also configured to: obtain initial data; Obtain the initial graph structure corresponding to the initial data; the initial graph structure includes at least two initial entity objects and the relationships between entities; vectorize the initial entity structure to obtain a second vector dataset; construct a database based on the initial graph structure and the second vector dataset; the database is used to match the first vectorized data and the second vectorized data corresponding to the target input.