Intelligent generation method, device, electronic equipment and storage medium for vehicle diagnostic reports

By combining structured queries and vector semantic retrieval from a symptom information database and an automotive fault repair knowledge base in the vehicle diagnostic report generation system, and utilizing a pre-trained large language model to generate structured diagnostic reports, the problem of low reliability of repair suggestions due to a lack of professional knowledge in existing technologies is solved, and highly reliable diagnostic report generation is achieved.

CN123070321APending Publication Date: 2026-11-10THINKCAR TECH CO LTD
0 Cites 0 Cited by

Patent Information

Application Number
CN202611288945.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Current methods for generating vehicle OBD diagnostic reports rely on lookup-based translation, lacking vertical expertise in the automotive repair field, resulting in low reliability of repair recommendations.

Method used

By acquiring vehicle diagnostic data and basic information, structured queries are performed in the symptom information database. Vector semantic retrieval is then combined with the automotive fault repair knowledge base to recall relevant repair cases. Finally, a pre-trained large language model is used to generate a structured diagnostic report, constraining the inference boundaries and output format of the large language model.

Benefits of technology

A diagnostic report was generated that integrates professional data support and personalized vehicle information, improving the reliability and accuracy of the report.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123070321A_ABST
    Figure CN123070321A_ABST
Patent Text Reader

Abstract

This application relates to the field of intelligent vehicle diagnostic report generation technology, and discloses a method, device, electronic device, and storage medium for intelligent generation of vehicle diagnostic reports. The method includes: acquiring diagnostic data and basic vehicle information of a target vehicle; performing a structured query in a symptom information database to obtain structured description text corresponding to fault codes; and performing a vector semantic retrieval in an automotive fault repair knowledge base to recall relevant repair cases. The diagnostic data, basic vehicle information, structured description text, and relevant repair cases are then concatenated into a structured instruction according to a preset instruction template and sent to a large language model to obtain a response text. The response text is then analyzed to obtain a diagnostic report. The beneficial technical effects of this invention are: effectively reducing reasoning bias caused by a lack of professional knowledge support; and the structured analysis results can be directly embedded into the report template, improving the reliability of the report.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent generation technology for vehicle diagnostic reports, and in particular to a method, apparatus, electronic device, and storage medium for intelligent generation of vehicle diagnostic reports. Background Technology

[0002] Currently, the diagnostic reports generated after vehicle OBD (On-Board Diagnostics) diagnosis are mostly presented in the form of a list of fault codes plus a brief text description. This method relies on a local static dictionary to translate the fault codes in a lookup manner, and can only provide the fault code number and its corresponding brief meaning.

[0003] Currently, large language model technology has gradually matured. Some solutions attempt to directly input diagnostic data into a general large language model to obtain natural language analysis. However, general large language models lack vertical expertise in the field of automotive repair, and direct reasoning is prone to producing illusory content that deviates from the facts, resulting in low reliability of the output repair suggestions. Summary of the Invention

[0004] Based on this, it is necessary to propose a method, device, electronic device and storage medium for intelligent generation of vehicle diagnostic reports to address the existing problem of intelligent generation of vehicle diagnostic reports.

[0005] A method for intelligently generating vehicle diagnostic reports, the method comprising: Obtain diagnostic data and basic vehicle information for the target vehicle; Based on the diagnostic data, a structured query is performed in a preset symptom information database to obtain a structured descriptive text; Based on the diagnostic data and the vehicle's basic information, a vector semantic search is performed in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases; The diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases are segmented and spliced ​​together according to the preset instruction template to form a structured instruction; The structured instructions are sent to the pre-trained large language model, and the response text returned by the pre-trained large language model is received. The response text is parsed to obtain structured analysis results, which are then embedded into a diagnostic report template to generate a complete diagnostic report.

[0006] Furthermore, the step of acquiring the diagnostic data and basic vehicle information of the target vehicle includes: Receive diagnostic data; wherein the diagnostic data includes at least a list of fault codes and a vehicle identification number; Based on the vehicle identification code, the vehicle brand, model, year, engine displacement, and transmission type of the target vehicle are obtained; Read the cumulative mileage data of the target vehicle; The vehicle's basic information is formed by combining the vehicle brand, model, year, engine displacement, transmission type, and cumulative mileage.

[0007] Furthermore, the step of performing vector semantic retrieval based on the diagnostic data and the vehicle's basic information in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases includes: The list of fault codes in the diagnostic data is combined with the vehicle's basic information to form a query text; The query text is converted into a query vector using a preset embedding model; Perform a cosine similarity nearest neighbor search in the vector space of the automotive fault repair knowledge base to obtain the similarity score between the query vector and each repair case; A preset number of relevant repair cases are selected based on their similarity scores, from highest to lowest.

[0008] Furthermore, after the step of filtering a preset number of relevant repair cases based on their similarity scores from highest to lowest, the process also includes: Determine whether the selected relevant repair cases meet the preset screening conditions; wherein, the screening conditions include a vehicle model matching degree greater than a preset matching degree threshold and a quality score greater than a preset quality score threshold; For related repair cases that do not meet the filtering conditions, a preset number of related repair cases will be re-filtered based on the similarity score to determine the filtering conditions, until the preset number of related repair cases all meet the filtering conditions.

[0009] Furthermore, the preset instruction template includes at least six paragraphs: role setting paragraph, vehicle information paragraph, current diagnosis result paragraph, fault code professional data paragraph, relevant repair case paragraph, and output format constraint paragraph; The step of segmenting and splicing the diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases according to a preset instruction template to form a structured instruction includes: Fill the preset character description text into the character setting section; Fill the vehicle basic information into the vehicle information segment; Fill the diagnostic data into the current diagnostic results section; Fill the structured description text into the fault code professional data segment; Fill the relevant repair cases into the relevant repair case section; The preset format constraint text is filled into the output format constraint segment to form a structured instruction.

[0010] Furthermore, the step of parsing the response text to obtain the structured analysis results includes: After removing code block markers from the response text, format parsing is performed to obtain temporary parsed text; Verify whether the temporarily parsed text contains all necessary fields and whether the values ​​of each field meet the preset requirements; When the verification passes, the structured analysis results are extracted from the temporarily parsed text.

[0011] Furthermore, after the step of verifying whether the temporarily parsed text contains all necessary fields and whether the values ​​of each field meet preset requirements, the method further includes: When the verification fails, a retry counter is initialized; wherein, the retry counter is used to record the number of failures, and is incremented by 1 each time the verification fails, and the initial value of the retry counter is 0; Determine if the current number of failed attempts is less than the preset maximum number of retries; If the number of retries is less than the preset maximum number, a format error message is appended to the end of the structured instruction and it is resent to the pre-trained large language model for parsing, and the response text is retrieved again for verification. If the number of retries reaches the preset maximum number of retries and still fails, the fault code professional data is directly read from the symptom information database, and a basic analysis result without large language model reasoning is generated according to the preset simplified report template as the structured analysis result.

[0012] A vehicle diagnostic report intelligent generation device, the device comprising: The acquisition module is used to acquire diagnostic data and basic vehicle information of the target vehicle. The structured query execution module is used to perform a structured query on the pre-set symptom information database based on the diagnostic data to obtain structured descriptive text; The vector semantic retrieval execution module is used to perform vector semantic retrieval in a preset automotive fault repair knowledge base based on the diagnostic data and the vehicle basic information to obtain multiple relevant repair cases; The forming module is used to segment and splice the diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases according to a preset instruction template to form structured instructions; The receiving module is used to send the structured instructions to the pre-trained large language model and receive the response text returned by the pre-trained large language model; The parsing module is used to parse the response text, obtain structured analysis results, and embed the structured analysis results into the diagnostic report template to generate a complete diagnostic report.

[0013] An electronic device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps: Obtain diagnostic data and basic vehicle information for the target vehicle; Based on the diagnostic data, a structured query is performed in a preset symptom information database to obtain a structured descriptive text; Based on the diagnostic data and the vehicle's basic information, a vector semantic search is performed in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases; The diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases are segmented and spliced ​​together according to the preset instruction template to form a structured instruction; The structured instructions are sent to the pre-trained large language model, and the response text returned by the pre-trained large language model is received. The response text is parsed to obtain structured analysis results, which are then embedded into a diagnostic report template to generate a complete diagnostic report.

[0014] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps: Obtain diagnostic data and basic vehicle information for the target vehicle; Based on the diagnostic data, a structured query is performed in a preset symptom information database to obtain a structured descriptive text; Based on the diagnostic data and the vehicle's basic information, a vector semantic search is performed in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases; The diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases are segmented and spliced ​​together according to the preset instruction template to form a structured instruction; The structured instructions are sent to the pre-trained large language model, and the response text returned by the pre-trained large language model is received. The response text is parsed to obtain structured analysis results, which are then embedded into a diagnostic report template to generate a complete diagnostic report.

[0015] The beneficial effects of this invention are as follows: By acquiring diagnostic data and basic vehicle information of the target vehicle, on the one hand, a structured query is performed in the symptom information database to obtain structured descriptive text such as professional positioning descriptions and typical symptoms corresponding to the fault codes; on the other hand, a vector semantic retrieval is performed in the automotive fault repair knowledge base to recall relevant repair cases that match the current diagnostic scenario and vehicle conditions. The diagnostic data, basic vehicle information, structured descriptive text, and relevant repair cases are then concatenated into structured instructions according to a preset instruction template and sent to the large language model. This constrains the reasoning boundaries and output format of the large language model, enabling it to perform targeted reasoning with the support of vertical domain knowledge, effectively reducing reasoning bias caused by a lack of professional knowledge support. At the same time, the structured analysis results can be directly embedded into the report template, ultimately generating a diagnostic report that integrates professional data support and personalized vehicle information, thus improving the reliability of the report. Attached Figure Description

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

[0017] in: Figure 1 This is an application environment diagram of the intelligent generation method for vehicle diagnostic reports in one embodiment; Figure 2 This is a flowchart of a vehicle diagnostic report intelligent generation method in one embodiment; Figure 3 This is a structural block diagram of a vehicle diagnostic report intelligent generation device in one embodiment; Figure 4 This is a structural block diagram of an electronic device in one embodiment. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Figure 1 This is a diagram illustrating the application environment for intelligent generation of vehicle diagnostic reports in one embodiment. (Refer to...) Figure 1This intelligent vehicle diagnostic report generation method is applied to an intelligent vehicle diagnostic report generation system. The system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal; a mobile terminal can be at least one of a mobile phone, tablet, or laptop. The server 120 can be a standalone server or a server cluster consisting of multiple servers. The terminal 110 is used to acquire diagnostic data and basic vehicle information for the target vehicle, while the server 120 is used to generate a complete diagnostic report.

[0020] like Figure 2 As shown, in one embodiment, a method for intelligently generating vehicle diagnostic reports is provided. This method can be applied to both terminals and servers; this embodiment uses terminal application as an example. The intelligent vehicle diagnostic report generation method specifically includes the following steps: S1: Obtain diagnostic data and basic vehicle information for the target vehicle; S2: Based on the diagnostic data, perform a structured query in a preset symptom information database to obtain a structured descriptive text; S3: Based on the diagnostic data and the vehicle's basic information, perform vector semantic retrieval in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases; S4: According to the preset instruction template, the diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases are segmented and spliced ​​together to form a structured instruction; S5: Send the structured instructions to the pre-trained large language model and receive the response text returned by the pre-trained large language model; S6: Parse the response text to obtain the structured analysis results, and embed the structured analysis results into the diagnostic report template to generate a complete diagnostic report.

[0021] As described in step S1 above, diagnostic data and basic vehicle information of the target vehicle are acquired. After the vehicle diagnostic terminal (e.g., an Android vehicle host or smartphone with a diagnostic app installed) establishes communication via Bluetooth with the hardware diagnostic connector plugged into the vehicle's OBD interface (preferably a low-power connector with a standby current of only 5mA, automatically waking up after vehicle startup), the terminal sends diagnostic commands to the connector. The connector collects fault codes, data streams, and freeze frames from each ECU of the vehicle and transmits them back to the vehicle diagnostic terminal. The vehicle diagnostic terminal then uploads this data to the cloud server in JSON format via a 4G or Wi-Fi network, thus obtaining diagnostic data. Simultaneously, the cloud server, on the one hand, calls the VIN decoding interface to parse the brand, model, year, displacement, and transmission type based on the Vehicle Identification Number (VIN); on the other hand, it reads the vehicle's recorded cumulative mileage (e.g., 85,000 kilometers) from the user profile database. The cloud server combines the VIN decoding results with the user profile mileage and encapsulates them into a vehicle basic information object.

[0022] As described in step S2 above, a structured query is performed on the pre-set symptom information database based on the diagnostic data to obtain structured descriptive text. The symptom information database is not a general dictionary, but a pre-organized relational professional database; the query results are not simple code translations, but structured descriptions containing multiple fields such as location, symptoms, and components, aiming to inject highly reliable vertical domain factual knowledge into the large model. The pre-set symptom information database is a pre-built and continuously iterated proprietary fault code location and symptom information database, implemented using a MySQL relational database. Its table structure includes fields such as dtc_code, location_description (professional location description), symptom_description (typical symptom description), related_components (related component JSON array), and performance_impact_level (performance impact levels 1-5). When the cloud server obtains the fault code list from the diagnostic data, it uses each fault code number in the list (e.g., P0301) as a precise query condition and executes an SQL SELECT statement for matching and retrieval. For example, the structured description text returned by query P0301 is not just a single cylinder misfire, but a combined data package: the location description is a misfire in cylinder 1, with common causes being an open circuit in the primary / secondary ignition coil or spark plug electrode erosion; typical symptoms are irregular engine idling vibration and noticeable jerking during rapid acceleration; associated components are [ignition coil, spark plug, fuel injector]; the impact level is 4 (high). If multiple fault codes exist, each is queried separately, and all returned structured description texts are then aggregated into a complete professional data set for subsequent steps.

[0023] As described in step S3 above, vector semantic retrieval is performed on the preset automotive fault repair knowledge base based on the diagnostic data and the vehicle's basic information to obtain multiple relevant repair cases. Simultaneously, query conditions are constructed using fault codes and vehicle basic information (brand / model / year / mileage), and semantic similarity matching is performed in the vector space to recall historical repair cases that are semantically similar to the current vehicle condition rather than literally identical, providing experience reference for generating subsequent repair suggestions.

[0024] As described in step S4 above, the diagnostic data, vehicle basic information, structured description text, and multiple related repair cases are segmented and concatenated according to a preset instruction template to form a structured instruction. The heterogeneous data acquired in S1 to S3 are reorganized into structured natural language instructions according to logical hierarchy (role, background, problem, knowledge, case, constraint). This design is a key engineering method for guiding the large model to output stable, professional, and controllable results. In this embodiment, the preset instruction template is a six-segment structured Prompt template. The cloud server strictly fills in the text according to the placeholders of this template: the first segment [role setting]; the second segment [vehicle information]; the third segment [current diagnostic result]; the fourth segment [fault code professional data]; the fifth segment [related repair cases]; and the sixth segment [output format constraints]. These six segments are concatenated in sequence into a long text string that the large model can understand, i.e., the structured instruction.

[0025] As described in step S5 above, the structured instructions are sent to the pre-trained large language model, and the response text returned by the pre-trained large language model is received. To ensure the commercial reliability and response stability of the system, the abstraction and encapsulation of the interface, timeout control, and parameter tuning need to be considered in actual deployment to balance the creativity and determinism of the generated content. Specifically, the cloud server calls the pre-trained large language model through a preset unified abstract interface layer (which has encapsulated API Key authentication, request signing, and timeout control logic). Specifically, the server initiates an HTTPSPOST request to the API endpoint of the large language model. The structured instructions generated in S4 are assigned to the messages parameter in the request body, and temperature=0.3 is set synchronously to reduce the randomness of the model output (to ensure that the analysis results of multiple times for the same vehicle are highly consistent), max_tokens is set to limit the output length to prevent unexpectedly long responses, and timeout=60s is set to ensure that long text inference is not interrupted. After sending, the cloud server enters a synchronous waiting state until it receives the original response text returned by the model.

[0026] As described in step S6 above, the response text is parsed to obtain structured analysis results, which are then embedded into the diagnostic report template to generate a complete diagnostic report. Since large models naturally exhibit probabilistic fluctuations in output, it is essential not only to extract valid fields but also to include fault tolerance mechanisms (validation, retry, degradation) to filter or correct unexpected formats in the model output, ensuring that the final report delivered to the user is a formal document with a complete structure, consistent format, and six-dimensional decision information (interpretation, level, recommendations, accessories, cost, priority). In this embodiment, after receiving the response text from S5, the cloud server first executes a preprocessing procedure, using regular expressions to remove Markdown code block tags (such as json and ) that may be mixed in with the response. Subsequently, a JSON parser is called to attempt to convert the cleaned text into an object, and field integrity checks (checking for the existence of six required keys: fault_interpretation, severity, repair_suggestion, parts_list, estimated_cost, and repair_priority) and field value validity checks (such as checking whether severity belongs to the urgent|warning|info enumeration). If the verification fails, the system will automatically append the error message "Previous output format error: please strictly follow the JSON format output correction instructions" to the end of the original prompt, triggering a maximum of 3 retries. If all 3 retries fail, a fallback mechanism is triggered: the system directly extracts the location description from the symptom information database retrieved by S2 and generates a basic report according to a preset simplified template. If the verification passes, the system extracts the complete six-dimensional structured analysis results and uses them as the data source to render a color HTML report suitable for car owners to read and a PDF report suitable for archiving / printing, respectively, using a template engine (such as Freemarker or Jasper Reports). Finally, the cloud server sends the PDF attachment to multiple email addresses preset by the user.

[0027] In one embodiment, step S1 of acquiring diagnostic data and basic vehicle information of the target vehicle includes: S101: Receive diagnostic data; wherein the diagnostic data includes at least a list of fault codes and a vehicle identification number; S102: Based on the vehicle identification code, obtain the vehicle brand, model, year, engine displacement and transmission type of the target vehicle; S103: Read the cumulative mileage data of the target vehicle; S104: Combine the vehicle brand, model, year, engine displacement, transmission type, and cumulative mileage to form the vehicle's basic information.

[0028] As described in step S101 above, diagnostic data is received; wherein the diagnostic data includes at least a fault code list and a vehicle identification number (VIN). The fault code list is the core query condition for subsequent structured queries and vector retrieval, and the VIN is the unique index for parsing the vehicle's static attributes. This limitation ensures that the input of the method has the most basic usable information, and also provides a data foundation for the execution of subsequent steps. Specifically, the data receiving module of the cloud server listens for upload requests from the diagnostic terminal through the POST interface of the HTTPS protocol. After completing the OBD diagnosis, the diagnostic terminal (such as the vehicle host or smartphone APP) encapsulates the collected data into a JSON format message body and uploads it. This JSON message contains at least the following required fields: the vin field stores the 17-digit vehicle identification number (e.g., LFV2A21K7J4000001), and the dtc_list field stores the fault code array (e.g., [P0301, P0171]). In addition to the required fields, this JSON message may include optional extended fields to provide richer diagnostic context. For example, the `datastream` field carries key data stream parameters (e.g., `{engine_rpm:850,coolant_temp:89,stft:12.5,ltft:9.8}`), the `freeze_frame` field carries the frozen frame data at the time of the fault, the `timestamp` field records the diagnostic timestamp, and the `user_id` and `device_id` fields are used for user and device identification. Upon receiving this JSON data, the cloud server first performs a protocol-level format validation to confirm the JSON structure is complete and that the required fields are not empty. After successful validation, the raw data is persistently stored in the diagnostic record table (`diagnosis_records`) in the cloud database, and a unique diagnostic record ID (`record_id`) is generated for subsequent data traceability throughout the entire process and for session association in multi-round interactions.

[0029] As described in step S102 above, the vehicle brand, model, year, engine displacement, and transmission type of the target vehicle are obtained based on the vehicle identification number (VIN). The VIN, as the unique identifier of a vehicle, contains rich vehicle manufacturing information. At least five core fields must be parsed: Brand, Model, ModelYear, Displacement / Eengine Capacity, and Transmission Type. These fields together constitute the static attribute portion of the vehicle's basic information, used for model matching and personalized analysis during subsequent searches. Specifically, the VIN parsing module on the cloud server is responsible for performing this step. Upon receiving diagnostic data containing the VIN, the system extracts the VIN string and calls the VIN decoding service. VIN decoding can be implemented in several ways: a preferred method is to call a third-party professional VIN decoding API, which returns standardized parsing results based on a large vehicle manufacturing database; another method is to use a locally deployed VIN code parsing engine, which has a built-in WMI (World Manufacturer Identifier) ​​mapping table and model coding rules for various manufacturers. After parsing, these five fields are encapsulated into a vehicle static attribute object. If an unrecognizable code or service timeout occurs during VIN parsing, the system can be configured with a degradation strategy—returning partial parsing results and logging the exception in the log, while allowing users on the diagnostic terminal to manually supplement or correct vehicle information.

[0030] As described in step S103 above, the cumulative mileage data of the target vehicle is read. The cumulative mileage is part of the vehicle's usage history and increases with vehicle use. The possible causes and repair strategies for the same fault code often differ between low-mileage and high-mileage vehicles (for example, a fault in a low-mileage vehicle is more likely due to a quality issue with the component itself, while in a high-mileage vehicle it is more likely due to normal wear and tear). This step uses the word "read" rather than "parse" to indicate that the data originates from a stored user profile rather than the VIN itself.

[0031] As described in step S104 above, the vehicle brand, model, year, engine displacement, transmission type, and cumulative mileage are combined to form the vehicle's basic information. These data fields from scattered sources and of different natures are aggregated into a structured information entity. This combination provides a multi-dimensional query context of brand, model, year, engine displacement, transmission, and mileage for the subsequent vector retrieval in S3, and also provides ready-made, directly populated vehicle information data blocks for the Prompt assembly in S4.

[0032] In one embodiment, step S3, which involves performing vector semantic retrieval based on the diagnostic data and the vehicle's basic information in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases, includes: S301: Assemble the list of fault codes in the diagnostic data with the vehicle basic information into a query text; S302: Convert the query text into a query vector using a preset embedding model; S303: Perform a cosine similarity nearest neighbor search in the vector space of the automotive fault repair knowledge base to obtain the similarity score between the query vector and each repair case; S304: Filter a preset number of relevant repair cases based on the similarity score from highest to lowest.

[0033] As described in step S301 above, the fault code list in the diagnostic data and the vehicle basic information are assembled into a query text. Since the underlying mechanism of vector retrieval is to convert natural language text into dense vectors before performing similarity calculations, it is necessary to first convert the structured input data (fault code list + vehicle basic information) into a coherent natural language query text. The essence of this assembly is to fuse multi-dimensional structured information into one or more sentences with complete semantics, so that the subsequent embedding model can correctly capture the semantic information of the query, thereby finding semantically similar repair cases in the vector space. Specifically, the query text assembly module of the cloud server performs the following operations: First, extract six fields—brand, model, year, displacement, transmission type, and cumulative mileage—from the vehicle basic information object obtained in step S1; extract the fault code list (e.g., [P0301, P0171]) from the diagnostic data obtained in step S1. Then, according to the preset assembly template, these fields are concatenated into a natural language query text consisting of one or more sentences. A preferred assembly format is: [Brand][Model] [Year][Engine Displacement] [Transmission][Cumulative Mileage] Fault Codes [Fault Code 1][Fault Code 2]... This assembly process can also add optional information to enrich the query semantics. For example, adding fields such as engine model or drive type to the vehicle's basic information, or adding key data stream parameters (such as idle speed 850 rpm, coolant temperature 89℃) to the diagnostic data, and incorporating this additional information into the query text can further improve the semantic relevance of the retrieval. After assembly, the query text is cached in the context of the current analysis session for direct use in step S302.

[0034] As described in step S302 above, the query text is converted into a query vector using a preset embedding model. An embedding model is a technique for compressing high-dimensional, sparse text semantics into a low-dimensional, dense vector space. Its core function is to ensure that semantically similar texts are also closer in distance within the vector space. This embedding model is pre-selected and deployed, serving as a fixed mapping function between the text and the vector space. This allows the query text generated in S301 to be projected into the same vector space as the case vectors in the maintenance knowledge base, thereby supporting subsequent similarity calculations.

[0035] As described in step S303 above, a cosine similarity nearest neighbor search is performed in the vector space of the automotive fault repair knowledge base to obtain the similarity score between the query vector and each repair case. In the preset vector space of the automotive fault repair knowledge base, using the generated query vector as a reference, a cosine similarity nearest neighbor search is performed to calculate the similarity between the query vector and the embedded vector corresponding to each repair case in the knowledge base, and the similarity score for each case is output. Cosine similarity is a measure of the directional consistency between two non-zero vectors, with a value range of [-1, 1]. In text semantic retrieval scenarios, it is usually a positive number between 0 and 1; a higher score indicates stronger semantic relevance. Nearest neighbor search means efficiently finding the K closest vectors to the query vector in a high-dimensional vector space (in the context of cosine similarity, closest means highest similarity), requiring fast retrieval accelerated by vector index structures (such as IVF indexes or HNSW indexes).

[0036] As described in step S304 above, a preset number of relevant repair cases are filtered based on their similarity scores, from highest to lowest. All similarity scores calculated in S303 are sorted from highest to lowest (i.e., from most relevant to least relevant), and then the preset number of repair cases are selected as the final search results. The preset number K indicates that this number is a pre-configured parameter (e.g., default value K=3), rather than dynamically determined or specified by the user. This filtering step determines the final number of cases input into the Prompt—needing both a sufficient number of cases to provide diverse reference information and controlling the total length of the Prompt to not exceed the context window limit of a large model (especially for earlier models with smaller context windows).

[0037] In one embodiment, after step S304 of filtering a preset number of relevant repair cases according to their similarity scores from highest to lowest, the method further includes: S3051: Determine whether the selected relevant repair cases meet the preset screening conditions; wherein, the screening conditions include a vehicle model matching degree greater than a preset matching degree threshold and a quality score greater than a preset quality score threshold; S3052: For relevant repair cases that do not meet the filtering conditions, a preset number of relevant repair cases are re-filtered based on the similarity score to determine the filtering conditions, until the preset number of relevant repair cases all meet the filtering conditions.

[0038] As described in step S3051 above, it is determined whether the selected relevant repair cases meet the preset screening conditions. These screening conditions include a vehicle model matching degree greater than a preset matching degree threshold and a quality score greater than a preset quality score threshold. The preset screening conditions include at least two dimensions: a vehicle model matching degree greater than the preset matching degree threshold and a quality score greater than the preset quality score threshold. The preset matching degree threshold is a pre-set value ranging from [0,1]. A larger value results in higher precision but lower recall rate, while a smaller value results in lower precision but higher recall rate. Therefore, a trade-off is necessary, and it is generally set to 0.7. The quality score is a quantitative evaluation of the overall quality of each repair case, generally based on source credibility, content completeness, and content detail. This is achieved by weighted summation of the three factors, with weight ratios of 0.4, 0.35, and 0.25. The preset quality score threshold is a value set based on this score. For example, it might be the value in the top 30% after ranking a series of quality scores from highest to lowest, set to 0.7. Vehicle model matching ensures that recalled repair cases are sufficiently compatible with the current target vehicle at the vehicle model level (e.g., cases for the Sagitar cannot come from completely different vehicle platforms); quality scoring ensures that the data quality of the cases themselves meets usability standards (e.g., verified cases from reliable sources are given priority). Both conditions must be met simultaneously (i.e., a logical AND relationship); failure to meet either condition renders the case unqualified. This dual-screening mechanism effectively ensures that the reference cases input into the large model Prompt are both vehicle model applicable and data reliable.

[0039] As described in step S3052 above, relevant repair cases that do not meet the filtering conditions are removed, and a preset number of relevant repair cases are re-filtered based on similarity scores to judge the filtering conditions, until all preset number of relevant repair cases meet the filtering conditions. This limits the iterative completion mechanism when some cases are found to not meet the filtering conditions. Its core logic is: remove cases that do not meet the conditions from the candidate set, then select new cases from the knowledge base according to similarity scores from high to low (supplementing from cases that have never been selected), and judge the newly selected cases using the same filtering conditions. This iterative process continues until a preset number (e.g., K=3) of cases that all meet the filtering conditions are successfully filtered. This iterative mechanism ensures that the final output number of relevant repair cases reaches the preset value, while also ensuring that each case meets the dual requirements of vehicle model matching and quality score.

[0040] In one embodiment, the preset instruction template includes at least six paragraphs: role setting paragraph, vehicle information paragraph, current diagnosis result paragraph, fault code professional data paragraph, relevant repair case paragraph, and output format constraint paragraph; Step S4, which involves segmenting and concatenating the diagnostic data, vehicle basic information, structured description text, and multiple related repair cases according to a preset instruction template to form a structured instruction, includes: S401: Fill the preset character description text into the character setting section; S402: Fill the vehicle basic information into the vehicle information segment; S403: Fill the diagnostic data into the current diagnostic result segment; S404: Fill the structured description text into the fault code professional data segment; S405: Fill the multiple relevant repair cases into the relevant repair case section; S406: Fill the output format constraint segment with the preset format constraint text to form a structured instruction.

[0041] As described in step S401 above, the preset role description text is filled into the role setting section. The role setting section is the personality anchoring part of the entire Prompt, and its function is to set a clear identity and behavioral boundaries for the large language model. By anchoring its role identity in advance before the large model inferences, it is possible to effectively guide the model to analyze problems from the perspective of an expert in a specific domain, rather than responding from the generalized perspective of a general assistant.

[0042] As described in step S402 above, the basic vehicle information is filled into the vehicle information segment. The function of the vehicle information segment is to present the static attributes and usage history of the current target vehicle to the large model in a complete manner, so that the model can fully consider the vehicle model specificity when analyzing faults. The causes and repair solutions for the same fault code may vary significantly across different brands, models, and years. For example, a fault code may point to the ignition coil on model A, while it may point to the fuel injector on model B.

[0043] As described in step S403 above, the diagnostic data is filled into the current diagnostic result segment. The function of this diagnostic result segment is to present the raw data of this OBD diagnosis, the current fault phenomena and abnormal parameters of the vehicle to the large model. This is the core problem description of the entire analysis task. The diagnostic data includes at least a list of fault codes, and preferably also key data stream parameters (such as engine speed, coolant temperature, fuel trim value, etc.). These data reflect the current actual operating status of various vehicle systems.

[0044] As described in step S404 above, the structured description text is filled into the fault code professional data segment. The function of this segment is to inject highly reliable vertical domain knowledge from the proprietary fault code location and symptom information database into the large model. Unlike those segments that only contain fault code numbers and brief Chinese names, the structured description text provided in this segment includes in-depth information such as professional location descriptions of the fault code, descriptions of typical symptoms, information on associated components, and performance impact levels.

[0045] As described in step S405 above, the multiple relevant repair cases are filled into the relevant repair case segment. The function of this relevant repair case segment is to provide the large model with historical repair experience retrieved through vector semantic retrieval. These cases include information such as actual repair steps under similar fault conditions, spare parts used, reference working hours, and cost ranges. When generating repair suggestions, the large model can refer to the repair paths of these real cases, thereby significantly improving the operability of the suggestions.

[0046] As described in step S406 above, the preset format constraint text is filled into the output format constraint segment to form a structured instruction. This involves filling the preset format constraint text into this segment and finally concatenating the six segments to form a complete structured instruction. The function of the output format constraint segment is to explicitly specify the format requirements and value specifications of the output results to the large model, ensuring that the response text output by the model has a stable, unified, and machine-parseable structure. The original output of the large model has inherently unstructured characteristics. By strictly limiting the JSON structure, field types, and enumeration value range in this segment, the subsequent S6 step can efficiently and accurately extract the six-dimensional analysis results through a programmed parsing method, without relying on complex natural language understanding techniques for result extraction.

[0047] In one embodiment, step S6, which involves parsing the response text to obtain the structured analysis results, includes: S601: After removing the code block markers from the response text, perform format parsing to obtain temporary parsed text; S602: Verify whether the temporary parsed text contains all necessary fields and whether the values ​​of each field meet the preset requirements; S603: When the verification passes, extract the structured analysis results from the temporary parsed text.

[0048] As described in step S601 above, after removing code block markers from the response text, format parsing is performed to obtain temporary parsed text. The large model response text received in step S5 undergoes preprocessing operations of format cleaning and parsing, specifically including two sub-operations: first, removing code block markers, then performing format parsing, ultimately obtaining temporary parsed text. When generating responses containing JSON structures, large models often wrap the JSON content with Markdown-style code block markers (such as ```json and ```) for format friendliness. These markers are easy for humans to read but not conducive to direct machine parsing. Therefore, they need to be stripped first before performing format parsing on the clean content (i.e., calling the JSON parser to convert the string into a data structure object). The text obtained after parsing is called temporary parsed text, indicating that it is still in a temporary state awaiting verification and has not yet been confirmed as the final valid structured result.

[0049] As described in step S602 above, the temporary parsed text is verified to ensure it contains all necessary fields and that the values ​​of each field meet preset requirements. The generated temporary parsed text undergoes a dual verification process: the first verification checks whether the data structure contains all necessary fields (i.e., field integrity verification); the second verification checks whether the values ​​of each field meet preset requirements (i.e., field value validity verification). Necessary fields are determined by the six dimensions of the six-dimensional structured analysis results: fault interpretation, severity, repair suggestion, parts list, estimated cost, and repair priority. Preset requirements include data type constraints, enumerated value range constraints, and nested structure constraints for each field. Before extracting results, the output of the large model is ensured to meet the system's quality threshold to prevent errors in subsequent steps due to missing fields or abnormal formats.

[0050] As described in step S603 above, when the verification passes, the structured analysis results are extracted from the temporary parsed text. If the verification passes (i.e., both verifications are successful), the formal extraction of the structured analysis results from the temporary parsed text is executed. After the format cleaning and parsing in S601 and the integrity and legality verification in S602, the temporary parsed text has been verified as valid data that meets all quality requirements. Therefore, the six-dimensional structured analysis results can be directly extracted from it according to the field mapping rules. The six-dimensional analysis results have a direct correspondence with the fields in the temporary parsed text, requiring no additional business logic conversion or data processing.

[0051] In one embodiment, after step S602 of verifying whether the temporarily parsed text contains all necessary fields and whether the values ​​of each field meet preset requirements, the method further includes: S6031: When the verification fails, a retry counter is initialized; wherein, the retry counter is used to record the number of failures, and is incremented by 1 each time the verification fails, and the initial value of the retry counter is 0; S6032: Determine whether the current number of failed attempts is less than the preset maximum number of retries; S6033: If the number of retries is less than the preset maximum number, append a format error message to the end of the structured instruction and resend it to the pre-trained large language model for parsing, and re-obtain the response text for verification; S6034: When the number of retries reaches the preset maximum number of retries and still fails, the fault code professional data is directly read from the symptom information database, and a basic analysis result without large language model reasoning is generated according to the preset simplified report template as the structured analysis result.

[0052] As described in step S6031 above, when the verification fails, a retry counter is initialized. This retry counter records the number of failures, incrementing by 1 with each failed verification attempt. The initial value of the retry counter is 0. This defines the triggering point of the fault tolerance process after a verification failure, namely, the initialization of a retry counter. This counter is a variable used to record the number of verification failures, with an initial value of 0, incrementing by 1 with each failed verification attempt. The retry counter is created and initialized from the first verification failure, increasing with each subsequent failure until it reaches a preset maximum retry threshold. The maximum retry threshold is positively correlated with the request success rate but also with response latency. Therefore, a balance needs to be struck between success rate and response latency, typically set to 3 times. This counting mechanism allows the system to accurately track the current retry round, enabling it to make the correct decision between continuing retries and abandoning retries to enter a degradation phase. Specifically, when the verification logic in step S602 returns a verification failure result, the fault tolerance processing module of the cloud server immediately initiates the retry process. This module first creates a retry counter variable named `retry_count` in the context of the current analysis session (which can be stored in a Redis cache or a memory variable, using the current diagnostic record ID `record_id` as the key), and initializes it to 0. Then, since this is the first failed verification, the system increments the counter, updating `retry_count` to 1, and logs the first verification failure, triggering the retry process.

[0053] As described in the above step S6032, it is determined whether the current number of failures is less than the preset maximum number of retries, that is, whether the current accumulated number of verification failures (i.e., the current value of the retry counter maintained in S6031) is less than the preset maximum retry count threshold. If the current number of failures is less than the preset maximum number of retries, it indicates that the system still has remaining retry quotas, and the retry operation of S6033 is performed; if the current number of failures has reached or exceeded the preset maximum number of retries, it indicates that the system has exhausted all retry quotas, and the process jumps to S6034 to perform degradation processing. The preset maximum number of retries indicates that this threshold is a pre-configured parameter of the system, rather than a dynamically adjusted value, which ensures the certainty and controllability of the retry strategy. For example, after the fault-tolerant control module of the cloud server completes the counter increment in S6031 (retry_count=1 after the first failure), it executes the judgment logic of this step. The module reads the preset maximum retry count parameter max_retries from the system configuration center (such as the Apollo or Nacos configuration management service). In this embodiment, this parameter is preset to 3, which means that the system allows a maximum of 3 attempts to re-invoke the large model. The judgment logic is to compare whether retry_count < max_retries is established, that is, whether the current number of failures 1 is less than the maximum retry count 3. The result is True (1<3), indicating that there are still retry quotas, and the system continues to execute the retry operation of S6033. If the verification still fails after two retries, the counter has incremented to 3 at this time, and when this step is executed again, the judgment 3<3 is False, indicating that the retry quota has been exhausted, and the system will skip S6033 and directly execute the degradation processing of S6034.

[0054] As described in the above step S6033, if it is less than the preset maximum number of retries, a format error prompt text is appended to the end of the structured instruction and then resent to the pre-trained large language model for parsing, and the response text is reacquired for verification. When it is determined that the current number of failures is less than the preset maximum number of retries, the system executes the following operation sequence: first, append a piece of format error prompt text to the end of the original structured instruction, then resend the modified structured instruction to the pre-trained large language model, obtain a new response text, and re-perform verification on the new response text (that is, re-enter the parsing and verification processes of S601 and S602). The key design of this step lies in appending the format error prompt text — the function of this prompt text is to inform the large model that the previous output format is unqualified, and guide the model to correct the format problem during the current generation, rather than simply resubmitting the original instruction (the latter is almost ineffective for improving the output format). This design embodies the engineering concept of feedback-based retry rather than blind retry.

[0055] As described in step S6034 above, when the number of retries reaches the preset maximum number of retries and still fails, the system directly reads the fault code professional data from the symptom information database and generates a basic analysis result without large language model inference according to the preset simplified report template as the structured analysis result. When the number of retries reaches the preset maximum number of retries and the last verification still fails, the system abandons further attempts to call the large model and instead directly reads the professional data corresponding to the fault code from its own symptom information database and generates a basic analysis result without large language model inference according to the preset simplified report template. This basic analysis result is consistent with the six-dimensional structured analysis result in terms of data structure, but the fault interpretation field is no longer a comprehensive natural language analysis generated by the large model, but a concatenated text of fault code location description and typical symptoms directly extracted from the symptom information database; fields that require inference generation, such as maintenance suggestions, are filled with a preset general template. This degradation mechanism ensures that even in extreme cases (such as large model service unavailable, API timeout, repeated output format errors), the system can still deliver a valuable diagnostic report to the user, rather than directly reporting an error or returning an empty result.

[0056] Reference Figure 3 The present invention provides a vehicle diagnostic report intelligent generation device, the device comprising: The acquisition module 902 is used to acquire diagnostic data and basic vehicle information of the target vehicle; The structured query execution module 904 is used to perform a structured query on the preset symptom information database based on the diagnostic data to obtain structured descriptive text; The vector semantic retrieval execution module 906 is used to perform vector semantic retrieval in a preset automotive fault repair knowledge base based on the diagnostic data and the vehicle basic information to obtain multiple relevant repair cases; The forming module 908 is used to segment and splice the diagnostic data, the vehicle basic information, the structured description text and the multiple related repair cases according to a preset instruction template to form a structured instruction; The receiving module 910 is used to send the structured instructions to the pre-trained large language model and receive the response text returned by the pre-trained large language model; The parsing module 912 is used to parse the response text, obtain the structured analysis results, and embed the structured analysis results into the diagnostic report template to generate a complete diagnostic report.

[0057] In one embodiment, the acquisition module 902 includes: A diagnostic data receiving submodule is used to receive diagnostic data; wherein the diagnostic data includes at least a fault code list and a vehicle identification number; The vehicle brand acquisition submodule is used to obtain the vehicle brand, model, year, engine displacement and transmission type of the target vehicle based on the vehicle identification code parsing. The reading submodule is used to read the cumulative mileage data of the target vehicle; The vehicle basic information formation submodule is used to combine the vehicle brand, model, year, engine displacement, transmission type and cumulative mileage to form the vehicle basic information.

[0058] In one embodiment, the vector semantic retrieval execution module 906 includes: An assembly submodule is used to assemble the list of fault codes in the diagnostic data with the vehicle's basic information into a query text. The conversion submodule is used to convert the query text into a query vector using a preset embedding model; The similarity score acquisition submodule is used to perform cosine similarity nearest neighbor search in the vector space of the automotive fault repair knowledge base to obtain the similarity score between the query vector and each repair case. The filtering submodule is used to filter a preset number of related repair cases based on their similarity scores, from highest to lowest.

[0059] In one embodiment, the vector semantic retrieval execution module 906 further includes: The first judgment submodule is used to determine whether the selected relevant repair cases meet the preset screening conditions; wherein, the screening conditions include the vehicle model matching degree being greater than the preset matching degree threshold and the quality score being greater than the preset quality score threshold; The re-filtering submodule is used to re-filter a preset number of related repair cases that do not meet the filtering conditions based on similarity scores, until all the preset number of related repair cases meet the filtering conditions.

[0060] In one embodiment, forming module 908 includes: The Character Setting Section Filling Submodule is used to fill the preset character description text into the Character Setting Section; The vehicle information segment filling submodule is used to fill the basic vehicle information into the vehicle information segment; The diagnostic results field filling submodule is used to fill the diagnostic data into the current diagnostic results field; The fault code professional data segment filling submodule is used to fill the structured description text into the fault code professional data segment; The relevant repair case section filling submodule is used to fill the multiple relevant repair cases into the relevant repair case section; The structured instruction forming submodule is used to fill the output format constraint segment with preset format constraint text to form structured instructions.

[0061] In one embodiment, the parsing module 912 includes: The temporary parsing text submodule is used to remove code block markers from the response text and then perform format parsing to obtain temporary parsing text. The verification submodule is used to verify whether the temporarily parsed text contains all the necessary fields and whether the values ​​of each field meet the preset requirements. The structured analysis result extraction submodule is used to extract the structured analysis results from the temporarily parsed text when the verification passes.

[0062] In one embodiment, the parsing module 912 further includes: An initialization submodule is used to initialize a retry counter when the verification fails; wherein, the retry counter is used to record the number of failures, and increments by 1 each time the verification fails, and the initial value of the retry counter is 0; The second judgment submodule is used to determine whether the current number of failed attempts is less than the preset maximum number of retries; An additional submodule is used to append a format error message to the end of the structured instruction if the number of retries is less than the preset maximum number of retries, and then resend the instruction to the pre-trained large language model for parsing and to obtain the response text again for verification. The basic analysis result generation submodule is used to directly read fault code professional data from the symptom information database and generate basic analysis results without large language model inference as the structured analysis results when the number of retries reaches the preset maximum number of retries and still fails.

[0063] Figure 4 An internal structural diagram of an electronic device in one embodiment is shown. This electronic device can specifically be a terminal or a server, and more specifically, a computer device. Figure 4 As shown, the electronic device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a method for intelligently generating vehicle diagnostic reports. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute the method for intelligently generating vehicle diagnostic reports. Those skilled in the art will understand that… Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0064] In one embodiment, an electronic device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps: Obtain diagnostic data and basic vehicle information for the target vehicle; Based on the diagnostic data, a structured query is performed in a preset symptom information database to obtain a structured descriptive text; Based on the diagnostic data and the vehicle's basic information, a vector semantic search is performed in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases; The diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases are segmented and spliced ​​together according to the preset instruction template to form a structured instruction; The structured instructions are sent to the pre-trained large language model, and the response text returned by the pre-trained large language model is received. The response text is parsed to obtain structured analysis results, which are then embedded into a diagnostic report template to generate a complete diagnostic report.

[0065] By acquiring diagnostic data and basic vehicle information of the target vehicle, the system performs two main operations: firstly, it executes a structured query in the symptom information database to obtain structured descriptive texts such as professional location descriptions and typical symptoms corresponding to fault codes; secondly, it performs vector semantic retrieval in the automotive fault repair knowledge base to recall relevant repair cases that match the current diagnostic scenario and vehicle conditions. The diagnostic data, basic vehicle information, structured descriptive texts, and relevant repair cases are then concatenated into structured instructions according to a preset instruction template and sent to the large language model. This constrains the reasoning boundaries and output format of the large language model, enabling it to perform targeted reasoning with the support of vertical domain knowledge. This effectively reduces reasoning bias caused by a lack of professional knowledge support. At the same time, the structured analysis results can be directly embedded into the report template, ultimately generating a diagnostic report that integrates professional data support and personalized vehicle information, thus improving the reliability of the report.

[0066] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the following steps: Obtain diagnostic data and basic vehicle information for the target vehicle; Based on the diagnostic data, a structured query is performed in a preset symptom information database to obtain a structured descriptive text; Based on the diagnostic data and the vehicle's basic information, a vector semantic search is performed in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases; The diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases are segmented and spliced ​​together according to the preset instruction template to form a structured instruction; The structured instructions are sent to the pre-trained large language model, and the response text returned by the pre-trained large language model is received. The response text is parsed to obtain structured analysis results, which are then embedded into a diagnostic report template to generate a complete diagnostic report.

[0067] By acquiring diagnostic data and basic vehicle information of the target vehicle, the system performs two main operations: firstly, it executes a structured query in the symptom information database to obtain structured descriptive texts such as professional location descriptions and typical symptoms corresponding to fault codes; secondly, it performs vector semantic retrieval in the automotive fault repair knowledge base to recall relevant repair cases that match the current diagnostic scenario and vehicle conditions. The diagnostic data, basic vehicle information, structured descriptive texts, and relevant repair cases are then concatenated into structured instructions according to a preset instruction template and sent to the large language model. This constrains the reasoning boundaries and output format of the large language model, enabling it to perform targeted reasoning with the support of vertical domain knowledge. This effectively reduces reasoning bias caused by a lack of professional knowledge support. At the same time, the structured analysis results can be directly embedded into the report template, ultimately generating a diagnostic report that integrates professional data support and personalized vehicle information, thus improving the reliability of the report.

[0068] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0069] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0070] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for intelligently generating vehicle diagnostic reports, characterized in that, The method includes: Obtain diagnostic data and basic vehicle information for the target vehicle; Based on the diagnostic data, a structured query is performed in a preset symptom information database to obtain a structured descriptive text; Based on the diagnostic data and the vehicle's basic information, a vector semantic search is performed in a preset automotive fault repair knowledge base to obtain multiple relevant repair cases; The diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases are segmented and spliced ​​together according to the preset instruction template to form a structured instruction; The structured instructions are sent to the pre-trained large language model, and the response text returned by the pre-trained large language model is received. The response text is parsed to obtain structured analysis results, which are then embedded into a diagnostic report template to generate a complete diagnostic report.

2. The intelligent vehicle diagnostic report generation method according to claim 1, characterized in that, The steps for obtaining diagnostic data and basic vehicle information of the target vehicle include: Receive diagnostic data; wherein the diagnostic data includes at least a list of fault codes and a vehicle identification number; Based on the vehicle identification code, the vehicle brand, model, year, engine displacement, and transmission type of the target vehicle are obtained; Read the cumulative mileage data of the target vehicle; The vehicle's basic information is formed by combining the vehicle brand, model, year, engine displacement, transmission type, and cumulative mileage.

3. The intelligent vehicle diagnostic report generation method according to claim 1, characterized in that, The step of performing vector semantic retrieval in a preset automotive fault repair knowledge base based on the diagnostic data and the vehicle's basic information to obtain multiple relevant repair cases includes: The list of fault codes in the diagnostic data is combined with the vehicle's basic information to form a query text; The query text is converted into a query vector using a preset embedding model; Perform a cosine similarity nearest neighbor search in the vector space of the automotive fault repair knowledge base to obtain the similarity score between the query vector and each repair case; A preset number of relevant repair cases are selected based on their similarity scores, from highest to lowest.

4. The intelligent vehicle diagnostic report generation method according to claim 1, characterized in that, After the step of filtering a preset number of relevant repair cases based on their similarity scores from highest to lowest, the process also includes: Determine whether the selected relevant repair cases meet the preset screening conditions; wherein, the screening conditions include a vehicle model matching degree greater than a preset matching degree threshold and a quality score greater than a preset quality score threshold; For related repair cases that do not meet the filtering conditions, a preset number of related repair cases will be re-filtered based on the similarity score to determine the filtering conditions, until the preset number of related repair cases all meet the filtering conditions.

5. The intelligent vehicle diagnostic report generation method according to claim 1, characterized in that, The preset instruction template includes at least six paragraphs: role setting paragraph, vehicle information paragraph, current diagnosis result paragraph, fault code professional data paragraph, relevant repair case paragraph, and output format constraint paragraph; The step of segmenting and splicing the diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases according to a preset instruction template to form a structured instruction includes: Fill the preset character description text into the character setting section; Fill the vehicle basic information into the vehicle information segment; Fill the diagnostic data into the current diagnostic results section; Fill the structured description text into the fault code professional data segment; Fill the relevant repair cases into the relevant repair case section; The preset format constraint text is filled into the output format constraint segment to form a structured instruction.

6. The intelligent vehicle diagnostic report generation method according to claim 1, characterized in that, The step of parsing the response text to obtain structured analysis results includes: After removing code block markers from the response text, format parsing is performed to obtain temporary parsed text; Verify whether the temporarily parsed text contains all necessary fields and whether the values ​​of each field meet the preset requirements; When the verification passes, the structured analysis results are extracted from the temporarily parsed text.

7. The intelligent vehicle diagnostic report generation method according to claim 6, characterized in that, After the step of verifying whether the temporarily parsed text contains all necessary fields and whether the values ​​of each field meet the preset requirements, the method further includes: When the verification fails, a retry counter is initialized; wherein, the retry counter is used to record the number of failures, and is incremented by 1 each time the verification fails, and the initial value of the retry counter is 0; Determine if the current number of failed attempts is less than the preset maximum number of retries; If the number of retries is less than the preset maximum number, a format error message is appended to the end of the structured instruction and it is resent to the pre-trained large language model for parsing, and the response text is retrieved again for verification. If the number of retries reaches the preset maximum number of retries and still fails, the fault code professional data is directly read from the symptom information database, and a basic analysis result without large language model reasoning is generated according to the preset simplified report template as the structured analysis result.

8. A vehicle diagnostic report intelligent generation device, characterized in that, The device includes: The acquisition module is used to acquire diagnostic data and basic vehicle information of the target vehicle. The structured query execution module is used to perform a structured query on the pre-set symptom information database based on the diagnostic data to obtain structured descriptive text; The vector semantic retrieval execution module is used to perform vector semantic retrieval in a preset automotive fault repair knowledge base based on the diagnostic data and the vehicle basic information to obtain multiple relevant repair cases; The forming module is used to segment and splice the diagnostic data, the vehicle basic information, the structured description text, and the multiple related repair cases according to a preset instruction template to form structured instructions; The receiving module is used to send the structured instructions to the pre-trained large language model and receive the response text returned by the pre-trained large language model; The parsing module is used to parse the response text, obtain structured analysis results, and embed the structured analysis results into the diagnostic report template to generate a complete diagnostic report.

9. A computer-readable storage medium, characterized in that, The system contains a computer program that, when executed by a processor, causes the processor to perform the steps of the intelligent vehicle diagnostic report generation method as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, The device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the intelligent vehicle diagnostic report generation method as described in any one of claims 1 to 7.