CN114185814A - Method and device for generating variable address file - Google Patents

Method and device for generating variable address file Download PDF

Info

Publication number
CN114185814A
CN114185814A CN202111245423.6A CN202111245423A CN114185814A CN 114185814 A CN114185814 A CN 114185814A CN 202111245423 A CN202111245423 A CN 202111245423A CN 114185814 A CN114185814 A CN 114185814A
Authority
CN
China
Prior art keywords
variable
address
target control
file
control variable
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.)
Pending
Application number
CN202111245423.6A
Other languages
Chinese (zh)
Inventor
王秋来
孙海英
宫熔
张明凯
王涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfeng Motor Corp
Original Assignee
Dongfeng Motor Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Dongfeng Motor Corp filed Critical Dongfeng Motor Corp
Priority to CN202111245423.6A priority Critical patent/CN114185814A/en
Publication of CN114185814A publication Critical patent/CN114185814A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/0292User address space allocation, e.g. contiguous or non contiguous base addressing using tables or multilevel address translation means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for generating a variable address file, wherein the method comprises the following steps: acquiring a variable mapping file, wherein the variable mapping file comprises an allocation address of at least one control variable; acquiring a target control variable, wherein the target control variable is a control variable to be updated; obtaining a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least comprises the target control variable and the corresponding allocation address; and obtaining a variable address file according to the variable address allocation table. The generation method of the invention has simpler and more visual maintenance mode of the target control variable, has small workload and improves the maintenance efficiency of the target control variable; the dependency on the position order of the target control variables in the control variable management file is reduced.

Description

Method and device for generating variable address file
Technical Field
The present application relates to the field of software technologies, and in particular, to a method and an apparatus for generating a variable address file.
Background
The control variables in the software are defined for realizing a functional algorithm, each control variable is correspondingly allocated with a unique address in the memory, and the number of the control variables defined in a software system is usually huge, for example, the number of the control variables of a hydrogen-fuel control system of an automobile is thousands. When software is debugged, each compiling involves the addition and modification of a control variable, and the problem of control variable address redistribution is involved; particularly, when the control variable is newly added, deleted or modified, the corresponding address of the control variable is reassigned, and it is generally difficult to add the control variable at the end of the existing control variable due to the change of the control variable. Therefore, each time the control variable address is allocated, the address value allocated to the same control variable may be different, which results in the address allocation file of the control variable being created again.
At present, for the increase of control variables, in order to ensure that the change of compiled files allocated by control variable addresses is minimized, the control variables needing to be newly added are generally manually added to the end of a control variable management file; for the modification of the control variable, the position of the control variable needs to be manually searched, and then the information such as the address and the like needs to be modified. The control variable address file obtained by maintaining the control variable in the above way has huge workload, is easy to make mistakes and is difficult to correct errors.
Disclosure of Invention
In view of the above technical problems, the present invention provides a method and an apparatus for generating a variable address file, which can maintain a control variable in a simpler and intuitive manner.
The embodiment of the invention provides the following scheme:
in a first aspect, an embodiment of the present invention provides a method for generating a variable address file, including the following steps:
acquiring a variable mapping file, wherein the variable mapping file comprises an allocation address of at least one control variable;
acquiring a target control variable, wherein the target control variable is a control variable to be updated;
obtaining a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least comprises the target control variable and the corresponding allocation address;
and obtaining a variable address file according to the variable address allocation table.
In an alternative embodiment, the obtaining the target control variable includes:
obtaining a historical variable address file;
and obtaining the target control variable according to the control variable in the historical variable address file.
In an optional embodiment, the obtaining the target control variable according to the control variable in the historical variable address file includes:
obtaining a variable classification of the control variable;
determining an extraction mode of the target control variable according to the variable classification;
and extracting the target control variable in the historical variable address file according to the extraction mode.
In an optional embodiment, the obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:
extracting the corresponding distribution address in the variable mapping file according to the first variable information of the target control variable;
and generating the variable address allocation table according to the target control variable and the allocation address.
In an optional embodiment, the obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:
obtaining a historical variable address allocation table;
obtaining an updating result of the historical variable address allocation table according to the variable mapping file and the target control variable;
and obtaining the variable address allocation table according to the updating result.
In an optional embodiment, the extracting, according to the first variable information of the target control variable, the corresponding allocated address in the variable mapping file includes:
acquiring the first variable information;
obtaining the position of the target control variable between lines of the variable mapping file according to the first variable information;
and extracting the distribution address according to the position between the lines.
In an optional embodiment, the obtaining a variable address file according to the variable address allocation table includes:
acquiring second variable information of the variable address allocation table;
and constructing a control variable statement to the variable address file according to the second variable information, wherein the control variable statement is an expression mode of the target control variable in the variable address file.
In a second aspect, an embodiment of the present invention further provides a device for generating a variable address file, where the device includes:
the device comprises a first acquisition module, a second acquisition module and a control module, wherein the first acquisition module is used for acquiring a variable mapping file, and the variable mapping file comprises an allocation address of at least one control variable;
the second acquisition module is used for acquiring a target control variable, wherein the target control variable is a control variable to be updated;
a first obtaining module, configured to obtain a variable address allocation table according to the variable mapping file and the target control variable, where the variable address allocation table at least includes the target control variable and the corresponding allocation address;
and the second obtaining module is used for obtaining the variable address file according to the variable address allocation table.
In an optional embodiment, the second obtaining module includes:
the first obtaining submodule is used for obtaining a historical variable address file;
and the first obtaining submodule is used for obtaining the target control variable according to the control variable in the historical variable address file.
In an alternative embodiment, the first obtaining sub-module includes:
a first obtaining unit configured to obtain a variable classification of the control variable;
the determining unit is used for determining the extraction mode of the target control variable according to the variable classification;
and the first extraction unit is used for extracting the target control variable in the historical variable address file according to the extraction mode.
In an alternative embodiment, the first obtaining module includes:
the extraction submodule is used for extracting the corresponding distribution address in the variable mapping file according to the first variable information of the target control variable;
and the generation submodule is used for generating the variable address allocation table according to the target control variable and the allocation address.
In an alternative embodiment, the first obtaining module includes:
the second acquisition submodule is used for acquiring a historical variable address allocation table;
the second obtaining submodule is used for obtaining an updating result of the historical variable address allocation table according to the variable mapping file and the target control variable;
and the third obtaining submodule is used for obtaining the variable address allocation table according to the updating result.
In an alternative embodiment, the extraction sub-module includes:
a second obtaining unit configured to obtain the first variable information;
a second obtaining unit, configured to obtain, according to the first variable information, an inter-row position of the target control variable in the variable mapping file;
and the second extraction unit is used for extracting the distribution address according to the position between the lines.
In an alternative embodiment, the second obtaining module includes:
the third obtaining submodule is used for obtaining second variable information of the variable address allocation table;
and the construction submodule constructs a control variable statement to the variable address file according to the second variable information, wherein the control variable statement is an expression mode of the target control variable in the variable address file.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the method of any of the first aspects.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps of the method in any one of the first aspect.
Compared with the prior art, the method and the device for generating the variable address file have the following advantages that:
the generation method of the invention maintains the target control variable to be added, modified or deleted through the variable address allocation table, and then correspondingly obtains the allocation address in the variable mapping file, so that the corresponding information of the target control variable is completely obtained, and further the variable address file is obtained, the maintenance mode of the target control variable is simpler and more visual, the workload is less, and the maintenance efficiency of the target control variable is improved; the dependency on the position order of the target control variables in the control variable management file is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present specification, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for generating a variable address file according to an embodiment of the present invention;
fig. 2 is a schematic format diagram of a variable mapping file according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a Mon _ Var variable expression format according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the format of the Cal _ Var variable expression provided by the embodiment of the present invention;
fig. 5 is a schematic diagram of a format of the representation of the LikeArr _ Var variable according to the embodiment of the present invention;
fig. 6 is a schematic diagram of a format of a calcurr _ Var variable expression provided in an embodiment of the present invention;
fig. 7 is a schematic diagram of a format of a callmap _ Var variable expression provided in the embodiment of the present invention;
fig. 8 is a flowchart of variable information extraction of a target control variable according to an embodiment of the present invention;
FIG. 9 is a flowchart of extracting an address assigned to a target control variable according to an embodiment of the present invention;
FIG. 10 is a diagram illustrating a format of a variable address allocation table according to an embodiment of the present invention;
fig. 11 is a flowchart of generating a variable address file according to an embodiment of the present invention;
FIG. 12 is a diagram illustrating a format of a target control variable in a tb7 file according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a control variable maintenance apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by those skilled in the art based on the embodiments of the present invention belong to the scope of protection of the embodiments of the present invention.
The generation method of the variable address file in the embodiment of the invention can be applied to debugging of a control system containing control variables, the embodiment specifically explains a hydrogen fuel electrical system as an example, and a hydrogen fuel cell becomes a hot field of the domestic and foreign fierce competitive research due to the advantages of high efficiency, zero emission, short hydrogenation time, long endurance and the like. For hydrogen-powered electrical systems, a number of key components are the overall coordinated control over the CAN communication network. The advantages of the hydrogen fuel cell system are well exerted and key performance indexes are achieved, and the advantages are not separated from the control function of the hydrogen fuel controller. The control system of the hydrogen combustion controller is jointly completed by three parts, namely upper application control, bottom drive control and integrated control combining the upper layer and the bottom layer, namely the integrated control of software and hardware of the whole control system. The hydrogen combustion system control is to transmit message signals through CAN communication to finish the dispatching of upper layer application to bottom layer drive, and the transmission of the message signals is performed in a control variable mode. Therefore, the hydrogen-fuel system control involves the interaction of a large number of control variables during debugging and formal operation, and these variables need to be addressed in the memory. In the debugging process, target control variables in the control variables, such as observation variables, calibration variables and the like, need to be maintained for multiple times to be newly added, deleted or modified, wherein the maintenance problem of the control variables exists.
The observation and calibration of the hydrogen fuel electric system can be realized by software CANOE or Inca, the variable address file is an a2l file conforming to the ASPS2 standard, of course, HECAL software can be selected for calibration and observation, and the variable address file corresponds to a tb7 file format. the tb7 file creates a data source from the process file-variable mapping file (or map mapping file) after the hydrogen fuel system control Simulink model automatic code generation, and the variable definition file in the upper and lower integration of the control system. The variable definition file command in the upper and lower integration of the control system is closely related to the upper and lower integration environment of the control system. In the embodiment of the present invention, for example, an upper and lower integration environment of a control system is S32 Design Studio for Power Architecture, and variable definition files (or header files) in the upper and lower integration of the control system are CalHW _ var.h, CalSW _ var.h, GlobalHW _ var.h, GlobalSW _ var.h, and the like, where CalHW _ var.h is a calibration variable file related to hardware, CalSW _ var.h is a calibration variable file related to software, GlobalHW _ var.h is an observed global variable file related to hardware, and GlobalSW _ var.h is an observed global variable file related to software. The following will be developed to specifically explain how to solve the maintenance problem of the control variables.
Referring to fig. 1, fig. 1 is a flowchart of a method for generating a variable address file according to an embodiment of the present invention, including the following steps:
s11, obtaining a variable mapping file, wherein the variable mapping file comprises an allocation address of at least one control variable.
Specifically, the variable mapping file is obtained, and a variable management file including all control variables may be obtained in the integrated environment, and the variable mapping file is generated by compiling the variable management file according to the variable name (or called control variable ID) of the control variable. Referring to fig. 2, fig. 2 is a schematic diagram of a format of a variable mapping file, where variable names of control variables and corresponding allocated addresses are included, and the allocated addresses are stored in a hexadecimal manner. After the variable map file is acquired, the process proceeds to step S12.
And S12, acquiring a target control variable, wherein the target control variable is a control variable to be updated.
Specifically, the target control variable may be a part to be modified or deleted in the control variable, or may be a newly added control variable, and the target control variable may be determined from the control variables according to a debugging requirement of the control system. In a hydrogen fueled electrical system, a target control variable may be defined as a control variable that needs to be observed and calibrated.
The target control variable may have more cardinality, the target control variable is confirmed from all the control variables, the process is complicated, the efficiency is low, and the target control variable needs to be acquired in a higher efficiency mode.
In a specific embodiment, the obtaining the target control variable includes:
obtaining a historical variable address file; and obtaining the target control variable according to the control variable in the historical variable address file.
Specifically, the control system debugging is a process of repeatedly maintaining the target control variable, and the maintained control variable may be fixed, so that the target control variable may be obtained through a historical variable address file, which is a variable address file of a previous debugging period. The variable information of the target control variable in the historical variable address file may include attribute information such as a variable name, a variable address, a data type, description, and the like, and the variable address in the historical variable address file is an allocated address of a previous debugging period, and may have a deviation, and therefore, extraction should not be performed.
In practical application, different target control variables may contain different variable information, so that the target control variables are of multiple types, and different types may also be expressed in different variable address files, and if one type of expression is adopted, the variable information of the target control variables may be lost or disordered, so that the target control variables cannot be applied.
In a specific embodiment, the obtaining the target control variable according to the control variable in the historical variable address file includes:
obtaining a variable classification of the control variable; determining an extraction mode of the target control variable according to the variable classification; and extracting the target control variable in the historical variable address file according to the extraction mode.
Specifically, the variable classification of the target control variable may be defined according to the actual application requirement, or may be divided according to the expression manner in the variable address file, or may be divided according to the data type or precision. The variable information of different variable classifications in the historical variable address file may be different, and therefore, the extraction mode may be determined according to the variable classification, so as to correspondingly extract the variable information of the target control variable in the historical variable address file according to the corresponding extraction mode. After the target control variable is acquired, the process proceeds to step S13.
S13, obtaining a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least comprises the target control variable and the corresponding allocation address.
Specifically, after the target control variable is determined, the distribution address corresponding to the target variable file is searched and extracted through the variable mapping file according to variable information of the target control variable, wherein the variable information includes variable name, data type, description and the like, and the variable information can be perfected to create the variable address distribution table.
When the hydrogen fuel electrical system is specifically applied, the classification of the target control variables includes a Mon _ Var variable, a Cal _ Var variable, a LikeArr _ Var variable, a CalCurve _ Var variable, and a CalMap _ Var variable, and the expression formats of the target control variables are shown in fig. 3 to 7, which are respectively the expression formats of the target control variables of each category.
The line data for the Mon _ Var variable is as follows:
SGL _ AD _01,0x400377f8, UInt16,0, 1,0, 65535,0, BSW collect AD variable 01(A08)
Specifically, a callable split () function is extracted, the line data of the target control variable is used and separated; calling a trim () function to remove the spaces at the two ends of each separation field; the processed separate fields are written into the information columns of the variable address allocation table, and the corresponding relationship between the separate fields of the Mon _ Var variable and the variable address allocation table can be referred to in fig. 3. The expression of the Mon _ Var variable in the variable address allocation table includes a 1: a control variable name; a 2: a control variable address; a 3: a data type; a 4: a bit mask; a 5: a unit; a 6: a coefficient; a 7: biasing; a 8: precision; a 9: maximum; a 10: minimum; a 11: a description is given.
Row data for the Cal _ Var variable is as follows:
CalSW _ HDCDC _ CANEN,0x40004120, UInt8,. star, 1,0, 255,0, HDCDC communication CAN enable
Specifically, a callable split () function is extracted, the control variable line data is used and separated; calling a trim () function to remove the spaces at the two ends of each separation field; the processed separate fields are written into the information columns of the variable address allocation table, and the corresponding relationship between the separate fields of the Cal _ Var variable and the variable address allocation table can be referred to in fig. 4. The expression of the Cal _ Var variable in the variable address allocation table includes a 1: a control variable name; a 2: a control variable address; a 3: a data type; a 4: a unit; a 5: a coefficient; a 6: biasing; a 7: precision; a 8: maximum; a 9: minimum; a 10: a description is given.
The row data for the LikeArr _ Var variable is as follows:
SGL _ AppSVT _ Crv,0x40024100,60,0, switch variables corresponding to hardware channels
The specific extraction can also call a split () function, use the control variable line data and separate the control variable line data; calling a trim () function to remove the spaces at the two ends of each separation field; the processed separate fields are written into the information columns of the variable address allocation table, and the corresponding relationship between the separate fields of the LikeArr _ Var variable and the variable address allocation table can be referred to fig. 5. The expression of the LikeArr _ Var variable in the variable address allocation table includes a 1: a control variable name; a 2: a control variable address; a 3: the number of bytes; a 4: whether it is a date; a 5: a description is given.
Likewise, the expression of the CalCurve _ Var variable in the variable address assignment table includes a 1: a control variable name; a 2: a control variable address; a 3: the number of elements; a 4: a data type; a 5: a unit; a 6: a coefficient; a 7: biasing; a 8: precision; a 9: maximum; a 10: minimum; a 11: a description is given. The expression of the CalMap _ Var variable in the variable address allocation table includes a 1: a control variable name; a 2: a control variable address; a 3: the number of elements; a 4: a data type; a 5: a unit; a 6: a coefficient; a 7: biasing; a 8: precision; a 9: maximum; a 10: minimum; a 11: a description is given. See fig. 6-7, respectively.
Please refer to fig. 8 for a process of extracting the target control variable from the historical variable address file to the variable address allocation table. Opening a historical variable address file, positioning the position of a target control variable according to the classification of the target control variable, reading data line by line in a classification section, correspondingly extracting variable information, writing the variable information into a variable address allocation table, and storing the variable address allocation table after the variable information in the classification section is written; judging whether the extraction of the variable information is finished or not, if not, continuing to read and write; if yes, judging whether the classified target control variables are completely written, and if yes, finishing the extraction of the control variable information; if not, the position of another type of target control variable is positioned, and reading and writing are continued until all the classified target control variables are written into the variable address allocation table.
In a specific embodiment, the obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:
extracting the corresponding distribution address in the variable mapping file according to the first variable information of the target control variable; and generating the variable address allocation table according to the target control variable and the allocation address.
Specifically, the corresponding allocated address in the variable mapping file is extracted, and the corresponding search can be performed through first variable information of the target control variable, where the first variable information may be a variable name, and of course, the first variable information may also be searched through a corresponding sequence number, and the accurate search can be performed through other information representing uniqueness of the target control variable. Referring to fig. 9, in the process of extracting the allocated address, a variable address allocation table is opened, the target control variable is sequentially extracted, a variable mapping file is opened, the allocated address of the target control variable is located according to the variable name of the target control variable, the allocated address is correspondingly extracted, and the allocated address is written into the variable address allocation table; and judging whether the extraction of the allocated address is finished, if not, sequentially continuing the extraction, and if so, finishing the extraction of the allocated address. After the extraction of the allocated address is finished, the variable information of the target control variable in the variable address allocation table is completely acquired.
In an optional implementation manner, the obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:
obtaining a historical variable address allocation table; obtaining an updating result of the historical variable address allocation table according to the variable mapping file and the target control variable; and obtaining the variable address allocation table according to the updating result.
Specifically, in the process of repeatedly maintaining the target control variable, the target control variable may be directly added, deleted or modified in the variable address allocation table, and after the maintenance is completed, the variable address allocation table may extract a corresponding allocation address in the variable mapping file through the target control variable, so as to obtain an updated variable address allocation table.
In the process of maintaining and updating the target control variable, partial updating may be involved, and the updated part may be confused with the non-updated part, so that a debugging person cannot distinguish whether updating is performed in the updating process, and the updating process is disordered.
In a specific embodiment, before obtaining the variable address allocation table according to the update result, the method further includes:
and marking according to the updated record of the target control variable.
Specifically, an information field may be created in the variable address allocation table, and a corresponding flag may be input in the information field to indicate whether the target control variable is updated and maintained.
When the method is applied to maintenance of the hydrogen fuel electric system, whether the current control variable is updated or not can be described through a binary system, wherein 1 represents that the control variable is updated in an adding, modifying or deleting mode, and 0 represents that the control variable is not updated in an adding, modifying or deleting mode, so that maintenance personnel can clearly identify the updating state of the target control variable, and disorder in the maintenance process is reduced.
The specific format expression of the variable address allocation table can be seen in fig. 10, and the information columns of the variable address allocation table include variable name, variable classification, variable mark, variable address, element number, data type, bit mask, unit, coefficient, offset, precision, maximum, minimum, byte number, date and description.
In an optional embodiment, the extracting, according to the first variable information of the target control variable, the corresponding allocated address in the variable mapping file includes:
acquiring the first variable information; obtaining the position of the target control variable between lines of the variable mapping file according to the first variable information; and extracting the distribution address according to the position between the lines.
Specifically, after the target control variable is obtained, the variable information having uniqueness, such as a variable name or a corresponding serial number, may be correspondingly searched in the variable mapping file, and then the assigned address of the target control variable is correspondingly extracted, and after the assigned address is extracted, the variable information of the target control variable is completely obtained, and then the variable address assignment table may be created or updated. The method has the advantages of high efficiency of obtaining the variable address allocation table, small workload and perfect obtained variable information. The variable address allocation table is obtained, and the process proceeds to step S14.
And S14, obtaining a variable address file according to the variable address allocation table.
Specifically, the variable address allocation table includes variable information of the target control variable, and the variable address file may be generated according to an expression format of the target control variable in the variable address file based on the variable information. Of course, the variable address file in the last period may also be updated and overwritten to obtain a new variable address file.
When the method is applied to a hydrogen fuel electrical system, referring to fig. 11, a variable address allocation table is opened, variable information of a target control variable is extracted, tb7 statements of the control variable are constructed, corresponding fields are extracted one by one, whether construction is finished is judged, and if not, a tb7 statement is continuously constructed; if yes, writing the classification section according to the expression mode of the tb7 statement; judging whether the extraction is finished or not, if not, continuously extracting variable information; if yes, generating a variable address file. The sorted target control variables are in the variable address file, in the format expressed in the tb7 statement, see FIG. 12.
It can be understood that the expression manner of the target control variable in the variable address file may also be other statements, and in a specific embodiment, the obtaining the variable address file according to the variable address allocation table includes:
acquiring second variable information of the variable address allocation table; and constructing a control variable statement to the variable address file according to the second variable information, wherein the control variable statement is an expression mode of the target control variable in the variable address file.
Specifically, the second variable information may be partial variable information of the target control variable in the variable address allocation table, or may be all variable information, and may be expressed in the variable address file according to the actual application requirement.
It should be noted that, in the application to the hydrogen fuel electrical system, the variable address file expressed by the tb7 statement can support HIL test and bench test, and during actual observation and calibration, the variable information of the variable address allocation table needs to be written back to the variable management file, so that the information of the variable management file, the variable address file and the variable mapping file are consistent. When the variable information is written back to the variable management file, the information column marking the target control variable in the variable address allocation table is updated to be all maintained, i.e. 1 is reset to 0, so that the target control variable is conveniently maintained in the next debugging period.
Based on the same inventive concept as the generation method, an embodiment of the present invention further provides a generation apparatus for a variable address file, referring to fig. 13, where the generation apparatus includes:
a first obtaining module 301, configured to obtain a variable mapping file, where the variable mapping file includes an assigned address of at least one control variable;
a second obtaining module 302, configured to obtain a target control variable, where the target control variable is a control variable to be updated;
a first obtaining module 303, configured to obtain a variable address allocation table according to the variable mapping file and the target control variable, where the variable address allocation table at least includes the target control variable and the corresponding allocation address;
a second obtaining module 304, configured to obtain a variable address file according to the variable address allocation table.
In an optional embodiment, the second obtaining module includes:
the first obtaining submodule is used for obtaining a historical variable address file;
and the first obtaining submodule is used for obtaining the target control variable according to the control variable in the historical variable address file.
In an alternative embodiment, the first obtaining sub-module includes:
a first obtaining unit configured to obtain a variable classification of the control variable;
the determining unit is used for determining the extraction mode of the target control variable according to the variable classification;
and the first extraction unit is used for extracting the target control variable in the historical variable address file according to the extraction mode.
In an alternative embodiment, the first obtaining module includes:
the extraction submodule is used for extracting the corresponding distribution address in the variable mapping file according to the first variable information of the target control variable;
and the generation submodule is used for generating the variable address allocation table according to the target control variable and the allocation address.
In an alternative embodiment, the first obtaining module includes:
the second acquisition submodule is used for acquiring a historical variable address allocation table;
the second obtaining submodule is used for obtaining an updating result of the historical variable address allocation table according to the variable mapping file and the target control variable;
and the third obtaining submodule is used for obtaining the variable address allocation table according to the updating result.
In an alternative embodiment, the extraction sub-module includes:
a second obtaining unit configured to obtain the first variable information;
a second obtaining unit, configured to obtain, according to the first variable information, an inter-row position of the target control variable in the variable mapping file;
and the second extraction unit is used for extracting the distribution address according to the position between the lines.
In an alternative embodiment, the second obtaining module includes:
the third obtaining submodule is used for obtaining second variable information of the variable address allocation table;
and the construction submodule constructs a control variable statement to the variable address file according to the second variable information, wherein the control variable statement is an expression mode of the target control variable in the variable address file.
Based on the same inventive concept as the generation method, an embodiment of the present invention further provides an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of any of the methods of generating.
Based on the same inventive concept as the generation method, the embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement the steps of any one of the generation methods.
The technical scheme provided by the embodiment of the invention at least has the following technical effects or advantages:
the target control variables needing to be added, modified or deleted are maintained through the variable address allocation table, and then the allocation addresses in the variable mapping file are correspondingly obtained, so that the corresponding information of the target control variables is obtained perfectly, the variable address file is obtained, the maintenance mode of the target control variables is simpler and more visual, the workload is small, and the maintenance efficiency of the target control variables is improved; the dependency on the position order of the target control variables in the control variable management file is reduced.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (modules, systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for generating a variable address file is characterized by comprising the following steps:
acquiring a variable mapping file, wherein the variable mapping file comprises an allocation address of at least one control variable;
acquiring a target control variable, wherein the target control variable is a control variable to be updated;
obtaining a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least comprises the target control variable and the corresponding allocation address;
and obtaining a variable address file according to the variable address allocation table.
2. The method for generating the variable address file according to claim 1, wherein the obtaining the target control variable includes:
obtaining a historical variable address file;
and obtaining the target control variable according to the control variable in the historical variable address file.
3. The method for generating the variable address file according to claim 2, wherein the obtaining the target control variable according to the control variable in the historical variable address file includes:
obtaining a variable classification of the control variable;
determining an extraction mode of the target control variable according to the variable classification;
and extracting the target control variable in the historical variable address file according to the extraction mode.
4. The method for generating a variable address file according to claim 1, wherein obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:
extracting the corresponding distribution address in the variable mapping file according to the first variable information of the target control variable;
and generating the variable address allocation table according to the target control variable and the allocation address.
5. The method for generating a variable address file according to claim 1, wherein obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:
obtaining a historical variable address allocation table;
obtaining an updating result of the historical variable address allocation table according to the variable mapping file and the target control variable;
and obtaining the variable address allocation table according to the updating result.
6. The method for generating a variable address file according to claim 4, wherein the extracting the corresponding allocated address in the variable mapping file according to the first variable information of the target control variable includes:
acquiring the first variable information;
obtaining the position of the target control variable between lines of the variable mapping file according to the first variable information;
and extracting the distribution address according to the position between the lines.
7. The method for generating a variable address file according to claim 1, wherein the obtaining a variable address file according to the variable address allocation table includes:
acquiring second variable information of the variable address allocation table;
and constructing a control variable statement to the variable address file according to the second variable information, wherein the control variable statement is an expression mode of the target control variable in the variable address file.
8. An apparatus for generating a variable address file, comprising:
the device comprises a first acquisition module, a second acquisition module and a control module, wherein the first acquisition module is used for acquiring a variable mapping file, and the variable mapping file comprises an allocation address of at least one control variable;
the second acquisition module is used for acquiring a target control variable, wherein the target control variable is a control variable to be updated;
a first obtaining module, configured to obtain a variable address allocation table according to the variable mapping file and the target control variable, where the variable address allocation table at least includes the target control variable and the corresponding allocation address;
and the second obtaining module is used for obtaining the variable address file according to the variable address allocation table.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to carry out the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, is adapted to carry out the steps of the method of any one of claims 1 to 7.
CN202111245423.6A 2021-10-26 2021-10-26 Method and device for generating variable address file Pending CN114185814A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111245423.6A CN114185814A (en) 2021-10-26 2021-10-26 Method and device for generating variable address file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111245423.6A CN114185814A (en) 2021-10-26 2021-10-26 Method and device for generating variable address file

Publications (1)

Publication Number Publication Date
CN114185814A true CN114185814A (en) 2022-03-15

Family

ID=80601454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111245423.6A Pending CN114185814A (en) 2021-10-26 2021-10-26 Method and device for generating variable address file

Country Status (1)

Country Link
CN (1) CN114185814A (en)

Similar Documents

Publication Publication Date Title
CN107665171B (en) Automatic regression testing method and device
CN102541521B (en) Automatic operating instruction generating device based on structured query language and method
CN101504672B (en) Method and system for dynamically configuring physical data table
US5594892A (en) Method for automated software application testing
CN110968509B (en) Method and system for batch customizing of variables
CN105808437A (en) Automation testing method and system based on test case data table
CN110019111A (en) Data processing method, device, storage medium and processor
CN113177090A (en) Data processing method and device
CN104714957A (en) List structure changing method and device
CN111061733B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN111190814A (en) Software test case generation method and device, storage medium and terminal
CN115563924A (en) Integrated circuit layout process information transplanting method, device, medium and terminal
CN107766519B (en) Method for visually configuring data structure
CN113535258A (en) Pattern file loading method and system
CN110502735B (en) Method and system for quickly manufacturing universal process file of electronic equipment
CN114185814A (en) Method and device for generating variable address file
CN102043853A (en) Method and device for updating stored data
CN114818994B (en) Cross-business map fusion method based on multi-source heterogeneous power data
CN111444163A (en) Method and device for map data management and electronic map rollback
CN115758950A (en) Automatic drawing method, device and computer readable storage medium
CN110597728A (en) Method, device and system for constructing test data
CN110147313A (en) A kind of log-output method and device
CN113157551B (en) ROS-oriented differential fuzzy test method
CN114936054A (en) Method and device for generating debugging process file of vehicle and rail vehicle
CN105718373A (en) Code coverage rate generating method meeting DO-178C

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