CN110262289B - Method and device for processing variables in A2L file and storage medium - Google Patents
Method and device for processing variables in A2L file and storage medium Download PDFInfo
- Publication number
- CN110262289B CN110262289B CN201910648860.9A CN201910648860A CN110262289B CN 110262289 B CN110262289 B CN 110262289B CN 201910648860 A CN201910648860 A CN 201910648860A CN 110262289 B CN110262289 B CN 110262289B
- Authority
- CN
- China
- Prior art keywords
- file
- character string
- variable
- processed
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B17/00—Systems involving the use of models or simulators of said systems
- G05B17/02—Systems involving the use of models or simulators of said systems electric
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a processing method, a device and a storage medium for variables in an A2L file, wherein the processing method for the variables in the A2L file reads the A2L file into a memory according to lines, obtains part of contents of the A2L file as information to be processed, can quickly and accurately find the variables needing to be processed by only searching the variables in the information to be processed, avoids the subsequent processing aiming at the variables which do not exist in the A2L file, improves the processing efficiency and reduces the total processing time.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for processing variables in an A2L file and a storage medium.
Background
At present, the automobile electronic controller development field applies an international universal V-shaped development mode. And setting an MATLAB control model according to the control requirement, and automatically generating a C code and an A2L file by using the MATLAB code. The parameter address of the variable in the A2L File is a virtual address, and the parameter address needs to be replaced by a physical address of the variable found in a Linker MAP File (MAP) generated by compiling, and then the parameter address can be used.
Generally, it is necessary to first traverse the corresponding relationship between all variables and their corresponding physical addresses in the MAP file, and then traverse the search in the A2L file for each variable, find the variables in the A2L file, and perform address replacement.
However, since many variables in the MAP file do not exist in the target A2L file, traversing the A2L file for each variable in the MAP file results in less efficient processing and increased overall time consumption.
Disclosure of Invention
The application provides a method and a device for processing variables in an A2L file and a storage medium, which are used for solving the problems of low processing efficiency and increased total time consumption caused by searching in an A2L file aiming at each variable in an MAP file.
In a first aspect, the present application provides a method for processing variables in an A2L file, including:
reading the A2L file into a memory according to lines to obtain information to be processed; the number of lines of the information to be processed is N, and N is a positive integer and is less than the total number of lines of the A2L file;
and if the variable is found in the information to be processed, acquiring the name of the variable.
Optionally, reading the A2L file in the memory in rows to obtain the information to be processed includes:
reading the K line character string in the A2L file to a memory; k is a positive integer;
if the initial character string of the K-th row of character strings is the first character string, reading the K + 1-th row of character strings in the A2L file into a memory; the first string is used to begin defining variables;
judging whether the initial character string of the K +1 row character string is a second character string; the second character string is used for ending the definition variable;
if the initial character string of the K +1 th row of character strings is the second character string, acquiring the information to be processed, wherein the information to be processed comprises the K +1 th row of character strings; and if the initial character string of the (K + 1) th line of character strings is not the second character string, reading the (K + 2) th line of character strings in the A2L file into a memory, and re-executing the step of judging whether the initial character string is the second character string.
Optionally, the method further includes:
and if the initial character string of the K-th line of character strings is not the first character string, writing the K-th line of character strings into a new A2L file.
Optionally, if the variable is found in the information to be processed, obtaining the name of the variable includes:
matching a preset regular expression with the information to be processed, and judging whether the information to be processed comprises variables; the preset regular expression comprises a preset identifier, and the preset identifier is used for identifying a variable;
and if the information to be processed comprises the variable, acquiring the name of the variable according to the preset identifier.
Optionally, the method further includes:
acquiring a physical address corresponding to a variable according to a corresponding relation between the variable and the physical address stored in a memory;
and replacing the address of the variable according to the physical address corresponding to the variable, and writing the information to be processed after address replacement into a new A2L file.
In a second aspect, the present application provides an apparatus for processing variables in an A2L file, including:
the first acquisition module is used for reading the A2L file into the memory according to lines and acquiring information to be processed; the number of lines of the information to be processed is N, and N is a positive integer and is less than the total number of lines of the A2L file;
and the first processing module is used for acquiring the name of the variable when the variable is found in the information to be processed.
Optionally, the first obtaining module is specifically configured to:
reading the K line character string in the A2L file to a memory; k is a positive integer;
if the initial character string of the K-th row of character strings is the first character string, reading the K + 1-th row of character strings in the A2L file into a memory; the first string is used to begin defining variables;
judging whether the initial character string of the K +1 row character string is a second character string; the second character string is used for ending the definition variable;
if the initial character string of the K +1 th row of character strings is the second character string, acquiring the information to be processed, wherein the information to be processed comprises the K +1 th row of character strings; and if the initial character string of the (K + 1) th line of character strings is not the second character string, reading the (K + 2) th line of character strings in the A2L file into a memory, and re-executing the step of judging whether the initial character string is the second character string.
Optionally, the method further includes:
and the first writing module is used for writing the K-th line of character strings into a new A2L file if the initial character string of the K-th line of character strings is not the first character string.
Optionally, the first processing module is specifically configured to:
matching a preset regular expression with the information to be processed, and judging whether the information to be processed comprises variables; the preset regular expression comprises a preset identifier, and the preset identifier is used for identifying a variable;
and if the information to be processed comprises the variable, acquiring the name of the variable according to the preset identifier.
Optionally, the method further includes:
the second obtaining module is used for obtaining a physical address corresponding to the variable according to the corresponding relation between the variable and the physical address stored in the memory;
the second processing module is used for replacing the address of the variable according to the physical address corresponding to the variable;
and the second writing module is also used for writing the information to be processed after the address replacement into a new A2L file.
In a third aspect, the present application provides an apparatus for processing variables in an A2L file, including: a memory and a processor;
the memory to store program instructions;
the processor is configured to call the program instructions stored in the memory to implement a method for processing variables in the A2L file provided in any embodiment of the first aspect of the present application.
In a fourth aspect, the present application provides a storage medium comprising: a readable storage medium and a computer program, the computer program being used for implementing the method for processing the variables in the A2L file provided in any embodiment of the first aspect of the present application.
The application provides a processing method, a device and a storage medium for variables in an A2L file, wherein the processing method for the variables in the A2L file reads the A2L file into a memory according to lines, obtains part of contents of the A2L file as information to be processed, can quickly and accurately find the variables needing to be processed by only searching the variables in the information to be processed, avoids the subsequent processing aiming at the variables which do not exist in the A2L file, improves the processing efficiency and reduces the total processing time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a method for processing variables in an A2L file according to an embodiment of the present application;
fig. 2 is a flowchart of a method for processing variables in the A2L file according to a second embodiment of the present application;
fig. 3 is a flowchart of a method for processing variables in the A2L file according to a third embodiment of the present application;
fig. 4 is a flowchart of a method for processing variables in the A2L file according to the fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of a processing apparatus for processing variables in the A2L document according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a processing apparatus for processing variables in the A2L file according to a second embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms to which the present invention relates will be explained first:
A2L file: the A2L file is a file describing internal variables of an Electronic Control Unit (ECU) and includes two parts, namely a measurement variable and a calibration variable, and the A2L file corresponds to a program one by one. Through the A2L file, the calibration tool identifies information such as variable names, variable addresses, variable lengths and the like in the program.
And (3) MAP file: the embedded software is processed by the compiler to generate a description file which stores information such as variable names and corresponding addresses.
A dictionary: a variable type stored in the form of a key-value pair in a scripting language.
Fig. 1 is a flowchart of a method for processing variables in an A2L file according to an embodiment of the present application. The execution subject of the method can be a processing device of the variable in the A2L file. As shown in fig. 1, a method for processing variables in an A2L file provided in an embodiment of the present application includes:
s101, reading the A2L file into a memory according to lines, and acquiring information to be processed.
The number of rows of the information to be processed is N, and N is a positive integer and is less than the total number of rows of the A2L file.
And S102, if the variable is found in the information to be processed, acquiring the name of the variable.
Specifically, the processing device for the variables in the A2L file reads the character strings in the A2L file line by line into the memory, uses the N lines of read character strings as the information to be processed, and searches the variables in the information to be processed. In general, in the A2L file, the storage form of the variable has a prescribed format, and the variable can be searched in the information to be processed according to the prescribed format, and after the variable is searched, the name of the variable is extracted from the variable.
The size of N is not limited in this embodiment, and the value of N may be determined according to a format specified in the A2L file with respect to the variable storage form.
According to the method for processing the variables in the A2L file, the A2L file is read into the memory according to the lines, part of the content of the A2L file is obtained as the information to be processed, the variables needing to be processed can be quickly and accurately found by only searching the variables in the information to be processed, the follow-up processing aiming at the variables which do not exist in the A2L file is avoided, the processing efficiency is improved, and the total processing time is reduced.
Fig. 2 is a flowchart of a method for processing variables in the A2L file according to the second embodiment of the present application. The present embodiment provides an implementation manner of S101 on the basis of the embodiment shown in fig. 1. As shown in fig. 2, in S101, reading the A2L file into the memory by rows to obtain the information to be processed may include:
s201, reading a K-th line of character strings in the A2L file into a memory; k is a positive integer.
S202, judging whether the initial character string of the K-th row of character strings is the first character string. Wherein the first string is used to begin defining variables.
If the initial string of the K-th string is the first string, then S203 is executed. If the initial string of the kth string is not the first string, S207 is executed.
S203, reading the K +1 th line character string in the A2L file into the memory.
After that, S204 is executed.
S204, judging whether the initial character string of the K +1 th row of character strings is a second character string. Wherein the second string is used to end the defined variable.
If the initial string of the K +1 th string is the second string, S205 is executed. If the starting string of the K +1 th string is not the second string, S206 is executed.
S205, obtaining information to be processed, wherein the information to be processed comprises the K-th line character string to the K + 1-th line character string.
S206, taking K +1 as a new K, and returning to execute S203.
Specifically, in the A2L file, the storage form of a variable generally has a prescribed format. For example, the storage of variables may include multiple lines of strings. In a plurality of lines of strings, with a first string as the beginning of the variable description and a second string as the end of the variable description, the virtual address of the variable may be located in the string between the first string and the second string. Therefore, the A2L file can be read into the memory by line, and whether the current read line is the beginning of the variable description is determined according to whether the initial character string of the current read line character string is the first character string, and whether the current read line is the end of the variable description is determined according to whether the initial character string of the current read line character string is the second character string. Further, the complete A2L description string of one variable is determined, that is, the information to be processed is acquired.
In the embodiment, by using the specific format of the A2L file and taking the complete A2L description character string of one variable as the basic unit for searching the variable, the search range of the variable is narrowed, and the speed of determining the variable in the A2L file is improved.
This is illustrated by way of example.
In the A2L file, the variables may include calibration variables and measurement variables. Optionally, in one example, one stored form of the calibration variables is as follows:
in this example, the calibration variable may be stored beginning with the string "begin CHARACTERISTIC" and ending with the string "end CHARACTERISTIC", with a string between the string "begin CHARACTERISTIC" and the string "end CHARACTERISTIC" that has variable names, variable addresses, variable lengths, data types, minimum values, and maximum values describing the calibration variable. In this example, the first string may be "begin" and the second string may be "end". A character string between the first character string "begin" and the second character string "end" may be determined as the information to be processed.
Alternatively, in another example, in one stored form of the measured variable, the measured variable may begin with the string "begin MEASUREMENT" and end with the string "end MEASUREMENT", where the string "begin MEASUREMENT" and the string "end MEASUREMENT" have a string describing the variable name, variable address, variable length, calculation formula, precision, minimum value, and maximum value of the measured variable. In this example, the first string may be "begin" and the second string may be "end". A character string between the first character string "begin" and the second character string "end" may be determined as the information to be processed.
The first character string and the second character string are merely examples, and the first character string and the second character string are not limited.
The current behavior K is taken as an example below. Firstly, reading the K-th string in the A2L file into a memory, and judging whether the initial string of the K-th string is the first string. And if the initial character string of the K-th row of character strings is judged to be the first character string, determining that the K-th row of character strings is the start of variable description, continuously reading the K + 1-th row of character strings in the A2L file into the memory, and judging whether the initial character string of the K + 1-th row of character strings is the second character string. If the initial character string of the (K + 1) th row of character strings is the second character string, determining that the (K + 1) th row of character strings is the end of variable description, and further taking the (K) th row of character strings to the (K + 1) th row of character strings as complete A2L description character strings representing a variable, namely taking the (K) th row of character strings to the (K + 1) th row of character strings as information to be processed. And if the initial character string of the (K + 1) th row of character strings is not the second character string, continuously reading the (K + 2) th row of character strings, and judging whether the initial character string of the (K + 2) th row of character strings is the second character string. Similarly, if the initial character string of the (K + 2) th row of character strings is the second character string, determining that the (K + 2) th row of character strings is the end of the variable description, and taking the (K + 2) th row of character strings to the (K + 2) th row of character strings as the information to be processed, otherwise, continuously reading the next character string until the character string of which the initial character string is the second character string is read. For example, if the starting string of the K + n-th string is the second string, determining that the K + n-th string is the end of the variable description, and taking the K-th string to the K + n-th string as the information to be processed, where n is an integer greater than or equal to 1.
Optionally, in S202, if the starting string of the kth string is not the first string, S207 is executed.
And S207, writing the K-th line character string into a new A2L file.
Specifically, when the A2L file is read into the memory by line, if the initial character string of the kth line character string is determined not to be the first character string, it may be determined that the kth line character string is not the start of the variable description, and then it is not necessary to process a certain character string in the kth line character string. Therefore, the K line string can be written directly into the new A2L file. By directly writing some character strings which do not need further processing into a new A2L file, the search range of the character strings with specific identifications can be reduced, and the search speed of the character strings with specific variables is improved.
Fig. 3 is a flowchart of a method for processing variables in the A2L file according to a third embodiment of the present application. The present embodiment provides an implementation manner of S102 on the basis of the embodiment shown in fig. 1. As shown in fig. 3, in S102, if the variable is found in the information to be processed, acquiring the name of the variable may include:
s301, matching a preset regular expression with the information to be processed, and judging whether the information to be processed comprises a variable or not; the preset regular expression comprises a preset identifier, and the preset identifier is used for identifying a variable.
S302, if the information to be processed comprises the variable, acquiring the name of the variable according to the preset identifier.
Specifically, in the A2L file, the storage form of a variable usually has a prescribed format, for example, the variable name, the variable type, and the variable address have a prescribed representation form. Wherein the variable address can be identified by a character string with a specific identification, for example. Therefore, the preset regular expression may be constructed according to the representation form of the variable address in the A2L file, so that the preset regular expression includes a preset identifier for identifying the variable address. And matching the preset regular expression with the acquired information to be processed, and judging whether the information to be processed has a character string with a preset identifier. If a character string with a preset identifier is found in the information to be processed, the variable name can be extracted from the character string.
In this embodiment, specific content of the preset identifier is not limited. The preset identifier may be determined according to a defined format of the variable address in the A2L file.
In the following, the expression form of the variable address in the A2L file is exemplified by the string "@ mem @ where" @ "represents the name of the variable. The preset regular expression can be constructed according to the character string "@ mem @" so that the preset regular expression has a preset identifier representing "@ mem @ @". And searching the information to be processed by using a preset regular expression. After finding the string with the preset identifier, extracting the variable name from the string. For example, the character string "@ mem @ test _ var @ is found in the information to be processed, and then the variable name" test _ var "may be extracted from the character string.
In this embodiment, by using a specified format for storing variables in the A2L file, a regular expression is constructed as needed to search for the variables, and the variables that need to be processed can be quickly and accurately located.
Fig. 4 is a flowchart of a method for processing variables in the A2L file according to the fourth embodiment of the present application. The method for processing the variables in the A2L file provided in this embodiment may further include:
s401, according to the corresponding relation between the variable and the physical address stored in the memory, obtaining the physical address corresponding to the variable.
S402, replacing the address of the variable according to the physical address corresponding to the variable, and writing the information to be processed after address replacement into a new A2L file.
Specifically, the correspondence between the variable name and the physical address is stored in the memory in advance, and after the variable name is acquired in S102, the physical address corresponding to the variable may be acquired according to the variable name. After the physical address corresponding to the variable is obtained, the physical address is adopted to replace the virtual address corresponding to the variable in the information to be processed, and the conversion from the virtual address of the variable in the information to be processed to the physical address is realized. And then writing the information to be processed after address replacement into a new A2L file.
In this embodiment, the obtaining manner of the corresponding relationship between the variable and the physical address stored in the memory is not limited. For example, all variables and their corresponding physical addresses may be traversed in the MAP file, and the found variables and corresponding physical addresses are stored in the memory as a dictionary in a one-to-one key-value pair form. For example, all variables traversed in the MAP file and their corresponding physical addresses may be stored in the memory with the variable name as a key and their corresponding physical addresses as a value.
According to the processing method for the variables in the A2L file, provided by the embodiment of the application, the main body of address replacement is converted from the characters of the whole A2L file into the A2L description character strings of a single variable, so that the unit time of the address replacement operation is reduced, meanwhile, the replacement of all addresses can be completed only by traversing the A2L file once, and the processing speed of the address replacement of the A2L file is improved. Experiments show that for a large A2L file, the processing speed of the A2L file address replacement can be improved by 6-8 times by adopting the processing method of the variables in the A2L file provided by the embodiment of the application.
Fig. 5 is a schematic structural diagram of a processing apparatus for processing variables in the A2L file according to an embodiment of the present application, and the processing apparatus for processing variables in the A2L file according to the embodiment is used to execute a processing method for variables in the A2L file according to any method embodiment of the present application. As shown in fig. 5, the apparatus for processing variables in the A2L file provided in this embodiment may include:
the first obtaining module 51 is configured to read the A2L file into the memory in rows and obtain information to be processed; the number of lines of the information to be processed is N, and N is a positive integer and is less than the total number of lines of the A2L file;
the first processing module 52 is configured to obtain a name of the variable when the variable is found in the information to be processed.
Optionally, the first obtaining module 52 is specifically configured to:
reading the K line character string in the A2L file to a memory; k is a positive integer;
if the initial character string of the K-th row of character strings is the first character string, reading the K + 1-th row of character strings in the A2L file into the memory; the first string is used to begin defining variables;
judging whether the initial character string of the K +1 row character string is a second character string; the second character string is used for ending the definition variable;
if the initial character string of the K +1 th row of character strings is a second character string, acquiring information to be processed, wherein the information to be processed comprises the K +1 th row of character strings; and if the initial character string of the (K + 1) th row of character strings is not the second character string, reading the (K + 2) th row of character strings in the A2L file into the memory, and re-executing the step of judging whether the initial character string is the second character string.
Optionally, the method further includes:
the first writing module 53 is configured to write the kth string into the new A2L file if the starting string of the kth string is not the first string.
Optionally, the first processing module 52 is specifically configured to:
matching a preset regular expression with the information to be processed, and judging whether the information to be processed comprises variables; the preset regular expression comprises a preset identifier, and the preset identifier is used for identifying the variable;
and if the information to be processed comprises the variable, acquiring the name of the variable according to the preset identifier.
Optionally, the method further includes:
a second obtaining module (not shown) configured to obtain a physical address corresponding to the variable according to a correspondence between the variable and the physical address stored in the memory;
a second processing module (not shown) for replacing the address of the variable according to the physical address corresponding to the variable;
and a second writing module (not shown) for writing the information to be processed after address replacement into the new A2L file.
The processing apparatus for processing the variables in the A2L file provided in this embodiment is configured to execute the processing method for the variables in the A2L file provided in any method embodiment of the present application, and the technical principle and the technical effect are similar, and are not described herein again.
Fig. 6 is a schematic structural diagram of a processing apparatus for processing variables in the A2L file provided in this embodiment, and the processing apparatus for processing variables in the A2L file provided in this embodiment is used to execute the processing method for variables in the A2L file provided in any method embodiment of the present application. As shown in fig. 6, the apparatus for processing variables in the A2L file provided in this embodiment may include:
a memory 61 for storing program instructions;
and a processor 62 for calling the program instructions stored in the memory to implement the processing method of the variables in the A2L file provided by any method embodiment of the present application.
The specific implementation and technical effects are similar, and are not described herein again.
The present application further provides a storage medium, which may include: a readable storage medium and a computer program for implementing a method for processing variables in the A2L file provided in any of the method embodiments of the present application. The specific implementation and technical effects are similar, and are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (8)
1. A method for processing variables in an A2L file is characterized by comprising the following steps:
reading the A2L file into a memory according to lines to obtain information to be processed; the number of lines of the information to be processed is N, and N is a positive integer and is less than the total number of lines of the A2L file;
if the variable is found in the information to be processed, acquiring the name of the variable;
reading the A2L file into the memory according to the rows to obtain the information to be processed, wherein the method comprises the following steps:
reading the K line character string in the A2L file to a memory; k is a positive integer;
if the initial character string of the K-th row of character strings is the first character string, reading the K + 1-th row of character strings in the A2L file into a memory; the first string is used to begin defining variables;
judging whether the initial character string of the K +1 row character string is a second character string; the second character string is used for ending the definition variable;
if the initial character string of the K +1 th row of character strings is the second character string, acquiring the information to be processed, wherein the information to be processed comprises the K +1 th row of character strings; and if the initial character string of the (K + 1) th line of character strings is not the second character string, reading the (K + 2) th line of character strings in the A2L file into a memory, and re-executing the step of judging whether the initial character string is the second character string.
2. The method of claim 1, further comprising:
and if the initial character string of the K-th line of character strings is not the first character string, writing the K-th line of character strings into a new A2L file.
3. The method according to claim 1, wherein the obtaining the name of the variable if the variable is found in the information to be processed comprises:
matching a preset regular expression with the information to be processed, and judging whether the information to be processed comprises variables; the preset regular expression comprises a preset identifier, and the preset identifier is used for identifying a variable;
and if the information to be processed comprises the variable, acquiring the name of the variable according to the preset identifier.
4. The method of claim 1 or 2, further comprising:
acquiring a physical address corresponding to a variable according to a corresponding relation between the variable and the physical address stored in a memory;
and replacing the address of the variable according to the physical address corresponding to the variable, and writing the information to be processed after address replacement into a new A2L file.
5. An apparatus for processing variables in an A2L file, comprising:
the first acquisition module is used for reading the A2L file into the memory according to lines and acquiring information to be processed; the number of lines of the information to be processed is N, and N is a positive integer and is less than the total number of lines of the A2L file;
the first processing module is used for acquiring the name of the variable when the variable is found in the information to be processed;
the first obtaining module is specifically configured to:
reading the K line character string in the A2L file to a memory; k is a positive integer;
if the initial character string of the K-th row of character strings is the first character string, reading the K + 1-th row of character strings in the A2L file into a memory; the first string is used to begin defining variables;
judging whether the initial character string of the K +1 row character string is a second character string; the second character string is used for ending the definition variable;
if the initial character string of the K +1 th row of character strings is the second character string, acquiring the information to be processed, wherein the information to be processed comprises the K +1 th row of character strings; and if the initial character string of the (K + 1) th line of character strings is not the second character string, reading the (K + 2) th line of character strings in the A2L file into a memory, and re-executing the step of judging whether the initial character string is the second character string.
6. The processing apparatus as in claim 5, further comprising:
and the first writing module is used for writing the K-th line of character strings into a new A2L file if the initial character string of the K-th line of character strings is not the first character string.
7. An apparatus for processing variables in an A2L file, comprising: a memory and a processor;
the memory to store program instructions;
the processor, configured to call the program instructions stored in the memory to implement a processing method of a variable in the A2L file according to any one of claims 1 to 4.
8. A storage medium, comprising: a readable storage medium and a computer program for implementing the method of processing variables in the A2L file according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910648860.9A CN110262289B (en) | 2019-07-18 | 2019-07-18 | Method and device for processing variables in A2L file and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910648860.9A CN110262289B (en) | 2019-07-18 | 2019-07-18 | Method and device for processing variables in A2L file and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110262289A CN110262289A (en) | 2019-09-20 |
CN110262289B true CN110262289B (en) | 2022-04-26 |
Family
ID=67926822
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910648860.9A Active CN110262289B (en) | 2019-07-18 | 2019-07-18 | Method and device for processing variables in A2L file and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110262289B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113076092B (en) * | 2020-01-06 | 2023-08-15 | 广汽埃安新能源汽车有限公司 | Processing method and device for A2L file of vehicle-mounted controller |
CN113533936A (en) * | 2021-07-13 | 2021-10-22 | 上海矽昌微电子有限公司 | Chip scan chain test method and system |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1236588A2 (en) * | 2001-02-28 | 2002-09-04 | WABCO GmbH & CO. OHG | Method and system for tyre pressure surveillance for vehicles with anti-blocking systems (ABS systems) |
RU2004123348A (en) * | 2003-07-29 | 2006-01-27 | Майкрософт Корпорейшн (Us) | METHOD AND DEVICE FOR DYNAMIC LINKING / DYNAMIC RESOLUTION OF PATH NAMES |
CN101853263A (en) * | 2009-04-03 | 2010-10-06 | 鸿富锦精密工业(深圳)有限公司 | Data structuralizing system and method |
JP2011221845A (en) * | 2010-04-12 | 2011-11-04 | Fujitsu Ltd | Text processing apparatus, text processing method and text processing program |
CN103136211A (en) * | 2011-11-23 | 2013-06-05 | 北汽福田汽车股份有限公司 | Automatic generation method and device for A2L file |
CN104636351A (en) * | 2013-11-07 | 2015-05-20 | 北汽福田汽车股份有限公司 | A2L file generation method and system |
CN104850570A (en) * | 2014-08-29 | 2015-08-19 | 北汽福田汽车股份有限公司 | Method and system for automatically generating A2L file |
CN106126504A (en) * | 2016-08-26 | 2016-11-16 | 重庆红江机械有限责任公司 | A2L grammar parser and method |
CN106776633A (en) * | 2015-11-23 | 2017-05-31 | 上海极能客车动力系统有限公司 | The apparatus and method that what user can configure automatically generate a2l files |
CN106844288A (en) * | 2015-12-07 | 2017-06-13 | 阿里巴巴集团控股有限公司 | A kind of random string generation method and device |
CN207946700U (en) * | 2018-01-30 | 2018-10-09 | 潍柴动力股份有限公司 | A kind of portable road spectrum acquisition system |
CN108733674A (en) * | 2017-04-14 | 2018-11-02 | 宁德时代新能源科技股份有限公司 | A2L file merging method and device |
CN109696904A (en) * | 2018-12-24 | 2019-04-30 | 普华基础软件股份有限公司 | A kind of the address replacement method and system of electronic control unit data description file |
CN109697279A (en) * | 2018-12-27 | 2019-04-30 | 潍柴动力股份有限公司 | A kind of A2L address of variable treating method and apparatus |
-
2019
- 2019-07-18 CN CN201910648860.9A patent/CN110262289B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1236588A2 (en) * | 2001-02-28 | 2002-09-04 | WABCO GmbH & CO. OHG | Method and system for tyre pressure surveillance for vehicles with anti-blocking systems (ABS systems) |
RU2004123348A (en) * | 2003-07-29 | 2006-01-27 | Майкрософт Корпорейшн (Us) | METHOD AND DEVICE FOR DYNAMIC LINKING / DYNAMIC RESOLUTION OF PATH NAMES |
CN101853263A (en) * | 2009-04-03 | 2010-10-06 | 鸿富锦精密工业(深圳)有限公司 | Data structuralizing system and method |
JP2011221845A (en) * | 2010-04-12 | 2011-11-04 | Fujitsu Ltd | Text processing apparatus, text processing method and text processing program |
CN103136211A (en) * | 2011-11-23 | 2013-06-05 | 北汽福田汽车股份有限公司 | Automatic generation method and device for A2L file |
CN104636351A (en) * | 2013-11-07 | 2015-05-20 | 北汽福田汽车股份有限公司 | A2L file generation method and system |
CN104850570A (en) * | 2014-08-29 | 2015-08-19 | 北汽福田汽车股份有限公司 | Method and system for automatically generating A2L file |
CN106776633A (en) * | 2015-11-23 | 2017-05-31 | 上海极能客车动力系统有限公司 | The apparatus and method that what user can configure automatically generate a2l files |
CN106844288A (en) * | 2015-12-07 | 2017-06-13 | 阿里巴巴集团控股有限公司 | A kind of random string generation method and device |
CN106126504A (en) * | 2016-08-26 | 2016-11-16 | 重庆红江机械有限责任公司 | A2L grammar parser and method |
CN108733674A (en) * | 2017-04-14 | 2018-11-02 | 宁德时代新能源科技股份有限公司 | A2L file merging method and device |
CN207946700U (en) * | 2018-01-30 | 2018-10-09 | 潍柴动力股份有限公司 | A kind of portable road spectrum acquisition system |
CN109696904A (en) * | 2018-12-24 | 2019-04-30 | 普华基础软件股份有限公司 | A kind of the address replacement method and system of electronic control unit data description file |
CN109697279A (en) * | 2018-12-27 | 2019-04-30 | 潍柴动力股份有限公司 | A kind of A2L address of variable treating method and apparatus |
Non-Patent Citations (4)
Title |
---|
New methods of debugging and testing improve the software quality of AUTOSAR ECUs;R. E. Lotoczky and M. Schwager,;《 SAE Int. J.Passeng. Cars – Electron. Electr. Syst》;20131231;第180-185页 * |
发动机标定数据管理系统开发;周洋;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20131215;第I138-535页 * |
基于ASAM标准的汽车通用标定系统的设计与实现;钱啸君;《中国优秀博硕士学位论文全文数据库(硕士)工程科技Ⅱ辑》;20130215;第C035-138页 * |
基于ASAP2标准的A2L文件生成与解析技术实现;马亮;《中国优秀博硕士学位论文全文数据库(硕士)工程科技Ⅱ辑》;20180115;第C035-212页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110262289A (en) | 2019-09-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108710662B (en) | Language conversion method and device, storage medium, data query system and method | |
CN110262289B (en) | Method and device for processing variables in A2L file and storage medium | |
US20190087208A1 (en) | Method and apparatus for loading elf file of linux system in windows system | |
CN112633423B (en) | Training method of text recognition model, text recognition method, device and equipment | |
CN110825827A (en) | Entity relationship recognition model training method and device and entity relationship recognition method and device | |
CN111737541B (en) | Semantic recognition and evaluation method supporting multiple languages | |
CN104063329A (en) | 64-bit immediate operand processing method and device | |
CN111241811B (en) | Method, apparatus, computer device and storage medium for determining search term weight | |
CN116306498B (en) | Text rendering method and device | |
CN116701567A (en) | Electronic book retrieval method and system based on artificial intelligence | |
CN111240790A (en) | Multi-language adaptation method and device for application, client and storage medium | |
CN110019295B (en) | Database retrieval method, device, system and storage medium | |
CN110968702A (en) | Method and device for extracting matter relationship | |
CN116431660A (en) | Data processing method, device, system, electronic equipment and storage medium | |
CN114003685B (en) | Word segmentation position index construction method and device, and document retrieval method and device | |
CN107562715B (en) | Word vector processing method and device and electronic equipment | |
CN115688099A (en) | Computer virus retrieval method and device, computer equipment and storage medium | |
CN113467783B (en) | Nuclear function compiling method and device of artificial intelligent accelerator | |
CN113010550B (en) | Batch object generation and batch processing method and device for structured data | |
CN111859089B (en) | Wrong word detection control method for Internet information | |
CN111580856A (en) | Internet of things equipment component version information extraction method for MIPS framework | |
CN117393046B (en) | Space transcriptome sequencing method, system, medium and equipment | |
CN110674264A (en) | Entity normalization method and device | |
CN113887223B (en) | Character string matching method and related device | |
CN110147429B (en) | Text comparison method, apparatus, computer device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |