RFID reader-writer intelligent fault diagnosis method and system based on knowledge base retrieval enhancement large model

Through the method of enhancing large-scale models based on knowledge base retrieval, RFID fault text is subjected to multi-level slicing and vectorization, combining vector similarity calculation and large language model generation diagnostic suggestions, the problems of low retrieval efficiency and poor accuracy in the existing technology are solved, and efficient and accurate fault diagnosis is achieved.

CN119669446AActive Publication Date: 2025-03-21GUANGZHOU HONGYU SCI & TECH

Patent Information

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

AI Technical Summary

Technical Problem

Among the existing RFID reader and writer fault diagnosis methods, the retrieval efficiency and poor accuracy lead to low diagnostic efficiency and accuracy.

Method used

The method based on knowledge base search enhancement model is adopted to process RFID fault text through multi-level segmentation and vectorization processing, the fault text is efficiently retrieved by vector similarity calculation, and diagnostic suggestions are generated based on the large language model.

Benefits of technology

The search efficiency and accuracy of fault diagnosis are significantly improved, and the diagnostic suggestions generated are more specific and detailed, reducing dependence on manual experience, and improving the efficiency and reliability of fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669446A_ABST
    Figure CN119669446A_ABST
Patent Text Reader

Abstract

The invention discloses an RFID reader-writer intelligent fault diagnosis method and system based on a knowledge base retrieval enhancement large model, and the method comprises the following steps: carrying out the multi-level segmentation of an RFID reader-writer fault knowledge base document, obtaining an RFID fault text, extracting an RFID fault text vector from the RFID fault text, and storing the RFID fault text vector in a vector database; converting the received query problem text into a query problem vector, and retrieving an RFID fault text vector in the vector database according to the degree of correlation with the query problem vector to obtain a target RFID fault text; and generating a prompt statement and prompt information according to the context prompt word of the target RFID fault text and a preset prompt template, inputting the prompt statement 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 a user. The technical problems of low text retrieval efficiency and poor accuracy in the background art can be solved.
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 of RFID readers based on 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 asset management, logistics tracking, and intelligent manufacturing. However, due to external environmental interference, hardware failures, software anomalies, and other factors, unstable operation and reading and writing failures often occur, which seriously affect production efficiency and service quality. Existing fault diagnosis methods include manual fault diagnosis, fault diagnosis based on knowledge graphs, and fault diagnosis based on knowledge base enhancement. Manual fault diagnosis relies on the experience and knowledge of experts. Although it is effective in some scenarios, it is highly dependent on the professional ability of personnel, has low diagnostic efficiency, and requires a lot of time to manually analyze problems when facing complex equipment. Information is also difficult to manage systematically. Fault diagnosis based on knowledge graphs helps technicians quickly find the cause of the fault and propose solutions by building an association graph between information such as equipment, faults, and solutions. However, its construction cost is high and its generalization ability for uncommon faults is weak. Fault diagnosis based on knowledge base enhancement combines pre-trained large language models and knowledge bases to automatically extract key information from fault descriptions and match them with the knowledge base to generate diagnostic suggestions. Although the level of automation is improved, the incoherent text semantics leads to low retrieval efficiency and poor accuracy. Summary of the invention

[0003] The main purpose of the present invention is to provide an RFID reader intelligent fault diagnosis method and system based on 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 object, the first aspect of the present invention provides an RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model, comprising the following steps:

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

[0006] Step S200: converting the received query question text into a query question vector, and searching 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;

[0007] Step S300: Generate prompt statements and prompt information according to 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: Obtain RFID reader fault knowledge base document;

[0010] Step S120: dividing 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 the contextual association between parent node texts through a bidirectional linked list and constructing 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: Calculate the initial segmentation length and overlap length according to 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 adjusting the segmentation length and the 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] In the formula, k n For keywords;

[0028] The segmentation length is adjusted according to the maximum length of the keyword, and 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 segmentation length;

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

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

[0033] In the formula, 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] The second aspect of the present invention provides an RFID reader intelligent fault diagnosis system based on knowledge base retrieval enhanced large model, characterized in that it includes:

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

[0039] A retrieval module, 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 to the query vector to obtain the target RFID fault text;

[0040] The answer module is used to generate a prompt sentence and prompt information according to the context prompt words of the target RFID fault text and a preset prompt template, input the prompt sentence and the target RFID fault text into a large language model to generate a diagnosis suggestion, and display the prompt information and the diagnosis 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 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 knowledge base retrieval enhanced large model. When the RFID reader / writer intelligent fault diagnosis program based on knowledge base retrieval enhanced large model is executed by a processor, the steps of the RFID reader / writer intelligent fault diagnosis method based on 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, wherein the RFID reader intelligent fault diagnosis method based on a 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, thereby significantly improving the retrieval efficiency; further, 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 ability of a 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 is generated, the dependence on manual experience is reduced, and the efficiency and reliability of fault diagnosis are improved; and the system is able to adapt to new fault types and maintain long-term effectiveness and accuracy by continuously updating the RFID fault knowledge base and optimizing model parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without creative work. The purpose, functional features and advantages of the present invention will be further explained in combination with the embodiments and with reference to the drawings.

[0046] Figure 1 A flow chart of an RFID reader intelligent fault diagnosis method based on a knowledge base retrieval enhanced large model provided in 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 in an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[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 components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication 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 technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "and / or" appearing in the full text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme that satisfies both A and B. 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 the field to implement. When the combination of technical solutions is 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 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 object, the first aspect of the present invention provides an RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model, comprising the following steps:

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

[0060] Step S200: converting the received query question text into a query question vector, and searching 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;

[0061] Step S300: Generate prompt statements and prompt information according to 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 1, in one embodiment of the present invention, the system exports the fault knowledge base documents of the RFID reader 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 failure, software failure, network failure, 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 operations such as stemming or word form restoration 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 the 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 the person in charge of the production line enters the query question "RFID reader cannot connect to the server" through the system interface, the system converts the query question into a vector form, retrieves the document vector most similar to the query vector in the vector database, and locates 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". The generation of the prompt statement combines the context prompt words provided by the parent node to enhance the semantic interpretation of the retrieval results. Then, the system inputs the prompt statement and the fault case text into the large language model to generate detailed diagnostic suggestions, 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 displays the generated diagnostic suggestions and prompt information to the person in charge of the production line in a user-friendly manner to help him quickly locate and solve the problem. It can be understood that the double-layer structure design of the parent node and the child node, combined with the efficient retrieval capability of the vector database, significantly improves the efficiency of similarity retrieval. The context prompt words provided by the parent node further enhance the semantic interpretation of the retrieval results, ensuring the rapid positioning 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: Obtain RFID reader fault knowledge base document;

[0065] Step S120: dividing 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 the contextual association between parent node texts through a bidirectional linked list and constructing 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] Where 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 It is the parent node, ensuring that the division maintains the integrity of paragraph-level semantics and the integrity of the context through the larger paragraph (parent node), which is used as a prompt template for subsequent retrieval.

[0071] Next, establish the contextual relationship between parent nodes. Parent nodes {T1, T2, ..., T n} establish forward and backward links in the form of a bidirectional linked list to construct 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 segmentation length chunk_size and overlap length overlap_size for segmentation:

[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 It is a child node C ij The end position is determined by the chunk 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, by embedding the vector Calculate the similarity with the query vector q:

[0079]

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

[0081] Finally, the retrieval results are optimized through the parent node prompt words. After the retrieval is completed, the semantic interpretability of the retrieval results is further enhanced through the context prompt words provided by the parent node Ti and output to the user. The parent node does not participate in the embedding, but can be used as a text prompt input to optimize the retrieval quality of the model. The prompt function of the parent node improves the interpretability of the retrieval results, especially in complex scenarios to help better understand the text context. This method combines the parent node and the child node of the hierarchical structure to solve the problem of semantic incoherence and fragment isolation after text segmentation. At the same time, the vectorized child node retrieval and the context prompt of the parent node improve the text similarity retrieval efficiency 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, ensuring that each parent node contains a complete paragraph, maintaining the semantic integrity of the paragraph level, avoiding the loss of context caused by segmentation in the middle of a paragraph, and improving 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 the fault knowledge base document of the RFID reader from the internal system of the enterprise, converts the fault knowledge base document of the RFID reader into a long text T, counts the length information (number of words in the text) and paragraph information of T, and determines the appropriate segmentation length chunk_size and overlap length overlap_size according to the length information and paragraph information of T. According to the specific content of the parent node text, the segmentation length and overlap length are adjusted based on the dynamic segmentation algorithm to ensure the rationality and semantic coherence of the child node content, and then the parent node text is segmented according to the segmentation length and overlap length to obtain the RFID fault text. It can be understood that the segmentation parameters are determined according to the structural information of the parent node text and the dynamic segmentation algorithm to ensure the rationality and semantic coherence of the child node content, thereby avoiding the problems caused by the fixed segmentation length; by dynamically adjusting the segmentation length and overlap length, the reasonable length of the child node content is ensured, and the influence of too long or too short fragments on the similarity retrieval is avoided, thereby further improving the retrieval efficiency; further, by the dynamic segmentation algorithm, it is ensured that each child node contains key information, thereby avoiding the omission of important information, thereby improving the comprehensiveness and accuracy of the diagnostic suggestions.

[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: Calculate the initial segmentation length and overlap length according to 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 the 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 the overlap length overlap_size0 are calculated according to 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, 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, 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 come from the knowledge base of the company's operation and maintenance management intelligent fault analysis and prediction system about RFID and other equipment, and can be manually added or model recognized. 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 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] In the formula, k n For keywords;

[0103] The segmentation length is adjusted according to the maximum length of the keyword, and 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 segmentation length;

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

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

[0108] In the formula, 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 the break of keywords, and improving the accuracy and completeness of the diagnosis 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 the following steps are also included:

[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 determine 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 the segmentation operation 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 into 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 fragments, and 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 is a specific example to illustrate how to dynamically adjust the segmentation length and overlap length based on the maximum length of the keyword. The system first obtains a fault knowledge base document of an RFID reader, which covers a variety of fault conditions, including hardware failure, software failure, and network failure. In order to better process this document, we need to perform multi-level segmentation on it and dynamically adjust the segmentation parameters.

[0120] Here is part 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] -Incompatible RFID reader firmware version

[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("Incompatible firmware version"),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. Assume that the adjusted segmentation length and overlap length still cause some keywords to be split across segments, for example, "Unable to connect to server" is split into two different segments. In this case, 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] The second aspect of the present invention provides an RFID reader intelligent fault diagnosis system based on knowledge base retrieval enhanced large model, characterized in that it includes:

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

[0178] A retrieval module, 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 to the query vector to obtain the target RFID fault text;

[0179] The answer module is used to generate a prompt sentence and prompt information according to the context prompt words of the target RFID fault text and a preset prompt template, input the prompt sentence and the target RFID fault text into a large language model to generate a diagnosis suggestion, and display the prompt information and the diagnosis 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 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 knowledge base retrieval enhanced large model. When the RFID reader / writer intelligent fault diagnosis program based on knowledge base retrieval enhanced large model is executed by a processor, the steps of the RFID reader / writer intelligent fault diagnosis method based on 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 is the control center of the RFID reader-writer intelligent fault diagnosis system based on knowledge base retrieval enhanced large model, and uses various interfaces and lines to connect the various parts of the entire RFID reader-writer intelligent fault diagnosis system based on knowledge base retrieval enhanced large model to process the executable device.

[0183] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the RFID reader intelligent fault diagnosis system based on knowledge base retrieval enhanced large model by running or executing the computer program and / or module 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, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[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, wherein the RFID reader intelligent fault diagnosis method based on a 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, thereby significantly improving the retrieval efficiency; further, 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 ability of a 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 is generated, the dependence on manual experience is reduced, and the efficiency and reliability of fault diagnosis are improved; and the system is able to adapt to new fault types and maintain long-term effectiveness and accuracy by continuously updating the RFID fault knowledge base and optimizing model parameters. 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 child nodes, effectively avoiding the problem of semantic breakage after text segmentation that is common in traditional text processing methods; the dynamic segmentation algorithm adjusts the segmentation length and overlapping 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-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and the equivalent structural transformations made by the contents of the present invention specification and drawings, or direct / indirect application in other related technical fields are all included in the scope of patent protection of the present invention. Therefore, the scope of protection of the patent of the present invention shall be subject to the attached 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: multi-level segmentation of the RFID reader fault knowledge base document to obtain an RFID fault text, and extracting an RFID fault text vector from the RFID fault text and storing it in a vector database; Step S200: converting the received query question text into a query question vector, and searching 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; Step S300: Generate prompt statements and prompt information according to 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.

2. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model as claimed in claim 1 is characterized in that: 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: Step S110: Obtain RFID reader fault knowledge base document; Step S120: dividing 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 the contextual association between parent node texts through a bidirectional linked list and constructing a semantic flow to provide contextual information when retrieving texts; Step S140: dynamically segment the parent node text according to a predefined child node segmentation rule to obtain an RFID fault text.

3. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model as claimed in claim 2 is characterized in that: In step S120, the parent node segmentation rule includes: 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.

4. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model as claimed in claim 2 is characterized in that: 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.

5. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model as claimed in claim 4 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: Calculate the initial segmentation length and overlap length according to 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 the 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.

6. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model as claimed in claim 5 is characterized in that: In step 420, 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 )) In the formula, k n For keywords; Step 422: adjusting 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 segmentation length; Step 423: Adjust the overlap length according to the maximum length of the keyword and the second percentile threshold of the segmentation length, using the following formula: overlap_size new =min(overlap_size old +|k max |,m×chunk_size new ) In the formula, 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.

7. The RFID reader intelligent fault diagnosis method based on knowledge base retrieval enhanced large model according to any one of claims 1 to 6, 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.

8. An intelligent fault diagnosis system for RFID readers based on knowledge base retrieval enhanced large model, characterized in that: include: A segmentation module is used to perform multi-level segmentation on the RFID reader fault knowledge base document to obtain an RFID fault text, and extract an RFID fault text vector from the RFID fault text and store it in a vector database; A retrieval module, 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 to the query vector to obtain the target RFID fault text; The answer module is used to generate a prompt sentence and prompt information according to the context prompt words of the target RFID fault text and a preset prompt template, input the prompt sentence and the target RFID fault text into a large language model to generate a diagnosis suggestion, and display the prompt information and the diagnosis suggestion to the user.

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

10. 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 method for intelligent fault diagnosis of an RFID reader based on knowledge base retrieval enhanced large model as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Text retrieval method, device and system

    CN116821282A

  • Question response method and device based on large language model

    CN117235226A

  • Fault diagnosis method and device, electronic equipment and storage medium

    CN117331730A

  • Intelligent question answering method and device based on large language model, equipment and storage medium

    CN117556020A

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

    CN117828050A

Cited By

  • Hard disk fault diagnosis method and electronic equipment

    CN120832263A

  • Harvester fault diagnosis method and device, electronic equipment and storage medium

    CN120873169A

  • Electromechanical coupling system fault diagnosis method and system based on multi-level vector library

    CN121390329A

  • Electromechanical coupling system fault diagnosis method and system based on multi-level vector library

    CN121390329B

  • Private network data generation method and device, electronic equipment and storage medium

    CN121579455A