Updating method and device of real-time operating system, equipment, medium and product

By compiling the executable program files of the FreeRTOS real-time operating system into the main program file and application file, independent updates of each program module of the system are achieved, solving the problem that the update method cannot be updated independently in the existing technology, saving update time and resources.

CN119883270APending Publication Date: 2025-04-25BEIJING HEXINRUITONG POWER TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411753799.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing FreeRTOS real-time operating system update method cannot independently update some content in the program file, resulting in waste of resources and long update time.

Method used

Compile the executable program file of the real-time operating system into a main program file and at least one application file. By determining the program file to be updated, replace the program file to be updated with the updated program file, and restart the real-time operating system to complete the update of the real-time operating system.

Benefits of technology

It realizes independent updates to each program module of the system, saving update time and resources, and reducing time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883270A_ABST
    Figure CN119883270A_ABST
Patent Text Reader

Abstract

The invention discloses an updating method and device of a real-time operating system, equipment, a medium and a product. The method comprises the following steps: compiling an executable program file corresponding to a real-time operating system into a main program file and at least one application program file; determining a program file to be updated from the main program file and the at least one application program file; replacing the to-be-updated program file with the updated program file, and restarting the real-time operating system to complete updating of the real-time operating system; wherein the main program and the application program are configured with function calling functions, and the function calling functions are used for realizing mutual function calling between the main program and the application program. According to the method, one executable file corresponding to the real-time operating system is split into one main program file and a plurality of application program files, and each program module of the system can be independently updated, so that the updating time is saved, and resource waste is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, equipment, medium and product for updating a real-time operating system. Background Art

[0002] The operating system and application programs of the FreeRTOS real-time operating system commonly used in embedded devices are usually compiled into one executable program file and do not support dynamic library loading.

[0003] If the FreeRTOS real-time operating system wants to update part of the content in the application, it is necessary to comprehensively update the entire executable program file. It is impossible to independently update a certain program module of the system according to demand.

[0004] However, the above method of updating the entire executable program file will result in a waste of resources, and the long update time will result in a high time cost. Summary of the invention

[0005] The present invention provides a real-time operating system update method, device, equipment, medium and product to solve the problem that the existing real-time operating system update method cannot independently update part of the content in the program file.

[0006] According to one aspect of the present invention, there is provided a method for updating a real-time operating system, comprising:

[0007] Compiling the executable program file corresponding to the real-time operating system into a main program file and at least one application program file;

[0008] Determining a program file to be updated from the one main program file and the at least one application program file;

[0009] Using the updated program file to replace the program file to be updated, and restarting the real-time operating system to complete the update of the real-time operating system;

[0010] The main program and the application program are configured with a function calling function, and the function calling function is used to implement mutual function calling between the main program and the application program.

[0011] According to another aspect of the present invention, there is provided a device for updating a real-time operating system, comprising:

[0012] A compiling module, used for compiling the executable program file corresponding to the real-time operating system into a main program file and at least one application program file;

[0013] A determination module, used to determine a program file to be updated from the one main program file and the at least one application program file;

[0014] An updating module, used to replace the program file to be updated with the updated program file, and restart the real-time operating system to complete the update of the real-time operating system;

[0015] The main program and the application program are configured with a function calling function, and the function calling function is used to implement mutual function calling between the main program and the application program.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor;

[0018] and a memory communicatively coupled to the at least one processor;

[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the real-time operating system update method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the real-time operating system update method described in any embodiment of the present invention when executed.

[0021] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the real-time operating system update method according to any embodiment of the present invention is implemented.

[0022] The technical solution of the embodiment of the present invention solves the problem that the real-time operating system cannot perform software updates on a certain module therein by compiling the executable program file corresponding to the real-time operating system into a main program file and at least one application file, thereby achieving the beneficial effect of being able to independently update each program module of the system.

[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Figure 1 A schematic diagram of a flow chart of a method for updating an application program provided in Embodiment 1 of the present invention;

[0026] Figure 2 A schematic diagram of a real-time operating system initialization process provided by an embodiment of the present invention;

[0027] Figure 3 A schematic diagram of a real-time operating system initialization process provided by an embodiment of the present invention;

[0028] Figure 4 A schematic diagram of the structure of a real-time operating system update device provided in Embodiment 2 of the present invention;

[0029] Figure 5 A schematic diagram of the structure of an embedded device of a method for updating an application program according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should belong to the scope of protection of the present invention. It should be understood that the various steps recorded in the method implementation of the present invention can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0035] Embodiment 1

[0036] Figure 1 This is a flow chart of a method for updating an application provided in Embodiment 1 of the present invention. The method is applicable to the case of updating a real-time operating system, and is particularly applicable to the case of updating a part of the program in the real-time operating system. The method can be executed by an application updating device, wherein the device can be implemented by software and / or hardware and is generally integrated in an electronic device. In this embodiment, the electronic device includes but is not limited to: an embedded device.

[0037] like Figure 1 As shown, a method for updating an application program provided in Embodiment 1 of the present invention includes the following steps:

[0038] S110, compile the executable program file corresponding to the real-time operating system into a main program file and at least one application program file.

[0039] Among them, the real-time operating system FreeRTOS is the real-time operating system kernel in embedded system development, providing a reliable software foundation for device development in many fields. Multiple applications are installed on the real-time operating system, and multiple applications run on the real-time operating system.

[0040] In this embodiment, when writing the executable program file corresponding to the real-time operating system, the real-time operating system can be compiled into a main program file, and multiple applications running on the real-time operating system can be compiled into corresponding application files, with one application file corresponding to one application.

[0041] Among them, the main program file can be a bin file, and the application file can be a dynamic library so file.

[0042] In this embodiment, the main program and the application program are configured with a function calling function, and the function calling function is used to implement mutual function calling between the main program and the application program.

[0043] The main program and the application program can implement the function call function, the function call function of the main program is specifically manifested as the main program calling the function in the dynamic library, and the function call function of the application program is specifically manifested as the dynamic library calling the function in the main program. The function call function of the main program and the application program is implemented based on the symbol mapping table.

[0044] It should be noted that although the main program file and the application program file are both independent executable files, the main program and the application programs can be integrated into a whole through mutual function calls, and the two can implement their own functions by calling each other's functions. It can be understood that the main program and the application program are independent in structure, but are integrated when used.

[0045] S120: Determine a program file to be updated from the one main program file and the at least one application program file.

[0046] In this embodiment, the update of the real-time operating system may include the update of the main program file and the update of the application program file.

[0047] The program file to be updated may be a main program file, i.e., a bin file, or an application file, i.e., a dynamic library so file. The main program file and the application file may be updated independently.

[0048] S130: Use the updated program file to replace the program file to be updated, and restart the real-time operating system to complete the update of the real-time operating system.

[0049] The updated program file may be obtained by adding part of the content, deleting part of the content or modifying part of the content in the program file to be updated.

[0050] In this embodiment, if the program file to be updated is a main program file, the original bin file can be replaced by the updated bin file, and the real-time operating system can be restarted to complete the update of the main program; if the program file to be updated is an application file, the original dynamic library so file can be replaced by the updated dynamic library so file, and the real-time operating system can be restarted to complete the update of the application.

[0051] A method for updating a real-time operating system provided in a first embodiment of the present invention first compiles the executable program file corresponding to the real-time operating system into a main program file and at least one application file; then determines the program file to be updated from the main program file and the at least one application file; finally replaces the program file to be updated with the updated program file, and restarts the real-time operating system to complete the update of the real-time operating system. Using the above method, each program module of the system can be updated independently, which can effectively save update time and resources compared with the update method in the prior art.

[0052] Furthermore, the main program includes at least a real-time operating system kernel, a basic module, and a loading module;

[0053] The loading module is used to load the at least one application program to implement mutual function calls between the main program and the application program.

[0054] In this embodiment, the main program file can be guided and executed by the central processing unit like an independent executable file. The main program mainly includes basic modules such as FreeRTOS and drivers, and a loading module. The loading module can be used to load the application program, which can be understood as being used to load the dynamic library so file to realize mutual function calls between the main program and the application program.

[0055] Further, the mutual function call between the main program and the application program is executed after the real-time operating system completes initialization, and the initialization process of the real-time operating system includes:

[0056] Allocate memory space for the symbol mapping table;

[0057] The correspondence between the function name and the function address in the main program and the mapping between the function name and the function address in the application program are added to the symbol mapping table.

[0058] The real-time operating system is initialized after the system is started, and the initialization of the real-time operating system may include the initialization of the main program and the initialization of the application program. After the system is initialized, the mutual function call between the main program and the application program can be executed.

[0059] In this embodiment, initialization of the real-time operating system may include allocating a memory space for a symbol mapping table; and adding mapping relationships between all function names and function addresses to the symbol mapping table.

[0060] Among them, an area of ​​the system memory can be used as the memory space of the symbol mapping table. The memory space is independently occupied by the symbol mapping table and is no longer used by the system. The symbol mapping table is a structural data used to store the mapping relationship between the function name and the function address. The mapping relationship is stored using a structure containing the function name and the function address. Table 1 is a symbol mapping table provided by an embodiment of the present invention. As shown in Table 1, the first column in the table stores the function name, and the second column in the table stores the function address.

[0061] Function 0 Name Function 0 address Function 1 Name Function 1 address Function 2 Name Function 2 address Function 3 name Function 3 address

[0062] Table 1

[0063] In one embodiment, Figure 2 A schematic diagram of a real-time operating system initialization process provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the initialization process of the real-time operating system includes the following steps:

[0064] S1. Allocate memory space for the symbol mapping table.

[0065] S2. Add a structure array to the symbol mapping table, wherein the structure array includes a mapping relationship between a function name and a function address of a target function, and the target function is a function called by an application program in a main program.

[0066] Among them, step S2 is the process of initializing the main program.

[0067] In this embodiment, since the main program includes a large number of functions, a structure array is defined, and the mapping relationship of the functions called by the dynamic library in the main program is added to the structure array. The structure array can be added to the symbol mapping table to complete the initialization of the main program.

[0068] S3. Import the dynamic library so file into the system memory.

[0069] Among them, the application file is a dynamic library so file.

[0070] S4, adding the mapping relationship between the function name and the function address in the dynamic library so file to the symbol mapping table.

[0071] Among them, step S3 and step S4 are the initialization process of the application.

[0072] In this embodiment, all dynamic library so files are imported into the memory loading area of ​​the system. When importing the dynamic library so files, the memory of the memory loading area can be applied according to the size of the file data area, and the file data area is added to the memory loading area. At the same time, the mapping relationship between the function name and the function address in the dynamic library so file can be added to the symbol mapping table.

[0073] Accordingly, Figure 2 The main program corresponding to the initialization process shown calls a function in the application program, including: obtaining the function address of the called function from the symbol mapping table according to the function name of the called function, and the called function is a function in the application program; assigning the function address of the called function to a function pointer; calling the function pointer in the function body, and jumping to the corresponding application program through the function pointer to execute the called function; and returning to the main program after the called function is executed.

[0074] Among them, a function for obtaining the function address can be defined to obtain the function address from the mapping table and assign it to the function pointer. The input is the function name and the output is the function address. The function structure is as follows:

[0075] DL_HIDDEN void*lspos_get_func(const char*cName){

[0076] int i;

[0077] for(i=0;DL_Vector_Table[i].addr!=((void*)0);i++)

[0078] {

[0079] if(mystrcmp(DL_Vector_Table[i].name,cName)==0){

[0080] return DL_Vector_Table[i].addr;

[0081] }

[0082] }

[0083] return ((void*)0);

[0084] }

[0085] Accordingly, Figure 2The application corresponding to the initialization process shown calls a function in the main program, including: obtaining the function address of the called function from the symbol mapping table according to the function name of the called function, and the called function is the function in the main program; assigning the function address of the called function to a function pointer; calling the function pointer in the function body, jumping to the main program through the function pointer to execute the called function; and returning to the main program after the called function is executed.

[0086] Among them, returning to the main program after the called function is executed can include the following two situations: if the called function has a return value after execution, the return value can be returned to the main program; if the calling function has no return value after execution, it can return to continue executing the main program.

[0087] In one embodiment, Figure 3 A schematic diagram of a real-time operating system initialization process provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the initialization process of the real-time operating system includes the following steps:

[0088] S1. Allocate memory space for the symbol mapping table.

[0089] S2. Add a structure array to the symbol mapping table, wherein the structure array includes a mapping relationship between a function name and a function address of a target function, and the target function is a function called by an application program in a main program.

[0090] S3. Import the dynamic library so file into the system memory.

[0091] S4, adding the mapping relationship between the function name and the function address in the dynamic library so file to the symbol mapping table.

[0092] S5, loading the initialization functions of all dynamic libraries to obtain the function addresses of all functions in the symbol mapping table.

[0093] Among them, a function pointer is defined in the dynamic library initialization function, and the function pointer is assigned a function address.

[0094] In this embodiment, the initialization process of the real-time operating system may also include initialization of a dynamic library initialization function.

[0095] Among them, each dynamic library implements an initialization function of the dynamic library. By calling the initialization function of the dynamic library, the function addresses of all functions in the dynamic library can be directly obtained, including the function addresses in the dynamic library of the main program, the basic C library and the dynamic library of the application.

[0096] Specifically, loading the dynamic library initialization function includes: obtaining the address of the dynamic library initialization function from the symbol mapping table according to the dynamic library so file name; calling the dynamic library initialization function according to the address of the initialization function to perform initialization.

[0097] Among them, the initialization function name of the dynamic library is designed according to the dynamic library file name. For example, if the dynamic library name is abc.so, the corresponding initialization function name is initso_abc(). Therefore, the name of the corresponding initialization function can be known according to the dynamic library file name, and then the address of the initialization function can be obtained from the symbol mapping table according to the name of the initialization function.

[0098] After calling the initialization function of the dynamic library to perform initialization, the addresses of all functions in the dynamic library can be obtained.

[0099] Accordingly, Figure 3 The main program corresponding to the initialization process shown calls a function in the application program, including: calling the corresponding initialization function according to the function name of the called function to obtain the function pointer of the called function, where the called function is the function in the application program; calling the function pointer in the function body, and jumping to the corresponding application program through the function pointer to execute the called function; and returning to the main program after the called function is executed.

[0100] Wherein, if the called function belongs to the dynamic library of the application file, the initialization function of the dynamic library of the application can be called to obtain the function pointer of the called function without obtaining the function address from the symbol mapping table.

[0101] In this embodiment, since the initialization functions of all dynamic libraries are initialized during the initialization process, when a function is called, the initialization function can be used to obtain the function pointer of the called function. The function pointer is assigned a function address, and the function can jump to the application file corresponding to the function address to execute the called function.

[0102] Accordingly, Figure 3 The application corresponding to the initialization process shown calls the function in the main program, including: calling the corresponding initialization function according to the function name of the called function to obtain the function pointer of the called function, and the called function is the function in the main program; calling the function pointer in the function body, jumping to the main program through the function pointer to execute the called function; and returning to the main program after the called function is executed.

[0103] Among them, if the called function belongs to the dynamic library of the main program file, the initialization function of the main program dynamic library can be called to obtain the function pointer of the called function without obtaining the function address from the symbol mapping table.

[0104] In this embodiment, since the initialization functions of all dynamic libraries are initialized during the initialization process, when a function is called, the initialization function can be used to obtain the function pointer of the called function. The function pointer is assigned a function address, and the function can jump to the main program file corresponding to the function address to execute the called function.

[0105] Embodiment 2

[0106] Figure 4 A structural schematic diagram of a real-time operating system update device provided in Embodiment 2 of the present invention, the device can be used for updating a real-time operating system, and is particularly suitable for updating some programs in a real-time operating system, wherein the device can be implemented by software and / or hardware and is generally integrated on an embedded device.

[0107] like Figure 4 As shown, the device includes: a compiling module 110 , a determining module 120 and an updating module 130 .

[0108] A compiling module 110, used to compile an executable program file corresponding to the real-time operating system into a main program file and at least one application program file;

[0109] A determination module 120, configured to determine a program file to be updated from the one main program file and the at least one application program file;

[0110] An updating module 130, configured to replace the program file to be updated with the updated program file, and restart the real-time operating system to complete the update of the real-time operating system;

[0111] The main program and the application program are configured with a function calling function, and the function calling function is used to implement mutual function calling between the main program and the application program.

[0112] In this embodiment, the device first compiles the executable program file corresponding to the real-time operating system into a main program file and at least one application file through the compilation module 110; then determines the program file to be updated from the one main program file and the at least one application file through the determination module 120; finally, replaces the program file to be updated with the updated program file through the update module 130, and restarts the real-time operating system to complete the update of the real-time operating system.

[0113] This embodiment provides an updating device for a real-time operating system, which can independently update each program module of the system to save updating time and avoid wasting resources.

[0114] The mutual function calls between the main program and the application are executed after the real-time operating system is initialized. Furthermore, the device also includes a loading module for loading at least one application to implement the mutual function calls between the main program and the application.

[0115] Based on the above optimization, the loading modules include:

[0116] Allocation unit, used to allocate memory space for symbol mapping table;

[0117] The adding unit is used to add the corresponding relationship between the function name and the function address in the main program and the mapping relationship between the function name and the function address in the application program to the symbol mapping table.

[0118] Based on the above technical solution, the adding unit is specifically used for:

[0119] Adding a structure array to the symbol mapping table, the structure array includes a mapping relationship between a function name and a function address of a target function, the target function being a function called by an application program in a main program;

[0120] Import the dynamic library so file into the system memory. The dynamic library so file is the application file.

[0121] The mapping relationship between the function name and the function address in the dynamic library so file is added to the symbol mapping table.

[0122] Further, the loading module also includes a loading unit, which is used to load the initialization functions of all dynamic libraries to obtain the function addresses of all functions in the symbol mapping table;

[0123] Wherein, a function pointer is defined in the initialization function, and the function pointer is assigned a function address.

[0124] Based on the above technical solution, the loading unit is specifically used to: obtain the address of the initialization function of the dynamic library from the symbol mapping table according to the dynamic library so file name; call the initialization function of the dynamic library according to the address of the initialization function to perform initialization.

[0125] Furthermore, the device also includes a first function calling module and a second function calling module.

[0126] The first function calling module is used to: obtain the function address of the called function from the symbol mapping table according to the function name of the called function, wherein the called function is a function in the application program; assign the function address of the called function to a function pointer; call the function pointer in the function body, jump to the corresponding application program through the function pointer to execute the called function; and return to the main program after the called function is executed;

[0127] The first function calling module is also used to: obtain the function address of the called function from the symbol mapping table according to the function name of the called function, and the called function is a function in the main program; assign the function address of the called function to a function pointer; call the function pointer in the function body, jump to the main program through the function pointer to execute the called function; and return to the main program after the called function is executed.

[0128] The second function calling module is used to: call the corresponding initialization function according to the function name of the called function to obtain the function pointer of the called function, where the called function is a function in the application; call the function pointer in the function body, jump to the corresponding application through the function pointer to execute the called function; and return to the main program after the called function is executed;

[0129] The second function calling module is also used to: call the corresponding initialization function according to the function name of the called function to obtain the function pointer of the called function, and the called function is the function in the main program; call the function pointer in the function body, jump to the main program through the function pointer to execute the called function; and return to the main program after the called function is executed.

[0130] The above-mentioned real-time operating system update device can execute the real-time operating system update method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0131] Embodiment 3

[0132] Figure 5 The schematic diagram of the structure of the embedded device 10 that can be used to implement the embodiment of the present invention is shown. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0133] like Figure 5As shown, the embedded device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the embedded device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0134] A number of components in the embedded device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the embedded device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0135] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a real-time operating system update method.

[0136] In some embodiments, the update method of the real-time operating system can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the embedded device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps in the update method of the real-time operating system described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the update method of the real-time operating system by any other appropriate means (for example, by means of firmware).

[0137] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0138] In some embodiments, the updating method of the real-time operating system can be implemented as a computer program, which is invisibly included in a computer program product. The computer program implements the updating method of the real-time operating system of the present invention when executed by a processor. The computer program product can be understood as a software product that mainly implements its solution through a computer program. The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the computer program, when executed by the processor, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as an independent software package, and partially on a remote machine, or completely on a remote machine or server.

[0139] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0140] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0141] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0142] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0143] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0144] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for updating a real-time operating system, characterized in that: The method comprises: Compiling the executable program file corresponding to the real-time operating system into a main program file and at least one application program file; Determining a program file to be updated from the one main program file and the at least one application program file; Using the updated program file to replace the program file to be updated, and restarting the real-time operating system to complete the update of the real-time operating system; The main program and the application program are configured with a function calling function, and the function calling function is used to implement mutual function calling between the main program and the application program.

2. The method according to claim 1, characterized in that The main program at least includes a real-time operating system kernel, a basic module and a loading module; The loading module is used to load the at least one application program to implement mutual function calls between the main program and the application program.

3. The method according to claim 1, characterized in that The mutual function calls between the main program and the application program are executed after the real-time operating system is initialized. The initialization process of the real-time operating system includes: Allocate memory space for the symbol mapping table; The correspondence between the function name and the function address in the main program and the mapping between the function name and the function address in the application program are added to the symbol mapping table.

4. The method according to claim 3, characterized in that The application file is a dynamic library so file, and the mapping relationship between the function name and the function address in the main program and the mapping relationship between the function name and the function address in the application are added to the symbol mapping table, including: Adding a structure array to the symbol mapping table, the structure array includes a mapping relationship between a function name and a function address of a target function, the target function being a function called by an application program in a main program; Import the dynamic library so file into the system memory; The mapping relationship between the function name and the function address in the dynamic library so file is added to the symbol mapping table.

5. The method according to claim 3, characterized in that: The initialization process of the real-time operating system also includes: Loading the initialization functions of all dynamic libraries to obtain the function addresses of all functions in the symbol mapping table; Wherein, a function pointer is defined in the initialization function, and the function pointer is assigned a function address.

6. The method according to claim 5, characterized in that The initialization function for loading all dynamic libraries includes: Obtain the address of the initialization function of the dynamic library from the symbol mapping table according to the dynamic library so file name; The initialization function of the dynamic library is called according to the address of the initialization function to perform initialization.

7. The method according to claim 3, characterized in that The mutual function calls between the main program and the application program include the main program calling the functions in the application program. Accordingly, the main program calls the function in the application program, including: Acquire a function address of the called function from the symbol mapping table according to the function name of the called function, wherein the called function is a function in the application program; Assigning the function address of the called function to the function pointer; Call the function pointer in the function body, and jump to the corresponding application program through the function pointer to execute the called function; After the called function is executed, it returns to the main program.

8. The method according to claim 3, characterized in that The mutual function calls between the main program and the application include the application calling the function in the main program, Accordingly, the application program calls the function in the main program, including: Obtaining a function address of the called function from the symbol mapping table according to the function name of the called function, wherein the called function is a function in the main program; Assigning the function address of the called function to the function pointer; Call the function pointer in the function body, and jump to the main program through the function pointer to execute the called function; After the called function is executed, it returns to the main program.

9. The method according to claim 5, characterized in that The mutual function calls between the main program and the application program include the main program calling the functions in the application program. Accordingly, the main program calls the function in the application program, including: Calling a corresponding initialization function according to the function name of a called function to obtain a function pointer of the called function, wherein the called function is a function in an application program; Call the function pointer in the function body, and jump to the corresponding application program through the function pointer to execute the called function; After the called function is executed, it returns to the main program.

10. The method according to claim 5, characterized in that The mutual function calls between the main program and the application include the application calling the function in the main program, Accordingly, the application program calls the function in the main program, including: Calling a corresponding initialization function according to the function name of the called function to obtain a function pointer of the called function, wherein the called function is a function in the main program; Call the function pointer in the function body, and jump to the main program through the function pointer to execute the called function; After the called function is executed, it returns to the main program.

11. A real-time operating system update device, characterized in that: The device comprises: A compiling module, used for compiling the executable program file corresponding to the real-time operating system into a main program file and at least one application program file; A determination module, used to determine a program file to be updated from the one main program file and the at least one application program file; An updating module, used to replace the program file to be updated with the updated program file, and restart the real-time operating system to complete the update of the real-time operating system; The main program and the application program are configured with a function calling function, and the function calling function is used to implement mutual function calling between the main program and the application program.

12. An embedded device, characterized in that: The embedded device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the real-time operating system update method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the real-time operating system update method according to any one of claims 1 to 10 when executed.

14. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the method for updating a real-time operating system according to any one of claims 1 to 10.