Application installation method, device, embedded device and storage medium
By saving the stable state APP installation package in embedded devices and automatically recovering after the version is upgraded, the problem of the APP version in embedded devices cannot run normally after the upgrade is improved, the timeliness and simplicity of reinstallation is improved, and trust is used. The processing ensures the security of the installation package.
Patent Information
- Application Number
- CN202010614364.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-06-30
AI Technical Summary
The application (APP) version in an embedded device may not run normally after upgrading, resulting in poor reinstallation timeliness and cumbersome process.
Save the first installation package in a stable state in an embedded device and judge its operating status after the APP version is upgraded. If it cannot run normally, use the installation package to reinstall the APP to ensure that the APP returns to a stable state and sufficient storage resources are available The APP is automatically installed and the storage area is read-only to prevent tampering.
It improves the timeliness and simplicity of APP reinstallation, ensures that the APP can run normally after the version upgrade, reduces user installation time, simplifies the reinstallation process, and ensures the security of the installation package through trust processing.
Smart Images

Figure CN111796879B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an application installation method, device, embedded device and storage medium. Background Art
[0002] In recent years, with the continuous development of embedded devices, more and more applications APPs are installed in embedded devices. Most of these APPs are manually installed by users after the embedded devices leave the factory. Among them, embedded devices refer to devices or micro devices with specific control or auxiliary functions, such as security monitoring equipment. In addition, embedded devices are also called embedded systems. APP refers to application software developed by non-embedded device manufacturers that can be used for embedded devices.
[0003] After installing an APP in an embedded device, there is generally a situation where the APP version is upgraded. After the user upgrades the APP version, the APP may not be used normally. For example, when the embedded device is a security monitoring device, the embedded device is installed at an intersection or a checkpoint. The embedded device collects image information through the APP. When the APP cannot be used normally due to the version upgrade, the user can only wait until the image information needs to be checked before the APP is found to be abnormal, and then the user reinstalls the APP, resulting in poor timeliness of reinstalling the APP after the APP is abnormal. And because the APP version upgrade cannot be used normally, the data in the latest installation package saved in the embedded device is abnormal, so using the latest installation package to install the APP again will also cause the installed APP to be unable to be used normally. The only way is to retrieve the embedded device, re-store the available APP installation package to the embedded device, and then install the APP, which further makes the timeliness of reinstalling the APP poor and the process is more cumbersome. Summary of the invention
[0004] The embodiments of the present invention provide an application installation method, apparatus, embedded device and storage medium, which are used to solve the problem in the prior art that when the APP version in the embedded device cannot run normally after upgrading, the timeliness of reinstalling the APP is poor and the reinstallation process is cumbersome.
[0005] An embodiment of the present invention provides a method for installing an application program, the method comprising:
[0006] After the application APP version is upgraded, determine whether the current version of the APP cannot run normally;
[0007] If yes, the APP is installed using the first installation package of the APP in a stable state stored locally on the embedded device.
[0008] Further, determining that the current version of the APP cannot operate normally includes:
[0009] Determine that the current version of the APP cannot be started normally; or determine that the function of the current version of the APP cannot be used normally.
[0010] Furthermore, after the application APP version is upgraded, before determining whether the current version of the APP cannot run normally, the method further includes:
[0011] After the embedded device is started for the first time, the embedded device determines whether the remaining first storage resources of the embedded device are greater than the pre-saved second storage resources required for the installation of the APP;
[0012] If yes, determine whether the APP is installed; if not, use the first installation package to install the APP.
[0013] Furthermore, the storage area storing the first installation package is a read-only mode storage area.
[0014] Furthermore, the application APP version upgrade includes:
[0015] When a version upgrade instruction for the APP is received, the first data and the upgraded second data in the first installation package are obtained, a second installation package is generated according to the first data and the second data, and the APP is installed using the second installation package.
[0016] Furthermore, after installing the APP using the first installation package of the APP in a stable state stored locally on the embedded device, the method further comprises:
[0017] When an APP stable state update instruction is received, the version information carried in the APP stable state update instruction is obtained, the third installation package corresponding to the version information is updated to the first installation package of the stable state of the APP, and the storage area for saving the third installation package is a read-only mode storage area.
[0018] Furthermore, after installing the APP using the first installation package of the APP in a stable state stored locally on the embedded device, the method further comprises:
[0019] When receiving an instruction to delete the first installation package triggered by the user or the APP, deleting the first installation package, wherein the instruction is triggered after the APP is installed; or
[0020] When it is determined that the remaining third storage resource is less than a preset resource threshold, the first installation package is deleted.
[0021] Furthermore, the installation package is an installation package obtained through trust processing; wherein, the trust processing process includes inserting a signature into the data of the APP, encrypting the data path of the APP, and compressing the data of the APP into at least one of an installation package of a set format.
[0022] On the other hand, an embodiment of the present invention provides an application installation device, the device comprising:
[0023] A judgment module, used to judge whether the current version of the application APP cannot run normally after the application APP version is upgraded, and if so, trigger the first installation module;
[0024] The first installation module is used to install the APP using a first installation package of the APP in a stable state stored locally on the embedded device.
[0025] Furthermore, the judgment module is specifically used to determine that the current version of the APP cannot be started normally; or determine that the function of the current version of the APP cannot be used normally, thereby triggering the first installation module.
[0026] Furthermore, the device also includes:
[0027] The second installation module is used to determine whether the remaining first storage resources of the embedded device are greater than the pre-saved second storage resources required for the installation of the APP after the embedded device is started for the first time; if so, determine whether the APP is installed; if not, use the first installation package to install the APP.
[0028] Furthermore, the storage area storing the first installation package is a read-only mode storage area.
[0029] Furthermore, the device also includes:
[0030] The upgrade module is used to obtain the first data and the upgraded second data in the first installation package when receiving an instruction to upgrade the version of the APP, generate a second installation package based on the first data and the second data, and use the second installation package to install the APP.
[0031] Furthermore, the device also includes:
[0032] The update module is used to obtain the version information carried in the APP stable state update instruction when receiving the APP stable state update instruction, update the third installation package corresponding to the version information to the first installation package of the stable state of the APP, and save the storage area of the third installation package as a read-only mode storage area.
[0033] Furthermore, the device also includes:
[0034] A deletion module is used to delete the first installation package when an instruction to delete the first installation package is received from the user or the APP, wherein the instruction is triggered after the installation of the APP is completed; or, when it is determined that the remaining third storage resources are less than a preset resource threshold, delete the first installation package.
[0035] Furthermore, the installation package is an installation package obtained through trust processing; wherein, the trust processing process includes inserting a signature into the data of the APP, encrypting the data path of the APP, and compressing the data of the APP into at least one of an installation package of a set format.
[0036] On the other hand, an embodiment of the present invention provides an embedded device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0037] Memory, used to store computer programs;
[0038] The processor is used to implement any of the method steps described above when executing the program stored in the memory.
[0039] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the method steps described above is implemented.
[0040] The embodiment of the present invention provides an application installation method, apparatus, embedded device and storage medium, the method comprising: after the application APP version is upgraded, determining whether the current version of the APP cannot run normally; if so, using the first installation package of the APP in a stable state stored locally on the embedded device to install the APP. Since in the embodiment of the present invention, the embedded device locally stores the first installation package of the APP in a stable state, when the embedded device determines that the APP cannot run normally after the version upgrade, the first installation package is used to install the APP, thereby restoring the APP to a stable state, and realizing that when the APP cannot run normally after the version upgrade, the embedded device autonomously restores the APP to a stable state, ensuring that the APP can run normally, improving the timeliness of reinstalling the APP, and the reinstallation process is also simple and quick. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 paying creative work.
[0042] Figure 1 A schematic diagram of an application installation process provided by an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a first installation image generation process provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of a fourth installation image generation process provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a process for releasing data storage resources provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of the process of updating the initial state of an APP provided in an embodiment of the present invention;
[0047] Figure 6 A schematic diagram of a process for restoring an APP to its initial state provided by an embodiment of the present invention;
[0048] Figure 7 A schematic diagram of the structure of an application installation device provided by an embodiment of the present invention;
[0049] Figure 8 A schematic diagram of the structure of an embedded device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than 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 are within the scope of protection of the present invention.
[0051] Embodiment 1:
[0052] Figure 1 A schematic diagram of an application installation process provided in an embodiment of the present invention, the process includes:
[0053] S101: After the application APP version is upgraded, determine whether the current version of the APP cannot run normally. If yes, proceed to S102; if not, the process ends.
[0054] S102: Install the APP using a first installation package of the APP in a stable state stored locally on the embedded device.
[0055] The application installation method provided in the embodiment of the present invention is applied to an embedded device, which refers to a device or micro device with specific control or auxiliary functions, such as a security monitoring device.
[0056] An application APP (hereinafter referred to as APP) is installed in the embedded device. During the use of APP, the user can actively upgrade the APP, and the background server can also upgrade the APP. Therefore, the version of APP is upgraded. After the version of APP is upgraded, it is possible that the APP cannot run normally.
[0057] In an embodiment of the present invention, after each version upgrade of the APP, the embedded device determines whether the current version of the APP cannot operate normally. Wherein, determining that the current version of the APP cannot operate normally includes: determining that the current version of the APP cannot be started normally; or determining that the function of the current version of the APP cannot be used normally.
[0058] Specifically, after the APP version is upgraded, when the embedded device starts the APP, if the APP can start normally, the embedded device can identify the process information of the normal start of the APP. If the APP cannot start normally, the embedded device cannot identify the process information of the normal start of the APP. Therefore, after the embedded device sends the instruction to start the APP, it can determine whether the process information of the normal start of the APP is recognized. If so, it is determined that the current version of the APP starts normally. If not, it is determined that the current version of the APP cannot start normally. After the APP starts normally, the embedded device also needs to determine whether the functions of the APP can be used normally. Specifically, each APP has corresponding functions, such as the function of the APP is to collect images or perform corresponding processing on images. The embedded device sends an instruction to execute the function to the APP. If the embedded device obtains the normal processing result of the APP, it is determined that the function of the current version of the APP is used normally, otherwise it is determined that the function of the current version of the APP cannot be used normally.
[0059] When the embedded device determines that the current version of the APP cannot run normally, the subsequent step of reinstalling the APP is performed. When it is determined that the current version of the APP can run normally, the step of reinstalling the APP is not performed at this time.
[0060] It should be noted that in the embodiment of the present invention, the embedded device can automatically determine whether the current version of the APP cannot run normally, and if it can, the APP can be restored to a stable state. However, the priority of the embedded device automatically controlling the APP to restore to a stable state is lower than the user's instructions. For example, if the embedded device determines that the current version of the APP can run normally, that is, the embedded device does not perform the steps of restoring the stable state, but if the user's instructions to restore the stable state are received at this time, the embedded device still restores the APP to a stable state according to the user's instructions.
[0061] The embedded device locally stores the first installation package of the APP, which is the installation package corresponding to the stable state of the APP. When the APP needs to be restored to a stable state, the first installation package is used to install the APP. Generally, installing the APP using the first installation package can overwrite the previous version of the APP. Alternatively, before using the first installation package to install the APP, the embedded device can first perform the step of uninstalling the currently installed APP, and then perform the step of installing the APP using the first installation package after the uninstallation is complete, thereby ensuring that the latest installed APP is a stable APP.
[0062] Since in the embodiment of the present invention, the embedded device locally stores the first installation package of the stable state of the APP, when the embedded device determines that the APP cannot run normally after the version upgrade, the first installation package is used to install the APP, thereby restoring the APP to a stable state. This achieves that when the APP cannot run normally after the version upgrade, the embedded device autonomously restores the APP to a stable state, thereby ensuring that the APP can run normally, improving the timeliness of reinstalling the APP, and the reinstallation process is also simple and quick.
[0063] Embodiment 2:
[0064] In order to reduce the time spent by users on installing APPs, facilitate users to use embedded devices and improve the experience of embedded devices, based on the above embodiments, in an embodiment of the present invention, after the application APP version is upgraded, before determining whether the current version of the APP cannot run normally, the method further includes:
[0065] After the embedded device is started for the first time, the embedded device determines whether the remaining first storage resources of the embedded device are greater than the pre-saved second storage resources required for the installation of the APP;
[0066] If yes, determine whether the APP is installed; if not, use the first installation package to install the APP.
[0067] Generally, an embedded device will be started for the first time before leaving the factory. After the embedded device is started for the first time, it will determine whether it meets the conditions for installing the APP. If it does, the APP will be installed. In this way, the embedded device will have the APP installed after leaving the factory, so the user does not need to install it by himself, which reduces the time spent by the user to install the APP, facilitates the user to use the embedded device and improves the experience of the embedded device.
[0068] Specifically, judging whether the conditions for installing the APP are met includes judging whether the remaining first storage resources of the device are greater than the second storage resources required for the installation of the APP saved in advance. Different APPs have different memory usage, that is, different APPs have different storage resources required for installation. The second storage resources required for the installation of each APP are stored in the embedded device. After the embedded device is started for the first time, the remaining first storage resources of the device are queried, and the second storage resources required for the current APP to be installed are obtained to judge whether the first storage resources are greater than the second storage resources. If so, in order to avoid repeated installation of the APP, all APPs installed by the embedded device are traversed to judge whether the current APP to be installed is installed. If not, the first installation package is used to install the APP. In this way, the APP installed after the embedded device is started for the first time is an APP in a stable state. If the embedded device judges that the remaining first storage resources of the device are not greater than the second storage resources required for the installation of the APP saved in advance, the APP is not installed. In addition, when the first startup determines that the remaining first storage resources of the device do not meet the second storage resources required for the installation of the APP, the embedded device can issue a prompt message. After receiving the prompt message, the user can check the embedded device to judge whether there is an abnormality in the storage resources of the embedded device, or judge whether there are too many APPs installed on the embedded device. Among them, an alarm or an indicator light may be installed in the embedded device, and the prompt information may be the alarm sound information generated by the alarm, or may be the light indication information of the indicator light.
[0069] Embodiment 3:
[0070] The installation packages of the APP are all stored in the storage area. In order to ensure that the first installation package of the APP in a stable state is not modified, the storage area where the embedded device stores the first installation package is a read-only mode storage area. It is ensured that no object or behavior can tamper with or delete the contents of the storage area. In this way, it can be ensured that every time there is a problem that the APP cannot run normally, the correct and stable first installation package in the read-only mode storage area can be used to install the APP, ensuring that the APP is restored to a stable state.
[0071] In an embodiment of the present invention, the application APP version upgrade includes:
[0072] When a version upgrade instruction for the APP is received, the first data and the upgraded second data in the first installation package are obtained, a second installation package is generated according to the first data and the second data, and the APP is installed using the second installation package.
[0073] Since the storage area where the embedded device stores the first installation package is a read-only mode storage area, the upgraded data cannot be directly written into the first installation package when upgrading the APP. Therefore, in an embodiment of the present invention, when the embedded device receives an instruction to upgrade the version of the APP, the embedded device obtains the first data in the first installation package, and the embedded device also obtains the upgraded second data. The upgraded second data can be data developed by the user and stored locally in the embedded device, or it can be data downloaded by the embedded device from the network side. After the embedded device obtains the first data and the second data, it generates a second installation package based on the first data and the second data, and uses the second installation package to install the APP. Thereby, the upgrade of the APP is realized.
[0074] Embodiment 4:
[0075] During the APP version upgrade process, it is possible that a certain version of the APP can run normally and stably, and the functions of this version of the APP are more in line with the needs of the user. At this time, the embedded device can update the first installation package corresponding to the stable APP according to the user's instructions, so that when the APP needs to be restored to a stable state later, it can better meet the user's usage requirements. Based on the above considerations, on the basis of the above embodiments, in an embodiment of the present invention, after installing the APP using the first installation package of the stable state of the APP locally saved by the embedded device, the method also includes:
[0076] When an APP stable state update instruction is received, the version information carried in the APP stable state update instruction is obtained, the third installation package corresponding to the version information is updated to the first installation package of the stable state of the APP, and the storage area for saving the third installation package is a read-only mode storage area.
[0077] In an embodiment of the present invention, if the embedded device receives an APP stable state update instruction, the version information carried in the update instruction is obtained, indicating that the function of the APP of the version information is more in line with the needs of the user. Therefore, after receiving the APP stable state update instruction, the embedded device obtains the version information carried in the APP stable state update instruction, and obtains the third installation package corresponding to the version information, and then updates the third installation package to the first installation package of the APP stable state, and saves the storage area of the third installation package as a read-only mode storage area. Thereby, when the APP stable state needs to be restored later, it can be directly restored to the APP state of the version information, which is more in line with the user's usage requirements.
[0078] Embodiment 5:
[0079] In order to ensure the running speed of the embedded device and not affect the installation of other APPs, based on the above embodiments, in an embodiment of the present invention, after installing the APP using the first installation package of the APP in a stable state stored locally on the embedded device, the method further includes:
[0080] When receiving an instruction to delete the first installation package triggered by the user or the APP, deleting the first installation package, wherein the instruction is triggered after the APP is installed; or
[0081] When it is determined that the remaining third storage resource is less than a preset resource threshold, the first installation package is deleted.
[0082] In an embodiment of the present invention, after the APP is completely completed, the user can send an instruction to delete the first installation package to the embedded device, and when the embedded device receives the instruction to delete the first installation package sent by the user, it deletes the first installation package. In addition, a deletion option can also be customized in the first installation package. After the installation of the APP using the first installation package is completed, the APP automatically triggers the deletion option, that is, the APP sends an instruction to delete the first installation package to the embedded device, and the embedded device deletes the first installation package.
[0083] In addition, the embedded device stores a preset resource threshold. When the remaining third storage resource is less than the preset resource threshold, it will not only affect the installation of other apps, but also affect the running speed of the embedded device to a certain extent. In order to avoid the above problems, when the embedded device determines that the remaining third storage resource is less than the preset resource threshold, it deletes the first installation package of the app, thereby releasing the storage resources of the embedded device.
[0084] It should be noted that, because the first installation package is stored in a storage area in read-only mode, when the first installation package is deleted, the storage area storing the first installation package is deleted instead of deleting the installation package in the storage area.
[0085] Embodiment 6:
[0086] In order to ensure the security of the APP installation process, on the basis of the above embodiments, in an embodiment of the present invention, the installation package is an installation package obtained through trust processing; wherein the trust processing process includes inserting a signature into the APP data, encrypting the APP data path, and compressing the APP data into at least one of an installation package in a set format.
[0087] In an embodiment of the present invention, in order to ensure the security of installing an APP, the method adopted is to perform trust processing on the data of the APP. The installation package obtained by trust processing the data of the APP is stored in the installation image. When the installation image is used to install the APP, the security of the installation of the APP can be guaranteed. Among them, the trust processing process includes inserting a signature into the data of the APP, encrypting the data path of the APP, and compressing the data of the APP into an installation package of a set format. It should be noted that the trust processing of the data of the APP can include one or two of the above three methods. Preferably, when the above three methods are used for trust processing at the same time, the security of the APP data can be guaranteed to the greatest extent.
[0088] Specifically, the process of inserting a signature into the APP data includes signing with a private key and verifying the signature with a public key corresponding to the private key, thereby ensuring that the APP data is not tampered with. Encrypting the APP data path includes encrypting the original path of the APP data to ensure that the original path of the APP data cannot be reversely inferred, further improving the security of the APP data. Compressing the APP data into an installation package of a set format, including modifying or adding certain fields of the general installation package to make an installation package in a private format, ensures that the original APP data cannot be decompressed by general means, and further improves the security of the APP data.
[0089] It should be noted that for the installation package of the APP, the installation package and the storage area are generally compressed into an installation image and saved in the embedded device. The embedded device installs the APP through the installation image and stores the installation package in the storage area. In an embodiment of the present invention, the installation image corresponding to the APP can be called the first installation image, and the installation image of other general software can be called the second installation image. In order to make the installation process of the APP and other general software more convenient, the embedded device can merge the first installation image and the second installation image of the general software to obtain a third installation image; use the third installation image to install the APP and the general software. It should be noted that the second installation image of the general software can be one or more, and the number of second installation images of the general software is not limited in the embodiment of the present invention.
[0090] The application installation process provided by the embodiment of the present invention is described in detail below with reference to the accompanying drawings.
[0091] The embedded device performs trust processing on the APP data to obtain an installation package in a special format. The trust processing process includes inserting a signature into the APP data, encrypting the APP data path, and compressing the APP data into an installation package in a set format. The security and integrity of the APP data can be guaranteed through trust processing.
[0092] Figure 2 A schematic diagram of a first installation image generation process provided by an embodiment of the present invention, such as Figure 2 As shown, the APP program and data are obtained through the APP installation tool (APP package tools), and the APP program and data are packaged into an APP installation package (APP package). The installation package and a separate storage area (separate storage) are packaged into an independent first installation image (APP_Firmware_Image). APP_Firmware_Image is designed as an independent storage area, which can be independently upgraded without affecting the entire system of the embedded device. The independent storage area is defined as a read-only storage area in a predetermined manner in the system, that is, it is guaranteed that any object and behavior cannot tamper with or delete the contents of the storage area.
[0093] Figure 3 A schematic diagram of a fourth installation image generation process provided by an embodiment of the present invention, such as Figure 3 As shown, the first installation image APP_Firmware_Image and the standard firmware installation image Std_Firmware_Image, that is, the second installation image, are merged to generate a pre-installed firmware production image PreInstall_Firmware_Image, that is, the third installation image. In the production step of the embedded device leaving the factory, PreInstall_Firmware_Image is used for production. That is, the third installation image is used to install APP and general software.
[0094] The first installation image APP_Firmware_Image is an image file that stores APP data. Its content is APP data and its partition information. It is a subset of PreInstall_Firmware_Image and can be used to upgrade APP independently. The standard firmware installation image Std_Firmware_Image is an image file that stores the device system and general software. Its content is the software data and partition information of the entire device system. It is another subset of PreInstall_Firmware_Image and can be used to upgrade the entire system. It does not contain APP data and partition information.
[0095] When an embedded device is first started during production, it will decide whether to automatically install the APP based on its capabilities and current environmental conditions. When the installation conditions are met, the APP will be automatically installed to ensure that the embedded device has the APP required by the user when it leaves the factory.
[0096] Deciding whether to execute automatic installation of the APP based on the capabilities and current environmental conditions includes: after the embedded device is started for the first time, the embedded device determines whether its remaining first storage resources are greater than the pre-saved second storage resources required for the installation of the APP; if so, determines whether the APP is installed, and if not, uses the first installation package to install the APP.
[0097] The process of installing the APP is to execute the standard installation process to ensure the consistency of the pre-installation process with the general installation process. The embedded device defines the stable state of the APP based on key factors such as the current read-only storage area status and the status of the installation package, the status after the software is installed, etc., that is, the APP in a stable state is an APP that can run reliably and stably. During use, users can update the stable state of the APP, that is, define a new version of the APP as a stable state APP, but it is based on the premise that the APP can run reliably and stably. The reliable and stable software state of the APP includes that the APP can be installed correctly, the APP can be started correctly after installation, and the functions of the APP can be carried out correctly after startup. When the installation is performed, if the above conditions are met, it is a stable and reliable state of the APP, then the installation package will be retained after installation to ensure that it can be reinstalled later.
[0098] Figure 4 A schematic diagram of the process of releasing data storage resources provided in an embodiment of the present invention, wherein the embedded device decides on a cleanup strategy based on its own capabilities and releases installation resources, i.e., releases data storage resources. The conditions for releasing installation resources include: 1. A deletion option is customized in the APP installation package, and the embedded device receives an instruction to delete the installation package. In this case, the installation package is deleted after the APP is installed. 2. The deletion strategy is determined by system resources. When the device data storage resources are tight (for example, an economical device), the installation package is deleted after installation to free up data storage resources. 3. During the APP installation process, when illegal data is detected in the installation package, the installation process is terminated and the installation package is deleted.
[0099] Figure 5 The schematic diagram of the process of updating the initial state of an APP provided in an embodiment of the present invention is that for an embedded device that has been shipped, if the user needs to update the pre-installed installation package of the software, that is, to update the initial state of the software, the independent installation image APP_Firmware_Image of the software is upgraded to update the installation package in the independent storage area. The APP is made into an independent installation image in an independent storage area, and the APP and the installation package are updated independently without updating the system. When the installation package in the independent read-only storage area is updated and the software installation state is normal, the initial state of the APP is also updated by the user. Figure 5 As shown, the software independent installation image is updated to the embedded device, the APP installation package is updated, and then the updated APP installation package is installed to update the initial state of the APP.
[0100] Figure 6 The schematic diagram of the process of restoring the initial state of an APP provided in an embodiment of the present invention is that when an embedded device is in use and the user wishes to restore the software state to the initial stable and reliable initial state, a factory restore operation can be performed. The embedded device deletes the current version of the software according to the current read-only storage area state and the installation package state, and reinstalls the APP using the first installation image. At this time, the software is reset to the initial state, that is, the stable and reliable software state. Figure 6 As shown, stop and uninstall the current version of the APP, reinstall the APP using the first installation image, and run the reinstalled APP.
[0101] The application installation solution provided by the embodiment of the present invention has the following advantages: before the embedded device leaves the factory, the APP is automatically installed when it is started for the first time, reducing the user's repeated installation cost. After the embedded device is started, the stable state of the updated or rolled back APP is automatically defined. After the embedded device is started, the user can actively restore the APP to a stable state. The read-only attribute of the APP independent storage image ensures the security of the software installation package.
[0102] Embodiment 7:
[0103] Figure 7 A schematic diagram of the structure of an application installation device provided in an embodiment of the present invention, wherein the device comprises:
[0104] A judging module 71 is used to judge whether the current version of the application APP cannot run normally after the application APP version is upgraded, and if so, trigger the first installation module 72;
[0105] The first installation module 72 is used to install the APP using a first installation package of the APP in a stable state stored locally in the embedded device.
[0106] The judgment module 71 is specifically used to determine that the current version of the APP cannot be started normally; or determine that the function of the current version of the APP cannot be used normally, thereby triggering the first installation module.
[0107] The device also includes:
[0108] The second installation module 73 is used for, after the embedded device is started for the first time, for the embedded device to determine whether its remaining first storage resources are greater than the pre-saved second storage resources required for the installation of the APP; if so, to determine whether the APP is installed; if not, to use the first installation package to install the APP.
[0109] The storage area storing the first installation package is a read-only mode storage area.
[0110] The device also includes:
[0111] The upgrade module 74 is used to obtain the first data and the upgraded second data in the first installation package when receiving an instruction to upgrade the version of the APP, generate a second installation package according to the first data and the second data, and use the second installation package to install the APP.
[0112] The device also includes:
[0113] The update module 75 is used to obtain the version information carried in the APP stable state update instruction when receiving the APP stable state update instruction, update the third installation package corresponding to the version information to the first installation package of the stable state of the APP, and save the storage area of the third installation package as a read-only mode storage area.
[0114] The device also includes:
[0115] The deletion module 76 is used to delete the first installation package when receiving an instruction to delete the first installation package triggered by the user or the APP, wherein the instruction is triggered after the installation of the APP is completed; or, when it is determined that the remaining third storage resources are less than a preset resource threshold, delete the first installation package.
[0116] The installation package is an installation package obtained through trust processing; wherein, the trust processing process includes inserting a signature into the data of the APP, encrypting the data path of the APP, and compressing the data of the APP into at least one of an installation package of a set format.
[0117] Embodiment 8:
[0118] Based on the above embodiments, an embedded device is also provided in an embodiment of the present invention, such as Figure 8 As shown, it includes: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;
[0119] The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 performs the following steps:
[0120] After the application APP version is upgraded, determine whether the current version of the APP cannot run normally;
[0121] If yes, the APP is installed using the first installation package of the APP in a stable state stored locally on the embedded device.
[0122] Based on the same inventive concept, an embedded device is also provided in an embodiment of the present invention. Since the principle of solving the problem by the above-mentioned embedded device is similar to the application installation method, the implementation of the above-mentioned embedded device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0123] The embedded device provided in the embodiment of the present invention may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), a network side device, etc.
[0124] The communication bus mentioned in the above embedded device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0125] The communication interface 302 is used for communication between the above embedded device and other devices.
[0126] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0127] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0128] In the embodiment of the present invention, when the processor executes the program stored in the memory, it is implemented to determine whether the current version of the APP cannot run normally after the application APP version is upgraded; if so, the APP is installed using the first installation package of the stable state of the APP stored locally on the embedded device. Since in the embodiment of the present invention, the embedded device locally stores the first installation package of the stable state of the APP, when the embedded device determines that the APP cannot run normally after the version upgrade, the first installation package is used to install the APP, so that the APP is restored to a stable state, and when the APP cannot run normally after the version upgrade, the embedded device autonomously restores the APP to a stable state, ensuring that the APP can run normally, improving the timeliness of reinstalling the APP, and the reinstallation process is also simple and quick.
[0129] Embodiment 9:
[0130] On the basis of the above embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, wherein the computer readable storage medium stores a computer program executable by an embedded device, and when the program is run on the embedded device, the embedded device implements the following steps when executing:
[0131] After the application APP version is upgraded, determine whether the current version of the APP cannot run normally;
[0132] If yes, the APP is installed using the first installation package of the APP in a stable state stored locally on the embedded device.
[0133] Based on the same inventive concept, a computer-readable storage medium is also provided in an embodiment of the present invention. Since the principle of solving the problem when the processor executes the computer program stored on the above-mentioned computer-readable storage medium is similar to the application installation method, the implementation of the processor when executing the computer program stored on the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0134] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the embedded device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drives (SSDs), etc.
[0135] The computer-readable storage medium provided in the embodiment of the present invention stores a computer program, and when the computer program is executed by the processor, it is implemented to determine whether the current version of the application APP cannot run normally after the application APP version is upgraded; if so, the APP is installed using the first installation package of the stable state of the APP stored locally on the embedded device. Since in the embodiment of the present invention, the embedded device locally stores the first installation package of the stable state of the APP, when the embedded device determines that the APP cannot run normally after the version upgrade, the first installation package is used to install the APP, so that the APP is restored to a stable state, and when the APP cannot run normally after the version upgrade, the embedded device autonomously restores the APP to a stable state, ensuring that the APP can run normally, improving the timeliness of reinstalling the APP, and the reinstallation process is also simple and quick.
[0136] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0139] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0140] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for installing an application, characterized in that: The method comprises: After the application APP version is upgraded, determine whether the current version of the APP cannot run normally; If yes, install the APP using the first installation package of the APP in a stable state stored locally on the embedded device; Among them, for the installation package of the APP, the installation package and the storage area are compressed into an installation image and saved in the embedded device, and the embedded device installs the APP through the installation image; the installation image corresponding to the APP is called the first installation image, and the installation image of other general software is called the second installation image. The first installation image and the second installation image of the general software are merged to obtain a third installation image; in the production step of the embedded device, the third installation image is used to install the APP and the general software; Among them, the priority of the embedded device automatically controlling the APP to restore to a stable state is lower than the user's instruction; if the embedded device determines that the current version of the APP is running normally, the embedded device does not perform the step of restoring the stable state. If the embedded device receives the user's instruction to restore the stable state at this time, the embedded device restores the APP to a stable state according to the user's instruction; The application APP version upgrade includes: When receiving a version upgrade instruction for the APP, obtaining the first data and the upgraded second data in the first installation package, generating a second installation package according to the first data and the second data, and installing the APP using the second installation package; After installing the APP using the first installation package of the APP in a stable state stored locally on the embedded device, the method further comprises: When an APP stable state update instruction is received, the version information carried in the APP stable state update instruction is obtained, the third installation package corresponding to the version information is updated to the first installation package of the stable state of the APP, and the storage area for saving the third installation package is a read-only mode storage area.
2. The method according to claim 1, characterized in that Determining that the current version of the APP cannot operate normally includes: Determine that the current version of the APP cannot be started normally; or determine that the function of the current version of the APP cannot be used normally.
3. The method according to claim 1, characterized in that After the application APP version is upgraded, before determining whether the current version of the APP cannot run normally, the method further includes: After the embedded device is started for the first time, the embedded device determines whether the remaining first storage resources of the embedded device are greater than the pre-saved second storage resources required for the installation of the APP; If yes, determine whether the APP is installed; if not, use the first installation package to install the APP.
4. The method according to claim 1, characterized in that The storage area storing the first installation package is a read-only mode storage area.
5. The method according to claim 1, characterized in that After installing the APP using the first installation package of the APP in a stable state stored locally on the embedded device, the method further comprises: When receiving an instruction to delete the first installation package triggered by the user or the APP, deleting the first installation package, wherein the instruction is triggered after the APP is installed; or When it is determined that the remaining third storage resource is less than a preset resource threshold, the first installation package is deleted.
6. The method according to any one of claims 1 to 5, characterized in that: The installation package is an installation package obtained through trust processing; wherein, the trust processing process includes inserting a signature into the data of the APP, encrypting the data path of the APP, and compressing the data of the APP into at least one of an installation package of a set format.
7. An application installation device, characterized in that: The device comprises: A judgment module, used to judge whether the current version of the application APP cannot run normally after the application APP version is upgraded, and if so, trigger the first installation module; A first installation module, configured to install the APP using a first installation package of the APP in a stable state stored locally on the embedded device; Among them, for the installation package of the APP, the installation package and the storage area are compressed into an installation image and saved in the embedded device, and the embedded device installs the APP through the installation image; the installation image corresponding to the APP is called the first installation image, and the installation image of other general software is called the second installation image. The first installation image and the second installation image of the general software are merged to obtain a third installation image; in the production step of the embedded device, the third installation image is used to install the APP and the general software; Among them, the priority of the embedded device automatically controlling the APP to restore to a stable state is lower than the user's instruction; if the embedded device determines that the current version of the APP is running normally, the embedded device does not perform the step of restoring the stable state. If the embedded device receives the user's instruction to restore the stable state at this time, the embedded device restores the APP to a stable state according to the user's instruction; The device also includes: an upgrade module, configured to, when receiving an instruction to upgrade the version of the APP, obtain the first data and the upgraded second data in the first installation package, generate a second installation package according to the first data and the second data, and use the second installation package to install the APP; The device also includes: The update module is used to obtain the version information carried in the APP stable state update instruction when receiving the APP stable state update instruction, update the third installation package corresponding to the version information to the first installation package of the stable state of the APP, and save the storage area of the third installation package as a read-only mode storage area.
8. An embedded device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.
