Automobile software development question and answer method and device, storage medium and equipment

By combining retrieval-enhanced generation and large language modeling methods, a knowledge base question-answering assistant was constructed, which solved the problem of high learning difficulty in automotive software requirements documents and achieved efficient knowledge retrieval and accurate question-answering result generation.

CN121278044APending Publication Date: 2026-01-06CHINA FAW CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511226981.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

The rapid version iterations of automotive software requirements documents, detailed security level classifications, and complex terminology systems result in a steep learning curve for employees and low efficiency in knowledge retrieval.

Method used

A knowledge base question-answering assistant is constructed by combining Retrieval Enhancement Generation (RAG) and Large Language Model (LLM). It can quickly locate relevant content in the knowledge base through keyword retrieval and vector retrieval, and reorder the retrieval results to generate question-answering results for automotive software development.

Benefits of technology

It reduces the difficulty for users to learn about automotive software requirements documents, improves knowledge retrieval efficiency, and ensures the accuracy and relevance of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121278044A_ABST
    Figure CN121278044A_ABST
Patent Text Reader

Abstract

The invention provides an automobile software development question and answer method and device, a storage medium and equipment, in the method, an automobile software demand document is used as a data basis, question and answer processing is carried out in a mode of combining retrieval enhancement generation and a large language model, and based on an automobile software development problem, the question and answer efficiency is improved. Searching a retrieval result related to the automobile software development problem in the knowledge base by adopting a keyword retrieval method and a vector retrieval method, so as to more comprehensively mine potential related information in the knowledge base; and then, reordering the retrieval results to obtain context information, and inputting the context information and the automobile software development problem into a large language model to generate an automobile software development question and answer result. According to the method, rich and accurate context information is injected into the large language model, so that model response better meets actual requirements, time and energy of a user for manually searching massive documents are saved, difficulty of the user for learning automobile software demand documents is reduced, and knowledge retrieval efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive technology, and more specifically, to a question-and-answer method, apparatus, storage medium, and device for automotive software development. Background Technology

[0002] Automotive software requirements documents (KQAs) are core documents in automotive product development. They are primarily used to clearly record and describe the specific software requirements of new or modified vehicle models, covering key elements such as functional requirements, performance indicators, and safety standards. Automotive company employees need to study KQAs to ensure development meets requirements. However, KQAs are characterized by rapid version iterations, detailed safety level classifications, and complex terminology, resulting in a steep learning curve for employees. Employees often need to manually search for necessary knowledge within a vast amount of KQAs, leading to inefficient knowledge retrieval. Summary of the Invention

[0003] The purpose of this application is to provide a question-and-answer method, apparatus, storage medium, and device for automotive software development, aiming to solve the problem in related technologies where employees face a steep learning curve when learning automotive software requirements documents, need to manually search for the required knowledge in a large number of requirements documents, and have low knowledge retrieval efficiency.

[0004] Firstly, this application provides a question-and-answer method for automotive software development, comprising: acquiring text data of an automotive software requirements document; dividing the text data into multiple text units according to automotive functional modules; storing the text units in a knowledge base; the knowledge base includes a vector database and a relational database; the vector database is used to store text vectors corresponding to the text units; the relational database is used to store structured fields corresponding to the text units; based on an automotive software development question, performing keyword retrieval and vector retrieval in the knowledge base to obtain retrieval results related to the automotive software development question; reordering the retrieval results to obtain context information; and inputting the automotive software development question and the context information into a large language model to generate automotive software development question-and-answer results.

[0005] In the above implementation process, using automotive software requirements documents as the data foundation, a combination of retrieval-enhanced generation and a large language model is employed for question-answering. Based on automotive software development questions, keyword retrieval and vector retrieval methods are used to search for relevant search results in the knowledge base, thereby more comprehensively mining potential related information within the knowledge base. Subsequently, the search results are reordered to obtain contextual information, which is then combined with the automotive software development questions and input into the large language model to generate automotive software development question-answering results. In this way, by injecting rich and accurate contextual information into the large language model, the model's response can better match actual needs. This saves users time and effort from manually searching through massive amounts of documents, reduces the difficulty for users to learn automotive software requirements documents, and improves knowledge retrieval efficiency.

[0006] Furthermore, in some examples, obtaining the text data of automotive software requirements documents includes: collecting automotive software requirements documents covering the entire lifecycle versions; the automotive software requirements documents having multiple document formats; and preprocessing the automotive software requirements documents to obtain text data.

[0007] In the above implementation process, the collected automotive software requirements documents can cover the entire lifecycle versions and have diverse document formats to cover information from different sources and historical stages; the collected automotive software requirements documents are then preprocessed to facilitate subsequent retrieval and processing.

[0008] Furthermore, in some examples, the preprocessing of the automotive software requirements document includes: removing redundant information from the automotive software requirements document; the redundant information includes redundant version numbers in headers and footers and meeting minutes content; and standardizing the automotive software requirements document; the standardization process includes unifying letter formats, standardizing terminology, and standardizing encoding.

[0009] In the above implementation process, since the collected automotive software requirements documents often contain a large amount of irrelevant content and inconsistent formatting, the collected documents are cleaned according to the characteristics of automotive documents, and then the letter format, technical terminology and encoding format of the documents are standardized. In this way, the quality and usability of the knowledge base are effectively improved.

[0010] Furthermore, in some examples, the step of performing keyword retrieval and vector retrieval based on the automotive software development problem in the knowledge base to obtain retrieval results related to the automotive software development problem includes: extracting keywords from the automotive software development problem, searching for document fragments containing the keywords in the index of the knowledge base to obtain keyword retrieval results; converting the automotive software development problem into a vector representation using a pre-trained large language model, performing a similarity search in the vector database based on the vector representation to obtain vector retrieval results; and fusing the keyword retrieval results and the vector retrieval results to obtain retrieval results related to the automotive software development problem and corresponding comprehensive scores.

[0011] In the above implementation process, during fusion retrieval, keyword retrieval technology can be used to extract keywords from automotive software development questions. This allows for searching the knowledge base index for document fragments containing these keywords and related nodes. Additionally, vector retrieval technology is used to convert the question text into a vector representation using a pre-trained large language model. Then, semantically similar text vectors are searched in a vector database to find knowledge content semantically related to the question. Finally, the results of keyword retrieval and vector retrieval are fused, and a comprehensive score is calculated for each retrieval result. This improves the accuracy and recall of the retrieval process.

[0012] Furthermore, in some examples, the extraction of keywords from automotive software development problems includes: using a keyword retrieval method to extract initial keywords from the automotive software development problems; obtaining synonyms of the initial keywords through a target thesaurus; the target thesaurus recording synonyms of automotive terms; and determining the initial keywords and the synonyms as keywords extracted from the automotive software development problems.

[0013] In the above implementation process, after analyzing user questions and extracting keywords, the synonyms in the automotive field can be automatically expanded. By matching these keywords and synonyms in the knowledge base index, document fragments containing these words can be quickly located, and a batch of potentially related knowledge content can be initially screened out.

[0014] Furthermore, in some examples, the fusion of the keyword search results and the vector search results to obtain search results and corresponding comprehensive scores related to the automotive software development problem includes: combining the keyword search results and the vector search results into multiple search results related to the automotive software development problem; for each search result, normalizing and weighting the scores of the keyword search results and the vector search results corresponding to the search result to obtain the comprehensive score corresponding to the search result; wherein, when the search result corresponds to a security-related document, the weight of the keyword search result score is the first weight, and the weight of the vector search result score is the second weight; when the search result corresponds to a non-security-related document, the weight of the keyword search result score is the third weight, and the weight of the vector search result score is the fourth weight; the first weight is greater than the third weight; the second weight is greater than the fourth weight.

[0015] In the above implementation process, when the results of keyword retrieval and vector retrieval are combined, by setting weights, the score of security-related documents will be amplified when sorting the search results, ensuring that they are displayed first.

[0016] Furthermore, in some examples, the reordering of the search results to obtain context information includes: reordering the multiple search results using a reciprocal ranking fusion algorithm based on the comprehensive score; and determining a preset number of search results ranked first among the reordered multiple search results as context information.

[0017] In the above implementation process, after calculating the comprehensive score of each search result, the RRF algorithm can be used to reorder the results. Then, the top N search results after the RRF algorithm reordering are used as context information. In this way, by combining the rankings of different search results, the chances of the most relevant documents / knowledge appearing at the top of the final ranking can be increased, thereby helping the large model improve the quality of response generation.

[0018] Furthermore, in some examples, the knowledge base index includes a version dimension index; the version dimension index is used to record the version change trajectory of the requirement entries for each text unit.

[0019] In the above implementation process, a new version dimension index is created in the knowledge base to record the change trajectory of the requirement items in each version. In this way, the automatic identification of version revision records can be achieved, enabling the large language model to accurately answer questions related to version revision records.

[0020] Furthermore, in some examples, the structured fields include a version number and a security level; before inputting the automotive software development problem and the context information into the large language model, the process includes: labeling the corresponding version number and security level in the context information.

[0021] In the above implementation process, after determining the context information, the version and security level can be automatically labeled, thus providing rich and accurate context for answer generation, thereby ensuring the accuracy and reliability of the answer.

[0022] Furthermore, in some examples, the knowledge base also includes a graph database; the graph database is used to store the relationships between functional requirements; the method further includes: determining target functional requirements based on the automotive software development Q&A results; and outputting the relationships between the target functional requirements and other functional requirements based on the graph database.

[0023] In the above implementation process, based on the Q&A results of automotive software development output by the large language model, the functional requirements corresponding to the document searched by the user can be determined. Then, the relationships between this functional requirement and other functional requirements are searched from the graph database, and these relationships are presented in the form of a graph. In this way, users can quickly find the knowledge they need, improving the efficiency of users learning automotive software requirements documents.

[0024] Secondly, this application provides a question-and-answer device for automotive software development, comprising: an acquisition module, used to acquire text data of automotive software requirements documents, divide the text data into multiple text units according to automotive functional modules, and store the text units in a knowledge base; the knowledge base includes a vector database and a relational database; the vector database is used to store text vectors corresponding to the text units; the relational database is used to store structured fields corresponding to the text units; a retrieval module, used to perform keyword retrieval and vector retrieval in the knowledge base based on automotive software development questions, obtain retrieval results related to the automotive software development questions, reorder the retrieval results, and obtain context information; and a generation module, used to input the automotive software development questions and the context information into a large language model to generate automotive software development question-and-answer results.

[0025] Thirdly, this application provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method described in any of the first aspects.

[0026] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in any of the first aspects.

[0027] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first aspects.

[0028] Other features and advantages disclosed in this application will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the above-described technology disclosed in this application.

[0029] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0030] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 A flowchart illustrating a question-and-answer method for automotive software development provided in this application embodiment; Figure 2 A schematic diagram illustrating the workflow of a knowledge base management scheme for the field of automotive software requirements, provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the impact analysis of requirement document version changes provided in this application embodiment; Figure 4 A block diagram of an automotive software development question-and-answer device provided in an embodiment of this application; Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0032] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0033] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0034] Automotive software requirements documents are core documents in automotive product development. They are primarily used to clearly record and describe the specific software requirements of new or modified vehicle models, and generally include various documents such as functional requirements, performance indicators, and safety standards. With the transformation of corporate talent structures towards younger generations, the automotive development field is facing new challenges in knowledge management. The large number of requirements documents accumulated internally by automotive development professionals are characterized by rapid version iterations, detailed safety level classifications, and complex terminology systems, resulting in a steep learning curve for employees and difficulties in finding relevant information.

[0035] To address the aforementioned issues, this application provides a question-and-answer solution for automotive software development. It employs a combination of RAG (Retrieval Augmented Generation) and LLM (Large Language Model) to construct a knowledge base question-and-answer assistant. This assistant can quickly retrieve the most relevant content from the requirements document knowledge base, ensuring the accuracy and relevance of the answers. Simultaneously, a fusion retrieval method is used during the retrieval phase, employing keyword and vector retrieval methods, and the results are reordered before output, thereby improving retrieval accuracy. This reduces the difficulty for users in learning automotive software requirements documents and improves knowledge retrieval efficiency.

[0036] The embodiments of this application will be described below: like Figure 1 As shown, Figure 1 This is a flowchart illustrating a question-and-answer method for automotive software development provided in an embodiment of this application. The method can be applied to a server that communicates with a user's terminal via a network. The method can be implemented as an intelligent question-and-answer assistant, allowing the user to input questions through the terminal. After generating the automotive software development question-and-answer results, the intelligent assistant sends these results back to the terminal.

[0037] The method includes: Step 101: Obtain the text data of the automotive software requirements document, divide the text data into multiple text units according to the automotive functional modules, and store the text units in a knowledge base; the knowledge base includes a vector database and a relational database; the vector database is used to store the text vectors corresponding to the text units; the relational database is used to store the structured fields corresponding to the text units. The automotive software requirements documents mentioned in this step can include various documents such as functional requirements (e.g., "AEB automatic emergency braking trigger conditions"), performance indicators (e.g., "ESP response time ≤ 150ms"), and safety standards (e.g., "compliant with ISO 26262 ASIL B"). The text data mentioned in this step can refer to useful information in the automotive software requirements documents in natural language form. In some embodiments, obtaining the text data of the automotive software requirements documents mentioned in this step can include: collecting automotive software requirements documents covering all lifecycle versions; the automotive software requirements documents having multiple document formats; and preprocessing the automotive software requirements documents to obtain text data. That is, the collected automotive software requirements documents can cover all lifecycle versions, with diverse document formats such as PDF, Word, and TXT, to cover information from different sources and historical stages; subsequently, to improve the quality and usability of the knowledge base, the collected automotive software requirements documents are preprocessed to facilitate subsequent retrieval and processing.

[0038] Because collected automotive software requirement documents often contain a large amount of irrelevant content and inconsistent formatting, in some embodiments, the aforementioned preprocessing of these documents may include: removing redundant information, such as redundant version numbers in headers and footers and meeting minutes; and standardizing the documents, including unifying letter formats, terminology, and encoding. In other words, when preprocessing automotive software requirement documents, cleaning can be performed based on the characteristics of automotive documents, such as removing redundant version numbers in headers and footers, retaining requirement numbers, and removing irrelevant meeting minutes. Secondly, all text content is converted to lowercase to unify letter formats and technical terminology, such as standardizing "on-board diagnostics" to "OBD." Simultaneously, encoding formats are standardized, such as converting all documents to UTF-8 encoding to ensure compatibility and readability across different systems and platforms. This effectively improves the quality and usability of the knowledge base.

[0039] In this embodiment, text data is divided into smaller text units according to automotive functional modules. Each text unit contains complete requirement items and associated test methods. For example, a long document about the requirements for autonomous driving functions can be divided into text units such as "environmental perception," "path planning," and "vehicle control," with each text unit focusing on the requirements of a specific function. This facilitates subsequent retrieval and processing, improving the system's response speed and accuracy.

[0040] Text units are stored in a knowledge base employing a hybrid database architecture, capable of simultaneously satisfying structured queries and semantic retrieval for automotive needs. This knowledge base comprises a vector database and a relational database. The vector database can utilize FAISS, storing text vectors and supporting cross-language semantic retrieval. The relational database can employ PostgreSQL, storing structured fields such as requirement ID, version number, ASIL level, and associated ECU. During implementation, text units can be encoded to generate text vectors representing their semantics, which are then stored in the vector database. Simultaneously, pre-trained large language models or regular expressions can be used to extract structured fields from the text units.

[0041] In addition, in some embodiments, the knowledge base index mentioned in this step may include a version dimension index; the version dimension index is used to record the version change trajectory of the requirement items for each text unit. That is, by creating a new version dimension index in the knowledge base and recording the change trajectory of the requirement items in each version, automatic identification of version revision records can be achieved, enabling the large language model to accurately answer questions related to version revision records, such as "What diagnostic requirements were added in V2.3 compared to V2.2?"

[0042] Step 102: Based on the automotive software development problem, perform keyword retrieval and vector retrieval in the knowledge base to obtain retrieval results related to the automotive software development problem, and reorder the retrieval results to obtain context information; The automotive software development problem mentioned in this step can be a user-input question related to automotive software development. Existing large language models, when trained on general datasets, lack specific optimizations for the automotive software development domain. Therefore, directly inputting an automotive software development problem into a large language model is unlikely to yield an accurate answer. Based on this, this embodiment employs RAG technology. RAG technology is an artificial intelligence technique that extracts relevant information from external knowledge bases to inject more accurate and in-depth contextual information into the large language model, making the model's response more closely aligned with actual needs.

[0043] This embodiment also employs a fusion retrieval method during the retrieval phase, intelligently integrating the results of keyword retrieval and vector retrieval. By combining the semantic understanding capabilities of vector retrieval with the precise matching capabilities of keyword retrieval, higher-quality retrieval results are generated. In some embodiments, the step mentioned in this section, based on the automotive software development problem, involves performing keyword and vector retrieval in the knowledge base to obtain retrieval results related to the automotive software development problem. This may include: extracting keywords from the automotive software development problem; searching for document fragments containing the keywords in the index of the knowledge base to obtain keyword retrieval results; converting the automotive software development problem into a vector representation using a pre-trained large language model; performing a similarity search in the vector database based on the vector representation to obtain vector retrieval results; and fusing the keyword retrieval results and the vector retrieval results to obtain retrieval results related to the automotive software development problem and their corresponding comprehensive scores. In other words, during fusion retrieval, keyword retrieval techniques, such as BM25 (Best Matching 25), can be used to extract keywords from automotive software development questions. These keywords are then searched in the knowledge base index for relevant nodes in document fragments containing these keywords. Vector retrieval techniques are also employed, converting the question text into vector representations using a pre-trained large language model. Then, semantically similar text vectors are searched in a vector database to find knowledge content semantically related to the question. Finally, the results of keyword and vector retrieval are fused, and a comprehensive score is calculated for each retrieval result. This improves both the accuracy and recall of the retrieval process.

[0044] Furthermore, in some embodiments, the aforementioned extraction of keywords from automotive software development problems may include: extracting initial keywords from the automotive software development problem using a keyword retrieval method; obtaining synonyms of the initial keywords through a target thesaurus; the target thesaurus recording synonyms of automotive terms; and determining the initial keywords and the synonyms as keywords extracted from the automotive software development problem. In other words, after analyzing user questions and extracting keywords, the thesaurus can be automatically expanded to include automotive-related synonyms. For example, in the question "Motor power related requirements in electric vehicle battery management system requirements documents," keywords such as "electric vehicle," "battery management system," "motor power," and "requirements" can be extracted. Using a target thesaurus, the synonym for "battery management system" can be found as "BMS." Thus, by matching these keywords and synonyms in the knowledge base index, document fragments containing these terms can be quickly located, and a batch of potentially relevant knowledge content can be preliminarily selected.

[0045] Furthermore, in some embodiments, the aforementioned fusion of the keyword search results and the vector search results to obtain search results and corresponding comprehensive scores related to the automotive software development problem may include: combining the keyword search results and the vector search results into multiple search results related to the automotive software development problem; for each search result, normalizing and weighting the scores of the keyword search results and the vector search results corresponding to the search result to obtain the comprehensive score corresponding to the search result; wherein, when the search result corresponds to a security-related document, the weight of the keyword search result score is the first weight, and the weight of the vector search result score is the second weight; when the search result corresponds to a non-security-related document, the weight of the keyword search result score is the third weight, and the weight of the vector search result score is the fourth weight; the first weight is greater than the third weight; and the second weight is greater than the fourth weight. In other words, when fusing the results of keyword retrieval and vector retrieval, a priority weight for automotive needs can be introduced to improve the accuracy of the search. In implementation, the scores of keyword search results and vector search results can be normalized to the range of 0-1. Then, the two scores are weighted and fused to obtain a comprehensive score for the search results. By setting weights, the scores of security-related documents are amplified during search result ranking, ensuring their priority display. Optionally, the first weight can be 1.5 times the third weight, and the second weight can be 1.5 times the fourth weight.

[0046] Furthermore, in some embodiments, the reordering of the search results to obtain context information mentioned in this step may include: reordering the multiple search results using a reciprocal rank fusion algorithm based on the comprehensive score; and determining the top-ranked preset number of search results as context information from the reordered multiple search results. That is, after calculating the comprehensive score of each search result, the results can be reordered using the RRF (Reciprocal Rank Fusion) algorithm, and then the top N search results after RRF reordering are used as context information. The RRF algorithm is a technique that combines the rankings of multiple search results to generate a single unified ranking. RRF calculates the RRF score for each document and then reorders the documents based on the RRF score. The formula for calculating the RRF score is as follows:

[0047] In the formula, For document RRF score; The number of results in the search list; For document In the Ranking in a list of search results; Let be a constant used for smoothing the ranking. Where, It can be determined based on the calculated comprehensive score. It can be 60. In this way, by combining the rankings of different search results, the chances of the most relevant documents / knowledge appearing at the top of the final ranking can be increased, thereby helping the large model improve the quality of response generation.

[0048] Step 103: Input the automotive software development question and the context information into the large language model to generate automotive software development question and answer results.

[0049] The large language model mentioned in this step can be any type of large language model. The contextual information generated during the retrieval phase, along with the automotive software development question, is input into the large language model to ensure that the contextual information covers knowledge closely related to the question and that knowledge from different sources complements each other. Based on the input question and contextual information, the large language model performs deep semantic understanding and reasoning to generate an initial answer. This allows users to quickly find the complex knowledge they need, saving time and effort spent manually searching through massive amounts of documents. Furthermore, the automotive software development question-and-answer result mentioned in this step refers to the output of the large language model. It can contain only the answer to the automotive software development question, or it can contain both the automotive software development question and its corresponding answer. After obtaining the automotive software development question-and-answer result, the system can provide feedback to the user's terminal.

[0050] In some embodiments, the structured fields mentioned above may include a version number and a security level; accordingly, the step of inputting the automotive software development question and the context information into the large language model may include: annotating the context information with the corresponding version number and security level. That is, after determining the context information, the version and security level can be automatically annotated, thus providing rich and accurate context for answer generation. After receiving the input automotive software development question and context information, the large language model can utilize the version number and security level annotated in the context information to locate the most valuable knowledge that best meets the user's question requirements, thereby ensuring the accuracy and reliability of the answer.

[0051] Furthermore, in some embodiments, the aforementioned knowledge base may also include a graph database; the graph database is used to store the relationships between functional requirements. Optionally, the graph database here may be a Neo4j database. Accordingly, the method may further include: determining the target functional requirement based on the automotive software development Q&A results; and outputting the relationship between the target functional requirement and other functional requirements based on the graph database. That is, the graph database can store complex relationships between requirements through nodes and edges, such as the traceability relationship between "SRS-007" and "Test Case TC-123". In this way, based on the automotive software development Q&A results output by the large language model, the functional requirement corresponding to the document searched by the user can be determined, and then the relationship between this functional requirement and other functional requirements can be searched from the graph database. This relationship is presented in the form of a graph. This allows users to quickly find the knowledge they need, improving the efficiency of users learning automotive software requirement documents.

[0052] This embodiment uses automotive software requirements documents as its data foundation and employs a combination of retrieval enhancement generation and a large language model for question-answering processing. Based on automotive software development questions, keyword retrieval and vector retrieval methods are used to search for relevant search results in the knowledge base, thereby more comprehensively mining potential related information within the knowledge base. Subsequently, the search results are reordered to obtain contextual information, which is then combined with the automotive software development questions and input into the large language model to generate automotive software development question-answering results. In this way, by injecting rich and accurate contextual information into the large language model, the model's response can better match actual needs. This saves users time and effort from manually searching through massive amounts of documents, reduces the difficulty for users to learn automotive software requirements documents, and improves knowledge retrieval efficiency.

[0053] To provide a more detailed explanation of the solution in this application, a specific embodiment is described below: This embodiment provides a knowledge base management solution for the automotive software requirements domain. It uses a combination of RAG and LLM to build an intelligent question-and-answer assistant, which provides services to users through a question-and-answer robot product. The workflow of this solution is as follows: Figure 2 As shown, it includes: S201. Collect automotive software requirements documents; the collected automotive software requirements documents cover the entire lifecycle versions, including various documents such as functional requirements, performance indicators, and safety standards, and ensure that the document formats are diverse, such as PDF, Word, TXT, etc., to cover information from different sources and historical stages. S202. Perform data preprocessing on the collected automotive software requirements documents to obtain text data. The preprocessing process includes: removing redundant version numbers in headers and footers, retaining requirement numbers, and removing meeting minutes content that is irrelevant to the requirements; converting all text content to lowercase; standardizing technical terminology; converting all documents to UTF-8 encoding; in addition, for nested tables in Word documents, row and column relationships can be parsed, and for state transition diagrams in PDF documents, nodes can be extracted to extract knowledge from the documents. S203. Divide the text data into text units according to the vehicle's functional modules. Each text unit contains complete requirement items and associated test methods. S204. The text units are stored in a knowledge base; this knowledge base includes a vector database, a relational database, and a graph database. The vector database stores text vectors and supports cross-language semantic retrieval; the relational database stores structured fields such as requirement ID, version number, ASIL level, and associated ECU; the graph database stores the relationships between requirements; additionally, the knowledge base also includes a version-dimensional index to record the change trajectory of requirement items across versions. Therefore, based on this knowledge base, the following can be achieved: Figure 3 The analysis shows the impact of version changes to the requirements document. Specifically, Figure 3 This document illustrates the change trajectory of a vehicle functional module's requirements across versions V1.0 to V3.0. Version V1.0 included a requirement for "Power Signal Definition CAN Cycle = 200ms." Version V2.0 modified this to "Power Signal Definition CAN Cycle = 100ms" and added a safety level monitoring requirement, specifically "Safety Level ASIL B." Version V3.0 further modified the Power Signal Definition CAN Cycle from 100ms to 20ms and upgraded the safety level from ASIL B to ASIL D. Furthermore, Figure 3 The requirement chain for the vehicle's functional modules is also shown. In version V3.0, the requirement "Power signal definition CAN cycle = 20ms" is associated with "ECU1 communication module" and "ECU2 communication module", and "Safety level ASIL D" is associated with "Test case TC-098" and "Test case TC-102". S205, Receiving user questions; where the user questions are related to automotive software development. S206. Based on user questions, perform keyword retrieval in the knowledge base; wherein, keywords are extracted from the questions, synonyms in the automotive field are automatically expanded, and relevant nodes of document fragments containing keywords and synonyms are searched in the index of the knowledge base; S207. Based on the user's question, perform vector retrieval in the knowledge base; wherein, the question text is converted into a vector representation through a pre-trained large language model, and then semantically similar text vectors are searched in the vector database to find knowledge content related to the question's semantics; in addition, this step and S206 do not have a fixed order and can be performed simultaneously. S208. Merge the results of keyword retrieval and vector retrieval, introduce the priority weight of automobile demand, and use the RRF algorithm to re-rank the results; S209. Use the first N search results after being reordered by the RRF algorithm as context information and automatically label the version and security level among them; S210. Input the context information and user question into the large language model to obtain the answer generated by the large language model. During the answer generation stage, double verification can be added for the characteristics of the automotive field: factual verification, which ensures that the technical parameters in the answer can be traced back to specific document sources; compliance prompts, which automatically add standard references such as "This requirement complies with ISO 26262-6:2018 clause 9.4" when safety requirements are involved. In addition, if the user's subsequent questions are related to previous questions, the system will refer to the previous dialogue history, automatically associate the requirement chain of the same functional module, and perform re-retrieval and generation in combination with the new questions to maintain the coherence and consistency of the answers and ensure a smooth experience in multi-turn dialogues.

[0054] This embodiment of the solution structures automotive software requirements documents into a knowledge base and dynamically generates new knowledge using the reasoning capabilities of a large language model. This transforms knowledge from static to dynamic, enabling the knowledge base to reflect changes in automotive software requirements and industry technological developments in real time. For example, when a new automotive safety standard is released, the system can automatically associate and integrate it with existing requirements knowledge to generate new, standard-compliant recommendations and requirements, eliminating the need for manual updates to numerous documents. Furthermore, the fusion retrieval method, combined with the RRF algorithm, integrates the advantages of keyword retrieval and vector retrieval, significantly improving the recall and accuracy of knowledge retrieval. Compared to traditional single retrieval methods, it can more comprehensively mine potential relevant information in the knowledge base, ensuring rich and accurate context for answer generation. This allows users to quickly find the complex knowledge they need, saving time and effort compared to manually searching through massive amounts of documents.

[0055] Corresponding to the embodiments of the aforementioned methods, this application also provides embodiments of a terminal for an automotive software development question-and-answer device and its application: like Figure 4 As shown, Figure 4 This is a block diagram of a question-and-answer device for automotive software development provided in an embodiment of this application. The device includes: The acquisition module 41 is used to acquire text data of automotive software requirements documents, divide the text data into multiple text units according to automotive functional modules, and store the text units in a knowledge base; the knowledge base includes a vector database and a relational database; the vector database is used to store the text vectors corresponding to the text units; the relational database is used to store the structured fields corresponding to the text units. The retrieval module 42 is used to perform keyword retrieval and vector retrieval in the knowledge base based on automotive software development issues, obtain retrieval results related to the automotive software development issues, and reorder the retrieval results to obtain context information; The generation module 43 is used to input the automotive software development question and the context information into the large language model to generate automotive software development question-and-answer results.

[0056] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0057] This application also provides an electronic device, please refer to [link to application]. Figure 5 , Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this application. The electronic device may include a processor 510, a communication interface 520, a memory 530, and at least one communication bus 540. The communication bus 540 is used to enable direct communication between these components. In this embodiment, the communication interface 520 of the electronic device is used for signaling or data communication with other node devices. The processor 510 may be an integrated circuit chip with signal processing capabilities.

[0058] The processor 510 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or the processor 510 can be any conventional processor.

[0059] The memory 530 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The memory 530 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 510, the electronic device can perform the aforementioned operations. Figure 1 The various steps involved in the method implementation examples.

[0060] Alternatively, the electronic device may also include a storage controller and an input / output unit.

[0061] The memory 530, storage controller, processor 510, peripheral interface, and input / output unit are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 540. The processor 510 is used to execute executable modules stored in the memory 530, such as software function modules or computer programs included in electronic devices.

[0062] The input / output unit is used to provide users with the ability to create tasks and to set optional start periods or preset execution times for those tasks, thereby enabling user-server interaction. The input / output unit may be, but is not limited to, a mouse and keyboard.

[0063] Understandable. Figure 5 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown. Figure 5 The components shown can be implemented using hardware, software, or a combination thereof.

[0064] This application also provides a storage medium storing instructions. When the instructions are run on a computer, the computer program is executed by a processor to implement the method described in the method embodiment. To avoid repetition, the method will not be described again here.

[0065] This application also provides a computer program product that, when run on a computer, causes the computer to perform the method described in the method embodiment.

[0066] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0067] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0068] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0069] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0070] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

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

Claims

1. An automobile software development question and answer method characterized by, The method comprises the following steps: acquiring text data of a vehicle software requirement document, segmenting the text data into a plurality of text units according to vehicle function modules, and storing the text units in a knowledge base; the knowledge base comprises a vector database and a relational database; the vector database is used for storing text vectors corresponding to the text units; the relational database is used for storing structured fields corresponding to the text units; based on a vehicle software development problem, performing keyword retrieval and vector retrieval in the knowledge base to obtain retrieval results related to the vehicle software development problem, reordering the retrieval results to obtain context information; inputting the vehicle software development problem and the context information into a large language model to generate a vehicle software development question and answer result.

2. The method of claim 1, wherein, The acquisition of the text data of the vehicle software requirement document comprises: collecting vehicle software requirement documents covering all life cycle versions; the vehicle software requirement documents have multiple document formats; preprocessing the vehicle software requirement documents to obtain text data.

3. The method of claim 2, wherein, The preprocessing of the vehicle software requirement documents comprises: removing redundant information in the vehicle software requirement documents; the redundant information includes version number redundancy in headers and footers and meeting minutes content; performing standardization processing on the vehicle software requirement documents; the standardization processing includes uniform letter format, term standardization and coding standardization.

4. The method of claim 1, wherein, The keyword retrieval and vector retrieval in the knowledge base based on the vehicle software development problem to obtain the retrieval results related to the vehicle software development problem comprises: extracting keywords from the vehicle software development problem, searching for document segments containing the keywords in the index of the knowledge base to obtain keyword retrieval results; converting the vehicle software development problem into a vector representation through a pre-trained large language model, and performing a similarity search in the vector database based on the vector representation to obtain vector retrieval results; fusing the keyword retrieval results and the vector retrieval results to obtain retrieval results related to the vehicle software development problem and corresponding comprehensive scores.

5. The method of claim 4, wherein, The keyword extraction from the vehicle software development problem comprises: extracting initial keywords from the vehicle software development problem using a keyword retrieval method; obtaining synonyms of the initial keywords through a target synonym dictionary; the target synonym dictionary records synonyms of vehicle terms; determining the initial keywords and the synonyms as the keywords extracted from the vehicle software development problem.

6. The method of claim 4, wherein, The fusion of the keyword retrieval results and the vector retrieval results to obtain the retrieval results related to the vehicle software development problem and the corresponding comprehensive scores comprises: combining the keyword retrieval results and the vector retrieval results into a plurality of retrieval results related to the vehicle software development problem; for each retrieval result, normalizing and weighting the scores of the keyword retrieval results and the vector retrieval results corresponding to the retrieval result to obtain a comprehensive score corresponding to the retrieval result; When the search result corresponds to a safety-related document, the weight of the score of the keyword search result is a first weight, and the weight of the score of the vector search result is a second weight; when the search result corresponds to a non-safety-related document, the weight of the score of the keyword search result is a third weight, and the weight of the score of the vector search result is a fourth weight; the first weight is greater than the third weight; and the second weight is greater than the fourth weight.

7. The method of claim 6, wherein, The reordering of the search result obtains context information, including: According to the comprehensive score, the plurality of search results are reordered using a reciprocal ranking fusion algorithm. In the reordered plurality of search results, a preset number of search results ranked in the front are determined as context information.

8. The method of claim 2, wherein, The index of the knowledge base includes a version dimension index; the version dimension index is used to record the version change track of the requirement item of each text unit.

9. The method of claim 1, wherein, The structured field includes a version number and a safety level; before the automobile software development question and the context information are input into the large language model, including: The corresponding version number and safety level are marked in the context information.

10. The method of claim 1, wherein, The knowledge base further includes a graph database; the graph database is used to store the association relationship between functional requirements; The method further includes: According to the automobile software development question and answer result, a target functional requirement is determined; Based on the graph database, an association relationship between the target functional requirement and other functional requirements is output.

11. An automobile software development question answering apparatus characterized by comprising: Including: An acquisition module is configured to acquire text data of an automobile software requirement document, split the text data into a plurality of text units according to automobile functional modules, and store the text units in a knowledge base; the knowledge base includes a vector database and a relational database; the vector database is used to store text vectors corresponding to the text units; and the relational database is used to store structured fields corresponding to the text units; A search module is configured to perform keyword search and vector search in the knowledge base based on an automobile software development question, obtain search results related to the automobile software development question, reorder the search results, and obtain context information; A generation module is configured to input the automobile software development question and the context information into a large language model, and generate an automobile software development question and answer result.

12. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program is executed by a processor to implement the method of any one of claims 1 to 10.

13. An electronic device, comprising: A processor, a memory, and a computer program stored on the memory and executable on the processor are included, and the processor implements the method of any one of claims 1 to 10 when executing the computer program.

Citation Information

Cited By

  • Method and device for retrieval enhancement generation, electronic equipment and storage medium

    CN121479030A

  • Knowledge base RAG recall method and system based on index and medium

    CN121599133A