A double-chain application method based on vector database
Through the combination of vector database and LangChain technology, the problem of link efficiency and accuracy of traditional double-chain structure in large-scale data processing is solved, efficient and accurate content linking and relationship display are achieved, user understanding is enhanced, and the development of double-chain structure is promoted. Innovation and development.
Patent Information
- Application Number
- CN202410126914.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-01-30
AI Technical Summary
The traditional double-chain structure cannot meet the demand for efficient and accurate linking when processing large-scale data. It is especially difficult to establish effective links for content with similar semantics but inconsistent expressions, and the manual link creation process is cumbersome and time-consuming.
Adopting a double-chain application method based on vector database, through data preprocessing, text vectorization, establishing a vector database, constructing a double-chain structure and information indexing, vector similarity analysis and LangChain technology are used to extract key information and establish links, providing relationships Graphic display to enhance user understanding.
It achieves more efficient and accurate content linking and relationship display, reduces reliance on exact matching, improves the efficiency and accuracy of data links, and enhances users' intuitive understanding of data relationships.
Smart Images

Figure CN117971830B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of databases, and in particular to a double-chain application method based on a vector database. Background Art
[0002] In the existing double-chain structure, data links mainly rely on users to create them. This means that users need to actively and accurately describe and mark the content that needs to be linked. However, the limitation of this method is that it over-relies on exact matching, making it difficult to establish effective links for content that is semantically similar but not completely consistent in expression. In addition, the process of manually creating links can be cumbersome and time-consuming, especially when dealing with large amounts of data, which increases the difficulty of using the double-chain structure. Therefore, the traditional double-chain structure is difficult to meet the needs of efficient and accurate links when dealing with large-scale data.
[0003] With the explosive growth of data scale, the traditional double-chain structure faces challenges in efficiency and accuracy when processing these massive data. In order to more effectively meet these challenges, we must not only explore new data processing technologies, but also improve the existing structure. Among them, vector database, as a tool widely used in information retrieval and machine learning, provides new ideas for solving these problems with its efficient similarity search capabilities.
[0004] Based on this, there is an urgent need to develop an innovative dual-chain application. Summary of the invention
[0005] In view of the problems mentioned in the background technology, the purpose of the present invention is to provide a double-chain application method based on a vector database to solve the problems mentioned in the background technology.
[0006] The above technical objectives of the present invention are achieved through the following technical solutions:
[0007] A double-chain application method based on a vector database comprises the following steps:
[0008] S1, data preprocessing;
[0009] S2, data annotation;
[0010] S3, text vectorization;
[0011] S4, establishing a vector database;
[0012] S5, constructing a double-chain structure;
[0013] S6, information indexing;
[0014] S7, relationship diagram display.
[0015] Preferably, the S1 includes the following sub-steps:
[0016] S11. Format conversion: convert unstructured documents into plain text in TXT format;
[0017] S12. Document splitting: Split long text files according to a certain logical structure, including chapter, paragraph or keyword splitting; use natural language processing technology, including word segmentation and named entity recognition technology, during splitting;
[0018] S13. Data cleaning: In the preprocessing stage, remove irrelevant content from the text, including extra spaces, punctuation, footnotes, and directories; this is done through regular expressions or using a specialized text cleaning library to ensure data consistency and accuracy;
[0019] S14. Data normalization: Normalize text data, including unified coding format, text alignment, and removal of special characters.
[0020] Preferably, S2 includes the following sub-steps:
[0021] S21. Use the Prompt integration method based on LangChain technology to extract key information, use LangChain technology to understand the text semantics, and extract key information points from the text through Prompt technology;
[0022] S22. Based on the prompt technology, key information points in the text are identified, including time, place, person, and event, and this information is stored as metadata using structured storage methods.
[0023] S23. Associate metadata with original text files and establish a complete metadata system so that structured data and original text complement each other.
[0024] Preferably, S3 includes the following sub-steps:
[0025] S31, using a vectorization model to convert the text file content into a vector form, so that a computer can understand and process the text data, wherein the vectorization model includes Word2Vec and BERT;
[0026] S32, storage and indexing: storing the structured data and the corresponding vector data together in a vector database, wherein the contents stored in the database include vector representation of the text, metadata and index information.
[0027] Preferably, the S4 includes the following sub-steps:
[0028] S41, creating an index for each text file to quickly retrieve and query key information points and association relationships, wherein the index is based on vector similarity analysis results between files;
[0029] S42. Store the structured metadata and the corresponding vector data in a vector database to form a complete metadata system.
[0030] Preferably, S5 includes the following sub-steps:
[0031] S51. Based on the vector similarity analysis result, select files with a high correlation degree for linking, construct a double-chain structure, and associate the selected files through the links;
[0032] S52, further analyzing the association relationship between the texts based on the similarity calculation results, identifying texts with similar themes and semantics, and establishing a more accurate link relationship;
[0033] S53. Analyze the key points, characters, and events mentioned in the annotation information, integrate the related information into a double-link structure, explain the relationships between linked files according to different types of annotations, identify the hierarchical relationships in the text according to the annotation information, including using parent-child relationships and superior-subordinate relationships to build a hierarchical double-link structure; annotate the entities, concepts, and attributes in the text; annotate the event information in the text and the relationship between events, including event trigger words, participants, and time, to establish the relationship between events in the double-link structure; use sentiment analysis technology to sentimentally annotate the text, identify the sentiment tendency of the text, and establish sentiment-related links in the double-link structure, wherein the sentiment tendency includes positive, negative, or neutral; extract keywords from the text, and use the keywords as link identifiers to link files with similar keywords together; extract the relationships between entities from the text, including character relationships and organizational relationships, and establish corresponding links in the double-link structure.
[0034] Preferably, S6 includes the following sub-steps:
[0035] S61, indexing the linked files for quick retrieval and query, using the indexing function of the vector database to perform indexing;
[0036] S62. Optimize the index structure and query algorithm to further accelerate the retrieval speed of the file.
[0037] Preferably, the S7 includes the following steps:
[0038] S71, displaying the finally generated double-link structure in a relationship diagram, wherein the relationship diagram is used to display the associated files and the associated words or key information points between them;
[0039] S72. Provide interactive function modules for users to explore and query data.
[0040] Preferably, step S8 is added after the data preprocessing stage and before the data labeling stage, and S8 is an operation of adding, deleting, modifying and checking the data, including the following:
[0041] S81, adding data: when new text data is added, it needs to be pre-processed and vectorized first, and then added to the vector database, and a new double-chain link is established based on the similarity analysis results;
[0042] S82. Delete data: For double-linked links or text files that are no longer needed, delete them from the vector database and update the related index and metadata information to maintain data accuracy and consistency; the data deleted from the text will be removed from the relationship graph to ensure that the relationship graph is updated in real time;
[0043] S83, modify data: For the text file or double-chain link that needs to be modified, perform necessary modification operations, including content update, label modification, and then re-vectorize and update to the vector database. At the same time, recalculate the double-chain link related to the file and update the index information;
[0044] S84. Query operation: The query function module allows the user to quickly locate the required data points and highlight, enlarge or mark the query results in the relationship diagram.
[0045] In summary, the present invention mainly has the following beneficial effects:
[0046] The present invention provides a double-chain application based on a vector database, aiming to solve the link efficiency and accuracy problems existing in the existing double-chain structure. By combining the similarity search capability of the vector database, it is possible to establish links between contents more efficiently and accurately, and add a relationship display function, so that users can understand the relationship between data more intuitively.
[0047] The highlight of the invention of this patent is that it creatively combines the vector database with the double-chain structure, completely getting rid of the traditional double-chain structure's reliance on precise matching. By utilizing the similarity judgment ability of the vector database, it is possible to accurately judge whether two contents can be connected, greatly improving the efficiency and accuracy of data links. This combination is one of the notable features of this patent, which makes the present invention significantly innovative and superior compared to the existing double-chain structure technology. In addition, this patent adds a relationship display function, allowing users to understand the relationship between data more intuitively, further enhancing users' understanding of the data. Finally, this patent brings new development space for the double-chain structure, which can be combined with other advanced technologies to further expand its application in the fields of data processing and information retrieval. This extensibility makes the present invention not only have practical application value, but also have potential market prospects and development space.
[0048] The patented dual-chain application based on vector database realizes efficient and accurate content linking and relationship display by combining the similarity search capability of vector database. This innovative dual-chain application will bring revolutionary changes to the fields of data processing and information retrieval, and meet the needs of modern data processing for efficiency, accuracy and intuition. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a structural block diagram of a double-chain application based on a vector database;
[0050] Figure 2 It is a schematic diagram of the principle of double-chain application based on vector database;
[0051] Figure 3 This is the final presentation of the double-chain application based on the vector database. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example 1
[0053] refer to Figure 1-Figure 3 , a double-chain application method based on a vector database, the specific implementation method is as follows:
[0054] S1. Data preprocessing:
[0055] S11. Format conversion: The original data may come from different document formats, such as Word, PDF, XML, Excel, etc. First, convert these unstructured documents into plain text in TXT format for subsequent processing.
[0056] S12. Document splitting: For longer text files, they need to be split according to a certain logical structure, such as by chapter, paragraph, or keyword. This step requires the use of natural language processing techniques, such as word segmentation and named entity recognition, to assist the splitting process. The split parts should remain meaningful and complete.
[0057] S13. Data cleaning: In the preprocessing stage, it is necessary to remove irrelevant content in the text, such as extra spaces, punctuation, footnotes, directories, etc. This is usually done through regular expressions or using a specialized text cleaning library. The purpose of data cleaning is to ensure the consistency and accuracy of the data.
[0058] S14. Data normalization: Normalize text data, including unified coding format, text alignment, removal of special characters, etc., to improve the efficiency and accuracy of subsequent processing.
[0059] S2. Data annotation:
[0060] S21. Extract key information using the Prompt integration method based on LangChain technology. This step mainly uses LangChain technology to understand the text semantics and extract key information points from the text using Prompt technology.
[0061] S22. Based on the prompt technology, key information points in the text are identified, such as time, place, person, event, etc. This information will be structured and stored as metadata for subsequent query and analysis.
[0062] S23. The key information extracted by structured data is stored as metadata and associated with the original text file. In this way, a complete metadata system can be established to make the structured data and the original text complement each other.
[0063] S3, text vectorization:
[0064] S31. Use advanced vectorization models (such as Word2Vec, BERT, etc.) to convert text file contents into vector form. This will enable computers to understand and process text data.
[0065] S32, storage and indexing: The structured data and the corresponding vector data are stored together in the vector database. The database not only stores the vector representation of the text, but also stores metadata and index information. This can improve the efficiency and accuracy of subsequent processing.
[0066] S4. Establish vector database:
[0067] S41. Create an index for each text file to quickly retrieve and query key information points and associations. These indexes are based on the vector similarity analysis results between files.
[0068] S42. The structured metadata and the corresponding vector data are stored in the vector database to form a complete metadata system. At the same time, the query structure and algorithm of the database are optimized to further improve the file retrieval speed and user experience.
[0069] S5. Constructing a double-chain structure:
[0070] S51. Based on the vector similarity analysis result, select files with a high correlation to link. In this way, a double chain structure can be constructed, that is, the selected files are linked together through links.
[0071] S52. Further analyze the association relationship between the texts based on the similarity calculation results. Texts with similar themes and semantics can be identified, thereby establishing a more accurate link relationship.
[0072] S53. Analyze the key points, characters, events, etc. mentioned in the annotation information, and integrate these related information into the double-link structure to make the structure more complete and accurate. According to different types of annotations, explain the relationship between the linked files. For example: identify the hierarchical relationship in the text, such as parent-child relationship, superior-subordinate relationship, etc., according to the annotation information, and build a hierarchical double-link structure; annotate the entities, concepts and attributes in the text to identify and link files with similar attributes or characteristics in the double-link structure; annotate the event information in the text and the relationship between events, such as event trigger words, participants, time, etc., to establish the relationship between events in the double-link structure; use sentiment analysis technology to sentimentally annotate the text, identify the sentiment tendency of the text (positive, negative or neutral), and thus establish sentiment-related links in the double-link structure; extract keywords from the text, and use these keywords as link identifiers to link files with similar keywords together; extract the relationship between entities from the text, such as character relationship, organizational relationship, etc., and establish corresponding links in the double-link structure.
[0073] S6. Information indexing:
[0074] S61. Indexing the linked files for quick retrieval and query. By using the indexing function of the vector database, the query efficiency can be greatly improved.
[0075] S62: By optimizing the index structure and query algorithm, the file retrieval speed is further accelerated to provide a better user experience, thereby providing users with more efficient and accurate query services.
[0076] S7, relationship diagram display:
[0077] S71, displaying the finally generated double-chain structure in a relationship diagram. The relationship diagram can clearly display the associated files and the associated words or key information points between them.
[0078] S72. Provide rich interactive functions to enable users to easily explore and query data. For example, users can zoom in or out of the relationship diagram, view detailed information, or perform further search operations. This makes it easier for users to understand and query data.
[0079] S8. In the dual-chain application method based on the vector database, the addition of data addition, deletion, modification and query operations can be performed after the data preprocessing stage and before the data annotation stage. The specific implementation steps are as follows:
[0080] S81. Adding data: When new text data is added, it needs to be preprocessed and vectorized before adding it to the vector database. At the same time, a new double-chain link is established based on the similarity analysis results.
[0081] S82. Delete data: For double-linked links or text files that are no longer needed, they can be deleted from the vector database. At the same time, the relevant index and metadata information needs to be updated to maintain data accuracy and consistency. Data deleted from the text will be removed from the relationship graph to ensure that the relationship graph is updated in real time.
[0082] S83, modify data: For the text file or double-chain link that needs to be modified, first perform the necessary modification operations (such as content update, label modification, etc.), then re-vectorize and update to the vector database. At the same time, it is necessary to recalculate the double-chain link related to the file and update the index information.
[0083] S84. Query operation: Provides query function, allowing users to quickly locate required data points. Query results can be highlighted, enlarged or marked in the relationship diagram to improve query efficiency and user experience.
[0084] Through the above steps, the dual-chain application method based on vector database of this patent can realize efficient and accurate processing and linking of text data, and provide a more intuitive display of data relationships.
[0085] The technical effects of the present invention are mainly reflected in the following aspects:
[0086] Efficient information extraction and processing: This patent uses advanced algorithms and models to quickly process large amounts of unstructured text data, and identify and extract key information, such as entities, relationships, and sentiments. This not only greatly improves the efficiency of information processing, but also reduces the error rate that may occur in information extraction, ensuring the accuracy of data analysis and use.
[0087] Constructing an accurate double-chain structure: Based on in-depth analysis of unstructured text data, this patent can accurately construct a double-chain structure between files. This structured link not only makes the relationship between data clearer, but also helps to discover valuable associations hidden in the data. This structured link not only improves the readability and ease of use of data, but also helps users better understand the data and make more informed decisions.
[0088] Efficient indexing and retrieval: Based on the construction of the double-link structure, this patent also provides an efficient indexing and query mechanism. Users can quickly retrieve and query linked files to obtain the required information. This efficient indexing and query mechanism greatly improves the efficiency of data retrieval and provides users with a better user experience. It enables users to find the required information faster, reduce search time, and thus use data more efficiently.
[0089] The present invention enables intuitive data display: In order to better help users understand and use data, this patent provides a visual display method. Through the relationship diagram, the double-chain structure can be clearly displayed. This visual display method allows users to intuitively understand the relationship and structure between data, so as to better mine and understand the information in the data. It not only improves the readability of data, but also helps users better discover and understand patterns and trends in data.
[0090] The application used in the present invention can cleverly combine the similarity search capability of the vector database, so as to more efficiently and accurately establish links between contents. The present invention solves the link efficiency and accuracy problems existing in the existing double-chain structure. By combining the similarity search capability of the vector database, it is possible to more efficiently and accurately establish links between contents, and add a relationship display function, so that users can more intuitively understand the relationship between data.
[0091] The highlight of the invention of this patent is that it creatively combines the vector database with the double-chain structure, completely getting rid of the traditional double-chain structure's reliance on precise matching. By utilizing the similarity judgment ability of the vector database, it is possible to accurately judge whether two contents can be connected, greatly improving the efficiency and accuracy of data links. This combination is one of the notable features of this patent, which makes the present invention significantly innovative and superior compared to the existing double-chain structure technology. In addition, this patent adds a relationship display function, allowing users to understand the relationship between data more intuitively, further enhancing users' understanding of the data. Finally, this patent brings new development space for the double-chain structure, which can be combined with other advanced technologies to further expand its application in the fields of data processing and information retrieval. This extensibility makes the present invention not only have practical application value, but also have potential market prospects and development space.
[0092] In summary, the dual-chain application based on the vector database of this patent realizes efficient and accurate content linking and relationship display by combining the similarity search capability of the vector database. This innovative dual-chain application will bring revolutionary changes to the fields of data processing and information retrieval, and meet the needs of modern data processing for efficiency, accuracy and intuition.
[0093] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A double-chain application method based on a vector database, characterized in that: The following steps are involved: S1, data preprocessing; S2, data annotation; S3, text vectorization; S4, establishing a vector database; S5, constructing a double-chain structure; S6, information indexing; S7, relationship diagram display; The S1 includes the following sub-steps: S11. Format conversion: convert unstructured documents into plain text in TXT format; S12. Document splitting: Split long text files according to a certain logical structure, including chapter, paragraph or keyword splitting; use natural language processing technology, including word segmentation and named entity recognition technology, during splitting; S13. Data cleaning: In the preprocessing stage, remove irrelevant content from the text, including extra spaces, punctuation, footnotes, and directories; this is done through regular expressions or using a specialized text cleaning library to ensure data consistency and accuracy; S14, data normalization processing: normalize text data, including unified coding format, text alignment, and removal of special characters; The S5 includes the following sub-steps: S51. Based on the vector similarity analysis result, select files with a high correlation degree for linking, construct a double-chain structure, and associate the selected files through the links; S52, further analyzing the association relationship between the texts based on the similarity calculation results, identifying texts with similar themes and semantics, and establishing a more accurate link relationship; S53, analyzing the key points, characters, and events mentioned in the annotation information, integrating the related information into a double-link structure, providing relationship descriptions for linked files according to different types of annotations, identifying hierarchical relationships in the text according to the annotation information, including building a hierarchical double-link structure using parent-child relationships and superior-subordinate relationships; annotating entities, concepts, and attributes in the text; annotating event information in the text and the relationship between events, including event trigger words, participants, and time, to establish associations between events in the double-link structure; Use sentiment analysis technology to emotionally annotate text, identify the sentiment tendency of the text, and establish sentiment-related links in the double-link structure. The sentiment tendency includes positive, negative or neutral; extract keywords from the text, and use the keywords as link identifiers to link files with similar keywords together; extract the relationships between entities from the text, including character relationships and organizational relationships, and establish corresponding links in the double-link structure.
2. A double-chain application method based on a vector database according to claim 1, characterized in that: The S3 includes the following sub-steps: S31, using a vectorization model to convert the text file content into a vector form, so that a computer can understand and process the text data, wherein the vectorization model includes Word2Vec and BERT; S32, storage and indexing: storing the structured data and the corresponding vector data together in a vector database, wherein the contents stored in the database include vector representation of the text, metadata and index information.
3. The double-chain application method based on vector database according to claim 1, characterized in that: The S4 includes the following sub-steps: S41, creating an index for each text file to quickly retrieve and query key information points and association relationships, wherein the index is based on vector similarity analysis results between files; S42. Store the structured metadata and the corresponding vector data in a vector database to form a complete metadata system.
4. The double-chain application method based on vector database according to claim 1, characterized in that: The S6 includes the following sub-steps: S61, indexing the linked files for quick retrieval and query, using the indexing function of the vector database to perform indexing; S62. Optimize the index structure and query algorithm to further accelerate the retrieval speed of the file.
5. The double-chain application method based on vector database according to claim 1, characterized in that: The S7 includes the following steps: S71, displaying the finally generated double-link structure in a relationship diagram, wherein the relationship diagram is used to display the associated files and the associated words or key information points between them; S72. Provide interactive function modules for users to explore and query data.
6. The double-chain application method based on vector database according to claim 1, characterized in that: After the data preprocessing stage and before the data labeling stage, step S8 is added, which is the operation of adding, deleting, modifying and checking the data, including the following: S81, adding data: when new text data is added, it needs to be pre-processed and vectorized first, and then added to the vector database, and a new double-chain link is established based on the similarity analysis results; S82. Delete data: For double-linked links or text files that are no longer needed, delete them from the vector database and update the related index and metadata information to maintain data accuracy and consistency; the data deleted from the text will be removed from the relationship graph to ensure that the relationship graph is updated in real time; S83, modify data: for the text file or double-chain link that needs to be modified, perform necessary modification operations, including content update, label modification, and then re-vectorize and update to the vector database; at the same time, recalculate the double-chain link related to the file and update the index information; S84. Query operation: The query function module allows the user to quickly locate the required data points and highlight, enlarge or mark the query results in the relationship diagram.
Citation Information
Patent Citations
Double-chain application method based on dot matrix technology and vector database
CN117971829A
KR20200117542A
