Avionics software defect prevention method based on RAG and optimization prompt LLM
By applying RAG -based and optimizing prompt LLM in the aviation electronic system, combining the thinking chain and the Monte Carlo tree search algorithm, constructing a reasonable tree tree to solve the lack of technical technology in the prevention of avionics software defects, and achieve more efficient software. Quality management.
Patent Information
- Application Number
- CN202411321663.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-23
AI Technical Summary
In avionics systems, the prior art lacks mature solutions in the prevention of defects of avionics software, resulting in insufficient software quality management.
Based on a large -scale language model (LLM) based on retrieval reinforcement technology (RAG) and optimization prompts, combined with the thinking chain thought and the Monte Carlo tree search algorithm to build a reasoning tree to improve LLM's ability to solve problems in complex professional fields.
By integrated text data in the field of professional fields and the reasoning capabilities of large language models, the ability to identify and solve the problem of complex avionics software defects has been improved, and the efficiency and effect of software quality management have been significantly improved.
Smart Images

Figure CN119376777A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software quality assurance and project management, and relates to an avionics system, a large language model (LLM), prompt engineering and retrieval enhancement generation technology (RAG), and specifically provides an avionics software defect prevention method based on RAG and optimized prompt LLM. Background Art
[0002] In the current aviation field, the application of embedded airborne avionics software has become an important factor in promoting aircraft innovation and performance improvement. The function and performance level of an aircraft are directly subject to its complex and sophisticated avionics software. These avionics software must meet strict safety standards and certification requirements, because the failure of avionics software may lead to serious consequences. Therefore, strict safety specifications must be followed during the design, development and testing of avionics software to ensure that the aircraft can operate reliably under various conditions.
[0003] Considering the key role of avionics software in avionics systems, higher requirements are placed on software quality management. According to the Capability Maturity Model (CMMI), software quality management includes multiple means, such as software quality assurance, peer review, quantitative quality management, and defect prevention. At present, software quality management of avionics system software mainly covers methods such as software quality assurance and peer review, but there is still a lack of mature solutions for defect prevention.
[0004] By utilizing a large amount of relevant data generated in the past avionics software development process, we can extract the defects and fault records that have occurred in the development process, and provide knowledge and experience guidance for the subsequent development process to improve software quality management by using defect prevention. This is a possible solution for defect prevention. By making full use of past data, we can better prevent problems that may occur in the development process, thereby improving the development efficiency and the overall quality level of the avionics system.
[0005] In recent years, large language models (LLMs) trained on a wide range of data sets have demonstrated their enhanced capabilities in tasks such as semantic recognition, text reasoning, and especially in general question answering. However, LLMs are still insufficient in their ability to acquire and accurately process specific knowledge, such as reasoning and answering questions about internal enterprise data. In this case, LLMs need to be fused with external knowledge sources. The retrieval-augmented generation technique RAG introduces a retrieval algorithm based on the similarity of the embedding space between queries and documents. With the help of this external knowledge, this capability not only broadens the application areas of LLMs, but also improves the ability to reason about and provide solutions to problems in professional fields. In less common fields or when using private data, LLMs based on factual external knowledge can reduce the generation of factual inaccuracies and hallucinations.
[0006] Defect problems in avionics systems are often very complex. Problems may involve various stages of research and development, coding, integration, testing, etc., or various functional modules of avionics systems. This requires LLM to have higher complex reasoning capabilities when providing solutions to defect problems. For example, the domestic patent document with the publication number CN117933392A proposes a Monte Carlo tree search method and device based on science problem-solving tasks, which constructs a reasoning tree to improve the reasoning performance of large language models in science problem-solving tasks. In addition, when LLM uses retrieval enhancement technology to introduce external knowledge, it needs to integrate knowledge data from all aspects of the problem. Combining the idea of thinking chain with RAG, in each reasoning step, retrieve relevant content information to assist reasoning and decision-making, expand the reasoning path, and thus improve the ability of LLM to solve complex professional problems. Summary of the invention
[0007] The purpose of the invention is to provide an avionics software defect prevention method based on RAG and optimization prompt LLM, adopt the thinking chain idea, construct a reasoning state tree and introduce retrieval enhancement technology to improve the ability of LLM to solve complex professional field problems.
[0008] The object of the present invention is achieved through the following technical solutions:
[0009] An avionics software defect prevention method based on RAG and optimization hint LLM includes the following steps:
[0010] S1: Collect literature and books related to the field of digital avionics technology, and collect various version history records and defect sample data in the avionics system R&D process;
[0011] S2: Convert the literature and books related to the field of digital avionics technology into standardized domain text data; use LLM to extract change sample data from various version history records, extract the problem content, cause and solution from the defect text data, and generate defect sample data in a unified format;
[0012] S3: Use LLM to segment domain text data and defect sample data. The segmented text blocks are input into LLM for embedding operation. After being converted into vector representations that can capture the meaning of the text and related information, a vector database is constructed. The position of each text in the vector database is determined by its corresponding vector.
[0013] S4: According to the content of the defect problem, search for several text block vectors with high correlation with it in the vector database, decode the searched text block vectors, and convert them into text data;
[0014] S5: Take the defect problem text as the initial reasoning state node of the reasoning state tree, and expand along the path with high value score toward the leaf node until a leaf node is reached; if the leaf node has been visited, combine the reasoning state node text generated by the current leaf node or retrieve the highly relevant text embedding in the vector database through text embedding, convert it into text data, and use LLM to generate a new reasoning state node as the child node of the leaf node, so as to expand the branch of the tree; if the leaf node has not been visited, enter S6 and update the number of visits to the node on the current path;
[0015] S6: Combine the reasoning state text of the current node with the input problem, call LLM for scoring, if the LLM evaluation result shows that the text is sufficient to solve the problem, then the text is selected as the final solution; if the text is not sufficient to solve the problem, then the text is value scored, and the value scores and visit times of all visited nodes on this round of paths are updated; when the number of reasoning steps reaches the preset maximum limit, select the leaf node in the path with the highest value score, combine its reasoning state text and input problem, and call LLM again to generate the final solution. If the maximum number of steps is not reached, return to S5 to continue building and evaluating the reasoning path.
[0016] Furthermore, S1 uses automation technology to crawl text materials in related fields within the enterprise to obtain various version history records and defect sample data generated by the avionics system R&D process in actual work.
[0017] Furthermore, in S3, optical character recognition is performed on the collected documents and books related to the field of digital avionics technology, and the image format is converted into editable text, while non-text elements in the document are removed, and non-text characters generated during the OCR process are deleted, and OCR errors and spelling errors are repaired, and then the text format is standardized;
[0018] For the collected historical records of various versions, key information such as the content of changes and reasons for changes are extracted through analysis to form change sample data;
[0019] Process problem report data, review data, and defect report data, extract problem content, causes, and solutions, and generate defect sample data in a unified format;
[0020] Change sample data and defect sample data include detailed description of the defect, scope of impact, solution measures and prevention strategy.
[0021] Further, the specific steps of S5 are as follows:
[0022] S51: Obtain the defect problem text, and use the defect problem text as the initial reasoning state node;
[0023] S52: Calculate the value score of each node in the current reasoning state tree using the upper confidence boundary formula, select the node with the value score as the next path selection, and build a path from the root node to the leaf node;
[0024] S53: Check whether the leaf node has been visited. If it has been visited, take the reasoning state text corresponding to the node as input, combine the currently generated reasoning state node text or according to the embedding of the text, retrieve several highly relevant text embeddings in the vector database, convert them into text data, merge these data and call LLM to generate several reasoning state nodes as child nodes of the leaf node, so as to expand the reasoning state tree; if the node has not been visited, enter S6 to score the value of the node to decide whether to use it as part of the reasoning path;
[0025] S54: After the value evaluation, the newly generated first child node is selected as the current node, and S6 is entered again to continue the expansion of the reasoning state tree;
[0026] S6 specific steps are as follows:
[0027] S61: combining the reasoning status text and defect problem text corresponding to the node, calling LLM to evaluate the completion of solving the defect problem of the node;
[0028] S62: If the reasoning status text is not sufficient to solve the problem, a value evaluation is performed to update the nodes visited on this round of paths and their visit times;
[0029] S63: If the preset maximum number of reasoning steps has been reached at this time, a leaf node is selected from the path with the highest value score, and the reasoning status text and defect problem corresponding to the node are combined to call LLM to generate the final solution; if the preset maximum number of reasoning steps has not been reached at this time, return to step S52 and loop this process until a satisfactory solution is reached or the maximum number of reasoning steps is reached.
[0030] The beneficial effects of the present invention are:
[0031] The present invention discloses an avionics software defect prevention method based on RAG and optimization hint LLM, which combines the text reasoning ability of a large language model with text data in a professional field. The Monte Carlo tree search algorithm is used to improve the relevance of text information retrieval and the accuracy of multi-step reasoning of a large language model. Avionics systems are ultra-large-scale complex systems. Defect problems that occur in the R&D process involve a large amount of professional content and complex logical reasoning. This method combines effective text information with accurate multi-step reasoning, and provides accurate solutions by calling a large language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The present invention is a flowchart of an avionics software defect prevention method based on RAG and optimization hint LLM.
[0033] Figure 2 Flowchart for the Monte Carlo Tree Search algorithm.
[0034] Figure 3 Build a graph for the inference state tree. DETAILED DESCRIPTION
[0035] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0036] like Figure 1 As shown, the avionics software defect prevention method based on RAG and optimization hint LLM shown in this embodiment includes three main parts, namely knowledge base construction, reasoning state tree construction and value assessment. In the knowledge base construction, it includes source data collection processing S1, data preprocessing S2 and vector database construction S3. In the reasoning state tree construction, it includes search and information integration S4 and reasoning state tree expansion S5. In the value assessment, it includes value assessment S6. This embodiment first performs source data collection processing, which includes processing document books through OCR technology, deleting non-text elements, fixing errors, and standardizing text formats, while collecting and extracting key text records and defect sample data in the avionics system R&D process. Subsequently, LLM is used to perform text segmentation and vectorization, and a vector database is constructed to represent the position of the text in the vector space. In the search and information integration stage, relevant text blocks are retrieved in the vector database according to the problem content, and these blocks are decoded back to the original text for use by LLM to generate content. The reasoning state tree expansion involves starting from the initial state node, calculating the node value score, selecting and expanding the path, and using LLM to generate new reasoning state nodes until the leaf node is reached. In the value assessment phase, LLM is used to score the reasoning status text to decide whether to take it as a solution or continue to expand until a complete solution is obtained or the maximum number of reasoning steps is reached. The specific description of each step is as follows:
[0037] Source data collection and processing S1: Collect literature and books related to the field of digital avionics technology, and ensure that the collected information is extensive and representative by systematically combing the knowledge system in this field; collect relevant text records in the avionics system R&D process, including various version history records, defect sample data, etc.
[0038] Among them, automation technology can be used to crawl text materials in relevant fields within the enterprise, including but not limited to email communications, internal reports, technical specifications and design documents, etc., to obtain various types of text information generated by the avionics system development process in actual work. For example, various version history records and change content records of the avionics software development process stage can be crawled from version control systems such as SVN. These records can reflect the specific details of software iterations; at the same time, problem report PR (Problem Report), change request CR (Change Request) data, peer review meeting record review data and defect report data can be crawled from project management and issue tracking tools such as JIRA. These data provide direct evidence for defect discovery and handling.
[0039] Data preprocessing S2: Convert the literature and books related to the field of digital avionics technology into standardized field text data; use LLM to extract change sample data from various version history records, and extract key information such as problem content, cause and solution from defect text data to generate defect sample data in a unified format. The specific method is as follows:
[0040] Optical character recognition (OCR) was performed on the collected documents and books related to the field of digital avionics technology to convert the image format into editable text, while removing non-text elements in the document such as pictures and tables, as well as deleting non-text characters generated during the OCR process, and repairing OCR errors and spelling errors to ensure the accuracy and readability of the text. Next, the text format was standardized to unify the font, font size and paragraph format to provide a consistent text basis for subsequent analysis.
[0041] For various version history records in the version control system, key information such as change content and change reason analysis is extracted through analysis to form change sample data. At the same time, the problem report data, review data and defect report data in the project management and issue tracking tools are processed to extract key content such as problem content, cause and solution, and generate defect sample data in a unified format. This extraction process can be achieved by calling a large language model (LLM). Using its text processing capabilities, it can automatically identify and extract key information in the text to generate change sample data and defect sample data. These change sample data and defect sample data usually contain detailed descriptions of defects, impact scope, solutions and prevention strategies, providing rich examples for building defect prevention models. In the entire data preprocessing step, the extraction of key content and the generation of sample data must be performed accurately to ensure the quality and consistency of the data.
[0042] Vector database construction S3: Use a large language model (LLM) to segment the domain text data and defect sample data. The segmented text blocks are input into the LLM for embedding operations and converted into vector representations that can capture the meaning of the text and related information. These vectors are then used to build a vector database. The position of each text in the vector database is determined by its corresponding vector, which represents the distribution of the text in the vector space. The specific method is as follows:
[0043] S31: Use the data loader to load domain text data and defect sample data, use the large language model (LLM) loop call to perform semantic analysis, set appropriate text cutting points based on the semantic recognition of the content, and ensure the semantic integrity of the text block.
[0044] S32: Embedding processing is performed on the cut text blocks, and the text is converted into a meaningful vector representation through LLM. This process involves mapping the language information in the text to points in a high-dimensional space to capture the semantic content and contextual information of the text.
[0045] S33: Based on these embedded vectors, a vector database is constructed, which will store the position of the text data in the vector space and provide an index for subsequent query and analysis. During the construction process, the structural design and index strategy of the database need to be considered to optimize query efficiency and data processing speed.
[0046] Search and information integration S4: According to the content of the defect problem, search for several text block vectors with high correlation in the vector database, decode the searched text block vectors, convert them into text data to extract information, and use this information when calling LLM to generate content later. The specific steps are as follows:
[0047] S41: Based on the content of the input defect question, a search operation is performed in the vector database, and a number of text block vectors with high semantic relevance are identified by calculating the similarity between the defect question and the text block vectors stored in the database. The search process is completed by calculating the similarity between the input question vector and the vectors stored in the database.
[0048] S42: The retrieved text block vector is then converted back to text data through decoding. This conversion process involves mapping the information represented by the vector back to a readable text format to ensure the integrity and readability of the information. The extracted information will be used in the subsequent content generation process, where the large language model (LLM) can be called again to generate targeted content, using the retrieved information to improve the relevance and accuracy of the generated text.
[0049] The reasoning state tree is expanded S5, with the defect problem text as the initial reasoning state node of the reasoning state tree, and it is expanded along the path with high value score toward the leaf node until a leaf node is reached. If the leaf node has been visited, the reasoning state text of the node is used, combined with the currently generated reasoning state node text or through text embedding to retrieve highly relevant text embedding in the vector database, and converted into text data, and a new reasoning state node is generated using LLM as the child node of the leaf node, thereby expanding the branch of the tree. If the leaf node has not been visited, it enters the value evaluation S6, scores the value of the node, and updates the number of visits to the node on the current path.
[0050] The specific steps are as follows:
[0051] S51: Obtain the defect problem text and use the defect problem text as the initial reasoning state node. Set the defect problem text as the root node of the reasoning state tree, representing the starting point of the reasoning process.
[0052] S52: Calculate the value score of each node in the current reasoning state tree, and build a path from the root node to the leaf node. Use the upper confidence bound formula (Upper Confidence Bound UCB) to select the node with a high UCB value as the next path selection until a leaf node is reached.
[0053] S53: Check whether the leaf node has been visited. If it has been visited, the reasoning state text corresponding to the node is used as input, and several highly relevant text embeddings are retrieved in the vector database in combination with the currently generated reasoning state node text or according to the embedding of the text. After converting to text data, these data are merged and LLM is called to generate several reasoning state nodes as child nodes of the leaf node, thereby expanding the reasoning state tree. If the node has not been visited, enter the value evaluation step to score the value of the node to determine whether to use it as part of the reasoning path.
[0054] S54: After the value evaluation, select the first newly generated child node as the current node, enter the value evaluation step again, and continue to expand the reasoning state tree. In the whole process, the Chain of Thought CoT strategy is adopted to combine the input content and a series of intermediate reasoning steps. The reasoning state tree is a variant of the chain of thought. The root node of the tree is the known input content, and the intermediate nodes are the intermediate reasoning steps expanded according to the input content. According to the current reasoning state combined with external knowledge or other reasoning state content, call LLM to generate new reasoning state nodes as child nodes of these nodes. In this way, the reasoning decision is expanded to improve the comprehensiveness and accuracy of the solution given according to the input problem.
[0055] When the preset maximum number of reasoning steps is reached, the leaf node in the path with the highest value score is selected, the reasoning state text of the node is combined with the input problem, and LLM is called to give the final solution. If the maximum number of reasoning steps is not reached, it returns to the step of selecting a high-value scoring node and continues to expand the reasoning path. Throughout the process, the thinking chain strategy is adopted, combining the input content and the intermediate reasoning steps, and new reasoning state nodes are generated through LLM. At the same time, the Monte Carlo search algorithm is used to make efficient decisions and optimizations on the selection and expansion of reasoning steps, ensuring that the reasoning state tree can gradually build a comprehensive reasoning path for the input problem.
[0056] Value evaluation S6: Combine the reasoning state text of the current node with the input problem, call LLM for scoring to evaluate the extent to which the text solves the input problem. If the LLM evaluation result shows that the text is sufficient to solve the problem, the text is selected as the final solution. If the text is not sufficient to solve the problem, the text is valued and the value scores and number of visits of all visited nodes on this round of paths are updated. When the number of reasoning steps reaches the preset maximum limit, select the leaf node in the path with the highest value score, combine its reasoning state text and input problem, and call LLM again to generate the final solution. If the maximum number of steps is not reached, return to the reasoning state tree expansion S5 to continue building and evaluating the reasoning path.
[0057] The specific steps are as follows:
[0058] S61: Combine the reasoning state text and defect problem text corresponding to the node, and call LLM to evaluate the completion of solving the defect problem of the node. This scoring process uses the self-criticism ability of LLM. Through another preset prompt evaluation, LLM scores whether the current reasoning state text is accurate and fully answers the defect problem. If the LLM evaluation believes that the reasoning state text is sufficient to solve the defect problem, this reasoning state text is selected as the final solution.
[0059] S62: If the reasoning status text is not sufficient to solve the problem, a value assessment is performed. The nodes visited on this round of the path and their visit counts are updated. This update process involves back-propagating the value and visit count of all nodes on the reasoning path to reflect the contribution of the current node's reasoning status text to solving the defect problem.
[0060] S63: If the preset maximum number of reasoning steps has been reached, a leaf node is selected from the path with the highest value score, and the LLM is called to generate the final solution in combination with the reasoning status text and defect problem corresponding to the node.
[0061] S64: If the preset maximum number of reasoning steps has not been reached at this time, return to step S52 and loop this process until a satisfactory solution is reached or the maximum number of reasoning steps is reached.
[0062] In this process, the self-criticism function of LLM is used to score the accuracy and completeness of the current reasoning state text through preset prompts, so as to back-propagate and update the value score of the node. In addition, the upper confidence bound formula (UCB) is used to select the node with the highest value score on the current reasoning path to achieve a balance between exploration and utilization. The purpose of this step is to gradually optimize the reasoning state tree through accurate value evaluation and effective path selection to generate a solution that best meets the requirements of the input problem.
[0063] like Figure 2 As shown in the figure, the Monte Carlo tree search algorithm can be divided into four steps: selection, expansion, simulation, and back propagation. First, an input question is received, which is then set as the root node of the inference state tree. The flowchart guides how to explore and generate solutions by building and expanding the inference state tree through a series of judgment and operation steps.
[0064] In the selection step, the algorithm first checks whether the current node is a leaf node, that is, whether it has no unexplored child nodes. If the node has been explored, it will not be explored again, but will go directly to the next step. If the node is a leaf node and has not been explored, the algorithm will adopt the upper confidence bound (UCB) strategy and select the child node with the largest UCB value of the node as the current node for the next step. UCB is a strategy that balances exploration and exploitation. It guides the search process by calculating the potential value and exploration frequency of the node.
[0065] In the expansion step, after selecting a node, the text corresponding to the node is combined with the text of other nodes or external knowledge, and the LLM (Large Language Model) is called to generate several new node texts, which represent the new states that may be obtained through different reasoning paths starting from the current state. After generating the new node text, the algorithm uses the first newly generated node as the new current node.
[0066] In the simulation step, the value of the current node needs to be evaluated. The value evaluation is done by calling the score given by LLM, which reflects the degree to which the current node text solves the input problem. If the score shows that the current node text is sufficient to solve the problem, it is selected as the final solution.
[0067] In the back-propagation step, if the simulated nodes are not enough to solve the problem, the algorithm will update the value score and the number of visits of the nodes on the current path, and then back-propagate this information to optimize the subsequent node selection. The algorithm then re-enters the selection step and loops this process until the selected nodes are sufficient to solve the target problem or the maximum number of reasoning steps is reached. This is an iterative and recursive search process that gradually approaches the solution to the problem by continuously expanding and evaluating the nodes in the reasoning state tree. This process effectively combines the strategies of deep search and breadth search, using the generation ability of LLM and the selection strategy of UCB to find the optimal solution in a complex reasoning space.
[0068] like Figure 3 The figure shows the construction of the reasoning state tree. The initial state starts with the input question, i.e. Q, and the reasoning state tree is constructed with this as the root node. i is the text content corresponding to each inference state node, D i N is the external knowledge introduced. i is the current exploration count of the node. i is the number of children of the node. First check whether the node is a leaf node. At the start state, the node corresponding to Q is a leaf node and has not been explored. Then call LLM to determine whether external knowledge needs to be introduced for the next reasoning. As shown in the figure, for the relevant texts D1 and D2 retrieved from the vector database, calling LLM respectively can obtain the next reasoning state texts S1 and S2, or directly generate the next reasoning state text S3 without external knowledge. In this loop, LLM enumerates possible next reasoning states based on the input question, adds them to the tree, and sets the current node to the first generated new node, that is, S1. Perform a value evaluation operation on S1 and obtain a score of V1. Enter the backpropagation operation, that is, update the value V for all nodes on the exploration path of the current loop. i and N i , V i That is, the sum of the value scores of all child nodes of the node, N i This is the number of explorations of the node.
[0069] In the subsequent loops, it is necessary to build an exploration path starting from the root node. For example, in the path marked by the red line, each time the next node is selected, the UCB values of all child nodes of the current node need to be calculated. For the state node S i , calculate its UCB value, the UCB formula is:
[0070]
[0071] Where C is a constant. Select the child node with the largest UCB value as the current node, and repeat this process until the current node is a leaf node for subsequent operations. In the process of expanding the node, call LLM to determine whether to introduce external knowledge or generate a new reasoning state based on other reasoning state node texts.
[0072] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for preventing avionics software defects based on RAG and optimization hint LLM, characterized in that The following steps are involved: S1: Collect literature and books related to the field of digital avionics technology, and collect various version history records and defect sample data in the avionics system R&D process; S2: Convert the literature and books related to the field of digital avionics technology into standardized domain text data; use LLM to extract change sample data from various version history records, extract the problem content, cause and solution from the defect text data, and generate defect sample data in a unified format; S3: Use LLM to segment domain text data and defect sample data. The segmented text blocks are input into LLM for embedding operation. After being converted into vector representations that can capture the meaning of the text and related information, a vector database is constructed. The position of each text in the vector database is determined by its corresponding vector. S4: According to the content of the defect problem, search for several text block vectors with high correlation with it in the vector database, decode the searched text block vectors, and convert them into text data; S5: Take the defect problem text as the initial reasoning state node of the reasoning state tree, and expand along the path with high value score toward the leaf node until a leaf node is reached; if the leaf node has been visited, combine the reasoning state node text generated by the current leaf node or retrieve the highly relevant text embedding in the vector database through text embedding, convert it into text data, and use LLM to generate a new reasoning state node as the child node of the leaf node, so as to expand the branch of the tree; If the leaf node has not been visited, then go to S6 and update the number of visits to the node on the current path; S6: Combine the reasoning state text of the current node with the input problem and call LLM for scoring. If the LLM evaluation result shows that the text is sufficient to solve the problem, the text is selected as the final solution. If the text is not sufficient to solve the problem, the text is scored, and the value scores and visit times of all visited nodes on this round of paths are updated; when the number of reasoning steps reaches the preset maximum limit, the leaf node in the path with the highest value score is selected, and its reasoning state text and input problem are combined, and LLM is called again to generate the final solution. If the maximum number of steps is not reached, return to S5 to continue building and evaluating the reasoning path.
2. The avionics software defect prevention method based on RAG and optimization hint LLM according to claim 1 is characterized in that In S1, automation technology is used to crawl text materials in relevant fields within the enterprise to obtain various version history records and defect sample data generated by the avionics system R&D process in actual work.
3. The avionics software defect prevention method based on RAG and optimization hint LLM according to claim 1 is characterized in that In S3, optical character recognition is performed on the collected documents and books related to the field of digital avionics technology, and the image format is converted into editable text. At the same time, non-text elements in the document are removed, and non-text characters generated during the OCR process are deleted. OCR errors and spelling errors are repaired, and then the text format is standardized; For the collected historical records of various versions, key information such as the content of changes and reasons for changes are extracted through analysis to form change sample data; Process problem report data, review data, and defect report data, extract problem content, causes, and solutions, and generate defect sample data in a unified format; Change sample data and defect sample data include detailed description of the defect, scope of impact, solution measures and prevention strategy.
4. The avionics software defect prevention method based on RAG and optimization hint LLM according to claim 1 is characterized in that The specific steps of S5 are as follows: S51: Obtain the defect problem text, and use the defect problem text as the initial reasoning state node; S52: Calculate the value score of each node in the current reasoning state tree using the upper confidence boundary formula, select the node with the value score as the next path selection, and build a path from the root node to the leaf node; S53: Check whether the leaf node has been visited. If it has been visited, take the reasoning state text corresponding to the node as input, combine the currently generated reasoning state node text or according to the embedding of the text, retrieve several text embeddings with high relevance in the vector database, convert them into text data, merge these data and call LLM to generate several reasoning state nodes as child nodes of the leaf node, so as to expand the reasoning state tree; If the node has not been visited, then go to S6 to score the value of the node to decide whether to include it as part of the reasoning path; S54: After the value evaluation, the newly generated first child node is selected as the current node, and S6 is entered again to continue the expansion of the reasoning state tree; S6 specific steps are as follows: S61: combining the reasoning status text and defect problem text corresponding to the node, calling LLM to evaluate the completion of solving the defect problem of the node; S62: If the reasoning status text is not sufficient to solve the problem, a value evaluation is performed to update the nodes visited on this round of paths and their visit times; S63: If the preset maximum number of reasoning steps has been reached at this time, a leaf node is selected from the path with the highest value score, and the reasoning status text and defect problem corresponding to the node are combined to call LLM to generate the final solution; if the preset maximum number of reasoning steps has not been reached at this time, return to step S52 and loop this process until a satisfactory solution is reached or the maximum number of reasoning steps is reached.
Citation Information
Patent Citations
Monte Carlo tree searching method and device based on science question answering task
CN117933392A
Intelligent query reasoning method and device based on knowledge graph and large language model collaboration
CN117743531A
Construction industry safety question and answer method and equipment based on large language model technology
CN118332092A
Algorithm-driven brain graph model construction method for tobacco enterprises
CN118396105A
Cited By
VPN (Virtual Private Network) rapid auto-negotiation connection method and device
CN120675907A