Application post-downloading method and apparatus, system-on-chip, terminal, and storage medium

By dynamically allocated storage space and operating resources in the system, the problem of storage space waste and uncomfortable application management caused by the application of download methods in existing technology has been solved, and more efficient application management and user experience have been achieved.

WO2025020399A1PCT designated stage expired Publication Date: 2025-01-30BEIJING SMARTCHIP MICROELECTRONICS TECHNOLOGY CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/135171
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-27
Filing Date
2023-11-29
Publication Date
2025-01-30

AI Technical Summary

Technical Problem

In the prior art, the application-post-download method has problems such as wasting storage space and inflexible application management in the on-chip system.

Method used

After being issued by the embedded operating system on the film, according to the pre -obtained operating resource information and storage space information of the loadable file, the storage space and operating resources are dynamically allocated to form executable files and execute.

Benefits of technology

Realize the storage space of the system on the film, improve the flexibility of application management, and enhance the user's sense of experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023135171_30012025_PF_FP_ABST
    Figure CN2023135171_30012025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are an application post-downloading method and apparatus, a system-on-chip, a terminal, and a storage medium. The method comprises: a terminal compiling a source program of an application to be downloaded, so as to obtain a loadable file, and performing post-compilation on the loadable file, so as to obtain file header information, wherein the file header information comprises first running resource information and first storage space information of the loadable file in the terminal; on the basis of the first storage space information, a system-on-chip dynamically allocating the storage space of the system-on-chip, so as to obtain second storage space information; on the basis of the second storage space information, downloading the loadable file to the system-on-chip, so as to form an executable file; on the basis of the first running resource information, dynamically allocating running resources of the system-on-chip, so as to obtain second running resource information; and on the basis of the second storage space information and the second running resource information, running the executable file in the system-on-chip. In this way, the storage space of a system-on-chip can be saved on, and flexible application management can also be realized, thereby improving the usage experience of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Post-application download method, device, system on chip, terminal and storage medium Technical Field

[0001] The present invention relates to the technical field of system on chip, and in particular to a post-application download method, device, system on chip, terminal and storage medium. Background Art

[0002] With the continuous advancement of system-on-chip (SoC) technology, SoCs that integrate multiple different applications are becoming increasingly popular. Applications are the data structures, data elements, and program modules required to fulfill specific functions. They can include applications such as payment functions in the financial industry, metering and event logging functions in the power industry, and communication functions. They can also include portions of operating system code that can be in user mode, such as user-mode drivers, user-mode file systems, and user-mode components. Currently, applications can be downloaded, updated, installed, and deleted in SoCs through a post-application download method after the embedded operating system is released. For example, two fixed spaces can be set up in the SoC: one for application downloads and the other for application code usage, with the two areas alternately switched. Alternatively, applications can be downloaded to a fixed space in the SoC. However, these post-application download methods are relatively simple and easily waste storage space, hindering flexible application management.

[0003] Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. To this end, the first purpose of the present invention is to propose a post-application download method, which can dynamically allocate storage space corresponding to the first storage space information and running resources corresponding to the first running resource information on the system-on-chip for the loadable file after the embedded operating system of the system-on-chip is released, based on the first running resource information and first storage space information of the loadable file in the terminal acquired in advance, and download the loadable file to the system-on-chip to form an executable file according to the dynamic allocation result, and execute the executable file, so as to save the storage space of the system-on-chip and perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0005] The second object of the present invention is to provide another post-application download method.

[0006] The third object of the present invention is to provide a post-application downloading device.

[0007] A fourth object of the present invention is to provide another post-application downloading device.

[0008] A fifth object of the present invention is to provide a system on chip.

[0009] A sixth objective of the present invention is to provide a terminal.

[0010] A seventh object of the present invention is to provide an application post-download system.

[0011] An eighth object of the present invention is to provide a computer-readable storage medium.

[0012] To achieve the above-mentioned purpose, an embodiment of the first aspect of the present invention proposes a post-application download method, which is applied to a system-on-chip, and the method includes: obtaining a loadable file corresponding to the application to be downloaded and file header information corresponding to the loadable file, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and first storage space information of the loadable file in the terminal; based on the first storage space information, dynamically allocating storage space of the system-on-chip for the loadable file to obtain second storage space information; according to the second storage space information, downloading the loadable file to the system-on-chip to form an executable file; according to the first running resource information, dynamically allocating running resources of the system-on-chip for the executable file to obtain second running resource information; according to the second storage space information and the second running resource information, running the executable file in the system-on-chip.

[0013] According to the application post-download method of an embodiment of the present invention, it is applied to the system-on-chip, by obtaining the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; based on the first storage space information, the storage space of the system-on-chip is dynamically allocated to the loadable file to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the system-on-chip to form an executable file; according to the first running resource information, the running resources of the system-on-chip are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the system-on-chip. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0014] According to one embodiment of the present invention, the first storage space information includes the storage space information of each storage segment of the loadable file in the terminal, wherein, based on the first storage space information, the storage space of the on-chip system is dynamically allocated for the loadable file to obtain the second storage space information, including: determining the storage space information of each storage segment corresponding to the loadable file in the on-chip system according to the storage space information of each storage segment of the loadable file in the terminal; and using the storage space information of each storage segment corresponding to the loadable file in the on-chip system as the second storage space information.

[0015] According to one embodiment of the present invention, each storage segment of the loadable file in the terminal includes a first heap space, a first stack space, a first data segment and a first code segment, wherein the storage space information of each storage segment corresponding to the loadable file in the system-on-chip is determined based on the storage space information of each storage segment of the loadable file in the terminal, including: determining the size of the second heap space, the size of the first stack space, the size of the first data segment and the size and starting address of the first code segment corresponding to the loadable file in the system-on-chip, as well as the starting address of the second heap space, the starting address of the second stack space, the starting address of the second data segment and the starting address of the second code segment based on the size of the first heap space, the size of the first stack space, the size and starting address of the first data segment.

[0016] According to an embodiment of the present invention, the file header information also includes identification information of the application to be downloaded, and the method further includes: storing the second storage space information and the identification information in an application registry of the system on chip, so as to run the application to be downloaded according to the application registry.

[0017] According to one embodiment of the present invention, before dynamically allocating storage space of the system on chip for the loadable file based on the first storage space information and obtaining the second storage space information, the method further includes: performing integrity verification on the loadable file using a preset integrity verification algorithm.

[0018] According to one embodiment of the present invention, the preset integrity check algorithm includes at least one of the following: CRC16 algorithm, CRC32 algorithm, SHA1 algorithm, SHA256 algorithm, SM3 algorithm, and SM1-MAC algorithm.

[0019] According to an embodiment of the present invention, the loadable file includes one of the following: a bin file and a hex file.

[0020] According to one embodiment of the present invention, the file header information also includes file type information of the loadable file. Before dynamically allocating storage space of the on-chip system for the loadable file based on the first storage space information and obtaining the second storage space information, the method also includes: verifying the type of the loadable file based on the file type information of the loadable file.

[0021] According to one embodiment of the present invention, the first operating resource information includes a startup code segment. Based on the first operating resource information, the operating resources of the on-chip system are dynamically allocated to the executable file to obtain the second operating resource information, including: running the startup code segment, setting a pointer to the second heap space for the executable file, initializing the content of the second data segment and relocating the second code segment, and using the pointer to the second heap space, the initialized content of the second data segment and the address information after relocating the second code segment as the second operating resource information.

[0022] According to one embodiment of the present invention, the file header information also includes an application instance name, which is obtained by the terminal configuring the application instance in the post-compilation step. After the executable file is formed, the method also includes: installing the executable file as an application instance and storing the application instance name in the application registry.

[0023] To achieve the above-mentioned purpose, the second aspect of the embodiment of the present invention proposes another post-application download method, which is applied to a terminal, and the method includes: compiling the source program of the application to be downloaded to obtain a loadable file corresponding to the application to be downloaded; post-compiling the loadable file to obtain file header information, wherein the file header information includes the first running resource information and first storage space information of the loadable file in the terminal; sending the loadable file and the file header information to the system on chip, so that the system on chip dynamically allocates the storage space of the system on chip to the loadable file based on the first storage space information, and obtains the second storage space information; according to the second storage space information, downloading the loadable file to the system on chip to form an executable file; according to the first running resource information, dynamically allocating the running resources of the system on chip to the executable file, and obtain the second running resource information; according to the second storage space information and the second running resource information, running the executable file in the system on chip.

[0024] According to the post-application download method of an embodiment of the present invention, when applied to a terminal, after the embedded operating system of the system-on-chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system-on-chip can be dynamically allocated to the loadable file based on the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance. The loadable file can be downloaded to the system-on-chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system-on-chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0025] To achieve the above-mentioned purpose, the third aspect of the present invention proposes an application post-download device, which is applied to the system-on-chip. The application post-download device includes: an acquisition module, which is used to obtain the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and first storage space information of the loadable file in the terminal; a first allocation module, which is used to dynamically allocate the storage space of the system-on-chip for the loadable file based on the first storage space information to obtain the second storage space information; a download module, which is used to download the loadable file to the system-on-chip according to the second storage space information to form an executable file; a second allocation module, which is used to dynamically allocate the running resources of the system-on-chip for the executable file according to the first running resource information to obtain the second running resource information; and a running module, which is used to run the executable file in the system-on-chip according to the second storage space information and the second running resource information.

[0026] The above-mentioned application post-download device is applied to the system-on-chip, and obtains the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file through the acquisition module, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; through the first allocation module, based on the first storage space information, the storage space of the system-on-chip is dynamically allocated to the loadable file to obtain the second storage space information; through the download module, according to the second storage space information, the loadable file is downloaded to the system-on-chip to form an executable file; through the second allocation module, according to the first running resource information, the running resources of the system-on-chip are dynamically allocated to the executable file to obtain the second running resource information; through the running module, according to the second storage space information and the second running resource information, the executable file is run in the system-on-chip. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0027] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes another post-application download device, which is applied to a terminal. The post-application download device includes: a compilation module, which is used to compile the source program of the application to be downloaded to obtain a loadable file corresponding to the application to be downloaded; a post-compilation module, which is used to post-compile the loadable file to obtain file header information, wherein the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; a sending module, which is used to send the loadable file and the file header information to the system-on-chip, so that the system-on-chip dynamically allocates the storage space of the system-on-chip to the loadable file based on the first storage space information to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the system-on-chip to form an executable file; according to the first running resource information, the running resources of the system-on-chip are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the system-on-chip.

[0028] The above-mentioned application post-download device is applied to a terminal, and compiles the source program of the application to be downloaded through a compilation module to obtain a loadable file corresponding to the application to be downloaded; the loadable file is post-compiled through a post-compilation module to obtain file header information, wherein the file header information includes the first running resource information and first storage space information of the loadable file in the terminal; the loadable file and file header information are sent to the on-chip system through a sending module, so that the on-chip system dynamically allocates the storage space of the on-chip system for the loadable file based on the first storage space information to obtain second storage space information; according to the second storage space information, the loadable file is downloaded to the on-chip system to form an executable file; according to the first running resource information, the running resources of the on-chip system are dynamically allocated to the executable file to obtain second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the on-chip system. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0029] To achieve the above-mentioned purpose, the fifth embodiment of the present invention proposes a system on chip, including: a first memory, a first processor, and a program stored in the first memory and runnable on the first processor. When the first processor executes the program, the post-application download method of the first embodiment is implemented.

[0030] In the above-mentioned system-on-chip, the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file are obtained, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; based on the first storage space information, the storage space of the system-on-chip is dynamically allocated to the loadable file to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the system-on-chip to form an executable file; according to the first running resource information, the running resources of the system-on-chip are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the system-on-chip. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0031] To achieve the above-mentioned purpose, the sixth embodiment of the present invention proposes a terminal, comprising: a second memory, a second processor, and a program stored in the second memory and runnable on the second processor. When the second processor executes the program, the post-application download method of the second embodiment is implemented.

[0032] In the above-mentioned terminal, after the embedded operating system of the system-on-chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system-on-chip can be dynamically allocated to the loadable file based on the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system-on-chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system-on-chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0033] To achieve the above-mentioned purpose, a seventh embodiment of the present invention proposes a post-application download system, comprising the system-on-chip of the fifth embodiment and the terminal of the sixth embodiment.

[0034] In the above-mentioned post-application download system, the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file are obtained, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; based on the first storage space information, the storage space of the on-chip system is dynamically allocated to the loadable file to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the on-chip system to form an executable file; according to the first running resource information, the running resources of the on-chip system are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the on-chip system. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0035] To achieve the above-mentioned objectives, an eighth embodiment of the present invention proposes a computer-readable storage medium having a program stored thereon, which can be executed by a processor to implement the post-application download method of the first and second embodiments.

[0036] In the above-mentioned computer-readable storage medium, by obtaining the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; based on the first storage space information, the storage space of the on-chip system is dynamically allocated to the loadable file to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the on-chip system to form an executable file; according to the first running resource information, the running resources of the on-chip system are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the on-chip system. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0037] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] FIG1 is a schematic diagram of a flow chart of a post-application download method provided by an embodiment of the present invention;

[0039] FIG2 is a schematic structural diagram of a post-application download system provided by an embodiment of the present invention;

[0040] FIG3 is a flow chart of a method for compiling and post-compiling an application to be downloaded provided by an embodiment of the present invention;

[0041] FIG4 is a flow chart of a method for installing an application to be downloaded provided by an embodiment of the present invention;

[0042] FIG5 is a flow chart of a method for executing an application to be downloaded provided by an embodiment of the present invention;

[0043] FIG6 is a flow chart of another method for compiling and post-compiling an application to be downloaded provided by an embodiment of the present invention;

[0044] FIG7 is a flow chart of another method for installing an application to be downloaded provided by an embodiment of the present invention;

[0045] FIG8 is a flow chart of another method for executing an application to be downloaded provided by an embodiment of the present invention;

[0046] FIG9 is a schematic structural diagram of a post-application downloading device provided by an embodiment of the present invention;

[0047] FIG10 is a schematic structural diagram of another post-application downloading device provided by an embodiment of the present invention;

[0048] FIG11 is a schematic structural diagram of a system on a chip provided by an embodiment of the present invention;

[0049] FIG12 is a schematic structural diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0051] First, some terms involved in this invention are briefly explained:

[0052] EOS (Embedded Operating System): An operating system for embedded systems. An embedded operating system is a broad range of system software, typically including hardware-related low-level driver software, a system kernel, device driver interfaces, communication protocols, a graphical user interface, and a standardized browser. An embedded operating system is responsible for allocating software and hardware resources, scheduling tasks, and controlling and coordinating concurrent activities within the embedded system. It must reflect the characteristics of the system in which it resides and be able to achieve the required system functionality by installing and removing certain modules.

[0053] COS (Chip Operating System): An operating system that runs on a SOC (System on Chip), such as the security chip in cards and identity security devices. Integrating an embedded system with specific functions onto a single chip creates a system-on-chip (SOC), making the system-on-chip a special case of an embedded system. A COS typically refers to the operating system on a system-on-chip (SOC) in products such as smart cards, USBKEYs (hardware devices with USB interfaces), ESAMs (Embedded Secure Access Modules), and SEs (Secure Element).

[0054] Application: In order to meet the data structures, data elements and program modules required for specific functions, it includes application programs such as payment functions in the financial industry, metering functions in the power industry, event recording functions, communication functions, etc. It also includes part of the operating system code that can become user mode, such as user mode drivers, user mode file systems, user mode components, etc.

[0055] Post-application download: An application management method that allows applications to be downloaded, updated, installed, and deleted after the embedded operating system is released.

[0056] The following describes the post-application download method, device, system on chip, terminal, and storage medium proposed in the embodiments of the present invention with reference to the accompanying drawings.

[0057] In this application, reference is made to FIG1 , which is a flow chart of a post-application download method provided by an embodiment of the present invention. The post-application download method provided by this embodiment may include the following steps:

[0058] S101 : The terminal compiles the source program of the application to be downloaded to obtain a loadable file corresponding to the application to be downloaded.

[0059] Specifically, a source program for the application to be downloaded can be developed based on the functions that the application to be downloaded needs to implement, and the source program of the application to be downloaded can be compiled by an application compiler in the terminal to obtain a loadable file corresponding to the application to be downloaded. In specific implementation, the application compiler can pre-set the file format of the loadable file and compile the source program of the application to be downloaded into a loadable file in that file format.

[0060] Particularly, above-mentioned loadable file can include but not limited to the file of bin file, hex file or other self-defined type.Loadable file of the prior art is generally ELF (Executable and Linkable Format, executable and linkable format) file, and at same section source program, the ELF file after compiling usually comprises the data of hundreds of K bytes magnitude, and the bin file after compiling may only comprise the data of several K bytes magnitude.In the present embodiment, use the file of bin file, hex file or other self-defined type by post-compilation method, only extract valid information in the file header, both can save storage space, also can improve execution efficiency.

[0061] S102: The terminal post-compiles the loadable file to obtain file header information, wherein the file header information includes first running resource information and first storage space information of the loadable file in the terminal.

[0062] Specifically, the application compiler in the terminal can post-compile the loadable file through a post-compilation method to obtain file header information including first execution resource information and first storage space information of the loadable file in the terminal. In specific implementation, the post-compilation method can be a post-compilation tool, program code, or SDK (Software Development Kit) library package method.

[0063] The first execution resource information may represent specific execution information of the loadable file in the terminal. Furthermore, since the memory in the terminal allocates storage space for the loadable file when storing the loadable file corresponding to the application to be downloaded, the first storage space information may represent specific storage information of the loadable file in the terminal memory.

[0064] S103: The terminal sends the loadable file and file header information to the system on chip.

[0065] Specifically, the SoC may be integrated with an embedded operating system, which may include, but is not limited to, a real-time operating system, an Internet of Things operating system, an on-chip operating system, and other operating systems. In specific implementations, the SoC may include a smart card using a security chip, a USB KEY, an SE, or an intelligent module using a main control chip.

[0066] Specifically, the terminal may send the loadable file and file header information to the system-on-chip via a communication method such as a network. In specific implementation, the terminal may directly send the loadable file and file header information to the system-on-chip, or the terminal may send the loadable file and file header information to the system-on-chip via another device (e.g., a server).

[0067] S104, the system on chip obtains the loadable file and file header information.

[0068] S105 : The system on chip dynamically allocates storage space of the system on chip for the loadable file based on the first storage space information to obtain second storage space information.

[0069] Specifically, based on the first storage space information of the loadable file in the terminal, storage space of the system-on-chip can be dynamically allocated for the loadable file, and the dynamic allocation result information is used as the second storage space information. For example, the storage space of the system-on-chip can be Flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), or other data organization methods such as a file system.

[0070] S106 , downloading the loadable file to the system on chip according to the second storage space information to form an executable file.

[0071] Specifically, the loadable file may be downloaded to the system on chip according to the above dynamic allocation result information to form an executable file.

[0072] Optionally, the executable file containing the executable module can be installed as an application instance. Alternatively, the executable file and application instance downloaded to the system-on-chip can be deleted.

[0073] S107 , dynamically allocating operating resources of the system on chip to the executable file according to the first operating resource information, to obtain second operating resource information.

[0074] Specifically, according to the specific running information of the loadable file in the terminal, the running resources of the system on chip can be dynamically allocated to the executable file to obtain the second running resource information of the executable file in the system on chip.

[0075] S108 , running the executable file in the system on chip according to the second storage space information and the second running resource information.

[0076] Specifically, after receiving the trigger instruction to run the application, the executable file can be run in the system on chip according to the second storage space information and the second running resource information to start the business application and execute the application.

[0077] An embodiment of the present invention provides an application post-download method, which obtains a loadable file corresponding to the application to be downloaded and file header information corresponding to the loadable file, wherein the loadable file is obtained by compiling the source program of the application to be downloaded by the terminal, and the file header information is obtained by post-compiling the loadable file by the terminal, and the file header information includes first running resource information and first storage space information of the loadable file in the terminal; based on the first storage space information, the storage space of the on-chip system is dynamically allocated to the loadable file to obtain second storage space information; according to the second storage space information, the loadable file is downloaded to the on-chip system to form an executable file; according to the first running resource information, the running resources of the on-chip system are dynamically allocated to the executable file to obtain second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the on-chip system. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0078] In some embodiments, the system on chip can download the complete loadable file to perform application upgrade to achieve a full upgrade; the system on chip can also perform application upgrade by downloading the differential package of the local target file of the application and the source file on the terminal to achieve a differential upgrade.

[0079] In some embodiments, the above-mentioned first storage space information may include the storage space information of each storage segment of the loadable file in the terminal, wherein the above-mentioned dynamic allocation of storage space of the on-chip system for the loadable file based on the first storage space information to obtain the second storage space information may include: determining the storage space information of each storage segment corresponding to the loadable file in the on-chip system according to the storage space information of each storage segment of the loadable file in the terminal; and using the storage space information of each storage segment corresponding to the loadable file in the on-chip system as the second storage space information.

[0080] Specifically, since the memory in the terminal allocates storage space for the loadable file when storing the loadable file corresponding to the application to be downloaded, and the storage space allocated by the memory in the terminal can include multiple different storage segments, the loadable file can be stored in the terminal memory in the form of storage segments. The first storage space information may include storage space information of each storage segment of the loadable file in the terminal.

[0081] Specifically, based on the storage space information of each memory segment of the loadable file in the terminal, the storage space information of each memory segment corresponding to the loadable file in the system-on-chip can be determined. That is, the loadable file can be stored in the terminal's memory in the form of a memory segment, or the loadable file can be stored in the system-on-chip in the form of a memory segment. Furthermore, the storage space information of each memory segment corresponding to the loadable file in the system-on-chip can be used as the second storage space information, where the second storage space information can represent the specific storage space information of the loadable file in the system-on-chip.

[0082] For example, a loadable file is stored in a terminal memory in the form of memory segments a1, b1, ..., n1. Based on the storage space information of memory segment a1, it can be determined that the portion of the content corresponding to the loadable file memory segment a1 is stored in the storage space information of memory segment a2 in the system-on-chip. Based on the storage space information of memory segment b1, it can be determined that the portion of the content corresponding to the loadable file memory segment b1 is stored in the storage space information of memory segment b2 in the system-on-chip. Based on the storage space information of memory segment n1, it can be determined that the portion of the content corresponding to the loadable file memory segment n1 is stored in the storage space information of memory segment n2 in the system-on-chip.

[0083] In an embodiment of the present invention, the first storage space information includes the storage space information of each storage segment of the loadable file in the terminal. Based on the storage space information of each storage segment of the loadable file in the terminal, the storage space information of each storage segment corresponding to the loadable file in the system-on-chip is determined; and the storage space information of each storage segment corresponding to the loadable file in the system-on-chip is used as the second storage space information. Thus, based on the pre-acquired storage space information of each storage segment of the loadable file in the terminal, the storage space corresponding to each storage segment on the system-on-chip can be dynamically allocated to the loadable file. This can not only save the storage space of the system-on-chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0084] In some embodiments, the storage segments of the loadable file in the terminal may include a first heap space, a first stack space, a first data segment and a first code segment, wherein the above-mentioned determination of the storage space information of the storage segments corresponding to the loadable file in the on-chip system based on the storage space information of the storage segments of the loadable file in the terminal may include: determining the size of the second heap space, the size of the first stack space, the size of the first data segment and the size and starting address of the first code segment corresponding to the loadable file in the on-chip system, as well as the starting address of the second heap space, the starting address of the second stack space, the starting address of the second data segment and the starting address of the second code segment based on the size of the first heap space, the size of the first stack space, the size and starting address of the first data segment.

[0085] Specifically, the storage segments of the loadable file in the terminal may include a first heap space, a first stack space, a first data segment and a first code segment, wherein the first heap space can store dynamically allocated data, etc., the first stack space can store local variables, function parameters, return addresses and other function call-related data, the first data segment can store initialized global variables in the program, and the first code segment can store program execution code, etc.

[0086] Specifically, the size of the second heap space corresponding to the loadable file in the system-on-chip can be determined based on the size of the first heap space of the loadable file in the terminal, and the size of the second stack space corresponding to the loadable file in the system-on-chip can be determined based on the size of the first stack space of the loadable file in the terminal; and starting addresses can be allocated to the second heap space and the second stack space respectively. The size and starting address of the second data segment corresponding to the loadable file in the system-on-chip can also be determined based on the size and starting address of the first data segment of the loadable file in the terminal; and the size and starting address of the second code segment corresponding to the loadable file in the system-on-chip can be determined based on the size and starting address of the first code segment of the loadable file in the terminal.

[0087] In an embodiment of the present invention, the storage segment of the loadable file in the terminal includes a first heap space, a first stack space, a first data segment, and a first code segment. According to the size of the first heap space, the size of the first stack space, the size and starting address of the first data segment, and the size and starting address of the first code segment, the size of the second heap space, the size of the second stack space, the size of the second data segment, and the size of the second code segment corresponding to the loadable file in the system on chip, as well as the starting address of the second heap space, the starting address of the second stack space, the starting address of the second data segment, and the starting address of the second code segment are determined. Thus, according to the pre-acquired sizes of the first heap space, the first stack space, the first data segment, and the first code segment of the loadable file in the terminal, the second heap space, the second stack space, the second data segment, and the second code segment of the same size on the system on chip can be dynamically allocated to the loadable file. This can save the storage space of the system on chip and perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0088] In some embodiments, the above-mentioned file header information may also include identification information of the application to be downloaded, and the above-mentioned post-application download method may also include: storing the second storage space information and identification information in the application registry of the on-chip system so as to run the application to be downloaded according to the application registry.

[0089] Specifically, since multiple applications that can implement different functions can be installed in the on-chip system, the application information of each application can be stored in the application registry of the on-chip system. Therefore, the terminal can configure identification information (such as the application name) for the application to be downloaded and add the identification information to the file header information, so that the on-chip system can store the second storage space information and identification information of the application to be downloaded in the application registry of the on-chip system, so that the on-chip system can run the application to be downloaded by searching the application registry.

[0090] Specifically, according to the requirements of different operating systems, the application to be downloaded may be configured with identification information such as the application installation package ID (Identity, identification number), application ID, etc. according to the application name of the application to be downloaded, and these configured identification information may be stored in the application registry.

[0091] Specifically, when the application registry stores application information of multiple applications, if execution instructions of multiple applications are obtained simultaneously, the application registry can be searched and the multiple applications can be executed simultaneously according to the application information of each application, thereby improving the execution efficiency.

[0092] Specifically, in order to prevent the impact on the running loadable file or the erroneous download of the loadable file, the embedded operating system can use backup, conditional execution and rollback protection mechanisms.

[0093] In an embodiment of the present invention, the file header information also includes identification information of the application to be downloaded. By storing the second storage space information and the identification information in the application registry of the system on chip, the application to be downloaded can be executed according to the application registry. Thus, the application to be downloaded can be executed by searching the application registry, thereby improving operation efficiency.

[0094] In some embodiments, before dynamically allocating storage space of the on-chip system for the loadable file based on the first storage space information and obtaining the second storage space information, the post-application download method may further include: performing integrity verification on the loadable file using a preset integrity verification algorithm.

[0095] Specifically, the terminal can add a first integrity check field to the compiled loadable file using a preset integrity check algorithm. After receiving the loadable file, the system-on-chip can calculate a second integrity check field using the corresponding preset integrity check algorithm and complete the integrity check of the loadable file by comparing the first integrity check field and the second integrity check field. If the check passes, the system-on-chip can dynamically allocate storage space for the loadable file based on the first storage space information to obtain the second storage space information.

[0096] Specifically, the above-mentioned preset integrity check algorithms may include CRC (Cyclical Redundancy Check) 16 algorithm, CRC32 algorithm, SHA (Security Hash Algorithm) 1 algorithm, SHA256 algorithm, SM3 algorithm (a cryptographic hash algorithm), SM1-MAC algorithm (a block cipher algorithm), etc.

[0097] In the embodiment of the present invention, integrity verification is performed on the loadable file by using a preset integrity verification algorithm, thereby ensuring the integrity of the loadable file and improving the security of the loadable file.

[0098] In some embodiments, the above-mentioned file header information may also include file type information of the loadable file. Before dynamically allocating storage space of the on-chip system for the loadable file based on the first storage space information and obtaining the second storage space information, the above-mentioned post-application download method may also include: verifying the type of the loadable file according to the file type information of the loadable file.

[0099] Specifically, when the file header information includes file type information of the loadable file, the system on chip can verify the type of the loadable file according to the file type information of the currently downloaded loadable file, thereby ensuring that the file type of the currently downloaded loadable file is correct.

[0100] Specifically, the file header information may further include a magic number. When the file header information includes the magic number, the system on chip may further verify the magic number, thereby ensuring that the data in the currently downloaded loadable file is correct.

[0101] In an embodiment of the present invention, the file header information also includes file type information of the loadable file, and the type of the loadable file is verified based on the file type information of the loadable file. Thus, it can be ensured that the file type of the loadable file is correct, thereby improving the user experience.

[0102] In some embodiments, the first operating resource information includes a startup code segment. At this time, the above-mentioned dynamic allocation of operating resources of the on-chip system for the executable file based on the first operating resource information to obtain the second operating resource information may include: running the startup code segment, setting a pointer to the second heap space for the executable file, initializing the second data segment content and relocating the second code segment, and using the pointer to the second heap space, the initialized second data segment content and the relocated address information as the second operating resource information.

[0103] Specifically, the code can be run according to the code segment address information of the application in the registry. First, the startup code segment is run, the pointer of the second heap space is set for the application, the second data segment content is initialized, the second code segment is relocated, etc., so that the executable file can be run in the on-chip system according to the pointer of the second heap space, the initialized second data segment content and the address information after the relocation of the second code segment.

[0104] In an embodiment of the present invention, the first execution resource information includes a startup code segment. By executing the startup code segment, a pointer to the second heap space is set for the executable file, the contents of the second data segment are initialized, and the second code segment is relocated. The pointer to the second heap space, the initialized contents of the second data segment, and the address information after the relocation of the second code segment are used as the second execution resource information. Thus, based on the pointer to the second heap space, the initialized contents of the second data segment, and the relocated address information, the executable file can be run in the system-on-chip, thereby starting the business application and executing the application.

[0105] In some embodiments, after the executable file is formed, the above-mentioned file header information may also include an application instance name, where the application instance name is obtained by the terminal configuring the application instance in the post-compilation step. After the executable file is formed, the above-mentioned application post-download method may also include: installing the executable file as an application instance, and storing the application instance name in the application registry.

[0106] Specifically, the terminal can configure an application instance name for the application instance during the post-compilation process, and add the configured application instance name to the file header information. After the on-chip system obtains the file header information sent by the terminal, it can install the executable file containing multiple executable modules into different application instances, and store the application instance name in the application registry so that the corresponding application instance can be run according to the application registry.

[0107] In an embodiment of the present invention, the file header information also includes the application instance name, which is obtained by configuring the application instance during the post-compilation step. By installing the executable file as an application instance and storing the application instance name in the application registry, the corresponding application instance can be run according to the application registry, thereby improving operational efficiency.

[0108] FIG2 is a schematic diagram of the structure of a post-application download system provided by an embodiment of the present invention. Referring to FIG2 , the post-application download system 1 provided by this embodiment may include a system-on-chip 10 and a terminal 20. The system-on-chip 10 may include an application installer 110 and an application executor 120, and the terminal 20 may include an application compiler 210.

[0109] Specifically, the application compiler 210 shown in Figure 2 can be used to implement the compilation and post-compilation methods of the application to be downloaded shown in Figures 3 and 6 below; the application installer 110 shown in Figure 2 can also be used to implement the installation method of the application to be downloaded shown in Figures 4 and 7 below; and the application executor 120 shown in Figure 2 can also be used to implement the execution method of the application to be downloaded shown in Figures 5 and 8 below.

[0110] For example, the functions implemented by the application compiler 210 are shown in FIG3 below. The application compiler 210 can be used to: obtain the source program file of the application to be downloaded; perform universal compilation on the source program file to obtain a loadable file; and perform post-compilation on the loadable file to obtain file header information, where the file header information may include startup code segment information and application information. Thus, the loadable file and file header information can be obtained through the application compiler 210.

[0111] For another example, the functions that can be implemented by the above-mentioned application installer 110 are shown in Figure 4 below. The application installer 110 can be used to: obtain the loadable file and file header information corresponding to the application to be downloaded; analyze the file header information; based on the file header information, dynamically allocate the storage space of the on-chip system for the application to be downloaded (assuming that the executable files of multiple applications are stored in the storage space of the on-chip system in advance, such as the executable file of application 1, the executable file of application 2... the executable file of application 6. At this time, the storage space of the on-chip system is allocated for the application to be downloaded (the application ID of the application to be downloaded can be configured as application 7)), store the executable file of the application to be downloaded (application 7) in the storage space of the on-chip system, and obtain the application information of the application to be downloaded (application 7); write the application information of the application to be downloaded (application 7) back into the application registry of the on-chip system; and obtain an application registry including the application information of 7 applications. Among them, the application information of the application to be downloaded (application 7) may include: application installation package ID, application ID, application name, second code segment starting address, second code segment size, second data segment starting address, second data segment size, stack space starting address, stack space size and other information.

[0112] For example, the functions that can be implemented by the above-mentioned application executor 120 are shown in Figure 5 below. The application executor 120 can be used to: receive execution control instructions of application m (m is less than or equal to n); search the application registry (including application information of n applications) to obtain application information of application m; according to the application information of application m, search the storage space for data corresponding to the executable file of application m (such as instruction execution unit, stack space and heap space), and execute application m.

[0113] To illustrate the functions that can be implemented by the application compiler 210, FIG6 is a flowchart of another method for compiling and post-compiling an application to be downloaded provided in an embodiment of the present invention. As shown in FIG6 , the method for compiling and post-compiling an application to be downloaded provided in this embodiment is executed by the application compiler 210. The method for compiling and post-compiling an application to be downloaded provided in this embodiment may include the following steps:

[0114] S601: Obtain the source program file of the application to be downloaded.

[0115] S602: Compile the source program file to obtain a loadable file corresponding to the application to be downloaded.

[0116] S603: Post-compile the loadable file to obtain file header information, wherein the file header information includes first running resource information and first storage space information of the loadable file in the terminal.

[0117] Specifically, the file header information may include information required by the application installer and executor. During implementation, a header file startup code segment may be loaded based on the requirements of different on-chip operating systems. When executed, this code segment completes the initialization process for the application to be downloaded, including setting the stack pointer, initializing the data segment content, and relocating the code segment (first runtime resource information). Different application information may also be configured, such as the magic number, application name, memory size used by the application, the application's first heap space starting address, first stack space starting address, first heap space size, first stack space size, and first data segment starting address (first storage space information).

[0118] Specifically, the application compiler can add integrity check fields to the loadable file using algorithms such as CRC16, CRC32, SHA1, SHA256, SM3, and SM1-MAC.

[0119] S604: Send the loadable file and file header information to the system on chip.

[0120] In the embodiment of the present invention, the application compiler in the terminal may obtain in advance the first running resource information and the first storage space information of the loadable file in the terminal.

[0121] To illustrate the functions that can be implemented by the application installer 110 in detail, FIG7 is a flowchart of another method for installing an application to be downloaded provided in an embodiment of the present invention. As shown in FIG7 , the method for installing an application to be downloaded provided in this embodiment is executed by the application installer 110. The method for installing an application to be downloaded provided in this embodiment may include the following steps:

[0122] S701, obtain loadable files and file header information.

[0123] S702: Perform integrity check on the loadable file.

[0124] S703: Verify the file header information.

[0125] For example, the correctness of the magic number and the file type may be verified to ensure that the file type and data of the currently acquired loadable file are correct.

[0126] S704 , dynamically allocating storage space of the system on chip for the loadable file based on the first storage space information to obtain second storage space information.

[0127] For example, the second storage space information may include: the application's second code segment starting address, second code segment size, second data segment starting address, second data segment size, second stack space starting address, second stack space size and other information.

[0128] S705 : Download the loadable file to the system on chip according to the second storage space information to form an executable file.

[0129] S706: Configure identification information for the application, and store the second storage space information and the identification information in an application registration table of the system on chip.

[0130] For example, the identification information configured for the application may include: application installation package ID, application ID, application name, and other information.

[0131] Specifically, the application installer may install the executable file containing the executable module as an application instance, and may also delete the executable file and the application instance in the embedded operating system.

[0132] In an embodiment of the present invention, the application installer in the system-on-chip can dynamically allocate storage space on the system-on-chip corresponding to the first storage space information of the loadable file in the terminal based on the pre-acquired first storage space information of the loadable file, and download the loadable file to the system-on-chip according to the dynamic allocation result. This can not only save the storage space of the system-on-chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0133] To illustrate the functions that can be implemented by the application executor 120 in detail, FIG8 is a flowchart of a method for executing an application to be downloaded provided in an embodiment of the present invention. As shown in FIG8 , the execution subject of the method for executing an application to be downloaded provided in this embodiment is the application executor 120. The method for executing an application to be downloaded provided in this embodiment may include the following steps:

[0134] S801: Receive an application execution control instruction, where the application execution control instruction includes identification information of an application to be executed.

[0135] S802: Create a lightweight process for the application and allocate storage space for the data structure included in the process.

[0136] Among them, the data structure can include the mpu_info corresponding to the process (if there is MPU (Micro Processor Unit) protection, the parameters to be set when the process is protected by MPU), the code segment entry address and length corresponding to the process, the data segment entry address and length, the process ID, the currently running thread of the process, etc.

[0137] Specifically, each application may correspond to a lightweight process, and each lightweight process may contain multiple threads.

[0138] S803: Search the application registration table for application information of the application to be executed according to the identification information of the application to be executed.

[0139] For example, the application information may include an instruction execution unit, second stack space information, second heap space information, second code segment information, second data segment information, and the like.

[0140] S804: Execute the application according to the application information.

[0141] Specifically, according to the application information, the second code segment and the second data segment information of the executable file can be read; the second code segment can be set and initialized according to the entry address and length of the second code segment; the second data segment can be dynamically allocated and initialized according to the address and length (if there is MPU protection, the corresponding information will be updated to mpu_info); the application main thread stack space is opened according to the second stack space information, and the business application is started to execute the application.

[0142] In the embodiment of the present invention, the application downloaded and installed on the embedded operating system can be connected and executed through the application executor in the system on chip.

[0143] Figure 9 is a schematic diagram of the structure of a post-application download device provided by an embodiment of the present invention. As shown in Figure 9, the post-application download device 90 is applied to a system-on-chip and may include: an acquisition module 910, a first allocation module 920, a download module 930, a second allocation module 940, and an execution module 950.

[0144] The acquisition module 910 can be used to obtain the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; the first allocation module 920 can be used to dynamically allocate the storage space of the on-chip system for the loadable file based on the first storage space information to obtain the second storage space information; the download module 930 can be used to download the loadable file to the on-chip system according to the second storage space information to form an executable file; the second allocation module 940 can be used to dynamically allocate the running resources of the on-chip system for the executable file according to the first running resource information to obtain the second running resource information; the running module 950 can be used to run the executable file in the on-chip system according to the second storage space information and the second running resource information.

[0145] An application post-download device provided by an embodiment of the present invention is applied to a system-on-chip, and obtains a loadable file corresponding to the application to be downloaded and file header information corresponding to the loadable file through an acquisition module, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and first storage space information of the loadable file in the terminal; through the first allocation module, based on the first storage space information, the storage space of the system-on-chip is dynamically allocated to the loadable file to obtain the second storage space information; through the download module, according to the second storage space information, the loadable file is downloaded to the system-on-chip to form an executable file; through the second allocation module, according to the first running resource information, the running resources of the system-on-chip are dynamically allocated to the executable file to obtain the second running resource information; through the running module, according to the second storage space information and the second running resource information, the executable file is run in the system-on-chip. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0146] Figure 10 is a schematic diagram of another post-application downloading apparatus provided by an embodiment of the present invention. As shown in Figure 10 , the post-application downloading apparatus 100 is applied to a terminal and may include: a compilation module 1010 , a post-compilation module 1020 , and a sending module 1030 .

[0147] The compilation module 1010 can be used to compile the source program of the application to be downloaded to obtain the loadable file corresponding to the application to be downloaded; the post-compilation module 1020 can be used to post-compile the loadable file to obtain file header information, wherein the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; the sending module 1030 can be used to send the loadable file and the file header information to the system-on-chip, so that the system-on-chip dynamically allocates the storage space of the system-on-chip for the loadable file based on the first storage space information to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the system-on-chip to form an executable file; according to the first running resource information, the running resources of the system-on-chip are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the system-on-chip.

[0148] An application post-download device provided by an embodiment of the present invention is applied to a terminal, and compiles the source program of the application to be downloaded through a compilation module to obtain a loadable file corresponding to the application to be downloaded; the loadable file is post-compiled through a post-compilation module to obtain file header information, wherein the file header information includes the first running resource information and first storage space information of the loadable file in the terminal; the loadable file and the file header information are sent to the on-chip system through a sending module, so that the on-chip system dynamically allocates the storage space of the on-chip system for the loadable file based on the first storage space information to obtain second storage space information; according to the second storage space information, the loadable file is downloaded to the on-chip system to form an executable file; according to the first running resource information, the running resources of the on-chip system are dynamically allocated to the executable file to obtain second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the on-chip system. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0149] In addition, corresponding to the post-application download method provided in the above embodiment, an embodiment of the present invention also provides a system on chip. As shown in Figure 11, the system on chip 10 may include: a first memory 1110, a first processor 1120, and a program stored on the first memory 1110 and executable on the first processor 1120. When the first processor 1120 executes the program, all steps of the post-application download method provided in the embodiment of the present invention with the system on chip as the execution body are implemented.

[0150] In the above-mentioned system-on-chip, by obtaining the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; based on the first storage space information, the storage space of the system-on-chip is dynamically allocated to the loadable file to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the system-on-chip to form an executable file; according to the first running resource information, the running resources of the system-on-chip are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the system-on-chip. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0151] In addition, corresponding to the post-application download method provided in the above embodiment, an embodiment of the present invention also provides a terminal, as shown in Figure 12, the terminal 20 may include: a second memory 1210, a second processor 1220, and a program stored on the second memory 1210 and executable on the second processor 1220. When the second processor 1220 executes the program, all steps of the post-application download method provided in the embodiment of the present invention with the terminal as the execution subject are implemented.

[0152] In the above-mentioned terminal, after the embedded operating system of the system-on-chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system-on-chip can be dynamically allocated to the loadable file based on the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system-on-chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system-on-chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0153] In addition, corresponding to the post-application download method provided in the above embodiment, an embodiment of the present invention further provides a computer-readable storage medium on which a program is stored, which, when executed by a processor, implements all steps of the post-application download method of the embodiment of the present invention.

[0154] In the above-mentioned computer-readable storage medium, by obtaining the loadable file corresponding to the application to be downloaded and the file header information corresponding to the loadable file, wherein the loadable file is obtained by the terminal compiling the source program of the application to be downloaded, and the file header information is obtained by the terminal post-compiling the loadable file, and the file header information includes the first running resource information and the first storage space information of the loadable file in the terminal; based on the first storage space information, the storage space of the on-chip system is dynamically allocated to the loadable file to obtain the second storage space information; according to the second storage space information, the loadable file is downloaded to the on-chip system to form an executable file; according to the first running resource information, the running resources of the on-chip system are dynamically allocated to the executable file to obtain the second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the on-chip system. Therefore, after the embedded operating system of the system on chip is released, the storage space corresponding to the first storage space information and the running resources corresponding to the first running resource information on the system on chip can be dynamically allocated to the loadable file according to the first running resource information and the first storage space information of the loadable file in the terminal that are acquired in advance, and the loadable file can be downloaded to the system on chip to form an executable file according to the dynamic allocation result, and the executable file can be executed. This can not only save the storage space of the system on chip, but also perform different management for different applications, thereby realizing flexible application management and improving the user experience.

[0155] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

[0156] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0157] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0158] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0159] In the present invention, unless otherwise specified or limited, the terms "installed," "connected," "connect," "fixed," etc. should be understood in a broad sense. For example, they can refer to fixed connection, detachable connection, or integration; mechanical connection, electrical connection; direct connection, or indirect connection through an intermediate medium; internal communication between two components, or interaction between two components, unless otherwise specified. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0160] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A post-application download method, characterized in that: Applied to a system on chip, the method comprises: Obtaining a loadable file corresponding to the application to be downloaded and file header information corresponding to the loadable file, wherein the loadable file is obtained by compiling a source program of the application to be downloaded by a terminal, and the file header information is obtained by post-compiling the loadable file by the terminal, and the file header information includes first running resource information and first storage space information of the loadable file in the terminal; Based on the first storage space information, dynamically allocating storage space of the system on chip for the loadable file to obtain second storage space information; downloading the loadable file to the system on chip according to the second storage space information to form an executable file corresponding to the application to be downloaded; dynamically allocating the operating resources of the system on chip to the executable file according to the first operating resource information to obtain second operating resource information; The executable file is run in the system on chip according to the second storage space information and the second running resource information.

2. The post-application download method according to claim 1, characterized in that: The first storage space information includes storage space information of each storage segment of the loadable file in the terminal, wherein: The dynamically allocating storage space of the system on chip for the loadable file based on the first storage space information to obtain second storage space information includes: Determine storage space information of each storage segment corresponding to the loadable file in the system on chip according to storage space information of each storage segment of the loadable file in the terminal; The storage space information of each storage segment corresponding to the loadable file in the system on chip is used as the second storage space information.

3. The post-application download method according to claim 2, characterized in that: Each storage segment of the loadable file in the terminal includes a first heap space, a first stack space, a first data segment and a first code segment, wherein: Determining storage space information of each storage segment corresponding to the loadable file in the system on chip according to storage space information of each storage segment of the loadable file in the terminal includes: The size of the second heap space, the size of the first stack space, the size of the second data segment, and the size of the second code segment corresponding to the loadable file in the system on chip, as well as the starting address of the second heap space, the starting address of the second stack space, the starting address of the second data segment, and the starting address of the second code segment are determined based on the size of the first heap space, the size of the first stack space, the size of the first data segment and the size of the first code segment.

4. The post-application download method according to any one of claims 1 to 3, characterized in that: The file header information also includes identification information of the application to be downloaded, and the method further includes: The second storage space information and the identification information are stored in an application registration table of the system on chip, so as to run the application to be downloaded according to the application registration table.

5. The post-application download method according to any one of claims 1 to 3, characterized in that: Before dynamically allocating storage space of the system on chip for the loadable file based on the first storage space information to obtain second storage space information, the method further includes: The loadable file is integrity checked using a preset integrity check algorithm.

6. The post-application download method according to claim 5, characterized in that: The preset integrity check algorithm includes at least one of the following: CRC16 algorithm, CRC32 algorithm, SHA1 algorithm, SHA256 algorithm, SM3 algorithm, and SM1-MAC algorithm.

7. The post-application download method according to any one of claims 1 to 3, characterized in that: The loadable file includes one of the following: a bin file and a hex file.

8. The post-application download method according to any one of claims 1 to 3, characterized in that: The file header information also includes file type information of the loadable file. Before dynamically allocating storage space of the system on chip for the loadable file based on the first storage space information to obtain the second storage space information, the method further includes: The type of the loadable file is verified according to the file type information of the loadable file.

9. The post-application download method according to claim 3, characterized in that: The first operation resource information includes a startup code segment, The method dynamically allocates the operating resources of the system on chip to the executable file according to the first operating resource information to obtain the second operating Resource information, including: Run the startup code segment, set a pointer to the second heap space for the executable file, initialize the second data segment content and relocate the second code segment, and use the pointer to the second heap space, the initialized second data segment content and the address information after relocating the second code segment as the second running resource information.

10. The post-application download method according to claim 4, characterized in that: The file header information also includes an application instance name, where the application instance name is obtained by configuring the application instance by the terminal in the post-compilation step. After the executable file is formed, the method further includes: The executable file is installed as an application instance, and the application instance name is stored in the application registration table.

11. A post-application download method, characterized in that: Applied to a terminal, the method comprises: Compile the source program of the application to be downloaded to obtain a loadable file corresponding to the application to be downloaded; Post-compiling the loadable file to obtain file header information, wherein the file header information includes first running resource information and first storage space information of the loadable file in the terminal; The loadable file and the file header information are sent to the system on chip so that the system on chip dynamically allocates storage space of the system on chip for the loadable file based on the first storage space information to obtain second storage space information; according to the second storage space information, the loadable file is downloaded to the system on chip to form an executable file corresponding to the application to be downloaded; according to the first running resource information, the running resources of the system on chip are dynamically allocated to the executable file to obtain second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the system on chip.

12. A post-application download device, characterized in that: Applied to a system on chip, the post-application downloading device comprises: an acquisition module, used to acquire a loadable file corresponding to the application to be downloaded and file header information corresponding to the loadable file, wherein the loadable file is obtained by compiling the source program of the application to be downloaded by the terminal, and the file header information is obtained by post-compiling the loadable file by the terminal, and the file header information includes first running resource information and first storage space information of the loadable file in the terminal; A first allocation module, configured to dynamically allocate storage space of the system on chip for the loadable file based on the first storage space information to obtain second storage space information; A download module, configured to download the loadable file to the system on chip according to the second storage space information to form an executable file corresponding to the application to be downloaded; A second allocation module, configured to dynamically allocate the operating resources of the system on chip to the executable file according to the first operating resource information, so as to obtain second operating resource information; An operating module is used to operate the executable file in the system on chip according to the second storage space information and the second operating resource information.

13. The post-application downloading device according to claim 12, characterized in that: The first storage space information includes the storage space information of each storage segment of the loadable file in the terminal, wherein the first allocation module is specifically used to determine the storage space information of each storage segment corresponding to the loadable file in the on-chip system based on the storage space information of each storage segment of the loadable file in the terminal; and use the storage space information of each storage segment corresponding to the loadable file in the on-chip system as the second storage space information.

14. The post-application downloading device according to claim 13, characterized in that: The storage segments of the loadable file in the terminal include a first heap space, a first stack space, a first data segment and a first code segment, wherein the first allocation module is specifically used to determine the size of the second heap space, the size of the second stack space, the size of the second data segment and the size of the second code segment corresponding to the loadable file in the system on chip, as well as the starting address of the second heap space, the starting address of the second stack space, the starting address of the second data segment and the starting address of the second code segment according to the size of the first heap space, the size of the first stack space, the size and starting address of the first data segment and the size and starting address of the first code segment.

15. The post-application downloading device according to any one of claims 12 to 14, characterized in that: The file header information also includes identification information of the application to be downloaded, and the device also includes: The storage module is used to store the second storage space information and the identification information in an application registration table of the system on chip, so as to run the application to be downloaded according to the application registration table.

16. The post-application downloading device according to any one of claims 12 to 14, characterized in that: The device also includes: The first verification module is used to perform integrity verification on the loadable file using a preset integrity verification algorithm.

17. The post-application downloading device according to claim 16, characterized in that: The preset integrity check algorithm includes at least one of the following: CRC16 algorithm, CRC32 algorithm, SHA1 algorithm, SHA256 algorithm, SM3 algorithm, and SM1-MAC algorithm.

18. The post-application downloading device according to any one of claims 12 to 14, characterized in that: The loadable file includes one of the following: a bin file and a hex file.

19. The post-application downloading device according to any one of claims 12 to 14, characterized in that: The file header information also includes file type information of the loadable file, and the device also includes: The second verification module is used to verify the type of the loadable file according to the file type information of the loadable file.

20. The post-application downloading device according to claim 14, characterized in that: The first operating resource information includes a startup code segment, and the second allocation module is specifically used to run the startup code segment, set a pointer to the second heap space for the executable file, initialize the second data segment content and relocate the second code segment, and use the pointer to the second heap space, the initialized second data segment content and the address information after relocating the second code segment as the second operating resource information.

21. The post-application downloading device according to claim 15, characterized in that: The file header information also includes an application instance name, which is obtained by configuring the application instance in the post-compilation step. The storage module is also used to install the executable file as an application instance and store the application instance name in the application registry.

22. A post-application download device, characterized in that: Applied to a terminal, the post-application downloading device comprises: A compiling module, used to compile the source program of the application to be downloaded to obtain a loadable file corresponding to the application to be downloaded; A post-compilation module, used to post-compile the loadable file to obtain file header information, wherein the file header information includes first running resource information and first storage space information of the loadable file in the terminal; A sending module is used to send the loadable file and the file header information to the system on chip, so that the system on chip dynamically allocates storage space of the system on chip for the loadable file based on the first storage space information to obtain second storage space information; according to the second storage space information, the loadable file is downloaded to the system on chip to form an executable file corresponding to the application to be downloaded; according to the first running resource information, the running resources of the system on chip are dynamically allocated to the executable file to obtain second running resource information; according to the second storage space information and the second running resource information, the executable file is run in the system on chip.

23. A system on chip, characterized in that: include: A first memory, a first processor, and a program stored in the first memory and executable on the first processor, wherein when the first processor executes the program, the post-application download method according to any one of claims 1 to 10 is implemented.

24. A terminal, characterized in that: include: A second memory, a second processor, and a program stored in the second memory and executable on the second processor, wherein when the second processor executes the program, the post-application download method according to claim 11 is implemented.

25. A post-application download system, characterized in that: The method comprises a system on chip according to claim 23 and a terminal according to claim 24.

26. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the post-application download method according to any one of claims 1-11 is implemented.

Citation Information

Patent Citations

  • Application downloading method and application downloading system

    CN111880800A

  • Memory protection method based on RISC-V processor, control device and storage medium

    CN115510423A

  • Post-application downloading method and device, system on chip, terminal and storage medium

    CN116700833A

  • Embedded software loading debugging method and system thereof

    CN1904853A

  • Method and system for loading executable image into memory

    WO2020226189A1