Method and system for automatically generating ODX-D file based on Excel diagnosis questionnaire
By automatically generating ODX-D files using an Excel-based automated method, the problems of low efficiency, error-proneness, and high cost in existing ODX file writing technologies are solved, achieving efficient and accurate ODX-D file generation and reducing the technical threshold and tool procurement costs.
Patent Information
- Application Number
- CN202511573184.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-03-17
Smart Images

Figure CN121683707A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of file conversion, in particular to a method and system for automatically generating an ODX-D file based on an Excel diagnostic questionnaire. BACKGROUND
[0002] With the increasing complexity of automotive electronic systems, vehicle manufacturers and component suppliers generally adopt standardized diagnostic specifications (such as the UDS protocol) for electronic control unit (ECU) diagnosis and communication. ODX is an open diagnostic data exchange format based on XML, used to describe ECU diagnostic capabilities, communication parameters, data identifiers (DID), diagnostic trouble codes (DTC), and other information.
[0003] Currently, ODX file writing usually relies on manual editing of XML files or using professional ODX editing tools, which has the following problems: 1. Manual ODX file writing is prone to errors and inefficient; 2. Professional ODX editing tools are costly and have a steep learning curve; 3. Diagnostic questionnaires are usually in Excel format and need to be manually configured into ODX format, which is a cumbersome process and prone to inconsistencies. SUMMARY
[0004] In view of the deficiencies of the prior art, the present application provides a method and system for automatically generating an ODX-D file based on an Excel diagnostic questionnaire, which realizes automatic conversion from Excel to ODX-D file without the need for manual ODX file writing and ODX format configuration.
[0005] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0006] According to a first aspect of the present application, a method for automatically generating an ODX-D file based on an Excel diagnostic questionnaire is provided, comprising: parsing structured data in a plurality of worksheets in an Excel diagnostic questionnaire file; constructing an XML tree according to the ODX-D standard, the XML tree comprising a root structure and a plurality of container nodes under the root structure; mapping structured data to a plurality of container nodes according to a preset rule; outputting the constructed XML tree as an XML file conforming to the ODX-D standard.
[0007] In some embodiments of the present application, based on the foregoing scheme, the plurality of worksheets include a cover sheet, a negative response code table, a diagnostic trouble code table, and a data identifier table. The container nodes include a container node of a diagnostic layer container, the container node of the diagnostic layer container including a container node of a protocol, a container node of a negative response code, a container node of a diagnostic fault code, and a container node of a data identifier; The mapping of the structured data to the container nodes according to the preset rule includes: The information of the container nodes of the diagnostic layer container is extracted from the cover table and the Excel diagnostic questionnaire file, the information of the container node of the protocol is extracted from the ECU Addresses part in the cover table, the information of the container node of the negative response code is extracted from the negative response code table, the information of the container node of the diagnostic fault code is extracted from the diagnostic fault code table, and the information of the container node of the data identifier is extracted from the data identifier table.
[0008] In some embodiments of the present application, based on the foregoing scheme, the mapping of the structured data to the container nodes according to the preset rule further includes: The original data type string in each row of data in the worksheet is obtained, the original data type string is identified by using a data type parser, and the original data type string is converted into a standard string conforming to the ODX-D standard; The enumeration type data in each row of data in the worksheet is obtained, the enumeration type data is processed by using a calculation method generator, a data table string corresponding to the enumeration type data is parsed, and a standard COMPU-METHOD node is generated from the data table string corresponding to the enumeration type data; Each data cell in a single row of data in the worksheet is sequentially created into a parameter sub-node by using a parameter constructor, each data in each row of data in the worksheet is sequentially filled into the corresponding parameter sub-node, the standard string conforming to the ODX-D standard is filled into the corresponding parameter sub-node, and the standard COMPU-METHOD node is inserted into the corresponding parameter sub-node.
[0009] In some embodiments of the present application, based on the foregoing scheme, the identification of the original data type string by using the data type parser and the conversion of the original data type string into the standard string conforming to the ODX-D standard include: If the original data type string is a null value, a default value is returned; If the original data type string is not a null value, the numbers in the original data type string are converted into characters, the converted original data type string is converted into capital letters, and a standard string conforming to the ODX-D standard is obtained; It is detected whether the standard string includes a keyword according to a keyword matching order, if the standard string includes the keyword, the keyword is returned, and if the standard string does not include the keyword, a default value is returned.
[0010] In some embodiments of the present application, based on the foregoing scheme, the enumerated type data is processed by the computing method generator, the data table string corresponding to the enumerated type data is parsed, the data table string corresponding to the enumerated type data is generated into a standard COMPU-METHOD node, and the method further comprises: The data table string is split into a plurality of key-value pair units by identifying the separator; For each key-value pair unit, a COMPU-SCALE node is generated in the root structure of the XML tree, and the COMPU-SCALE node internally includes a LOWER-LIMIT node, an UPPER-LIMIT node, and a COMPU-CONST node; All COMPU-SCALE nodes are assembled into a COMPU-INTERNAL-TO-PHYS node as a standard COMPU-METHOD node.
[0011] In some embodiments of the present application, based on the foregoing scheme, the constructed XML tree is output as an XML file conforming to the ODX-D standard, comprising: An empty ODX-D file is set, and the empty ODX-D file includes a DID-DEF node, a DATA node, and a PHYSICAL-TYPE node; The DID-DEF node is provided with a SHORT-NAME sub-node and an ID sub-node; The DATA node is provided with a STRUCTURE node, the STRUCTURE node is provided with a PARAM node, and the PARAM node is provided with a SHORT-NAME sub-node, a BYTE-POSITION sub-node, a BIT-POSITION sub-node, a BIT-LENGTH sub-node, and a DATA-TYPE sub-node; The PHYSICAL-TYPE node is provided with a FACTOR sub-node, an OFFSET sub-node, and a UNIT sub-node; The constructed XML tree is filled into the empty ODX-D file to obtain an XML file conforming to the ODX-D standard.
[0012] In some embodiments of the present application, based on the foregoing scheme, the constructed XML tree is output as an XML file conforming to the ODX-D standard, comprising: The constructed XML tree is serialized and formatted; The XML tree after the serialization and formatting processing is output as an ODX-D file.
[0013] According to a second aspect of the present application, a system for automatically generating an ODX-D file based on an Excel diagnostic questionnaire is provided, and the system comprises: a parsing module configured to parse structured data in a plurality of worksheets in an Excel diagnostic questionnaire file; a construction module configured to construct an XML tree according to an ODX-D standard, wherein the XML tree comprises a root structure and a plurality of container nodes under the root structure; a data mapping module configured to map the structured data to the plurality of container nodes according to a preset rule; an output module configured to output the constructed XML tree as an XML file conforming to the ODX-D standard.
[0014] According to a third aspect of the present application, a computer readable storage medium having a computer program stored thereon is provided, and the computer program comprises executable instructions, which, when executed by a processor, implement the method described above.
[0015] According to a fourth aspect of the present application, an electronic device is provided, and the electronic device comprises: one or more processors; a memory configured to store executable instructions of the processor, wherein the executable instructions, when executed by the one or more processors, cause the one or more processors to implement the method described above.
[0016] The beneficial effects of the present application are as follows: (1) The embodiment provides a method and system for automatically generating an ODX-D file based on an Excel diagnostic questionnaire, which replaces the tedious and error-prone manual coding process through modular and automated design, ensures the accuracy and efficiency of ODX-D file generation, and significantly reduces the dependence on professional tools and specific skills.
[0017] (2) The embodiment provides a method and system for automatically generating an ODX-D file based on an Excel diagnostic questionnaire, which greatly improves the efficiency and automation level: the embodiment realizes the automatic conversion from an Excel diagnostic questionnaire file to an ODX-D file, completely changes the traditional inefficient mode of relying on manual writing of XML code or operation of complex GUI tools, and only takes a few minutes to process a complex Excel diagnostic questionnaire, which is more than tens of times more efficient than manual operation, greatly shortening the cycle of diagnostic data development.
[0018] (3) The embodiment provides a method and system for automatically generating an ODX-D file based on an Excel diagnosis questionnaire, and significantly improves data accuracy and consistency: the embodiment automatically maps and fills data through programmed rules, avoids input errors, inconsistent formats, missing parameters and other problems that are prone to occur in the manual conversion process. The built-in data type parser, calculation method generator and other components of the system ensure that the generated ODX-D file fully complies with the ASAM ODX standard specification, ensures the consistency of the diagnostic data in different tool chains (such as test systems, flashing tools, diagnostic instruments), and reduces the development and testing rework caused by data errors.
[0019] (4) The embodiment provides a method and system for automatically generating an ODX-D file based on an Excel diagnosis questionnaire, which effectively reduces the technical threshold and cost: the embodiment simplifies the process of generating an ODX file into preparing a standardized Excel questionnaire, users do not need to deeply learn the complex open diagnostic data exchange architecture (ODX Schema) and XML syntax, nor need to purchase expensive professional ODX editing software and related training, which significantly reduces the technical threshold and tool procurement cost of vehicle enterprises and component suppliers in the aspect of diagnostic data management.
[0020] The embodiment has good flexibility and scalability: the system of the embodiment adopts modular design, and the functions of each module (such as analysis, construction, data mapping and output) are clear. When the Excel questionnaire template format is fine-tuned or the ODX standard version is updated, usually only the specific module (such as the parser or the mapping rule) needs to be adjusted, without changing the overall architecture of the system, which is very convenient for maintenance and expansion. This method is also applicable to the input based on CSV and other structured data, and has a wide application range.
[0021] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0022] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a flowchart of a method for automatically generating an ODX-D file based on an Excel diagnosis questionnaire according to the present application; Figure 2 is a schematic diagram of an Excel diagnosis questionnaire file in a specific embodiment of the present application; Figure 3 is a schematic diagram of a device for automatically generating an ODX-D file based on an Excel diagnosis questionnaire according to the present application; Figure 4 This is a schematic diagram of an electronic device according to the present invention. Detailed Implementation
[0023] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0024] It should be understood that the terms "including" and other similar expressions in the specification, claims, and accompanying drawings of this invention are intended to cover non-exclusive inclusion, such as a process, method, system, or apparatus that includes a series of steps or units and is not limited to the listed steps or units. Furthermore, "first" and "second" are used to distinguish different objects and are not intended to describe a specific order.
[0025] Please see Figure 1 This invention illustrates a method for automatically generating ODX-D files based on an Excel diagnostic questionnaire, comprising: Step S1: Parse the structured data in several worksheets of the Excel diagnostic questionnaire file.
[0026] In some implementations of this embodiment, an Excel diagnostic questionnaire file is input. The Excel diagnostic questionnaire file is usually in the form of a worksheet, which includes a cover sheet, a negative response code table, a diagnostic fault code table, and a data identifier table.
[0027] In one specific embodiment, such as Figure 2 As shown, the cover table is called Cover, the negative response code table is called NegativeCode, the diagnostic fault code table includes DTC-List, the data identifier table includes SpecificCauseCode, fault code snapshot (DTC-Snapshot), extended fault code (DTC-Extended), real-time data stream (RealTime), full lifecycle management and transmission of diagnostic data (Logistic), input / output control (IOCtrl), etc.
[0028] In this embodiment, the data in the worksheet includes DID (HEX), Name, Size (Byte), ByteStart, BitStart, BitLength, DataType, Factor, Offset, and Unit. DID (HEX) is the data identifier, used in the Excel diagnostic questionnaire file to uniquely identify a data service or parameter. Name is the name, representing a unique and easily understood name for this data segment. For example, Vehicle Speed or Engine Coolant Temperature. Size (Byte) is the data length, representing the total number of bytes occupied by this data segment in the entire message data field. ByteStart is the starting byte, indicating which byte in the message this data segment begins from. BitStart is the starting bit, indicating which bit in the starting byte of the data segment begins. BitLength is the bit length, representing the total number of bits occupied by the data segment. DataType is the data type, representing the raw format of the data in the message. Factor is the scaling factor, representing the multiplier for converting the raw value to the physical value. Offset is the offset, representing the value added when converting the raw value to the physical value. "Unit" refers to the unit of measurement for physical values.
[0029] In this embodiment, each row of data in the worksheet describes a specific diagnostic parameter.
[0030] In one specific embodiment, structured data from several worksheets in an Excel diagnostic questionnaire file is parsed. A single row of data may contain the following: DID(HEX)=0215, Name=Operatingvoltagevalue, Size(Byte)=1, ByteStart=4, BitStart=0, BitLength=8, DataType=Unsigned, Factor=0.2, Offset=0, Unit=V.
[0031] Step S2: Construct an XML tree according to the ODX-D standard. The XML tree includes a root structure and several container nodes under the root structure.
[0032] In some embodiments of this example, the container nodes under the root structure include container nodes of the diagnostic layer container (DIAG-LAYER-CONTAINER), which include container nodes of the protocol (PROTOCOL), container nodes of negative response codes (NRCs), container nodes of diagnostic fault codes (DTCs), and container nodes of data identifiers (Diagnostic identifier definition DID-DEFS, dynamic data definition DYNAMIC-DEFS, etc.).
[0033] In this embodiment, the container node of the diagnostic layer container is a top-level structure used to hold all diagnostic-related data. Within this container, multiple core sub-elements are contained and managed: The container node of the protocol is used to define the protocol (such as UDS) and its parameters (such as CAN identifiers for requests and responses) used for diagnostic communication.
[0034] Container nodes with negative response codes provide a standardized way to organize error messages.
[0035] The Diagnostic Trouble Code Container Node is a container used to centrally manage all Diagnostic Trouble Code (DTC) information.
[0036] The data identifier container node is also a container used to centrally manage all data identifier (DID) definitions. Each DID definition contains a list of parameters (PARAM) describing its data structure.
[0037] Thus, this embodiment can automatically construct the complete ODX-D diagnostic layer container structure system described above, which includes all necessary elements, ensuring that the generated files fully comply with the open standard.
[0038] In this embodiment, as Figure 2 As shown, the container node information of the diagnostic layer container is extracted from the cover table and the Excel diagnostic questionnaire file; the container node information of the protocol is extracted from the ECU Addresses section of the cover table; the container node information of the negative response code is extracted from the negative response code table; the container node information of the diagnostic fault code is extracted from the diagnostic fault code table; and the container node information of the data identifier is extracted from the data identifier table.
[0039] Thus, by systematically associating and parsing the specific structures of different worksheets in an Excel diagnostic questionnaire (such as CAN ID in the Cover table, response codes in the NegativeCode table, diagnostic fault codes in the DTC-List table, and DID parameters in tables like DTC-Snapshot / RealTime), this method drives and automatically constructs the complete XML tree structure corresponding to ODX-D. This method can intelligently identify the purpose of each worksheet and accurately integrate scattered data into the corresponding container nodes in the ODX standard (such as PROTOCOLS, NRCs, DTCs, DID-DEFS, etc.), achieving automatic mapping from unstructured tables to complex standard XML documents.
[0040] Step S3: Map the structured data to several container nodes according to preset rules.
[0041] In some embodiments of this example, mapping structured data to several container nodes according to preset rules further includes: Retrieve the raw data type string from each row of data in the worksheet, use a data type parser to identify the raw data type string, and convert the raw data type string into a standard string that conforms to the ODX-D standard; Retrieve enumeration type data from each row of data in the worksheet, process the enumeration type data using the calculation method generator, parse out the data table string corresponding to the enumeration type data, and generate a standard COMPU-METHOD (calculation method) node structure from the data table string corresponding to the enumeration type data. The parameter constructor is used to create parameter child nodes for each data cell in a single row of data in the worksheet. Each data cell in each row of data in the worksheet is then filled into the corresponding parameter child node. Standard strings that conform to the ODX-D standard are filled into the corresponding parameter child nodes. Standard COMPU-METHOD nodes are then inserted into the corresponding parameter child nodes.
[0042] In some implementations of this embodiment, the primitive data type string includes unsigned data type, signed data type, American Standard Code for Information Interchange (ASCII), binary code decimal (BCD), enumerated data type (Enum), etc., where Unsigned is the default value.
[0043] In this embodiment, a data type parser is used to identify the original data type string and convert it into a standard string conforming to the ODX-D standard, specifically including: If the original data type string is empty, the default value is returned; If the primitive data type string is not empty, the numbers in the primitive data type string are converted to characters, and the converted primitive data type string is converted to uppercase letters to obtain a standard string that conforms to the ODX-D standard. The system checks whether the standard string contains keywords according to the keyword matching order. If the keywords are included, the keyword is returned; otherwise, the default value is returned.
[0044] In this embodiment, the returned keywords or default values are filled into the corresponding parameter sub-nodes.
[0045] In one specific implementation, if the standard string includes UNSIGNED, return UNSIGNED. Matching examples: Unsigned, UNSIGNEDINT, 8-bit unsigned; Otherwise, if the standard string includes SIGNED, return SIGNED. Matching examples: Signed, SIGNEDINTEGER; Otherwise, if the standard string includes ASCII, return ASCII. Matching examples: ASCII, ASCIISTRING; Otherwise, if the standard string includes BCD, return BCD. Matching examples: BCD, BinaryCodedDecimal; Otherwise, if the standard string includes ENUM, return ENUM. Matching examples: Enum, ENUMERATION, ValueTable; If none of the above conditions are met (i.e., the standard string does not contain any known keywords), the default value UNSIGNED is returned, ensuring that the data type parser can continue to run even if it encounters an unexpected data type (such as a user error UNSIGNED), instead of crashing with an error.
[0046] In some implementations of this embodiment, a computation method generator is used to process enumeration type data, parse out the data table string corresponding to the enumeration type data, and generate a standard COMPU-METHOD node (computation method node structure) from the data table string corresponding to the enumeration type data. The implementation also includes: By identifying delimiters, the data table string is split into several key-value pairs; For each key-value pair unit, a scaling node (COMPU-SCALE) is generated in the root structure of the XML tree. The COMPU-SCALE node includes an upper limit node (LOWER-LIMIT node), a lower limit node (UPPER-LIMIT node), and a constant conversion node (COMPU-CONST node). Assemble all COMPU-SCALE nodes into a transformation rule node (COMPU-INTERNAL-TO-PHYS node), which serves as the standard computation method node (COMPU-METHOD node). Insert the standard COMPU-METHOD node into the corresponding parameter child node.
[0047] Specifically, create a COMPU-SCALES node and add all COMPU-SCALES nodes as child nodes of COMPU-SCALES in sequence.
[0048] Create the COMPU-INTERNAL-TO-PHYS node, and add the COMPU-SCALES node as the only child node of the COMPU-INTERNAL-TO-PHYS node.
[0049] Create a COMPU-METHOD node as the root node, and add the COMPU-INTERNAL-TO-PHYS node as the only child node of the COMPU-METHOD node.
[0050] Add the COMPU-METHOD node as a child node under the corresponding parameter child node.
[0051] In one specific embodiment, the strings in the DataTable fields are typically a series of key-value pairs, such as 00=OFF, 01=ACC, 02=ON, and 03=START. By recognizing delimiters, the long strings are split into independent key-value pair units, thereby forming a structured list of key-value pairs within the system, for example: [("00", "OFF"), ("01", "ACC"), ("02", "ON"), ("03", "START")].
[0052] Subsequently, XML is constructed according to the rule mapping. For each key-value pair in the list, a corresponding COMPU-SCALE node is generated in the XML. This node forms the basis of the COMPU-METHOD node. Each COMPU-SCALE node contains three key child nodes: LOWER-LIMIT and UPPER-LIMIT (whose values are numeric keys in the key-value pair, such as 0 and 1), and COMPU-CONST (whose value is a description of the meaning of the key-value pair, such as "OFF" or "ACC").
[0053] Ultimately, all these COMPU-SCALE nodes are assembled into a complete COMPU-INTERNAL-TO-PHYS node, which serves as the final output of the COMPU-METHOD node.
[0054] Thus, it is demonstrated that this embodiment can intelligently parse non-standard enumeration strings and automatically generate complex COMPU-METHOD nodes that conform to the ODX standard, solving the core problem that is prone to errors when handled manually.
[0055] This embodiment provides an intelligent computation method (COMPU-METHOD) automatic generation mechanism for enumerated data: For complex enumerated types (Enum) in diagnostic parameters, this embodiment designs a core algorithm (i.e., a "computation method generator") capable of automatically parsing a string-formatted "Data Table" and generating standard ODX COMPU-METHOD nodes. This mechanism can handle various delimiters, intelligently identify key-value pairs, and automatically generate a complete computation method structure containing a series of sub-elements such as COMPU-SCALE, LOWER-LIMIT, UPPER-LIMIT, and COMPU-CONST. This solves the core pain point of being prone to errors when manually writing enumerated data, something that existing tools and manual methods cannot efficiently accomplish.
[0056] This embodiment provides a parameterized and rule-driven data mapping engine: This embodiment designs a highly parameterized, rule-driven data mapping module. This module incorporates data type parsing rules, physical unit conversion rules, parameter construction rules, etc., and can automatically, accurately, and completely generate all necessary parameter child nodes (PARAMs) and their attributes (such as bit position (BIT-POSITION), bit length (BIT-LENGTH), physical type (PHYSICAL-TYPE), etc.) defined in the ODX standard based on the original information of each row of parameters in Excel (such as ByteStart, BitStart, DataType, Factor, Offset, etc.). This ensures the standardization and completeness of the generated file and avoids the arbitrariness and uncertainty of manual mapping.
[0057] Step S4: Output the completed XML tree as an XML file conforming to the ODX-D standard.
[0058] In some embodiments of this example, outputting the constructed XML tree as an XML file conforming to the ODX-D standard includes: Set up an empty ODX-D file, which includes a diagnostic identifier definition node (DID-DEF node), a data node (DATA node), and a physical type node (PHYSICAL-TYPE node). The DID-DEF node has a short name sub-node (SHORT-NAME sub-node) and an identifier sub-node (ID sub-node). The DATA node has a STRUCTURE node, the STRUCTURE node has a PARAM node, and the PARAM node has a SHORT-NAME node, a BYTE-POSITION node, a BIT-POSITION node, a BIT-LENGTH node, and a DATA-TYPE node. The PHYSICAL-TYPE node has a factor sub-node (FACTOR sub-node), an offset quantum node (OFFSET sub-node), and a unit sub-node (UNIT sub-node). The completed XML tree is then populated into an empty ODX-D file to obtain an XML file that conforms to the ODX-D standard.
[0059] In some implementations of this embodiment, the constructed XML tree is output as an XML file conforming to the ODX-D standard, including: Serialization and formatting of the constructed XML tree; Populate the data from the serialized and formatted XML tree into an empty ODX-D file.
[0060] In this embodiment, the ODX-D file is a .odx file that conforms to the ODX-D standard and can be used directly.
[0061] In this embodiment, the method for serializing the constructed XML tree is to convert the XML tree object in memory into a byte string or string.
[0062] After automated processing by the method for automatically generating ODX-D files based on an Excel diagnostic questionnaire provided in this embodiment, the above input data is converted into a standard ODX-DXML file fragment for output. This fragment is a structured XML document. Corresponding to a specific embodiment of step S1, the output will generate a DID-DEF node, which contains a SHORT-NAME child node (content is DID_0215) and an ID child node (content is 0215). In the STRUCTURE node under the DATA node, a PARAM node will be generated, which contains a series of child nodes: SHORT-NAME (description parameter name), BYTE-POSITION (content is 4), BIT-POSITION (content is 0), BIT-LENGTH (content is 8), and DATA-TYPE (content is UNSIGNED). In addition, a PHYSICAL-TYPE node will be generated, which contains FACTOR (content is 0.2), OFFSET (content is 0), and UNIT (content is V) child nodes.
[0063] In this way, the structured data in several worksheets of the Excel diagnostic questionnaire file is parsed; this structured data is received by the ODX-D standard XML tree; the data type parser, calculation method generator, and parameter constructor work together to fill the specific values of the structured data into the corresponding positions of several container nodes in the XML tree, forming a complete XML tree; the XML tree is finally formatted and output as an ODX-D file.
[0064] This embodiment, through the modular and automated design described above, replaces the tedious and error-prone manual coding process, ensuring the accuracy and efficiency of ODX-D file generation, and significantly reducing reliance on professional tools and specific skills.
[0065] This embodiment significantly improves efficiency and automation: it automates the conversion from Excel diagnostic questionnaire files to ODX-D files, completely changing the inefficient traditional model that relied on manually writing XML code or operating complex GUI tools. Processing a complex diagnostic questionnaire containing hundreds of DIDs and DTCs can be completed in just a few minutes, improving efficiency by tens of times compared to manual operation and greatly shortening the diagnostic data development cycle.
[0066] This embodiment significantly improves data accuracy and consistency: It automatically maps and populates data using programmed rules, avoiding input errors, inconsistent formats, and missing parameters that are easily encountered during manual conversion. Built-in data type parsers and calculation method generators ensure that the generated ODX-D files fully comply with the ASMODX standard, guaranteeing the consistency of diagnostic data transmission and use across different toolchains (such as testing systems, flashing tools, and diagnostic instruments), and reducing development and testing rework caused by data errors.
[0067] This embodiment effectively reduces technical barriers and costs: This embodiment simplifies the process of generating ODX files to preparing a standardized Excel questionnaire. Users do not need to learn complex ODX Schema and XML syntax, nor do they need to purchase expensive professional ODX editing software (such as CANdelaStudio, ODX Studio, etc.) and related training. This significantly reduces the technical barriers and tool procurement costs for automakers and parts suppliers in diagnostic data management.
[0068] This embodiment offers excellent flexibility and scalability: the system employs a modular design, with clearly defined responsibilities for each functional module (such as parsing, construction, data mapping, and output). When the Excel questionnaire template format is slightly adjusted or the ODX standard version is updated, typically only specific modules (such as the parser or mapping rules) need adaptive adjustments, without altering the overall system architecture, making maintenance and expansion very convenient. This method is also applicable to input based on other structured data such as CSV, making it widely applicable.
[0069] According to the second aspect of this application, such as Figure 3 As shown in this embodiment, a system for automatically generating ODX-D files based on an Excel diagnostic questionnaire is provided. The system includes: The parsing module is used to parse structured data from several worksheets in an Excel diagnostic questionnaire file. A building module is used to build an XML tree according to the ODX-D standard, the XML tree including a root structure and several container nodes under the root structure; The data mapping module is used to map structured data to several container nodes according to preset rules; The output module is used to output the completed XML tree as an XML file conforming to the ODX-D standard.
[0070] Specifically, this embodiment corresponds one-to-one with the above method embodiments. The functions of each module have been described in detail in the corresponding method embodiments, so they will not be repeated here.
[0071] According to a third aspect of this application, this embodiment provides a computer-readable storage medium having a computer program stored thereon, the computer program including executable instructions that, when executed by a processor, implement the method described above.
[0072] The present invention can implement all or part of the processes in the above methods, or it can be accomplished 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: any entity or system capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0073] According to a fourth aspect of this application, an electronic device is provided, such as... Figure 4 As shown, it includes: One or more processors; Memory is used to store executable instructions for the processor, which, when executed by one or more processors, cause one or more processors to implement the methods described above.
[0074] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and a bus connecting different system components (including memory and processor).
[0075] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of a computer system, connecting all parts of the computer system through various interfaces and lines.
[0076] Memory can be used to store computer programs and / or modules. The processor implements various functions of the computer system by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system and at least one application program required for a function (e.g., sound playback, image playback, etc.); the data storage area can store data created based on the use of the mobile phone (e.g., audio data, video data, etc.). Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, SmartMedia Cards (SMC), Secure Digital (SD) cards, Flash Cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0077] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, servers, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and memory) that include computer-usable program code.
[0078] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), servers, and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.
[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0081] 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 the present invention.
[0082] 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.
[0083] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention 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 the present invention.
Claims
1. A method for automatically generating an ODX-D file based on an Excel diagnostic questionnaire, characterized in that, The application relates to a method for constructing an XML file conforming to an ODX-D standard. The method comprises the following steps: analyzing structured data in a plurality of worksheets in an Excel diagnostic questionnaire file; constructing an XML tree according to the ODX-D standard, wherein the XML tree comprises a root structure and a plurality of container nodes under the root structure; mapping the structured data to the plurality of container nodes according to preset rules; and 2. The method of claim 1, wherein, outputting the constructed XML tree as an XML file conforming to the ODX-D standard. The plurality of worksheets comprise a cover table, a negative response code table, a diagnostic fault code table and a data identifier table. The plurality of container nodes comprise a diagnostic layer container node, wherein the diagnostic layer container node comprises a protocol container node, a negative response code container node, a diagnostic fault code container node and a data identifier container node. The step of mapping the structured data to the plurality of container nodes according to preset rules comprises the following steps: extracting information of the diagnostic layer container node from the cover table and the Excel diagnostic questionnaire file, extracting information of the protocol container node from an ECU Addresses part in the cover table, extracting information of the negative response code container node from the negative response code table, extracting information of the diagnostic fault code container node from the diagnostic fault code table, and extracting information of the data identifier container node from the data identifier table.
3. The method of claim 1, wherein, The step of mapping the structured data to the plurality of container nodes according to preset rules further comprises the following steps: obtaining an original data type string in each row of data in a worksheet, identifying the original data type string by using a data type parser, and converting the original data type string into a standard string conforming to the ODX-D standard; obtaining enumeration type data in each row of data in the worksheet, processing the enumeration type data by using a calculation method generator, parsing a data table string corresponding to the enumeration type data, and generating a standard COMPU-METHOD node from the data table string corresponding to the enumeration type data; creating parameter sub-nodes for each data cell in a single row of data in the worksheet by using a parameter constructor, filling each data in each row of data in the worksheet into the corresponding parameter sub-node, filling the standard string conforming to the ODX-D standard into the corresponding parameter sub-node, and inserting the standard COMPU-METHOD node into the corresponding parameter sub-node.
4. The method of claim 1, wherein, The step of identifying the original data type string by using the data type parser and converting the original data type string into the standard string conforming to the ODX-D standard comprises the following steps: if the original data type string is a null value, a default value is returned; if the original data type string is not a null value, a number in the original data type string is converted into a character, the converted original data type string is converted into capital letters, and a standard string conforming to the ODX-D standard is obtained; whether a keyword is included in the standard string is detected according to a keyword matching order, if the keyword is included, the keyword is returned, and if the keyword is not included, a default value is returned.
5. The method of claim 1, wherein, The enumerated type data is processed by the computing method generator, a data table string corresponding to the enumerated type data is parsed, the data table string corresponding to the enumerated type data is generated into a standard COMPU-METHOD node, and the method further includes: The data table string is split into a plurality of key-value pair units by identifying the delimiters; For each key-value pair unit, a COMPU-SCALE node is generated in the root structure of the XML tree, and the COMPU-SCALE node internally includes a LOWER-LIMIT node, an UPPER-LIMIT node and a COMPU-CONST node; All COMPU-SCALE nodes are assembled into a COMPU-INTERNAL-TO-PHYS node as a standard COMPU-METHOD node.
6. The method of claim 1, wherein, The constructed XML tree is output as an XML file conforming to the ODX-D standard, including: An empty ODX-D file is set, and the empty ODX-D file includes a DID-DEF node, a DATA node and a PHYSICAL-TYPE node; The DID-DEF node is provided with a SHORT-NAME child node and an ID child node; The DATA node is provided with a STRUCTURE node, the STRUCTURE node is provided with a PARAM node, and the PARAM node is provided with a SHORT-NAME child node, a BYTE-POSITION child node, a BIT-POSITION child node, a BIT-LENGTH child node and a DATA-TYPE child node; The PHYSICAL-TYPE node is provided with a FACTOR child node, an OFFSET child node and a UNIT child node; The constructed XML tree is filled into the empty ODX-D file to obtain an XML file conforming to the ODX-D standard.
7. The method of claim 6, wherein, The constructed XML tree is output as an XML file conforming to the ODX-D standard, including: Serializing and formatting processing is performed on the constructed XML tree; Data in the XML tree after the serializing and formatting processing is filled into the empty ODX-D file.
8. A system for automatically generating an ODX-D file based on an Excel diagnostic questionnaire, characterized by, The system includes: An analysis module configured to analyze structured data in a plurality of worksheets in an Excel diagnostic questionnaire file; A construction module configured to construct an XML tree according to an ODX-D standard, the XML tree including a root structure and a plurality of container nodes under the root structure; A data mapping module configured to map the structured data to the plurality of container nodes according to a preset rule; An output module configured to output the constructed XML tree as an XML file conforming to the ODX-D standard.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program includes executable instructions, when the executable instructions are executed by a processor, the method of any one of claims 1-7 is implemented.
10. An electronic device, comprising: Including: One or more processors; A memory for storing executable instructions of the processor, when the executable instructions are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-7.