A software number information storage method, device, equipment and readable storage medium
By configuring a fixed storage address for the APP and Boot programs during ECU software upgrades, the problem of non-unique software number information is solved, enabling automatic generation and shared access of software number information, thus ensuring the uniqueness of the ECU program software number and the efficient use of storage space.
Patent Information
- Application Number
- CN202211576410.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-12-09
AI Technical Summary
In existing technologies, when upgrading ECU software, the software ID information of the APP program and the Boot program cannot be shared and accessed, resulting in non-unique software ID information, complicated operation, storage space consumption, and risk of loss.
Configure fixed storage addresses in the storage space of the APP program and the Boot program to store the APP and Boot software ID information respectively. Generate and link to these addresses through compilation to ensure that the addresses cannot be modified, and realize the automatic generation and shared access of software ID information.
It ensures the uniqueness and shared access of the software ID information for both the APP program and the Boot program, avoiding the risk of manual modification, simplifying operations, and saving storage space.
Smart Images

Figure CN116166310B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automotive electronic information, and in particular to a method, apparatus, device, and readable storage medium for storing software number information. Background Technology
[0002] ECU (Electronic Control Unit), also known as "on-board computer," is essential for the continuous iterative updates of ECU software throughout the entire vehicle production lifecycle, as electric vehicles become increasingly automated and intelligent. ECU software consists of two parts: the APP program and the Boot program. Each update and release of the ECU software requires the generation of unique APP program software IDs and Boot program software IDs for traceability of software functions.
[0003] Currently, ECU software upgrades typically involve manually modifying the APP and Boot program software IDs in the source code before recompiling. The APP and Boot program software IDs are generated at random addresses in the APP and Boot program storage spaces. Because these addresses are random, the APP and Boot program software IDs cannot be shared or accessed. Specifically, the APP program can only read the APP software version and compilation date; it cannot read the Boot software version and compilation date because its storage location is unknown. Similarly, the Boot program can only read the Boot software version and compilation date; it cannot read the APP software version and compilation date because its storage location is unknown. Alternatively, during the execution of the APP program and the Boot program, the APP program software number information and the Boot program software number information are written to a pre-agreed common parameter storage area, and then read from the common parameter storage area in the APP program or the Boot program. However, this may cause the APP program software number information and the Boot program software number information to be rewritten or lost, and the uniqueness of the ECU program software number cannot be guaranteed. In addition, the operation is complicated and wastes valuable parameter storage space. Summary of the Invention
[0004] This application provides a method, apparatus, device, and readable storage medium for storing software ID information, to at least solve the problems in the related art where the software ID information of an APP program and the software ID information of a Boot program cannot be shared and accessed, and the software ID of an ECU program is not unique.
[0005] In a first aspect, embodiments of this application provide a method for storing software number information, the method comprising:
[0006] Configure a first storage address in the APP program storage space for storing APP software ID information, and a second storage address in the Boot program storage space for storing Boot software ID information; the APP software ID information includes the APP software version and the APP compilation date; the Boot software ID information includes the Boot software version and the Boot compilation date;
[0007] Based on the obtained APP software version and APP compilation date, the APP software number information is compiled and generated, and based on the obtained Boot software version and Boot compilation date, the Boot software number information is compiled and generated.
[0008] Link the APP software ID information to the first storage address, and link the Boot software ID information to the second storage address.
[0009] In one embodiment, the first storage address in the configuration APP program storage space used to store APP software number information, and the second storage address in the Boot program storage space used to store Boot software number information, include:
[0010] The first storage address is defined using the APP project linker script, and the second storage address is defined using the Boot project linker script;
[0011] Link the identifier of the APP software number information in the APP project source code to the first storage address, and link the identifier of the Boot software number information in the Boot project source code to the second storage address.
[0012] In one embodiment, the first storage address in the configuration APP program storage space used to store APP software number information, and the second storage address in the Boot program storage space used to store Boot software number information, include:
[0013] The first storage address is divided into two segments, which are used to store the APP software version and the APP compilation date, respectively.
[0014] The second storage address is divided into two segments, which are used to store the Boot software version and the Boot compilation date, respectively.
[0015] In one embodiment, the first storage address belongs to an unmodifiable area in the APP program's storage space, and the second storage address belongs to an unmodifiable area in the Boot program's storage space.
[0016] In one embodiment, the step of compiling and generating the APP software ID information based on the obtained APP software version and APP compilation date, and compiling and generating the Boot software ID information based on the obtained Boot software version and Boot compilation date, includes:
[0017] The APP software version and APP compilation date are obtained based on the APP project compilation preprocessing script, wherein the APP software version is obtained by reading the APP project configuration file, and the APP compilation date is obtained by reading the computer time when the APP project compilation preprocessing script is running; and the Boot software version and Boot compilation date are obtained based on the Boot project compilation preprocessing script, wherein the Boot software version is obtained by reading the Boot project configuration file, and the Boot compilation date is obtained by reading the computer time when the Boot project compilation preprocessing script is running;
[0018] Based on the APP software version and the APP compilation date, the APP software ID information is generated by compilation, and based on the Boot software version and the Boot compilation date, the Boot software ID information is generated by compilation.
[0019] In one embodiment, the step of compiling and generating the APP software ID information based on the obtained APP software version and APP compilation date, and compiling and generating the Boot software ID information based on the obtained Boot software version and Boot compilation date, includes:
[0020] The APP project compilation script calls the APP project compilation preprocessing script to obtain the APP software version and APP compilation date; the Boot project compilation script calls the Boot project compilation preprocessing script to obtain the Boot software version and Boot compilation date.
[0021] Write the APP software version and APP compilation date into the first header file, and write the Boot software version and Boot compilation date into the second header file;
[0022] Add the first header file to the APP project source code, and add the second header file to the Boot project source code;
[0023] Compile the APP project source code to generate the APP software ID information, and compile the Boot project source code to generate the Boot software ID information.
[0024] In one embodiment, compiling the APP project source code to generate the APP software ID information, and compiling the Boot project source code to generate the Boot software ID information further include:
[0025] Compile the APP project source code to generate the APP program executable file, and compile the Boot project source code to generate the Boot program executable file.
[0026] Secondly, embodiments of this application also provide a software number information storage device. The device includes:
[0027] The configuration module is used to configure a first storage address in the APP program storage space for storing APP software ID information, and a second storage address in the Boot program storage space for storing Boot software ID information; the APP software ID information includes the APP software version and the APP compilation date; the Boot software ID information includes the Boot software version and the Boot compilation date;
[0028] The generation module generates the APP software ID information based on the obtained APP software version and APP compilation date, and generates the Boot software ID information based on the obtained Boot software version and Boot compilation date;
[0029] The linking module is used to link the APP software ID information to the first storage address and the Boot software ID information to the second storage address.
[0030] Thirdly, embodiments of this application also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the software number information storage method as described in the first aspect above.
[0031] Fourthly, embodiments of this application also provide a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the software number information storage method described in the first aspect above.
[0032] Compared to related technologies, the software number information storage method, apparatus, device, and readable storage medium provided in this application, by configuring a first storage address in the APP program storage space for storing APP software number information and a second storage address in the Boot program storage space for storing Boot software number information; and by compiling and generating the APP software number information and the Boot software number information, linking the APP software number information to the first storage address and the Boot software number information to the second storage address, solves the problem in related technologies that the software number information of the APP program and the software number information of the Boot program cannot be shared and accessed, and that the ECU program software number is not unique.
[0033] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0034] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0035] Figure 1 This is an application environment diagram of the software number information storage method according to an embodiment of this application;
[0036] Figure 2 This is a flowchart of a software number information storage method according to an embodiment of this application;
[0037] Figure 3 This is a flowchart of a method for automatically generating software number information according to an embodiment of this application;
[0038] Figure 4 This is a schematic diagram of the software number information storage address according to an embodiment of this application;
[0039] Figure 5 This is a structural block diagram of a software number information storage device according to an embodiment of this application;
[0040] Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of this application. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0042] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0043] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0044] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0045] The software number information storage method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 101 communicates with server 102 via a network. A data storage system can store the data that server 102 needs to process. The data storage system can be integrated onto server 102, or it can be located on a cloud or other network server. Terminal 101 can be, but is not limited to, various personal computers and laptops. Server 102 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0046] This embodiment provides a method for storing software number information. Figure 2 This is a flowchart of a software number information storage method according to an embodiment of this application, such as... Figure 2 As shown, the method includes:
[0047] Step S201: Configure a first storage address in the APP program storage space for storing APP software ID information, and a second storage address in the Boot program storage space for storing Boot software ID information; the APP software ID information includes the APP software version and the APP compilation date; the Boot software ID information includes the Boot software version and the Boot compilation date.
[0048] In this embodiment, both the APP program storage space and the Boot program storage space are located in the FLASH storage area.
[0049] Step S202: Based on the obtained APP software version and APP compilation date, compile and generate the APP software number information, and based on the obtained Boot software version and Boot compilation date, compile and generate the Boot software number information.
[0050] In this embodiment, the compiler with compilation capabilities can be the Microsoft C compiler, GCC compiler, Borland Turbo C compiler, which are all commonly used compilers, or other compilers.
[0051] Step S203: Link the APP software ID information to the first storage address, and link the Boot software ID information to the second storage address.
[0052] Specifically, the linker links the APP software ID information to the first storage address and the Boot software ID information to the second storage address.
[0053] Through steps S201 to S203, a first storage address is configured in the APP program's storage space to store the APP software ID information, and a second storage address is configured in the Boot program's storage space to store the Boot software ID information. The APP software ID information and the Boot software ID information are then generated through compilation, and the APP software ID information is linked to the first storage address, while the Boot software ID information is linked to the second storage address. Therefore, by reading the first storage address and the second storage address, the APP program and the BOOT program can share and read each other's software ID information.
[0054] In one embodiment, configuring a first storage address in the APP program storage space for storing APP software ID information and a second storage address in the Boot program storage space for storing Boot software ID information includes: defining the first storage address using the APP project linker script and defining the second storage address using the Boot project linker script; linking the identifier of the APP software ID information in the APP project source code to the first storage address, and linking the identifier of the Boot software ID information in the Boot project source code to the second storage address.
[0055] Linker scripts are written in the linker command language. The main purpose of linker scripts is to describe how to map the various parts of the input file to the output file and to control the storage layout of the output file.
[0056] The identifiers of the APP software number information include the identifier of the APP software version and the identifier of the APP compilation date, and the identifiers of the Boot software number information include the identifier of the Boot software version and the identifier of the Boot compilation date.
[0057] The APP project linker script divides the first storage address into two segments, which are used to store the APP software version and the APP compilation date of the APP program, and link the identifier of the APP software version and the identifier of the APP compilation date, respectively; the Boot project linker script divides the second storage address into two segments, which are used to store the Boot software version and the Boot compilation date of the Boot program, and link the identifier of the Boot software version and the identifier of the Boot compilation date, respectively.
[0058] In one embodiment, the step of compiling and generating the APP software ID information based on the obtained APP software version and APP compilation date, and compiling and generating the Boot software ID information based on the obtained Boot software version and Boot compilation date, includes: obtaining the APP software version and APP compilation date according to the APP project compilation preprocessing script, wherein the APP software version is obtained by reading the APP project configuration file, and the APP compilation date is obtained by reading the computer time at the time the APP project compilation preprocessing script runs; and obtaining the Boot software version and Boot compilation date according to the Boot project compilation preprocessing script, wherein the Boot software version is obtained by reading the Boot project configuration file, and the Boot compilation date is obtained by reading the computer time at the time the Boot project compilation preprocessing script runs; compiling and generating the APP software ID information based on the APP software version and the APP compilation date, and compiling and generating the Boot software ID information based on the Boot software version and the Boot compilation date.
[0059] In this embodiment, the APP software version and APP compilation date are obtained through the APP project compilation preprocessing script, and the Boot software version and Boot compilation date are obtained through the Boot project compilation preprocessing script. This avoids the risk of introducing software ID information in the APP project source code and Boot project source code by manually modifying them, and realizes automatic generation of software ID information for APP program and Boot program without adding extra manual operation, achieving one-click compilation.
[0060] As a unique identifier for the software version, the software number should be integrated into the software and cannot be modified. In existing solutions, after the APP program and the Boot program run, the software number information of the APP program and the Boot program stored in a random address is written to a predefined common parameter storage area (NVM parameter storage area) to achieve shared reading of the software number information of the APP program and the Boot program. However, by defining a common parameter storage area and treating the non-readable and non-writable software number as a writable parameter, there is a risk of loss, which cannot meet the uniqueness of the ECU program software number, and it also occupies storage resources and is complicated to operate.
[0061] In one embodiment, the first storage address is an unmodifiable area in the APP program's storage space, and the second storage address is an unmodifiable area in the Boot program's storage space.
[0062] In this embodiment, the unmodifiable area is the Rodata area. Since the Rodata area is unmodifiable and protected, any attempt to modify it will be detected in time. Therefore, the generated APP software number information and Boot software number information have the attribute of being unmodifiable, which ensures the uniqueness of the APP program software number information and the Boot program software number information, and further ensures the uniqueness of the ECU program software number.
[0063] In one embodiment, the process of compiling and generating the APP software ID information based on the obtained APP software version and APP compilation date, and compiling and generating the Boot software ID information based on the obtained Boot software version and Boot compilation date, is as follows: Figure 3 As shown, this is achieved through the following steps:
[0064] Step 301: The APP project compilation script calls the APP project compilation preprocessing script to obtain the APP software version and APP compilation date; the Boot project compilation script calls the Boot project compilation preprocessing script to obtain the Boot software version and Boot compilation date.
[0065] Step 302: Write the APP software version and APP compilation date into the first header file, and write the Boot software version and Boot compilation date into the second header file.
[0066] Step 303: Add the first header file to the APP project source code and add the second header file to the Boot project source code.
[0067] Step 304: Compile the APP project source code to generate the APP software ID information, and compile the Boot project source code to generate the Boot software ID information.
[0068] In this embodiment, the integrated development environment is NXP's S32DS (S32 Design Studio for Arm), which integrates the GNU toolchain, uses the GCC compiler and the LD linker, and the APP project source code and Boot project source code are written in C language.
[0069] Specifically, taking the generation of the APP software ID information as an example, before the APP project compilation script calls the GCC instructions, it first calls the APP project compilation preprocessing script. This preprocessing script is used to obtain the APP software version and the APP compilation date. Specifically, the preprocessing script obtains the APP software version and compilation date, creates the first header file, writes the obtained APP software version and compilation date into the first header file, adds the first header file to the APP project source code, and then calls the GCC instructions to compile the APP project source code, generating the APP software ID information. The steps for generating the Boot software ID information are the same as those for generating the APP software ID information, and will not be repeated here. Then, the LD linker links the APP software ID information to the first storage address and the Boot software ID information to the second storage address. Compiling the APP project source code includes generating the APP program executable file, and compiling the Boot project source code includes generating the Boot program executable file, which is in bin format.
[0070] In this embodiment, the APP project compilation script calls the APP project compilation preprocessing script to automatically obtain the APP software version and APP compilation date. Similarly, the Boot project compilation script calls the Boot project compilation preprocessing script to automatically obtain the Boot software version and Boot compilation date. This avoids the risks introduced by manually modifying the software ID information in the APP and Boot project source code, achieving automatic generation of the software ID information for both the APP and Boot programs. The LD linker links the APP software ID information to the first storage address and the Boot software ID information to the second storage address. By reading the first and second storage addresses, the APP and Boot programs can share and read each other's software ID information.
[0071] In one example embodiment, Figure 4This diagram illustrates the storage addresses of the software ID information in the APP program's storage space and the Boot program's storage space. Specifically, the first storage address for storing the APP software ID information is defined in the APP project's linker script file (S32K144_64_flash_1.ld). In this embodiment, the first storage address is named m_softver_config_1, with a start address of 0x00014410, an end address of 0x0001441F, and a size of 16 bytes. The first storage address is located in the Rodata area of the FLASH region and has an unmodifiable attribute. The second storage address for storing the Boot software ID information is defined in the Boot project's linker script file (S32K144_64_flash_2.ld). In this embodiment, the second storage address is named m_softver_config_2, with a start address of 0x0000410, an end address of 0x000041F, and a size of 16 bytes. The second storage address is located in the Rodata area of the FLASH region and has an unmodifiable attribute.
[0072] Furthermore, the first storage address m_softver_config_1 is divided into two segments, named .software_version_1 and .compile_date_1, respectively. .software_version_1 stores the APP software version and starts at address 0x00014410. .compile_date_1 stores the APP compilation date and starts at address 0x0001441C. Similarly, the second storage address m_softver_config_2 is divided into two segments, named .software_version_2 and .compile_date_2, respectively. .software_version_2 stores the Boot software version and starts at address 0x00000410. .compile_date_2 stores the Boot compilation date and starts at address 0x000041C.
[0073] Link the identifier of the APP software ID information in the APP project source code to the first storage address. The identifier of the APP software ID information is defined in the software_num_1.c source file, which includes defining the identifier of the APP software version as software_version_1, which is 10 bytes in size and linking it to the address of .software_version_1, and defining the identifier of the APP compilation date as compile_date_1, which is BCD code format, which is 4 bytes in size and linking it to the address of .compile_date_1. The software_num_1.c source file includes the predef_1.h header file. Link the identifier of the Boot software ID information in the Boot project source code to the second storage address. The identifier of the Boot software ID information is defined in the software_num_2.c source file, which includes defining the identifier of the Boot software version as software_version_2, which is 10 bytes in size and linking it to the address of .software_version_2, and defining the identifier of the Boot compilation date as compile_date_2, which is BCD code format, which is 4 bytes in size and linking it to the address of .compile_date_2. The software_num_2.c source file includes the predef_2.h header file.
[0074] The `Make` command is executed. The APP project's build script `makefile_1` calls the APP project's preprocessing script `Prebuild_1.bat` to obtain the APP software version and APP compilation date. The APP software version is obtained by reading the APP project's configuration file, and the APP compilation date is obtained by reading the computer's time at the moment the APP project's preprocessing script runs. The APP project's preprocessing script `Prebuild_1.bat` is a pre-written script. Running `Prebuild_1.bat` generates the `predef_1.h` header file, which automatically writes the APP software version and APP compilation date. In this embodiment, the APP software version is 0.00.11, and the APP compilation date is 20221019. `predef_1.h` is also automatically added to the `software_num_1.c` source file. The `software_num_1.c` source file is compiled along with the entire APP project source code, generating APP software ID information and the APP executable file. The generated APP software ID information is integrated into the APP executable file, which is in bin format. The APP software version 0.00.11 is linked to address 0x00014410 via the LD linker, and the APP compilation date 0x20 0x22 0x10 0x19 (i.e., 20221019) is linked to address 0x0001441C via the LD linker. The Make command is executed, and the Boot project compilation script makefile_2 calls the Boot project compilation preprocessing script Prebuild_2.bat to obtain the Boot software version and Boot compilation date. The Boot software version is obtained by reading the Boot project configuration file, and the Boot compilation date is obtained by reading the computer time at the time the Boot project compilation preprocessing script runs. The Boot project compilation preprocessing script Prebuild_2.bat is a pre-written script. Prebuild_2.bat generates the predef_2.h header file, which automatically writes the Boot software version and Boot compilation date. In this embodiment, the Boot software version written is 0.00.12, and the Boot compilation date is 20221020. It automatically adds predef_2.h to the software_num_2.c source file. The software_num_2.c source file is compiled together with the entire Boot project source code, generating Boot software ID information and APP program executable file. The generated Boot software ID information is integrated into the Boot program executable file, which is in bin format.Boot software version 0.00.12 is linked to address 0x0000410 via the LD linker, and Boot compilation date 0x20 0x22 0x10 0x20 (i.e. 20221020) is linked to address 0x000041C via the LD linker.
[0075] In this embodiment, by executing the Make command, the software version number and compilation date of the APP program and the Boot program are automatically obtained. This avoids the risks introduced by manually modifying the software ID information in the APP program and Boot project source code, enabling automatic generation of software ID information and one-click automatic compilation for software upgrades. The LD linker links the software ID information of the APP program and the Boot program to specified addresses. When the APP program or the BOOT program runs, the software version number of the APP program can be obtained by reading from 0x00014410 via the UDS protocol, the compilation date of the APP program can be obtained by reading from 0x000141C, the software version number of the Boot program can be obtained by reading from 0x0000410, and the compilation date of the Boot program can be obtained by reading from 0x000041C. This allows the APP program and the BOOT program to share and read each other's software ID information. Moreover, these addresses belong to the Rodata area and have unmodifiable attributes, so there is no possibility of the software ID information being rewritten, ensuring the uniqueness of the ECU program software ID.
[0076] This embodiment provides a software number information storage device. Figure 5 This is a structural block diagram of a software number information storage device according to an embodiment of this application, such as... Figure 5 As shown, the device includes:
[0077] The configuration module 510 is used to configure a first storage address in the APP program storage space for storing APP software ID information, and a second storage address in the Boot program storage space for storing Boot software ID information; the APP software ID information includes the APP software version and the APP compilation date; the Boot software ID information includes the Boot software version and the Boot compilation date.
[0078] The generation module 520 is used to generate the APP software number information based on the obtained APP software version and APP compilation date, and to generate the Boot software number information based on the obtained Boot software version and Boot compilation date.
[0079] The linking module 530 is used to link the APP software number information to the first storage address and the Boot software number information to the second storage address.
[0080] The configuration module 510 is further configured to define the first storage address using the APP project linking script and the second storage address using the Boot project linking script; link the identifier of the APP software number information in the APP project source code to the first storage address, and link the identifier of the Boot software number information in the Boot project source code to the second storage address.
[0081] The configuration module 510 is further configured to divide the first storage address into two segments, which are used to store the APP software version and APP compilation date of the APP program respectively; and to divide the second storage address into two segments, which are used to store the Boot software version and Boot compilation date of the Boot program respectively.
[0082] The configuration module 510 is further configured such that the first storage address is an unmodifiable area in the APP program storage space, and the second storage address is an unmodifiable area in the Boot program storage space.
[0083] The generation module 520 is further configured to obtain the APP software version and APP compilation date according to the APP project compilation preprocessing script, wherein the APP software version is obtained by reading the APP project configuration file and the APP compilation date is obtained by reading the computer time; and to obtain the Boot software version and Boot compilation date according to the Boot project compilation preprocessing script, wherein the Boot software version is obtained by reading the Boot project configuration file and the Boot compilation date is obtained by reading the computer time; and to compile and generate the APP software number information based on the APP software version and the APP compilation date, and to compile and generate the Boot software number information based on the Boot software version and the Boot compilation date.
[0084] The generation module 520 is further configured to have the APP project compilation script call the APP project compilation preprocessing script, and the Boot project compilation script call the Boot project compilation preprocessing script; the APP project compilation preprocessing script generates the first header file. , Obtain the APP software version and APP compilation date; the Boot project compilation preprocessing script generates the second header file. , Obtain the Boot software version and Boot compilation date; add the first header file to the APP project source code and the second header file to the Boot project source code; compile the APP project source code to generate the APP software ID information, and compile the Boot project source code to generate the Boot software ID information.
[0085] The generation module 520 is also used to compile the APP project source code to generate the APP program executable file, and to compile the Boot project source code to generate the Boot program executable file.
[0086] It should be noted that the functions or operation steps implemented by the above modules are largely the same as those in the above method embodiments, and will not be repeated here.
[0087] In addition, in conjunction with the software number information storage method in the above embodiments, this application embodiment can provide a computer device for implementation.
[0088] Figure 6 This is a schematic diagram of a computer device structure according to an embodiment of this application. The computer device includes a memory 610, a processor 620, and a computer program 530 stored in the memory and executable on the processor. The processor 620 executes the program to implement any of the software number information storage methods described in the above embodiments.
[0089] Specifically, the processor 620 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0090] The memory 610 may include a large-capacity memory for data or instructions. For example, and not limitingly, the memory 610 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 610 may include removable or non-removable (or fixed) media. Where appropriate, the memory 610 may be internal or external to a data processing device. In a particular embodiment, the memory 610 is non-volatile memory. In a particular embodiment, the memory 610 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only ROM (PROM), an erasable read-only ROM (EPROM), an electrically erasable read-only ROM (EEPROM), an electrically alterable read-only ROM (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random Access Memory (FPMDRAM), Extended Data Out Dynamic Random Access Memory (EDODRAM), Synchronous Dynamic Random Access Memory (SDRAM), etc.
[0091] Furthermore, in conjunction with the software number information storage method in the above embodiments, this application embodiment can provide a storage medium for implementation. This storage medium stores a computer program, which, when executed by a processor, implements any of the software number information storage methods in the above embodiments.
[0092] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0093] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for storing software number information, applied to ECU software, characterized in that, include: Configure a first storage address in the APP program storage space for storing APP software ID information, and a second storage address in the Boot program storage space for storing Boot software ID information; the APP software ID information includes the APP software version and the APP compilation date; the Boot software ID information includes the Boot software version and the Boot compilation date; wherein, the first storage address belongs to the unmodifiable area in the APP program storage space, and the second storage address belongs to the unmodifiable area in the Boot program storage space; Based on the obtained APP software version and APP compilation date, the APP software ID information is generated through compilation, and based on the obtained Boot software version and Boot compilation date, the Boot software ID information is generated through compilation. This includes: obtaining the APP software version and APP compilation date from the APP project compilation preprocessing script, wherein the APP software version is obtained by reading the APP project configuration file, and the APP compilation date is obtained by reading the computer time at the time the APP project compilation preprocessing script is running; and obtaining the Boot software version and Boot compilation date from the Boot project compilation preprocessing script, wherein the Boot software version is obtained by reading the Boot project configuration file, and the Boot compilation date is obtained by reading the Boot project configuration file. The process involves: obtaining the computer time at the time the project compilation preprocessing script runs; the APP project compilation script calling the APP project compilation preprocessing script to obtain the APP software version and APP compilation date; the Boot project compilation script calling the Boot project compilation preprocessing script to obtain the Boot software version and Boot compilation date; writing the APP software version and APP compilation date into a first header file and the Boot software version and Boot compilation date into a second header file; adding the first header file to the APP project source code and the second header file to the Boot project source code; compiling the APP project source code to generate the APP software ID information and compiling the Boot project source code to generate the Boot software ID information. Link the APP software ID information to the first storage address, and link the Boot software ID information to the second storage address.
2. The software number information storage method according to claim 1, characterized in that, The first storage address in the configuration APP program storage space used to store APP software ID information, and the second storage address in the Boot program storage space used to store Boot software ID information, include: The first storage address is defined using the APP project linker script, and the second storage address is defined using the Boot project linker script; Link the identifier of the APP software number information in the APP project source code to the first storage address, and link the identifier of the Boot software number information in the Boot project source code to the second storage address.
3. The software number information storage method according to claim 1, characterized in that, The first storage address in the configuration APP program storage space used to store APP software ID information, and the second storage address in the Boot program storage space used to store Boot software ID information, include: The first storage address is divided into two segments, which are used to store the APP software version and the APP compilation date, respectively. The second storage address is divided into two segments, which are used to store the Boot software version and the Boot compilation date, respectively.
4. The software number information storage method according to claim 1, characterized in that, Compiling the APP project source code to generate the APP software ID information, and compiling the Boot project source code to generate the Boot software ID information also includes: Compile the APP project source code to generate the APP program executable file, and compile the Boot project source code to generate the Boot program executable file.
5. A software number information storage device, characterized in that, The device includes: A configuration module is used to configure a first storage address in the APP program storage space for storing APP software ID information, and a second storage address in the Boot program storage space for storing Boot software ID information; the APP software ID information includes the APP software version and the APP compilation date; the Boot software ID information includes the Boot software version and the Boot compilation date; wherein, the first storage address belongs to an unmodifiable area in the APP program storage space, and the second storage address belongs to an unmodifiable area in the Boot program storage space; The generation module, based on the obtained APP software version and APP compilation date, compiles and generates the APP software ID information, and based on the obtained Boot software version and Boot compilation date, compiles and generates the Boot software ID information; including: obtaining the APP software version and APP compilation date according to the APP project compilation preprocessing script, wherein the APP software version is obtained by reading the APP project configuration file, and the APP compilation date is obtained by reading the computer time at the time the APP project compilation preprocessing script runs; and obtaining the Boot software version and Boot compilation date according to the Boot project compilation preprocessing script, wherein the Boot software version is obtained by reading the Boot project configuration file, and the Boot compilation date is obtained by reading the Boot project configuration file. The process involves: obtaining the computer's time at the time the .oot project compilation preprocessing script runs; the APP project compilation script calling the APP project compilation preprocessing script to obtain the APP software version and APP compilation date; the Boot project compilation script calling the Boot project compilation preprocessing script to obtain the Boot software version and Boot compilation date; writing the APP software version and APP compilation date into a first header file and the Boot software version and Boot compilation date into a second header file; adding the first header file to the APP project source code and the second header file to the Boot project source code; compiling the APP project source code to generate the APP software ID information and compiling the Boot project source code to generate the Boot software ID information. The linking module is used to link the APP software ID information to the first storage address and the Boot software ID information to the second storage address.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the software number information storage method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the software number information storage method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Efficient remote updating method for node software of wireless sensor network
CN103324501A
Program loading leading method of electric control system of car
CN104809009A