A vehicle diagnosis program generation method, device and terminal equipment
By constructing a diagnostic knowledge graph and semantic vector representation, vehicle diagnostic programs are automatically generated, solving the problems of high development costs and low efficiency in existing technologies, and achieving fast and accurate generation of vehicle diagnostic programs.
Patent Information
- Application Number
- CN202611242870.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-11-06
AI Technical Summary
The development of existing vehicle diagnostic software suffers from high development costs, low efficiency, and low code reusability. Furthermore, the protocol parsing process relies on manual hard coding, resulting in a long support cycle for new vehicle models and making it prone to introducing errors.
By constructing a diagnostic knowledge graph and semantic vector representation, the system automatically determines communication protocol association constraints and diagnostic business judgment rules, generates diagnostic function code, and generates vehicle diagnostic programs by combining basic program information, thus achieving intelligent diagnostic program generation.
Reduce manual intervention, shorten the support cycle for new models, improve the accuracy, code reusability and adaptability of diagnostic procedures, and achieve the systematic accumulation of diagnostic knowledge.
Smart Images

Figure CN123047531A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of vehicle diagnostic technology, and in particular relates to a method, apparatus and terminal equipment for generating vehicle diagnostic programs. Background Technology
[0002] The core function of vehicle diagnostic software is to establish a connection with the electronic control unit (ECU) through the vehicle's communication interface, and perform operations such as fault code reading, fault code clearing, data stream reading, action testing, and maintenance reset. Current development requirements for vehicle diagnostic software necessitate separate diagnostic protocol parsing and functional logic development for each brand and vehicle model, ultimately compiling them into independent software modules.
[0003] Although component-based diagnostic software frameworks have emerged in recent years, encapsulating common communication functions and user interfaces into reusable components, the protocol parsing process still relies on manual hard coding. Developers need to obtain the diagnostic protocol details of the target vehicle model through hardware packet capture and software reverse engineering, then manually write protocol parsing code, combine it with common components to develop business functions, and finally undergo real-vehicle testing, debugging, and software update release. This process leads to highly repetitive protocol layer development, long new model support cycles, and the manual parsing process is prone to introducing errors, making it difficult to adapt to the complexity and diversity of vehicle diagnostic data. Summary of the Invention
[0004] This application provides a method, apparatus, and terminal device for generating vehicle diagnostic programs, which can solve the problems of high development costs, low efficiency, and low code reusability in the development of existing vehicle diagnostic software.
[0005] In a first aspect, embodiments of this application provide a method for generating a vehicle diagnostic program, including: Based on the structured diagnostic data of the vehicle, a diagnostic knowledge graph and semantic vector representation are constructed; wherein, the structured diagnostic data is obtained by structuring the original diagnostic data of the vehicle, and the original diagnostic data includes vehicle bus diagnostic message data between the vehicle diagnostic equipment and the vehicle, and vehicle maintenance data. Based on the diagnostic knowledge graph and the semantic vector representation, the communication protocol association constraints and diagnostic business judgment rules between the vehicle and the vehicle diagnostic equipment are determined. Based on the communication protocol association constraints and the diagnostic service determination rules, diagnostic function codes corresponding to multiple diagnostic services are generated; wherein, the diagnostic function codes are configured with retrieval and invocation logic for the diagnostic knowledge graph and the semantic vector representation; Based on the diagnostic function codes and basic program information corresponding to the multiple diagnostic services, a vehicle diagnostic program adapted to the vehicle is generated; wherein, the basic program information is used to characterize the version management, compatible vehicle models, and function access permissions of the vehicle diagnostic program.
[0006] In one possible implementation of the first aspect, the step of constructing a diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data includes: Extract entities, entity attributes, and relationships between entities from the structured diagnostic data, wherein the entities include at least one of the following: fault type, component, and electronic control unit; The diagnostic knowledge graph is constructed by using the entities as nodes, the entity attributes as node attributes, and the relationships between entities as edges. The structured diagnostic data is semantically segmented to obtain semantic blocks; The semantic block is vector-encoded using an embedding model to obtain the semantic vector representation corresponding to the structured diagnostic data.
[0007] In one possible implementation of the first aspect, before constructing the diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data, the method includes: Obtain the vehicle's original diagnostic data; The original diagnostic data is analyzed using a multimodal large model to obtain diagnostic knowledge from the original diagnostic data; The diagnostic knowledge is cleaned and structured to obtain the structured diagnostic data.
[0008] In one possible implementation of the first aspect, generating diagnostic function code corresponding to multiple diagnostic services based on the communication protocol association constraints and the diagnostic service determination rules includes: Based on the communication protocol association constraints and the diagnostic service determination rules, multiple initial diagnostic function codes corresponding to the multiple diagnostic services are automatically generated through the protocol reverse engineering agent and the code generation agent; wherein, the protocol reverse engineering agent is used to parse vehicle bus diagnostic message data and reverse extract communication protocol elements. The multiple initial diagnostic function codes are registered into the function scheduling framework, and full-link automated testing is performed to obtain the multiple diagnostic function codes.
[0009] In one possible implementation of the first aspect, the step of automatically generating multiple initial diagnostic function codes corresponding to the multiple diagnostic services through a protocol reverse engineering agent and a code generation agent, based on the communication protocol association constraints and the diagnostic service determination rules, includes: Select a preset diagnostic function template corresponding to the diagnostic service. The preset diagnostic function template includes at least one of the following: fault code reading template, fault code clearing template, action test template, and maintenance reset template. The parameters, business workflow, and exception handling logic in the preset diagnostic function template are configured using a visual editor to obtain the configured template; The protocol reverse engineering agent automatically parses and processes the vehicle bus diagnostic message data to generate communication protocol parsing code. Based on the configured template and the communication protocol parsing code, the initial diagnostic function code is automatically generated by the code generation agent.
[0010] In one possible implementation of the first aspect, the automatic parsing and processing of the vehicle bus diagnostic message data by the protocol reverse engineering agent to generate communication protocol parsing code includes: Identify the basic protocol characteristics of the vehicle bus diagnostic message data; Cluster analysis of the vehicle bus diagnostic message data is performed using a large language model to identify the functional diagnostic instructions in the vehicle bus diagnostic message data. The request message format and response message format of the functional diagnostic instruction are parsed to obtain the header, data field, and checksum of the request message and response message; Based on the diagnostic knowledge graph and the protocol information similar to the basic features of the protocol in the semantic vector representation, as well as the preset protocol description data, the instruction meaning and parameter format of each functional diagnostic instruction are obtained; Based on the meaning and parameter format of each functional diagnostic instruction, protocol parsing code is automatically generated.
[0011] In one possible implementation of the first aspect, registering the plurality of initial diagnostic function codes to a function scheduling framework and performing end-to-end automated testing to obtain the plurality of diagnostic function codes includes: Register the multiple initial diagnostic function codes to the function scheduling framework; Configure automated testing agents and code review agents according to the diagnostic business judgment rules; The test cases automatically generated by the automated testing agent are used to perform full-link automated testing on the multiple initial diagnostic function codes to obtain test results. The code review agent performs a quality review on the multiple initial diagnostic function codes and generates a code review report. Based on the test results and the code review report, the initial diagnostic function code is optimized to obtain the multiple diagnostic function codes.
[0012] In one possible implementation of the first aspect, after generating a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes and program basic information corresponding to the plurality of diagnostic services, the method further includes: Obtain diagnostic data for new vehicles; Based on the diagnostic data of the new vehicle, the diagnostic intelligent knowledge base is incrementally updated to obtain the updated diagnostic intelligent knowledge base.
[0013] Secondly, embodiments of this application provide a vehicle diagnostic program generation apparatus, comprising: The knowledge construction module is used to construct a diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data; wherein, the structured diagnostic data is obtained by structuring the vehicle's original diagnostic data, which includes vehicle bus diagnostic message data between the vehicle diagnostic equipment and the vehicle, and vehicle maintenance data. The rule determination module is used to determine the communication protocol association constraints and diagnostic business judgment rules between the vehicle and the vehicle diagnostic equipment based on the diagnostic knowledge graph and the semantic vector representation. The code generation module is used to generate diagnostic function codes corresponding to multiple diagnostic services based on the communication protocol association constraints and the diagnostic service judgment rules; wherein, the diagnostic function codes are provided with retrieval and invocation logic for the diagnostic knowledge graph and the semantic vector representation; The program generation module is used to generate a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes and program basic information corresponding to the multiple diagnostic services; wherein, the program basic information is used to characterize the version management, compatible vehicle models, and function access permissions of the vehicle diagnostic program.
[0014] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vehicle diagnostic program generation method described in any of the above claims.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the vehicle diagnostic program generation method described in any of the preceding claims.
[0016] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the vehicle diagnostic program generation method described in any one of the first aspects.
[0017] The beneficial effects of the embodiments in this application compared with the prior art are: This application provides a method for generating vehicle diagnostic programs, comprising: First, constructing a diagnostic knowledge graph and semantic vector representation based on structured diagnostic data of the vehicle; wherein the structured diagnostic data is obtained by structuring the original diagnostic data of the vehicle, including vehicle bus diagnostic message data between the vehicle diagnostic device and the vehicle, and vehicle maintenance data. Then, based on the diagnostic knowledge graph and semantic vector representation, determining the communication protocol association constraints and diagnostic service judgment rules between the vehicle and the vehicle diagnostic device. Based on the communication protocol association constraints and diagnostic service judgment rules, generating diagnostic function codes corresponding to multiple diagnostic services; wherein the diagnostic function codes include retrieval and invocation logic for the diagnostic knowledge graph and semantic vector representation. Finally, generating a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes corresponding to multiple diagnostic services and basic program information; wherein the basic program information is used to characterize the version management, compatible vehicle model range, and functional access permissions of the vehicle diagnostic program. This method can reduce manual intervention, shorten the new vehicle model support cycle, improve the accuracy, code reusability, and adaptability of diagnostic programs, and achieve systematic accumulation of diagnostic knowledge. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic flowchart of a vehicle diagnostic program generation method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a vehicle diagnostic program generation device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0021] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0022] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0023] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0024] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0026] In the traditional vehicle diagnostic software development framework, the implementation of the protocol parsing part relies on hard coding. This process requires developers to manually construct the protocol parsing logic based on the raw diagnostic data obtained from hardware packet capture and software reverse engineering. This results in restricted development efficiency, extended support cycles for new vehicle models, and consequently affects the iteration speed and market adaptability of the diagnostic software. Specifically, software updates cannot respond to changes in vehicle models in a timely manner, increasing the complexity of the development process and resource consumption.
[0027] For example, when developing diagnostic software for a new model of a motorcycle manufacturer, developers capture vehicle bus diagnostic message data and perform reverse analysis to determine the protocol format. In this scenario, protocol parsing code is manually written to handle specific message structures. Due to protocol differences between different models, this code cannot be reused, resulting in the repeated consumption of development resources and delays in software release. Furthermore, business function development and testing phases are frequently interrupted due to protocol parsing errors, hindering the overall development process.
[0028] If the above problems are not resolved, the vehicle diagnostic software development process will continue to be limited by manual operation, making automation impossible. This will result in delayed software updates, increased maintenance complexity, and may reduce the reliability and accuracy of diagnostic functions, thereby adversely affecting the long-term stable operation and market competitiveness of vehicle diagnostic software.
[0029] To address this issue, this application proposes a vehicle diagnostic program generation system. This system employs a five-layer architecture: data layer, capability layer, engine layer, application layer, and user layer. Through fully automated processes including multimodal diagnostic knowledge import and processing, intelligent diagnostic knowledge base construction, standardized skill development (i.e., diagnostic function code development), agent-assisted development, and one-click deployment, it enables rapid development of motorcycle diagnostic software. The overall development process can be summarized as: knowledge import, intelligent diagnostic knowledge base construction, skill development, system integration, deployment, and continuous iteration.
[0030] The data layer may include a multimodal diagnostic knowledge import and processing module and an intelligent diagnostic knowledge base management module, used for data import, processing, storage, and retrieval. The multimodal diagnostic knowledge import and processing module is used to uniformly parse, clean, and structure various types of legally provided diagnostic data to build a standardized diagnostic knowledge system. The multimodal diagnostic knowledge import and processing module includes a batch data import submodule (supporting manual batch import of manufacturer-authorized official protocol documents, ECU communication message data, repair manuals, circuit diagrams, fault code definitions, technical bulletins, actual measurement packet capture data, real repair cases, etc.; supporting multiple formats such as PDF, Word, Excel, PPT, images, videos, and binary message files), a multimodal document parsing submodule (based on a multimodal large model, automatically parses various imported documents, extracting diagnostic knowledge from text, tables, circuit diagrams, disassembly and assembly diagrams, and video tutorials), a data cleaning and structuring submodule (automatically performs deduplication, error correction, standardization, and structuring on the extracted knowledge, unifying data formats, terminology standards, and coding rules), and a knowledge graph construction submodule (automatically constructing a knowledge graph linking vehicle model, ECU, protocol, fault code, component, fault symptom, and solution).
[0031] The intelligent diagnostic knowledge base management module is responsible for storing and managing all diagnostic knowledge, providing efficient retrieval and reasoning capabilities. It can include a vector database (stores vectorized text knowledge, supporting efficient semantic retrieval), a graph database (stores knowledge graphs, supporting relational reasoning and path querying), and a protocol library (stores diagnostic protocols, instruction formats, message structures, and Seed-Key algorithms for all brands, models, and ECUs). It can also include a version control submodule (supports version management and incremental updates of the knowledge base) and an access control submodule (supports fine-grained knowledge access control to protect manufacturer data).
[0032] The capability layer can include a standardized skill development and management module for the development, testing, release, and management of diagnostic functional code skills. This module provides a visual skill development environment, supporting no-code or low-code development of standardized diagnostic skills. It can include a skill standard definition submodule (defining skill metadata, input / output schema, workflow, error handling, security requirements, etc.), a visual skill editor (providing a drag-and-drop visual development environment supporting no-code skill development), a skill template library (providing a rich set of predefined skill templates, such as fault code reading, fault code clearing, action testing, and maintenance resetting), a skill testing submodule (providing a simulated testing environment supporting unit and integration testing of skills), and a skill marketplace (supporting internal release, sharing, download, and installation of skills).
[0033] The engine layer comprises a function scheduling framework and an intelligent development engine for agents, providing core capabilities such as AI protocol reverse engineering, automatic code generation, and automated testing. The function scheduling framework and intelligent development engine can include a protocol reverse engineering agent (automatically analyzing manually imported packet capture data to identify protocol formats, command meanings, and message structures), an automatic code generation agent (automatically generating skill code based on protocol information and skill templates), an automated testing agent (automatically generating test cases, executing end-to-end automated testing, and generating test reports), a code review agent (automatically reviewing code quality and identifying potential bugs and security issues), and the Harness function scheduling framework (providing basic capabilities such as the agent's runtime environment, task scheduling, resource management, and security control).
[0034] The application layer includes a one-click release and deployment module, supporting the generation and release of software for multiple platforms. The user layer provides a visual development interface for developers. The one-click release and deployment module can generate diagnostic software installation packages for PC, mobile, and cloud platforms with a single click, enabling rapid release and deployment. This module may include a multi-platform packaging submodule (supporting one-click generation of software installation packages for Windows, Android, iOS, and the cloud), a brand customization submodule (supporting customization of the software's brand, logo, and interface style), a permission configuration submodule (supporting configuration of different user permissions), and an automatic update submodule (supporting online upgrades and incremental updates).
[0035] Regarding the vehicle diagnostic program generation system proposed above, this embodiment proposes a vehicle diagnostic program generation method. Please refer to [link / reference needed]. Figure 1 , Figure 1This is a schematic flowchart illustrating a vehicle diagnostic program generation method according to an embodiment of this application. As an example and not a limitation, this method is applied to or runs in a terminal device, and includes: S11. Based on the vehicle's structured diagnostic data, a diagnostic knowledge graph and semantic vector representation are constructed. The structured diagnostic data is obtained by structuring the vehicle's original diagnostic data, which includes vehicle bus diagnostic message data between the vehicle diagnostic equipment and the vehicle, and vehicle maintenance data.
[0036] S12. Based on the diagnostic knowledge graph and semantic vector representation, determine the communication protocol association constraints between the vehicle and the vehicle diagnostic equipment, as well as the diagnostic business judgment rules.
[0037] S13. Based on the communication protocol association constraints and diagnostic business judgment rules, generate diagnostic function codes corresponding to multiple diagnostic businesses; wherein, the diagnostic function codes are equipped with retrieval and calling logic for diagnostic knowledge graphs and semantic vector representations.
[0038] S14. Generate a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes and program basic information corresponding to multiple diagnostic services; wherein, the program basic information is used to characterize the version management, compatible vehicle models, and function access permissions of the vehicle diagnostic program.
[0039] This embodiment provides a method for generating vehicle diagnostic programs. Through intelligent means, it realizes the automated construction of diagnostic knowledge, the intelligent determination of protocols and business rules, the automatic generation of diagnostic function codes, and the automated adaptation of the final diagnostic program.
[0040] Structured diagnostic data refers to a collection of diagnostic information that has been preprocessed and organized, with a clearly defined data model and field definitions. This structured diagnostic data is typically extracted from and standardized from the vehicle's raw diagnostic data to facilitate efficient storage, retrieval, and analysis by the computer system. Raw diagnostic data can include vehicle bus diagnostic message data (such as ECU communication message data, measured packet capture data, and fault code definitions), vehicle repair data (repair manuals, real repair cases), and also manufacturer-authorized official protocol documents, circuit diagrams, technical bulletins, etc. Raw diagnostic data can be in various formats such as PDF, Word, Excel, PPT, images, videos, and binary message files. Vehicle bus diagnostic message data refers to the data messages transmitted between electronic control units within the vehicle and between vehicle diagnostic equipment and the vehicle via the vehicle bus (such as CAN, LIN, FlexRay, etc.). This vehicle bus diagnostic message data contains key diagnostic information such as vehicle operating status, fault information, and control commands.
[0041] A diagnostic knowledge graph is a knowledge base represented in a graph structure. Nodes in the diagnostic knowledge graph represent entities (e.g., fault types, components, electronic control units), and edges represent relationships between entities. This diagnostic knowledge graph can intuitively display the knowledge system within the vehicle diagnostic field, supporting complex knowledge queries and reasoning. Semantic vector representation refers to converting unstructured information such as text or concepts into numerical representations in a high-dimensional vector space through an embedding model. In this vector space, semantically similar information has a close vector distance, thus supporting operations such as semantic matching and similarity retrieval.
[0042] Communication protocol constraints can be understood as the communication rules and data format requirements that must be followed when vehicle diagnostic equipment and the vehicle's electronic control unit exchange data during vehicle diagnostics. These constraints define elements such as message structure, timing, and verification to ensure the correctness and reliability of communication. Diagnostic service decision rules can be understood as the logical conditions and judgment criteria used to guide vehicle diagnostic programs in performing specific diagnostic operations. Based on diagnostic knowledge and experience, these rules determine under what circumstances which diagnostic functions should be performed, such as when to read fault codes and when to perform action tests.
[0043] Diagnostic function code refers to the program code module, or skill, that implements specific vehicle diagnostic business logic. This diagnostic function code encapsulates operations related to vehicle communication, data parsing, and fault diagnosis, and typically includes interfaces for calling diagnostic knowledge graphs and semantic vector representations to leverage intelligent diagnostic capabilities. This diagnostic function code can encapsulate diagnostic functions into standardized capability units that are independent of specific brands, models, and protocols, allowing for reuse across all vehicle models with a single development effort.
[0044] Basic program information can be understood as the core metadata used to manage and configure vehicle diagnostic programs. This basic information may include the program version number, the range of supported vehicle models, and the functional access permissions for users or devices, and is crucial for the deployment, updates, and access control of diagnostic programs.
[0045] Specifically, firstly, a diagnostic knowledge graph and semantic vector representation are constructed based on the vehicle's structured diagnostic data. This step is the foundation for the entire intelligent diagnostic process. Specifically, structured diagnostic data can be obtained by human experts through the organization and annotation of raw diagnostic data, including vehicle bus diagnostic messages between the vehicle diagnostic equipment and the vehicle, and vehicle maintenance data. For example, by manually reading a large amount of vehicle bus diagnostic messages and vehicle maintenance data, key information such as fault types, components, and electronic control units is identified and manually entered into a database to form structured data. Based on this, traditional data modeling tools can be used to map the entities and entity relationships in this structured diagnostic data into a graph structure, thereby constructing a diagnostic knowledge graph. Simultaneously, for the textual descriptions in the structured diagnostic data, traditional text representation methods such as the bag-of-words model can be used to convert the structured diagnostic data into numerical vectors, forming semantic vector representations.
[0046] Secondly, based on the diagnostic knowledge graph and semantic vector representation, the communication protocol association constraints and diagnostic business judgment rules between the vehicle and its diagnostic equipment are determined. The entity relationships within the diagnostic knowledge graph, including vehicle model, ECU, bus protocol, and diagnostic equipment, are traversed to automatically extract communication protocol association constraints. This clarifies which vehicle models, diagnostic equipment, and bus protocols, message commands, and communication service IDs can be used, defining communication compatibility boundaries. Simultaneously, by combining the business process relationships in the knowledge graph with fuzzy matching of similar fault scenarios using semantic vectors, the execution conditions, sequence, and anomaly judgment criteria for various diagnostic services are summarized, forming corresponding diagnostic business judgment rules. By determining the communication protocol association constraints and diagnostic business judgment rules, the underlying communication restrictions and upper-level business execution logic are automatically sorted out, replacing manual writing of protocol adaptation rules and business process rules, reducing human error. It should be understood that this step achieves automated extraction of diagnostic knowledge and intelligent inference of protocol rules, greatly reducing reliance on human experience and improving the accuracy and efficiency of protocol parsing.
[0047] Next, based on the communication protocol association constraints and the diagnostic service judgment rules, diagnostic function code corresponding to multiple diagnostic services is generated. This aims to transform abstract protocols and business rules into executable program code, achieving automated generation of diagnostic function code. Specifically, developers or intelligent agents can generate low-level communication code for parsing and constructing vehicle bus messages based on the established communication protocol association constraints. Simultaneously, based on the diagnostic service judgment rules, business logic code implementing specific diagnostic functions such as reading fault codes, clearing fault codes, and data stream reading is generated. After these code modules are written, they can be organized into independent functions or classes for subsequent calls.
[0048] It should be noted that the generated diagnostic function code includes retrieval and calling logic for diagnostic knowledge graphs and semantic vector representations, enabling the diagnostic program to have intelligent diagnostic capabilities at runtime. It can perform deeper analysis and judgment based on real-time data, which is difficult to achieve with traditional hard-coding methods.
[0049] Finally, based on the diagnostic function code and basic program information corresponding to these multiple diagnostic services, a vehicle diagnostic program adapted to the vehicle is generated. In one implementation, the generated diagnostic function code can be combined with predefined basic program information (e.g., version number, supported vehicle model list, and function permissions specified in a configuration file) and compiled and linked using a software compilation tool to generate an executable vehicle diagnostic program. After generation, this vehicle diagnostic program requires manual deployment and configuration to ensure it can run normally on the target vehicle diagnostic equipment and support the corresponding vehicle models and functions, significantly shortening the development and support cycle of diagnostic programs for new vehicle models.
[0050] It is understood that this embodiment provides a vehicle diagnostic program generation method. By introducing knowledge graphs, semantic vector representations, and automated code generation mechanisms, it transforms diagnostic software development from a labor-intensive manual mode to a knowledge-driven intelligent mode. This solves the problems of low efficiency and reliance on human experience in the existing vehicle diagnostic software development process, thereby improving development efficiency, reducing development costs, and enhancing the intelligence level of the diagnostic program.
[0051] In one possible implementation, a diagnostic knowledge graph and semantic vector representation are constructed based on the vehicle's structured diagnostic data, including: Extract entities, entity attributes, and relationships between entities from structured diagnostic data. Entities must include at least one of the following: fault type, component, or electronic control unit.
[0052] By using entities as nodes, entity attributes as node attributes, and relationships between entities as edges, a diagnostic knowledge graph is constructed.
[0053] The structured diagnostic data is semantically segmented to obtain semantic blocks.
[0054] An embedding model is used to perform vector encoding on semantic blocks to obtain semantic vector representations corresponding to structured diagnostic data.
[0055] In this embodiment, by identifying and extracting the core entities, their attributes, and the relationships between entities in the data, these discrete but crucial diagnostic information are transformed into structured knowledge representations, thereby constructing a diagnostic knowledge graph and semantic vector representation. The specific process is as follows: First, entities, entity attributes, and inter-entity relationships are extracted from the structured diagnostic data. Core, meaningful information units and their interrelationships are identified and extracted from the raw, structured diagnostic data. Entities are fundamental concepts in the diagnostic field, such as specific fault phenomena, involved vehicle components, or electronic control units (ECUs). Entity attributes describe the characteristics of these entities, such as the meaning of fault codes, component models, and ECU software versions. Inter-entity relationships reveal the logical connections between different entities, forming the edges in the diagnostic knowledge graph. For example, a certain fault type may be associated with a specific component, or a component may be controlled by a specific ECU.
[0056] This step can utilize Natural Language Processing (NLP) techniques, such as Named Entity Recognition (NER) models, to analyze structured text data, identify predefined entity types, and use relation extraction models to identify semantic relationships between entities. Alternatively, rule matching and pattern recognition methods can be used, with a predefined set of keywords, phrases, and grammatical rules, to match and extract entities, attributes, and relationships that conform to the rules from structured data.
[0057] Then, the identified fault types, components, electronic control units, and other entities are used as nodes in the diagnostic knowledge graph. Their detailed descriptions are used as node attributes, and the logical relationships between them (such as "fault type A affects component B" and "component C is controlled by electronic control unit D") are used as edges connecting the nodes. This process organizes the discrete information extracted in the above steps into a structured, machine-understandable knowledge representation, thus obtaining the diagnostic knowledge graph. The diagnostic knowledge graph visually presents the knowledge system within the diagnostic field in graph form, making complex diagnostic logic and relationships clear and traceable. Nodes can represent core concepts (entities) within the diagnostic field, node attributes are detailed descriptions of these concepts, and edges represent the interactions or connections between concepts.
[0058] In this embodiment, a graph database (such as Neo4j or ArangoDB) can be used to store and manage the knowledge graph. Extracted entities are treated as nodes in the graph, entity attributes as node attributes, and relationships between entities as edges between nodes. Alternatively, a custom data structure, such as an adjacency matrix or adjacency list, can be used to construct the knowledge graph in memory. Each entity is assigned a unique identifier, attributes are stored as key-value pairs, and relationships are represented by pointers or indexes to other entities. It should be understood that this graph-based representation clearly presents the inherent logic and complex relationships of diagnostic knowledge, facilitating efficient machine querying and reasoning.
[0059] Simultaneously, to capture the deep semantic information of diagnostic data, the structured diagnostic data is semantically segmented, dividing continuous structured diagnostic data into smaller units with independent semantic meanings, i.e., semantic blocks. This segmentation process facilitates subsequent vector encoding, ensuring that each encoding unit carries complete and meaningful information, and avoiding the impact of excessive data length or semantic complexity on the accuracy of vector representation. In this embodiment, segmentation can be based on paragraphs, sentences, or specific delimiters of the text. For example, the description of each diagnostic fault code, the explanation of each maintenance step, and the record of each sensor data can be treated as an independent semantic block. Alternatively, a sliding window or topic model-based method can be used for segmentation. A sliding window can extract text segments as semantic blocks at fixed or dynamic lengths, while a topic model can identify potential topics in the text and group text content belonging to the same topic into a semantic block.
[0060] After obtaining the semantic blocks, an embedding model is used to perform vector encoding on each semantic block, converting the discrete semantic blocks into continuous, low-dimensional numerical vectors, thereby obtaining the semantic vector representation corresponding to the structured diagnostic data. This vectorized representation can capture the deep meaning and contextual information of each semantic block, enabling computers to perform efficient similarity calculation, cluster analysis, and pattern recognition, providing a foundation for subsequent diagnostic business judgment and knowledge retrieval. In this embodiment, pre-trained word embedding models (such as Word2Vec, GloVe) or sentence embedding models (such as Sentence-BERT, Universal Sentence Encoder) can be used to encode the semantic blocks. These models can map text into a high-dimensional vector space, making semantically similar texts closer in the vector space. Alternatively, deep learning models based on the Transformer architecture (such as BERT, RoBERTa) can also be used for encoding. These models can better understand the contextual information and long-distance dependencies of the text, generating more expressive semantic vectors.
[0061] It should be understood that, in this way, this embodiment not only constructs a well-structured and logically rigorous diagnostic knowledge graph, but also generates vector representations that reflect the deep semantics of the data. Together, they provide a solid and accurate knowledge foundation for the subsequent determination of communication protocol association constraints and diagnostic business judgment rules. This effectively avoids the problem of insufficient accuracy of the diagnostic procedure caused by incomplete construction of the diagnostic knowledge graph or inaccurate semantic vector representation, and significantly improves the intelligence level and diagnostic efficiency of the vehicle diagnostic procedure.
[0062] In one possible implementation, before constructing the diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data, the method includes: Obtain the vehicle's original diagnostic data.
[0063] By analyzing the original diagnostic data using a multimodal large model, diagnostic knowledge can be obtained from the original diagnostic data.
[0064] The diagnostic knowledge is cleaned and structured to obtain structured diagnostic data.
[0065] In this embodiment, the initial diagnostic information, obtained directly from the vehicle or related systems and unprocessed, is first collected; this is the vehicle's raw diagnostic data. This data may include diagnostic message data transmitted on the vehicle bus (such as CAN, LIN, FlexRay), vehicle maintenance history, fault code logs, sensor data, fault description text reported by users, technical documents from the maintenance manual, etc. Acquiring this raw diagnostic data is the starting point for the entire diagnostic procedure generation process, providing foundational information for subsequent intelligent analysis and structured processing.
[0066] Then, the raw diagnostic data is parsed using a multimodal large model to obtain the diagnostic knowledge contained within it. A multimodal large model can be understood as an artificial intelligence model capable of processing and understanding various types of data (such as text, numerical values, logs, images, etc.). This multimodal large model is trained to identify, extract, and understand the diagnostic knowledge contained in the raw diagnostic data, such as fault phenomena, fault codes, related components, electronic control unit information, repair steps, and diagnostic procedures. The process of parsing the raw diagnostic data using the multimodal large model can include natural language understanding of text data, pattern recognition of message data, and anomaly detection of numerical data, thereby transforming heterogeneous raw data into a unified, semantically meaningful representation of diagnostic knowledge.
[0067] Finally, the diagnostic knowledge undergoes data cleaning and structuring to obtain structured diagnostic data. Data cleaning aims to eliminate noise, redundancy, inconsistencies, or errors in the parsed diagnostic knowledge, such as correcting typos, standardizing terminology, and handling missing values, to improve data quality. Structuring involves organizing and formatting the cleaned diagnostic knowledge according to a predefined schema or ontology, such as converting it into standard structures like tables, JSON objects, or XML documents. This process ensures the standardization, completeness, and machine readability of the diagnostic knowledge, enabling the structured diagnostic data to be efficiently used for subsequent diagnostic knowledge graph construction and semantic vector representation.
[0068] It should be understood that this embodiment establishes an efficient and intelligent data preprocessing link before constructing the diagnostic knowledge graph and semantic vector representation. By introducing a multimodal large model to intelligently parse the raw diagnostic data, it can comprehensively and deeply mine the rich diagnostic information contained in vehicle bus diagnostic message data and vehicle maintenance data, overcoming the limitations of traditional data processing methods when dealing with heterogeneous data. Simultaneously, the parsed diagnostic knowledge undergoes rigorous data cleaning and structuring to ensure the quality, consistency, and usability of the diagnostic data. This ensures the accuracy and completeness of subsequent knowledge graph construction and semantic vector representation based on structured diagnostic data, thus laying a solid data foundation for generating vehicle-adaptive diagnostic programs and greatly improving the generation efficiency and diagnostic accuracy of the diagnostic programs.
[0069] In one possible implementation, diagnostic function code corresponding to multiple diagnostic services is generated based on communication protocol association constraints and diagnostic service judgment rules, including: Based on the communication protocol association constraints and diagnostic service judgment rules, multiple initial diagnostic function codes corresponding to multiple diagnostic services are automatically generated through the protocol reverse engineering agent and the code generation agent; among them, the protocol reverse engineering agent is used to parse the vehicle bus diagnostic message data and reverse extract the communication protocol elements.
[0070] Multiple initial diagnostic function codes are registered into the function scheduling framework and full-link automated testing is performed to obtain multiple diagnostic function codes.
[0071] It should be noted that a protocol reverse engineering agent refers to an intelligent module or system that can automatically analyze and understand vehicle bus diagnostic message data and extract communication protocol elements from it. The role of this protocol reverse engineering agent is to automatically reverse engineer the communication protocol details required for vehicle diagnostics from raw, unstructured vehicle bus diagnostic message data, thereby providing an accurate protocol foundation for subsequent code generation. This protocol reverse engineering agent can be implemented through a rule-based expert system, which pre-sets a series of protocol parsing rules and pattern matching algorithms to analyze and identify the message data layer by layer. Alternatively, it can be implemented through a deep learning model, such as training a sequence-to-sequence model, allowing the protocol reverse engineering agent to learn the inherent structure and semantics of the message data, thereby automatically extracting protocol elements.
[0072] A code generation agent refers to an intelligent module or system that can automatically generate diagnostic function code based on given communication protocol constraints, diagnostic business judgment rules, and protocol elements extracted by a protocol reverse engineering agent. The role of this code generation agent is to transform abstract diagnostic requirements and protocol details into executable, high-quality diagnostic function code, significantly improving code development efficiency and consistency. This code generation agent can be implemented using a template engine and code snippet library, predefining code templates for various diagnostic functions and filling these templates with input parameters and protocol elements to generate specific code. Alternatively, this code generation agent can be implemented using a large language model, taking diagnostic business requirements and protocol information as input and leveraging the agent's programming capabilities to directly generate compliant diagnostic function code.
[0073] A function scheduling framework refers to a software architecture or platform used to manage, organize, and execute various diagnostic function codes, such as the Harness framework. The role of a function scheduling framework is to provide a unified runtime environment and management mechanism for the generated diagnostic function code, facilitating code integration, testing, deployment, and maintenance. This function scheduling framework can be a microservice-based platform, where each diagnostic function code is registered as an independent microservice and invoked and managed through an API gateway. Alternatively, the function scheduling framework can be a plug-in architecture, where diagnostic function codes are loaded as plug-in modules, and the framework provides a unified interface and scheduling mechanism to execute these plug-ins.
[0074] End-to-end automated testing can be understood as the process of automating the entire execution path of diagnostic function code from input to output. The purpose of this automated testing is to discover and fix potential defects and errors before code deployment, ensuring that the generated diagnostic function code can accurately and reliably execute diagnostic tasks, thereby improving code quality and user experience. This automated testing can be conducted through simulators or simulation environments to build a virtual vehicle environment and diagnostic equipment, automatically execute pre-set test cases, and compare expected results with actual results. Alternatively, this automated testing can also be conducted through an integration testing platform, deploying the diagnostic function code to a test server, calling code interfaces through automated test scripts, and verifying the results using log analysis, data comparison, and other methods.
[0075] Diagnostic function codes are the final output of the entire code generation process. Through automated generation and rigorous testing, the resulting diagnostic function codes are ensured to be of high quality and reliability, and can be directly used to generate vehicle diagnostic programs. After end-to-end automated testing, all initial diagnostic function codes that pass the tests and meet the quality standards are marked as final diagnostic function codes and stored in the code repository.
[0076] In this embodiment, during the generation of diagnostic function code corresponding to multiple diagnostic services, firstly, a protocol reverse engineering agent is used to deeply analyze the vehicle bus diagnostic message data, automatically extracting communication protocol elements, thus solving the problem of time-consuming and error-prone protocol parsing in traditional methods. Simultaneously, the code generation agent intelligently generates initial diagnostic function code matching the diagnostic services based on these parsed protocol elements, communication protocol association constraints, and diagnostic service determination rules. It should be understood that this collaborative working method of agents automates the complex protocol understanding and code writing process, greatly improving the efficiency and accuracy of code generation.
[0077] Subsequently, these initial diagnostic function codes are registered in a function scheduling framework, which provides a unified management and runtime environment for the diagnostic function codes. Based on this, full-link automated testing is performed to simulate real-world diagnostic scenarios, comprehensively verifying the functionality, performance, and stability of the code. Issues discovered during testing are promptly reported and optimized until the code meets the expected quality standards, ultimately resulting in high-quality diagnostic function code. It should be understood that the entire process is automated through intelligent agents, effectively avoiding errors and inefficiencies caused by human intervention, ensuring the rapid and accurate generation of diagnostic function code, and providing a solid foundation for the subsequent generation of vehicle diagnostic programs adapted to the vehicle.
[0078] It is understood that this embodiment, through the above technical solution, utilizes protocol reverse engineering agents and code generation agents to achieve automated generation of diagnostic function code, significantly improving code development efficiency and reducing errors that may be introduced by manual code writing. Simultaneously, registering the generated initial diagnostic function code into the function scheduling framework and performing full-link automated testing ensures code quality and reliability, effectively avoiding problems such as inaccurate diagnosis or program crashes caused by code defects. This significantly shortens the development cycle of vehicle diagnostic programs, reduces maintenance costs, and allows for rapid response to new vehicle models and diagnostic needs, providing a high-quality, high-efficiency code foundation for generating vehicle diagnostic programs adapted to specific vehicles.
[0079] In one possible implementation, based on communication protocol association constraints and diagnostic service judgment rules, a protocol reverse engineering agent and a code generation agent automatically generate multiple initial diagnostic function codes corresponding to multiple diagnostic services, including: Select the preset diagnostic function template corresponding to the diagnostic service. The preset diagnostic function template shall include at least one of the following: read fault code template, clear fault code template, action test template, and maintenance reset template.
[0080] The parameters, business workflows, and exception handling logic in the preset diagnostic function templates can be configured using a visual editor to obtain the configured template.
[0081] The protocol reverse engineering agent automatically parses and processes vehicle bus diagnostic message data to generate communication protocol parsing code.
[0082] Based on the configured template and communication protocol, the code is parsed, and the initial diagnostic function code is automatically generated by the code generation agent.
[0083] Pre-defined diagnostic function templates refer to pre-defined code skeletons or configuration frameworks with a general structure and logic for specific diagnostic business types. These templates can include templates for reading fault codes, clearing fault codes, action testing, and maintenance resetting. They encapsulate the general flow and data structure of a particular type of diagnostic operation. For example, a fault code reading template might include general steps such as requesting fault codes, receiving responses, and parsing the fault code list; a fault code clearing template might include sending a clearing command and confirming the clearing result. Providing these pre-defined templates significantly reduces the workload of writing code from scratch and ensures that the generated code conforms to industry standards and best practices. In some implementations, these pre-defined templates can be stored in a template library for users or the system to select when generating diagnostic function code; alternatively, the most suitable pre-defined template can be automatically recommended or matched based on the identified diagnostic business type.
[0084] A visual editor is a graphical user interface tool that allows users to intuitively customize preset diagnostic function templates without writing code directly. Through this visual editor, users can easily configure parameters in the template (e.g., diagnostic session mode, ECU address, data identifier, etc.), define or adjust business workflows (e.g., the order of sending diagnostic commands, conditional branches, loop execution logic, etc.), and set exception handling logic (e.g., timeout retry mechanism, error code parsing and prompts, rollback operations after diagnostic failure, etc.). This configuration method greatly improves the efficiency and flexibility of diagnostic function code generation, enabling non-programming professionals to participate in the customization of diagnostic logic. The visual editor can be implemented using web technologies, providing drag-and-drop components, form filling, and other interactive methods. Alternatively, the visual editor can also be a plugin in an integrated development environment (IDE), providing a graphical configuration interface.
[0085] In this embodiment, an efficient, flexible, and intelligent initial diagnostic function code generation process is constructed by introducing preset diagnostic function templates, a visual editor, and the collaborative work of a protocol reverse engineering agent and a code generation agent. First, a series of preset diagnostic function templates are provided to address different diagnostic business needs. These templates encapsulate a general logical framework for various diagnostic operations. When initial diagnostic function code for a specific diagnostic business needs to be generated, the user or system can select the preset template that best matches that business. Subsequently, through the visual editor, the user can intuitively fine-tune the selected template, including adjusting diagnostic parameters, defining specific business workflows, and setting detailed exception and error handling logic, thereby transforming the general template into a configured template that meets specific requirements.
[0086] After obtaining the configured template, the protocol reverse engineering agent independently and automatically parses the vehicle bus diagnostic message data, extracting the deep structure and semantic information of the communication protocol, and generating communication protocol parsing code for underlying data interaction. Finally, the code generation agent intelligently integrates and assembles the business logic carried in the configured template with the communication details encapsulated in the communication protocol parsing code. The code generation agent understands the template's structure and configuration intent, and utilizes the interfaces and functions provided by the protocol parsing code to automatically fill in the blanks in the template, generating complete and executable initial diagnostic function code. This collaborative mechanism ensures that the generated code not only conforms to specific diagnostic business logic but also accurately interacts with the vehicle's underlying communication protocol, greatly improving the generation efficiency, accuracy, and customizability of diagnostic function code, effectively solving the limitations of traditional manual coding or simple automation tools when facing complex and ever-changing diagnostic scenarios.
[0087] Understandably, through the above technical solutions, this embodiment can significantly improve the efficiency and accuracy of generating initial diagnostic function code. The introduction of preset diagnostic function templates eliminates the need to build diagnostic logic from scratch, greatly reducing development barriers and time costs. The visual editor provides an intuitive configuration method, allowing non-programming professionals to flexibly customize diagnostic business processes and parameters, ensuring that the generated code accurately adapts to various complex diagnostic scenarios, thus improving code customization and applicability. The automatic parsing of vehicle bus diagnostic message data by the protocol reverse engineering agent eliminates the tediousness and error-proneness of manual protocol analysis, ensuring the accuracy of communication protocol parsing code. Furthermore, the intelligent fusion of business logic and underlying communication protocol parsing code by the code generation agent achieves automated, high-quality generation of diagnostic function code, effectively avoiding errors that may be introduced by manual coding and ensuring a high degree of consistency between the code and the vehicle's actual communication protocol.
[0088] Overall, this embodiment solves the problem of quickly and accurately generating initial diagnostic function code in the context of diverse diagnostic services and complex communication protocols through modularization, visualization, and intelligent methods. This lays a solid foundation for subsequent diagnostic program development, thereby accelerating the development cycle of vehicle diagnostic programs and improving their reliability.
[0089] In one possible implementation, a protocol reverse engineering agent automatically parses and processes vehicle bus diagnostic message data to generate communication protocol parsing code, including: Identify the basic protocol characteristics of vehicle bus diagnostic message data.
[0090] By performing cluster analysis on vehicle bus diagnostic message data using a large language model, functional diagnostic commands in the vehicle bus diagnostic message data can be identified.
[0091] The request and response message formats of the functional diagnostic commands are parsed to obtain the header, data field, and checksum of the request and response messages.
[0092] Based on the diagnostic knowledge graph and the protocol information similar to the basic features of the protocol in the semantic vector representation, as well as the preset protocol description data, the instruction meaning and parameter format of each functional diagnostic instruction are obtained.
[0093] Based on the meaning and parameter format of each functional diagnostic command, protocol parsing code is automatically generated.
[0094] In the process of generating communication protocol parsing code, the first step is to identify the basic protocol characteristics of the vehicle bus diagnostic message data. These basic characteristics refer to the general or specific attributes exhibited by the vehicle bus diagnostic message data at the physical and data link layers, such as bus type (e.g., CAN, LIN, FlexRay), baud rate, frame format (e.g., standard frame, extended frame), arbitration ID range, and data length. Identifying these basic protocol characteristics is fundamental to understanding the message structure and subsequent parsing, and helps narrow down the scope of protocol analysis. These characteristics can be inferred by analyzing the physical layer signal characteristics of the message data (e.g., voltage waveforms, timing), or by statistically analyzing the distribution patterns and repetition patterns of fixed fields in the message data. For example, observing the frame start symbol, frame end symbol, and data length indicator. Alternatively, matching can be performed using a pre-defined protocol template library, or machine learning models can be trained on a large amount of message data from known protocols to identify the protocol type and key parameters of unknown message data.
[0095] Then, leveraging the powerful semantic understanding and pattern recognition capabilities of Large Language Models (LLM), cluster analysis is performed on massive amounts of vehicle bus diagnostic message data. Messages with similar structures, functions, or semantics are grouped together, thereby identifying instruction sequences or individual messages representing specific diagnostic functions (such as reading sensor values, performing action tests, clearing fault codes, etc.) within the vehicle bus diagnostic message data—that is, functional diagnostic instructions. Typically, the vehicle bus diagnostic message data can be converted into text sequences or structured feature vectors and input into a pre-trained LLM. The LLM's clustering algorithm or semantic similarity-based grouping capability can then automatically discover and distinguish different functional diagnostic instructions. Alternatively, prompting engineering can guide the LLM to analyze the message data and extract and summarize potential functional diagnostic instructions from the messages based on preset diagnostic business scenarios or keywords.
[0096] After identifying the functional diagnostic command, the request and response message formats are parsed to obtain the headers, data fields, and checksums of the request and response messages. Parsing the request and response message formats is crucial to clarifying the components of each message, including the header identifying the message type and purpose, the data field carrying the actual diagnostic data, and the checksums used for data integrity verification. This is essential for accurately constructing and parsing diagnostic messages subsequently. Typically, heuristic rules and pattern matching algorithms can be used. For example, the header can be determined by analyzing fixed-length fields and specific byte sequences (such as service IDs and sub-function IDs); the data field can be determined by analyzing the length indicators of variable-length fields; and the checksum can be verified by calculating the message's checksum and comparing it with the checksums in the message. Alternatively, the identified basic protocol characteristics can be combined with a pre-defined protocol parser or state machine model to parse the message byte-by-byte or field-by-field, thereby accurately dividing the header, data field, and checksum.
[0097] After determining the message structure, it's necessary to understand the actual meaning of each functional diagnostic instruction and the specific format of the parameters in the data domain of each instruction. This involves combining protocol information similar to the basic characteristics of the protocol in the diagnostic knowledge graph and semantic vector representation, along with pre-defined protocol description data, to assign semantics to the parsed message structure, thereby obtaining the instruction meaning and parameter format of each functional diagnostic instruction. The instruction meaning specifies the specific diagnostic operation performed by the instruction, while the parameter format defines the type, length, unit, and value range of each parameter in the data domain. This can be achieved by performing fuzzy matching or semantic search in the diagnostic intelligent knowledge base (composed of the diagnostic knowledge graph and semantic vector representation) to find known protocol specifications similar to the currently identified basic protocol characteristics and functional diagnostic instruction message structure. Once a match is found, the corresponding instruction meaning and parameter format can be extracted. Alternatively, pre-defined protocol description data (such as ODX, UDS protocol documents, etc.) can be used for keyword extraction and information mapping, associating service IDs, sub-function IDs, etc., in the message with definitions in the document to obtain the detailed semantics and parameter definitions of the instruction.
[0098] Finally, based on the defined meaning and parameter format of each functional diagnostic instruction, program code capable of correctly constructing request messages and parsing response messages—that is, protocol parsing code—is automatically generated. This protocol parsing code encapsulates protocol details, allowing upper-layer applications to perform diagnostic functions directly through function calls without needing to concern themselves with the complexity of the underlying messages. One implementation approach uses a code template engine, pre-defining code templates for different protocol types and instruction patterns. The parsed instruction meanings and parameter formats are then populated into the templates as variables, automatically generating protocol parsing functions or classes in languages such as C / C++ and Python. Alternatively, rule-based code generators or metaprogramming techniques can be used to map instruction meanings and parameter formats to specific code structures and logic based on a predefined set of rules, thereby dynamically generating protocol parsing code.
[0099] It is understandable that, through the above technical solution, this embodiment can significantly improve the efficiency and accuracy of automatically extracting communication protocol parsing code from raw vehicle bus diagnostic message data. Traditionally, protocol reverse engineering often relies on human experience and tedious manual analysis, which is time-consuming and error-prone. This embodiment, by introducing basic protocol feature recognition, large language model clustering analysis, and the assistance of a diagnostic intelligent knowledge base, achieves intelligent and automated parsing of vehicle bus diagnostic message data.
[0100] Specifically, the large language model's ability to identify functional diagnostic commands from massive amounts of message data significantly reduces the workload of manual screening and summarization, improving the accuracy of command recognition. Combined with a diagnostic intelligent knowledge base and pre-defined protocol specification data, the parsed message structure can be quickly assigned the correct semantics, ensuring that the generated protocol parsing code can accurately understand and execute diagnostic commands. This not only accelerates the development cycle of new vehicle models or new diagnostic functions and reduces development costs, but also improves the reliability and compatibility of diagnostic programs, providing solid technical support for the automated generation of vehicle diagnostic programs.
[0101] In one possible implementation, multiple initial diagnostic function codes are registered to a function scheduling framework, and full-link automated testing is performed to obtain multiple diagnostic function codes, including: Register multiple initial diagnostic function codes to the function scheduling framework.
[0102] Configure automated testing agents and code review agents according to the diagnostic business judgment rules.
[0103] Test cases automatically generated by the automated test agent are used to perform full-chain automated testing on multiple initial diagnostic function codes to obtain test results.
[0104] A code review agent performs quality reviews on multiple initial diagnostic function codes and generates a code review report.
[0105] Based on the test results and code review report, the initial diagnostic function code was optimized to obtain multiple diagnostic function codes.
[0106] An automated test agent refers to a software entity or module capable of automatically executing test tasks and verifying code functionality and performance. The role of an automated test agent is to simulate real-world diagnostic scenarios, performing comprehensive and efficient testing on initial diagnostic functional code to uncover potential defects and errors. This automated test agent can be a rule-engine-based testing system that automatically generates and executes test cases based on preset test rules and diagnostic business judgment rules. Alternatively, it can be a machine learning-based test agent that intelligently generates high-coverage test cases by learning from historical test data and code behavior patterns.
[0107] A code review agent is a software entity or module that can automatically analyze code quality, identify potential defects, and detect non-compliance with coding standards. The role of a code review agent is to evaluate initial diagnostic code from multiple dimensions, including code quality, security, and maintainability, and provide corresponding improvement suggestions. This code review agent can be a static code analysis tool, integrating various code style checkers and vulnerability scanners to automatically identify potential problems in the code. Alternatively, it can be an AI-based code review system that uses natural language processing and code semantic analysis to understand the code's intent and uncover deeper logical errors or design flaws.
[0108] The test results provide data and reports on the correctness, performance, and stability of the initial diagnostic functionality code. These results may include the execution status of test cases (pass / fail), error logs, performance metrics (such as response time and resource consumption), and can be presented in the form of structured data or visual reports. The code review report provides a detailed assessment of the quality, standardization, and potential risks of the initial diagnostic functionality code. This report may include code style issues, potential bugs, security vulnerabilities, complexity analysis, maintainability scores, and can be provided in the form of text reports, interactive dashboards, or integrated development environment (IDE) plugins.
[0109] In this embodiment, firstly, the initial diagnostic function code is registered in the function scheduling framework, providing a unified operating environment for subsequent verification and optimization. Then, based on diagnostic business judgment rules, an automated testing agent and a code review agent are configured, enabling the testing and review processes to be closely integrated with business requirements and code quality standards. The automated testing agent can automatically generate test cases and execute end-to-end automated testing, comprehensively verifying the functional correctness and stability of the initial diagnostic function code and generating test results. Simultaneously, the code review agent performs a quality review of the initial diagnostic function code, generating a code review report and evaluating it from multiple dimensions such as code style, security, and maintainability. Finally, based on the test results and the code review report, the initial diagnostic function code is optimized in a targeted manner, resulting in high-quality, highly reliable diagnostic function code. This systematic verification and optimization process ensures that the initial code generated from the protocol reverse engineering and code generation stages undergoes rigorous quality control, ultimately forming stable and reliable diagnostic function code.
[0110] It is understood that, through the above technical solutions, this embodiment can ensure that the generated diagnostic function code has higher reliability, accuracy, and stability. This significantly reduces the risk of deploying defective diagnostic programs to actual vehicle diagnostic equipment, thereby improving the overall efficiency of vehicle diagnostics and the accuracy of diagnostic results. At the same time, the introduction of automated testing and code review greatly improves the efficiency of code verification, reduces manual intervention, and makes the diagnostic program generation process more intelligent and automated.
[0111] In one possible implementation, after generating a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes and basic program information corresponding to multiple diagnostic services, the method further includes: Obtain diagnostic data for new vehicles.
[0112] Based on the diagnostic data of the new vehicle, the diagnostic intelligent knowledge base is incrementally updated to obtain the updated diagnostic intelligent knowledge base, which is composed of a diagnostic knowledge graph and semantic vector representation.
[0113] Diagnostic data for new vehicles refers to diagnostic-related information collected from newly commissioned vehicles or new data generated during the operation of existing vehicles. This diagnostic data may include, but is not limited to, vehicle bus diagnostic message data, vehicle maintenance records, fault code information, sensor data, and electronic control unit (ECU) logs. This diagnostic data can be acquired in real-time via an on-board diagnostic interface (such as OBD-II) connected to diagnostic equipment, uploaded via a remote vehicle diagnostic system, or imported in batches from the databases of vehicle manufacturers or service stations. This diagnostic data is used to provide the latest and most comprehensive data source for subsequent knowledge base updates, ensuring the timeliness and accuracy of diagnostic knowledge.
[0114] The diagnostic intelligent knowledge base is a comprehensive retrieval and enhancement knowledge base that supports automatic reasoning and matching of diagnostic codes. It consists of two core components: a diagnostic knowledge graph (a graph database storing entity relationships between faults, components, ECUs, and protocols) and semantic vector representations (a collection of multi-dimensional digital vectors embedded in a model encoding various fault and repair texts). The diagnostic knowledge graph and semantic vector representations work together to achieve precise relational queries and semantic fuzzy matching. This diagnostic intelligent knowledge base stores all diagnostic knowledge, providing real-time knowledge support for the intelligent agent.
[0115] Incremental updates to the diagnostic intelligent knowledge base refer to partially or completely reconstructing the content of the diagnostic intelligent knowledge base by utilizing newly acquired vehicle diagnostic data, rather than completely rebuilding it. In this embodiment, incremental updates can employ various strategies. For example, data mining techniques can be used to identify entities, attributes, and relationships in the new data and add these entities, attributes, and relationships to the existing diagnostic knowledge graph; alternatively, machine learning models can be used to perform semantic analysis on the new data, updating or expanding the semantic vector representation. Furthermore, expert systems or manual review mechanisms can be used to verify and correct the updated content. The goal of incremental updates is to efficiently integrate new knowledge while maintaining the overall structure of the knowledge base and the stability of existing knowledge, avoiding redundant calculations and resource waste.
[0116] The updated diagnostic intelligent knowledge base refers to the diagnostic intelligent knowledge base that contains the latest diagnostic information after incremental updates. This updated diagnostic intelligent knowledge base not only includes the original diagnostic knowledge, but also incorporates new entities, new attributes, new relationships, and updated semantic vector representations extracted from new vehicle diagnostic data. This provides a more comprehensive, accurate, and timely diagnostic basis for the generation of subsequent diagnostic procedures or the optimization of existing diagnostic procedures, thereby improving the overall performance and applicability of diagnostic procedures.
[0117] In this embodiment, after generating the diagnostic program adapted to the vehicle, a dynamic update mechanism for the diagnostic intelligent knowledge base is further introduced to address the continuous evolution of vehicle technology and fault modes. Specifically, when a new vehicle is put into use or existing vehicles generate new diagnostic data, the diagnostic data of these new vehicles is actively or passively acquired. This diagnostic data of new vehicles may include new fault phenomena, new component information, new ECU diagnostic commands, or new repair experience, etc.
[0118] Subsequently, these newly acquired data are used to incrementally update the previously constructed diagnostic intelligent knowledge base. This incremental update does not simply replace existing knowledge; instead, through intelligent analysis, it identifies differences and additions between the new data and the existing knowledge base. For example, it identifies new entities, entity attributes, and relationships between entities and integrates them into the diagnostic knowledge graph. Simultaneously, it performs semantic segmentation and vector encoding on the new data to update or expand semantic vector representations. In this way, the diagnostic intelligent knowledge base can continuously absorb the latest diagnostic information, maintaining the advanced nature and completeness of its content.
[0119] Ultimately, an updated diagnostic intelligent knowledge base is obtained, which can provide a more accurate and comprehensive basis for the generation of subsequent diagnostic programs or the iteration of existing diagnostic programs, ensuring that the generated diagnostic programs can adapt to the latest vehicle diagnostic needs.
[0120] It should be understood that in this embodiment, after a diagnostic program adapted to the vehicle has been generated, diagnostic data for new vehicles can be continuously acquired, and the diagnostic intelligent knowledge base can be incrementally updated. This solves the problem that existing diagnostic program generation methods suffer from outdated diagnostic intelligent knowledge bases and insufficient timeliness of diagnostic programs when facing rapid iterations in vehicle technology and the continuous emergence of new fault modes. By dynamically incorporating the latest diagnostic information, the diagnostic intelligent knowledge base can maintain the advancement and integrity of its content, thereby ensuring that subsequently generated diagnostic programs or optimizations of existing programs are always based on the most accurate and comprehensive diagnostic basis. This significantly improves the adaptability, accuracy, and lifecycle value of diagnostic programs, enabling the diagnostic system to continuously and effectively respond to ever-changing vehicle diagnostic needs and reducing diagnostic error rates and maintenance costs caused by knowledge base lag.
[0121] It is understood that the embodiments of this application propose a method for generating vehicle diagnostic programs, which restructures the development process of vehicle diagnostic software and fundamentally solves the technical defects of the traditional development model, and has the following core advantages: (1) Improve development efficiency: By adopting AI protocol reverse engineering and automatic code generation technology, the development cycle of a single model is shortened from 1-3 months to 1-2 days, and the development of software that supports 100 models is shortened from 10-20 person-years to 1-2 person-years.
[0122] (2) Reduced development costs. The manual workload in protocol reverse engineering, code writing, testing and other aspects has been greatly reduced, the reliance on high-end technical talents has been reduced, and the development cost of a single model has been greatly reduced.
[0123] (3) Improve the speed of new model support. After a new model is released, only relevant data needs to be imported and the diagnostic intelligent knowledge base needs to be updated. No code modification is required, and support can be completed in 1-2 days, which completely solves the problem of delayed support for new models.
[0124] (4) Improve code reuse rate. All diagnostic functions are encapsulated into standardized program code modules, which can be used for all models with one code development, completely solving the problem of low code reuse rate and reducing maintenance costs by more than 90%.
[0125] (5) Improve test coverage. By adopting an automated test agent, test cases are automatically generated and full-chain testing is performed, which greatly improves software quality and stability and reduces online vulnerabilities.
[0126] (6) Lowering the technical threshold. Providing a visual development environment and AI-assisted development capabilities, ordinary developers and even non-technical personnel can develop diagnostic software, solving the problem of talent shortage.
[0127] (7) Avoid copyright risks. All knowledge comes from legally authorized official materials and actual test data, avoiding copyright disputes caused by web scraping.
[0128] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0129] Corresponding to the vehicle diagnostic program generation method in the above embodiment, Figure 2 A schematic diagram of a vehicle diagnostic program generation device according to an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0130] Reference Figure 2 The vehicle diagnostic program generation device 3 in this embodiment includes: The knowledge construction module 31 is used to construct a diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data. The structured diagnostic data is obtained by structuring the vehicle's original diagnostic data, which includes vehicle bus diagnostic message data between the vehicle diagnostic equipment and the vehicle, and vehicle maintenance data.
[0131] The rule determination module 32 is used to determine the communication protocol association constraints between the vehicle and the vehicle diagnostic equipment, as well as the diagnostic business judgment rules, based on the diagnostic knowledge graph and semantic vector representation.
[0132] The code generation module 33 is used to generate diagnostic function codes corresponding to multiple diagnostic services based on communication protocol association constraints and diagnostic service judgment rules; wherein, the diagnostic function codes are equipped with retrieval and calling logic for diagnostic knowledge graphs and semantic vector representations.
[0133] The program generation module 34 is used to generate a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes and program basic information corresponding to multiple diagnostic services; wherein, the program basic information is used to characterize the version management, compatible vehicle models and function access permissions of the vehicle diagnostic program.
[0134] Furthermore, the knowledge construction module 31 includes: The extraction submodule is used to extract entities, entity attributes, and relationships between entities from structured diagnostic data. Entities include at least one of the following: fault type, component, or electronic control unit.
[0135] The construction submodule is used to construct a diagnostic knowledge graph by using entities as nodes, entity attributes as node attributes, and relationships between entities as edges.
[0136] The segmentation submodule is used to semantically segment structured diagnostic data to obtain semantic blocks.
[0137] The encoding submodule is used to perform vector encoding on semantic blocks using an embedding model to obtain semantic vector representations corresponding to structured diagnostic data.
[0138] Furthermore, the vehicle diagnostic program generation device 3 includes: The first acquisition module is used to acquire the vehicle's original diagnostic data.
[0139] The first parsing module is used to parse the original diagnostic data through a multimodal large model to obtain the diagnostic knowledge in the original diagnostic data.
[0140] The data processing module is used to clean and structure diagnostic knowledge to obtain structured diagnostic data.
[0141] Furthermore, the code generation module 33 includes: The initial generation submodule is used to automatically generate multiple initial diagnostic function codes corresponding to multiple diagnostic services based on communication protocol association constraints and diagnostic service judgment rules, through a protocol reverse agent and a code generation agent. Among them, the protocol reverse agent is used to parse vehicle bus diagnostic message data and reverse extract communication protocol elements.
[0142] The code testing submodule is used to register multiple initial diagnostic function codes into the function scheduling framework and execute full-link automated testing to obtain multiple diagnostic function codes.
[0143] Furthermore, the initial generation submodule includes: The selection unit is used to select a preset diagnostic function template corresponding to the diagnostic service. The preset diagnostic function template includes at least one of the following: fault code reading template, fault code clearing template, action test template, and maintenance reset template.
[0144] The configuration unit is used to configure the parameters, business workflows, and exception handling logic in the preset diagnostic function template through a visual editor to obtain the configured template.
[0145] The parsing unit is used to automatically parse and process vehicle bus diagnostic message data through a protocol reverse engineering agent, and generate communication protocol parsing code.
[0146] The generation unit is used to parse the code according to the configured template and communication protocol, and automatically generate the initial diagnostic function code through the code generation agent.
[0147] Furthermore, the parsing unit includes: The feature recognition subunit is used to identify the basic protocol features of vehicle bus diagnostic message data.
[0148] The clustering analysis subunit is used to perform clustering analysis on vehicle bus diagnostic message data using a large language model to identify functional diagnostic instructions in the vehicle bus diagnostic message data.
[0149] The format parsing subunit is used to parse the request message format and response message format of the functional diagnostic instruction to obtain the header, data field and check bit of the request message and response message.
[0150] The format generation subunit is used to obtain the instruction meaning and parameter format of each functional diagnostic instruction based on protocol information similar to the basic features of the protocol in the diagnostic knowledge graph and semantic vector representation, as well as preset protocol description data.
[0151] The code parsing subunit is used to automatically generate protocol parsing code based on the meaning of the instructions and the parameter format of each functional diagnostic instruction.
[0152] Furthermore, the code testing submodule includes: The registration unit is used to register multiple initial diagnostic function codes to the function scheduling framework.
[0153] The second configuration unit is used to configure automated testing agents and code review agents according to the diagnostic business judgment rules.
[0154] The code testing unit is used to perform full-link automated testing on multiple initial diagnostic function codes through test cases automatically generated by the automated testing agent, and obtain test results.
[0155] The code review unit is used to conduct quality reviews of multiple initial diagnostic function codes through a code review agent and generate a code review report.
[0156] The code optimization unit is used to optimize the initial diagnostic function code based on test results and code review reports, resulting in multiple diagnostic function codes.
[0157] Furthermore, the vehicle diagnostic program generation device 3 includes: The second acquisition module is used to acquire diagnostic data for the new vehicle.
[0158] The update module is used to incrementally update the diagnostic intelligent knowledge base based on the diagnostic data of new vehicles, resulting in an updated diagnostic intelligent knowledge base, which is composed of a diagnostic knowledge graph and semantic vector representation.
[0159] It should be noted that the information interaction and execution process between the modules in the above-mentioned vehicle diagnostic program generation device 3 are based on the same concept as the method embodiment of this application. For details on their specific functions and technical effects, please refer to the method embodiment section, and they will not be repeated here.
[0160] This application also provides a terminal device, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. (Refer to...) Figure 3 The terminal device 4 in this embodiment includes a memory 41, a processor 42, and a computer program stored in the memory 41 and executable on the processor 42. When the processor 42 executes the computer program, it implements the steps in the vehicle diagnostic program generation method embodiment described above.
[0161] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.
[0162] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the various method embodiments.
[0163] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographic device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0164] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0165] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0166] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0167] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0168] The technical features of the various embodiments described above in this application can be combined arbitrarily without conflict. For the sake of brevity, this specification does not describe all possible combinations, but as long as these combinations do not violate the technical spirit of this application, they should all be considered within the scope of this application. Based on the content disclosed in this application, those skilled in the art can reasonably combine, delete, or replace the technical features of the above embodiments according to actual needs, and such modifications and variations all fall within the protection scope of this application.
[0169] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for generating vehicle diagnostic programs, characterized in that, include: Based on the structured diagnostic data of the vehicle, a diagnostic knowledge graph and semantic vector representation are constructed; wherein, the structured diagnostic data is obtained by structuring the original diagnostic data of the vehicle, and the original diagnostic data includes vehicle bus diagnostic message data between the vehicle diagnostic equipment and the vehicle, and vehicle maintenance data. Based on the diagnostic knowledge graph and the semantic vector representation, the communication protocol association constraints and diagnostic business judgment rules between the vehicle and the vehicle diagnostic equipment are determined. Based on the communication protocol association constraints and the diagnostic service determination rules, diagnostic function codes corresponding to multiple diagnostic services are generated; wherein, the diagnostic function codes are configured with retrieval and invocation logic for the diagnostic knowledge graph and the semantic vector representation; Based on the diagnostic function codes and basic program information corresponding to the multiple diagnostic services, a vehicle diagnostic program adapted to the vehicle is generated; wherein, the basic program information is used to characterize the version management, compatible vehicle models, and function access permissions of the vehicle diagnostic program.
2. The vehicle diagnostic program generation method as described in claim 1, characterized in that, The process of constructing a diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data includes: Extract entities, entity attributes, and relationships between entities from the structured diagnostic data, wherein the entities include at least one of the following: fault type, component, and electronic control unit; The diagnostic knowledge graph is constructed by using the entities as nodes, the entity attributes as node attributes, and the relationships between entities as edges. The structured diagnostic data is semantically segmented to obtain semantic blocks; The semantic block is vector-encoded using an embedding model to obtain the semantic vector representation corresponding to the structured diagnostic data.
3. The vehicle diagnostic program generation method as described in claim 2, characterized in that, Before constructing the diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data, the method includes: Obtain the vehicle's original diagnostic data; The original diagnostic data is analyzed using a multimodal large model to obtain diagnostic knowledge from the original diagnostic data; The diagnostic knowledge is cleaned and structured to obtain the structured diagnostic data.
4. The vehicle diagnostic program generation method as described in claim 1, characterized in that, The step of generating diagnostic function codes corresponding to multiple diagnostic services based on the communication protocol association constraints and the diagnostic service determination rules includes: Based on the communication protocol association constraints and the diagnostic service determination rules, multiple initial diagnostic function codes corresponding to the multiple diagnostic services are automatically generated through the protocol reverse engineering agent and the code generation agent; wherein, the protocol reverse engineering agent is used to parse vehicle bus diagnostic message data and reverse extract communication protocol elements. The multiple initial diagnostic function codes are registered into the function scheduling framework, and full-link automated testing is performed to obtain the multiple diagnostic function codes.
5. The vehicle diagnostic program generation method as described in claim 4, characterized in that, The step involves automatically generating multiple initial diagnostic function codes corresponding to the multiple diagnostic services through a protocol reverse engineering agent and a code generation agent, based on the communication protocol association constraints and the diagnostic service determination rules. This includes: Select a preset diagnostic function template corresponding to the diagnostic service. The preset diagnostic function template includes at least one of the following: fault code reading template, fault code clearing template, action test template, and maintenance reset template. The parameters, business workflow, and exception handling logic in the preset diagnostic function template are configured using a visual editor to obtain the configured template; The protocol reverse engineering agent automatically parses and processes the vehicle bus diagnostic message data to generate communication protocol parsing code. Based on the configured template and the communication protocol parsing code, the initial diagnostic function code is automatically generated by the code generation agent.
6. The vehicle diagnostic program generation method as described in claim 5, characterized in that, The automatic parsing and processing of the vehicle bus diagnostic message data by the protocol reverse engineering agent to generate communication protocol parsing code includes: Identify the basic protocol characteristics of the vehicle bus diagnostic message data; Cluster analysis of the vehicle bus diagnostic message data is performed using a large language model to identify the functional diagnostic instructions in the vehicle bus diagnostic message data. The request message format and response message format of the functional diagnostic instruction are parsed to obtain the header, data field, and checksum of the request message and response message; Based on the diagnostic knowledge graph and the protocol information similar to the basic features of the protocol in the semantic vector representation, as well as the preset protocol description data, the instruction meaning and parameter format of each functional diagnostic instruction are obtained; Based on the meaning and parameter format of each functional diagnostic instruction, protocol parsing code is automatically generated.
7. The vehicle diagnostic program generation method as described in claim 6, characterized in that, The process of registering the multiple initial diagnostic function codes into the function scheduling framework and executing end-to-end automated testing to obtain the multiple diagnostic function codes includes: Register the multiple initial diagnostic function codes to the function scheduling framework; Configure automated testing agents and code review agents according to the diagnostic business judgment rules; The test cases automatically generated by the automated testing agent are used to perform full-link automated testing on the multiple initial diagnostic function codes to obtain test results. The code review agent performs a quality review on the multiple initial diagnostic function codes and generates a code review report. Based on the test results and the code review report, the initial diagnostic function code is optimized to obtain the multiple diagnostic function codes.
8. The vehicle diagnostic program generation method as described in claim 1, characterized in that, After generating a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes and program basic information corresponding to the multiple diagnostic services, the method further includes: Obtain diagnostic data for new vehicles; Based on the diagnostic data of the new vehicle, the diagnostic intelligent knowledge base is incrementally updated to obtain an updated diagnostic intelligent knowledge base, wherein the diagnostic intelligent knowledge base is composed of the diagnostic knowledge graph and the semantic vector representation.
9. A vehicle diagnostic program generation device, characterized in that, include: The knowledge construction module is used to construct a diagnostic knowledge graph and semantic vector representation based on the vehicle's structured diagnostic data; wherein, the structured diagnostic data is obtained by structuring the vehicle's original diagnostic data, which includes vehicle bus diagnostic message data between the vehicle diagnostic equipment and the vehicle, and vehicle maintenance data. The rule determination module is used to determine the communication protocol association constraints and diagnostic business judgment rules between the vehicle and the vehicle diagnostic equipment based on the diagnostic knowledge graph and the semantic vector representation. The code generation module is used to generate diagnostic function codes corresponding to multiple diagnostic services based on the communication protocol association constraints and the diagnostic service judgment rules; wherein, the diagnostic function codes are provided with retrieval and invocation logic for the diagnostic knowledge graph and the semantic vector representation; The program generation module is used to generate a vehicle diagnostic program adapted to the vehicle based on the diagnostic function codes and program basic information corresponding to the multiple diagnostic services; wherein, the program basic information is used to characterize the version management, compatible vehicle models, and function access permissions of the vehicle diagnostic program.
10. A terminal device, characterized in that, The method includes 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 method as claimed in any one of claims 1 to 8.
