[go: up one dir, main page]

CN114510437A - Information storage method, device, equipment and storage medium - Google Patents

Information storage method, device, equipment and storage medium Download PDF

Info

Publication number
CN114510437A
CN114510437A CN202210147902.2A CN202210147902A CN114510437A CN 114510437 A CN114510437 A CN 114510437A CN 202210147902 A CN202210147902 A CN 202210147902A CN 114510437 A CN114510437 A CN 114510437A
Authority
CN
China
Prior art keywords
addresses
address
variable
stack
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210147902.2A
Other languages
Chinese (zh)
Other versions
CN114510437B (en
Inventor
刘新
梅梦醒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Golo Iov Data Technology Co ltd
Original Assignee
Golo Iov Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Golo Iov Data Technology Co ltd filed Critical Golo Iov Data Technology Co ltd
Priority to CN202210147902.2A priority Critical patent/CN114510437B/en
Publication of CN114510437A publication Critical patent/CN114510437A/en
Application granted granted Critical
Publication of CN114510437B publication Critical patent/CN114510437B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种信息存储方法、装置、设备和存储介质,属于计算机技术领域。包括:在启动文件中添加n个变量中每个变量的变量声明;在启动文件中栈的n个第一地址中一一存储n个变量;在启动文件中添加n个变量中每个变量的变量定义,每个变量的变量定义用于指定每个变量的初始值为对应的预设信息;启动文件在编译时n个第一地址被一一映射至单片机的存储器中未被占用的n个第二地址,n个第二地址用于指示n个预设信息在存储器中的存储位置。本申请通过在启动文件中添加n个变量的变量声明以及变量定义,并在栈中存储n个变量,使得在编译启动文件时才为预设信息自动分配单片机的存储器中未被占用的第二地址,从而使启动文件具有良好的移植性。

Figure 202210147902

The present application discloses an information storage method, apparatus, device and storage medium, belonging to the technical field of computers. Including: adding the variable declaration of each variable in the n variables in the startup file; storing n variables one by one in the n first addresses of the stack in the startup file; adding the variable declaration of each variable in the n variables in the startup file Variable definition, the variable definition of each variable is used to specify the initial value of each variable to the corresponding preset information; when the startup file is compiled, the n first addresses are mapped to the n unoccupied n addresses in the memory of the microcontroller one by one The second addresses, the n second addresses are used to indicate the storage locations of the n preset information in the memory. In the present application, by adding variable declarations and variable definitions of n variables in the startup file, and storing n variables in the stack, the second unoccupied memory in the memory of the microcontroller is automatically allocated for the preset information when the startup file is compiled. address, so that the startup file has good portability.

Figure 202210147902

Description

信息存储方法、装置、设备和存储介质Information storage method, apparatus, device and storage medium

技术领域technical field

本申请涉及计算机技术领域,特别涉及一种信息存储方法、装置、设备和存储介质。The present application relates to the field of computer technology, and in particular, to an information storage method, apparatus, device, and storage medium.

背景技术Background technique

一般包含单片机的设备需要将自身设备信息(如BOOT(启动)版本、DOWNLOAD(下载)版本、DIAG(诊断)版本等)存储在单片机的FLASH存储器中,以便技术人员查看这些设备信息。Generally, a device containing a microcontroller needs to store its own device information (such as BOOT (boot) version, DOWNLOAD (download) version, DIAG (diagnosis) version, etc.) in the FLASH memory of the microcontroller so that technicians can view these device information.

相关技术中,技术人员在开发单片机的过程中,在单片机的开发文件中的链接配置文件中添加目标代码,目标代码用于指定设备信息在单片机的FLASH存储器中的存储地址。然后对开发文件进行编译,以得到可执行文件,将这个可执行文件烧录进单片机中。之后,单片机在启动时执行这个可执行文件,可将设备信息存储至FLASH存储器中指定的存储地址中。In the related art, in the process of developing the single-chip microcomputer, technicians add target code to the link configuration file in the development file of the single-chip microcomputer, and the target code is used to specify the storage address of the device information in the FLASH memory of the single-chip microcomputer. Then compile the development file to obtain an executable file, and burn the executable file into the microcontroller. After that, the single-chip microcomputer executes this executable file when it starts up, and can store the device information to the storage address specified in the FLASH memory.

然而,上述方式中,在目标代码中指定了设备信息在FLASH存储器中的存储地址,也即在目标代码中设置了固定的用于存储设备信息的存储地址。这种情况下,若需要将目标代码移植到其它单片机的开发文件中,就需要根据其它单片机的FLASH存储器中未被占用的地址重新在目标代码中设置用于存储设备信息的存储地址,即需要修改目标代码,如此不利于目标代码移植。However, in the above manner, the storage address of the device information in the FLASH memory is specified in the target code, that is, a fixed storage address for storing the device information is set in the target code. In this case, if the target code needs to be transplanted into the development files of other microcontrollers, it is necessary to re-set the storage address for storing device information in the target code according to the unoccupied addresses in the FLASH memory of other microcontrollers, that is, it is necessary to Modifying the object code is not conducive to the porting of the object code.

发明内容SUMMARY OF THE INVENTION

本申请提供了一种信息存储方法、装置、设备和存储介质,可以提高设备信息存储的代码移植性。所述技术方案如下:The present application provides an information storage method, device, device and storage medium, which can improve the code portability of device information storage. The technical solution is as follows:

第一方面,提供了一种信息存储方法,所述方法包括:In a first aspect, an information storage method is provided, the method comprising:

在启动文件中添加n个变量中每个变量的变量声明,所述n个变量与n个预设信息一一对应,所述n为正整数;A variable declaration of each of the n variables is added in the startup file, the n variables are in one-to-one correspondence with the n preset information, and the n is a positive integer;

在所述启动文件中栈的n个第一地址中一一存储所述n个变量,所述n个第一地址用于指示所述n个变量在所述栈中的存储位置;The n variables are stored one by one in the n first addresses of the stack in the startup file, and the n first addresses are used to indicate the storage positions of the n variables in the stack;

在所述启动文件中添加所述n个变量中每个变量的变量定义,所述每个变量的变量定义用于指定所述每个变量的初始值为对应的预设信息;A variable definition of each of the n variables is added to the startup file, and the variable definition of each variable is used to specify that the initial value of each variable is corresponding preset information;

其中,所述启动文件用于在编译后得到能够烧录至单片机的可执行文件,所述启动文件在编译时所述n个第一地址被一一映射至所述单片机的存储器中未被占用的n个第二地址,所述n个第二地址用于指示所述n个预设信息在所述存储器中的存储位置。Wherein, the startup file is used to obtain an executable file that can be burned into the microcontroller after compilation, and the n first addresses are mapped to the memory of the microcontroller one by one when the startup file is compiled and are not occupied in the memory of the microcontroller n second addresses, where the n second addresses are used to indicate the storage locations of the n preset information in the memory.

在本申请中,在启动文件中添加n个变量中每个变量的变量声明,并在启动文件的栈中的n个第一地址中一一存储n个变量,之后在启动文件中添加n个变量中每个变量的变量定义,每个变量的变量定义用于指定每个变量的初始值为对应的设备信息。启动文件在编译时n个第一地址被一一映射至单片机的存储器中未被占用的n个第二地址,从而使得后续该启动文件经编译得到的可执行文件被执行时,n个第一地址中的每个第一地址中的变量对应的预设信息可以被存储在单片机的存储器中对应的第二地址中。这种情况下,在启动文件中并未指定预设信息在单片机的存储器中固定的存储地址,而是在编译启动文件时才为预设信息自动分配单片机的存储器中未被占用的第二地址。因而启动文件具有良好的移植性,即将启动文件移植至其他单片机的开发文件中后启动文件也可正常使用。In the present application, a variable declaration of each of the n variables is added to the startup file, and n variables are stored one by one in the n first addresses in the stack of the startup file, and then n variables are added to the startup file. The variable definition of each variable in the variable, the variable definition of each variable is used to specify the initial value of each variable to the corresponding device information. When the startup file is compiled, the n first addresses are mapped to the unoccupied n second addresses in the memory of the microcontroller one by one, so that when the executable file obtained by compiling the startup file is executed subsequently, the n first addresses are not occupied. The preset information corresponding to the variable in each first address of the addresses may be stored in the corresponding second address in the memory of the microcontroller. In this case, the fixed storage address of the preset information in the memory of the single-chip microcomputer is not specified in the startup file, but the unoccupied second address in the memory of the single-chip microcomputer is automatically allocated for the preset information when the startup file is compiled. . Therefore, the startup file has good portability, and the startup file can also be used normally after transplanting the startup file to the development files of other microcontrollers.

可选地,所述栈包括保留地址,所述在所述启动文件中栈的n个第一地址中一一存储所述n个变量,包括:Optionally, the stack includes reserved addresses, and the n variables are stored one by one in the n first addresses of the stack in the startup file, including:

在所述栈的保留地址中的所述n个第一地址中一一存储所述n个变量。The n variables are stored one by one in the n first addresses in the reserved addresses of the stack.

可选地,所述在所述启动文件中添加所述n个变量中每个变量的变量定义之后,还包括:Optionally, after adding the variable definition of each of the n variables in the startup file, the method further includes:

对所述启动文件进行编译,得到所述可执行文件;Compile the startup file to obtain the executable file;

其中,在编译过程中,获取所述栈的栈顶地址;获取所述栈顶地址在所述存储器中映射的目标地址;根据所述栈顶地址和所述目标地址,将所述n个第一地址一一映射至所述n个第二地址。Wherein, in the compilation process, the stack top address of the stack is obtained; the target address mapped by the stack top address in the memory is obtained; according to the stack top address and the target address, the nth One address is mapped to the n second addresses one by one.

可选地,所述获取所述栈顶地址在所述存储器中映射的目标地址,包括:Optionally, the obtaining the target address mapped by the stack top address in the memory includes:

若所述存储器中存在连续m个地址均未被占用,则将所述m个地址中的第一个地址作为所述栈顶地址映射的所述目标地址,所述m为所述栈的地址总数,所述m为大于或等于2的整数;If there are m consecutive addresses in the memory that are not occupied, the first address in the m addresses is used as the target address of the stack top address mapping, where m is the address of the stack The total number, the m is an integer greater than or equal to 2;

可选地,所述根据所述栈顶地址和所述目标地址,将所述n个第一地址一一映射至所述n个第二地址,包括:Optionally, mapping the n first addresses to the n second addresses one by one according to the stack top address and the target address, including:

对于所述n个第一地址中的每一个第一地址,均执行以下操作:For each of the n first addresses, the following operations are performed:

获取所述一个第一地址与所述栈顶地址之间的地址差作为指定地址差;Obtain the address difference between the one first address and the stack top address as the specified address difference;

将所述m个地址中与所述目标地址之间的地址差为所述指定地址差的地址作为所述一个第一地址映射的一个第二地址。An address whose address difference between the m addresses and the target address is the specified address difference is used as a second address mapped to the one first address.

可选地,所述对所述启动文件进行编译,得到所述可执行文件之后,还包括:Optionally, after compiling the startup file to obtain the executable file, the method further includes:

将所述可执行文件烧录至所述单片机;Burning the executable file to the microcontroller;

其中,所述可执行文件在所述单片机启动时执行,且所述可执行文件执行时将所述n个预设信息中的每个预设信息存储至所述存储器中对应的第二地址中,所述每个预设信息对应的第二地址是所述每个预设信息对应的变量在所述栈中所在的第一地址映射的第二地址。Wherein, the executable file is executed when the single-chip microcomputer is started, and each preset information of the n preset information is stored in the corresponding second address in the memory when the executable file is executed. , the second address corresponding to each preset information is the second address mapped to the first address where the variable corresponding to each preset information is located in the stack.

可选地,所述单片机用于在执行所述可执行文件后保存所述n个第二地址至所述存储器中,所述将所述可执行文件烧录至所述单片机之后,还包括:Optionally, the single-chip microcomputer is configured to save the n second addresses in the memory after executing the executable file, and after burning the executable file to the single-chip computer, the method further includes:

从所述存储器中获取所述n个第二地址;obtaining the n second addresses from the memory;

获取所述存储器中的所述n个第二地址中每个第二地址处存储的预设信息。Acquire preset information stored at each of the n second addresses in the memory.

可选地,所述预设信息为安装有所述单片机的设备的设备信息。Optionally, the preset information is device information of a device in which the single-chip microcomputer is installed.

第二方面,提供了一种设备信息存储装置,所述装置包括:In a second aspect, a device information storage device is provided, the device comprising:

第一添加模块,在启动文件中添加n个变量中每个变量的变量声明,所述n个变量与n个预设信息一一对应,所述n为正整数;The first adding module adds a variable declaration of each of the n variables in the startup file, the n variables are in one-to-one correspondence with the n preset information, and the n is a positive integer;

存储模块,在所述启动文件中栈的n个第一地址中一一存储所述n个变量,所述n个第一地址用于指示所述n个变量在所述栈中的存储位置;The storage module stores the n variables one by one in the n first addresses of the stack in the startup file, and the n first addresses are used to indicate the storage positions of the n variables in the stack;

第二添加模块,在所述启动文件中添加所述n个变量中每个变量的变量定义,所述每个变量的变量定义用于指定所述每个变量的初始值为对应的预设信息;The second adding module adds a variable definition of each of the n variables to the startup file, where the variable definition of each variable is used to specify that the initial value of each variable is corresponding preset information ;

其中,所述启动文件用于在编译后得到能够烧录至单片机的可执行文件,所述启动文件在编译时所述n个第一地址被一一映射至所述单片机的存储器中未被占用的n个第二地址,所述n个第二地址用于指示所述n个预设信息在所述存储器中的存储位置。Wherein, the startup file is used to obtain an executable file that can be burned into the microcontroller after compilation, and the n first addresses are mapped to the memory of the microcontroller one by one when the startup file is compiled and are not occupied in the memory of the microcontroller n second addresses, where the n second addresses are used to indicate the storage locations of the n preset information in the memory.

可选地,所述栈包括保留地址,所述存储模块用于:Optionally, the stack includes reserved addresses, and the storage module is used for:

在所述栈的保留地址中的所述n个第一地址中一一存储所述n个变量。The n variables are stored one by one in the n first addresses in the reserved addresses of the stack.

可选地,所述装置还包括:Optionally, the device further includes:

编译模块,用于对所述启动文件进行编译,得到所述可执行文件;a compiling module for compiling the startup file to obtain the executable file;

第一获取模块,用于在编译过程中,获取所述栈的栈顶地址;获取所述栈顶地址在所述存储器中映射的目标地址;The first obtaining module is used to obtain the stack top address of the stack in the compilation process; obtain the target address mapped by the stack top address in the memory;

映射模块,用于根据所述栈顶地址和所述目标地址,将所述n个第一地址一一映射至所述n个第二地址。A mapping module, configured to map the n first addresses to the n second addresses one by one according to the stack top address and the target address.

可选地,所述第一获取模块用于:Optionally, the first acquisition module is used for:

若所述存储器中存在连续m个地址均未被占用,则将所述m个地址中的第一个地址作为所述栈顶地址映射的所述目标地址,所述m为所述栈的地址总数,所述m为大于或等于2的整数;If there are m consecutive addresses in the memory that are not occupied, the first address in the m addresses is used as the target address of the stack top address mapping, where m is the address of the stack The total number, the m is an integer greater than or equal to 2;

可选地,所述映射模块用于:Optionally, the mapping module is used to:

对于所述n个第一地址中的每一个第一地址,均执行以下操作:For each of the n first addresses, the following operations are performed:

获取所述一个第一地址与所述栈顶地址之间的地址差作为指定地址差;Obtain the address difference between the one first address and the stack top address as the specified address difference;

将所述m个地址中与所述目标地址之间的地址差为所述指定地址差的地址作为所述一个第一地址映射的一个第二地址。An address whose address difference between the m addresses and the target address is the specified address difference is used as a second address mapped to the one first address.

可选地,所述装置还包括:Optionally, the device further includes:

烧录模块,用于将所述可执行文件烧录至所述单片机;a burning module, used for burning the executable file to the single-chip microcomputer;

其中,所述可执行文件在所述单片机启动时执行,且所述可执行文件执行时将所述n个预设信息中的每个预设信息存储至所述存储器中对应的第二地址中,所述每个预设信息对应的第二地址是所述每个预设信息对应的变量在所述栈中所在的第一地址映射的第二地址。Wherein, the executable file is executed when the single-chip microcomputer is started, and each preset information of the n preset information is stored in the corresponding second address in the memory when the executable file is executed. , the second address corresponding to each preset information is the second address mapped to the first address where the variable corresponding to each preset information is located in the stack.

可选地,所述装置还包括:Optionally, the device further includes:

第二获取模块,用于从所述存储器中获取所述n个第二地址;a second obtaining module, configured to obtain the n second addresses from the memory;

第三获取模块,用于获取所述存储器中的所述n个第二地址中每个第二地址处存储的预设信息。A third acquiring module, configured to acquire preset information stored at each of the n second addresses in the memory.

可选地,所述预设信息为安装有所述单片机的设备的设备信息。Optionally, the preset information is device information of a device in which the single-chip microcomputer is installed.

第三方面,提供了一种计算机设备,所述计算机设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述的信息存储方法。In a third aspect, there is provided a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being executed by the processor When implementing the above-mentioned information storage method.

第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述的信息存储方法。In a fourth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium stores a computer program, and the computer program implements the above-mentioned information storage method when executed by a processor.

第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述的信息存储方法的步骤。In a fifth aspect, there is provided a computer program product containing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described information storage method.

可以理解的是,上述第二方面、第三方面、第四方面、第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the second aspect, the third aspect, the fourth aspect, and the fifth aspect, reference may be made to the relevant descriptions in the first aspect, which will not be repeated here.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1是本申请实施例提供的一种信息存储方法的流程图;1 is a flowchart of a method for storing information provided by an embodiment of the present application;

图2是本申请实施例提供的一种启动文件的示意图;2 is a schematic diagram of a startup file provided by an embodiment of the present application;

图3是本申请实施例提供的一种设备信息存储装置的结构示意图;3 is a schematic structural diagram of a device information storage device provided by an embodiment of the present application;

图4是本申请实施例提供的一种计算机设备的结构示意图。FIG. 4 is a schematic structural diagram of a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

应当理解的是,本申请提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that the "plurality" mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, "/" means or means, for example, A/B can mean A or B; "and/or" in this document is only an association relationship that describes an associated object, It means that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solutions of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same function and effect. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like are not necessarily different.

在对本申请实施例进行详细地解释说明之前,先对本申请实施例的应用场景予以说明。Before explaining the embodiments of the present application in detail, the application scenarios of the embodiments of the present application are described first.

本申请实施例提供的信息存储方法应用于对信息进行存储的场景中,如可以应用于将设备信息或其他一些固定的信息存储至单片机的存储器的场景中。示例地,可以在单片机开发过程中,使用本申请实施例提供的信息存储方法实现将设备信息存储至单片机的存储器(如FLASH存储器等)。其中,该设备信息可以是需安装单片机的设备的相关信息,如可以包括设备的BOOT(启动)版本、DOWNLOAD(下载)版本、DIGA(诊断)版本等。The information storage method provided in the embodiment of the present application is applied to a scenario of storing information, for example, it may be applied to a scenario of storing device information or some other fixed information in a memory of a single-chip microcomputer. For example, the information storage method provided by the embodiments of the present application may be used to store the device information in the memory (eg, FLASH memory, etc.) of the single-chip microcomputer during the development process of the single-chip microcomputer. Wherein, the device information may be related information of the device to be installed with the microcontroller, for example, may include the BOOT (boot) version, the DOWNLOAD (download) version, and the DIGA (diagnosis) version of the device.

在本申请实施例提供的信息存储方法中,在启动文件的栈中为n个变量中的每个变量分配第一地址,并在启动文件中添加每个变量的变量定义,通过每个变量的变量定义可将每个变量对应的预设信息保存在启动文件中。如此,启动文件在编译时,启动文件的栈中每个变量的第一地址均被映射到单片机的存储器中未被占用的第二地址,第二地址即为每个变量对应的预设信息在单片机中的存储地址,后续即可将每个变量对应的预设信息存储至第二地址处。In the information storage method provided by the embodiment of the present application, a first address is allocated to each of the n variables in the stack of the startup file, and the variable definition of each variable is added to the startup file, and the variable definition of each variable is added to the startup file. The variable definition can save the preset information corresponding to each variable in the startup file. In this way, when the startup file is compiled, the first address of each variable in the stack of the startup file is mapped to the unoccupied second address in the memory of the single-chip microcomputer, and the second address is the preset information corresponding to each variable. The storage address in the single-chip microcomputer, and then the preset information corresponding to each variable can be stored at the second address.

这种情况下,在启动文件中并未指定预设信息在单片机的存储器中固定的存储地址,而是在编译启动文件时才将启动文件中存储有预设信息对应的变量的第一地址映射至单片机的存储器中未被占用的第二地址,也即是在编译启动文件时才为预设信息自动分配单片机的存储器中未被占用的第二地址。因而启动文件具有良好的移植性,即将启动文件移植至其他单片机的开发文件中后启动文件也可正常使用。In this case, the fixed storage address of the preset information in the memory of the microcontroller is not specified in the startup file, but the first address of the variable corresponding to the preset information stored in the startup file is mapped when the startup file is compiled. to the unoccupied second address in the memory of the single-chip microcomputer, that is, the unoccupied second address in the memory of the single-chip microcomputer is automatically allocated for the preset information when the startup file is compiled. Therefore, the startup file has good portability, and the startup file can also be used normally after transplanting the startup file to the development files of other microcontrollers.

下面对本申请实施例提供的信息存储方法进行详细地解释说明。The information storage method provided by the embodiments of the present application will be explained in detail below.

图1是本申请实施例提供的一种信息存储方法的流程图。参见图1,该方法包括以下步骤。FIG. 1 is a flowchart of an information storage method provided by an embodiment of the present application. Referring to Figure 1, the method includes the following steps.

步骤101:终端在启动文件中添加n个变量中每个变量的变量声明,该n个变量与n个预设信息一一对应。Step 101: The terminal adds a variable declaration of each of the n variables in the startup file, and the n variables correspond to the n preset information one-to-one.

比如,该n个变量中每个变量用于表示对应的预设信息的名称。预设信息可以预先进行设置,如预设信息可以为设备的设备信息,该设备是需要安装单片机的设备,该设备信息可以包括设备的BOOT版本、DOWNLOAD版本、DIGA版本等。n为正整数。For example, each of the n variables is used to represent the name of the corresponding preset information. The preset information can be set in advance, for example, the preset information can be the device information of the device, the device is the device that needs to install the microcontroller, and the device information can include the BOOT version, the DOWNLOAD version, the DIGA version, etc. of the device. n is a positive integer.

该启动文件是单片机的开发文件中的文件,该启动文件为可以修改的文件,其用于在开发单片机时初始化堆栈指针和程序计数器指针、设置堆栈大小、设置异常向量表的入口地址等。The startup file is a file in the development file of the single-chip microcomputer. The startup file is a file that can be modified, and is used to initialize the stack pointer and the program counter pointer, set the stack size, and set the entry address of the exception vector table when developing the single-chip microcomputer.

例如:若需要存储名称为downloadVersion、productVersion、diagVersion的设备信息,则在启动文件中添加downloadVersion、productVersion、diagVersion的变量声明,如终端可以在启动文件中添加如下语句以实现添加downloadVersion、productVersion、diagVersion的变量声明:EXTERN downloadVersion、EXTERN productVersion、EXTERNdiagVersion。其中,EXTERN修饰变量的声明,也即,修饰符EXTERN用在变量的声明前,用来说明此变量是在别处定义的,要在此处引用。For example: if you need to store device information with names of downloadVersion, productVersion, and diagVersion, add the variable declarations of downloadVersion, productVersion, and diagVersion to the startup file. For example, the terminal can add the following statement in the startup file to add downloadVersion, productVersion, and diagVersion. Variable declarations: EXTERN downloadVersion, EXTERN productVersion, EXTERNdiagVersion. Among them, EXTERN modifies the declaration of the variable, that is, the modifier EXTERN is used before the declaration of the variable to indicate that the variable is defined elsewhere and should be quoted here.

终端在启动文件中添加该n个变量中每个变量的变量声明之后,则可以进一步为该n个变量中的每个变量分配存储空间,即可以继续执行如下步骤102。After adding the variable declaration of each of the n variables in the startup file, the terminal can further allocate storage space for each of the n variables, that is, the following step 102 can be continued.

步骤102:终端在该启动文件中栈的n个第一地址中一一存储该n个变量。Step 102: The terminal stores the n variables one by one in the n first addresses of the stack in the startup file.

n个第一地址为该栈中的地址,n个第一地址用于指示该n个变量在该栈中的存储位置,该n个第一地址中的每个第一地址中均存储有该n个变量中的一个变量。The n first addresses are addresses in the stack, the n first addresses are used to indicate the storage locations of the n variables in the stack, and each of the n first addresses stores the One of n variables.

在这种情况下,终端通过在该栈中为该n个变量分配n个第一地址,将该n个变量一一存储在n个第一地址中,以实现该n个变量中的每个变量在该栈中均拥有一个存储位置。In this case, the terminal implements each of the n variables by assigning n first addresses to the n variables in the stack and storing the n variables in the n first addresses one by one Variables each have a storage location on the stack.

具体地,该启动文件的栈中包括保留地址,步骤102的操作可以为:终端在该栈的保留地址中的n个第一地址中一一存储该n个变量。Specifically, the stack of the startup file includes reserved addresses, and the operation of step 102 may be: the terminal stores the n variables in the n first addresses in the reserved addresses of the stack one by one.

保留地址是该栈中固定存在的一块地址空间,且该保留地址中的每一个地址均未被分配,即该保留地址中的每一个地址均未存储数据。The reserved address is a fixed address space in the stack, and each of the reserved addresses is not allocated, that is, no data is stored in each of the reserved addresses.

在这种情况下,终端可以从该栈的保留地址中选取n个地址作为第一地址,然后在该栈的保留地址中的n个第一地址中一一存储该n个变量,如此,可以在不影响该栈中的其他数据地址的情况下,将该n个变量存储至该栈。In this case, the terminal can select n addresses from the reserved addresses of the stack as the first addresses, and then store the n variables one by one in the n first addresses in the reserved addresses of the stack. In this way, it is possible to The n variables are stored to the stack without affecting other data addresses in the stack.

例如:若需要存储名称为downloadVersion的设备信息,在启动文件中添加downloadVersion的变量声明之后,终端需要在该栈的保留地址中存储downloadVersion变量。若该栈的保留地址的地址范围为32-64,则可以在该栈的保留地址中为downloadVersion变量分配第一地址32,以在第一地址32中存储downloadVersion变量。如终端可以通过在第一地址32中添加如下语句实现在第一地址32中存储downloadVersion变量:DCD downloadVersion。其中,DCD为数据定义伪指令,DCD用于分配一片连续的字存储单元并用指定的数据初始化。For example, if the device information named downloadVersion needs to be stored, after adding the variable declaration of downloadVersion in the startup file, the terminal needs to store the variable downloadVersion in the reserved address of the stack. If the address range of the reserved address of the stack is 32-64, the first address 32 may be allocated to the downloadVersion variable in the reserved address of the stack to store the downloadVersion variable in the first address 32 . For example, the terminal may store the downloadVersion variable in the first address 32 by adding the following statement to the first address 32: DCD downloadVersion. Among them, DCD is a pseudo-instruction for data definition, and DCD is used to allocate a continuous word storage unit and initialize it with the specified data.

步骤103:终端在该启动文件中添加该n个变量中每个变量的变量定义,该n个变量中每个变量的变量定义用于指定每个变量的初始值为对应的预设信息。其中,该启动文件用于在编译后得到能够烧录至该单片机的可执行文件,该启动文件在编译时n个第一地址被一一映射至该单片机的存储器中未被占用的n个第二地址,n个第二地址用于指示该n个预设信息在该存储器中的存储位置。Step 103: The terminal adds a variable definition of each of the n variables to the startup file, and the variable definition of each of the n variables is used to specify the initial value of each variable to corresponding preset information. The startup file is used to obtain an executable file that can be burned into the microcontroller after compilation, and the startup file is mapped to the n first addresses that are not occupied in the memory of the microcontroller during compilation. Two addresses, the n second addresses are used to indicate the storage locations of the n preset information in the memory.

示例地,对于downloadVersion变量,downloadVersion变量对应的设备信息为设备的DOWNLOAD版本,假设设备的DOWNLOAD版本为V01.02,则终端可以通过如下语句添加downloadVersion变量的变量定义:const unsigned char downloadVersion[]=“V01.02”,以指定downloadVersion变量的初始值为V01.02。For example, for the downloadVersion variable, the device information corresponding to the downloadVersion variable is the DOWNLOAD version of the device. Assuming that the DOWNLOAD version of the device is V01.02, the terminal can add the variable definition of the downloadVersion variable through the following statement: const unsigned char downloadVersion[]=" V01.02" to specify the initial value of the downloadVersion variable as V01.02.

在这种情况下,终端在该启动文件中添加该n个变量中每个变量的变量定义,则在将该n个第一地址映射至该n个第二地址之后,后续可以将该n个变量中每个变量的变量定义指定的初始值(即对应的预设信息)存储到该n个第二地址中,即将该n个预设信息一一存储到该n个第二地址中。In this case, the terminal adds the variable definition of each of the n variables in the startup file, then after the n first addresses are mapped to the n second addresses, the n first addresses can be subsequently mapped to the n second addresses. The initial value (ie, the corresponding preset information) specified by the variable definition of each variable in the variables is stored in the n second addresses, that is, the n preset information is stored in the n second addresses one by one.

值得注意的是,终端通过上述步骤101-步骤103可以实现在该启动文件中添加存储预设信息的代码语句。示例地,在添加存储预设信息的代码语句之后,得到的启动文件中的部分内容如图2所示。It is worth noting that the terminal can implement adding a code statement for storing preset information in the startup file through the above steps 101 to 103 . For example, after adding a code statement for storing preset information, part of the content in the obtained startup file is shown in FIG. 2 .

图2为启动文件的示意图,图2中包含声明部分201、栈部分202、变量定义部分203三个部分。声明部分201用于声明多个变量;栈部分202用于为多个变量分配栈地址,其中多个变量中包括在声明部分201中声明的变量;变量定义部分203用于定义声明的多个变量的初始值。FIG. 2 is a schematic diagram of a startup file. FIG. 2 includes three parts: a declaration part 201 , a stack part 202 , and a variable definition part 203 . The declaration part 201 is used to declare multiple variables; the stack part 202 is used to allocate stack addresses for multiple variables, wherein the multiple variables include the variables declared in the declaration part 201; the variable definition part 203 is used to define the declared multiple variables the initial value of .

图2中Module?cstartup用于标记代码的开始,即终端从Module?cstartup的下一条代码语句开始执行。在声明部分201中,终端添加了声明预设信息对应的downloadVersion变量、diagVersion变量、productVersion变量的代码语句。在栈部分202中的保留地址中终端添加了为downloadVersion变量、diagVersion变量、productVersion变量分配栈地址的代码语句:DCD downloadVersion、DCD diagVersion、DCDproductVersion,即在栈的保留地址中一一存储downloadVersion变量、diagVersion变量、productVersion变量。DCD sfe(CSTACK)用于表示栈顶。在变量定义部分203中,定义了downloadVersion变量、diagVersion变量、productVersion变量的初始值,即指定downloadVersion变量、diagVersion变量、productVersion变量的初始值一一为其对应的预设信息V01.02、V01.01、设备1代。Module in Figure 2? cstartup is used to mark the start of the code, i.e. the terminal starts from the Module? The next code statement of cstartup begins execution. In the declaration part 201, the terminal adds a code statement for declaring the downloadVersion variable, the diagVersion variable, and the productVersion variable corresponding to the preset information. In the reserved address in the stack part 202, the terminal adds code statements for allocating stack addresses for the downloadVersion variable, diagVersion variable, and productVersion variable: DCD downloadVersion, DCD diagVersion, DCDproductVersion, that is, store the downloadVersion variable, diagVersion one by one in the reserved address of the stack variable, productVersion variable. DCD sfe (CSTACK) is used to represent the top of the stack. In the variable definition part 203, the initial values of the downloadVersion variable, the diagVersion variable, and the productVersion variable are defined, that is, the initial values of the downloadVersion variable, the diagVersion variable, and the productVersion variable are specified for their corresponding preset information V01.02, V01.01 , Equipment 1 generation.

进一步地,终端通过上述步骤101-步骤103在该启动文件中添加存储预设信息的代码语句之后,就得到了该启动文件。之后,终端在需要开发单片机时,可以对该启动文件进行编译,得到可执行文件。对该启动文件进行编译的操作可以由终端中的编译器执行。Further, the terminal obtains the startup file after adding the code statement for storing the preset information in the startup file through the above steps 101 to 103 . Afterwards, when the terminal needs to develop the microcontroller, it can compile the startup file to obtain an executable file. Compiling the startup file can be performed by the compiler in the terminal.

其中,在编译过程中,终端获取该栈的栈顶地址;获取栈顶地址在该单片机的存储器中映射的目标地址;根据栈顶地址和目标地址,将n个第一地址一一映射至n个第二地址。Among them, during the compilation process, the terminal obtains the stack top address of the stack; obtains the target address mapped by the stack top address in the memory of the single-chip microcomputer; and maps the n first addresses to n one by one according to the stack top address and the target address a second address.

栈顶地址是指该栈中起始位置的地址,示例地,栈顶地址一般为0。The stack top address refers to the address of the starting position in the stack, for example, the stack top address is generally 0.

目标地址是指终端在编译启动文件时将栈顶地址映射到该单片机的存储器中的地址。The target address refers to the address where the terminal maps the top address of the stack to the memory of the microcontroller when compiling the startup file.

其中,终端获取栈顶地址在该存储器中映射的目标地址的操作可以为:若该存储器中存在连续m个地址均未被占用,则终端将该m个地址中的第一个地址作为栈顶地址映射的目标地址,m为该栈的地址总数,m为大于或等于2的整数。The operation for the terminal to obtain the target address mapped by the top address of the stack in the memory may be: if there are m consecutive addresses in the memory that are not occupied, the terminal uses the first address of the m addresses as the top of the stack The target address of the address mapping, m is the total number of addresses in the stack, and m is an integer greater than or equal to 2.

在编译的过程中,终端在该存储器中寻找连续m个均未被占用的地址,若该存储器中存在连续m个地址均未被占用,则说明该存储器中的该m个地址可以存储该栈中的所有地址中的数据,因此终端将该m个地址中的第一个地址作为栈顶地址映射的目标地址,如此是从该m个地址中的第一个地址开始存储该栈中的数据。During the compilation process, the terminal looks for m consecutive addresses that are not occupied in the memory. If there are m consecutive addresses that are not occupied in the memory, it means that the m addresses in the memory can store the stack. The data in all addresses in the terminal, so the terminal uses the first address of the m addresses as the target address of the stack top address mapping, so the data in the stack is stored from the first address of the m addresses .

在这种情况下,终端通过将该存储器中连续m个均未被占用的地址中的第一个地址作为目标地址,即作为栈顶地址映射的目标地址,可以保证该栈中的所有地址的数据均可以存储到该m个地址中,即可以保证该栈中n个第一地址中的n个变量可以存储到该m个未被占用的地址中的n个地址中。In this case, by using the first address of m consecutive unoccupied addresses in the memory as the target address, that is, as the target address of the stack top address mapping, the terminal can ensure that all addresses in the stack are All data can be stored in the m addresses, that is, it can be guaranteed that n variables in the n first addresses in the stack can be stored in n addresses in the m unoccupied addresses.

其中,终端根据该栈顶地址和目标地址,将n个第一地址一一映射至n个第二地址的操作可以为:对于n个第一地址中的每一个第一地址,均执行以下操作:终端获取一个第一地址与栈顶地址之间的地址差作为指定地址差;将该m个地址中与目标地址之间的地址差为指定地址差的地址作为这个第一地址映射的一个第二地址。The operation for the terminal to map the n first addresses to the n second addresses one by one according to the stack top address and the target address may be: for each of the n first addresses, perform the following operations : The terminal obtains the address difference between the first address and the stack top address as the specified address difference; the address where the address difference between the m addresses and the target address is the specified address difference is used as a first address mapping of the first address Second address.

在这种情况下,终端通过获取一个第一地址与栈顶地址之间的地址差,使得终端得到该栈中这个第一地址中的变量与栈顶地址中的数据之间的地址差,也就是指定地址差。将该指定地址差映射到存储器的地址中,则目标地址与这个第一地址映射到该存储器中的地址之间的地址差与指定地址差相等,因此终端将该m个地址中与目标地址之间的地址差为指定地址差的地址作为这个第一地址映射的一个第二地址,从而可以得到这个第一地址中的变量对应的预设信息在该存储器中的存储地址。In this case, by obtaining the address difference between a first address and the top address of the stack, the terminal obtains the address difference between the variable in the first address in the stack and the data in the top address of the stack, and also Is the specified address difference. The specified address difference is mapped to the address of the memory, then the address difference between the target address and the address mapped from the first address to the memory is equal to the specified address difference, so the terminal is the m address and the target address. The address difference between the specified address difference is used as a second address mapped by the first address, so that the storage address in the memory of the preset information corresponding to the variable in the first address can be obtained.

如此,终端通过对n个第一地址中的每一个第一地址均执行上述操作,可以得到与该n个变量一一对应的n个预设信息在该存储器中的存储地址。In this way, by performing the above operations on each of the n first addresses, the terminal can obtain the storage addresses of n preset information in the memory corresponding to the n variables one-to-one.

进一步地,终端对该启动文件进行编译,得到可执行文件之后,还可以将该可执行文件烧录至该单片机中。Further, after compiling the startup file by the terminal to obtain an executable file, the executable file can also be burned into the microcontroller.

这种情况下,该单片机在启动时执行该可执行文件,实现声明该n个变量、将n个变量中每个变量的变量定义中指定的初始值(即对应的预设信息)存储至该栈中每个变量所在的第一地址所映射的第二地址中的操作。也即,该单片机在启动时执行该可执行文件,在执行该可执行文件时,将该n个预设信息中的每个预设信息存储至该存储器中对应的第二地址中。每个预设信息对应的第二地址是这个预设信息对应的变量在该栈中所在的第一地址映射的第二地址。In this case, the single-chip microcomputer executes the executable file at startup, declares the n variables, and stores the initial value (ie, the corresponding preset information) specified in the variable definition of each variable in the n variables into the The operation in the second address mapped by the first address of each variable in the stack. That is, the single-chip microcomputer executes the executable file when it starts up, and when executing the executable file, stores each preset information in the n preset information into a corresponding second address in the memory. The second address corresponding to each preset information is the second address mapped to the first address in the stack where the variable corresponding to the preset information is located.

更进一步地,单片机在执行该可执行文件后,还可以保存n个第二地址至该存储器中,以便在需要时可以据此读取该n个预设信息。Furthermore, after executing the executable file, the single-chip microcomputer can also save n second addresses in the memory, so that the n preset information can be read accordingly when needed.

值得注意的是,将该单片机安装至该设备之后,技术人员可以随时查看该n个预设信息。具体地,终端从该单片机的存储器中获取n个第二地址;获取该存储器中的n个第二地址中每个第二地址处存储的预设信息。It is worth noting that after the microcontroller is installed in the device, the technician can view the n preset information at any time. Specifically, the terminal obtains n second addresses from the memory of the single-chip microcomputer; and obtains preset information stored at each of the n second addresses in the memory.

如此,终端可以通过n个第二地址获取到n个第二地址中的每个第二地址中存储的预设信息,之后终端将获取的n个预设信息展示在显示屏上以供技术人员查看。In this way, the terminal can acquire the preset information stored in each of the n second addresses through the n second addresses, and then the terminal displays the acquired n preset information on the display screen for technicians to use Check.

值得注意的是,本申请实施例提供的信息存储方法是通过修改启动文件的方式实现预设信息的存储的。由于启动文件中的代码语句比较简单,技术人员学起来较为容易,所以对于技术人员来说修改启动文件比修改链接配置文件更为简单,如此可以提高工作效率。并且,因为几乎每种编译器和每种单片机都会带有启动文件,所以修改启动文件可以在编译器的工程内完成,无需修改外部的文件,从而不仅可以减少工作量,提高工作效率,而且可以在更换编译器后也无需更改本申请实施例提供的信息存储方法。此外,修改启动文件的方式不用固定预设信息在存储器中的存储地址,预设信息在存储器中的存储地址是在启动文件的编译过程中根据存储器中未被占用的地址自动分配的,所以可以很容易的移植到其他单片机的开发平台。据此可知,本申请实施例使用一种更加简易、方便、高效的方式来存储预设信息,操作简单、维护方便,且能够更加直观的查看所保存的预设信息。It is worth noting that, the information storage method provided by the embodiment of the present application realizes the storage of preset information by modifying the startup file. Since the code statement in the startup file is relatively simple, and it is easier for technicians to learn, it is easier for technicians to modify the startup file than to modify the link configuration file, which can improve work efficiency. And, because almost every compiler and every single-chip microcomputer will have a startup file, modifying the startup file can be done in the compiler project without modifying external files, which can not only reduce workload, improve work efficiency, but also The information storage method provided by the embodiments of the present application does not need to be changed after the compiler is replaced. In addition, the method of modifying the startup file does not need to fix the storage address of the preset information in the memory. The storage address of the preset information in the memory is automatically allocated according to the unoccupied addresses in the memory during the compilation process of the startup file, so you can It is easy to transplant to other development platforms of MCU. It can be seen from this that the embodiment of the present application uses a simpler, more convenient and more efficient way to store the preset information, which is easy to operate, easy to maintain, and can view the stored preset information more intuitively.

在本申请实施例中,终端在启动文件中添加n个变量中每个变量的变量声明,并在启动文件的栈中的n个第一地址中一一存储n个变量,之后在启动文件中添加n个变量中每个变量的变量定义,每个变量的变量定义用于指定每个变量的初始值为对应的设备信息。启动文件在编译时n个第一地址被一一映射至单片机的存储器中未被占用的n个第二地址,从而使得后续该启动文件经编译得到的可执行文件被执行时,n个第一地址中的每个第一地址中的变量对应的预设信息可以被存储在单片机的存储器中对应的第二地址中。这种情况下,在启动文件中并未指定预设信息在单片机的存储器中固定的存储地址,而是在编译启动文件时才为预设信息自动分配单片机的存储器中未被占用的第二地址。因而启动文件具有良好的移植性,即将启动文件移植至其他单片机的开发文件中后启动文件也可正常使用。In the embodiment of the present application, the terminal adds a variable declaration of each of the n variables in the startup file, and stores n variables one by one in the n first addresses in the stack of the startup file, and then stores the n variables in the startup file. A variable definition of each variable in the n variables is added, and the variable definition of each variable is used to specify that the initial value of each variable is the corresponding device information. When the startup file is compiled, the n first addresses are mapped to the unoccupied n second addresses in the memory of the microcontroller one by one, so that when the executable file obtained by compiling the startup file is executed subsequently, the n first addresses are not occupied. The preset information corresponding to the variable in each first address of the addresses may be stored in the corresponding second address in the memory of the microcontroller. In this case, the fixed storage address of the preset information in the memory of the single-chip microcomputer is not specified in the startup file, but the unoccupied second address in the memory of the single-chip microcomputer is automatically allocated for the preset information when the startup file is compiled. . Therefore, the startup file has good portability, and the startup file can also be used normally after transplanting the startup file to the development files of other microcontrollers.

图3是本申请实施例提供的一种设备信息存储装置的结构示意图。该设备信息存储装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部,该计算机设备可以为下文图4所示的计算机设备。参见图3,该装置包括:第一添加模块301、存储模块302、第二添加模块303。FIG. 3 is a schematic structural diagram of a device information storage device provided by an embodiment of the present application. The device information storage device may be implemented by software, hardware or a combination of the two as part or all of a computer device, and the computer device may be the computer device shown in FIG. 4 below. Referring to FIG. 3 , the apparatus includes: a first adding module 301 , a storage module 302 , and a second adding module 303 .

第一添加模块301,在启动文件中添加n个变量中每个变量的变量声明,该n个变量与n个预设信息一一对应,n为正整数;The first adding module 301 adds a variable declaration of each of the n variables in the startup file, the n variables are in one-to-one correspondence with the n preset information, and n is a positive integer;

存储模块302,在该启动文件中栈的n个第一地址中一一存储该n个变量,n个第一地址用于指示该n个变量在该栈中的存储位置;The storage module 302 stores the n variables one by one in the n first addresses of the stack in the startup file, and the n first addresses are used to indicate the storage positions of the n variables in the stack;

第二添加模块303,在该启动文件中添加该n个变量中每个变量的变量定义,该每个变量的变量定义用于指定该每个变量的初始值为对应的预设信息;The second adding module 303, adds the variable definition of each variable in the n variables in the startup file, and the variable definition of each variable is used to specify that the initial value of each variable is the corresponding preset information;

其中,该启动文件用于在编译后得到能够烧录至单片机的可执行文件,该启动文件在编译时n个第一地址被一一映射至该单片机的存储器中未被占用的n个第二地址,n个第二地址用于指示该n个预设信息在该存储器中的存储位置。The startup file is used to obtain an executable file that can be burned into the microcontroller after compilation, and the startup file is mapped to n second addresses that are not occupied in the memory of the microcontroller during compilation. address, and the n second addresses are used to indicate the storage locations of the n preset information in the memory.

可选地,该栈包括保留地址,存储模块302用于:Optionally, the stack includes reserved addresses, and the storage module 302 is used for:

在该栈的保留地址中的n个第一地址中一一存储该n个变量。The n variables are stored one by one in the n first addresses in the reserved addresses of the stack.

可选地,该装置还包括:Optionally, the device also includes:

编译模块,用于对该启动文件进行编译,得到该可执行文件;A compilation module is used to compile the startup file to obtain the executable file;

第一获取模块,用于在编译过程中,获取该栈的栈顶地址;获取该栈顶地址在该存储器中映射的目标地址;The first acquisition module is used to obtain the stack top address of the stack in the compilation process; obtain the target address mapped by the stack top address in the memory;

映射模块,用于根据该栈顶地址和该目标地址,将n个第一地址一一映射至n个第二地址。The mapping module is configured to map the n first addresses to the n second addresses one by one according to the stack top address and the target address.

可选地,第一获取模块用于:Optionally, the first obtaining module is used for:

若该存储器中存在连续m个地址均未被占用,则将该m个地址中的第一个地址作为栈顶地址映射的目标地址,m为该栈的地址总数,m为大于或等于2的整数;If there are m consecutive addresses in the memory that are not occupied, the first address in the m addresses is used as the target address of the stack top address mapping, m is the total number of addresses in the stack, m is greater than or equal to 2 integer;

可选地,该映射模块用于:Optionally, the mapping module is used to:

对于n个第一地址中的每一个第一地址,均执行以下操作:For each of the n first addresses, the following operations are performed:

获取一个第一地址与栈顶地址之间的地址差作为指定地址差;Obtain the address difference between the first address and the stack top address as the specified address difference;

将该m个地址中与目标地址之间的地址差为指定地址差的地址作为这个第一地址映射的一个第二地址。The address where the address difference between the m addresses and the target address is the specified address difference is used as a second address mapped to the first address.

可选地,该装置还包括:Optionally, the device also includes:

烧录模块,用于将该可执行文件烧录至该单片机;The burning module is used to burn the executable file to the microcontroller;

其中,该可执行文件在该单片机启动时执行,且该可执行文件执行时将该n个预设信息中的每个预设信息存储至该存储器中对应的第二地址中,每个预设信息对应的第二地址是每个预设信息对应的变量在该栈中所在的第一地址映射的第二地址。Wherein, the executable file is executed when the single-chip microcomputer is started, and when the executable file is executed, each preset information of the n preset information is stored in the corresponding second address in the memory, and each preset information is stored in the corresponding second address in the memory. The second address corresponding to the information is the second address mapped to the first address where the variable corresponding to each preset information is located in the stack.

可选地,该装置还包括:Optionally, the device also includes:

第二获取模块,用于从该存储器中获取n个第二地址;The second obtaining module is used to obtain n second addresses from the memory;

第三获取模块,用于获取该存储器中的n个第二地址中每个第二地址处存储的预设信息。The third acquiring module is configured to acquire preset information stored at each of the n second addresses in the memory.

可选地,该预设信息为安装有该单片机的设备的设备信息。Optionally, the preset information is device information of a device on which the single-chip microcomputer is installed.

在本申请实施例中,在启动文件中添加n个变量中每个变量的变量声明,并在启动文件的栈中的n个第一地址中一一存储n个变量,之后在启动文件中添加n个变量中每个变量的变量定义,每个变量的变量定义用于指定每个变量的初始值为对应的设备信息。启动文件在编译时n个第一地址被一一映射至单片机的存储器中未被占用的n个第二地址,从而使得后续该启动文件经编译得到的可执行文件被执行时,n个第一地址中的每个第一地址中的变量对应的预设信息可以被存储在单片机的存储器中对应的第二地址中。这种情况下,在启动文件中并未指定预设信息在单片机的存储器中固定的存储地址,而是在编译启动文件时才为预设信息自动分配单片机的存储器中未被占用的第二地址。因而启动文件具有良好的移植性,即将启动文件移植至其他单片机的开发文件中后启动文件也可正常使用。In the embodiment of the present application, a variable declaration of each variable in the n variables is added in the startup file, and n variables are stored one by one in the n first addresses in the stack of the startup file, and then added in the startup file. The variable definition of each variable in the n variables, and the variable definition of each variable is used to specify the initial value of each variable to correspond to the device information. When the startup file is compiled, the n first addresses are mapped to the unoccupied n second addresses in the memory of the microcontroller one by one, so that when the executable file obtained by compiling the startup file is executed subsequently, the n first addresses are not occupied. The preset information corresponding to the variable in each first address of the addresses may be stored in the corresponding second address in the memory of the microcontroller. In this case, the fixed storage address of the preset information in the memory of the single-chip microcomputer is not specified in the startup file, but the unoccupied second address in the memory of the single-chip microcomputer is automatically allocated for the preset information when the startup file is compiled. . Therefore, the startup file has good portability, and the startup file can also be used normally after transplanting the startup file to the development files of other microcontrollers.

需要说明的是:上述实施例提供的设备信息存储装置在对预设信息进行存储时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。It should be noted that: when the device information storage device provided in the above embodiment stores the preset information, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by different The function module is completed, that is, the internal structure of the device is divided into different function modules, so as to complete all or part of the functions described above.

上述实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。The functional units and modules in the above embodiments may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware. It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present application.

上述实施例提供的设备信息存储装置与信息存储方法实施例属于同一构思,上述实施例中单元、模块的具体工作过程及带来的技术效果,可参见方法实施例部分,此处不再赘述。The device information storage device and the information storage method provided by the above embodiments belong to the same concept. The specific working process of the units and modules in the above embodiments and the technical effects brought by them can be found in the method embodiment section, which will not be repeated here.

图4为本申请实施例提供的一种计算机设备的结构示意图。如图4所示,计算机设备4包括:处理器40、存储器41以及存储在存储器41中并可在处理器40上运行的计算机程序42,处理器40执行计算机程序42时实现上述实施例中的信息存储方法中的步骤。FIG. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in FIG. 4 , the computer device 4 includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and running on the processor 40. When the processor 40 executes the computer program 42, the above-mentioned embodiments are implemented. Steps in an information storage method.

计算机设备4可以是一个通用计算机设备或一个专用计算机设备。在具体实现中,计算机设备4可以是台式机、便携式电脑、掌上电脑、平板电脑等,本申请实施例不限定计算机设备4的类型。本领域技术人员可以理解,图4仅仅是计算机设备4的举例,并不构成对计算机设备4的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,比如还可以包括输入输出设备、网络接入设备等。Computer device 4 may be a general purpose computer device or a special purpose computer device. In a specific implementation, the computer device 4 may be a desktop computer, a portable computer, a palmtop computer, a tablet computer, etc. The embodiment of the present application does not limit the type of the computer device 4 . Those skilled in the art can understand that FIG. 4 is only an example of the computer device 4, and does not constitute a limitation on the computer device 4. It may include more or less components than the one shown, or combine some components, or different components , for example, it may also include input and output devices, network access devices, and so on.

处理器40可以是中央处理单元(Central Processing Unit,CPU),处理器40还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者也可以是任何常规的处理器。The processor 40 may be a central processing unit (Central Processing Unit, CPU), and the processor 40 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC) , Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or it may be any conventional processor.

存储器41在一些实施例中可以是计算机设备4的内部存储单元,比如计算机设备4的硬盘或内存。存储器41在另一些实施例中也可以是计算机设备4的外部存储设备,比如计算机设备4上配备的插接式硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(SecureDigital,SD)卡、闪存卡(Flash Card)等。进一步地,存储器41还可以既包括计算机设备4的内部存储单元也包括外部存储设备。存储器41用于存储操作系统、应用程序、引导装载程序(Boot Loader)、数据以及其他程序等。存储器41还可以用于暂时地存储已经输出或者将要输出的数据。The memory 41 may in some embodiments be an internal storage unit of the computer device 4 , such as a hard disk or memory of the computer device 4 . The memory 41 may also be an external storage device of the computer device 4 in other embodiments, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card equipped on the computer device 4 , Flash card (Flash Card) and so on. Further, the memory 41 may also include both an internal storage unit of the computer device 4 and an external storage device. The memory 41 is used to store an operating system, application programs, a boot loader (Boot Loader), data, and other programs. The memory 41 can also be used to temporarily store data that has been output or is to be output.

本申请实施例还提供了一种计算机设备,该计算机设备包括:至少一个处理器、存储器以及存储在该存储器中并可在该至少一个处理器上运行的计算机程序,该处理器执行该计算机程序时实现上述任意各个方法实施例中的步骤。Embodiments of the present application also provide a computer device, the computer device comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor executing the computer program The steps in any of the foregoing method embodiments are implemented at the same time.

本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时可实现上述各个方法实施例中的步骤。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.

本申请实施例提供了一种计算机程序产品,当其在计算机上运行时,使得计算机执行上述各个方法实施例中的步骤。The embodiments of the present application provide a computer program product, which, when running on a computer, enables the computer to execute the steps in the foregoing method embodiments.

集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述方法实施例中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,该计算机程序包括计算机程序代码,该计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。该计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,只读光盘)、磁带、软盘和光数据存储设备等。本申请提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。The integrated unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above method embodiments can be implemented by a computer program that instructs relevant hardware. The computer program can be stored in a computer-readable storage medium, and the computer program can be When executed by the processor, the steps of the foregoing method embodiments may be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include at least: any entity or device capable of carrying computer program codes to the photographing device/terminal device, recording medium, computer memory, ROM (Read-Only Memory, read-only memory), RAM (Random Access Memory) , random access memory), CD-ROM (Compact Disc Read-Only Memory, CD-ROM), magnetic tape, floppy disk and optical data storage devices, etc. The computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, may be a non-transitory storage medium.

应当理解的是,实现上述实施例的全部或部分步骤可以通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。该计算机指令可以存储在上述计算机可读存储介质中。It should be understood that, all or part of the steps of implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the computer-readable storage medium described above.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

在本申请所提供的实施例中,应该理解到,所揭露的装置/计算机设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/计算机设备实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/computer equipment and method may be implemented in other manners. For example, the apparatus/computer equipment embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components. May be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that: it can still be used for the above-mentioned implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the application, and should be included in the within the scope of protection of this application.

Claims (10)

1. An information storage method, the method comprising:
adding a variable statement of each variable in n variables in a starting file, wherein the n variables correspond to n preset information one by one, and n is a positive integer;
storing the n variables one by one in n first addresses of a stack in the startup file, wherein the n first addresses are used for indicating storage positions of the n variables in the stack;
adding a variable definition of each variable in the n variables into the starting file, wherein the variable definition of each variable is used for appointing an initial value of each variable as corresponding preset information;
the starting file is used for obtaining an executable file capable of being burned into a single chip microcomputer after compiling, the n first addresses are mapped to n unoccupied second addresses in a memory of the single chip microcomputer one by one during compiling of the starting file, and the n second addresses are used for indicating storage positions of the n preset information in the memory.
2. The method of claim 1, wherein the stack includes a reserved address, and wherein storing the n variables one by one in the n first addresses of the stack in the startup file comprises:
storing the n variables one by one in the n first addresses in the reserved addresses of the stack.
3. The method of claim 1, wherein after adding the variable definition for each of the n variables in the startup file, further comprising:
compiling the starting file to obtain the executable file;
acquiring a stack top address of the stack in the compiling process; acquiring a target address of the mapping of the stack top address in the memory; and mapping the n first addresses to the n second addresses one by one according to the stack top address and the target address.
4. The method of claim 3, wherein the obtaining the target address of the top-of-stack address mapped in the memory comprises:
if m continuous addresses are all unoccupied in the memory, taking a first address of the m addresses as the target address mapped by the stack top address, wherein m is the total number of the addresses of the stack, and is an integer greater than or equal to 2;
the mapping the n first addresses to the n second addresses one by one according to the stack top address and the target address includes:
for each of the n first addresses, performing the following:
acquiring an address difference between the first address and the stack top address as a designated address difference;
and taking the address with the address difference between the m addresses and the target address as the specified address difference as a second address of the first address mapping.
5. The method of claim 3, wherein after compiling the boot file to obtain the executable file, further comprising:
burning the executable file to the single chip microcomputer;
the executable file is executed when the single chip microcomputer is started, each piece of preset information in the n pieces of preset information is stored into a corresponding second address in the memory when the executable file is executed, and the second address corresponding to each piece of preset information is a second address of a first address mapping where a variable corresponding to each piece of preset information is located in the stack.
6. The method of claim 5, wherein the single-chip microcomputer is configured to save the n second addresses into the memory after executing the executable file, and wherein after burning the executable file into the single-chip microcomputer, the method further comprises:
obtaining the n second addresses from the memory;
and acquiring preset information stored at each second address in the n second addresses in the memory.
7. The method according to any one of claims 1 to 6, wherein the preset information is device information of a device in which the single chip microcomputer is installed.
8. An apparatus for storing device information, the apparatus comprising:
the device comprises a first adding module, a second adding module and a third adding module, wherein the first adding module is used for adding a variable statement of each variable in n variables in a starting file, the n variables correspond to n pieces of preset information one by one, and n is a positive integer;
the storage module is used for storing the n variables in n first addresses of a stack in the starting file one by one, wherein the n first addresses are used for indicating storage positions of the n variables in the stack;
a second adding module, configured to add a variable definition of each variable of the n variables to the start file, where the variable definition of each variable is used to specify an initial value of each variable as corresponding preset information;
the starting file is used for obtaining an executable file capable of being burned into a single chip microcomputer after compiling, the n first addresses are mapped to n unoccupied second addresses in a memory of the single chip microcomputer one by one during compiling of the starting file, and the n second addresses are used for indicating storage positions of the n preset information in the memory.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program when executed by the processor implementing the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202210147902.2A 2022-02-17 2022-02-17 Information storage method, apparatus, device and storage medium Active CN114510437B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210147902.2A CN114510437B (en) 2022-02-17 2022-02-17 Information storage method, apparatus, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210147902.2A CN114510437B (en) 2022-02-17 2022-02-17 Information storage method, apparatus, device and storage medium

Publications (2)

Publication Number Publication Date
CN114510437A true CN114510437A (en) 2022-05-17
CN114510437B CN114510437B (en) 2025-09-09

Family

ID=81551863

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210147902.2A Active CN114510437B (en) 2022-02-17 2022-02-17 Information storage method, apparatus, device and storage medium

Country Status (1)

Country Link
CN (1) CN114510437B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077017A (en) * 2012-12-27 2013-05-01 惠州市德赛西威汽车电子有限公司 Embedded memory multiplexing method
CN103136107A (en) * 2011-12-03 2013-06-05 南京南瑞继保电气有限公司 Variable debugging method of embedded program dynamic storage allocation
CN104820612A (en) * 2015-05-22 2015-08-05 网宿科技股份有限公司 Memory executing method for executable file
US20170168472A1 (en) * 2015-09-29 2017-06-15 Kabushiki Kaisha Toshiba Information processing apparatus or information communication terminal, and information processing method
CN108958795A (en) * 2018-08-01 2018-12-07 郑州云海信息技术有限公司 BootLoader code huge profit method and development board in a kind of embedded system
CN109144491A (en) * 2017-06-27 2019-01-04 中兴通讯股份有限公司 Microcomputer development platform
CN112732345A (en) * 2021-01-06 2021-04-30 北京科银京成技术有限公司 Starting method, device, equipment and storage medium of embedded system
CN113031932A (en) * 2021-03-11 2021-06-25 腾讯科技(深圳)有限公司 Project development method and device, electronic equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136107A (en) * 2011-12-03 2013-06-05 南京南瑞继保电气有限公司 Variable debugging method of embedded program dynamic storage allocation
CN103077017A (en) * 2012-12-27 2013-05-01 惠州市德赛西威汽车电子有限公司 Embedded memory multiplexing method
CN104820612A (en) * 2015-05-22 2015-08-05 网宿科技股份有限公司 Memory executing method for executable file
US20170168472A1 (en) * 2015-09-29 2017-06-15 Kabushiki Kaisha Toshiba Information processing apparatus or information communication terminal, and information processing method
CN109144491A (en) * 2017-06-27 2019-01-04 中兴通讯股份有限公司 Microcomputer development platform
CN108958795A (en) * 2018-08-01 2018-12-07 郑州云海信息技术有限公司 BootLoader code huge profit method and development board in a kind of embedded system
CN112732345A (en) * 2021-01-06 2021-04-30 北京科银京成技术有限公司 Starting method, device, equipment and storage medium of embedded system
CN113031932A (en) * 2021-03-11 2021-06-25 腾讯科技(深圳)有限公司 Project development method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114510437B (en) 2025-09-09

Similar Documents

Publication Publication Date Title
CN103718155B (en) runtime system
CN109062617B (en) Application method of platform supporting multiple types of equipment and mobile terminal
US8566372B2 (en) Method and device for dynamically loading relocatable file
US10929149B2 (en) Method and system for updating firmware
US20070234286A1 (en) Methods and apparatus to implement annotation based thunking
CN112818176B (en) Data processing method, device, equipment and storage medium
CN102364433B (en) Method for realizing Wine construction tool transplanting on ARM (Advanced RISC Machines) processor
CN114546934A (en) File system migration method, device, device and storage medium
CN114706533B (en) GPT partition table-based multi-file multi-stage starting loading method and device
CN112905180B (en) Instruction optimization method and device
CN112328241B (en) Method and device for creating Android library module dependency relationship in application program development
CN112148746B (en) Method, device, electronic device and storage medium for generating database table structure document
CN116719531B (en) Object conversion method, system and medium based on runtime bytecode editing
CN114510437A (en) Information storage method, device, equipment and storage medium
CN110333870B (en) Simulink model variable distribution processing method, device and equipment
WO2022036628A1 (en) Method for iteratively calling gpu shader programs, and gpu, compiler and gpu driver
CN117193872A (en) Chip starting firmware device and method based on symbol table dynamic execution
CN103235745A (en) Address conflict detection method and device
CN112114850B (en) Method for dispersedly loading FLASH programs in and out of STM32 single chip microcomputer based on serial port
CN103473319B (en) Statistical method for hotspot data
CN106294143A (en) The adjustment method of the depositor of chip and device
US12353884B2 (en) Cross-linking method and apparatus, electronic device and storage medium
CN112068851B (en) Method and device for dynamically configuring and running system ROM files of electronic equipment
CN116661876B (en) System startup method, file generation method, electronic equipment and server
CN115981741A (en) Relocation method, device, equipment and medium for boot loader firmware

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant