A2l file processing method and device, electronic equipment and storage medium
By creating cell arrays in MATLAB and comparing A2L file variables and their attribute information, comparison results are automatically generated, solving the problems of long time consumption and cumbersome operation in existing A2L file comparison technologies, and achieving efficient and accurate file comparison.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 江苏智驭汽车科技有限公司
- Filing Date
- 2023-12-20
- Publication Date
- 2026-07-03
Smart Images

Figure CN117744624B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of document processing technology, and in particular to an A2L document processing method, apparatus, electronic device and storage medium. Background Technology
[0002] An A2L file is a description file conforming to the ASAP2 (ASAM MCD-2MC) standard, used to store controller observation variables, calibration variables, and axis variable information (measurement and calibration, MC). The A2L file defines the information required for communication between the host computer and the Electronic Control Unit (ECU) during the calibration process. An A2L file may include: device parameter information (describing basic ECU information and some common attributes of ECU data units), interface data information (describing the interface information required for communication between the calibration system and the ECU), and ECU parameter information (describing the detailed contents of the internal data units).
[0003] As the ECU software is continuously updated during development, its corresponding A2L file is also updated, most commonly by adding or deleting variables. To verify the correctness of the A2L file, automotive engineers need to identify the changes, requiring a comparison between the new and old versions. Current comparison methods involve using Vector's ASAP2 Studio Editor to open the old and new A2L files and compare each defined variable and its corresponding attribute individually. This is time-consuming, inefficient, and prone to errors. Alternatively, the tool can be used to export the variables and their corresponding attributes from the A2L file to an Excel spreadsheet for batch comparison using formulas. However, this results in large data volumes, leading to lengthy calculations and cumbersome procedures. Summary of the Invention
[0004] This application provides an A2L file processing method, apparatus, electronic device, and storage medium to at least solve the problems of long processing time and cumbersome operation in the prior art when comparing new and old versions of A2L files.
[0005] In a first aspect, embodiments of this application provide an A2L file processing method, the method comprising:
[0006] Upon receiving an A2L file comparison request, a first cell array and a second cell array are created in MATLAB. The A2L file comparison request carries the first A2L file and the second A2L file to be compared.
[0007] Obtain the N variables included in the first A2L file and the attribute information corresponding to each of the N variables, and store them in the first unit array, where N is an integer greater than or equal to 1;
[0008] Obtain the M variables included in the second A2L file and the attribute information corresponding to each of the M variables, and store them in the second unit array, where M is an integer greater than or equal to 1;
[0009] By comparing the first unit array and the second unit array, an A2L file comparison result is obtained. The A2L file comparison result includes a set of newly added variables, a set of missing variables, and a set of attribute-changed variables. The variables in the set of newly added variables belong to the second unit array but not to the first unit array; the variables in the set of missing variables belong to the first unit array but not to the second unit array; and the attribute information corresponding to the variables in the set of attribute-changed variables in the first unit array is different from the attribute information corresponding to the variables in the second unit array.
[0010] The A2L file comparison results are output according to the preset template.
[0011] Secondly, embodiments of this application also provide an A2L file processing apparatus, the apparatus comprising:
[0012] A module is created to create a first cell array and a second cell array in MATLAB when an A2L file comparison request is received. The A2L file comparison request carries the first A2L file and the second A2L file to be compared.
[0013] The first processing module is used to obtain the N variables included in the first A2L file and the attribute information corresponding to each of the N variables, and store them in the first unit array, where N is an integer greater than or equal to 1;
[0014] The second processing module is used to obtain the M variables included in the second A2L file and the attribute information corresponding to each of the M variables, and store them in the second unit array, where M is an integer greater than or equal to 1;
[0015] The comparison module is used to compare the first unit array and the second unit array to obtain the A2L file comparison result. The A2L file comparison result includes a set of newly added variables, a set of missing variables, and a set of attribute-changed variables. The variables in the set of newly added variables belong to the second unit array but not to the first unit array; the variables in the set of missing variables belong to the first unit array but not to the second unit array; the attribute information corresponding to the variables in the set of attribute-changed variables in the first unit array is different from the attribute information corresponding to the variables in the second unit array.
[0016] The output module is used to output the comparison results of the A2L files according to a preset template.
[0017] Thirdly, embodiments of this application provide an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the A2L file processing method described above.
[0018] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the A2L file processing method described above.
[0019] The embodiments of this application include at least the following technical effects:
[0020] The technical solution of this application embodiment imports the first A2L file and the second A2L file to be compared into a first cell array and a second cell array created in MATLAB, and obtains the A2L file comparison result by comparing the first cell array and the second cell array. This can realize the automatic comparison of A2L files through MATLAB, simplify the operation steps of A2L file comparison, improve the comparison efficiency, and save human resources. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0022] Figure 1 This is one of the flowcharts illustrating the A2L file processing method provided in the embodiments of this application;
[0023] Figure 2 This is a second flowchart illustrating the A2L file processing method provided in the embodiments of this application;
[0024] Figure 3 This is a schematic diagram of the structure of the A2L file processing device provided in the embodiments of this application;
[0025] Figure 4 A block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0028] In the various embodiments of this application, it should be understood that the sequence number of each process described below 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.
[0029] like Figure 1 As shown in the figure, this application provides an A2L file processing method, which includes:
[0030] Step 101: Upon receiving an A2L file comparison request, create a first cell array and a second cell array in MATLAB. The A2L file comparison request carries the first A2L file and the second A2L file to be compared.
[0031] The A2L file processing method provided in this application embodiment is applied to an A2L file processing system. This A2L file processing system can compare A2L files. Users can submit A2L file comparison requests to the A2L file processing system through its A2L file comparison application interface. Specifically, the user selects the A2L file comparison option on the system's interface, enters the A2L file comparison application interface, and uploads a first A2L file and a second A2L file to be compared. The first A2L file is an older version corresponding to a first version number, and the second A2L file is a newer version corresponding to a second version number. After clicking "Confirm," the A2L file processing system receives the A2L file comparison request carrying the first and second A2L files.
[0032] After receiving an A2L file comparison request, the A2L file processing system uses the cell function in MATLAB to create two cell arrays: the first cell array and the second cell array.
[0033] Step 102: Obtain the N variables included in the first A2L file and the attribute information corresponding to each of the N variables, and store them in the first unit array, where N is an integer greater than or equal to 1.
[0034] Step 103: Obtain the M variables included in the second A2L file and the attribute information corresponding to each of the M variables, and store them in the second unit array, where M is an integer greater than or equal to 1.
[0035] After creating the first and second cell arrays, the A2L file processing system uses MATLAB's built-in xcpA2L function to import the N variables from the first A2L file and the attribute information corresponding to each of these N variables into the first cell array, and the M variables from the second A2L file and the attribute information corresponding to each of these M variables into the second cell array. Through steps 102 and 103, the first and second A2L files are converted into MATLAB cell data type files, i.e., cell arrays.
[0036] Step 104: Compare the first unit array and the second unit array to obtain the A2L file comparison result. The A2L file comparison result includes a set of newly added variables, a set of missing variables, and a set of attribute-changed variables. The variables in the set of newly added variables belong to the second unit array but not to the first unit array; the variables in the set of missing variables belong to the first unit array but not to the second unit array; the attribute information of the variables in the set of attribute-changed variables in the first unit array is different from the attribute information in the second unit array.
[0037] After importing the first and second A2L files into the first and second cell arrays in MATLAB, a data comparison method can be written using the M programming language to compare the first and second cell arrays in MATLAB. Variables belonging to the second cell array but not to the first cell array are identified as newly added variables, thus obtaining a set of newly added variables. Variables belonging to the first cell array but not to the second cell array are identified as missing variables, thus obtaining a set of missing variables. Variables whose corresponding attribute information in the first cell array differs from their corresponding attribute information in the second cell array are identified as attribute-changed variables, thus obtaining a set of attribute-changed variables. It should be noted that newly added variables refer to variables added in the second A2L file relative to the first A2L file, missing variables refer to variables missing in the second A2L file relative to the first A2L file, and attribute-changed variables refer to variables that belong to both the first and second A2L files but whose attribute information has changed.
[0038] Step 105: Output the A2L file comparison results according to the preset template.
[0039] After obtaining the A2L file comparison results, the results can be output according to a preset template for users to view. This preset template can be a uniform template pre-set by the A2L file processing system, or a customized template generated based on the comparison requirements selected by the user on the A2L file comparison application interface when submitting the request.
[0040] The above implementation process of this application, by importing the first A2L file and the second A2L file to be compared into a first cell array and a second cell array created in MATLAB, and by comparing the first cell array and the second cell array, obtains the A2L file comparison result, can realize the automatic comparison of A2L files through MATLAB, simplify the operation steps of A2L file comparison, improve the comparison efficiency, and save human resources.
[0041] In an optional embodiment of this application, outputting the A2L file comparison results according to a preset template includes:
[0042] Determine the number of first variables corresponding to the newly added variable set, the number of second variables corresponding to the missing variable set, and the number of third variables corresponding to the attribute change variable set;
[0043] Create a result display table with the first column representing the number of newly added variables, the number of missing variables, and the number of variables with changed attributes. Then, add the number of the first variable, the number of the second variable, and the number of the third variable to the second column of the result display table in sequence.
[0044] Create detailed tables to store the set of newly added variables, the set of missing variables, and the set of attribute change variables, and create jump links corresponding to each detailed table in the result display table.
[0045] When outputting A2L file comparison results according to the preset template, the A2L file comparison results display interface can show the number of new variables, missing variables, and variables with changed attributes in the second A2L file compared to the first A2L file in the form of a table. A jump link is set at each variable number so that users can click the jump link to view the details, that is, the corresponding variable name list.
[0046] Specifically, it is necessary to determine the number of first variables corresponding to the newly added variable set, the number of second variables corresponding to the missing variable set, and the number of third variables corresponding to the attribute-changed variable set. Then, create a results display table and a details table to store the newly added variable set, the missing variable set, and the attribute-changed variable set. The first column of the results display table is the number of newly added variables, the number of missing variables, and the number of attribute-changed variables. The obtained numbers of first variables, second variables, and third variables are added to the second column of the results display table in sequence, and a jump link corresponding to each details table is created in the results display table.
[0047] The above-described implementation scheme of this application, by creating a result display table for storing the number of newly added variables, the number of missing variables, and the number of attribute-changed variables, and a detail table for storing the sets of newly added variables, the sets of missing variables, and the sets of attribute-changed variables, and establishing a jump link between the detail table and the result display table, can clearly show users the number of newly added variables, the number of missing variables, and the number of attribute-changed variables in the second A2L file relative to the first A2L file. This eliminates the need for users to manually process the comparison results of the A2L files, thus improving the user experience.
[0048] In an optional embodiment of this application, outputting the A2L file comparison results according to a preset template includes:
[0049] Create a first table and a second table, and import the variables included in the first cell array and the attribute information corresponding to each variable into the first table, and import the variables included in the second cell array and the attribute information corresponding to each variable into the second table;
[0050] Based on the A2L file comparison results, the positions of the variables in the missing variable set corresponding to the variables in the first table are filled with the first color, the positions of the variables in the new variable set corresponding to the variables in the second table are filled with the second color, and the positions of the variables in the attribute change variable set corresponding to the variables in the first table and the second table are filled with the third color.
[0051] When outputting A2L file comparison results according to the preset template, two tables can be displayed on the A2L file comparison result display interface, namely the first table and the second table. The first table includes all variables of the first A2L file, and the second table includes all variables of the second A2L file. Among them, the missing variables of the second A2L file compared to the first A2L file are filled with the first color in the corresponding position in the first table, the newly added variables of the second A2L file compared to the first A2L file are filled with the second color in the corresponding position in the second table, and the variables of the second A2L file whose attribute information has changed compared to the first A2L file are filled with the third color in the corresponding position in the first table and the corresponding position in the second table.
[0052] Specifically, after creating the first and second tables using MATLAB's ActiveX functionality, the `xlswrite` function can be used to import the variables and their corresponding attributes from the first array into the first table, and the variables and their corresponding attributes from the second array into the second table. Then, based on the comparison results of the obtained A2L files, the positions of variables from the missing variable set in the first table are filled with the first color, the positions of variables from the newly added variable set in the second table are filled with the second color, and the positions of variables from the attribute-changed variable set in the first and second tables are filled with the third color.
[0053] The above-described implementation scheme of this application highlights the differences between the old and new versions of A2L files by color-filling the positions of variables in the newly added variable set in the second table, the positions of variables in the missing variable set in the first table, and the positions of variables in the attribute change variable set in the first and second tables.
[0054] In an optional embodiment of this application, after obtaining the A2L file comparison results, the method further includes:
[0055] Obtain the target alignment information carried in the A2L file alignment request, wherein the target alignment information includes a target alignment variable set and a target attribute set corresponding to each variable in the target alignment variable set;
[0056] From the newly added variable set, the missing variable set, and the attribute change variable set included in the A2L file comparison results, the variables in the target comparison variable set are respectively selected to obtain the target newly added variable set, the target missing variable set, and the target attribute change variable set;
[0057] For each variable in the target attribute change variable set, obtain the first attribute information corresponding to the target attribute set of the variable in the first unit array and the second attribute information corresponding to the second unit array. If the first attribute information and the second attribute information are the same, then remove the variable from the target attribute variable set.
[0058] Based on the target newly added variable set, the target missing variable set, and the target attribute change variable set, determine the target A2L file comparison result corresponding to the target comparison information;
[0059] Output the comparison results of the target A2L file according to the preset version.
[0060] The A2L file processing system can add a comparison range setting option to the A2L file comparison request interface. This allows users to set the comparison range when they only need to compare some variables or only certain attributes of variables. For example, users can upload a list of variables to be compared, as well as the variable attributes to be compared. Variables can include attributes such as name, address, length, calculation formula, precision, maximum and minimum values, etc. Here, only the name and length can be selected as comparison items. This means that if the calculation method of a variable changes in the first and second A2L files, but the name and length remain unchanged, the variable will not be included in the attribute change variable set. In this case, the A2L file comparison request submitted by the user to the A2L file processing system will carry target comparison information. This target comparison information includes the target comparison variable set and the target attribute set corresponding to each variable in the target comparison variable set. If the target attribute set corresponding to each variable in the target comparison variable set is not included, the default is to compare all attributes of the variable.
[0061] Specifically, after obtaining the A2L file comparison results, the A2L file processing system retrieves the target comparison information carried in the A2L file comparison request. If no target comparison information is carried, the A2L file comparison results are directly output using a preset template.
[0062] After obtaining the target comparison information, the variables in the target comparison variable set are selected from the newly added variable set, the missing variable set, and the attribute change variable set included in the A2L file comparison results, respectively, to obtain the target newly added variable set, the target missing variable set, and the target attribute change variable set.
[0063] At this point, if the target comparison information does not include the target attribute set corresponding to each variable in the target comparison variable set, then no further processing of the target attribute change variable set is required. If the target comparison information includes the target attribute set corresponding to each variable in the target comparison variable set, further processing of the target attribute change variable set is required. Specifically, for each variable in the target attribute change variable set, obtain the first attribute information corresponding to the target attribute set in the first unit array and the second attribute information corresponding to the target attribute set in the second unit array. If the first attribute information and the second attribute information are the same, then the variable is removed from the target attribute variable set. In other words, if the user sets a list of attributes to be compared, then it is not necessary to consider whether other attributes outside the attribute list have changed. The first attribute information and the second attribute information only include the attribute values corresponding to the attributes in the target attribute set. If the first attribute information and the second attribute information are the same, it indicates that the attributes included in the target attribute set of the variable are the same in the first A2L file and the second A2L file, and have not changed. At this time, the variable needs to be removed from the target attribute change variable set. After performing the above filtering operation on each variable in the target attribute change variable set, a new target attribute change variable set is obtained.
[0064] Finally, based on the target's newly added variable set, target's missing variable set, and target's attribute change variable set, the target A2L file comparison result corresponding to the target comparison information can be determined, and the target A2L file comparison result can be output according to the preset template.
[0065] The above-described implementation scheme of this application obtains the target comparison information carried in the A2L file comparison request, and processes the A2L file comparison results based on the target comparison information to obtain the target A2L file comparison results. This enables targeted A2L file comparison and can better meet the needs of users.
[0066] In an optional embodiment of this application, the first cell array includes a first sub-cell array, a second sub-cell array, and a third sub-cell array;
[0067] The second cell array includes a fourth sub-cell array, a fifth sub-cell array, and a sixth sub-cell array;
[0068] The first sub-unit array is used to store the measurement variables and their corresponding attribute information in the first A2L file; the second sub-unit array is used to store the calibration variables and their corresponding attribute information in the first A2L file; and the third sub-unit array is used to store the axis variables and their corresponding attribute information in the first A2L file.
[0069] The fourth sub-unit array is used to store the measurement variables and their corresponding attribute information in the second A2L file; the fifth sub-unit array is used to store the calibration variables and their corresponding attribute information in the second A2L file; and the sixth sub-unit array is used to store the axis variables and their corresponding attribute information in the second A2L file.
[0070] Variables in an A2L file are divided into three types: measurement variables, calibration variables, and axis variables. Therefore, when creating the first cell array, the A2L file comparison system creates three sub-cell arrays: the first sub-cell array, the second sub-cell array, and the third sub-cell array. These are used to store the measurement variables, calibration variables, and axis variables in the first A2L file, as well as the corresponding attribute information. When creating the second cell array, the A2L file comparison system creates three sub-cell arrays: the fourth sub-cell array, the fifth sub-cell array, and the sixth sub-cell array. These are used to store the measurement variables, calibration variables, and axis variables in the second A2L file, as well as the corresponding attribute information.
[0071] Based on this, the A2L file processing system can add selection options for three variable types to the A2L file comparison application interface. Users can select one, two, or all variable types. The A2L file processing system can also create sub-arrays within the first and second unit arrays based on user settings.
[0072] The above-described implementation scheme of this application, by creating sub-cell arrays corresponding to measurement variables, calibration variables, and axis variables respectively, allows users to selectively compare variables of a certain type, thereby improving user experience and comparison efficiency.
[0073] In an optional embodiment of this application, comparing the first cell array and the second cell array to obtain A2L file comparison results includes:
[0074] By comparing the first sub-unit array and the fourth sub-unit array, the comparison result of the first A2L file corresponding to the measurement variable is obtained;
[0075] By comparing the second sub-unit array and the fifth sub-unit array, the comparison result of the second A2L file corresponding to the calibration variable is obtained;
[0076] By comparing the third sub-unit array and the sixth sub-unit array, the comparison result of the third A2L file corresponding to the axis variable is obtained.
[0077] When comparing the first and second sub-arrays to obtain the A2L file comparison results, the comparisons can be performed separately for the variable types included in the A2L file. By comparing the first and fourth sub-arrays, the first A2L file comparison result corresponding to the measurement variable is obtained. By comparing the second and fifth sub-arrays, the second A2L file comparison result corresponding to the calibration variable is obtained. By comparing the third and sixth sub-arrays, the third A2L file comparison result corresponding to the axis variable is obtained.
[0078] The above-described implementation scheme of this application can obtain the A2L file comparison results corresponding to each type of variable by comparing the sub-cell arrays corresponding to the measurement variable, calibration variable and axis variable respectively. This facilitates the classification and display of the A2L file comparison results when outputting them, eliminating the need for further filtering by the user, improving user experience and comparison efficiency.
[0079] The A2L file processing method provided in this embodiment of the invention is described below through an overall implementation process. (See also...) Figure 2 As shown, it includes:
[0080] Step 201: Import the two A2L files to be compared into MATLAB.
[0081] Step 202: MATLAB returns two A2L objects, A2Lfile-A and A2Lfile-B.
[0082] Step 203: Define three methods corresponding to three variable types, namely a2l_measurement, a2l_characteristic, and a2l_axis.
[0083] Step 204: Define arrays Measurements_Cell_A and Measurements_Cell_B to store variable information of measurement variables in A2Lfile-A and A2Lfile-B; define arrays Characteristic_Cell_A and Characteristic_Cell_B to store variable information of calibration variables in A2Lfile-A and A2Lfile-B; define arrays Axises_Cell_A and Axises_Cell_B to store variable information of axis variables in A2Lfile-A and A2Lfile-B.
[0084] Step 205: Use the xlswrite function to write the contents of Measurements_Cell_A, Measurements_Cell_B, Characteristic_Cell_A, Characteristic_Cell_B, Axises_Cell_A, and Axises_Cell_B into an Excel spreadsheet respectively.
[0085] Step 206: Use the ismember function to compare the variable information in Measurements_Cell_A and Measurements_Cell_B to obtain newly added measurement variables, missing measurement variables, and measurement variables with changed attributes; use the ismember function to compare the variable information in Characteristic_Cell_A and Characteristic_Cell_B to obtain newly added calibration variables, missing calibration variables, and calibration variables with changed attributes; use the ismember function to compare the variable information in Axises_Cell_A and Axises_Cell_B to obtain newly added axis variables, missing axis variables, and axis variables with changed attributes.
[0086] Step 207: For the measurement variable, calibration variable, and axis variable, use ActiveX to create an Excel application object and write the measurement variable information, calibration variable information, and axis variable information into a first Excel table, a second Excel table, and a third Excel table, respectively.
[0087] Step 208: Using MATLAB's built-in combination method, the positions of variable names and attribute values that cannot be matched after comparison are mapped to the cells in the first, second, and third Excel spreadsheets in red.
[0088] Step 209: Write the number of newly added measurement variables, the number of missing measurement variables, the number of attribute-changed measurement variables, the number of newly added calibration variables, the number of missing calibration variables, the number of attribute-changed calibration variables, the number of newly added axis variables, the number of missing axis variables, and the number of attribute-changed axis variables obtained during the comparison process into an Excel table in the comparison report, and output the comparison report.
[0089] The above implementation process enables automatic comparison of A2L files using MATLAB, simplifying the operation steps for comparing A2L files, improving comparison efficiency, and saving human resources.
[0090] The A2L file processing method provided by the embodiments of this application has been described above. The A2L file processing apparatus provided by the embodiments of this application will be described below with reference to the accompanying drawings.
[0091] like Figure 3 As shown, this embodiment of the invention also provides an A2L file processing device, the device comprising:
[0092] A module 301 is created to create a first cell array and a second cell array in MATLAB when an A2L file comparison request is received. The A2L file comparison request carries the first A2L file and the second A2L file to be compared.
[0093] The first processing module 302 is used to obtain the N variables included in the first A2L file and the attribute information corresponding to each of the N variables, and store them in the first unit array, where N is an integer greater than or equal to 1.
[0094] The second processing module 303 is used to obtain the M variables included in the second A2L file and the attribute information corresponding to each of the M variables, and store them in the second unit array, where M is an integer greater than or equal to 1;
[0095] The comparison module 304 is used to compare the first unit array and the second unit array to obtain an A2L file comparison result. The A2L file comparison result includes a set of newly added variables, a set of missing variables, and a set of attribute-changed variables. The variables in the set of newly added variables belong to the second unit array but not to the first unit array; the variables in the set of missing variables belong to the first unit array but not to the second unit array; and the attribute information corresponding to the variables in the set of attribute-changed variables in the first unit array is different from the attribute information corresponding to the variables in the second unit array.
[0096] The output module 305 is used to output the comparison results of the A2L files according to a preset template.
[0097] Optionally, the output module includes:
[0098] The determination submodule is used to determine the number of first variables corresponding to the newly added variable set, the number of second variables corresponding to the missing variable set, and the number of third variables corresponding to the attribute change variable set.
[0099] The first processing submodule is used to create a result display table with the first column representing the number of newly added variables, the number of missing variables, and the number of variable attributes changed, and to add the number of the first variable, the number of the second variable, and the number of the third variable to the second column of the result display table in sequence;
[0100] The second processing submodule is used to create detail tables for storing the set of newly added variables, the set of missing variables, and the set of attribute change variables, and to create jump links corresponding to each detail table in the result display table.
[0101] Optionally, the output module further includes:
[0102] The third processing submodule is used to create a first table and a second table, and to import the variables included in the first cell array and the attribute information corresponding to each variable into the first table, and to import the variables included in the second cell array and the attribute information corresponding to each variable into the second table.
[0103] The fourth processing submodule is used to fill the positions of the variables in the missing variable set in the first table with a first color, fill the positions of the variables in the new variable set in the second table with a second color, and fill the positions of the variables in the attribute change variable set in the first table and the second table with a third color, based on the comparison results of the A2L files.
[0104] Optionally, the device includes:
[0105] The acquisition module is used to acquire the target comparison information carried in the A2L file comparison request after obtaining the A2L file comparison result. The target comparison information includes a target comparison variable set and a target attribute set corresponding to each variable in the target comparison variable set.
[0106] The third processing module is used to filter out the variables in the target comparison variable set from the newly added variable set, the missing variable set, and the attribute change variable set included in the A2L file comparison results, so as to obtain the target newly added variable set, the target missing variable set, and the target attribute change variable set.
[0107] The fourth processing module is used to obtain the first attribute information and the second attribute information corresponding to the target attribute set of each variable in the target attribute change variable set in the first unit array and the second attribute information corresponding to the target attribute set of the variable in the second unit array for each variable in the target attribute change variable set. If the first attribute information and the second attribute information are the same, the variable is removed from the target attribute variable set.
[0108] The determination module is used to determine the target A2L file comparison result corresponding to the target comparison information based on the target newly added variable set, the target missing variable set, and the target attribute change variable set.
[0109] The output module is further used to: output the comparison results of the target A2L file according to the preset version.
[0110] Optionally, the first cell array includes a first sub-cell array, a second sub-cell array, and a third sub-cell array;
[0111] The second cell array includes a fourth sub-cell array, a fifth sub-cell array, and a sixth sub-cell array;
[0112] The first sub-unit array is used to store the measurement variables and their corresponding attribute information in the first A2L file; the second sub-unit array is used to store the calibration variables and their corresponding attribute information in the first A2L file; and the third sub-unit array is used to store the axis variables and their corresponding attribute information in the first A2L file.
[0113] The fourth sub-unit array is used to store the measurement variables and their corresponding attribute information in the second A2L file; the fifth sub-unit array is used to store the calibration variables and their corresponding attribute information in the second A2L file; and the sixth sub-unit array is used to store the axis variables and their corresponding attribute information in the second A2L file.
[0114] Optionally, the comparison module includes:
[0115] The first comparison submodule is used to compare the first sub-unit array and the fourth sub-unit array to obtain the first A2L file comparison result corresponding to the measurement variable;
[0116] The second comparison submodule is used to compare the second sub-unit array and the fifth sub-unit array to obtain the second A2L file comparison result corresponding to the calibration variable;
[0117] The third comparison submodule is used to compare the third sub-unit array and the sixth sub-unit array to obtain the comparison result of the third A2L file corresponding to the axis variable.
[0118] The A2L file processing device provided in this application imports the first and second A2L files to be compared into a first cell array and a second cell array created in MATLAB, and obtains the A2L file comparison result by comparing the first cell array and the second cell array. This enables automatic comparison of A2L files through MATLAB, simplifies the operation steps of A2L file comparison, improves comparison efficiency, and saves human resources.
[0119] This application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described A2L file processing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here.
[0120] For example, Figure 4 A schematic diagram of the physical structure of an electronic device is shown.
[0121] like Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430. The processor 410 is used to perform the following steps: upon receiving an A2L file comparison request, it creates a first cell array and a second cell array in MATLAB. The A2L file comparison request carries the first A2L file and the second A2L file to be compared. It obtains N variables included in the first A2L file and the attribute information corresponding to each of the N variables, and stores them in the first cell array. It obtains M variables included in the second A2L file and the attribute information corresponding to each of the M variables, and stores them in the second cell array. It compares the first cell array and the second cell array to obtain the A2L file comparison result. The A2L file comparison result includes a set of newly added variables, a set of missing variables, and a set of variables with changed attributes. The variables in the set of newly added variables belong to the second cell array but not to the first cell array. The variables in the set of missing variables belong to the first cell array but not to the second cell array. The attribute information corresponding to the variables in the set of variables with changed attributes in the first cell array is different from the attribute information corresponding to the variables in the second cell array. It outputs the A2L file comparison result according to a preset template.
[0122] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0123] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described A2L file processing method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0124] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0126] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
[0127] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention 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 implementations should not be considered beyond the scope of this invention.
[0128] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0129] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of 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.
[0130] 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.
[0131] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0132] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0133] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An A2L file processing method, characterized in that, The method includes: Upon receiving an A2L file comparison request, a first cell array and a second cell array are created in MATLAB. The A2L file comparison request carries the first A2L file and the second A2L file to be compared. Obtain the N variables included in the first A2L file and the attribute information corresponding to each of the N variables, and store them in the first unit array, where N is an integer greater than or equal to 1; Obtain the M variables included in the second A2L file and the attribute information corresponding to each of the M variables, and store them in the second unit array, where M is an integer greater than or equal to 1; By comparing the first unit array and the second unit array, an A2L file comparison result is obtained. The A2L file comparison result includes a set of newly added variables, a set of missing variables, and a set of attribute-changed variables. The variables in the set of newly added variables belong to the second unit array but not to the first unit array; the variables in the set of missing variables belong to the first unit array but not to the second unit array; and the attribute information corresponding to the variables in the set of attribute-changed variables in the first unit array is different from the attribute information corresponding to the variables in the second unit array. Output the A2L file comparison results according to the preset template; After obtaining the A2L file comparison results, the following is also included: Obtain the target alignment information carried in the A2L file comparison request, wherein the target alignment information includes a set of target alignment variables and a set of target attributes corresponding to each variable in the set of target alignment variables; From the newly added variable set, the missing variable set, and the attribute change variable set included in the A2L file comparison results, the variables in the target comparison variable set are respectively selected to obtain the target newly added variable set, the target missing variable set, and the target attribute change variable set; For each variable in the target attribute change variable set, obtain the first attribute information corresponding to the target attribute set of the variable in the first unit array and the second attribute information corresponding to the second unit array. If the first attribute information and the second attribute information are the same, then remove the variable from the target attribute change variable set. Based on the target newly added variable set, the target missing variable set, and the target attribute change variable set, determine the target A2L file comparison result corresponding to the target comparison information; The target A2L file comparison results are output according to the preset template.
2. The A2L file processing method according to claim 1, characterized in that, The A2L file comparison results are output according to the preset template, including: Determine the number of first variables corresponding to the newly added variable set, the number of second variables corresponding to the missing variable set, and the number of third variables corresponding to the attribute change variable set; Create a result display table with the first column representing the number of newly added variables, the number of missing variables, and the number of variables with changed attributes. Then, add the number of the first variable, the number of the second variable, and the number of the third variable to the second column of the result display table in sequence. Create detailed tables to store the set of newly added variables, the set of missing variables, and the set of attribute change variables, and create jump links corresponding to each detailed table in the result display table.
3. The A2L file processing method according to claim 1, characterized in that, The A2L file comparison results are output according to the preset template, including: Create a first table and a second table, and import the variables included in the first cell array and the attribute information corresponding to each variable into the first table, and import the variables included in the second cell array and the attribute information corresponding to each variable into the second table; Based on the A2L file comparison results, the positions of the variables in the missing variable set corresponding to the variables in the first table are filled with the first color, the positions of the variables in the new variable set corresponding to the variables in the second table are filled with the second color, and the positions of the variables in the attribute change variable set corresponding to the variables in the first table and the second table are filled with the third color.
4. The A2L file processing method according to claim 1, characterized in that, The first cell array includes a first sub-cell array, a second sub-cell array, and a third sub-cell array; The second cell array includes a fourth sub-cell array, a fifth sub-cell array, and a sixth sub-cell array; The first sub-unit array is used to store the measurement variables and their corresponding attribute information in the first A2L file; the second sub-unit array is used to store the calibration variables and their corresponding attribute information in the first A2L file; and the third sub-unit array is used to store the axis variables and their corresponding attribute information in the first A2L file. The fourth sub-unit array is used to store the measurement variables and their corresponding attribute information in the second A2L file; the fifth sub-unit array is used to store the calibration variables and their corresponding attribute information in the second A2L file; and the sixth sub-unit array is used to store the axis variables and their corresponding attribute information in the second A2L file.
5. The A2L file processing method according to claim 4, characterized in that, By comparing the first cell array and the second cell array, the A2L file comparison results are obtained, including: By comparing the first sub-unit array and the fourth sub-unit array, the comparison result of the first A2L file corresponding to the measurement variable is obtained; By comparing the second sub-unit array and the fifth sub-unit array, the comparison result of the second A2L file corresponding to the calibration variable is obtained; By comparing the third sub-unit array and the sixth sub-unit array, the comparison result of the third A2L file corresponding to the axis variable is obtained.
6. An A2L document processing device, characterized in that, include: A module is created to create a first cell array and a second cell array in MATLAB when an A2L file comparison request is received, wherein the A2L file comparison request carries the first A2L file and the second A2L file to be compared. The first processing module is used to obtain the N variables included in the first A2L file and the attribute information corresponding to each of the N variables, and store them in the first unit array, where N is an integer greater than or equal to 1; The second processing module is used to obtain the M variables included in the second A2L file and the attribute information corresponding to each of the M variables, and store them in the second unit array, where M is an integer greater than or equal to 1; The comparison module is used to compare the first unit array and the second unit array to obtain the A2L file comparison result. The A2L file comparison result includes a set of newly added variables, a set of missing variables, and a set of attribute-changed variables. The variables in the set of newly added variables belong to the second unit array but not to the first unit array; the variables in the set of missing variables belong to the first unit array but not to the second unit array; the attribute information corresponding to the variables in the set of attribute-changed variables in the first unit array is different from the attribute information corresponding to the variables in the second unit array. The output module is used to output the comparison results of the A2L files according to a preset template; The acquisition module is used to acquire the target alignment information carried in the A2L file comparison request after obtaining the A2L file comparison result. The target alignment information includes a target alignment variable set and a target attribute set corresponding to each variable in the target alignment variable set. The third processing module is used to filter out the variables in the target comparison variable set from the newly added variable set, the missing variable set, and the attribute change variable set included in the A2L file comparison results, so as to obtain the target newly added variable set, the target missing variable set, and the target attribute change variable set. The fourth processing module is used to obtain, for each variable in the target attribute change variable set, the first attribute information corresponding to the target attribute set of the variable in the first unit array and the second attribute information corresponding to the target attribute set in the second unit array. If the first attribute information and the second attribute information are the same, the variable is removed from the target attribute change variable set. The determination module is used to determine the target A2L file comparison result corresponding to the target comparison information based on the target newly added variable set, the target missing variable set, and the target attribute change variable set. The output module is further used to: output the comparison results of the target A2L file according to the preset template.
7. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the A2L file processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the A2L file processing method as described in any one of claims 1 to 5.