Application downloading method and device, resource-constrained equipment and storage medium
By caching and batch writing component information of download commands in the security chip, the problem of low application download performance in the SE chip is solved, and a more efficient download process is achieved.
Patent Information
- Application Number
- CN202411196809.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2026-02-10
AI Technical Summary
There is a lack of effective means in the current technology to improve the performance of application downloads in security chips (SE chips), especially when the application package size increases in multi-application and complex scenarios.
By acquiring multiple download commands, the component information corresponding to each download command is cached in RAM, and written to NVM all at once after a page of RAM is full. A cross-command transaction mechanism is used to reduce the number of erase and write operations.
It accelerates the application download process and improves application download performance on resource-constrained devices.
Smart Images

Figure CN121501296A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an application downloading method and device, a resource-restricted device and a storage medium. BACKGROUND
[0002] At present, with the wide use of security chips (SE), more and more SE products begin to support multi-application, post-download, operating system running on resource-restricted devices, such as JavaCard virtual machine, multos virtual machine, WebAssembly virtual machine, etc.
[0003] At the same time, with more and more application scenarios and increasing complexity, the size of application package is gradually increasing, and there is a higher requirement on the download and installation performance of SE chip about application. There is a lack of an effective technical means to improve the performance of application download in SE chip in the prior art. SUMMARY
[0004] The present application provides an application downloading method and device, a resource-restricted device and a storage medium, which can reduce the number of erasing and writing of NVM in the application downloading process, speed up the application downloading process, and improve the application downloading performance of the resource-restricted device.
[0005] According to an aspect of the present application, an application downloading method is provided, which is executed by a resource-restricted device supporting multi-application; the method comprises:
[0006] obtaining a plurality of download commands, and sequentially caching component information corresponding to each download command to a random access memory (RAM);
[0007] after detecting that the component information in the RAM is full of a page, writing all the component information in the page to a non-volatile memory (NVM).
[0008] According to another aspect of the present application, an application downloading device is provided, which is configured in a resource-restricted device supporting multi-application, and comprises:
[0009] a command obtaining module, configured to obtain a plurality of download commands, and sequentially cache component information corresponding to each download command to a RAM;
[0010] an information writing module, configured to, after detecting that the component information in the RAM is full of a page, write all the component information in the page to a NVM.
[0011] According to another aspect of the present application, a resource-restricted device is provided, which comprises:
[0012] At least one processor; and
[0013] A memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the application download method described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the application download method described in any embodiment of the present invention.
[0016] The technical solution provided by this invention involves acquiring multiple download commands, sequentially caching the component information corresponding to each download command in RAM, and writing all component information within the page into the NVM after detecting that the component information in the RAM is full. This method of writing the component information of multiple download commands into the NVM at once provides a cross-command transaction mechanism compared to the standard transaction mechanism. This reduces the number of times the NVM is erased and written during application download, accelerates the application download process, and improves the application download performance of resource-constrained devices.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of an application download method provided according to an embodiment of the present invention;
[0020] Figure 2 This is a flowchart of another application download method provided according to an embodiment of the present invention;
[0021] Figure 3a This is a flowchart of another application download method provided according to an embodiment of the present invention;
[0022] Figure 3b This is a flowchart of another application download method provided according to an embodiment of the present invention;
[0023] Figure 3c This is a flowchart of an application download exception handling method provided by an embodiment of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of an application download device according to an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the structure of a resource-constrained device that implements the application download method of this invention. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] Figure 1 This is a flowchart illustrating an application download method provided in an embodiment of the present invention. This embodiment is applicable to resource-constrained devices downloading applications. The method can be executed by an application download device, which can be configured within a resource-constrained device that supports multiple applications. The method includes:
[0029] Step 110: Obtain multiple download commands and cache the component information corresponding to each download command into RAM in sequence.
[0030] In this embodiment, the resource-constrained device is an electronic device with limited storage capacity, including smart cards, security chips, IoT devices, etc., and this embodiment does not impose any limitations on this. Optionally, the resource-constrained device can obtain multiple download commands from the electronic device through Application Protocol Data Unit (APDU) or other protocols, and then cache the component information corresponding to each download command in RAM in sequence.
[0031] In one specific embodiment, the download command may consist of two parts: a data command header and a data body to be downloaded. The component information corresponding to each download command includes the installation package information or application information corresponding to each download command.
[0032] Step 120: After detecting that the component information in the RAM is full, write all the component information in the page into the NVM.
[0033] In this embodiment, during the process of caching the component information corresponding to the above download command to RAM, the storage capacity occupied by the component information in RAM can be counted in real time. If it is detected that the component information in RAM is full of a page, then all the component information in that page is written to NVM.
[0034] Here, a page can be understood as a fixed-size block in RAM that is divided for memory paging management. It should be noted that the size of a page is not fixed; it depends on the operating system's memory paging strategy. Common page sizes include 4KB, 8KB, and 16KB, and this embodiment does not impose any limitations on this.
[0035] The technical solution provided by this invention involves acquiring multiple download commands, sequentially caching the component information corresponding to each download command in RAM, and writing all component information within the page into the NVM after detecting that the component information in the RAM is full. This method of writing the component information of multiple download commands into the NVM at once provides a cross-command transaction mechanism compared to the standard transaction mechanism (i.e., writing data once for each download command). This reduces the number of times the NVM is erased and written during application download, accelerates the application download process, and improves the application download performance of resource-constrained devices.
[0036] Figure 2 A flowchart of another application download method provided in an embodiment of the present invention, such as... Figure 2 As shown, the method includes:
[0037] Step 210: Record the session information corresponding to the application to be downloaded.
[0038] In this embodiment, before starting the download process, the session information corresponding to the application to be downloaded can be recorded in advance, including: the table ID of the global installation package to which the installation package to be downloaded belongs, the table ID of the global application to which the application to be downloaded belongs, the storage start address of the installation package to be downloaded, and the storage start address of the application to be downloaded.
[0039] The advantage of this setup is that by pre-recording the session information of the application to be downloaded, download errors can be avoided during the execution of subsequent download commands, thereby improving the accuracy of application download results.
[0040] Step 220: Obtain multiple download commands. Based on the session information, sequentially obtain the component information corresponding to each download command and cache each component information in RAM.
[0041] In this step, specifically, the component information corresponding to each download command can be obtained based on the table ID of the global installation package to which the installation package to be downloaded belongs, the table ID of the global application to which the application to be downloaded belongs, the storage start address of the installation package to be downloaded, and the storage start address of the application to be downloaded, and the component information can be cached in RAM.
[0042] Step 230: After detecting that the component information in the RAM is full, write all the component information in the page into the memory page of the NVM according to the storage space occupied by the memory page in the NVM.
[0043] In this embodiment, a page refers to a page in the NVM. Optionally, if the component information in RAM fills a page in the NVM, this component information can be written to the memory page in the NVM in a page address aligned manner. Page address alignment means that the memory address must be an integer multiple of the page size. If a memory address is divisible by the page size, then this address is page aligned.
[0044] In one specific embodiment, before writing component information from RAM to the NVM, the size of a page in the NVM can be obtained by querying the operating system's documentation or the relevant application programming interface (API). For any given address in the NVM, it can be adjusted to an integer multiple of the page size through mathematical operations. Then, a bitwise AND operation is performed on the result, and the result is calculated by performing an operation with the two's complement of the page size. The aligned address is then calculated. Finally, the component information is written by calling the memory allocation function provided by the operating system and specifying the aligned address.
[0045] The advantage of this setup is that by writing all component information within a page into the memory page of NVM in a page-address-aligned manner, the operating system can manage memory more efficiently, reduce memory fragmentation, and improve memory access speed.
[0046] In one embodiment of this example, while writing all component information within a page into the memory page of the NVM in a page address-aligned manner, the method also includes: real-time recording of the cache information corresponding to the NVM, including the memory page address in the NVM and the offset address corresponding to the current cached data in the NVM.
[0047] The advantage of this setup is that by recording the cache information corresponding to NVM in real time, it is easier for users to manage the download component information of different applications, thereby improving application management efficiency.
[0048] The technical solution provided by this invention records session information corresponding to the application to be downloaded, obtains multiple download commands, sequentially obtains component information corresponding to each download command based on the session information, caches each component information in RAM, and, after detecting that the component information in RAM is full, writes all component information in the page into the memory page of NVM according to the storage space occupied by the memory page in NVM. This technique can reduce the number of times NVM is erased and written during application download, accelerate the application download process, and improve the application download performance of resource-constrained devices.
[0049] Figure 3a A flowchart of another application download method provided in an embodiment of the present invention, such as... Figure 3a As shown, the method includes:
[0050] Step 310: Record the session information corresponding to the application to be downloaded.
[0051] Step 320: Obtain multiple download commands. Based on the session information, sequentially obtain the component information corresponding to each download command and cache each component information in RAM.
[0052] Step 330: After detecting that the component information in the RAM is full, write all the component information in the page into the NVM.
[0053] Step 340: Generate the global reference table for the downloaded application.
[0054] The global reference table is used to store global data referenced by downloaded applications, addresses of external files called by the chip, table entry IDs corresponding to the global installation packages to which the downloaded applications belong, and table entry IDs corresponding to the global applications to which the downloaded applications belong.
[0055] In this embodiment, optionally, the component information corresponding to each download command is stored in the form of a continuous binary file. Specifically, the component information may include method component information and link component information for the download command. The method component is used to implement the business function corresponding to the download command; the link component is used to store the conversion relationship between the external file addresses called by the downloaded application and the internal file addresses of the chip. The global reference table may be stored within the link component.
[0056] The advantage of this setup is that by storing a global reference table within the link component, it is easy to quickly retrieve external files called by downloaded applications based on the address translation relationships stored within the link component, thereby improving the application download performance on resource-constrained devices.
[0057] Step 350: Write the download completion flag corresponding to the downloaded application into the NVM.
[0058] In this step, optionally, if an application download is complete, the corresponding download completion flag "1" can be written to NVM.
[0059] The advantage of this setup is that by writing the download completion flag for each downloaded application into NVM, users can easily understand the download progress of different applications, thus improving application management efficiency.
[0060] The technical solution provided by this invention records session information corresponding to the application to be downloaded, obtains multiple download commands, sequentially obtains component information corresponding to each download command based on the session information, caches each component information in RAM, and after detecting that the component information in RAM is full, writes all component information in the page into NVM to generate a global reference table corresponding to the downloaded application. The technical means of writing the download completion flag corresponding to the downloaded application into NVM can reduce the number of times NVM is erased and written during the application download process, accelerate the application download process, and improve the application download performance of resource-constrained devices.
[0061] Based on the above embodiments, Figure 3b This is a flowchart of another application download method provided in this embodiment. For example... Figure 3b As shown, after starting the download, the session information of the application to be downloaded can be recorded, and then it can be determined whether there are any uncached download commands among the multiple download commands obtained;
[0062] If yes, then cache the component information of the uncached download commands to RAM in sequence, and determine whether the component information in RAM is full; if yes, write all the component information in a page to NVM, generate the global reference table corresponding to the downloaded application, and write the download completion flag corresponding to the downloaded application; if no, return to the operation of determining whether there are uncached download commands, until all download commands are cached.
[0063] If not, determine whether the component information in RAM is full. If yes, write all component information in a page to NVM, generate a global reference table for the downloaded application, and write the download completion flag for the downloaded application. If not, directly write the download completion flag for the downloaded application.
[0064] In one embodiment of this example, if an abnormality is detected when the download command is executed in the manner described above, the component information corresponding to the target download command in the RAM and NVM can be cleaned up, and the session information corresponding to the target download command can also be cleaned up. Optionally, the information corresponding to the target download command in the global reference table can also be deleted, and the download completion flag corresponding to the target download command can be cleaned up.
[0065] In one specific embodiment Figure 3c This is a flowchart of an application download exception handling method provided in this embodiment. Figure 3c As shown, after detecting an abnormality in the execution of the target download command, the component information corresponding to the target download command in the RAM cache page can be cleaned up first, then the global reference table corresponding to the target download command can be cleaned up, information with the same ID as the target download command can be deleted, and the component information corresponding to the target download command in NVM can be cleaned up to release the storage space of NVM. At the same time, the session information of the target download command can be cleaned up, and finally the download completion flag corresponding to the target download command can be cleaned up.
[0066] The advantage of this setting is that it promptly releases storage space in RAM and NVM after the target download command executes abnormally, which can prevent abnormal download information from occupying space in RAM and NVM and improve the resource utilization of RAM and NVM.
[0067] Figure 4 This is a schematic diagram of an application download device provided in an embodiment of the present invention. The device is configured within a resource-constrained device that supports multiple applications, such as... Figure 4 As shown, the device includes a command acquisition module 410 and an information writing module 420.
[0068] The command acquisition module 410 is used to acquire multiple download commands and cache the component information corresponding to each download command into RAM in turn;
[0069] The information writing module 420 is used to write all the component information in the page into the NVM after detecting that the component information in the RAM is full.
[0070] The technical solution provided by this invention involves acquiring multiple download commands, sequentially caching the component information corresponding to each download command in RAM, and writing all component information within the page into the NVM after detecting that the component information in the RAM is full. This method of writing the component information of multiple download commands into the NVM at once provides a cross-command transaction mechanism compared to the standard transaction mechanism. This reduces the number of times the NVM is erased and written during application download, accelerates the application download process, and improves the application download performance of resource-constrained devices.
[0071] Based on the above embodiments, the component information corresponding to each download command includes the installation package information or application information corresponding to each download command. The component information corresponding to each download command is stored in the form of a contiguous binary file.
[0072] The command acquisition module 410 includes:
[0073] The session information recording unit is used to record the session information corresponding to the application to be downloaded;
[0074] The session information processing unit is used to sequentially obtain the component information corresponding to each download command based on the session information, and cache each component information in RAM;
[0075] The session information includes: the table ID of the global installation package to which the installation package to be downloaded belongs, the table ID of the global application to which the application to be downloaded belongs, the storage start address of the installation package to be downloaded, and the storage start address of the application to be downloaded.
[0076] The information writing module 420 includes:
[0077] The storage space processing unit is used to write all component information in a page into the memory page of the NVM according to the storage space occupied by the memory page in the NVM;
[0078] The memory page writing unit is used to write all component information within a page into a memory page in the NVM in a page address aligned manner.
[0079] The cache information recording unit is used to record the cache information corresponding to NVM in real time, including the memory page address in NVM and the offset address corresponding to the current cached data in NVM.
[0080] The device further includes:
[0081] An exception handling module is used to clean up the component information corresponding to the target download command in the RAM and NVM, and clean up the session information corresponding to the target download command after detecting an exception in the execution of the target download command.
[0082] A global reference table generation module is used to generate a global reference table corresponding to the downloaded application. The global reference table is used to store global data referenced by the downloaded application, the external file address of the application being called, the table ID corresponding to the global installation package to which the downloaded application belongs, and the table ID corresponding to the global application to which the downloaded application belongs. The global reference table is stored in the linking component, which is used to store the conversion relationship between the external file address of the chip called by the downloaded application and the internal file address of the chip.
[0083] The target information deletion module is used to delete the information corresponding to the target download command in the global reference table;
[0084] The download flag writing module is used to write the download completion flag corresponding to the downloaded application into the NVM;
[0085] The download flag cleanup module is used to clean up the download completion flag corresponding to the target download command after detecting an abnormality in the execution of the target download command.
[0086] The above-described apparatus can execute the methods provided in all the foregoing embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the above methods. Technical details not described in detail in the embodiments of the present invention can be found in the methods provided in all the foregoing embodiments of the present invention.
[0087] Figure 5 A schematic diagram of the structure of a resource-constrained device 10 that can be used to implement embodiments of the present invention is shown, such as... Figure 5As shown, the resource-constrained device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the resource-constrained device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0088] Multiple components in resource-constrained device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows resource-constrained device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0089] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as application download methods.
[0090] In some embodiments, the application download method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on resource-constrained device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the application download method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the application download method by any other suitable means (e.g., by means of firmware).
[0091] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0092] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0093] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on a resource-constrained device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the resource-constrained device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or haptic feedback); and input from the user can be received in any form (including sound input, voice input, or haptic input).
[0095] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0096] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0097] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0098] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An application download method, characterized in that, Performed by a resource-constrained device that supports multiple applications, the method includes: Obtain multiple download commands, and cache the component information corresponding to each download command into the random access memory (RAM) in sequence; Once it is detected that a page of component information in the RAM is full, all component information in the page is written to the non-volatile memory (NVM).
2. The method according to claim 1, characterized in that, Retrieve multiple download commands, and cache the component information corresponding to each download command in RAM in sequence, including: Determine whether any of the multiple download commands are uncached; If so, the component information corresponding to the uncached download commands will be cached in RAM in turn.
3. The method according to claim 2, characterized in that, After determining whether there is an uncached download command among the multiple download commands, the process further includes: If not, determine whether the component information in the RAM is full (one page is filled). If a page is full, all component information within that page is written to the NVM.
4. The method according to claim 1, characterized in that, The component information corresponding to each download command includes the installation package information or application information corresponding to each download command.
5. The method according to claim 1, characterized in that, Before obtaining multiple download commands, it also includes: Record the session information corresponding to the application to be downloaded; The component information corresponding to each download command is cached in RAM in sequence, including: Based on the session information, the component information corresponding to each download command is obtained sequentially, and the component information is cached in RAM.
6. The method according to claim 5, characterized in that, The session information includes: The table entry ID corresponding to the global installation package to which the installation package to be downloaded belongs, the table entry ID corresponding to the global application to which the application to be downloaded belongs, the starting storage address corresponding to the installation package to be downloaded, and the starting storage address corresponding to the application to be downloaded.
7. The method according to claim 1, characterized in that, Writing all component information within a single page to the NVM includes: Based on the storage space occupied by the memory page in NVM, all component information within the page is written into the memory page in NVM.
8. The method according to claim 7, characterized in that, Write all component information within a single page into a memory page in the NVM, including: All component information within a single page is written into a memory page in the NVM, aligned to page addresses.
9. The method according to claim 8, characterized in that, While writing all component information within a single page into the memory page of the NVM according to page address alignment, the process also includes: Record the cache information corresponding to NVM in real time, including the memory page address in NVM and the offset address corresponding to the current cached data in NVM.
10. The method according to claim 5, characterized in that, The method further includes: Upon detecting an abnormality in the execution of the target download command, the component information corresponding to the target download command in the RAM and NVM is cleaned up. Clean up the session information corresponding to the target download command.
11. The method according to claim 3 or 10, characterized in that, After writing all component information within a single page to the NVM, the process also includes: Generate a global reference table for the downloaded applications; The global reference table is used to store global data referenced by downloaded applications, the external file address of the applications being called, the table entry ID corresponding to the global installation package to which the downloaded applications belong, and the table entry ID corresponding to the global application to which the downloaded applications belong.
12. The method according to claim 11, characterized in that, After detecting an abnormality in the execution of the target download command, the following is also included: The information corresponding to the target download command in the global reference table is deleted.
13. The method according to claim 11, characterized in that, The component information corresponding to each download command is stored in the form of consecutive binary files; The global reference table is stored within the linking component, which stores the conversion relationship between the addresses of external files called by downloaded applications and the addresses of internal files.
14. The method according to claim 11, characterized in that, After generating the global reference table for the downloaded application, the following is also included: In the NVM, a download completion flag corresponding to the downloaded application is written.
15. The method according to claim 14, characterized in that, After detecting an abnormality in the execution of the target download command, the following is also included: Clean up the download completion flag corresponding to the target download command.
16. The method according to claim 1, characterized in that, The aforementioned page refers to a page in the NVM.
17. An application downloading device, characterized in that, The device, configured within a resource-constrained device that supports multiple applications, includes: The command acquisition module is used to acquire multiple download commands and cache the component information corresponding to each download command in RAM in turn; The information writing module is used to write all the component information in the page into the NVM after detecting that the component information in the RAM is full.
18. A resource-constrained device, characterized in that, The resource-constrained devices include: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the application download method according to any one of claims 1-16.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the application download method according to any one of claims 1-16.
Citation Information
Patent Citations
Data storage device and data writing method thereof
CN107870738A
Data storage device, host device, and data writing method
CN109885506A
Method and device for downloading and analyzing program package, terminal equipment and storage medium
CN114879986A
Application downloading method and device, resource-constrained equipment and storage medium
CN119088406A