EEPROM variable management method and system

By building a list of managed EEPROM variables and generating standard compiled code, the problem of inaccurate EEPROM variable addresses when updating automotive ECU programs is solved, and the accurate storage and retention of variable data is achieved.

CN116126229BActive Publication Date: 2025-04-04E-QUALITY INTELLIGENT TECHNOLOGY WUXI CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211607315.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2025-04-04
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

In the prior art, when the program updates of automotive ECUs, the accuracy of the EEPROM variable address cannot be guaranteed, resulting in the loss of variable data or incorrect storage when powered off.

Method used

By building a list of EEPROM variables for managing EEPROM, standard compiled code is generated, and variables are defined in source files and header files according to the numbering order and data type of the variables, ensuring that the address of variable information is fixed when stored in EEPROM.

Benefits of technology

It realizes the accuracy of the EEPROM variable address when the program is updated, ensures that the variable data is retained correctly when powered down, and avoids the remediation of EEPROM storage problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126229B_ABST
    Figure CN116126229B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for managing EEPROM variables. The method comprises: constructing a list for managing EEPROM variables, wherein the list comprises a plurality of pages for storing variable information, and a page corresponds to a partition corresponding to the EEPROM; when storing the variable information in the list in the EEPROM, reading the constructed list, and generating a standard compilation code according to the variable information on the page in the list, wherein the numbering sequence and data type of the variables are respectively defined in the source file and declared in the header file; according to the source file and the header file in the standard compilation code, the variables in the list are stored in the partition corresponding to the EEPROM. The present invention can ensure the accuracy of the EEROM variable address when the program is updated, ensure that the data corresponding to the variable can be accurately retained, and facilitate calling in the new program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a management method and system, in particular to a management method and system of EEPROM variables. Background Art

[0002] There are various types of variables in the memory of the car ECU (Electronic Control Unit), and most of the variables will lose data when the ECU is powered off. However, in actual work, there are important variables that need to accompany the entire life cycle of the ECU, that is, the variable information must always exist; for example: the vehicle's VIN code, anti-theft key, fault information, etc. The information of these variables needs to be stored in the EEPROM when the power is off, and it is necessary to ensure that the information of these variables is stored correctly.

[0003] At present, when managing variable information, after the new program has been generated, it is compared and checked with the old program in the ECU, that is, technical operations can only be performed after the new program is generated, which is not convenient for controlling the program quality in advance. Therefore, when there is a problem with the current variable management, most of the remediation is done after the EEROM storage problem occurs, and it is impossible to ensure that the address and size of the variable in the EEPROM are allocated in a fixed position when the program is updated. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide an EEPROM variable management method and system, which can ensure the accuracy of the EEROM variable address when the program is updated, ensure that the data corresponding to the variable can be accurately retained, and facilitate calling in the new program.

[0005] According to the technical solution provided by the present invention, a method for managing EEPROM variables includes:

[0006] Constructing a list for managing EEPROM variables, wherein the list includes a plurality of pages for storing variable information, and a page corresponds to a partition of the EEPROM;

[0007] When storing the variable information in the list in the EEPROM, the list constructed above is read, and a standard compilation code is generated according to the variable information of the page in the list. In the standard compilation code, the variables are defined in the source file and declared in the header file according to the numbering sequence and data type of the variables;

[0008] Compile the source and header files in the code according to the above standards, and store the variables in the list in the corresponding partition of the EEPROM.

[0009] The format of the pages in the list is the same, where

[0010] For any page, the column header of the page includes variable number, variable name, variable meaning, variable data type, variable dimension, variable default value and / or variable unit;

[0011] The variable numbered 1 in the page is configured as a fixed version information variable EE_Core_Ver;

[0012] When the state of the variable information in the page is updated, the variable default value corresponding to the version information variable EE_Core_Ver is accumulated by a count value.

[0013] Update the variable information in the page, including writing the variable information in the page of the newly constructed list and / or changing the corresponding variable information of the page where the variable information has been written;

[0014] The accumulated count value is 1.

[0015] For the variable information stored in any page, the storage capacity required for storing in the EEPROM is calculated based on the stored variable information;

[0016] When the determined occupied storage capacity exceeds the partition capacity of the EEPROM corresponding to the page, an alarm prompt indicating that the storage capacity is exceeded is output.

[0017] Provides an alarm prompt when the output storage capacity is exceeded, including marking the page with a prompt.

[0018] When generating a standard compiled code, the standard compiled code includes C code, wherein:

[0019] Delimiting the Flash partition address in the link file, and segmenting the generated standard compiled code according to the link rule so that the variable information of the page is located in the Flash partition;

[0020] The order of variables in the standard compiled code generated by script configuration is consistent with the order of variables in the page, so that the address of the variable information in the ECU remains fixed after compilation and linking.

[0021] For the version information variable EE_Core_Ver stored in the EEPROM partition, when the version information variable EE_Core_Ver stored in the EEPROM partition is inconsistent with the version information variable EE_Core_Ver in the corresponding page in the list, the version information variable EE_Core_Ver in the EEPROM partition is erased, and the version information variable EE_Core_Ver is updated the next time the variable information is written to the EEPRROM.

[0022] A management system for EEPROM variables includes an ECU and an EEPROM for storing variable information, wherein:

[0023] For the variables stored in the EEPROM, the ECU uses the above-mentioned management method to perform the required management.

[0024] The advantages of the present invention are as follows: the storage and management of EEPROM variables are realized by using a list; when the variables in the list need to be stored in the EEPROM, a standard compilation code is generated according to the variable information on the page in the list, in which the variables are defined in a source file and declared in a header file according to the numbering sequence and data type of the variables; according to the source file and the header file in the above standard compilation code, the variables in the list are stored in the partition corresponding to the EEPROM, and when the program is updated, the accuracy of the EEROM variable address can be guaranteed, and it is ensured that the data corresponding to the variable can be accurately retained.

[0025] When the state of the variable information in the page is updated, the corresponding variable default value of the version information variable EE_Core_Ver is accumulated by a count value, so that the variable version can be managed according to the variable default value of the version information variable EE_Core_Ver to prevent EEROM confusion when the ECU is initialized. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 The present invention is a flowchart of an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The present invention will be further described below in conjunction with specific drawings and embodiments.

[0028] In order to ensure the accuracy of EEROM (Electrically Erasable Programmable Read-Only Memory) variable addresses and ensure that data corresponding to the variables can be accurately retained when the program is updated, a method for managing EEPROM variables, in one embodiment of the present invention, includes:

[0029] Constructing a list for managing EEPROM variables, wherein the list includes a plurality of pages for storing variable information, and a page corresponds to a partition of the EEPROM;

[0030] When storing the variable information in the list in the EEPROM, the list constructed above is read, and a standard compilation code is generated according to the variable information of the page in the list. In the standard compilation code, the variables are defined in the source file and declared in the header file according to the numbering sequence and data type of the variables;

[0031] Compile the source and header files in the code according to the above standards, and store the variables in the list in the corresponding partition of the EEPROM.

[0032] In specific implementation, a list is constructed in the file management system of the automobile ECU. Generally, the constructed list can be in the form of a commonly used Excel table. The form of the list can be selected as needed to meet the management of EEPROM variables. In order to correspond to different partitions in the EEPROM, the list needs to include multiple pages. Generally, one page corresponds to one partition, that is, the page and the partition are in one-to-one correspondence. Therefore, after determining the number of partitions of the EEPROM, the number of pages in the constructed list can be determined.

[0033] In one embodiment of the present invention, the pages in the list have the same format, wherein:

[0034] For any page, the column header of the page includes variable number, variable name, variable meaning, variable data type, variable dimension, variable default value and / or variable unit;

[0035] The variable numbered 1 in the page is configured as a fixed version information variable EE_Core_Ver;

[0036] When the state of the variable information in the page is updated, the variable default value corresponding to the version information variable EE_Core_Ver is accumulated by a count value.

[0037] In specific implementation, within a page, the variable information of any variable can be determined by the variable number, variable name, variable meaning, variable data type, variable dimension, variable default value and / or variable unit. That is, different variables within the page can be distinguished by the variable number, variable name, variable meaning, variable data type, variable dimension, variable default value and variable unit.

[0038] When the variable information in the page is stored in the partition of the EEPROM, there will be a situation where the variable information is updated. In order to quickly determine the version of the variable information stored in the EEPROM, in each page, the variable numbered 1 is configured as a fixed version information variable EE_Core_Ver. During operation, when the state of the variable information in the page is updated, the corresponding variable default value of the version information variable EE_Core_Ver is accumulated by a count value.

[0039] In one embodiment of the present invention, updating the variable information in the page includes writing the variable information in the page of the newly constructed list and / or changing the corresponding variable information of the page where the variable information has been written;

[0040] The accumulated count value is 1.

[0041] In specific implementation, for a newly constructed list, the initial default value of the version information variable EE_Core_Ver may be 0. When the corresponding variable information is first written into the page, the version information variable EE_Core_Ver will be counted cumulatively, that is, after the variable information is first written into the page, the default value of the version information variable EE_Core_Ver changes from 0 to 1.

[0042] When working, when any variable information in the page changes, the variable default value of the version information variable EE_Core_Ver is accumulated; the variable information changes, such as the number of variables, the variable default value of the variable, etc., and the corresponding content of any column header changes.

[0043] When the variable information in the list needs to be stored in the EEPROM, the list must be read first when a new program is generated; after the new program is generated, the program is flashed into the ECU, and the program will run in the ECU. When the car is powered off, the EEPROM variables in the ECU will be stored in the EEPROM Flash partition.

[0044] After reading the list, a standard compilation code is generated according to the variable information on the page in the list. In the standard compilation code, the variables are defined in the source file and declared in the header file according to the numbering sequence and data type of the variables; based on the source file and header file in the above standard compilation code, the variables in the list are stored in the corresponding partition of the EEPROM. At this point, the variables in the list are stored in the EEPROM, which meets the accuracy of the EEROM variable address and ensures that the data corresponding to the variable can be accurately retained.

[0045] In specific implementation, the source file is a C file on the C language, in which the EEPROM variables are defined; the header file is an H file on the C language, in which the EEPROM variables are declared, and the purpose of the declaration is to facilitate other C files to call the declared variables. According to the coding specification of the C language, the corresponding source file and header file are generated in sequence according to the list information, and the specific method and process of generating the source file and header file are consistent with the existing ones.

[0046] In one embodiment of the present invention, for variable information stored in any page, the storage capacity required for storage in the EEPROM is calculated based on the stored variable information;

[0047] When the determined occupied storage capacity exceeds the partition capacity of the EEPROM corresponding to the page, an alarm prompt indicating that the storage capacity is exceeded is output.

[0048] According to the characteristics of the variable information in the page, such as the variable number, variable name, variable meaning, variable data type, variable dimension, variable default value and variable unit mentioned above, the storage capacity occupied when stored in the EEPROM can be calculated or counted by existing commonly used technical means. For determining the partition of the EEPROM, the storage capacity of each partition can be determined. Therefore, when the storage capacity occupied by the calculation or statistics exceeds the storage capacity of the corresponding partition, an alarm prompt of storage capacity exceeding is output.

[0049] In the specific implementation, the output storage capacity exceeds the alarm prompt, including the prompt mark of the page. The prompt mark can be a color mark of the page or other mark that can provide a time slot alarm prompt. The specific situation of the prompt mark is determined according to actual needs to meet the purpose of the prompt alarm.

[0050] In one embodiment of the present invention, when generating a standard compiled code, the standard compiled code includes C code, wherein:

[0051] Delimiting the Flash partition address in the link file, and segmenting the generated standard compiled code according to the link rule so that the variable information of the page is located in the Flash partition;

[0052] The order of variables in the standard compiled code generated by script configuration is consistent with the order of variables in the page, so that the address of the variable information in the ECU remains fixed after compilation and linking.

[0053] In specific implementation, the starting address and length of the EEPROM partition corresponding to the page in the list can generally be pre-configured. The following figure shows an implementation method corresponding to the starting address and length of the name of the three segments.

[0054]

[0055] The segmentation processing is the processing in the C code. The link file and the specific method and process of segmentation processing can be implemented by existing commonly used technical means, which is based on the ability to achieve the division of Flash partition addresses and the required segmentation processing.

[0056] In one embodiment of the present invention, for the version information variable EE_Core_Ver stored in the EEPROM partition, when the version information variable EE_Core_Ver stored in the EEPROM partition is inconsistent with the version information variable EE_Core_Ver in the corresponding page in the list, the version information variable EE_Core_Ver in the EEPROM partition is erased, and the version information variable EE_Core_Ver is updated the next time the variable information is written to the EEPROM (specifically, when the ECU of the vehicle is powered off and executes to store the variable in the EEPROM).

[0057] In specific implementation, when the ECU is powered on and initialized, the version information stored in the EEPROM partition can be verified. Generally, the list is stored in the Flash, that is, when powered on and initialized, the ECU can read all the version information variables EE_Core_Ver in the list.

[0058] From the above description, it can be traced that the variable information in the page includes the version information variable EE_Core_Ver and will be stored in the corresponding partition of the EEPROM. Therefore, the ECU can compare the read version information variable EE_Core_Ver with the corresponding version information variable EE_Core_Ver in the EEPROM partition. When comparing, the corresponding variable default values ​​of the version information variable EE_Core_Ver can be compared. When the variable default values ​​of the version information variable EE_Core_Ver are equal, it is considered that the version information stored in the EEPROM partition is consistent with the version information stored in the list, otherwise, it is inconsistent.

[0059] When the version information is inconsistent, the ECU will erase the variable information stored in the EEPROM, and store the corresponding variables of the page in the corresponding EEPROM partition during the next update. At this time, the version management of the variables can be realized to prevent the EEROM from being confused when the ECU is initialized.

[0060] In summary, a management system for EEPROM variables can be obtained. In one embodiment of the present invention, the management system includes an ECU and an EEPROM for storing variable information, wherein:

[0061] For the variables stored in the EEPROM, the ECU uses the above-mentioned management method to perform the required management.

[0062] In the specific implementation, the method and process of ECU and EEPROM to achieve variable management can refer to the above description and will not be repeated here.

Claims

1. A method for managing EEPROM variables, characterized in that: include: Constructing a list for managing EEPROM variables, wherein the list includes a plurality of pages for storing variable information, and a page corresponds to a partition of the EEPROM; When storing the variable information in the list in the EEPROM, the list constructed above is read, and a standard compilation code is generated according to the variable information of the page in the list. In the standard compilation code, the variables are defined in the source file and declared in the header file according to the numbering sequence and data type of the variables; Compile the source and header files in the code according to the above standards, and store the variables in the list in the corresponding partition of the EEPROM; The format of the pages in the list is the same, where For any page, the column header of the page includes variable number, variable name, variable meaning, variable data type, variable dimension, variable default value and / or variable unit; The variable numbered 1 in the page is configured as a fixed version information variable EE_Core_Ver; When the state of the variable information in the page is updated, the corresponding variable default value of the version information variable EE_Core_Ver is accumulated by a count value; Update the variable information in the page, including writing the variable information in the page of the newly constructed list and / or changing the corresponding variable information of the page where the variable information has been written; The accumulated count value is 1; When generating a standard compiled code, the standard compiled code includes C code, wherein: Delimiting the Flash partition address in the link file, and segmenting the generated standard compiled code according to the link rule so that the variable information of the page is located in the Flash partition; The order of variables in the standard compiled code generated by script configuration is consistent with the order of variables in the page, so that the address of the variable information in the ECU remains fixed after compilation and linking.

2. The method for managing EEPROM variables according to claim 1, characterized in that: For the variable information stored in any page, the storage capacity required for storing in the EEPROM is calculated based on the stored variable information; When the determined occupied storage capacity exceeds the partition capacity of the EEPROM corresponding to the page, an alarm prompt indicating that the storage capacity is exceeded is output.

3. The method for managing EEPROM variables according to claim 2, characterized in that: Provides an alarm prompt when the output storage capacity is exceeded, including marking the page with a prompt.

4. The method for managing EEPROM variables according to claim 1, characterized in that: For the version information variable EE_Core_Ver stored in the EEPROM partition, when the version information variable EE_Core_Ver stored in the EEPROM partition is inconsistent with the version information variable EE_Core_Ver in the corresponding page in the list, the version information variable EE_Core_Ver in the EEPROM partition is erased, and the version information variable EE_Core_Ver is updated the next time the variable information is written to the EEPRROM.

5. A management system for EEPROM variables, characterized in that: It includes ECU and EEPREOM for storing variable information, among which, For the variables stored in the EEPROM, the ECU uses the management method of any one of claims 1 to 4 to perform the required management.

Citation Information

Patent Citations

  • A software version upgrading method and device

    CN109358892A

  • Read-write processing method and system capable of configuring storage data type

    CN114721982A