Intelligent fault diagnosis method and system for RFID readers based on knowledge base retrieval enhanced large model

By multi-level segmentation and vectorization of the RFID reader fault knowledge base, combined with contextual hints from a large language model, the problems of low retrieval efficiency and poor accuracy in existing technologies are solved, achieving efficient and accurate fault diagnosis.

CN119669446BActive Publication Date: 2025-09-23GUANGZHOU HONGYU SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411636966.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-09-23
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

Existing RFID reader fault diagnosis methods suffer from low retrieval efficiency and poor accuracy, especially in complex equipment and uncommon fault scenarios.

Method used

We employ a knowledge base retrieval-enhanced big model approach to perform multi-level segmentation of RFID reader fault knowledge base documents, construct semantic flow through doubly linked lists, retrieve and generate diagnostic suggestions using a vector database, and combine this with a large language model to provide contextual hints and generate detailed diagnostic suggestions.

Benefits of technology

It improves the efficiency and accuracy of fault diagnosis retrieval, reduces reliance on human experience, ensures the semantic coherence and specificity of diagnostic suggestions, adapts to new fault types, and maintains long-term effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669446B_ABST
    Figure CN119669446B_ABST
Patent Text Reader

Abstract

The present invention discloses an intelligent fault diagnosis method and system for RFID readers based on a knowledge base retrieval-enhanced large model. The method comprises the following steps: performing multi-level segmentation on RFID reader fault knowledge base documents to obtain RFID fault texts, extracting RFID fault text vectors from the RFID fault texts and storing them in a vector database; converting received query question texts into query question vectors, searching the vector database for RFID fault text vectors based on their relevance to the query question vectors to obtain target RFID fault texts; generating prompt statements and prompt information based on contextual prompt words and preset prompt templates of the target RFID fault texts, inputting the prompt statements and the target RFID fault texts into a large language model to generate diagnostic suggestions, and presenting the prompt information and diagnostic suggestions to the user. The present invention can solve the technical problems of low text retrieval efficiency and poor accuracy in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent fault diagnosis of RFID readers, and in particular to an intelligent fault diagnosis method and system for RFID readers based on a knowledge base retrieval enhanced large model. Background Art

[0002] In modern industrial production and information systems, RFID (Radio Frequency Identification) readers are widely used in areas such as asset management, logistics tracking, and smart manufacturing. However, due to factors such as environmental interference, hardware failures, and software anomalies, they often experience operational instability and read / write failures, severely impacting production efficiency and service quality. Existing fault diagnosis methods include manual fault diagnosis, knowledge graph-based fault diagnosis, and knowledge-based fault diagnosis. Manual fault diagnosis relies on the experience and knowledge of experts. While effective in certain scenarios, it is highly dependent on personnel expertise, resulting in low diagnostic efficiency. Complex equipment requires significant time for manual problem analysis, and information management is difficult. Knowledge graph-based fault diagnosis builds a correlation graph between equipment, faults, and solutions, helping technicians quickly identify fault causes and propose solutions. However, its construction cost is high and its generalization ability for uncommon faults is limited. Knowledge-based fault diagnosis combines a pre-trained large language model with a knowledge base to automatically extract key information from fault descriptions, match it with the knowledge base, and generate diagnostic recommendations. While this approach improves automation, semantic incoherence in the text leads to low retrieval efficiency and poor accuracy. Summary of the Invention

[0003] The main purpose of the present invention is to provide an intelligent fault diagnosis method and system for RFID readers based on a knowledge base retrieval enhanced large model, aiming to solve the technical problems of low retrieval efficiency and poor accuracy in the background technology.

[0004] To achieve the above objectives, the present invention provides, in a first aspect, an intelligent fault diagnosis method for RFID readers based on a knowledge base retrieval enhanced large model, comprising the following steps:

[0005] Step S100: performing multi-level segmentation on the RFID reader fault knowledge base document to obtain RFID fault text, extracting RFID fault text vectors from the RFID fault text and storing them in a vector database;

[0006] Step S200: converting the received query text into a query vector, searching the vector of the RFID fault text in the vector database according to the degree of relevance to the query vector, and obtaining the target RFID fault text;

[0007] Step S300: Generate prompt statements and prompt information based on the context prompt words of the target RFID fault text and a preset prompt template, input the prompt statement and the target RFID fault text into a large language model to generate diagnostic suggestions, and display the prompt information and the diagnostic suggestions to the user.

[0008] Optionally, in step S100, the step of performing multi-level segmentation on the RFID reader fault knowledge base document to obtain the RFID fault text includes:

[0009] Step S110: Obtaining RFID reader fault knowledge base documents;

[0010] Step S120: Segmenting the RFID reader fault knowledge base document into a plurality of parent node texts according to a predefined parent node segmentation rule;

[0011] Step S130: Establishing contextual associations between parent node texts through a bidirectional linked list to construct a semantic flow to provide contextual information when retrieving texts;

[0012] Step S140: Dynamically segment the parent node text according to a predefined child node segmentation rule to obtain an RFID fault text.

[0013] Optionally, in step S120, the parent node segmentation rule includes:

[0014] The parent node text length is greater than or equal to the first length threshold and less than the second length threshold;

[0015] The segmentation point of each parent node text is located at the end of the paragraph to ensure that each parent node text contains a complete paragraph.

[0016] Optionally, in step S140, the step of dynamically segmenting the parent node text according to a predefined child node segmentation rule to obtain the RFID fault text includes:

[0017] Step S141: determining segmentation parameters according to the structural information of the parent node text and a dynamic segmentation algorithm, wherein the structural information includes length information and paragraph information, and the segmentation parameters include segmentation length and overlap length;

[0018] Step S142: Segment the parent node text according to the segmentation parameters to obtain RFID fault text.

[0019] Optionally, in step S141, the step of determining segmentation parameters according to the structural information of the parent node text and the dynamic segmentation algorithm includes:

[0020] Step S410: Calculating an initial segmentation length and an overlap length based on the total length of the parent node text and the number of paragraphs, wherein the overlap length is less than a first percentage threshold of the segmentation length;

[0021] Step S420: Dynamically adjust the segmentation length and overlap length until any of the following termination conditions is met:

[0022] All keywords were not segmented across texts;

[0023] The overlapping length is greater than or equal to a second percentage threshold of the segmentation length.

[0024] Optionally, in step 420, the step of dynamically adjusting the segmentation length and the overlap length includes:

[0025] Calculate the maximum length of all keywords |k max |, the formula is as follows:

[0026] |k max |=max(len(k1),len(k2),...,len(k n ))

[0027] Where k n For keywords;

[0028] The segmentation length is adjusted according to the maximum length of the keyword. The formula is as follows:

[0029] chunk_size new =chunk_size old +|k max |

[0030] Where chunk_size old is the length of the segmentation before adjustment, chunk_size new is the adjusted cutting length;

[0031] The overlap length is adjusted according to the maximum length of the keyword and the second percentile threshold of the segmentation length. The formula is as follows:

[0032] overlap_size new =min(overlap_size old +|k max |, m × chunk_size new )

[0033] Where, overlap_size old is the overlap length before adjustment, overlap_size newis the adjusted overlap length, and m is the second percentage threshold of the segmentation length.

[0034] Optionally, in step S200, the step of retrieving the RFID fault text vector in the vector database according to the degree of relevance to the query question vector to obtain the target RFID fault text includes:

[0035] Calculate the similarity between the query question vector and the RFID fault text vector;

[0036] According to the similarity value sorting, several RFID fault text vectors with the highest similarity are selected as the target RFID fault text.

[0037] A second aspect of the present invention provides an RFID reader intelligent fault diagnosis system based on a knowledge base retrieval enhanced large model, characterized by comprising:

[0038] a segmentation module, configured to perform multi-level segmentation on the RFID reader fault knowledge base document to obtain an RFID fault text, extract an RFID fault text vector from the RFID fault text, and store the vector vector in a vector database;

[0039] A retrieval module is used to convert the received query text into a query vector, and retrieve the RFID fault text vector in the vector database according to the degree of relevance with the query vector to obtain the target RFID fault text;

[0040] The answer module is used to generate a prompt statement and prompt information based on the context prompt words of the target RFID fault text and a preset prompt template, input the prompt statement and the target RFID fault text into a large language model to generate a diagnostic suggestion, and display the prompt information and the diagnostic suggestion to the user.

[0041] The third aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the RFID reader intelligent fault diagnosis method based on the knowledge base retrieval enhanced large model as described in the first aspect when executing the computer program.

[0042] The fourth aspect of the present invention provides a computer-readable storage medium, on which is stored an RFID reader / writer intelligent fault diagnosis processing program based on a knowledge base retrieval enhanced large model. When the RFID reader / writer intelligent fault diagnosis processing program based on a knowledge base retrieval enhanced large model is executed by a processor, the steps of the RFID reader / writer intelligent fault diagnosis method based on a knowledge base retrieval enhanced large model as described in the first aspect are implemented.

[0043] Compared with the prior art, the beneficial effects of the present invention include at least:

[0044] The present invention provides an RFID reader intelligent fault diagnosis method and system based on a knowledge base retrieval enhanced large model. The RFID reader intelligent fault diagnosis method based on the knowledge base retrieval enhanced large model ensures the semantic coherence of each fault text segment through multi-level segmentation and vectorization processing, and uses a vector similarity calculation method to efficiently retrieve related fault texts, significantly improving retrieval efficiency. Furthermore, a forward and backward association between parent node texts is established through a bidirectional linked list, a semantic flow is constructed, context information support is provided, and more specific and detailed diagnostic suggestions are generated. The natural language understanding capability of the large language model is utilized, combined with specific fault context information, to generate more accurate diagnostic suggestions and improve the accuracy of fault diagnosis. The fault description is automatically processed and the diagnostic suggestion generation is generated, reducing dependence on manual experience and improving the efficiency and reliability of fault diagnosis. By continuously updating the RFID fault knowledge base and optimizing model parameters, the system can adapt to new fault types and maintain long-term effectiveness and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be derived based on the structures shown in these drawings without inventive work. The purpose of the present invention, its functional features and advantages will be further explained in conjunction with the embodiments and with reference to the drawings.

[0046] Figure 1 A flowchart of an RFID reader intelligent fault diagnosis method based on a knowledge base retrieval enhanced large model provided by an embodiment of the present invention;

[0047] Figure 2 A flow chart of a fault diagnosis method based on knowledge base enhancement in the prior art provided by an embodiment of the present invention;

[0048] Figure 3 The overall flow chart of the RFID reader intelligent fault diagnosis method based on the knowledge base retrieval enhanced large model provided by the embodiment of the present invention;

[0049] Figure 4 A schematic diagram of the effects of the layered context and dynamic adjustment of text blocks and text overlap algorithm provided by an embodiment of the present invention;

[0050] Figure 5 A flowchart of a hierarchical context-enhanced retrieval method provided by an embodiment of the present invention;

[0051] Figure 6 A flowchart of a dynamically adjusted text segmentation algorithm provided by an embodiment of the present invention;

[0052] Figure 7 A schematic diagram of an RFID reader intelligent fault diagnosis system based on a knowledge base retrieval enhanced large model provided by an embodiment of the present invention;

[0053] Figure 8 A schematic diagram of a computer device for intelligent fault diagnosis of RFID readers based on a knowledge base retrieval enhanced large model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0055] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.

[0056] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the meaning of "and / or" appearing throughout the text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme in which A and B are satisfied at the same time. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0057] In view of this, the main purpose of the present invention is to provide an RFID reader intelligent fault diagnosis method and system based on a knowledge base retrieval enhanced large model, aiming to solve the technical problems of low retrieval efficiency and poor accuracy of background technology.

[0058] To achieve the above objectives, the present invention provides, in a first aspect, an intelligent fault diagnosis method for RFID readers based on a knowledge base retrieval enhanced large model, comprising the following steps:

[0059] Step S100: performing multi-level segmentation on the RFID reader fault knowledge base document to obtain RFID fault text, extracting RFID fault text vectors from the RFID fault text and storing them in a vector database;

[0060] Step S200: converting the received query text into a query vector, searching the vector of the RFID fault text in the vector database according to the degree of relevance to the query vector, and obtaining the target RFID fault text;

[0061] Step S300: Generate prompt statements and prompt information based on the context prompt words of the target RFID fault text and a preset prompt template, input the prompt statement and the target RFID fault text into a large language model to generate diagnostic suggestions, and display the prompt information and the diagnostic suggestions to the user.

[0062] Specifically, refer to Figure 1Flowchart of the present invention. In one embodiment of the present invention, the system exports the fault knowledge base documents of RFID readers from the internal system of the enterprise, including technical manuals, user feedback, maintenance records, etc. The documents cover various fault cases of RFID readers, such as hardware faults, software faults, network faults, etc. The document format can be PDF, Word or other text formats. The collected RFID reader fault knowledge base documents are preprocessed, such as removing stop words and punctuation marks, and performing stemming or lemmatization operations to ensure the effectiveness of subsequent processing. Then, the preprocessed fault knowledge base documents are fine-grainedly segmented using the hierarchical context-enhanced retrieval method to generate parent nodes and child nodes. The parent node is segmented according to the predefined segment length to maintain the integrity of the paragraph-level semantics; the child node is further segmented according to preset rules to ensure that the child node content is suitable for the similarity retrieval of the vector database, while retaining the semantic connection between the child nodes. The segmented child node text is word-embedded to generate a vector representation and stored in the vector database. When a production line manager enters the query "RFID reader cannot connect to the server" through the system interface, the system converts the query into a vector form and searches the vector database for the document vector most similar to the query vector, locating the relevant child node text. Based on the retrieved child node text, the system generates a prompt statement, such as "Please check whether the network connection is normal." This prompt statement incorporates contextual prompts provided by the parent node to enhance the semantic interpretation of the search results. The system then inputs the prompt statement and the fault case text into a large language model to generate detailed diagnostic recommendations, such as "Check whether the network cable is loose or damaged, restart the router and reader, and check whether the network configuration is correct." Finally, the system presents the generated diagnostic recommendations and prompts to the production line manager in a user-friendly manner, helping them quickly locate and resolve the problem. This dual-layer structure of parent and child nodes, combined with the efficient search capabilities of the vector database, significantly improves the efficiency of similarity retrieval. The contextual prompts provided by the parent node further enhance the semantic interpretation of the search results, ensuring rapid location and accurate matching of key information.

[0063] Optionally, in step S100, the step of performing multi-level segmentation on the RFID reader fault knowledge base document to obtain the RFID fault text includes:

[0064] Step S110: Obtaining RFID reader fault knowledge base documents;

[0065] Step S120: Segmenting the RFID reader fault knowledge base document into a plurality of parent node texts according to a predefined parent node segmentation rule;

[0066] Step S130: Establishing contextual associations between parent node texts through a bidirectional linked list to construct a semantic flow to provide contextual information when retrieving texts;

[0067] Step S140: Dynamically segment the parent node text according to a predefined child node segmentation rule to obtain an RFID fault text.

[0068] Specifically, in one embodiment of the present invention, the system exports the RFID reader fault knowledge base document from the enterprise internal system. The RFID reader fault knowledge base document is converted into a long text T, which is divided into a parent node sequence {T1, T2, ..., T n}:

[0069] Ti=T[S i :E i ]

[0070] Among them S i is the starting position of the i-th parent node, E i is the end position of the i-th parent node, T i As the parent node, ensure that the division maintains the integrity of paragraph-level semantics, and maintains the integrity of the context through the larger paragraph (parent node), which is used as a subsequent retrieval prompt template.

[0071] Next, establish the front-back relationship between parent nodes, parent nodes {T1, T2, ..., T n} are linked together in a bidirectional linked list to build a semantic flow:

[0072] (T1)-[:next]→(T2)

[0073] (T2)-[:prev]→(T1)

[0074] The linked list structure between parent nodes ensures that text fragments can refer to the context during retrieval, solving the isolation problem after fragmentation.

[0075] Then divide the child nodes and perform word embedding processing. i , further divided into sub-nodes {C i1 , C i2 ,...,C im}, use the split length chunk_size and overlap length overlap_size for splitting:

[0076] C ij =T i [S j :E j ]

[0077] Among them, C ijis the child node, S j For child node C ij The starting position, E j Is the child node C ij The end position is determined by the segmentation length chunk_size and the overlap length overlap_size. ij Perform word embedding processing to generate embedding vectors By further splitting the parent node, the child node content can adapt to the similarity retrieval of the vector database while retaining the semantic connection between the child nodes.

[0078] Next, the system performs similarity retrieval, using the vector database to perform similarity retrieval on the child nodes, and embeds the vector Calculate the similarity with the query question vector q:

[0079]

[0080] in, For child node C ij The embedding vector of , q is the query question vector.

[0081] Finally, the search results are optimized using parent node prompts. After the search is complete, the contextual prompts provided by the parent node Ti further enhance the semantic interpretability of the search results and output them to the user. Parent nodes do not participate in embedding but can be used as text prompt input to optimize the model's search quality. The parent node's prompt function enhances the interpretability of search results, particularly in complex scenarios, helping to better understand the text context. This method, by combining hierarchical parent and child nodes, addresses the issues of semantic incoherence and isolated fragments after text fragmentation. Furthermore, vectorized child node retrieval and parent node contextual prompts improve the efficiency of text similarity retrieval and the semantic coherence of the results.

[0082] Optionally, in step S120, the parent node segmentation rule includes:

[0083] The parent node text length is greater than or equal to the first length threshold and less than the second length threshold;

[0084] The segmentation point of each parent node text is located at the end of the paragraph to ensure that each parent node text contains a complete paragraph.

[0085] Specifically, in one embodiment of the present invention, the parent node segmentation rule is: the parent node text length is greater than or equal to the first length threshold (for example, 600 words) and less than the second length threshold (for example, 800 words). At the same time, the segmentation point of each parent node text is located at the end of the paragraph to ensure that each parent node text contains a complete paragraph. It can be understood that for different types of fault documents, different first length thresholds and second length thresholds can be set according to their paragraph information to ensure that each parent node text has a reasonable length and avoid semantic breaks caused by overly long or short fragments. The segmentation point of each parent node text is located at the end of the paragraph to ensure that each parent node contains a complete paragraph, maintain the semantic integrity of the paragraph level, avoid the loss of context caused by segmentation in the middle of the paragraph, and improve the coherence and readability of the text.

[0086] Optionally, in step S140, the step of dynamically segmenting the parent node text according to a predefined child node segmentation rule to obtain the RFID fault text includes:

[0087] Step S141: determining segmentation parameters according to the structural information of the parent node text and a dynamic segmentation algorithm, wherein the structural information includes length information and paragraph information, and the segmentation parameters include segmentation length and overlap length;

[0088] Step S142: Segment the parent node text according to the segmentation parameters to obtain RFID fault text.

[0089] Specifically, in one embodiment of the present invention, the system exports an RFID reader fault knowledge base document from an internal enterprise system, converts the RFID reader fault knowledge base document into a long text T, calculates T's length information (number of words) and paragraph information, and determines an appropriate chunking length (chunk_size) and overlap length (overlap_size) based on the length and paragraph information of T. Based on the specific content of the parent node text, the chunking length and overlap length are adjusted using a dynamic chunking algorithm to ensure the rationality and semantic coherence of the child node content. The parent node text is then chunked based on the chunking length and overlap length to obtain the RFID fault text. As will be appreciated, the chunking parameters are determined based on the structural information of the parent node text and the dynamic chunking algorithm to ensure the rationality and semantic coherence of the child node content, thus avoiding the problems associated with a fixed chunking length. By dynamically adjusting the chunking length and overlap length, the appropriate length of the child node content is ensured, preventing the impact of overly long or short segments on similarity retrieval, further improving retrieval efficiency. Furthermore, the dynamic chunking algorithm ensures that each child node contains key information, avoiding the omission of important information and improving the comprehensiveness and accuracy of diagnostic recommendations.

[0090] Optionally, in step S141, the step of determining segmentation parameters according to the structural information of the parent node text and the dynamic segmentation algorithm includes:

[0091] Step S410: Calculating an initial segmentation length and an overlap length based on the total length of the parent node text and the number of paragraphs, wherein the overlap length is less than or equal to a first percentage threshold of the segmentation length;

[0092] Step S420: Dynamically adjust the segmentation length and overlap length until any of the following termination conditions is met:

[0093] All keywords were not segmented across texts;

[0094] The overlapping length is greater than or equal to a second percentage threshold of the segmentation length.

[0095] Specifically, in one embodiment of the present invention, the initial segmentation length chunk_size0 and overlap length overlap_size0 are calculated based on the total text length L and the number of paragraphs P of the parent node text:

[0096]

[0097] Where L is the total number of characters or words in the parent node text, P is the number of paragraphs in the parent node text, and h is the first percentage threshold of the segmentation length (usually 0.3, indicating that the initial overlap length is 30% of the segmentation length). Indicates the initial segmentation length, and overlap_size0 indicates the initial overlap length.

[0098] Then, according to the predefined keyword list K={k1, k2, ..., k n}, determine whether the keyword is split across segments. If so, increase the segmentation length and overlap length until all keywords are not split across segments or the overlap length is greater than or equal to the second percentage threshold of the segmentation length (usually 0.7, indicating that the initial overlap length is 70% of the segmentation length). Keywords are derived from the knowledge base of the company's operation and maintenance management intelligent fault analysis and prediction system on RFID and other equipment, and can be added manually or identified by models. It is understandable that by detecting keywords and dynamically adjusting the segmentation parameters, it is ensured that the text segmentation is more complete in semantically dense areas or keyword areas, so as to improve semantic retention and the correlation between segments.

[0099] Optionally, in step 420, the step of dynamically adjusting the segmentation length and the overlap length includes:

[0100] Calculate the maximum length of all keywords |k max |, the formula is as follows:

[0101] |k max |=max(len(k1),len(k2),...,len(k n ))

[0102] Where k n For keywords;

[0103] The segmentation length is adjusted according to the maximum length of the keyword. The formula is as follows:

[0104] chunk_size new =chunk_size old +|k max |

[0105] Where chunk_size old is the length of the segmentation before adjustment, chunk_size new is the adjusted cutting length;

[0106] The overlap length is adjusted according to the maximum length of the keyword and the second percentile threshold of the segmentation length. The formula is as follows:

[0107] overlap_size new =min(overlap_size old +|k max |, m × chunk_size new )

[0108] Where, overlap_size old is the overlap length before adjustment, overlap_size new is the adjusted overlap length, and m is the second percentage threshold of the segmentation length.

[0109] It can be understood that through the above steps, the segmentation length and overlap length are dynamically adjusted based on the maximum length of the keyword, ensuring the rationality and semantic coherence of the sub-node text, avoiding keyword breaks, and improving the accuracy and completeness of the diagnostic suggestions.

[0110] Specifically, in one embodiment of the present invention, the segmentation operation of the sub-node text is completed according to the segmentation length and the overlap length, and further includes the following steps:

[0111] Set the initial starting position, set the initial starting position of the first segment, and start segmenting from the very beginning of the text: S0 = 0

[0112] Determine whether the starting position is less than the text length and the current starting position S j Is it less than the total length of the text L: S j <L

[0113] If yes, continue segmentation, otherwise stop segmentation, ensuring that segmentation is continued only when the starting position does not exceed the text length to avoid redundant segmentation.

[0114] Calculate the end position of the fragment and the end position E of the current fragment j , make sure it does not exceed the text length: E i =min(S i +chunk size , L)

[0115] Extract and save the current fragment P i to a list, split the text into reasonable sub-segments and save them one by one for subsequent processing :P i =T[S i :E i ]

[0116] Update the starting position S j+1 , taking into account the overlap_size, ensure that there is some overlap between the subsequent fragment and the current fragment, and enhance the semantic coherence between the fragments:

[0117] S i+1 =S i +chunk size -overlap size

[0118] Finally, stop segmentation, output and save the fragment, when the starting position S j When the text length L is exceeded, the segmentation stops, all the saved segments are output, and the final segment list is generated for subsequent vector retrieval.

[0119] The following example illustrates how to dynamically adjust the segmentation and overlap lengths based on the maximum keyword length. The system first retrieves a knowledge base document about RFID reader failures. The document covers various failure scenarios, including hardware failures, software failures, and network failures. To better process this document, we need to perform multi-level segmentation and dynamically adjust the segmentation parameters.

[0120] Here are some parts of the document:

[0121] 1. Hardware failure:

[0122] -RFID reader power module failure

[0123] -RFID reader antenna failure

[0124] -RFID reader motherboard failure

[0125] 2. Software failure:

[0126] -RFID reader firmware version is incompatible

[0127] -RFID reader driver error

[0128] -RFID reader application crashes

[0129] 3. Network failure:

[0130] -RFID reader cannot connect to the server

[0131] -RFID reader network configuration error

[0132] - RFID reader network connection is unstable

[0133] The preset keyword list is as follows:

[0134] K = ["Power module failure", "Antenna failure", "Motherboard failure", "Incompatible firmware version", "Driver error", "Application crash", "Unable to connect to server", "Network configuration error", "Unstable network connection"]

[0135] The initial parameter settings are as follows:

[0136] The total length of the document L=500 characters, the number of paragraphs P=9, the first percentage threshold h=0.3, and the second percentage threshold m=0.7.

[0137] Calculate the initial segmentation length and overlap length:

[0138] chunk_size0 = L / P = 500 / 9 ≈ 55.56 ≈ 56 (rounded)

[0139] overlap_size0=h*chunk_size0=0.3*56≈17

[0140] Calculate the maximum length of a keyword:

[0141] |k max |=max(len("Power Module Failure"),len("Antenna Failure"),len("Motherboard Failure"),len("Firmware Version Incompatibility"),len("Driver Error"),len("Application Crash"),len("Unable to Connect to Server"),len("Network Configuration Error"),len("Unstable Network Connection"))

[0142] =max(8,4,4,8,8,8,12,8,12)

[0143] =12

[0144] Then dynamically adjust the segmentation length and overlap length. The result of the first adjustment is as follows:

[0145] chunk_size new =chunk_size old +|k max |=56+12=68

[0146] overlap_size new =min(overlap_size old +|k max |,m×chunk_size new )

[0147] =min(17+12,0.7*68)

[0148] =min(29,47.6)

[0149] =29

[0150] Next, check whether the keywords are split across segments. If the adjusted segmentation length and overlap length still result in some keywords being split across segments, for example, "Unable to connect to server" is split into two different segments, then you need to adjust the segmentation parameters again.

[0151] The results of the second adjustment are as follows:

[0152] chunk_size new =chunk_size old +|k max |=68+12=80

[0153] overlap_size new =min(overlap_size old +|k max |,m×chunk_size new )

[0154] =min(29+12,0.7*80)

[0155] =min(41,56)

[0156] =41

[0157] After two adjustments, the final segmentation parameters are: segmentation length chunk_size = 80, overlap length overlap_size = 41, and the document is segmented using the final segmentation parameters.

[0158] The total length of the document is L = 500 characters. The final segmentation parameters are chunk_size = 80 and overlap_size = 41. The segmentation results are as follows:

[0159] Segment 1: P_1 = T[0:80]

[0160] Segment 2: P_2 = T [39:119]

[0161] Segment 3: P_3 = T [78:158]

[0162] Segment 4: P_4 = T[117:197]

[0163] Segment 5: P_5 = T[156:236]

[0164] Segment 6: P_6=T[195:275]

[0165] Segment 7: P_7 = T[234:314]

[0166] Segment 8: P_8 = T[273:353]

[0167] Segment 9: P_9 = T[312:392]

[0168] Segment 10: P_10 = T[351:431]

[0169] Segment 11: P_11 = T[390:470]

[0170] Segment 12: P_12 = T[429:500]

[0171] It can be understood that by dynamically adjusting the chunk_size and overlap_size lengths, optimization is performed for keywords or semantically dense areas during text segmentation, ensuring that text segments maintain a reasonable length while enhancing the coherence of contextual semantics.

[0172] Optionally, in step S200, the step of retrieving the RFID fault text vector in the vector database according to the degree of relevance to the query question vector to obtain the target RFID fault text includes:

[0173] Calculate the similarity between the query question vector and the RFID fault text vector;

[0174] According to the similarity value sorting, several RFID fault text vectors with the highest similarity are selected as the target RFID fault text.

[0175] In this way, it can be ensured that each segment contains complete keywords, avoiding the problem of keywords being split across segments, thereby improving the semantic coherence of text segments and the accuracy of similarity retrieval.

[0176] A second aspect of the present invention provides an RFID reader intelligent fault diagnosis system based on a knowledge base retrieval enhanced large model, characterized by comprising:

[0177] a segmentation module, configured to perform multi-level segmentation on the RFID reader fault knowledge base document to obtain an RFID fault text, extract an RFID fault text vector from the RFID fault text, and store the vector vector in a vector database;

[0178] A retrieval module is used to convert the received query text into a query vector, and retrieve the RFID fault text vector in the vector database according to the degree of relevance with the query vector to obtain the target RFID fault text;

[0179] The answer module is used to generate a prompt statement and prompt information based on the context prompt words of the target RFID fault text and a preset prompt template, input the prompt statement and the target RFID fault text into a large language model to generate a diagnostic suggestion, and display the prompt information and the diagnostic suggestion to the user.

[0180] The third aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the RFID reader intelligent fault diagnosis method based on the knowledge base retrieval enhanced large model as described in the first aspect when executing the computer program.

[0181] The fourth aspect of the present invention provides a computer-readable storage medium, on which is stored an RFID reader / writer intelligent fault diagnosis processing program based on a knowledge base retrieval enhanced large model. When the RFID reader / writer intelligent fault diagnosis processing program based on a knowledge base retrieval enhanced large model is executed by a processor, the steps of the RFID reader / writer intelligent fault diagnosis method based on a knowledge base retrieval enhanced large model as described in the first aspect are implemented.

[0182] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor serves as the control center of the RFID reader intelligent fault diagnosis system based on the knowledge base retrieval enhanced large model, and utilizes various interfaces and lines to connect the various parts of the processing and operational devices of the RFID reader intelligent fault diagnosis system based on the knowledge base retrieval enhanced large model.

[0183] The memory can be used to store the computer programs and / or modules. The processor implements the various functions of the RFID reader / writer intelligent fault diagnosis system based on knowledge base retrieval enhanced large model by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0184] Compared with the prior art, the beneficial effects of the present invention include at least:

[0185] The present invention provides an RFID reader intelligent fault diagnosis method and system based on a knowledge base retrieval enhanced large model. The RFID reader intelligent fault diagnosis method based on the knowledge base retrieval enhanced large model ensures the semantic coherence of each fault text segment through multi-level segmentation and vectorization processing, and uses a vector similarity calculation method to efficiently retrieve related fault texts, significantly improving retrieval efficiency. Furthermore, a forward and backward association between parent node texts is established through a bidirectional linked list, a semantic flow is constructed, context information support is provided, and more specific and detailed diagnostic suggestions are generated. The natural language understanding capability of the large language model is utilized, combined with specific fault context information, to generate more accurate diagnostic suggestions and improve the accuracy of fault diagnosis. The fault description is automatically processed and the diagnostic suggestion generation is generated, reducing dependence on manual experience and improving the efficiency and reliability of fault diagnosis. By continuously updating the RFID fault knowledge base and optimizing model parameters, the system can adapt to new fault types and maintain long-term effectiveness and accuracy. Furthermore, the setting of the parent node not only ensures that each text block contains enough information to maintain independence, but also ensures the semantic connection between fine-grained text fragments through further subdivision of the child nodes, effectively avoiding the semantic break problem after text fragmentation that is common in traditional text processing methods; the dynamic segmentation algorithm adjusts the segmentation length and overlap length according to the specific content of the parent node text, ensuring the rationality and semantic coherence of the child node content, further strengthening the connection between text fragments, and ensuring good semantic coherence even in highly fragmented texts.

[0186] The above-described embodiments merely represent several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that, for those skilled in the art, without departing from the concept of the present invention, several variations and improvements can be made, and equivalent structural transformations made using the contents of the present invention's description and drawings, or direct / indirect application in other related technical fields are all included within the scope of the present invention's patent protection. Therefore, the scope of protection of the present invention's patent shall be based on the appended claims.

Claims

1. An intelligent fault diagnosis method for RFID readers based on knowledge base retrieval enhanced large model, characterized in that: The following steps are involved: Step S100: performing multi-level segmentation on the RFID reader fault knowledge base document to obtain RFID fault text, extracting RFID fault text vectors from the RFID fault text and storing them in a vector database; Step S200: converting the received query text into a query vector, searching the vector of the RFID fault text in the vector database according to the degree of relevance to the query vector, and obtaining the target RFID fault text; Step S300: generating a prompt sentence and prompt information based on the context prompt words of the target RFID fault text and a preset prompt template, inputting the prompt sentence and the target RFID fault text into a large language model to generate a diagnosis suggestion, and displaying the prompt information and the diagnosis suggestion to the user; In step S100, the steps of performing multi-level segmentation on the RFID reader fault knowledge base document to obtain the RFID fault text include: Step S110: Obtaining RFID reader fault knowledge base documents; Step S120: Segmenting the RFID reader fault knowledge base document into a plurality of parent node texts according to a predefined parent node segmentation rule; Step S130: Establishing contextual associations between parent node texts through a bidirectional linked list to construct a semantic flow to provide contextual information when retrieving texts; Step S140: dynamically segmenting the parent node text according to a predefined child node segmentation rule to obtain an RFID fault text; In step S140, the step of dynamically segmenting the parent node text according to the predefined child node segmentation rule to obtain the RFID fault text includes: Step S141: determining segmentation parameters according to the structural information of the parent node text and a dynamic segmentation algorithm, wherein the structural information includes length information and paragraph information, and the segmentation parameters include segmentation length and overlap length; Step S142: Segment the parent node text according to the segmentation parameters to obtain RFID fault text.

2. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model according to claim 1 is characterized in that: In step S120, the parent node segmentation rules include: The parent node text length is greater than or equal to the first length threshold and less than the second length threshold; The segmentation point of each parent node text is located at the end of the paragraph to ensure that each parent node text contains a complete paragraph.

3. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model according to claim 1 is characterized in that: In step S141, the step of determining segmentation parameters according to the structural information of the parent node text and the dynamic segmentation algorithm includes: Step S410: Calculating an initial segmentation length and an overlap length based on the total length of the parent node text and the number of paragraphs, wherein the overlap length is less than a first percentage threshold of the segmentation length; Step S420: Dynamically adjust the segmentation length and overlap length until any of the following termination conditions is met: All keywords were not segmented across texts; The overlapping length is greater than or equal to a second percentage threshold of the segmentation length.

4. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model according to claim 3 is characterized in that: In step S420, the step of dynamically adjusting the segmentation length and the overlap length includes: Step 421: Calculate the maximum length of all keywords |k max |, the formula is as follows: |k max |=max(len(k1),len(k2),…,len(k n )) Where k n For keywords; Step 422: Adjust the segmentation length according to the maximum length of the keyword. The formula is as follows: chunk_size new =chunk_size old +|k max | Where chunk_size old is the length of the segmentation before adjustment, chunk_size new is the adjusted cutting length; Step 423: Adjust the overlap length according to the maximum length of the keyword and the second percentile threshold of the segmentation length. The formula is as follows: overlap_size new =min(overlap_size old +|k max |,m×chunk_size new ) Where, overlap_size old is the overlap length before adjustment, overlap_size new is the adjusted overlap length, and m is the second percentage threshold of the segmentation length.

5. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model according to any one of claims 1 to 4, characterized in that: In step S200, the step of retrieving the RFID fault text vector in the vector database according to the degree of relevance to the query question vector to obtain the target RFID fault text includes: Calculate the similarity between the query question vector and the RFID fault text vector; According to the similarity value sorting, several RFID fault text vectors with the highest similarity are selected as the target RFID fault text.

6. An intelligent fault diagnosis system for RFID readers based on knowledge base retrieval enhanced large model, characterized in that: include: a segmentation module, configured to perform multi-level segmentation on the RFID reader fault knowledge base document to obtain an RFID fault text, extract an RFID fault text vector from the RFID fault text, and store the vector vector in a vector database; A retrieval module is used to convert the received query text into a query vector, and retrieve the RFID fault text vector in the vector database according to the degree of relevance with the query vector to obtain the target RFID fault text; An answer module is configured to generate a prompt statement and prompt information based on the context prompt words of the target RFID fault text and a preset prompt template, input the prompt statement and the target RFID fault text into a large language model to generate a diagnosis suggestion, and present the prompt information and the diagnosis suggestion to the user; In the segmentation module, the step of performing multi-level segmentation on the RFID reader fault knowledge base document to obtain the RFID fault text includes: Step S110: Obtaining RFID reader fault knowledge base documents; Step S120: Segmenting the RFID reader fault knowledge base document into a plurality of parent node texts according to a predefined parent node segmentation rule; Step S130: Establishing contextual associations between parent node texts through a bidirectional linked list to construct a semantic flow to provide contextual information when retrieving texts; Step S140: dynamically segmenting the parent node text according to a predefined child node segmentation rule to obtain an RFID fault text; In step S140, the step of dynamically segmenting the parent node text according to the predefined child node segmentation rule to obtain the RFID fault text includes: Step S141: determining segmentation parameters according to the structural information of the parent node text and a dynamic segmentation algorithm, wherein the structural information includes length information and paragraph information, and the segmentation parameters include segmentation length and overlap length; Step S142: Segment the parent node text according to the segmentation parameters to obtain RFID fault text.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the RFID reader intelligent fault diagnosis method based on the knowledge base retrieval enhanced large model according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the computer program implements the RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Question response method and device based on large language model

    CN117235226A

  • Traditional Chinese medicine question and answer method and device based on long document retrieval enhancement generation and medium

    CN117828050A