Application upgrading method and device, equipment, terminal, storage medium and program

By receiving and processing specific upgrade instructions in the WebAssembly virtual machine running system, obtaining and saving old version application data and restoring it to the new version of the application, the problem of data loss during application upgrade is solved, and the flexibility of application upgrade is improved.

CN119088420APending Publication Date: 2024-12-06BEIJING TONGFANG MICROELECTRONICS

Patent Information

Application Number
CN202411201995.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In a running system based on WebAssembly virtual machine, data from old versions of applications cannot be retained during application upgrades, resulting in poor application upgrade flexibility.

Method used

By receiving the first upgrade instruction containing the application data holding indication information, the application data object of the old version of the application is acquired and saved, and under the second upgrade instruction, it is restored to the application data object of the new version of the application.

Benefits of technology

Improves flexibility in application upgrades in WebAssembly virtual machine running systems, allowing application data to be retained and synchronized during the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088420A_ABST
    Figure CN119088420A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an application upgrading method and device, equipment, a terminal, a storage medium and a program.The method is applied to an operation system of a WebAssembly virtual machine and comprises the steps that a first upgrading instruction initiated by a to-be-upgraded application is received; the first upgrading instruction comprises application data retention indication information of the to-be-upgraded application; obtaining an old-version application corresponding to the to-be-upgraded application and an application data object of the old-version application according to application data retention indication information included in the first upgrading instruction, and storing application data in the application data object of the old-version application; receiving a second upgrading instruction initiated by the to-be-upgraded application; and recovering the application data in the application data object of the old-version application to the application data object of the new-version application corresponding to the old-version application according to the second upgrading instruction. According to the technical scheme provided by the embodiment of the invention, the application upgrading flexibility in the operation system of the WebAssembly virtual machine can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to an application upgrading method, apparatus, device, terminal, storage medium and program. Background Art

[0002] At present, a multi-application operating system is usually deployed in a resource-constrained chip or device. The application operating system can provide an operating environment and application programming interface to the application to realize its application functions, such as an operating system based on the WebAssembly (web assembly, abbreviated as wasm) virtual machine. Most applications need to store some application data persistently, such as identity information and static keys. At the same time, many applications have the need to upgrade, and require that the existing application data in the application to be upgraded be retained after the upgrade.

[0003] In the process of implementing the present invention, the inventors found that the prior art has the following defects: On the operating system based on the WebAssembly virtual machine, the application creates a persistent application data object by calling the application programming interface. If the application on the operating system based on the WebAssembly virtual machine is upgraded, the old version of the application needs to be deleted and then the new version of the application needs to be installed. At this time, the application data object in the old version of the application will be deleted and cannot be retained and synchronized to the new version of the application, thereby limiting the ability of application developers to flexibly upgrade applications that have been deployed to chips or devices. Summary of the invention

[0004] Embodiments of the present invention provide an application upgrade method, apparatus, device, terminal, storage medium, and program, which can improve the flexibility of application upgrades in a running system of a WebAssembly virtual machine.

[0005] According to one aspect of the present invention, there is provided an application upgrade method, which is applied to a running system of a WebAssembly virtual machine, comprising:

[0006] Receive a first upgrade instruction initiated for an application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded;

[0007] Acquire an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application;

[0008] receiving a second upgrade instruction initiated for the application to be upgraded;

[0009] The application data in the application data object of the old version application is restored to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction.

[0010] According to another aspect of the present invention, there is provided an application upgrade device, which is configured in a running system of a WebAssembly virtual machine, and includes:

[0011] A first upgrade instruction receiving module, configured to receive a first upgrade instruction initiated by the application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded;

[0012] an application data saving module, configured to obtain an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application;

[0013] A second upgrade instruction receiving module, used to receive a second upgrade instruction initiated to the application to be upgraded;

[0014] The application data recovery module is used to recover the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction.

[0015] According to another aspect of the present invention, a restricted device is provided, wherein an operating system is installed on the restricted device, a runtime environment is executed in the operating system, and the restricted device comprises:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can apply the application upgrade method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a terminal is provided, comprising the restricted device according to any one of the embodiments of the present invention.

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

[0021] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the application upgrading method described in any embodiment of the present invention is implemented.

[0022] The embodiment of the present invention receives a first upgrade instruction initiated by a WebAssembly virtual machine's operating system for an application to be upgraded, which includes application data retention indication information of the application to be upgraded, so as to obtain an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application, and further receives a second upgrade instruction initiated by the application to be upgraded, so as to restore the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction. This can solve the problem of poor flexibility when performing application upgrades in the existing WebAssembly virtual machine's operating system, and can improve the flexibility of application upgrades in the WebAssembly virtual machine's operating system.

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

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

[0025] Figure 1 is a flow chart of an application upgrade method provided by an embodiment of the present invention;

[0026] Figure 2 is a flow chart of another application upgrade method provided by an embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of the structure of an application data object provided by an embodiment of the present invention;

[0028] Figure 4 is a flow chart of another application upgrade method provided by an embodiment of the present invention;

[0029] Figure 5 It is a schematic diagram of the effect of restoring application data to an application data object of a new version application provided by an embodiment of the present invention;

[0030] Figure 6 is a flow chart of another application upgrade method provided by an embodiment of the present invention;

[0031] Figure 7 is a schematic diagram of an application upgrading device provided by an embodiment of the present invention;

[0032] Figure 8 A schematic diagram of the structure of a restricted device provided by an embodiment of the present invention;

[0033] Fig. 9 is a structural diagram of a terminal provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

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

[0036] Figure 1 is a flowchart of an application upgrade method provided by an embodiment of the present invention. This embodiment is applicable to the case where the operating system of the WebAssembly virtual machine performs application upgrades while maintaining application data. The method can be executed by an application upgrade device, which can be implemented by software and / or hardware and can generally be integrated in a restricted device. The restricted device can be integrated in a terminal device. The embodiment of the present invention does not limit the specific device type of the restricted device. Figure 1 As shown, the method includes the following operations:

[0037] S110. Receive a first upgrade instruction initiated for an application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded.

[0038] The first upgrade instruction may be used to instruct the operating system of the WebAssembly virtual machine to start upgrading the application to be upgraded. The application to be upgraded is also the application that needs to be upgraded. The application data retention indication information is used to indicate the preservation of application data of the application to be upgraded.

[0039] In an embodiment of the present invention, during the operation of the operating system of the WebAssembly virtual machine, the upgrade indication status of each application can be detected in real time. If a first upgrade instruction initiated for an application to be upgraded is received at a certain moment, preparations can be made to upgrade the application to be upgraded.

[0040] Optionally, the operating system of the WebAssembly virtual machine can be integrated into a restricted device. The restricted device may include, but is not limited to, an embedded security element, a smart card, a SE (Secure Element), a security chip, or an embedded device.

[0041] S120. Acquire an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application.

[0042] Among them, the application data object can be used to store the application data of the application in the running system of the WebAssembly virtual machine. One application can be configured with one or more application data objects, and the application data objects of different applications can be allocated continuously or discretely in the corresponding storage space, or partially continuously or partially discretely, etc. The embodiment of the present invention does not limit the storage location of the application data objects corresponding to each application in the storage space.

[0043] Accordingly, when the operating system of the WebAssembly virtual machine receives the first upgrade instruction initiated for the application to be upgraded, the first upgrade instruction can be parsed to obtain the application data retention indication information of the application to be upgraded, thereby obtaining the old version application and the application data object of the old version application corresponding to the application to be upgraded based on the application data retention indication information of the application to be upgraded obtained through the parsing. After obtaining the application data object of the old version application corresponding to the application to be upgraded, the application data object can be further parsed to obtain the application data stored in the application data object.

[0044] Optionally, the types of applications to be upgraded are different, and the types of application data in the application data objects corresponding to the old version applications may also be different. The application data in the application data objects corresponding to the old version applications of certain types of applications to be upgraded may include only one type of data, that is, all types of application data of the application are stored in one storage area of ​​the application data object. The application data in the application data objects corresponding to the old version applications of certain types of applications to be upgraded may include two types of data, that is, the two types of application data of the application are stored in two storage areas of the application data object respectively.

[0045] S130: Receive a second upgrade instruction initiated for the application to be upgraded.

[0046] The second upgrade instruction may be used to instruct the operating system of the WebAssembly virtual machine to start downloading a new version of the application to complete the upgrade process of the old version of the application corresponding to the application to be upgraded.

[0047] Correspondingly, when the operating system of the WebAssembly virtual machine responds to the first upgrade instruction and saves the application data in the application data object of the old version application corresponding to the program to be upgraded, it can receive and respond to the second upgrade instruction, download the new version application corresponding to the old version application, and start upgrading the new version application corresponding to the old version application.

[0048] S140. According to the second upgrade instruction, restore the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application.

[0049] It is understandable that the operating system of the WebAssembly virtual machine responds to the second upgrade instruction, downloads the new version application corresponding to the old version application, and then creates an application data object corresponding to the new version application. When the application data object corresponding to the new version application is created, the operating system of the WebAssembly virtual machine can further respond to the second upgrade instruction to restore the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application, thereby completing the upgrade process of the application to be upgraded.

[0050] It can be seen that the above application upgrade method can retain the application data corresponding to the old version of the application for the new version of the application during the application upgrade process of the running system of the WebAssembly virtual machine, so that application developers can flexibly upgrade their deployed applications.

[0051] The embodiment of the present invention receives a first upgrade instruction initiated by a WebAssembly virtual machine's operating system for an application to be upgraded, which includes application data retention indication information of the application to be upgraded, so as to obtain an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application, and further receives a second upgrade instruction initiated by the application to be upgraded, so as to restore the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction. This can solve the problem of poor flexibility when performing application upgrades in the existing WebAssembly virtual machine's operating system, and can improve the flexibility of application upgrades in the WebAssembly virtual machine's operating system.

[0052] Figure 2 is a flowchart of another application upgrade method provided by an embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, a specific optional implementation method for saving application data in an application data object of an old version application is provided. Figure 2 As shown, the method of this embodiment may include:

[0053] S210: Receive a first upgrade instruction initiated for an application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded.

[0054] When the application to be upgraded needs to be upgraded, before deleting the old version of the application to be upgraded, a first upgrade instruction may be transmitted to the operating system based on the WebAssembly virtual machine.

[0055] In an optional embodiment of the present invention, the application data retention indication information may include: an application identifier of the old version application, a version of the old version application, and an identifier of a data object of the old version application.

[0056] Among them, the application identifier can be used to uniquely identify the application. The identifier of the old version application data object can uniquely identify the old version application data object. Optionally, the application identifier and the identifier of the application data object can include, for example, a number, a name, or a string, etc., as long as the function of unique identification can be achieved. The embodiment of the present invention does not limit the specific type and content of the application identifier and the identifier of the application data object.

[0057] Exemplarily, the application representation may be an AID (Application Identifier). When the identification of the old version application data object adopts a number, the number of the application data object may adopt the position number of the application data object in the reference array.

[0058] S220: Determine the old version application corresponding to the application to be upgraded according to the application identifier of the old version application and the version of the old version application.

[0059] Specifically, the operating system of the WebAssembly virtual machine can parse the application data retention indication information in the first upgrade instruction to obtain the application identifier of the old version application and the version of the old version application, and then find the old version application corresponding to the application to be upgraded according to the application identifier of the old version application and the version of the old version application.

[0060] S230: Search the first data area of ​​the old version application according to the identifier of the application data object corresponding to the old version application to obtain the application data object corresponding to the old version application.

[0061] The first data area may be one of the data areas in the application data object for storing application data. The first data area may be used to store the first part of data. Exemplary. The first part of data may include but is not limited to data types such as type, persistent storage identifier, and number.

[0062] In an embodiment of the present invention, on a running system based on a WebAssembly virtual machine, an application can create one or more application data objects by calling the system's application programming interface. Exemplarily, the application data object can be used to store the application's persistent application data, for example, including but not limited to the basic type data in the reference domain data, and persistent arrays, key objects, and algorithm objects created through the application programming interface.

[0063] In an optional embodiment of the present invention, before the receiving of the first upgrade instruction initiated for the application to be upgraded, it may also include: when it is determined that the application is a first type of application, applying for a first data area for the application in a persistent data storage device, and storing the first part of data of each application data object created by the application through the first data area; when it is determined that the application is a second type of application, applying for a first data area and a second data area for the application in a persistent data storage device, storing the first part of data of each application data object created by the application through the first data area, and storing the second part of data of some application data objects through the second data area; wherein the first part of data may include: at least one of: application data type, persistent storage identifier, application data number and data field; wherein the second part of data may include: data field referenced by the first part of data of the application data object.

[0064] The first type of application may be an application type that only needs the first data area to store the first part of the data, for example, an application type with simple requirements. The second type of application may be an application type that requires both the first data area to store the first part of the data and the second data area to store the second part of the data, for example, an application type with more complex requirements.

[0065] Optionally, the application data object can be created in a persistent data storage. The persistent data storage is a mechanism that can convert data between a persistent state and a transient state, and is mainly used to store objects in memory in a database, or in a disk file and an XML (Extensible Markup Language) data file, etc. Optionally, each application has a reference array in the persistent data storage, namely the first data area. In the first data area of ​​the application, the first part of the data of each application data object created by the application can be stored. The application object of the first type of application only stores the first part of the data in the first data area, such as the basic type data application data object stores all the application data of the application in the first data area, including the data domain. For the application data object of the second type of application, in addition to storing the first part of the data in the first data area, it is also necessary to use the second data area to store the second part of the data. The first part of the data of the application data object may include at least one of the application data type, the persistent storage identifier, the application data number and the data domain. The second part of the data may include the data domain referenced by the first part of the data of the application data object. Therefore, there may be a reference relationship between the first data area and the second data area. For example, for persistent arrays, key objects, and algorithm objects, their data fields can be stored in other locations of the persistent memory that can be referenced by the reference array, namely, the second data area. That is, for application data objects of the first type of application, their data fields are stored in the first data area; for application data objects of the second type of application, their data fields are stored in the second data area of ​​the persistent data memory, and the second data area stores the second part of the data of the application data object, and the second part of the data may include the data field referenced by the first part of the data of the application data object. Among them, the data field stored in the application data object is used to store valid data of the corresponding application data. Exemplarily, the data stored in the data field can be the key data of the application signature and the value of the array, etc.

[0066] Figure 3 is a schematic diagram of the structure of an application data object provided by an embodiment of the present invention. In a specific example, Figure 3As shown, an application data object of a second type of application can store various types of first part data such as application data 1, application data 2, application data 3, application data 4 and application data 5 in the first data area. Among them, application data 2 can store the first part data of a persistent array in the first data area, and the first part data can be the type information of the array, for example, it can include but not limited to the identifier or pointer of the array, and whether the array is a persistent storage identifier and other information. At the same time, application data 2 stores the corresponding data domain in the second data area, for example, it can be the specific array content in the persistent array. The signature object (algorithm object) in application data 5 can store the identifier of the signature object in the first part data in the first data area, and the data domain stored in the second data area can store the key data related to the signature in the algorithm, etc.

[0067] S240: Save the first portion of data included in the application data object corresponding to the old version application as the application data of the old version application, or save the first portion of data and the second portion of data included in the application data object corresponding to the old version application as the application data of the old version application.

[0068] Correspondingly, if the application to be upgraded is a first type application, that is, the application data object corresponding to the application to be upgraded only includes the first data area, the first part of the data included in the application data object corresponding to the old version of the application can be obtained by searching the first data area of ​​the old version of the application, and the first part of the data included in the application data object corresponding to the old version of the application can be saved as the application data of the old version of the application. If the application to be upgraded is a second type application, that is, the application data object corresponding to the application to be upgraded includes both the first data area and the second data area, since there is a reference relationship between the first data area and the second data area, the first part of the data included in the application data object corresponding to the old version of the application can also be obtained by searching the first data area of ​​the old version of the application, and the reference relationship between the first data area and the second data area can be used to further search the second data area to obtain the second part of the data included in the application data object corresponding to the old version of the application, so that the first part of the data and the second part of the data included in the application data object corresponding to the old version of the application can be saved as the application data of the old version of the application.

[0069] Specifically, when deleting the old version application corresponding to the application to be upgraded, the operating system based on the WebAssembly virtual machine can find the old version application according to the application identifier of the old version application and the version of the old version application in the first upgrade instruction, and search the first data area of ​​the old version application according to the identifier of the old version application data object in the first upgrade instruction, find the application data object corresponding to the old version application, and save their first part of data and second part of data.

[0070] S250: Receive a second upgrade instruction initiated for the application to be upgraded.

[0071] S260: According to the second upgrade instruction, restore the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application.

[0072] The above technical solution stores application data of different types of applications by sampling application data objects, and divides the application data into a first part of data and a second part of data, thereby realizing classified storage of application data and improving the flexibility of application data storage deployment.

[0073] Figure 4 is a flowchart of another application upgrade method provided by an embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, a specific optional implementation method of restoring the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction is provided. Figure 4 As shown, the method of this embodiment may include:

[0074] S310: Receive a first upgrade instruction initiated for an application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded.

[0075] S320: Acquire an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application.

[0076] S330: Receive a second upgrade instruction initiated for the application to be upgraded.

[0077] In an embodiment of the present invention, when downloading a new version of an application, a second upgrade instruction may be transmitted to a running system based on a WebAssembly virtual machine, and the second upgrade instruction may include a mapping table.

[0078] In an optional embodiment of the present invention, the second upgrade instruction may include a mapping table, and the mapping table may include a mapping relationship between application data objects of the old version application and application data objects of the new version application.

[0079] Optionally, the content of the mapping table may be a mapping between identifiers of application data objects in the new version application and identifiers of application data objects in the old version application.

[0080] S340: Determine a new version application that matches the old version application according to the second upgrade instruction.

[0081] S350: Determine, according to the mapping table included in the second upgrade instruction, an application data object of the old version application corresponding to the application data object of the new version application.

[0082] S360: Obtain application data included in the application data object of the old version application corresponding to the application data object of the new version application.

[0083] S370: Restore the application data to the application data object of the new version application.

[0084] In an embodiment of the present invention, when installing a new version of an application, a running system based on a WebAssembly virtual machine can first determine the new version of the application that matches the old version of the application, and then search the mapping table included in the second upgrade instruction according to the identifier of the application data object of the old version of the application to determine the application data object of the old version of the application corresponding to the application data object of the new version of the application, and restore the application data included in the application data object of the old version of the application to the application data object of the new version of the application.

[0085] Figure 5 1 is a schematic diagram of the effect of restoring application data to an application data object of a new version application provided by an embodiment of the present invention. Figure 5 As shown, by querying the mapping relationship between the new version application data number and the old version application data number according to the mapping table, it can be known that there is a mapping relationship between application data 1 of the application data object of the new version application and application data 1 in the application data object of the old version, so application data 1 in the application data object of the old version can be copied to application data 1 in the application data object of the new version. There is a mapping relationship between application data 2 of the application data object of the new version application and application data 2 in the application data object of the old version, so application data 2 in the application data object of the old version can be copied to application data 2 in the application data object of the new version. There is a mapping relationship between application data 3 of the application data object of the new version application and application data 5 in the application data object of the old version, so application data 5 in the application data object of the old version can be copied to application data 3 in the application data object of the new version. Temporary array objects can be used to store temporary data of applications, so temporary array objects do not require persistent storage. Therefore, generally speaking, temporary array objects do not need to be maintained during the upgrade process. Therefore, the application data corresponding to the temporary array object can be restored in the default order. For example, as Figure 5 As shown, application data 3 in the old version of the application data object can be copied to application data 4 in the new version of the application data object, and application data 4 in the old version of the application data object can be copied to application data 5 in the new version of the application data object.

[0086] In an optional embodiment of the present invention, restoring the application data to the application data object of the new version application may include: applying for a first data area in a persistent data storage device for the application data object of the new version application; and copying valid data in the application data object of the old version application to the application data object mapped in the first data area of ​​the new version application.

[0087] Correspondingly, when the operating system of the WebAssembly virtual machine determines that the new version application matches the old version application, if the new version application only needs to store the first part of the data through the first data area, the first data area can be applied for the application data object of the new version application in the persistent data storage device, and the valid data in the application data object of the old version application can be copied to the application data object mapped in the first data area of ​​the new version application.

[0088] In an optional embodiment of the present invention, the valid data may include the type, persistent storage identifier, and data domain of the application data in the first part of data of the application data object of the old version application.

[0089] Optionally, for application data objects corresponding to certain types of applications, such as basic type application data objects, their valid data may include the type, persistent storage identifier, and data domain in the first part of data of the application data object.

[0090] For example, Figure 3 and Figure 5 As shown, the types in the first part of data may be data types corresponding to application data 1, application data 2, application data 3, application data 4, and application data 5. The data domain may be directly stored in a corresponding type of application data, such as application data 2.

[0091] Among them, the persistent storage identifier can be used to identify whether the application data type is persistent storage. Optionally, the persistent storage identifier can be an explicit identifier or an implicit identifier. The so-called explicit identifier can be understood as an identifier that directly configures visible data for application data. The so-called implicit identifier can be an identifier implicit in the application data. The embodiment of the present invention does not limit the type of persistent storage identifier.

[0092] In an optional embodiment of the present invention, after copying the valid data in the application data object of the old version application to the application data object mapped in the first data area of ​​the new version application, it may also include: establishing a reference relationship between the data field in the second part of the data in the application data object of the old version application and the application data object in the first data area of ​​the new version application.

[0093] Optionally, if the new version application needs to store the first part of data in the first data area and the second part of data in the second data area, then after applying for the first data area in the persistent data storage device for the application data object of the new version application, the second data area may not be allocated to it, and a reference relationship may be directly established between the data field in the second part of data in the application data object of the old version application and the application data object in the first data area of ​​the new version application. In this way, the new version application can have the first part of data and the second part of data of the old version application at the same time.

[0094] In an optional embodiment of the present invention, restoring the application data to the application data object of the new version application may include: applying for a first data area and a second data area in a persistent data storage device for the application data object of the new version application; copying valid data in the application data object of the old version application to the application data object mapped in the first data area of ​​the new version application; and copying data fields in the second part of the data in the application data object of the old version application to the second part of the data area of ​​the application data object of the new version application.

[0095] Optionally, if the new version application needs to store the first part of the data in the first data area and the second part of the data in the second data area, the first data area and the second data area can be applied for the application data object of the new version application in the persistent data storage at the same time. Furthermore, the valid data in the application data object of the old version application is copied to the application data object mapped in the first data area of ​​the new version application, and the data field in the second part of the data in the application data object of the old version application is copied to the second part of the data area of ​​the application data object of the new version application. In this way, the new version application can have the first part of the data and the second part of the data of the old version application at the same time.

[0096] In an optional embodiment of the present invention, the valid data may include the type and persistent storage identifier in the first part of data of the application data object of the old version application.

[0097] Optionally, for application data objects corresponding to certain types of applications, such as application data objects of persistent arrays, key objects, and algorithm objects, their valid data may include the type and persistent storage identifier in the first part of data of the application data object of the old version application.

[0098] The above technical solution, by introducing a mapping table in the second upgrade instruction, can copy each application data of the application data object corresponding to the old version application to the structure of the application data object corresponding to the new version application through the mapping table, thereby realizing flexible upgrading of the application while retaining the application data.

[0099] Figure 6 is a flow chart of another application upgrade method provided by an embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, a specific optional implementation method for generating a first upgrade instruction and a second upgrade instruction is provided. Figure 6 As shown, the method of this embodiment may include:

[0100] S410: Acquire an application version sequence, and generate application data retention indication information of the application to be upgraded in the first upgrade instruction and the mapping table in the second upgrade instruction for each version application according to the application version sequence.

[0101] The application version sequence may be used to store information related to each application version and application upgrade, for example, including but not limited to the types and application identifiers of all persistent application data objects in each version of the application.

[0102] In order to support the upgrade of multi-version applications, the application version sequence can be maintained based on the operating system of the WebAssembly virtual machine. The application version sequence can include information related to the application upgrade for each version of the application, such as the type and number of all persistent application data objects in the version application.

[0103] Correspondingly, before generating the first upgrade instruction and the second upgrade instruction, you can first obtain the application version sequence to obtain the version information of all deployed applications, and based on the application version sequence, generate the application data retention indication information of the application to be upgraded in the first upgrade instruction and the mapping table in the second upgrade instruction for each version application.

[0104] S420: Acquire an application version sequence, and determine version information of the application to be upgraded according to the application version sequence.

[0105] S430: Obtain application data retention indication information corresponding to the application to be upgraded according to the version information of the application to be upgraded, and generate the first upgrade instruction according to the application data retention indication information corresponding to the application to be upgraded.

[0106] Correspondingly, when generating the first upgrade instruction that matches the application to be upgraded, the application version sequence can be obtained to query the application version sequence to determine the version information of the application to be upgraded, and based on the version information of the application to be upgraded, the application data retention indication information corresponding to the application to be upgraded is obtained, that is, the application identifier, version information and application data object identifier of the current version application corresponding to the application to be upgraded, and then the first upgrade instruction is generated according to the application data retention indication information corresponding to the application to be upgraded.

[0107] S440: Receive a first upgrade instruction initiated for an application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded.

[0108] S450: Acquire an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application.

[0109] S460: Obtain a mapping table corresponding to the application to be upgraded according to the version information of the application to be upgraded, and generate the second upgrade instruction according to the mapping table corresponding to the application to be upgraded.

[0110] Correspondingly, when generating a second upgrade instruction that matches the application to be upgraded, the application version sequence can be obtained to query the application version sequence to determine the version information of the application to be upgraded, and based on the version information of the application to be upgraded, a mapping table corresponding to the application to be upgraded is obtained, that is, the mapping relationship between the application data object of the old version application and the application data object of the new version application is determined, thereby generating a second upgrade instruction according to the mapping table corresponding to the application to be upgraded.

[0111] S470: Receive a second upgrade instruction initiated for the application to be upgraded, and restore the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction.

[0112] It should be noted that when developing a new version of an application, application developers should distinguish between the processes of first application creation and application upgrade, so that they can both deploy new applications on chips or devices and upgrade applications on chips or devices that have already deployed applications.

[0113] The above technical solution can support the upgrade requirements of multi-version applications by maintaining the application version sequence, thereby allowing application developers to flexibly upgrade their applications deployed in chips or devices.

[0114] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0115] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.

[0116] Figure 7 is a schematic diagram of an application upgrade device provided by an embodiment of the present invention, such as Figure 7As shown, the device includes: a first upgrade instruction receiving module 510, an application data saving module 520, a second upgrade instruction receiving module 530 and an application data recovery module 540, wherein:

[0117] A first upgrade instruction receiving module 510 is used to receive a first upgrade instruction initiated by the application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded;

[0118] The application data saving module 520 is used to obtain the old version application and the application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application;

[0119] A second upgrade instruction receiving module 530, configured to receive a second upgrade instruction initiated to the application to be upgraded;

[0120] The application data recovery module 540 is used to recover the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction.

[0121] The embodiment of the present invention receives a first upgrade instruction initiated by a WebAssembly virtual machine's operating system for an application to be upgraded, which includes application data retention indication information of the application to be upgraded, so as to obtain an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application, and further receives a second upgrade instruction initiated by the application to be upgraded, so as to restore the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction. This can solve the problem of poor flexibility when performing application upgrades in the existing WebAssembly virtual machine's operating system, and can improve the flexibility of application upgrades in the WebAssembly virtual machine's operating system.

[0122] Optionally, the application data retention indication information includes: an application identifier of the old version application, a version of the old version application, and an identifier of a data object of the old version application.

[0123] Optionally, the application data saving module 520 is also used to: determine the old version application corresponding to the application to be upgraded based on the application identifier of the old version application and the version of the old version application; search the first data area of ​​the old version application based on the identifier of the application data object corresponding to the old version application to obtain the application data object corresponding to the old version application; save the first part of data included in the application data object corresponding to the old version application as the application data of the old version application, or save the first part of data and the second part of data included in the application data object corresponding to the old version application as the application data of the old version application.

[0124] Optionally, the second upgrade instruction includes a mapping table, and the mapping table includes a mapping relationship between application data objects of the old version application and application data objects of the new version application.

[0125] Optionally, the application data recovery module 540 is also used to: determine the new version application that matches the old version application according to the second upgrade instruction; determine the application data object of the old version application corresponding to the application data object of the new version application according to the mapping table included in the second upgrade instruction; obtain the application data included in the application data object of the old version application corresponding to the application data object of the new version application; and restore the application data to the application data object of the new version application.

[0126] Optionally, the application data recovery module 540 is further used to: apply for a first data area in a persistent data storage device for the application data object of the new version application; and copy valid data in the application data object of the old version application to the application data object mapped in the first data area of ​​the new version application.

[0127] Optionally, the application data recovery module 540 is further used to establish a reference relationship between the data field in the second part of the data in the application data object of the old version application and the application data object in the first data area of ​​the new version application.

[0128] Optionally, the application data recovery module 540 is also used to: apply for a first data area and a second data area in a persistent data storage device for the application data object of the new version application; copy valid data in the application data object of the old version application to the application data object mapped in the first data area of ​​the new version application; copy the data field in the second part of the data in the application data object of the old version application to the second part of the data area of ​​the application data object of the new version application.

[0129] Optionally, the valid data includes the type, persistent storage identifier, and data domain of the application data in the first part of data of the application data object of the old version application.

[0130] Optionally, the valid data includes the type and persistent storage identifier in the first part of data of the application data object of the old version application.

[0131] Optionally, the application upgrade device may further include a data storage module, which is used to: when it is determined that the application is a first type of application, apply for a first data area for the application in a persistent data storage device, and store the first part of data of each application data object created by the application through the first data area; when it is determined that the application is a second type of application, apply for a first data area and a second data area for the application in a persistent data storage device, store the first part of data of each application data object created by the application through the first data area, and store the second part of data of some application data objects through the second data area; wherein the first part of data includes: at least one of: application data type, persistent storage identifier, application data number and data field; wherein the second part of data includes: data field referenced by the first part of data of the application data object.

[0132] Optionally, the application upgrade device may further include an indication information mapping table generation module, which is used to: obtain an application version sequence; and generate the application data retention indication information of the application to be upgraded in the first upgrade instruction and the mapping table in the second upgrade instruction for each version application according to the application version sequence.

[0133] Optionally, the application upgrade device may further include an upgrade instruction generation module, which is used to: obtain an application version sequence, and determine the version information of the application to be upgraded based on the application version sequence; obtain the application data retention indication information corresponding to the application to be upgraded based on the version information of the application to be upgraded; generate the first upgrade instruction based on the application data retention indication information corresponding to the application to be upgraded; obtain the mapping table corresponding to the application to be upgraded based on the version information of the application to be upgraded; and generate the second upgrade instruction based on the mapping table corresponding to the application to be upgraded.

[0134] The above application upgrade device can execute the application upgrade method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the application upgrade method provided by any embodiment of the present invention.

[0135] Since the application upgrade device introduced above is a device that can execute the application upgrade method in the embodiment of the present invention, based on the application upgrade method introduced in the embodiment of the present invention, the technical personnel in the field can understand the specific implementation of the application upgrade device of the present embodiment and its various variations, so how the application upgrade device implements the application upgrade method in the embodiment of the present invention is not described in detail here. As long as the technical personnel in the field implement the device used by the application upgrade method in the embodiment of the present invention, it belongs to the scope of protection of this application.

[0136] Figure 8 A schematic diagram of the structure of a restricted device 10 that can be used to implement an embodiment of the present invention is shown.

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

[0138] The I / O interface 15 in the restricted device 10 may include: eSPI (Enhanced Serial Peripheral Interface) and SPI (Serial Peripheral Interface), etc.

[0139] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, for example, executing an application upgrade method as described in various embodiments of the present invention, which is executed by a runtime environment in an embedded operating system, and the embedded operating system is installed in a restricted device, and the method includes:

[0140] Receive a first upgrade instruction initiated for an application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded;

[0141] Acquire an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application;

[0142] receiving a second upgrade instruction initiated for the application to be upgraded;

[0143] The application data in the application data object of the old version application is restored to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction.

[0144] In some embodiments, an application upgrade method as described in various embodiments of the present invention may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 16. In some embodiments, part or all of the computer program may be loaded and / or installed on the restricted device 10 via the ROM 12. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of an application upgrade method as described in various embodiments of the present invention described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform an application upgrade method as described in various embodiments of the present invention in any other appropriate manner (e.g., by means of firmware).

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

[0146] Computer programs for implementing 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, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

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

[0148] Fig. 9 is a structural diagram of a terminal provided according to an embodiment of the present invention. Fig. 9 As shown, the terminal includes a restricted device 1010 as described in any embodiment of the present invention.

[0149] The restricted device 1010 may be an embedded security element, a smart card, a SE (Secure Element), a security chip, an embedded device, etc.

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

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

Claims

1. An application upgrade method, characterized in that: The operating system for the WebAssembly virtual machine includes: Receive a first upgrade instruction initiated for an application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded; Acquire an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application; wherein the application data object includes a first data area, or the application data object includes a first data area and a second data area; receiving a second upgrade instruction initiated for the application to be upgraded; The application data in the application data object of the old version application is restored to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction.

2. The method according to claim 1, characterized in that The acquiring, according to the application data retention indication information included in the first upgrade instruction, the old version application and the application data object of the old version application corresponding to the application to be upgraded, and saving the application data in the application data object of the old version application, comprises: Determine the old version application corresponding to the application to be upgraded according to the application identifier of the old version application and the version of the old version application; According to the identifier of the application data object corresponding to the old version application, searching the first data area of ​​the old version application to obtain the application data object corresponding to the old version application; The first portion of data included in the application data object corresponding to the old version application is saved as the application data of the old version application, or the first portion of data and the second portion of data included in the application data object corresponding to the old version application are saved as the application data of the old version application.

3. The method according to claim 1, characterized in that in, The second upgrade instruction includes a mapping table, wherein the mapping table includes a mapping relationship between application data objects of the old version application and application data objects of the new version application; The step of restoring the old version application data to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction includes: Determining a new version application matching the old version application according to the second upgrade instruction; Determine, according to the mapping table included in the second upgrade instruction, the application data object of the old version application corresponding to the application data object of the new version application; Acquire application data included in the application data object of the old version application corresponding to the application data object of the new version application; The application data is restored to the application data object of the new version application.

4. The method according to claim 3, characterized in that The restoring the application data to the application data object of the new version application includes: Applying for a first data area in a persistent data storage device for the application data object of the new version application; The valid data in the application data object of the old version application is copied to the application data object mapped in the first data area of ​​the new version application.

5. The method according to claim 3, characterized in that: The restoring the application data to the application data object of the new version application includes: Applying for a first data area and a second data area in a persistent data storage device for the application data object of the new version application; Copying valid data in the application data object of the old version application to the application data object mapped in the first data area of ​​the new version application; The data fields in the second part of the data in the application data object of the old version application are copied to the second part of the data area of ​​the application data object of the new version application.

6. An application upgrade device, characterized in that: The operating system configured on the WebAssembly virtual machine includes: A first upgrade instruction receiving module, configured to receive a first upgrade instruction initiated by the application to be upgraded; wherein the first upgrade instruction includes application data retention indication information of the application to be upgraded; an application data saving module, configured to obtain an old version application and an application data object of the old version application corresponding to the application to be upgraded according to the application data retention indication information included in the first upgrade instruction, and save the application data in the application data object of the old version application; wherein the application data object includes a first data area, or the application data object includes a first data area and a second data area; A second upgrade instruction receiving module, used to receive a second upgrade instruction initiated to the application to be upgraded; The application data recovery module is used to recover the application data in the application data object of the old version application to the application data object of the new version application corresponding to the old version application according to the second upgrade instruction.

7. A restricted device, characterized in that: The restricted device has an embedded operating system installed thereon, a runtime environment is executed in the embedded operating system, and the restricted device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application upgrading method according to any one of claims 1 to 5.

8. A terminal, characterized in that: Comprising a restricted device as claimed in claim 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application upgrade method of any one of claims 1-5 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the application upgrade method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Hierarchical storage write-in method and device and hierarchical storage read-out method, device and system

    CN111309245A

  • Method and system for upgrading application program of intelligent card

    CN113282320A

  • WebAssembly virtual machine distributed system fine-grained migration method and system

    CN113791870A

  • Control unit updating method and device, equipment and storage medium

    CN116009904A

  • PLC program online updating method and device and electronic equipment

    CN118092958A

Cited By

  • Application upgrading method and device, equipment, terminal, storage medium and program

    CN121501303A

  • Service update method and service update apparatus

    WO2026158216A1