A2L file processing method, electronic equipment and storage medium

By extracting and constructing the abstract syntax tree information of the A2L file, the updated A2L file is generated, which solves the problem of low efficiency and accuracy of A2L file processing in the existing technology, and realizes efficient A2L file generation and XCP protocol data operation.

CN118733050APending Publication Date: 2024-10-01NIO TECH ANHUI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410782239.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The existing A2L file processing method has low efficiency and accuracy and relies on the commercial tool ASAP2 Tool-Set for manual operation, making the address extraction process cumbersome and error-prone for function module developers.

Method used

By obtaining multiple A2L files, extract the abstract syntax tree information of each file respectively, build a second A2L file based on the abstract syntax tree information of all files, update the address information of the preset node, and generate the final A2L file through serialization. It solves the problems of cumbersome manual operations and errors.

Benefits of technology

The efficiency and accuracy of A2L file generation are improved, and A2L files that can be used for the XCP protocol are obtained, supporting fast and effective reading and writing operations of calibration data and measurement data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733050A_ABST
    Figure CN118733050A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, particularly provides an A2L file processing method, electronic equipment and a storage medium, and aims at solving the technical problem that an existing A2L file processing method is low in efficiency and accuracy. In order to achieve the purpose, the A2L file processing method comprises the steps of obtaining a plurality of first A2L files; extracting abstract syntax tree information of each first A2L file; and determining a second A2L file based on the abstract syntax tree information of all the first A2L files. Therefore, the generation efficiency and accuracy of the second A2L file are improved, and the A2L file which can be finally used for the XCP protocol is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data processing, and specifically provides an A2L file processing method, an electronic device, and a storage medium. Background Art

[0002] At present, with the rapid development of automotive electronics, there are more and more electronic control units in cars, and each controller works together to control different components. The electronic control unit collects input information, such as the accelerator pedal, brake pedal, cruise, start-stop, etc., and uses a specific algorithm to calculate the output. In order to achieve the ideal control effect, the algorithm contains more calibrable parameters, which are adjusted according to different inputs and working conditions. The XCP protocol is a protocol based on the bus protocol that can quickly and effectively read or write calibrable parameters. The XCP host computer connection requires a file in a standard format to describe the XCP protocol and calibration data information, including device parameter information, interface data information and controller parameter information. This standard format is the A2l format.

[0003] At present, the generation of A2l files depends on the application function developers generating A2l with missing calibration parameter addresses in the Simulink code generation stage. After generating elf / map files carrying address information in the compilation stage, the addresses are extracted from the elf / map files and filled into the A2l with missing addresses generated by Simulink to obtain A2l that can be used for the XCP protocol.

[0004] However, the above process relies on manual operation of the commercial tool ASAP2 Tool-Set. Functional module developers divide the address extraction process into many modules based on modular development ideas. Manual operation is cumbersome and error-prone, resulting in low efficiency and accuracy.

[0005] Accordingly, the art needs a new A2L file processing solution to solve the above problems.

[0006] Application Contents

[0007] In order to overcome the above defects, the present application is proposed to provide a solution or at least partially solve the technical problem of low efficiency and accuracy of the existing A2L file processing method. The present application provides an A2L file processing method, an electronic device and a storage medium.

[0008] In a first aspect, the present application provides an A2L file processing method, the method comprising:

[0009] Obtain multiple first A2L files;

[0010] Extracting abstract syntax tree information of each of the first A2L files respectively;

[0011] The second A2L file is determined based on the abstract syntax tree information of all the first A2L files.

[0012] In one embodiment of the present application, the abstract syntax tree information of each of the first A2L files is extracted respectively, including:

[0013] Parsing each of the first A2L files to obtain a tag sequence;

[0014] Constructing a first abstract syntax tree based on the tag sequence;

[0015] The first abstract syntax tree is traversed to extract abstract syntax tree information of the first A2L file.

[0016] In one embodiment of the present application, determining the second A2L file based on the abstract syntax tree information of all first A2L files includes:

[0017] Constructing a second abstract syntax tree based on the abstract syntax tree information of all first A2L files;

[0018] The second A2L file is determined based on the second abstract syntax tree.

[0019] In one implementation of the present application, determining the second A2L file based on the second abstract syntax tree includes:

[0020] Updating address information of a preset node in the second abstract syntax tree;

[0021] The second A2L file is generated based on the second abstract syntax tree in which the preset node address information has been updated.

[0022] In one embodiment of the present application, the preset nodes include calibration object nodes and measurement object nodes;

[0023] The updating of the address information of the preset node in the second abstract syntax tree includes:

[0024] Get the predefined address information table;

[0025] Acquire the address information of the calibration object node and the measurement object node respectively from the predefined address information table;

[0026] The calibration object node and the measurement object node are updated to corresponding node positions of the second abstract syntax tree.

[0027] In one embodiment of the present application, generating the second A2L file based on the second abstract syntax tree with updated preset node address information includes: serializing the second abstract syntax tree with updated preset node address information to generate the second A2L file.

[0028] In one embodiment of the present application, before updating the address information of the preset nodes in the second abstract syntax tree, the method further includes: performing conflict processing on the preset nodes in the second abstract syntax tree based on the identifier of the preset nodes and at least one item of node information in the keyword to delete the same nodes.

[0029] In one implementation of the present application, the predefined address information table is generated by the following steps:

[0030] Extract the identifier and address information corresponding to the A2L object in the address information file;

[0031] The predefined address information table is generated based on the identifier and the address information.

[0032] In a second aspect, an electronic device is provided, comprising at least one processor and at least one memory, wherein the memory is suitable for storing a plurality of program codes, and the program codes are suitable for being loaded and run by the processor to execute any of the aforementioned A2L file processing methods.

[0033] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored in the computer-readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute any of the aforementioned A2L file processing methods.

[0034] The above one or more technical solutions of the present application have at least one or more of the following beneficial effects:

[0035] The A2L file processing method in the present application includes: obtaining multiple first A2L files; extracting the abstract syntax tree information of each first A2L file respectively; and determining the second A2L file based on the abstract syntax tree information of all the first A2L files. In this way, the generation efficiency and accuracy of the second A2L file are improved, and the A2L file that can be finally used for the XCP protocol is obtained, which is conducive to the XCP protocol to quickly and effectively read and write the calibration data and measurement data in the A2L file. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The disclosure of the present application will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. In addition, similar numbers in the drawings are used to represent similar components, among which:

[0037] Figure 1 is a flowchart of the main steps of an A2L file processing method according to an embodiment of the present application;

[0038] Figure 2This is a complete flowchart of an A2L file processing method in one embodiment of the present application;

[0039] Figure 3 is a schematic diagram of the main structure block diagram of an A2L file processing device according to an embodiment of the present application;

[0040] Figure 4 It is a schematic diagram of the structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION

[0041] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.

[0042] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.

[0043] Currently, traditional A2L file processing relies on manual operation using the commercial tool ASAP2 Tool-Set. Functional module developers divide the files into many modules based on modular development ideas. Manual operations in the address extraction process are cumbersome and prone to errors, resulting in low efficiency and accuracy.

[0044] To this end, the present application proposes an A2L file processing method, an electronic device and a storage medium.

[0045] See attached Figure 1 , Figure 1 It is a flowchart of the main steps of the A2L file processing method according to an embodiment of the present application.

[0046] like Figure 1As shown, the A2L file processing method in the embodiment of the present application mainly includes the following steps S101 to S103.

[0047] Step S101: Acquire a plurality of first A2L files.

[0048] A2L file (Automotive Measurement and Calibration List) is a data exchange format file widely used in the automotive industry, mainly used to store ECU (Electronic Control Unit) calibration and measurement data. These data include but are not limited to: ECU internal parameter definition and description, measurement channel definition, calibration procedure information, etc. The definition and description of ECU internal parameters include calibration quantity, characteristic curve, map, etc. The measurement channel definition includes which signals are collected, what is the sampling rate, etc. The calibration procedure information includes how to calibrate the ECU online or offline.

[0049] During the development phase, engineers use A2L file configuration and calibration tools to debug and optimize ECU software; during the production phase, A2L files can be used for maintenance and fault diagnosis after the vehicle leaves the factory.

[0050] Specifically, the first A2L file is an original A2L file, that is, a file storing calibration and measurement data of the electronic control unit, and there may be multiple files.

[0051] Step S102: extracting the abstract syntax tree information of each of the first A2L files respectively.

[0052] The Abstract Syntax Tree (AST) contains the structured information obtained after the source code has been lexically analyzed and parsed. It does not contain blank characters, comments, and non-essential syntax tags (such as semicolons, brackets, etc.) in the source code. The Abstract Syntax Tree AST usually corresponds to multiple nodes, each of which may contain abstract syntax tree information such as node type, node attributes, symbol table information, location information, semantic information, and additional information.

[0053] Each node represents a building block in the source code, such as an expression, declaration, statement, function, class, module, etc.

[0054] The node type reflects the role of the node in the language, such as "function declaration", "variable assignment", "conditional statement", etc.

[0055] Each node in the AST may have zero or more child nodes, which represent parts of a higher-level structure.

[0056] Nodes often have some associated attributes, such as variable names, function parameter lists, operator types, expression value types, etc.

[0057] For some nodes, especially identifiers (such as variable names and function names), the AST will contain relevant information in the symbol table, such as scope, type, binding value, etc.

[0058] Some AST nodes may contain location information in the source code, such as line and column numbers, to facilitate debugging and error reporting.

[0059] In statically typed languages, the type-checked AST may contain type information or other forms of semantic analysis results.

[0060] Node information may also include other information added by the compiler or interpreter during processing, such as the results of constant folding, optimized intermediate representations, etc.

[0061] This step specifically extracts the corresponding abstract syntax tree information from the abstract syntax tree information of each first A2L file.

[0062] Step S103: Determine a second A2L file based on the abstract syntax tree information of all first A2L files.

[0063] The second A2L file is the final A2L file after merging multiple first A2L files. The second A2L file is mainly used to simplify calibration and measurement activities in a multi-ECU (Electronic Control Unit) system or a multi-component system, and to improve data consistency management and interoperability. For example, the application scenarios of the second A2L file can be as follows:

[0064] In a complete vehicle or complex distributed control system, there may be multiple ECUs, each with its own A2L file describing its calibration parameters and measurement points. After merging these files into a target A2L file, the parameters of different ECUs can be centrally managed and calibrated in the same calibration environment without having to load multiple files separately.

[0065] During vehicle testing, especially for Hardware-in-the-Loop (HiL) and Software-in-the-Loop (SiL) testing, a comprehensive A2L file simplifies the test bench setup, allowing the test tool to read all necessary calibration and measurement configurations at once, without having to import and configure them one by one.

[0066] Therefore, the second A2L file is one of the important means to achieve integrated management and control of complex systems, which improves work efficiency and reduces the possibility of errors.

[0067] Based on the above steps S101 to S103, firstly, a plurality of first A2L files are obtained; the abstract syntax tree information of each first A2L file is extracted respectively; and the second A2L file is determined based on the abstract syntax tree information of all the first A2L files. In this way, the generation efficiency and accuracy of the second A2L file are improved, and the A2L file that can be finally used for the XCP protocol is obtained, which is conducive to the XCP protocol to quickly and effectively read and write the calibration data and measurement data in the A2L file.

[0068] The above steps S102 to S103 are further explained below.

[0069] With respect to step S102, A2L files are often used to store measurement and calibration data in automotive software development. To extract AST (abstract syntax tree) information from a single or multiple A2L files, it is necessary to customize the lexical analyzer and parser according to the grammatical rules of the A2L files so as to parse and process the contents of the files in a structured manner.

[0070] For example, Lexer can be used as an example of a lexical analyzer; Parser can be used as an example of a parser.

[0071] BNF is a formal grammar rule description method used to define the structure of programming languages, file formats, etc. For A2L files, if you want to write a parser to process A2L files, you first need to determine its BNF grammar rules in order to clarify how to convert the content of the A2L file into an abstract syntax tree (AST).

[0072] Specifically, the Python ply library is a toolkit for compiler construction, which provides generators for lexical analyzers (Lexer) and parsers (Parser). The Python ply library can be used to create a custom Lexer and Parser according to the BNF grammar rules of the A2L file, thereby effectively parsing the content of the A2L file and converting it into an operable data structure (such as AST).

[0073] Specifically, the above step S102 can be implemented through the following steps S1021 to S1023.

[0074] Step S1021: Parse each of the first A2L files to obtain a tag sequence.

[0075] Specifically, the lexical analyzer decomposes the text content of the first A2L file to obtain a series of tokens, that is, a token sequence, such as keywords, identifiers, character strings, and numbers.

[0076] Step S1022: construct a first abstract syntax tree based on the tag sequence.

[0077] Specifically, the lexical analyzer passes the token sequence obtained by decomposition to the parser, and the parser constructs the first abstract syntax tree according to the grammatical rules of the A2L file.

[0078] The first abstract syntax tree is a first abstract syntax tree constructed for each first A2L file. Therefore, each first abstract syntax tree only contains relevant information corresponding to the first A2L file.

[0079] It is understandable that constructing an abstract syntax tree according to a tag sequence is a routine operation for those skilled in the art and will not be described in detail here.

[0080] Step S1023: traverse the first abstract syntax tree to extract abstract syntax tree information of the first A2L file.

[0081] Specifically, the entire first abstract syntax tree is traversed to extract all required first abstract syntax tree information, such as module definition, parameter description, and measurement points.

[0082] The above is a further description of step S102 , and the following is a further description of step S103 .

[0083] Specifically, the above step S103 can be implemented through the following steps S1031 to S1032.

[0084] Step S1031: construct a second abstract syntax tree based on the abstract syntax tree information of all first A2L files.

[0085] The second abstract syntax tree is a whole abstract syntax tree constructed according to the abstract syntax tree information of all the first A2L files, and includes relevant information of all the first A2L files.

[0086] It is understandable that constructing an abstract syntax tree according to the abstract syntax tree information is a routine operation for those skilled in the art and will not be described in detail here.

[0087] In a specific implementation of the present application, the method further includes: performing conflict processing on the preset nodes in the second abstract syntax tree based on the identifier of the preset node and at least one node information in the keyword to delete the same node.

[0088] Specifically, node information, such as at least one of the identifier and the keyword, can be used to determine whether there are nodes with the same identifier or keyword in the second abstract syntax tree. Such nodes are identical nodes and duplicate nodes should be deleted, thereby ensuring the correct construction of the abstract syntax tree, which is beneficial to improving the accuracy of the target A2L file.

[0089] Step S1032: Determine the second A2L file based on the second abstract syntax tree.

[0090] Specifically, step S1032 can be implemented through the following steps S10321 to S10322.

[0091] Step S10321: Update address information of preset nodes in the second abstract syntax tree.

[0092] In a specific embodiment of the present application, the preset nodes include a calibration object node and a measurement object node; the updating of the address information of the preset nodes in the second abstract syntax tree includes: obtaining a predefined address information table; obtaining the address information of the calibration object node and the measurement object node respectively from the predefined address information table; and updating the calibration object node and the measurement object node to the corresponding node positions of the second abstract syntax tree.

[0093] The predefined address information table is a mapping relationship between an identifier and address information obtained from an address information file (Map file).

[0094] In addition to the calibration object node and the measurement object node, the second abstract syntax tree may also include a project definition node, a physical signal node, a characteristic curve node, a memory area node, and the like.

[0095] Exemplarily, since the final target A2L file is used for the XCP protocol to enable reading and writing of calibration object and measurement object related information, the preset nodes at this time may only focus on calibration object nodes and measurement object nodes.

[0096] In a specific implementation of the present application, the predefined address information table is generated by the following steps: extracting the identifier and address information corresponding to the A2L object in the address information file; and generating the predefined address information table based on the identifier and address information.

[0097] The address information file (Map file) is a file in memory that stores the address information of A2L objects and measures the address information of A2L objects. The Map file may also contain multiple types of address information.

[0098] Specifically, first, extract the identifier and address information corresponding to the A2L object from the Map file. When extracting the address information in the map file, it can be implemented by reading and judging line by line. Specifically, the address information in the A2L file generally starts with ".rodata", ".bss", ".vletext", ".data", ".calib", ".app_const", ".app_data", and there are only 3 data segments (consisting of continuous characters) in each line. Based on this, the data in the map file can be read line by line. If any line of data starts with ".rodata", ".bss", ".vletext", ".data", ".calib", ".app_const", ".app_data", and there are only 3 data segments (consisting of continuous characters) in this line, the address information of the A2L object contained in this line of data can be extracted. Then, the identifier and address information corresponding to the extracted A2L object are stored in the form of key-value, and the predefined address information table can be obtained, which is conducive to improving the efficiency of obtaining the address information of the preset node in the later stage.

[0099] Specifically, in this embodiment, a predefined address information table is first obtained, and for each calibration object node and measurement object node with an address to be filled in, the address information of the calibration object node and the measurement object node is respectively obtained from the predefined address information table according to the identifiers of the calibration object node and the measurement object node, and the address information of the calibration object node and the measurement object node is filled in or updated to the corresponding node position in the second abstract syntax tree.

[0100] Step S10322: Generate the second A2L file based on the second abstract syntax tree in which the preset node address information has been updated.

[0101] Specifically, the entire second abstract syntax tree with updated preset node address information is traversed and serialized to regenerate text content according to the standard format of the A2L file and save it as a second A2L file.

[0102] In this way, a target A2L file with higher accuracy is obtained, avoiding the technical problems of low efficiency and easy errors caused by frequent manual operations in the existing method, and improving the generation efficiency and accuracy of the target A2L file.

[0103] Figure 2 It is a complete flowchart of the A2L file processing method in one implementation of the present application.

[0104] Specific as Figure 2As shown, firstly, a pre-defined lexical analyzer Lexer and a parser Parser are used to parse each first A2L file to obtain multiple first abstract syntax trees, and then a second abstract syntax tree is constructed based on the abstract syntax tree information extracted from all the first abstract syntax trees. Secondly, address information matching the corresponding node in the second abstract syntax tree is obtained from the Map file, and the address information is added to the corresponding node of the second abstract syntax tree. Finally, the second abstract syntax tree is serialized to generate a second A2L file.

[0105] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.

[0106] Furthermore, the present application also provides an A2L file processing device.

[0107] See attached Figure 3 , Figure 3 It is a main structural block diagram of an A2L file processing device according to an embodiment of the present application.

[0108] like Figure 3 As shown, the A2L file processing device in the embodiment of the present application mainly includes an acquisition module 11, an extraction module 12 and a determination module 13. In some embodiments, one or more of the acquisition module 11, the extraction module 12 and the determination module 13 can be combined into one module.

[0109] In some embodiments, the acquisition module 11 may be configured to acquire a plurality of first A2L files.

[0110] The extraction module 12 may be configured to extract the abstract syntax tree information of each of the first A2L files respectively.

[0111] The determination module 13 is configured to determine the second A2L file based on the abstract syntax tree information of all the first A2L files.

[0112] In one implementation, the description of the specific implementation functions may refer to steps S101 to S103.

[0113] The A2L file processing device is used to execute Figure 1The A2L file processing method embodiment shown in the figure has similar technical principles, technical problems solved and technical effects produced. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process and related instructions of the A2L file processing device can refer to the contents described in the embodiment of the A2L file processing method, which will not be repeated here.

[0114] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above-mentioned embodiment of the present application can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.

[0115] Furthermore, the present application also provides an electronic device. In an electronic device embodiment according to the present application, Figure 4 As shown, the electronic device includes at least one processor 41 and at least one memory 42, the memory 42 can be configured to store a program for executing the A2L file processing method of the above method embodiment, and the processor 41 can be configured to execute the program in the memory, which includes but is not limited to the program for executing the A2L file processing method of the above method embodiment. For ease of explanation, only the part related to the embodiment of the present application is shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application.

[0116] In the embodiment of the present application, the electronic device may be a control device device including various devices. In some possible implementations, the electronic device may include multiple memories and multiple processors. The program for executing the A2L file processing method of the above method embodiment can be divided into multiple subprograms, each of which can be loaded and run by a processor to execute different steps of the A2L file processing method of the above method embodiment. Specifically, each subprogram can be stored in different memories, and each processor can be configured to execute programs in one or more memories to jointly implement the A2L file processing method of the above method embodiment, that is, each processor executes different steps of the A2L file processing method of the above method embodiment, to jointly implement the A2L file processing method of the above method embodiment.

[0117] The above-mentioned multiple processors may be processors deployed on the same device. For example, the above-mentioned electronic device may be a high-performance device composed of multiple processors, and the above-mentioned multiple processors may be processors configured on the high-performance device. In addition, the above-mentioned multiple processors may also be processors deployed on different devices. For example, the above-mentioned electronic device may be a server cluster, and the above-mentioned multiple processors may be processors on different servers in the server cluster.

[0118] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the A2L file processing method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned A2L file processing method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a memory device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.

[0119] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present application, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.

[0120] It is understood by those skilled in the art that each module in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present application, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present application.

[0121] So far, the technical solutions of the present application have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.

Claims

1. An A2L file processing method, characterized in that: The method comprises: Obtain multiple first A2L files; Extracting abstract syntax tree information of each of the first A2L files respectively; The second A2L file is determined based on the abstract syntax tree information of all the first A2L files.

2. The A2L file processing method according to claim 1, characterized in that: The abstract syntax tree information of each of the first A2L files is extracted respectively, including: Parsing each of the first A2L files to obtain a tag sequence; Constructing a first abstract syntax tree based on the tag sequence; The first abstract syntax tree is traversed to extract abstract syntax tree information of the first A2L file.

3. The A2L file processing method according to claim 1, characterized in that: The determining the second A2L file based on the abstract syntax tree information of all the first A2L files includes: Constructing a second abstract syntax tree based on the abstract syntax tree information of all first A2L files; The second A2L file is determined based on the second abstract syntax tree.

4. The A2L file processing method according to claim 3, characterized in that: The determining the second A2L file based on the second abstract syntax tree includes: Updating address information of a preset node in the second abstract syntax tree; The second A2L file is generated based on the second abstract syntax tree in which the preset node address information has been updated.

5. The A2L file processing method according to claim 4, characterized in that: The preset nodes include calibration object nodes and measurement object nodes; The updating of the address information of the preset node in the second abstract syntax tree includes: Get the predefined address information table; Acquire the address information of the calibration object node and the measurement object node respectively from the predefined address information table; The address information of the calibration object node and the measurement object node is updated to the corresponding node position of the second abstract syntax tree.

6. The A2L file processing method according to claim 4, characterized in that: The generating the second A2L file based on the second abstract syntax tree in which the preset node address information has been updated includes: serializing the second abstract syntax tree in which the preset node address information has been updated to generate the second A2L file.

7. The A2L file processing method according to claim 4, characterized in that: Before updating the address information of the preset nodes in the second abstract syntax tree, the method further includes: performing conflict processing on the preset nodes in the second abstract syntax tree based on the identifier of the preset nodes and at least one item of node information in the keyword to delete the same node.

8. The A2L file processing method according to claim 5, characterized in that: The predefined address information table is generated by the following steps: Extract the identifier and address information corresponding to the A2L object in the address information file; The predefined address information table is generated based on the identifier and the address information.

9. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores a computer program, and when the computer program is executed by the at least one processor, the A2L file processing method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the A2L file processing method according to any one of claims 1 to 8.