A device full life cycle knowledge distributed retrieval method

By using a combined index structure of HashMap and B+ tree in a distributed system, the issues of access efficiency and hotspots in device lifecycle knowledge retrieval are resolved, achieving efficient and fast distributed retrieval.

CN119884208BActive Publication Date: 2026-01-13CHINA ORDNANCE EQUIP GRP AUTOMATION RES INST CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411899187.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2026-01-13
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In distributed systems, existing technologies struggle to efficiently perform distributed retrieval of device lifecycle knowledge, especially when multiple machines access index files, where access efficiency is limited and frequent read/write operations can lead to hotspot issues.

Method used

It adopts a combined index structure of HashMap and B+ tree, and binds keywords to machine nodes through a hash function. Each keyword is stored on a specific machine, and the client only needs to send a request to one node, avoiding cross-node communication.

Benefits of technology

It enables fast retrieval even under unstable communication conditions, reduces communication volume, is suitable for distributed systems with high communication costs, and improves retrieval efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884208B_ABST
    Figure CN119884208B_ABST
Patent Text Reader

Abstract

The application discloses a kind of equipment full life cycle knowledge distributed retrieval method, it is related to knowledge retrieval technical field, this method uses HashMap and B+ tree to realize inverted index, when equipment full life cycle knowledge distributed retrieval, client only needs to send request to a node, avoid multiple node communication, each keyword is only stored in the machine corresponding to a node, without merging cross node data, and communication volume is greatly reduced.Simultaneously, under the condition that communication is unstable, fast retrieval can be realized, and it is suitable for efficient retrieval under the condition that communication cost between distributed systems is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge retrieval technology, and in particular to a distributed knowledge retrieval method for the entire lifecycle of a device. Background Technology

[0002] In distributed systems with multi-source, heterogeneous data, indexing using lists in inverted files provides an efficient way to locate relevant documents, making it a core data structure for large-scale search engines and social networks. The principle behind inverted indexing based on inverted files is to store an ordered list of document identifiers for each term appearing in a document. When a keyword is used in a query, it can retrieve all relevant identifiers for documents containing all or at least one of these terms.

[0003] There are two problems with indexing large-scale data: First, when the index file is stored on a single machine, the access efficiency is limited by the performance of the machine when multiple machines access it; second, when accessing storage resources based on the index file, frequent read and write operations may lead to hotspot problems.

[0004] Patent document CN1536509A discloses an inverted index storage method based on inverted files. This method includes multiple fixed-size index blocks, each index block comprising multiple fixed-size index units, and each index unit storing one piece of index information. Based on the index structure of the inverted file, this invention proposes an online insertion, online deletion, and online integration indexing mechanism. Furthermore, since multiple index units in each index block are only used to store index information related to the same index entry, this method proposes an online update method to avoid affecting other index entries. However, this method does not address how to perform inverted indexing when data files are distributed across multiple processors.

[0005] For example, the characteristics of equipment lifecycle knowledge are that the data collected is widely dispersed throughout the entire process from equipment procurement to disposal. Due to the interconnection problems between local area networks, wide area networks, and the Internet, the communication costs between servers storing knowledge are uncertain. Therefore, it is necessary to optimize the inverted index structure to adapt to the challenges faced by equipment lifecycle knowledge, that is, to perform distributed indexing on widely dispersed and autonomously isolated storage resources. Summary of the Invention

[0006] In view of the above problems, the present invention provides a distributed retrieval method for knowledge throughout the entire lifecycle of a device to overcome or at least partially solve the above problems.

[0007] This invention provides the following solution:

[0008] A distributed knowledge retrieval method for the entire lifecycle of a device is applied to a distributed system. The distributed system includes several nodes, each node comprising at least one machine, and the machines within each node are communicably connected to each other. Each machine stores inverted index data for all machines in the distributed system. Each machine has a HashMap, where the keys and values ​​are keywords and B+ trees, respectively. The B+ tree stores a keyword and its corresponding metadata. Different B+ trees are stored in different machine HashMaps. The keyword hash value of the B+ tree stored on each machine is the same as a preset hash value corresponding to that machine. The keyword hash value is calculated by combining the keyword with a preset hash function. The method includes:

[0009] Get the collection of documents on the current machine, where the current machine is any one of all the machines in the distributed system;

[0010] The document collection is traversed to extract keywords from each document in the document collection to obtain at least one keyword to be created;

[0011] Obtain the document ID and metadata corresponding to each of the keywords to be created;

[0012] For each keyword to be created, a corresponding B+ tree is created; the metadata corresponding to each keyword to be created is inserted into the corresponding B+ tree;

[0013] The hash function is used to calculate the hash value of each keyword to be created.

[0014] The machine to which each keyword to be created belongs is determined based on the relationship between each keyword hash value and all the preset hash values;

[0015] The B+ tree corresponding to each keyword to be created and the corresponding document ID are sent to the HashMap on their respective machines for storage;

[0016] After the traversal is complete, the inverted index data generated by the current machine is sent to all the machines in the distributed system except the current machine;

[0017] The query client receives a query request input by the user, and the query client can be any one of all the machines in the distributed system;

[0018] The query hash value of the keyword to be queried contained in the query request is calculated using the hash function.

[0019] The query request is sent to the target machine corresponding to the preset hash value that is the same as the query hash value, where the target machine is any one of all the machines in the distributed system;

[0020] The target machine performs a hash lookup to locate all documents in the B+ tree corresponding to the query keyword, and returns all document IDs and corresponding metadata.

[0021] Preferably, the metadata includes word frequency, user access frequency, and word position.

[0022] Preferably, the documents corresponding to each keyword are sorted in the corresponding B+ tree according to the user access frequency.

[0023] Preferably: when a new document is inserted on the current machine, the new document is segmented and at least one new keyword is extracted;

[0024] The hash value of each new keyword is calculated using the hash function.

[0025] Obtain the document ID and metadata corresponding to each new keyword;

[0026] Determine whether each of the aforementioned new keywords already exists;

[0027] Insert the metadata corresponding to the new keyword that already exists into the corresponding B+ tree;

[0028] If it is determined that the new keyword does not exist, a new B+ tree is initialized for each new keyword that does not exist, and the metadata corresponding to each new keyword is inserted into the corresponding new B+ tree.

[0029] The machine to which each new keyword belongs is determined based on the relationship between the hash value of each new keyword and all the preset hash values;

[0030] The new B+ tree corresponding to each new keyword and the corresponding document ID are sent to the HashMap on their respective machines for storage.

[0031] Preferably: Extract a list of keywords from the documents to be deleted;

[0032] The hash function is used to calculate the machine to which the keyword to be deleted belongs; the deletion command and the corresponding keyword are sent to other nodes storing the keyword;

[0033] Upon receiving a delete command, it iterates through each keyword to be deleted, searches for the corresponding B+ tree for each keyword, and deletes the entry for the document corresponding to each keyword in the B+ tree.

[0034] Preferably, the document is used to store fault knowledge throughout the entire lifecycle of the device.

[0035] Preferably, the hash function is as follows:

[0036] NodeID = h(keyword)mod X

[0037] In the formula: X is the number of machine nodes in the distributed system, keyword is the key, h(·) is the hash function, and NodeID is the node in the distributed system.

[0038] Preferably, the hash function h(·) includes any one of the following algorithms: SHA-1, MD5, CRC, Lookup3, and MurmurHash3.

[0039] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0040] This application provides a distributed retrieval method for device lifecycle knowledge. It uses a HashMap and B+ tree to implement an inverted index. During distributed retrieval of device lifecycle knowledge, the client only needs to send a request to one node, avoiding multi-node communication. Each keyword is stored on only the machine corresponding to one node, eliminating the need to merge cross-node data and significantly reducing communication volume. Furthermore, it enables fast retrieval even under unstable communication conditions, making it suitable for efficient retrieval under conditions where communication costs between distributed systems are high.

[0041] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0043] Figure 1 This is a keyword t provided in the embodiments of the present invention. i A schematic diagram of a B+ tree;

[0044] Figure 2 This is a schematic diagram of the distributed index built by each machine according to an embodiment of the present invention. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.

[0046] See Figure 1 This invention provides a distributed knowledge retrieval method for the entire lifecycle of a device, as exemplified by this embodiment. Figure 1 As shown, this method is applied to a distributed system, which includes several nodes, each node including at least one machine, and the machines in each node are communicable and interconnected. Each machine stores inverted index data of all machines in the distributed system. Each machine is equipped with a HashMap, where the keys and values ​​are keywords and B+ trees, respectively. The B+ tree stores a keyword and its corresponding metadata. Different B+ trees are stored in different machine HashMaps, and the keyword hash value of the B+ tree stored on each machine is the same as the preset hash value corresponding to that machine. The keyword hash value is calculated by combining the keyword with a preset hash function. The method may include:

[0047] Get the collection of documents on the current machine, where the current machine is any one of all the machines in the distributed system;

[0048] The document collection is traversed to extract keywords from each document in the document collection to obtain at least one keyword to be created;

[0049] Obtain the document ID and metadata corresponding to each keyword to be created; in specific implementations, the metadata may include word frequency, user access frequency and word position.

[0050] A corresponding B+ tree is created for each keyword to be created; the metadata corresponding to each keyword to be created is inserted into the corresponding B+ tree; in a specific implementation, the embodiments of this application can provide that each document corresponding to each keyword is sorted in the corresponding B+ tree according to the user access frequency.

[0051] The hash function is used to calculate the hash value of each keyword to be created.

[0052] The machine to which each keyword to be created belongs is determined based on the relationship between each keyword hash value and all the preset hash values;

[0053] The B+ tree corresponding to each keyword to be created and the corresponding document ID are sent to the HashMap on their respective machines for storage;

[0054] After the traversal is complete, the inverted index data generated by the current machine is sent to all the machines in the distributed system except the current machine;

[0055] The query client receives a query request input by the user, and the query client can be any one of all the machines in the distributed system;

[0056] The query hash value of the keyword to be queried contained in the query request is calculated using the hash function.

[0057] The query request is sent to the target machine corresponding to the preset hash value that is the same as the query hash value, where the target machine is any one of all the machines in the distributed system;

[0058] The target machine performs a hash lookup to locate all documents in the B+ tree corresponding to the query keyword, and returns all document IDs and corresponding metadata.

[0059] The distributed retrieval method for device lifecycle knowledge provided in this application can be applied to distributed retrieval under widely dispersed and autonomously isolated storage resources. Indexing large-scale data presents two problems: first, when the index file is stored on a single machine, access efficiency is limited by the performance of that machine when multiple machines access it; second, frequent read and write operations when accessing storage resources based on the index file may lead to hotspot issues. The retrieval method provided in this application can achieve fast retrieval even under unstable communication conditions, and is suitable for efficient retrieval under conditions where communication costs between distributed systems are high. Based on this inverted index structure, update, deletion, and retrieval operations are proposed.

[0060] The method provided in this application offers an improved inverted index structure that combines HashMap and B+ tree methods, fully leveraging the fast location capability of HashMap and the efficient range query characteristics of B+ tree. The inverted list is stored using a HashMap, where the key is the keyword and the value is the corresponding inverted list, as shown in Table 1.

[0061] Table 1 Local Hash Table

[0062] Key Value <![CDATA[t1]]> <![CDATA[B+ tree constructed from DocID and MetaData corresponding to the t1 term]]> … …… <![CDATA[t n ]]> <![CDATA[t n A B+ tree constructed from the DocID and MetaData corresponding to each term.

[0063] Use a B+ tree for storage and sort by user access frequency. An example of a B+ tree is shown below. Figure 1As shown in the figure. This structure can perform fast keyword positioning, supports range queries and sorting, and is highly flexible, but it requires additional storage overhead. It is suitable for the scenario proposed by this method, namely, the retrieval of fault knowledge throughout the entire life cycle of a device.

[0064] When a new document needs to be inserted, embodiments of this application can provide, when it is determined that a new document is to be inserted on the current machine, to perform word segmentation on the new document and extract at least one new keyword;

[0065] The hash value of each new keyword is calculated using the hash function.

[0066] Obtain the document ID and metadata corresponding to each new keyword;

[0067] Determine whether each of the aforementioned new keywords already exists;

[0068] Insert the metadata corresponding to the new keyword that already exists into the corresponding B+ tree;

[0069] If it is determined that the new keyword does not exist, a new B+ tree is initialized for each new keyword that does not exist, and the metadata corresponding to each new keyword is inserted into the corresponding new B+ tree.

[0070] The machine to which each new keyword belongs is determined based on the relationship between the hash value of each new keyword and all the preset hash values;

[0071] The new B+ tree corresponding to each new keyword and the corresponding document ID are sent to the HashMap on their respective machines for storage.

[0072] When it is necessary to delete existing documents, embodiments of this application can provide a list of keywords for extracting the documents to be deleted;

[0073] The hash function is used to calculate the machine to which the keyword to be deleted belongs; the deletion command and the corresponding keyword are sent to other nodes storing the keyword;

[0074] Upon receiving a delete command, it iterates through each keyword to be deleted, searches for the corresponding B+ tree for each keyword, and deletes the entry for the document corresponding to each keyword in the B+ tree.

[0075] It is understood that the method provided in this application embodiment is applicable to document storage and retrieval in various distributed systems. For example, in one implementation, this application embodiment can provide the document for storing knowledge of the entire lifecycle of the storage device.

[0076] In the method provided in this application embodiment, the relationship between the hash value obtained by calculating the hash value using a hash function and a preset hash value is used to determine the machine to which each keyword belongs. Specifically, in this application embodiment, the hash function can be provided as shown in the following formula:

[0077] NodeID = h(keyword)mod X

[0078] In the formula: X is the number of machine nodes in the distributed system, keyword is the key, h(·) is the hash function, and NodeID is the node in the distributed system.

[0079] Furthermore, the hash function h(·) includes any one of the following algorithms: MurmurHash3, SHA-1, MD5, CRC, and Lookup3.

[0080] The method provided in this application will be described in detail below.

[0081] This invention provides a method for initially constructing an index on each machine based on the improved inverted index structure.

[0082] Step 1: Create an empty HashMap to store keywords and their corresponding B+ trees;

[0083] Step 2: Traverse the document collection and extract a keyword list for each document;

[0084] Step 3: Initialize a new B+ tree, using the keyword as the key and the B+ tree as the value. Calculate the machine corresponding to the distributed system node to which the keyword belongs using a hash function, and record the document ID and metadata (MetaData) corresponding to the keyword. The metadata includes term frequency (TF), user access frequency (UAF), and word position (POS). Insert the keyword and its metadata into the corresponding B+ tree.

[0085] Step 4: After the traversal is complete, send the locally generated inverted index data to the machines of other nodes to ensure data consistency across all nodes in the distributed system.

[0086] The time complexity analysis follows. Suppose the document set contains N documents, each document contains an average of M terms, and the number of documents associated with each term in the inverted index is D. Then, term parsing takes O(N·M), HashMap insertion or lookup has a time complexity of O(1), and a total lookup for each term takes O(N·M). The time complexity of B+ tree insertion is O(log D), where D is the length of the inverted list corresponding to each term, and the total number of insertions is O(N·M). Therefore, for index construction on a single machine, the time is O(N·M) + O(N·M) + O(N·M·log D) = O(N·M·log D).

[0087] The space complexity is analyzed below. A HashMap needs to store a pointer or reference for each term, resulting in a space complexity of O(K), where K is the total number of terms. The number of nodes in each B+ tree depends on the length D of the inverted list and the order B of the B+ tree. Assuming an average of K terms and an average inverted list length D for each term, the total number of nodes is O(K·D / B). Each inverted list needs to store the document ID and metadata, resulting in a space complexity of O(K·D). In summary, under the condition that D / B << D, the space complexity required for an inverted index on a single machine is O(K·D).

[0088] This application also provides an index insertion method based on the improved inverted index structure.

[0089] Step 1: When inserting a new document, perform word segmentation and extract new keywords.

[0090] Step 2: Calculate the machine corresponding to the distributed system node to which the keyword belongs using a hash function. Generate metadata (MetaData) for each new keyword, including term frequency (TF), user access frequency (UAF), and word position (POS). The user access frequency is initialized to 0. Send the locally generated inverted index data to the machines on other nodes.

[0091] Step 3: On each machine in the distributed system, for each received data, iterate through each new keyword. If the new keyword does not exist, initialize a new B+ tree, using the keyword as the key and the B+ tree as the value, and insert it into a HashMap. If the keyword already exists, insert the document ID and metadata corresponding to the new keyword into the corresponding B+ tree.

[0092] The time complexity analysis is as follows. Suppose the document has M terms, term parsing takes O(M), and the time complexity of inserting each term into the B+ tree is O(log D), where D is the length of the inverted list corresponding to each term. The total complexity is O(M·log D).

[0093] The space complexity analysis is as follows. Each keyword requires an additional document entry, resulting in a space complexity of O(M).

[0094] This application also provides an index deletion method on each machine based on the improved inverted index structure.

[0095] Step 1: Extract a list of keywords from the documents that need to be deleted.

[0096] Step 2: Calculate the distributed system node to which the keyword belongs using a hash function. Send the locally generated inverted index data to other nodes.

[0097] Step 3: On each machine in the distributed system, traverse each keyword, find the corresponding B+ tree for the keyword, and delete the entry for the document in the B+ tree.

[0098] The time complexity analysis is as follows. Suppose the document has M terms, term parsing takes O(M), and the time complexity of deleting an entry from the B+ tree for each term is O(log D), where D is the length of the inverted list corresponding to each term. The total complexity is O(M·log D).

[0099] This application also provides a keyword-based query method based on the improved inverted index structure.

[0100] Step 1: The machine that submitted the query (hereinafter referred to as the client) directly locates the machine to which the keyword belongs based on the hash algorithm;

[0101] Step 2: The client sends the query request to the machine that stores the target keywords;

[0102] Step 3: The machine performs a hash lookup to locate all documents in the B+ tree, that is, to traverse the records of the leaf nodes, and returns all document IDs and their metadata.

[0103] The time complexity of hash lookup is O(1), and traversing the leaf nodes of the B+ tree is O(D), where D is the length of the inverted list, for a total time complexity of O(D). During the query process, only the results need to be stored, resulting in a space complexity of O(K), where K is the number of documents returned.

[0104] The following example illustrates the method provided in this application embodiment, using the case where the knowledge of faults throughout the entire lifecycle is distributed across 5 machines and there are 10 English documents.

[0105] The equipment's entire lifecycle fault knowledge is distributed across 5 machines, with 10 English documents, namely Doc1, Doc2, ..., Doc10, and two English documents are stored on each machine.

[0106] For example, Doc1 contains the question: "Who are you?" and Doc2 contains the question: "Where are you from?". Doc1 and Doc2 are stored on machine Machine1. Doc1 and Doc2 are accessed 3 times by a user. The steps for building the inverted index on machine Machine1 (NodeID=0) are as follows:

[0107] Create an empty HashMap to store the keywords and their corresponding B+ trees;

[0108] Iterate through Doc1 and Doc2, and extract a keyword list for each document. The keyword list is: {Who, are, you, ?, Where, from}.

[0109] If the keyword does not exist in the HashMap, a new B+ tree is initialized, using the keyword as the key and the B+ tree as the value. The distributed system node to which the keyword belongs is calculated using a hash function, as shown in the following formula.

[0110] NodeID = h(keyword)mod X

[0111] Where X is the number of machine nodes in the distributed system, keyword is the key, h(·) is the hash function, and NodeID is the distributed system node. If X is 5, and the MurmurHash3 algorithm is used as the hash function, then the hash values ​​of {“Who”, “are”, “you”, “?”, “Where”, “from”} are {4114073512, 1662505136, 814527388, 2522961926, 104668330, 2755325844}, which are pre-stored in the machines corresponding to the distributed system nodes with NodeIDs of 2, 1, 3, 1, 0, and 4, respectively.

[0112] It is evident that for Machine1 (NodeID=0) on this machine, it is necessary to record the document ID and metadata (MetaData) corresponding to the keyword {Where}. The metadata includes term frequency (TF), user access frequency (UAF), and word position (POS). The keyword and its metadata are then inserted into the corresponding B+ tree.

[0113] Send the other keywords, along with their corresponding document IDs and metadata, to the other machines. Keywords {"are", "?"} are sent to Machine2 (NodeID=1), keywords {"Who"} to Machine3 (NodeID=2), keywords {"you"} to Machine4 (NodeID=3), and keywords {"from"} to Machine5 (NodeID=4).

[0114] By performing the above operations on each machine, each machine can build a distributed index. Figure 2 As shown.

[0115] If a user searches for the keyword "are" on Machine3, the search steps are as follows:

[0116] Based on the hash value obtained from the hash function, the distributed system node for the keyword "are" can be determined to be 1, namely Machine2.

[0117] Send the query request to Machine2.

[0118] Machine2 performs a hash lookup to locate all documents in the B+ tree, that is, to traverse the records of the leaf nodes, and returns all document IDs and their metadata.

[0119] In summary, the distributed retrieval method for device lifecycle knowledge provided in this application uses HashMap and B+ tree to implement an inverted index. During distributed retrieval of device lifecycle fault knowledge, the client only needs to send a request to one node, avoiding multi-node communication. Each keyword is stored on only the machine corresponding to one node, eliminating the need to merge cross-node data and significantly reducing communication volume. Furthermore, it enables fast retrieval even under unstable communication conditions, making it suitable for efficient retrieval under conditions where communication costs between distributed systems are high.

[0120] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0121] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0122] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0123] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A distributed knowledge retrieval method for the entire lifecycle of equipment, characterized in that, This method is applied to a distributed system, which includes several nodes, each node including at least one machine, and the machines in each node are communicable and interconnected. Each machine stores inverted index data for all machines in the distributed system. Each machine has a HashMap, where the keys and values ​​are keywords and B+ trees, respectively. The B+ tree stores a keyword and its corresponding metadata. Different B+ trees are stored in different machine HashMaps, and the keyword hash value of the B+ tree stored on each machine is the same as a preset hash value corresponding to that machine. The keyword hash value is calculated by combining the keyword with a preset hash function. The method includes: Retrieve the document collection on the current machine, where the current machine is any one of all machines in the distributed system; the documents are used to store fault knowledge throughout the device's lifecycle. The document collection is traversed to extract keywords from each document in the document collection to obtain at least one keyword to be created; Obtain the document ID and metadata corresponding to each of the keywords to be created; For each keyword to be created, a corresponding B+ tree is created; the metadata corresponding to each keyword to be created is inserted into the corresponding B+ tree; The hash function is used to calculate the hash value of each keyword to be created. The machine to which each keyword to be created belongs is determined based on the relationship between each keyword hash value and all the preset hash values; The B+ tree corresponding to each keyword to be created and the corresponding document ID are sent to the HashMap on their respective machines for storage; After the traversal is complete, the inverted index data generated by the current machine is sent to all the machines in the distributed system except the current machine; The query client receives a query request input by the user, and the query client can be any one of all the machines in the distributed system; The query hash value of the keyword to be queried contained in the query request is calculated using the hash function. The query request is sent to the target machine corresponding to the preset hash value that is the same as the query hash value, where the target machine is any one of all the machines in the distributed system; The target machine performs a hash lookup to locate all documents in the B+ tree corresponding to the query keyword, and returns all document IDs and corresponding metadata.

2. The distributed knowledge retrieval method for the entire lifecycle of equipment according to claim 1, characterized in that, The metadata includes word frequency, user access frequency, and word position.

3. The distributed knowledge retrieval method for the entire lifecycle of equipment according to claim 2, characterized in that, Each document corresponding to a keyword is sorted in the corresponding B+ tree according to the user access frequency.

4. The distributed knowledge retrieval method for the entire lifecycle of equipment according to claim 1, characterized in that, When a new document is inserted on the current machine, the new document is segmented and at least one new keyword is extracted. The hash value of each new keyword is calculated using the hash function. Obtain the document ID and metadata corresponding to each new keyword; Determine whether each of the aforementioned new keywords already exists; Insert the metadata corresponding to the new keyword that already exists into the corresponding B+ tree; If it is determined that the new keyword does not exist, a new B+ tree is initialized for each new keyword that does not exist, and the metadata corresponding to each new keyword is inserted into the corresponding new B+ tree. The machine to which each new keyword belongs is determined based on the relationship between the hash value of each new keyword and all the preset hash values; The new B+ tree corresponding to each new keyword and the corresponding document ID are sent to the HashMap on their respective machines for storage.

5. The distributed knowledge retrieval method for the entire lifecycle of equipment according to claim 1, characterized in that, Extract a list of keywords from the documents that need to be deleted; The hash function is used to calculate the machine to which the keyword to be deleted belongs; the deletion command and the corresponding keyword are sent to other nodes storing the keyword; Upon receiving a delete command, it iterates through each keyword to be deleted, searches for the corresponding B+ tree for each keyword, and deletes the entry for the document corresponding to each keyword in the B+ tree.

6. The distributed knowledge retrieval method for the entire lifecycle of equipment according to claim 1, characterized in that, The hash function is shown in the following formula: In the formula: This represents the number of machine nodes in the distributed system. As keywords, For hash functions, It is a node in a distributed system.

7. The distributed knowledge retrieval method for the entire lifecycle of equipment according to claim 6, characterized in that, The hash function This includes any one of the following algorithms: SHA-1, MD5, CRC, Lookup3, and MurmurHash3.

Citation Information

Patent Citations

  • Inverted index storage method, inverted index mechanism and on-line updating method

    CN1536509A

  • Method, medium and system for locally searching files based on keywords for IPFS nodes

    CN114297145A

  • Distributed storage keyword retrieval method based on IPFS

    CN114780486A