Method and device for generating variable address file

By generating variable address allocation tables and files, the maintenance difficulties caused by frequent updates of control variable address allocation are solved, and more efficient control variable management is achieved, especially in the hydrogen-fuel power control system, the maintenance process of control variables is simplified.

CN114185814BActive Publication Date: 2025-08-26DONGFENG MOTOR GRP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111245423.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2025-08-26
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

In the prior art, the control variable address allocation files need to be updated frequently, resulting in large workloads of manual maintenance, prone to errors and difficulty in correcting errors. Especially in the hydrogen-fuel power control system, the number of control variables is huge and the changes are frequent.

Method used

By obtaining the variable mapping file and the target control variable, a variable address allocation table is generated, including the target control variable and its allocation address, and then a variable address file is constructed to simplify the maintenance process of the control variable.

Benefits of technology

It improves the maintenance efficiency of control variables, reduces the dependence on the position order of control variables, makes the maintenance method of control variables simpler and more intuitive, and reduces the workload and error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114185814B_ABST
    Figure CN114185814B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for generating a variable address file. The method comprises the following steps: obtaining a variable mapping file, the variable mapping file including the assigned address of at least one control variable; obtaining a target control variable, the target control variable being the control variable to be updated; obtaining a variable address allocation table based on the variable mapping file and the target control variable, wherein the variable address allocation table includes at least the target control variable and the corresponding assigned address; and obtaining a variable address file based on the variable address allocation table. The generation method of the present invention simplifies and intuitively maintains the target control variable, reduces workload, improves target control variable maintenance efficiency, and reduces reliance on the positional order of the target control variables in the control variable management file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software technology, and in particular to a method and device for generating a variable address file. Background Art

[0002] Control variables in software are defined to implement functional algorithms. Each control variable is assigned a unique address in memory. Typically, a software system defines a large number of control variables. For example, a hydrogen fuel cell control system for an automobile can have thousands of control variables. During software debugging, each compilation involves adding and modifying control variables, which in turn involves reallocating control variable addresses. In particular, every time a control variable is added, deleted, or modified, the corresponding address of the control variable is reallocated. Due to the changes in control variables, it is generally difficult to append an address to the end of an existing control variable. Consequently, each control variable address allocation may result in different address values ​​for the same control variable, requiring the creation of a new control variable address allocation file.

[0003] Currently, to minimize changes to the compiled file for control variable address allocation when adding control variables, the newly added control variables are typically manually appended to the end of the control variable management file. Modifying control variables requires manually locating the control variables and then modifying their addresses and other information. Maintaining control variables in this manner, resulting in a control variable address file, is labor-intensive, error-prone, and difficult to correct. Summary of the Invention

[0004] In view of the above technical problems, the present invention proposes a method and device for generating a variable address file to maintain control variables in a simpler and more intuitive manner.

[0005] The embodiments of the present invention provide the following solutions:

[0006] In a first aspect, an embodiment of the present invention provides a method for generating a variable address file, comprising the following steps:

[0007] Obtaining a variable mapping file, wherein the variable mapping file includes an allocation address of at least one control variable;

[0008] Obtaining a target control variable, where the target control variable is a control variable to be updated;

[0009] 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 includes the target control variable and the corresponding allocation address;

[0010] According to the variable address allocation table, a variable address file is obtained.

[0011] In an optional embodiment, obtaining the target control variable includes:

[0012] Get the historical variable address file;

[0013] The target control variable is obtained according to the control variable in the historical variable address file.

[0014] In an optional embodiment, obtaining the target control variable according to the control variable in the historical variable address file includes:

[0015] obtaining a variable classification of the control variable;

[0016] Determining a method for extracting the target control variable according to the variable classification;

[0017] According to the extraction method, the target control variable in the historical variable address file is extracted.

[0018] In an optional embodiment, obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:

[0019] Extracting the corresponding allocation address in the variable mapping file according to the first variable information of the target control variable;

[0020] The variable address allocation table is generated according to the target control variable and the allocation address.

[0021] In an optional embodiment, obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:

[0022] Get the historical variable address allocation table;

[0023] Obtaining an update result of the historical variable address allocation table according to the variable mapping file and the target control variable;

[0024] The variable address allocation table is obtained according to the update result.

[0025] In an optional embodiment, extracting the corresponding allocation address in the variable mapping file according to the first variable information of the target control variable includes:

[0026] Obtaining the first variable information;

[0027] According to the first variable information, obtaining the target control variable is located in an inter-row position of the variable mapping file;

[0028] The allocation address is extracted according to the inter-row position.

[0029] In an optional embodiment, obtaining a variable address file according to the variable address allocation table includes:

[0030] Obtaining second variable information of the variable address allocation table;

[0031] According to the second variable information, a control variable statement is constructed and added to the variable address file, wherein the control variable statement is an expression of the target control variable in the variable address file.

[0032] In a second aspect, an embodiment of the present invention further provides a device for generating a variable address file, comprising:

[0033] A first acquisition module is configured to acquire a variable mapping file, wherein the variable mapping file includes an allocation address of at least one control variable;

[0034] A second acquisition module is used to acquire a target control variable, where the target control variable is a control variable to be updated;

[0035] A first obtaining module is configured to obtain a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least includes the target control variable and the corresponding allocation address;

[0036] The second obtaining module is used to obtain a variable address file according to the variable address allocation table.

[0037] In an optional embodiment, the second acquisition module includes:

[0038] The first acquisition submodule is used to obtain the historical variable address file;

[0039] The first obtaining submodule is configured to obtain the target control variable according to the control variable in the historical variable address file.

[0040] In an optional embodiment, the first obtaining submodule includes:

[0041] a first acquiring unit, configured to acquire a variable classification of the control variable;

[0042] a determination unit, configured to determine a method for extracting the target control variable according to the variable classification;

[0043] The first extraction unit is configured to extract the target control variable from the historical variable address file according to the extraction method.

[0044] In an optional embodiment, the first obtaining module includes:

[0045] an extraction submodule, configured to extract the corresponding allocation address in the variable mapping file according to the first variable information of the target control variable;

[0046] A generating submodule is used to generate the variable address allocation table according to the target control variable and the allocation address.

[0047] In an optional embodiment, the first obtaining module includes:

[0048] The second acquisition submodule is used to obtain the historical variable address allocation table;

[0049] A second obtaining submodule, configured to obtain an update result of the historical variable address allocation table according to the variable mapping file and the target control variable;

[0050] The third obtaining submodule is configured to obtain the variable address allocation table according to the update result.

[0051] In an optional embodiment, the extraction submodule includes:

[0052] a second acquiring unit, configured to acquire the first variable information;

[0053] a second obtaining unit, configured to obtain, based on the first variable information, a position between lines of the target control variable in the variable mapping file;

[0054] The second extraction unit is configured to extract the allocation address according to the inter-row position.

[0055] In an optional embodiment, the second obtaining module includes:

[0056] A third acquisition submodule is used to obtain second variable information of the variable address allocation table;

[0057] 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 the expression of the target control variable in the variable address file.

[0058] In a third aspect, an embodiment of the present invention further provides an electronic device, including:

[0059] Memory for storing computer programs;

[0060] A processor is configured to execute the computer program to implement the steps of any one of the methods described in the first aspect.

[0061] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of any one of the methods described in the first aspect.

[0062] Compared with the prior art, the method and device for generating a variable address file provided by the present invention have the following advantages:

[0063] The generation method of the present invention maintains the target control variables that need to be added, modified or deleted through the variable address allocation table, and then obtains the allocation addresses in the variable mapping file accordingly, so as to complete the corresponding information of the target control variables and then obtain the variable address file. The maintenance method of the target control variables is simpler and more intuitive, with less workload, and the maintenance efficiency of the target control variables is improved; and the dependence on the position order of the target control variables in the control variable management file is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0065] Figure 1 A flow chart of a method for generating a variable address file provided by an embodiment of the present invention;

[0066] Figure 2 A schematic diagram of the format of a variable mapping file provided in an embodiment of the present invention;

[0067] Figure 3 A schematic diagram of the format of the Mon_Var variable expression provided in an embodiment of the present invention;

[0068] Figure 4 A schematic diagram of the format of the Cal_Var variable expression provided in an embodiment of the present invention;

[0069] Figure 5 A schematic diagram of the format of the LikeArr_Var variable expression provided in an embodiment of the present invention;

[0070] Figure 6 A schematic diagram of the format of the CalCurve_Var variable expression provided in an embodiment of the present invention;

[0071] Figure 7 A schematic diagram of the format of the CalMap_Var variable expression provided in an embodiment of the present invention;

[0072] Figure 8A flow chart of variable information extraction of target control variables provided by an embodiment of the present invention;

[0073] Figure 9 A flowchart of extracting target control variable allocation addresses provided by an embodiment of the present invention;

[0074] Figure 10 A schematic diagram of the format of a variable address allocation table provided in an embodiment of the present invention;

[0075] Figure 11 A flow chart for generating a variable address file provided in an embodiment of the present invention;

[0076] Figure 12 A schematic diagram of the format of target control variables in the tb7 file provided in an embodiment of the present invention;

[0077] Figure 13 A schematic structural diagram of a maintenance device for controlling variables provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0078] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field fall within the scope of protection of the embodiments of the present invention.

[0079] A variable address file generation method according to an embodiment of the present invention can be applied to debugging control systems that include control variables. This embodiment will be specifically described using a hydrogen fuel cell system as an example. Hydrogen fuel cells, with their advantages of high efficiency, zero emissions, short refueling times, and long driving range, have become a hot area of ​​research both domestically and internationally. Many key components of a hydrogen fuel cell system are coordinated and controlled via a CAN communication network. The effectiveness of the hydrogen fuel cell system's advantages and the achievement of key performance indicators are closely linked to the control functions of the hydrogen fuel cell controller. The control system of a hydrogen fuel cell controller is comprised of three components: upper-layer application control, lower-layer driver control, and integrated control combining the upper and lower layers, providing centralized control of the entire control system's hardware and software. Hydrogen fuel cell system control utilizes CAN communication to transmit message signals, enabling upper-layer applications to schedule lower-layer drivers. Message signal transmission is performed in the form of control variables. Therefore, during debugging and operational operation, hydrogen fuel cell system control involves the interaction of numerous control variables, which require addresses to be allocated in memory. During the debugging process, target control variables in the control variables, such as observation variables, calibration variables, etc., need to be maintained multiple times to be added, deleted or modified, which involves the maintenance problem of control variables.

[0080] Observation and calibration of hydrogen fuel cell systems can be performed using CANOE or Inca software. Variable address files are a2l files that comply with the ASPS2 standard. HECAL software can also be used for calibration and observation. The variable address files correspond to the tb7 file format. The data source for creating tb7 files comes from the variable mapping file (also known as the map file), a process file generated after automatic code generation from the hydrogen fuel cell system control Simulink model, as well as the variable definition file used in the control system's upper and lower layer integration. The variable definition file commands used in the control system's upper and lower layer integration are closely related to the control system's upper and lower layer integration environment. In the embodiment of the present invention, taking the S32 Design Studio for PowerArchitecture control system upper and lower layer integration environment as an example, the variable definition files (or header files) involved in the control system upper and lower layer integration are CalHW_Var.h, CalSW_Var.h, GlobalHW_Var.h, GlobalSW_Var.h, etc. Among them, CalHW_Var.h is a calibration variable file for hardware, CalSW_Var.h is a calibration variable file for software, GlobalHW_Var.h is a hardware observation global variable file, and GlobalSW_Var.h is a software observation global variable file. The following will specifically explain how to solve the problem of maintaining control variables.

[0081] See also Figure 1 , Figure 1 A flow chart of a method for generating a variable address file provided in an embodiment of the present invention includes the following steps:

[0082] S11. Obtain a variable mapping file, where the variable mapping file includes an allocation address of at least one control variable.

[0083] Specifically, to obtain the variable mapping file, you can obtain the variable management file in the integrated environment. The variable management file includes all the control variables. According to the variable name of the control variable (or control variable ID), compile and generate the variable mapping file. Figure 2 , Figure 2 The format diagram of the variable mapping file includes the variable names of the control variables and their corresponding allocation addresses, wherein the allocation addresses are stored in hexadecimal format. After obtaining the variable mapping file, step S12 is entered.

[0084] S12. Obtain a target control variable, where the target control variable is a control variable to be updated.

[0085] Specifically, the target control variable can be the portion of the control variables to be modified or deleted, or it can be a newly added control variable. Based on the control system's debugging requirements, the target control variable can be determined from the control variables. In hydrogen fuel cell systems, the target control variable can be defined as the control variable that needs to be observed and calibrated.

[0086] The target control variable may have a large cardinality. The process of identifying the target control variable from all the control variables is cumbersome and inefficient. The target control variable needs to be obtained in a more efficient way.

[0087] In a specific embodiment, obtaining the target control variable includes:

[0088] Obtain a historical variable address file; and obtain the target control variable according to the control variable in the historical variable address file.

[0089] Specifically, control system debugging involves repeatedly maintaining target control variables. These maintained control variables may be fixed. Therefore, the target control variables can be retrieved from a historical variable address file, which contains the variable address files from the previous debugging cycle. The target control variable information in the historical variable address file may include attributes such as the variable name, variable address, data type, and description. However, the variable addresses in the historical variable address file are the addresses assigned during the previous debugging cycle and may vary, so they should not be retrieved.

[0090] In actual applications, different target control variables may contain different variable information, resulting in multiple types of target control variables. Different types may also be expressed differently in the variable address file. If one method is used to express them, the variable information of the target control variable may be missing or confused, resulting in inability to apply.

[0091] In a specific implementation, obtaining the target control variable according to the control variable in the historical variable address file includes:

[0092] Obtaining a variable classification of the control variable; determining an extraction method for the target control variable according to the variable classification; and extracting the target control variable from the historical variable address file according to the extraction method.

[0093] Specifically, the variable classification of the target control variable can be defined based on the classification criteria defined by actual application requirements, or based on the expression method in the variable address file. Of course, classification can also be based on data type or precision. Different variable classifications may contain different variable information in the historical variable address file. Therefore, an extraction method can be determined based on the variable classification, and the variable information of the target control variable in the historical variable address file can be extracted according to the corresponding extraction method. After obtaining the target control variable, the process proceeds to step S13.

[0094] S13. Obtain a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least includes the target control variable and the corresponding allocation address.

[0095] Specifically, after determining the target control variable, the allocation address corresponding to the target variable file can be extracted through the variable mapping file based on the variable information of the target control variable, which includes the variable name, data type and description, and the variable information can be improved to create a variable address allocation table.

[0096] In the specific application of hydrogen fuel cell systems, the classification of target control variables includes Mon_Var variables, Cal_Var variables, LikeArr_Var variables, CalCurve_Var variables and CalMap_Var variables. For the expression format of each target control variable, please refer to Figure 3-7 , the figure shows the expression format of each category of target control variables.

[0097] The row data of the Mon_Var variable is as follows:

[0098] SGL_AD_01,0x400377f8,UInt16,0,*,1,0,0,65535,0,BSW collects AD variable 01 (A08)

[0099] To extract the data, call the split() function and separate the row data of the target control variable with ","; call the trim() function to remove the spaces at both ends of each separated field; write the processed separated fields into the information columns of the variable address allocation table respectively. The corresponding relationship between the separated fields of the Mon_Var variable and the variable address allocation table can be found in Figure 3 The expression of Mon_Var variable in the variable address allocation table includes a1: control variable name; a2: control variable address; a3: data type; a4: bit mask; a5: unit; a6: coefficient; a7: bias; a8: precision; a9: maximum; a10: minimum; a11: description.

[0100] The row data of the Cal_Var variable is as follows:

[0101] CalSW_HDCDC_CANEN,0x40004120,UInt8,*,1,0,0,255,0,HDCDC communication CAN enable

[0102] To extract the data, call the split() function and separate the control variable row data with ","; call the trim() function to remove the spaces at both ends of each separated field; write the processed separated fields into the information columns of the variable address allocation table. The corresponding relationship between the separated fields of the Cal_Var variable and the variable address allocation table can be found in Figure 4 The expression of Cal_Var variable in the variable address allocation table includes a1: control variable name; a2: control variable address; a3: data type; a4: unit; a5: coefficient; a6: bias; a7: precision; a8: maximum; a9: minimum; a10: description.

[0103] The row data of the LikeArr_Var variable is as follows:

[0104] SGL_AppSWT_Crv,0x40024100,60,0,Switch variables correspond to hardware channels

[0105] The specific extraction can also call the split() function to separate the control variable row data with ","; call the trim() function to remove the spaces at both ends of each separated field; write the processed separated fields into the information columns of the variable address allocation table respectively. The corresponding relationship between the separated fields of the LikeArr_Var variable and the variable address allocation table can be found in Figure 5 The expression of the LikeArr_Var variable in the variable address allocation table includes a1: control variable name; a2: control variable address; a3: number of bytes; a4: whether it is a date; and a5: description.

[0106] Similarly, the variable CalCurve_Var variable is represented in the variable address allocation table as follows: a1: control variable name; a2: control variable address; a3: number of elements; a4: data type; a5: unit; a6: coefficient; a7: bias; a8: precision; a9: maximum; a10: minimum; a11: description. The variable CalMap_Var variable is represented in the variable address allocation table as follows: a1: control variable name; a2: control variable address; a3: number of elements; a4: data type; a5: unit; a6: coefficient; a7: bias; a8: precision; a9: maximum; a10: minimum; a11: description. Figure 6-7 .

[0107] For the process of extracting the target control variable from the historical variable address file to the variable address allocation table, please refer to Figure 8First, open the historical variable address file, locate the target control variable according to the classification of the target control variable, read the data line by line in the classification segment, extract the corresponding variable information, and write the variable information into the variable address allocation table. After the variable information in the classification segment is written, save the variable address allocation table; then determine whether the variable information extraction is completed. If not, continue reading and writing; if so, determine whether the target control variable of the classification is completely written. If so, the control variable information extraction is completed; if not, locate the position of another type of target control variable and continue reading and writing until the target control variables of all classifications are written into the variable address allocation table.

[0108] In a specific embodiment, obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:

[0109] According to the first variable information of the target control variable, the corresponding allocation address in the variable mapping file is extracted; and according to the target control variable and the allocation address, the variable address allocation table is generated.

[0110] Specifically, to extract the corresponding allocation address in the variable mapping file, you can search for the first variable information of the target control variable. The first variable information can be the variable name. Of course, you can also search for the corresponding serial number. You can use other information that represents the uniqueness of the target control variable to accurately search. Please refer to the extraction process of the allocation address. Figure 9 , open the variable address allocation table, extract the target control variables in sequence, then open the variable mapping file, locate the target control variable's allocation address according to the variable name of the target control variable, extract the corresponding allocation address, and write the allocation address to the variable address allocation table; determine whether the allocation address extraction is complete. If not, continue to extract the allocation address in sequence. If so, the allocation address extraction is complete. After the allocation address extraction is complete, the variable information of the target control variable in the variable address allocation table is completely obtained.

[0111] In an optional implementation, obtaining a variable address allocation table according to the variable mapping file and the target control variable includes:

[0112] Acquire a historical variable address allocation table; obtain an update result of the historical variable address allocation table according to the variable mapping file and the target control variable; and obtain the variable address allocation table according to the update result.

[0113] Specifically, during the repeated maintenance of the target control variable, the target control variable can be directly added, deleted or modified in the variable address allocation table. After the maintenance is completed, the variable address allocation table can extract the corresponding allocation address in the variable mapping file through the target control variable to obtain an updated variable address allocation table.

[0114] During the maintenance and update process of the target control variable, partial updates may be involved. The updated part may be confused with the unupdated part, making it impossible for the debugger to distinguish whether the update has been performed during the update process, thereby causing confusion in the update process.

[0115] In a specific implementation, before obtaining the variable address allocation table according to the update result, the method further includes:

[0116] Mark according to the update record of the target control variable.

[0117] Specifically, an information column may be created in the variable address allocation table, and a corresponding mark may be input in the information column to indicate whether the target control variable has been updated and maintained.

[0118] When applied to the maintenance of hydrogen fuel cell systems, the binary system can describe whether the current control variable has been updated. 1 indicates an update of addition, modification or deletion, and 0 indicates no update of addition, modification or deletion. This allows maintenance personnel to clearly identify the update status of the target control variable and reduce confusion during maintenance.

[0119] The specific format of the variable address allocation table can be found in Figure 10 ,The information columns of the variable address allocation table include variable name, ,variable category, variable tag, variable address, number of elements, data type, bit mask, unit, coefficient, bias, precision, maximum, minimum, number of bytes, whether it is a date and ,description.

[0120] In an optional embodiment, extracting the corresponding allocation address in the variable mapping file according to the first variable information of the target control variable includes:

[0121] The first variable information is obtained; based on the first variable information, the target control variable is located in an inter-line position of the variable mapping file; and based on the inter-line position, the allocation address is extracted.

[0122] Specifically, after obtaining the target control variable, the variable information having uniqueness according to the first variable information, such as the variable name or corresponding serial number, can be searched in the variable mapping file, and the allocation address of the target control variable can be correspondingly extracted. After extracting the allocation address, the variable information of the target control variable is completely obtained, and the variable address allocation table can be created or updated. This method of obtaining the variable address allocation table is highly efficient, requires little work, and obtains relatively complete variable information. After obtaining the variable address allocation table, step S14 is entered.

[0123] S14. Obtain a variable address file according to the variable address allocation table.

[0124] Specifically, the variable address allocation table includes variable information of the target control variable. Based on the variable information, a variable address file can be generated according to the expression format of the target control variable in the variable address file. Of course, the variable address file in the previous cycle can also be updated and overwritten to obtain a new variable address file.

[0125] When applied to hydrogen fuel cell systems, please refer to the specific process Figure 11 , open the variable address allocation table, extract the variable information of the target control variable, construct the tb7 statement of the control variable, extract the corresponding fields one by one, determine whether the construction is completed, if not, continue to construct the tb7 statement; if so, write the classification segment according to the expression of the tb7 statement; then determine whether the extraction is completed, if not, continue to extract the variable information; if so, generate the variable address file. The target control variable of the classification is in the variable address file, and the format expressed in the tb7 statement is shown in the following example. Figure 12 .

[0126] It is understandable that the target control variable may be expressed in other statements in the variable address file. In a specific embodiment, obtaining the variable address file according to the variable address allocation table includes:

[0127] Acquire second variable information of the variable address allocation table; construct a control variable statement to the variable address file according to the second variable information, wherein the control variable statement is the expression of the target control variable in the variable address file.

[0128] Specifically, the second variable information may be part of the variable information of the target control variable in the variable address allocation table, or may be all of the variable information, and can be expressed in the variable address file according to actual application requirements.

[0129] It should be noted that, when applied to hydrogen fuel cell systems, the variable address file expressed in the tb7 statement can support HIL testing and bench testing. During actual observation and calibration, the variable information in the variable address allocation table needs to be written back to the variable management file to ensure that the information in the variable management file, variable address file, and variable mapping file is 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 "all unmaintained", that is, reset from 1 to 0, to facilitate maintenance of the target control variable in the next debugging cycle.

[0130] Based on the same inventive concept as the generation method, the embodiment of the present invention also provides a device for generating a variable address file, see Figure 13 , the generating device includes:

[0131] A first acquisition module 301 is configured to acquire a variable mapping file, wherein the variable mapping file includes an allocation address of at least one control variable;

[0132] The second acquisition module 302 is used to acquire a target control variable, where the target control variable is the control variable to be updated;

[0133] A first obtaining module 303 is configured to obtain a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least includes the target control variable and the corresponding allocation address;

[0134] The second obtaining module 304 is configured to obtain a variable address file according to the variable address allocation table.

[0135] In an optional embodiment, the second acquisition module includes:

[0136] The first acquisition submodule is used to obtain the historical variable address file;

[0137] The first obtaining submodule is configured to obtain the target control variable according to the control variable in the historical variable address file.

[0138] In an optional embodiment, the first obtaining submodule includes:

[0139] a first acquiring unit, configured to acquire a variable classification of the control variable;

[0140] a determination unit, configured to determine a method for extracting the target control variable according to the variable classification;

[0141] The first extraction unit is configured to extract the target control variable from the historical variable address file according to the extraction method.

[0142] In an optional embodiment, the first obtaining module includes:

[0143] an extraction submodule, configured to extract the corresponding allocation address in the variable mapping file according to the first variable information of the target control variable;

[0144] A generating submodule is used to generate the variable address allocation table according to the target control variable and the allocation address.

[0145] In an optional embodiment, the first obtaining module includes:

[0146] The second acquisition submodule is used to obtain the historical variable address allocation table;

[0147] A second obtaining submodule, configured to obtain an update result of the historical variable address allocation table according to the variable mapping file and the target control variable;

[0148] The third obtaining submodule is configured to obtain the variable address allocation table according to the update result.

[0149] In an optional embodiment, the extraction submodule includes:

[0150] a second acquiring unit, configured to acquire the first variable information;

[0151] a second obtaining unit, configured to obtain, based on the first variable information, a position between lines of the target control variable in the variable mapping file;

[0152] The second extraction unit is configured to extract the allocation address according to the inter-row position.

[0153] In an optional embodiment, the second obtaining module includes:

[0154] A third acquisition submodule is used to obtain second variable information of the variable address allocation table;

[0155] 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 the expression of the target control variable in the variable address file.

[0156] Based on the same inventive concept as the generating method, an embodiment of the present invention further provides an electronic device, including:

[0157] Memory for storing computer programs;

[0158] A processor is configured to execute the computer program to implement the steps of any of the methods described in the generation method.

[0159] Based on the same inventive concept as the generation method, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which is used to implement the steps of any method described in the generation method when executed by a processor.

[0160] The technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:

[0161] The target control variables that need 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 obtained accordingly to complete the corresponding information of the target control variables, and then the variable address file is obtained. The maintenance method of the target control variables is simpler and more intuitive, with less workload, which improves the maintenance efficiency of the target control variables and reduces the dependence on the position order of the target control variables in the control variable management file.

[0162] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0163] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (modules, systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0164] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0165] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0166] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0167] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for generating a variable address file, characterized in that: The following steps are involved: Obtaining a variable mapping file, wherein the variable mapping file includes an allocation address of at least one control variable; Obtaining a target control variable, where 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 includes the target control variable and the corresponding allocation address; Obtaining a variable address file according to the variable address allocation table; The step of obtaining a variable address allocation table according to the variable mapping file and the target control variable includes: Extracting the corresponding allocation address in the variable mapping file according to the first variable information of the target control variable; generating the variable address allocation table according to the target control variable and the allocation address; The extracting the corresponding allocation address in the variable mapping file according to the first variable information of the target control variable includes: Obtaining the first variable information; According to the first variable information, obtaining the target control variable is located in an inter-row position of the variable mapping file; The allocation address is extracted according to the inter-row position.

2. The method for generating a variable address file according to claim 1, wherein: The obtaining of the target control variable includes: Get the historical variable address file; The target control variable is obtained according to the control variable in the historical variable address file.

3. The method for generating a variable address file according to claim 2, wherein: The step of 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 a method for extracting the target control variable according to the variable classification; According to the extraction method, the target control variable in the historical variable address file is extracted.

4. The method for generating a variable address file according to claim 1, wherein: The step of obtaining a variable address allocation table according to the variable mapping file and the target control variable includes: Get the historical variable address allocation table; Obtaining an update result of the historical variable address allocation table according to the variable mapping file and the target control variable; The variable address allocation table is obtained according to the update result.

5. The method for generating a variable address file according to claim 1, wherein: The step of obtaining a variable address file according to the variable address allocation table includes: Obtaining second variable information of the variable address allocation table; According to the second variable information, a control variable statement is constructed and added to the variable address file, wherein the control variable statement is an expression of the target control variable in the variable address file.

6. A device for generating a variable address file, characterized in that: include: A first acquisition module is configured to acquire a variable mapping file, wherein the variable mapping file includes an allocation address of at least one control variable; A second acquisition module is used to acquire a target control variable, where the target control variable is a control variable to be updated; A first obtaining module is configured to obtain a variable address allocation table according to the variable mapping file and the target control variable, wherein the variable address allocation table at least includes the target control variable and the corresponding allocation address; The first obtaining module is further used to obtain first variable information of the target control module; According to the first variable information, obtaining the target control variable is located in an inter-row position of the variable mapping file; extracting the allocation address according to the inter-row position; The variable address allocation table is generated according to the target control variable and the allocation address; and the second obtaining module is used to obtain a variable address file according to the variable address allocation table.

7. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data updating method and device

    CN106777393A

  • Control system, analysis method, and program

    WO2021019818A1