Application program running method and device and storage medium

By setting up multiple storage partitions in an embedded system, using package version differences for invisible upgrades, and switching to the initial package when failure, it solves the problem of inability to start after application upgrade failure, improves user experience and extends The service life of the flash memory module.

CN119322628AActive Publication Date: 2025-01-17GUANGZHOU KINDLINK SOFTWARE TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411859026.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-01-17
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

In embedded systems, after the application upgrade fails, it cannot start normally, resulting in poor user experience and unable to obtain the application before the upgrade.

Method used

By setting up multiple storage partitions in the electronic device, perform a senseless upgrade using the version differences between the first and second packages, and switching to the initial package when the upgrade fails to ensure the normal startup of the application.

Benefits of technology

It realizes that the application can still be started normally when the application upgrade fails, which improves the user experience and extends the service life of the flash module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322628A_ABST
    Figure CN119322628A_ABST
Patent Text Reader

Abstract

The invention provides an application program running method and device and a storage medium, and relates to the technical field of storage, and the scheme comprises the steps of obtaining a second program package of a target application program under the condition that the target application program is run based on a first program package and the residual storage space of an electronic device is greater than a threshold value; wherein the first program package is stored in the first storage partition, and the version of the second program package is higher than that of the first program package; storing the second program package in a second storage partition; under the condition that the target application program is restarted, starting and running the target application program based on the second program package; and under the condition that starting based on the second program package fails, starting and running the target application program based on the first program package. According to the scheme, the application program can be normally started under the condition of upgrading failure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and more specifically, to a method, device and storage medium for running an application in the field of storage technology. Background Art

[0002] Application upgrades in embedded systems refer to version updates of applications that have been deployed on embedded devices to fix existing problems, add new features, or improve performance.

[0003] When upgrading an application, there may be a situation where the application upgrade fails, and accordingly, the application startup of the failed upgrade application will be abnormal. Since the application that failed to upgrade cannot be started normally and the application before the upgrade cannot be obtained, the application deployed on the embedded device cannot be started normally, resulting in a poor user experience.

[0004] Therefore, how to start the application normally in case of upgrade failure is a problem that needs to be solved at present. Summary of the invention

[0005] The present application provides a method, device and storage medium for running an application program, which method can start the application program normally when an upgrade fails.

[0006] In a first aspect, a method for running an application is provided, which is applied to an electronic device; the storage space of a target hard disk in the electronic device includes a first storage partition and a second storage partition, and the target hard disk is any hard disk in the electronic device; the method includes: when the target application is run based on a first program package and the remaining storage space of the electronic device is greater than a threshold, obtaining a second program package of the target application; wherein the first program package is stored in the first storage partition, and the version of the second program package is higher than the version of the first program package; storing the second program package in the second storage partition; when there is a need to restart the target application, starting to run the target application based on the second program package; and when starting to run the target application based on the first program package fails.

[0007] In an embodiment of the present application, when the target application is run based on the first program package and the remaining storage space of the electronic device is greater than a threshold, a second program package of the target application is obtained; and the second program package is stored in the second storage partition; since the version of the second program package is higher than the version of the first program package, the target application can be upgraded in the second storage partition; in the case of restarting the target application, the target application is started and run based on the second program package; in the case of failure to start based on the second program package, the target application is started and run based on the first program package, so that in the case of failure to upgrade the target application, the target application can still be started normally based on the first program package; based on this, the embodiment of the present application can start the application normally in the case of upgrade failure.

[0008] In combination with the first aspect, in certain implementations of the first aspect, the method provided in the embodiments of the present application also includes: when the target application is running based on the second program package and the remaining storage space of the electronic device is greater than a threshold, obtaining a third program package; the version of the third program package is higher than the version of the second program package; storing the third program package in the first storage partition; when there is a restart target application, starting to run the target application based on the third program package; when starting based on the third program package fails, starting to run the target application based on the second program package; when starting based on the third program package is successful, starting to run the target application based on the third program package.

[0009] In an embodiment of the present application, through the first storage partition and the second storage partition, the target application can be seamlessly upgraded while running the target application; and in the event of an abnormality in the upgrade data, the target application can be ensured to be started normally, thereby improving the user experience.

[0010] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the flash memory module of the electronic device includes a third storage partition; the third storage partition stores the initial program package of the target application; the method provided in the embodiment of the present application also includes: in the case where both the first program package and the second program package fail to start, starting the target application based on the initial program package; sending a first prompt message; wherein the first prompt message is used to prompt that the first program package and the second program package are in an abnormal state.

[0011] In an embodiment of the present application, when both the first program package and the second program package fail to start, the target application can be started based on the initial program package to ensure that the target application can run normally and the user can be promptly prompted that the first program package and the second program package are in an abnormal state.

[0012] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, when no program package of the target application is stored in the first storage partition and the second storage partition, the method provided in the embodiment of the present application also includes: obtaining a first program package based on the initial program package; wherein the version of the first program package is higher than the version of the initial program package; storing the first program package in the first storage partition; and starting to run the target application based on the first program package.

[0013] In an embodiment of the present application, when the first storage partition and the second storage partition usually do not store the program package of the target application, the first program package can be obtained through the initial program package in the third storage partition, thereby achieving normal operation of the target application.

[0014] In combination with the first aspect and the above-mentioned implementation methods, in certain implementation methods of the first aspect, the method provided in the embodiments of the present application also includes: in the event that obtaining the first program package fails, obtaining an initial program package from a third storage partition; storing the initial program package in the first storage partition; and starting to run the target application based on the initial program package in the first storage partition.

[0015] In an embodiment of the present application, in the case of failure to obtain the first program package, the target application can be started based on the initial program package to achieve normal operation of the target application.

[0016] In combination with the first aspect and the above implementations, in some implementations of the first aspect, the first storage partition and the second storage partition have read and write permissions; and the third storage partition has read permission.

[0017] In the embodiment of the present application, since the first storage partition and the second storage partition have read and write permissions, and the third storage partition has read permissions, the service life of the flash memory module can be extended by reducing the write operation of the third storage partition.

[0018] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the flash memory module of the electronic device includes a path configuration partition; the path configuration partition includes a first path parameter and a second path parameter; the first path parameter is used to indicate the current running version; the second path parameter is used to indicate the upgraded version; before starting to run the target application based on the second program package, the method provided in the embodiment of the present application also includes: updating the parameter value of the second path parameter to the storage path of the second program package; wherein the priority of the second path parameter is higher than the priority of the first path parameter; starting to run the target application based on the second program package includes: obtaining the second path parameter; and starting the target application based on the parameter value of the second path parameter.

[0019] In an embodiment of the present application, by updating the parameter value of the second path parameter to the storage path of the second program package, after the target application is upgraded, it can be ensured that the upgraded target application can be started the next time the electronic device is started.

[0020] In combination with the first aspect and the above-mentioned implementation manner, in some implementation manners of the first aspect, the path configuration partition also includes a third path parameter; wherein the priority of the third path parameter is lower than the priority of the first path parameter and the second path parameter; in the case of restarting the target application, after starting to run the target application based on the second program package, the method provided in the embodiment of the present application also includes: updating the parameter value of the third path parameter to the storage path of the first program package; updating the parameter value of the first path parameter to the storage path of the second program package; in the case of failure to start based on the second program package, starting to run the target application based on the first program package, including: in the case of failure to start based on the second program package, based on the identifier of the third path parameter, obtaining the parameter value of the third path parameter; starting the target application based on the parameter value of the third path parameter.

[0021] In an embodiment of the present application, by updating the first path parameter to the storage path of the second program package, the storage path of the second program package can be avoided from being overwritten when the target application is upgraded next time; by updating the parameter value of the third path parameter to the storage path of the first program package, when the second program package fails to start, the target application can be quickly started based on the first program package according to the parameter value of the third path parameter to achieve normal operation of the target application.

[0022] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the method provided in the embodiments of the present application also includes: determining whether a target script exists in the electronic device; wherein the target script is used to trigger the electronic device to preferentially execute the function corresponding to the target script; if the target script exists, the target script is automatically executed; if the target script does not exist, the target application is started based on the first program package.

[0023] In the embodiments of the present application, by executing the target script, the electronic device can be debugged and tested to reduce the occurrence of abnormalities in the start-up of the target application due to abnormalities in the electronic device.

[0024] In a second aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the method of the electronic device in the above-mentioned first aspect or any possible implementation of the first aspect.

[0025] In a third aspect, a computer program product is provided, which includes: a computer program code, which, when executed on a computer, enables the computer to execute a method for running an application in the first aspect or any possible implementation of the first aspect.

[0026] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method for running the application in the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a structural schematic diagram of an electronic device provided in an embodiment of the present application; Figure 2 is a schematic flow chart of a method for running an application program provided in an embodiment of the present application; Figure 3 is a schematic flow chart of another method for running an application provided in an embodiment of the present application; Figure 4 is a schematic flow chart of a method for running a third application program provided in an embodiment of the present application; Figure 5 It is a structural schematic diagram of a device for starting an application program provided in an embodiment of the present application; Figure 6 It is a structural schematic diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0030] Application upgrades in embedded systems refer to updating the versions of applications that have been deployed on embedded devices to fix existing problems, add new features, or improve performance. However, when upgrading applications, there may be cases where the application upgrade fails; accordingly, there will be abnormal startup of the application that failed to upgrade. At this time, since the application that failed to upgrade cannot be started normally and the application before the upgrade cannot be obtained, the application deployed on the embedded device cannot be started normally, resulting in a poor user experience.

[0031] Therefore, how to start the application normally in case of upgrade failure is a problem that needs to be solved at present.

[0032] In view of this, the present application provides an application running method, device and storage medium, the method comprising: when a target application package is run based on a first program package and the remaining storage space of the electronic device is greater than a threshold, acquiring and storing a second program package in a second storage partition; when restarting the target application based on the second program package fails, starting and running the target application based on the first program package. The embodiment of the present application can start the application normally when the upgrade fails.

[0033] Combine the following Figures 1 to 6 The operating method, device and storage medium of the application provided in the embodiments of the present application are described in detail.

[0034] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0035] For example, Figure 1 The electronic device 100 includes a flash memory module 110 and at least one hard disk 120; wherein the flash memory module 110 includes a bootloader partition 111, a boot partition 112, a rootfs partition 113, a misc partition 114 and an oem partition 115. The storage space of the target hard disk in the at least one hard disk 120 includes a first storage partition 121, a second storage partition 122 and a data partition 113.

[0036] Among them, the bootloader partition 111 is used to load the operating system and can store the boot loader. The boot partition 112 can be used to store the startup kernel of the operating system, such as the Linux kernel. The rootfs partition 113 can be used to store the root file system, including the system files, library files, applications, etc. of the operating system. The misc partition 114 can be used to store various miscellaneous data, such as system configuration, log files, storage paths, etc.; for example, the misc partition 114 can store the storage path of the program package of the target application in the first storage partition 121, the second storage partition 122 or the oem partition. The oem partition 115 can be used to store the initial version of the target application; the oem partition 115 can detect the target application through the initial version of the target application in the oem partition 115 when the target application in the first storage partition 121 or the second storage partition 122 is abnormal, so as to determine the abnormal location in the target application, thereby reducing maintenance costs.

[0037] Each of the at least one hard disk 120 can be used to store data of one or more applications. For example, the data of the target application can be stored in the first storage partition 121 and / or the second storage partition 122 included in the storage space of the target hard disk; the first storage partition 121 and the second storage partition 122 can store the same version of the target application program package, or can store different versions of the target application program package. The data partition 133 can be used to store user data, such as documents, videos, etc.

[0038] Exemplarily, the bootloader partition 111, boot partition 112, rootfs partition 113, misc partition 114 and oem partition 115 in the flash memory module 110 can be set to read-only permissions; in this way, the data in any partition in the flash memory module 110 can be read, but the data in each partition in the flash memory module 110 cannot be modified.

[0039] Exemplarily, any hard disk 120 (eg, the target hard disk) of the at least one hard disk 120 may be set to have read and write permissions; thus, not only can data in any hard disk 120 be read, but data in any hard disk 120 can also be modified.

[0040] It is understandable that, considering that the frequency of system upgrades in electronic devices may be low, while the frequency of application updates is frequent; since the flash memory module 110 will be worn when erasing and writing data, reducing the write operation can extend the service life of the flash memory module 110. Therefore, the system data (such as the Linux kernel, the root file system, etc.) stored in the flash memory module 110 can be set to read-only permissions; then. The application is stored in the hard disk 120, and the hard disk 120 is set to have read-write permissions, so that the high write durability and large capacity characteristics of the hard disk 120 can be used to update the target program; at the same time, the pressure on the flash memory module 110 is also reduced. In addition, due to the operation of modifying the flash memory module 110, there may be a possibility that the data in the flash memory module 110 is damaged or lost if it is sudden; therefore, storing the application in the hard disk 120 can reduce the write operation of the flash memory module 110, thereby reducing the risk of data or loss.

[0041] Figure 2 It is a schematic flowchart of a method for running an application provided in an embodiment of the present application.

[0042] It should be understood that the embodiments of the present application do not specifically limit the execution subject of the application program's running method, as long as the program that records the code of the application program's running method of the embodiments of the present application can be run to communicate according to the application program's running method of the embodiments of the present application. For example, the execution subject of the application program's running method provided by the embodiments of the present application can be the electronic device described in the above embodiments, or it can be a functional module in the electronic device that can call and execute the program, such as a chip, and the present application does not limit this.

[0043] Exemplarily, the electronic device may be a terminal device such as a computer, a mobile phone, or a smart interactive tablet, and the embodiments of the present application do not impose specific limitations on this.

[0044] like Figure 2 As shown, the application program running method 200 includes S210 to S240, and S210 to S240 are described in detail below.

[0045] The operation method 200 is applied to an electronic device. For example, the electronic device may be a terminal device such as a computer, a mobile phone, or a smart interactive tablet, and the present application embodiment does not impose any specific limitation on this.

[0046] The storage space of the target hard disk in the electronic device includes a first storage partition and a second storage partition. The target hard disk is any hard disk in the electronic device.

[0047] Exemplarily, the electronic device may include at least one hard disk; the storage space of each hard disk may include one or more storage partitions, and each storage partition may be used to store data of one or more applications. The same application (the same version of the application or different versions of the application) may be stored in different storage partitions. The first storage partition and the second storage partition are any two storage partitions of the one or more storage partitions used to store the program package of the target application.

[0048] For example, at least one hard disk includes hard disk A and hard disk B; storage partitions of hard disk A may include storage partition A1 and storage partition A2; storage partitions of hard disk B may include storage partitions B1, storage partition B2, and storage partition B3. Storage partition A1 stores package 1.1 of application 1 and package 2.1 of application 2; storage partition A2 stores package 1.2 of application 1 and package 2.2 of application 2; storage partition B1 stores package 1.1 of application 1 and package 3.1 of application 3; storage partition B2 stores package 1.1 of application 1 and package 3.2 of application 3; storage partition B3 stores package 1.1 of application 1 and package 3.3 of application 3.

[0049] Exemplarily, the target hard disk may be any one of the at least one hard disk. The storage partition of the target hard disk may include at least two storage partitions. It should be explained that the first storage partition and the second storage partition mentioned in the embodiment of the present application are used to store the program package of the target application to achieve the upgrade, backup and detection of the target application; the details can be referred to the following embodiment, which will not be repeated here.

[0050] S210. When the target application is run based on the first program package and the remaining storage space of the electronic device is greater than a threshold, obtain a second program package of the target application.

[0051] The first program package is stored in the first storage partition. The version of the second program package is higher than the version of the first program package.

[0052] It should be understood that different versions of an application usually have a corresponding package; the package can be an Android Package Kit (APK) file. The package includes code, resources, and configurations specific to the corresponding version of the package. It is understood that the APK file is the installation package format of the application program of the Android operating system, which contains all necessary components of the application program such as code, resources, assets, libraries, etc. Users can install the application program on an Android device by downloading the APK file.

[0053] Exemplarily, the second program package may be obtained from a server, or by connecting an electronic device to a target device (eg, a flash drive or a computer); the embodiment of the present application does not impose any specific limitation on this.

[0054] Exemplarily, the target application may include multiple versions, and the data of each version may be a program package corresponding to the target application. In this way, different operating system versions, device types or user requirements may be met.

[0055] Exemplarily, the target application may include an initial package, a first package, a second package, a third package, etc. Among them, the initial package may be the first released version of the target application, that is, the initial version. The initial package usually contains the core functions of the application. The version of the first package is higher than the version of the initial package; the version of the second package is higher than the version of the first package; the version of the third package is higher than the version of the second package. For example, the initial package may correspond to version 1.0, the first package may correspond to version 2.0, the second package may correspond to version 3.0, and the third package may correspond to version 4.0.

[0056] Exemplarily, the threshold value may be a value preconfigured by the electronic device, or a value set manually, and the embodiments of the present application do not impose any specific limitation on this.

[0057] It should be understood that the remaining storage space of the electronic device mentioned above is greater than the threshold value, which may mean that the operating load of the current electronic device is low, and can support the execution of the action of obtaining the second program package without affecting the operation of the first program package in the first storage area; of course, it may also mean that the storage space of the current electronic device can support the storage of the second program package.

[0058] For example, when the target application is running based on the first program package, it can be determined that there is a version update of the target application, for example, there is a second program package, and the version of the second program package is higher than the version of the first program package, based on the prompt information of the version update received from the server. Then, when the current service is in an idle state, the second program package is obtained.

[0059] S220. Store the second program package in the second storage partition.

[0060] Illustratively, before writing the second program package to the second storage partition, the second storage partition may store program packages of other versions of the target application, or may not store program packages of any version of the target application, which is not specifically limited in the embodiments of the present application.

[0061] As an example, when a package of another version of the target application is stored in the second storage partition (for example, a fourth package whose version is lower than the second package), the fourth package in the second storage partition may be replaced with the second package. For example, the fourth package is in the first position of the second storage partition (for example, the storage address of the first position may be / mnt / partition2 / Package4); the fourth package in the first position is replaced with the second package, so that the storage address of the first position may be / mnt / partition2 / Package2.

[0062] As another example, when no package of any version of the target application is stored in the second storage partition, the second package can be stored in an available location in the second storage partition, such as the second location, and a corresponding storage address is created, such as: mnt / partition2 / Package2.

[0063] Exemplarily, after the second program package is acquired, the second program package may be decompressed, and then the decompressed second program package is written into the second storage partition, and a file check is performed on the second program package.

[0064] S230. In the case where the target application program needs to be restarted, the target application program is started based on the second program package.

[0065] It can be understood that when the first program package in the first storage partition is in a running state, if there is a version update of the target application, the second program package can be obtained and written to a second storage partition different from the first storage partition; then, when the target application is restarted, the second program package can be run through the second storage partition to achieve a seamless upgrade of the target application, reduce the impact of the upgrade process on users, and improve the user experience.

[0066] Exemplarily, there is a situation where the target application is restarted: when the electronic device is restarted, the target application is started; or, the target application can be started after the target application is run based on the first program package. The embodiment of the present application does not impose any specific restrictions on this.

[0067] S240. In the case that the startup based on the second program package fails, the target application is started and run based on the first program package.

[0068] Exemplarily, in the case where the second program package is damaged or missing, the target application may fail to be started based on the second program package. For example, some key data summarized in the second program package is deleted or damaged, or a necessary configuration file is lost; or when writing the second program package to the second storage partition, part of the data of the second program package cannot be written due to insufficient storage space in the second storage partition; or when obtaining the second program package, the data of the obtained second program package may be incomplete due to power outages, network fluctuations, etc.; or, due to the operation permission problem of the second program package in the target hard disk, the second program package cannot be started normally. Therefore, in the case where it is detected that the target application fails to be started based on the second program package, the first program package in the first storage partition can be started to ensure that the target application can be started normally, thereby improving the user experience.

[0069] In an embodiment of the present application, when the target application is run based on the first program package and the remaining storage space of the electronic device is greater than a threshold, a second program package of the target application is obtained; and the second program package is stored in the second storage partition; since the version of the second program package is higher than the version of the first program package, the target application can be upgraded in the second storage partition; in the case of restarting the target application, the target application is started and run based on the second program package; in the case of failure to start based on the second program package, the target application is started and run based on the first program package, so that in the case of failure to upgrade the target application, the target application can still be started normally based on the first program package; based on this, the embodiment of the present application can start the application normally in the case of upgrade failure.

[0070] In a possible embodiment of the present application, the method provided in the embodiment of the present application also includes: when the target application is run based on the second program package and the remaining storage space of the electronic device is greater than a threshold, obtaining a third program package; the version of the third program package is higher than the version of the second program package; storing the third program package in the first storage partition; when there is a restart target application, starting to run the target application based on the third program package; when the startup based on the third program package fails, starting to run the target application based on the second program package; when the startup based on the third program package is successful, starting to run the target application based on the third program package.

[0071] The version of the third program package is higher than the version of the second program package.

[0072] Exemplarily, when the target application is run based on the second program package, version update prompt information of the server can be obtained to determine whether there is a version update for the target application.

[0073] For example, the prompt information may carry the identifier of the third program package of the target application; when the electronic device receives the prompt information, it may determine that the target application has version update data based on the identifier of the third program package, and then obtain the third program package.

[0074] As another example, the prompt information may also only carry version update information; when the electronic device receives the prompt information, it can directly determine that the target application has version update data, and then obtain the third program package from the server.

[0075] Exemplarily, after the target application is run based on the second program package in the second storage partition to achieve a seamless upgrade, if the target application releases a new version, for example, there is a third program package of the target application, the third program package can be obtained and stored in the first storage partition; in the case of restarting the target application, the target application is started and run based on the third program package, thereby once again achieving a seamless upgrade of the target application; in addition, in the event that starting the target application based on the third program package fails, the target application can also be started and run based on the second program package in the second storage partition to ensure that the target application can be determined normally.

[0076] In an embodiment of the present application, through the first storage partition and the second storage partition, the target application can be seamlessly upgraded while running the target application; and in the event of an abnormality in the upgrade data, the target application can be ensured to be started normally, thereby improving the user experience.

[0077] In a possible embodiment of the present application, the flash memory module of the electronic device includes a third storage partition; the third storage partition stores an initial program package of the target application; the method provided in the embodiment of the present application also includes: in the event that both the first program package and the second program package fail to start, starting the target application based on the initial program package; and sending a first prompt message.

[0078] The first prompt information is used to prompt that the first program package and the second program package are in an abnormal state.

[0079] In actual application scenarios, the third storage partition can be as follows Figure 1 The OEM partition shown is used to store the initial program package of the target application. Since the OEM partition in the flash memory module can be set to read-only permission, the data in the OEM partition can be prevented from being modified, so as to avoid modifying the initial program package and reduce the impact of power failure and other conditions on the data in the OEM partition.

[0080] For example, the first prompt information may be sent to the user by email. Alternatively, the first prompt information may be sent by displaying it on a display screen of an electronic device to promptly remind the user that the first program package and the second program package are in an abnormal state. In addition, the first prompt information may remind the user of the abnormal location when the first program package and the second program package are in an abnormal state, thereby reducing maintenance costs.

[0081] In an embodiment of the present application, when both the first program package and the second program package fail to start, the target application can be started based on the initial program package to ensure that the target application can run normally and the user can be promptly prompted that the first program package and the second program package are in an abnormal state.

[0082] In a possible embodiment of the present application, when no program package of the target application is stored in the first storage partition and the second storage partition, the method provided in the embodiment of the present application also includes: obtaining a first program package based on the initial program package; storing the first program package in the first storage partition; and starting to run the target application based on the first program package.

[0083] The version of the first program package is higher than the version of the initial program package.

[0084] Exemplarily, when no program package of the target application is stored in the first storage partition and the second storage partition, a first program package can be obtained based on the initial program package and stored in the first storage partition to start running the target application based on the first program package in the first storage partition.

[0085] It should be understood that when the electronic device is started for the first time, the first storage partition and the second storage partition usually do not store the program package of the target application. At this time, if the target application needs to be upgraded, the first program package can be obtained through the initial program package. For example, based on the application identifier of the initial program package, a first program package with the same application identifier as the initial program package can be obtained from the server or the target device. The application identifier of the initial program package can be the name of the target application, the unique code of the application, or the license of the application.

[0086] In an embodiment of the present application, when the first storage partition and the second storage partition usually do not store the program package of the target application, the first program package can be obtained through the initial program package in the third storage partition, thereby achieving normal operation of the target application.

[0087] In an embodiment of the present application, the method provided in the embodiment of the present application also includes: in the event that obtaining the first program package fails, obtaining the initial program package from the third storage partition; storing the initial program package in the first storage partition; and starting to run the target application based on the initial program package in the first storage partition.

[0088] Exemplarily, when the electronic device is in a network-isolated state, or when no program package of the target application exists in the server, the initial program package may be directly obtained from the third storage partition and stored in the first storage partition.

[0089] In an embodiment of the present application, in the case of failure to obtain the first program package, the target application can be started based on the initial program package to achieve normal operation of the target application.

[0090] In a possible embodiment of the present application, the first storage partition and the second storage partition have read and write permissions; and the third storage partition has read permission.

[0091] In actual application scenarios, the first storage partition and the second storage partition are partitions divided by the storage space of the target hard disk. The third storage partition can be an OEM partition in the flash memory module. The third storage partition is set to read-only permission, so that the data in the third storage partition can be read, but the data in the third storage partition cannot be modified. The first storage partition and the second storage partition in the storage space of the target hard disk are set to read-write permission; in this way, not only can the data in the first storage partition and the second storage partition be read, but the data in the first storage partition and the second storage partition can also be modified.

[0092] It is understandable that, considering that the frequency of system upgrades in electronic devices may be low, while the frequency of application updates is high; and since the flash memory module will wear out when erasing and writing data, reducing write operations can extend the service life of the flash memory module. Therefore, the third storage partition used to store the initial program package can be set to read-only permissions, thereby reducing the pressure on the third storage partition. In addition, due to the modification operation on the third storage partition, there is a possibility that the data in the third storage partition may be damaged or lost if it is sudden; therefore, the program package of the target application that is frequently used for upgrading is stored in the target hard disk, so that the high write durability and large capacity characteristics of the target hard disk can be used to update the target program; it can also reduce the write operation of the flash memory module, thereby reducing the risk of data loss. In the embodiment of the present application, since the first storage partition and the second storage partition have read and write permissions, and the third storage partition has read permissions, the service life of the flash memory module can be extended by reducing the write operation of the third storage partition.

[0093] In a possible embodiment of the present application, the flash memory module of the electronic device includes a path configuration partition; the path configuration partition includes a first path parameter and a second path parameter; the first path parameter is used to indicate the current running version; the second path parameter is used to indicate the upgrade version; before the above S230, the method provided in the embodiment of the present application also includes: updating the parameter value of the second path parameter to the storage path of the second program package; the above S230 includes: obtaining the second path parameter; based on the parameter value of the second path parameter, starting the target application. Wherein, the priority of the second path parameter is higher than the priority of the first path parameter.

[0094] In actual application scenarios, the path configuration partition can be as follows Figure 1 The misc partition in the flash module shown.

[0095] Exemplarily, the electronic device can start the program package of the storage path corresponding to the path parameter based on the path parameter in the path configuration partition. Since the first path parameter is used to indicate the storage path of the first program package; therefore, when the parameter value of the second path parameter is empty, the first program package can be started based on the parameter value of the first path parameter; when the parameter value of the second path parameter is updated to the storage path of the second program package, since the priority of the second path parameter is higher than the priority of the first path parameter, the parameter value of the second path parameter is read first, and the second program package is started based on the parameter value of the second path parameter.

[0096] In an embodiment of the present application, by updating the parameter value of the second path parameter to the storage path of the second program package, after the target application is upgraded, it can be ensured that the upgraded target application can be started the next time the electronic device is started.

[0097] In a possible embodiment of the present application, the path configuration partition also includes a third path parameter; after the above S230, the method provided in the embodiment of the present application also includes: updating the parameter value of the third path parameter to the storage path of the first program package; updating the parameter value of the first path parameter to the storage path of the second program package; the above S240 includes: in the event of a failure to start the second program package, based on the identifier of the third path parameter, obtaining the parameter value of the third path parameter; based on the parameter value of the third path parameter, starting the target application.

[0098] The priority of the third path parameter is lower than the priorities of the first path parameter and the second path parameter.

[0099] Exemplarily, the parameter value of the first path parameter is updated to the storage path of the second program package, and the parameter value of the third path parameter is updated to the storage path of the first program package. In this way, when a version update is detected next time (for example, the existence of the third program package), after the third program package is written to the first storage partition, the parameter value of the second path parameter is updated to the storage path of the third program package, thereby avoiding the loss of the storage path of the second program package due to the overwriting of the parameter value of the second path parameter.

[0100] Exemplarily, since the parameter value of the third path parameter is updated to the storage path of the first program package, the first program package can be used as a backup. When the second program package in the second storage partition fails to start, the parameter value of the third path parameter can be quickly obtained according to the identifier of the third path parameter; and the first program package can be started according to the parameter value of the third path parameter.

[0101] As an example, the path configuration partition includes a first path parameter, a second path parameter, and a third path parameter. According to the first path parameter, the second path parameter, and the third path parameter, an action corresponding to the parameter value of the first path parameter, the parameter value of the second path parameter, and the parameter value of the third path parameter can be executed.

[0102] For example, as shown in Table 1, Table 1 is a schematic diagram of the execution of path parameters in a path configuration partition. Among them, the second path parameter is: MISC_NEXT, the first path parameter is MISC_CURR, and the third path parameter is MISC_BAK. Among them, the priority of MISC_NEXT is higher than MISC_CURR and MISC_BAK, and the priority of MISC_CURR is higher than MISC_BAK. In other words, the program package corresponding to the storage path indicated by the parameter value of MISC_NEXT is started first; when the parameter value of MISC_NEXT is NULL, the program package corresponding to the storage path indicated by the parameter value of MISC_CURR is started; when the parameter value of MISC_NEXT and the parameter value of MISC_CURR are both NULL, the program package corresponding to the storage path indicated by the parameter value of MISC_BAK is started. It should be noted that PATH_NEXT, PATH_CURR, and PATH_BAK are only used for illustration and do not represent the specific meaning of the relevant terms in the embodiments of the present application.

[0103] Table 1

[0104] For example: when the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is NULL, and the parameter value of MISC_BAK is NULL, it can be considered that the electronic device is started for the first time, and the target application is started based on the initial program package in the third storage partition. When the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is NULL, and the parameter value of MISC_BAK is PATH_BAK, the target application is started based on the initial program package in the third storage partition. When the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is PATH_CURR, and the parameter value of MISC_BAK is PATH_BAK, it can be considered that the parameter value of the path parameter is after the target application is upgraded (for example, the second program package is obtained) and the target application is started. When the parameter value of MISC_NEXT is PATH_NEXT, the parameter value of MISC_CURR is PATH_CURR, and the parameter value of MISC_BAK is PATH_BAK, it can be considered that the latest version of the package has been written to the storage partition and at least one upgrade of the target application has been performed before; then, the parameter value of MISC_NEXT is updated to the path of the latest version of the package, the target application can be started based on the package corresponding to PATH_NEXT, and the parameter value of MISC_CURR is updated to PATH_NEXT, the parameter value of MISC_BAK is updated to PATH_CURR, and the parameter value of MISC_NEXT is updated to NULL. When the parameter value of MISC_NEXT is PATH_NEXT, the parameter value of MISC_CURR is PATH_CURR, and the parameter value of MISC_BAK is NULL, it can be considered that the latest version of the package has been written to the storage partition, and the target application has not been upgraded before; then, the parameter value of MISC_NEXT is updated to the path of the latest version of the package, the target application can be started based on the package corresponding to PATH_NEXT, and the parameter value of MISC_CURR is updated to PATH_NEXT, the parameter value of MISC_BAK is updated to PATH_CURR, and the parameter value of MISC_NEXT is updated to NULL. When the parameter value of MISC_NEXT is PATH_NEXT, the parameter value of MISC_CURR is NULL, and the parameter value of MISC_BAK is PATH_BAK, the target application can be started based on the package corresponding to PATH_NEXT; the parameter value of MISC_CURR is updated to PATH_NEXT; the parameter value of MISC_NEXT is updated to NULL.When the parameter value of MISC_NEXT is PATH_NEXT, the parameter value of MISC_CURR is NULL, and the parameter value of MISC_BAK is NULL, it can be considered that this is the scenario where the target application is upgraded through the initial package in the third storage partition and the first package is written to the first storage partition; then, the target application is started based on the package corresponding to PATH_NEXT, and the parameter value of MISC_CURR is updated to PATH_NEXT, and the parameter value of MISC_NEXT is updated to NULL. When the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is PATH_CURR, and the parameter value of MISC_BAK is NULL, it can be considered that this is the first time to upgrade the target application and start the target application.

[0105] In order to more clearly explain how to start the target program according to the first path parameter, the second path parameter and the third path parameter in the embodiment of the present application. As shown in Table 2, Table 2 is a schematic table of the changes in the parameter values ​​of each path parameter after the target application is upgraded. Among them, PATH_A represents the storage path of the first program package in the first storage partition, and PATH_B represents the storage path of the second program package in the second storage partition.

[0106] Table 2

[0107] For example, when the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is NULL, and the parameter value of MISC_BAK is NULL, it is considered that when the electronic device is started for the first time, the target application is started, and the program package corresponding to the target application is not stored in the first storage partition and the second storage partition; at this time, the target application is started based on the initial program package in the third storage partition. When the parameter value of MISC_NEXT is PATH_A, the parameter value of MISC_CURR is NULL, and the parameter value of MISC_BAK is NULL, it is considered that the first program package has been obtained through the initial program package in the third storage partition, and the first program package has been written to the first storage partition; at this time, the target application can be started based on the first program package in the first storage partition. When the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is PATH_A, and the parameter value of MISC_BAK is NULL, it is considered that the first program package is obtained through the initial program package in the third storage partition, and the first program package is written to the first storage partition, and the target application is started based on the first program package; at this time, the target application can be started based on the first program package in the first storage partition; and if no version update is detected, each subsequent start of the target application will not change the path parameters. When the parameter value of MISC_NEXT is PATH_B, the parameter value of MISC_CURR is PATH_A, and the parameter value of MISC_BAK is NULL, it can be considered that when the first program package is in the running state, the second program package is obtained and the second program package is written to the second storage partition; at this time, the target application can be started based on the second program package in the second storage partition. When the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is PATH_B, and the parameter value of MISC_BAK is PATH_A, it can be considered that after the second package is written to the second storage partition and the target application is started based on the second package, the changes in the path parameters can be considered; at this time, the target application can be started based on the second package in the second storage partition; and if no version update is detected, each subsequent start of the target application will not change the path parameters. When the parameter value of MISC_NEXT is PATH_A, the parameter value of MISC_CURR is PATH_B, and the parameter value of MISC_BAK is PATH_A, it can be considered that when the second package is in the running state, the third package is obtained and the third package is written to the second storage partition to replace the first package; at this time, the target application can be started based on the third package in the first storage partition.When the parameter value of MISC_NEXT is NULL, the parameter value of MISC_CURR is PATH_A, and the parameter value of MISC_BAK is PATH_B, it can be considered that the changes in each path parameter after the third program package is written to the first storage partition and the target application is started based on the third program package; at this time, the target application can be started based on the third program package in the first storage partition; and, if no version update is detected, the path parameters will not change each time the target application is started thereafter.

[0108] It should be explained that when the electronic device is started for the first time, if the target application is not upgraded, even if the first storage partition and the second storage partition exist, no matter how many times the target application is restarted, the parameter values ​​of the path parameters MISC_NEXT, MISC_CURR, and MISC_BAK are NULL. In other words, the parameter value of MISC_NEXT is generally updated after the target application is upgraded. The parameter values ​​of MISC_CURR and MISC_BAK can be updated according to the upgrade and startup of the target application.

[0109] It should be explained that if the parameter value of MISC_NEXT is not NULL, the target application is started based on the package corresponding to the storage path indicated by the parameter value of MISC_NEXT; if the parameter value of MISC_NEXT is NULL and the parameter value of MISC_CURR is not NULL, the target application is started based on the package corresponding to the storage path indicated by the parameter value of MISC_CURR; if the parameter values ​​of MISC_NEXT and MISC_CURR are both NULL, the target application is started based on the initial package of the third storage partition.

[0110] It should be explained that MISC_BAK is mainly used to restore and start the target application based on the package corresponding to the previous version when the target application fails to start normally after being upgraded.

[0111] In an embodiment of the present application, by updating the first path parameter to the storage path of the second program package, the storage path of the second program package can be avoided from being overwritten when the target application is upgraded next time; by updating the parameter value of the third path parameter to the storage path of the first program package, when the target application fails to be started based on the second program package, the target application can be quickly started based on the first program package according to the parameter value of the third path parameter to achieve normal operation of the target application.

[0112] As a possible implementation method, the method provided in the embodiment of the present application also includes: determining whether a target script exists in the electronic device; if the target script exists, automatically executing the target script; if the target script does not exist, starting the target application based on the first program package.

[0113] Among them, the target script is used to trigger the electronic device to preferentially execute the function corresponding to the target script.

[0114] For example, if a target script exists, it can be considered that the functions corresponding to the target script are executed first, such as repair, detection and other functions.

[0115] Exemplarily, a method for determining whether a target script exists in an electronic device may be to determine whether there is a storage path corresponding to the target script, or an identifier of the target script. For example, the storage path corresponding to the target script may be / media / udisk0 / debug.sh; the identifier of the target script may be the file format of debug.sh. For example, if / media / udisk0 / debug.sh exists, it can be considered that the electronic device is connected to a target device (e.g., a USB flash drive), and the target device stores data of the target script. At this time, the target script can be automatically executed. If the target script does not exist, the target application can be started based on the first program package.

[0116] For example, a specific behavior corresponding to a target script can be triggered by inserting a USB drive with a target script into an electronic device. First, if a USB drive is detected to be inserted into the electronic device, the USB drive will be mounted to a specific directory, such as / media / udisk0. Then, the electronic device can detect whether the target script (for example, debug.sh) exists in the USB drive. If the target script exists, the target script is executed instead of the target application.

[0117] In the embodiments of the present application, by executing the target script, the electronic device can be debugged and tested to reduce the occurrence of abnormalities in the start-up of the target application due to abnormalities in the electronic device.

[0118] Figure 3 It is a schematic flowchart of another method for running an application provided in an embodiment of the present application.

[0119] For example, Figure 3 The application running method 300 shown can be executed by an electronic device, or can be executed by an application startup device in the electronic device, such as a chip.

[0120] like Figure 3 As shown, the application program running method 300 includes S301 to S313, and S301 to S313 are described in detail below.

[0121] S301. Receive a startup instruction for a target application.

[0122] As an example, the start instruction for the target application may be an operation performed by a user on the electronic device.

[0123] As another example, when the electronic device is started, a startup instruction for a target application is automatically received.

[0124] S302. Determine whether the target script exists. If yes, execute S303; if no, execute S304.

[0125] Exemplarily, the method of determining whether the target script exists may be to determine whether there is a storage path corresponding to the target script, or an identifier of the target script. For example, the storage path corresponding to the target script may be / media / udisk0 / debug.sh; the identifier of the target script may be the file format of debug.sh. For example, if / media / udisk0 / debug.sh exists, it can be considered that the electronic device is connected to the target device (e.g., a USB flash drive), and the target device stores data of the target script.

[0126] S303. Execute the target script.

[0127] S304. Get MISC_NEXT, MISC_CURR, and MISC_BAK from the misc partition.

[0128] Exemplarily, MISC_NEXT, MISC_CURR, and MISC_BAK are used to represent the path parameters of the storage path of the target application. In the absence of the target script, MISC_NEXT, MISC_CURR, and MISC_BAK can be obtained from the misc partition, and then the corresponding action is performed according to the parameter values ​​of MISC_NEXT, MISC_CURR, and MISC_BAK.

[0129] S305. Determine whether the parameter value of MISC_NEXT is NULL; if so, execute S306; if not, execute S308.

[0130] S306. Determine whether the parameter value of MISC_CURR is NULL; if so, execute S307; if not, execute S309.

[0131] S307. Based on the initial program package in the OEM partition, start the target application.

[0132] S308. Start the target application based on the program package corresponding to the storage path indicated by the parameter value of MISC_NEXT.

[0133] For example, if the parameter value of MISC_NEXT is PATH_A; PATH_A is the storage path of the first program package in the first storage partition; then based on the first program package, the target application is started.

[0134] For another example, if the parameter value of MISC_NEXT is PATH_B; PATH_B is the storage path of the second program package in the second storage partition; then based on the second program package, the target application is started.

[0135] S309. Start the target application based on the program package corresponding to the storage path indicated by the parameter value of MISC_CURR.

[0136] For example, if the parameter value of MISC_CURR is PATH_A; PATH_A is the storage path of the first program package in the first storage partition; then based on the first program package, the target application is started.

[0137] For another example, if the parameter value of MISC_CURR is PATH_B; PATH_B is the storage path of the second program package in the second storage partition; then based on the second program package, the target application is started.

[0138] S310. Determine whether the program package is started abnormally. If so, execute S311.

[0139] S311. Determine whether the parameter value of MISC_BAK is NULL; if so, execute S307; if not, execute S312.

[0140] S312. Start the target application based on the backup program package corresponding to the storage path indicated by the parameter value of MISC_BAK.

[0141] For example, if the parameter value of MISC_BAK is PATH_A; PATH_A is the storage path of the first program package in the first storage partition; then based on the first program package, the target application is started.

[0142] For another example, if the parameter value of MISC_BAK is PATH_B; PATH_B is the storage path of the second program package in the second storage partition; then based on the second program package, the target application is started.

[0143] S313. Determine whether the standby program package is started abnormally. If so, execute S307.

[0144] For detailed description of S301 to S313, please refer to Figure 1 to Figure 2The relevant description will not be repeated here.

[0145] In an embodiment of the present application, by obtaining MISC_NEXT, MISC_CURR, and MISC_BAK from the misc partition, it is possible to determine based on the parameter values ​​of MISC_NEXT, MISC_CURR, and MISC_BAK which storage partition's package is used to start the target application; and in the event of an abnormal package startup, the target application is started based on the backup package or the initial package through the path parameters MISC_NEXT, MISC_CURR, and MISC_BAK to achieve normal operation of the target application.

[0146] Figure 4 is a schematic flow chart of a method for running a third application program provided in an embodiment of the present application; For example, Figure 4 The application running method 400 shown can be executed by an electronic device, or can be executed by an application startup device in the electronic device, such as a chip.

[0147] like Figure 4 As shown, the application program running method 400 includes S401 to S411, and S401 to S411 are described in detail below.

[0148] S401. Start a target application based on a first program package in a first storage partition.

[0149] S402. Determine whether to actively upgrade; if so, execute S403; if not, execute S405.

[0150] S403. When the target device is connected to the electronic device, an upgrade page is displayed on the electronic device.

[0151] S404. In response to the user's operation on the upgrade page, obtain an upgrade package.

[0152] S405. Receive a prompt message for a version update of the target application from the server.

[0153] S406. Determine whether the current operation state of the electronic device is in an idle state; if so, execute S407.

[0154] S407. Obtain the upgrade package from the server.

[0155] S408. Decompress the upgrade package to obtain a second program package.

[0156] S409. Write the decompressed second program package into the second storage partition and perform file verification.

[0157] S410. Update the parameter value of MISC_NEXT to the storage path of the second program package in the second storage partition.

[0158] S411. When restarting the target application, start the target application based on the second program package in the second storage partition.

[0159] For detailed description of S401 to S411, please refer to Figures 1 to 3 The relevant description will not be repeated here.

[0160] In an embodiment of the present application, when the target application is started by the first program package based on the first storage partition and the remaining storage space of the electronic device is greater than a threshold, the second program package can be obtained and decompressed; then the decompressed second program package is written to the second storage partition; in this way, when the target application is run by the first program package based on the first storage partition, the upgrade package can be obtained, thereby reducing interference with the operation of the target application; then, by updating the parameter value of MISC_NEXT to the storage path of the second program package in the second storage partition, the target application can be started based on the second program package in the second storage partition the next time the electronic device is started, thereby achieving a seamless upgrade of the target application.

[0161] Combination of the above Figures 1 to 4 The operating method of the application provided in the embodiment of the present application is described in detail; Figure 5 and Figure 6 The device embodiments of the present application are described in detail. It should be understood that the device in the embodiments of the present application can execute the various methods of the aforementioned embodiments of the present application, that is, the specific working processes of the following various products can refer to the corresponding processes in the aforementioned method embodiments.

[0162] Figure 5 It is a structural diagram of a device for starting an application program provided in an embodiment of the present application.

[0163] Exemplarily, the electronic device may be a terminal device such as a computer, a mobile phone, or a smart interactive tablet, and the embodiments of the present application do not impose specific limitations on this.

[0164] For example, Figure 5 As shown, the application startup device 500 includes: The acquisition module 510 is used to acquire a second program package of the target application when the target application is run based on the first program package and the remaining storage space of the electronic device is greater than a threshold; wherein the first program package is stored in the first storage partition, and the version of the second program package is higher than the version of the first program package; The storage module 520 is used to store the second program package in the second storage partition; A starting module 530, configured to start running the target application based on the second program package when there is a restart of the target application; The startup module 530 is further configured to start and run the target application based on the first program package if the startup based on the second program package fails.

[0165] Optionally, as an embodiment, the acquisition module 510 is further used to acquire a third program package when the target application is running based on the second program package and the remaining storage space of the electronic device is greater than a threshold; the version of the third program package is higher than the version of the second program package; the storage module 520 is further used to store the third program package in the first storage partition; the startup module 530 is further used to start running the target application based on the third program package when there is a restart target application; start running the target application based on the second program package when the startup based on the third program package fails; and start running the target application based on the third program package when the startup based on the third program package succeeds.

[0166] Optionally, as an embodiment, the startup module 530 is also used to start running the target application based on the initial program package when both the first program package and the second program package fail to start; and send a first prompt message; wherein the first prompt message is used to prompt that the first program package and the second program package are in an abnormal state.

[0167] Optionally, as an embodiment, the acquisition module 510 is also used to acquire a first program package based on the initial program package; wherein the version of the first program package is higher than the version of the initial program package; the storage module 520 is also used to store the first program package in a first storage partition; the startup module 530 is also used to start running the target application based on the first program package.

[0168] Optionally, as an embodiment, the acquisition module 510 is also used to obtain the initial program package from the third storage partition when the acquisition of the first program package fails; the storage module 520 is also used to store the initial program package in the first storage partition; the startup module 530 is also used to start running the target application based on the initial program package in the first storage partition.

[0169] Optionally, as an embodiment, the application startup device 500 also includes: an update module, used to update the parameter value of the second path parameter to the storage path of the second program package; wherein the priority of the second path parameter is higher than the priority of the first path parameter; a startup module 530, specifically used to obtain the second path parameter; and based on the parameter value of the second path parameter, start the target application.

[0170] Optionally, as an embodiment, the update module updates the parameter value of the third path parameter to the storage path of the first program package; and is also used to update the parameter value of the first path parameter to the storage path of the second program package.

[0171] Optionally, as an embodiment, the startup module 530 is specifically used to obtain the parameter value of the third path parameter based on the identifier of the third path parameter when the startup based on the second program package fails; and start the target application based on the parameter value of the third path parameter.

[0172] Optionally, as an embodiment, the startup module 530 is also used to determine whether a target script exists in the electronic device; wherein the target script is used to trigger the electronic device to preferentially execute the function corresponding to the target script; if the target script exists, the target script is automatically executed; if the target script does not exist, the target application is started based on the first program package.

[0173] It should be noted that the application startup device 500 is implemented in the form of a functional unit. The term "module" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0174] For example, a "module" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0175] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0176] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0177] Exemplarily, the electronic device 600 may be a terminal device such as a computer, a mobile phone, or a smart interactive tablet, and the embodiments of the present application do not impose any specific restrictions on this.

[0178] Exemplarily, the electronic device 600 includes: a processor 610 , a memory 620 , and an executable program code 630 .

[0179] Exemplarily, the electronic device 600 includes one or more processors 610, which can support the electronic device 600 to implement the method for generating an electronic device in the method embodiment. The processor 610 can be a general-purpose processor or a special-purpose processor. For example, the processor 610 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0180] Exemplarily, the processor 610 may be used to control the electronic device 600, execute software programs, and process data of the software programs. The electronic device 600 may also include a communication unit to implement input (reception) and output (transmission) of signals.

[0181] Exemplarily, the electronic device 600 may include one or more memories 620 on which executable program code 630 is stored. The executable program code 630 can be executed by the processor 610 to generate instructions, so that the processor 610 executes the generation method described in the above method embodiment according to the instructions.

[0182] Optionally, data may be stored in the memory 620. Optionally, the processor 610 may read data stored in the memory 620, which may be stored at the same storage address as the executable program code 630, or may be stored at a different storage address from the executable program code 630.

[0183] Exemplarily, the processor 610 and the memory 620 may be provided separately or integrated together, for example, integrated on a system on chip (SOC) of the terminal device.

[0184] Exemplarily, the memory 620 can be used to store relevant programs of the generation method of the electronic device provided in the embodiment of the present application, and the processor 610 can be used to call the executable program code 630 stored in the memory 620 when controlling the electronic device 600, and execute the running method of the application program of the embodiment of the present application; for example, when the first program package of the target application in the first storage partition is in a running state, obtain the second program package of the target application from the server; wherein the version of the second program package is higher than the version of the first program package; write the second program package to the second storage partition; when the electronic device is powered on again, start the second program package; when the second program package fails to start, start the first program package.

[0185] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for running the application program of any of the aforementioned embodiments.

[0186] Among them, computer-readable storage media may include, but are not limited to, any type of disk, including floppy disks, optical disks, digital versatile disks (DVD), compact disc read-only memory (CD-ROM), microdrives and magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read only memory (EEPROM), dynamic random access memory (DRAM), video random access memory (VRAM), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.

[0187] The present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement a method for running an application program in the above-mentioned embodiment.

[0188] In addition, the electronic device provided in the embodiments of the present application may specifically be a chip, a component or a module, and the electronic device may include a connected processor and a memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor may call and execute instructions so that the chip executes a method for running an application in the above-mentioned embodiments.

[0189] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this application is used to execute the operating method of the corresponding application provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the operating method of the corresponding application provided above, and will not be repeated here.

[0190] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0191] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0192] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for running an application, characterized in that: Applied to an electronic device; the storage space of a target hard disk in the electronic device includes a first storage partition and a second storage partition, and the target hard disk is any hard disk in the electronic device; the method includes: When the target application is run based on the first program package and the remaining storage space of the electronic device is greater than a threshold, obtaining a second program package of the target application; wherein the first program package is stored in the first storage partition, and the version of the second program package is higher than the version of the first program package; storing the second program package in the second storage partition; In the case of restarting the target application, starting to run the target application based on the second program package; In the case that starting based on the second program package fails, starting and running the target application based on the first program package.

2. The method according to claim 1, characterized in that The operation method further comprises: When the target application is run based on the second program package and the remaining storage space of the electronic device is greater than a threshold, obtaining a third program package; the version of the third program package is higher than the version of the second program package; storing the third program package in the first storage partition; In the case of restarting the target application, starting to run the target application based on the third program package; In the case that starting based on the third program package fails, starting and running the target application based on the second program package; In the case where the startup based on the third program package is successful, the target application is started and executed based on the third program package.

3. The method according to claim 1, characterized in that The flash memory module of the electronic device comprises a third storage partition; the third storage partition stores an initial program package of the target application; The operation method further comprises: In the case that both the first program package and the second program package fail to be started, starting and running the target application based on the initial program package; Sending a first prompt message; wherein the first prompt message is used to prompt that the first program package and the second program package are in an abnormal state.

4. The method according to claim 3, characterized in that In the case that neither the first storage partition nor the second storage partition stores any program package of the target application, the operation method further includes: Based on the initial program package, acquiring the first program package; wherein the version of the first program package is higher than the version of the initial program package; storing the first program package in the first storage partition; The target application is started and executed based on the first program package.

5. The method according to claim 4, characterized in that The operation method further comprises: In case of failure in obtaining the first program package, obtaining the initial program package from the third storage partition; storing the initial program package in the first storage partition; The target application is started and executed based on the initial program package in the first storage partition.

6. The method according to claim 3, characterized in that The first storage partition and the second storage partition have read and write permissions; the third storage partition has read permission.

7. The method according to any one of claims 1 to 5, characterized in that The flash memory module of the electronic device includes a path configuration partition; the path configuration partition includes a first path parameter and a second path parameter; the first path parameter is used to indicate the current running version; The second path parameter is used to indicate the upgraded version; Before starting to run the target application based on the second program package, the running method further includes: updating the parameter value of the second path parameter to the storage path of the second program package; wherein the priority of the second path parameter is higher than the priority of the first path parameter; The starting and running of the target application based on the second program package includes: Obtain the second path parameter; Based on the parameter value of the second path parameter, the target application is started.

8. The method according to claim 7, characterized in that The path configuration partition further includes a third path parameter; wherein the priority of the third path parameter is lower than the priority of the first path parameter and the second path parameter; In the case where the target application is restarted, after starting to run the target application based on the second program package, the running method further includes: Updating the parameter value of the third path parameter to the storage path of the first program package; Updating the parameter value of the first path parameter to the storage path of the second program package; The step of starting and running the target application based on the first program package when the startup based on the second program package fails includes: In the case that the startup of the second program package fails, obtaining a parameter value of the third path parameter based on the identifier of the third path parameter; Based on the parameter value of the third path parameter, the target application is started.

9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor is used to call and run the executable program code from the memory, so that the electronic device executes the method for running the application as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for running the application program according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and device for starting application program, storage medium and electronic equipment

    CN112433775A

  • Online upgrading method based on separated storage under vxworks system

    CN113626060A

  • Program upgrading method and device, electronic equipment and storage medium

    CN114035828A

  • System upgrading method and device based on asymmetric partition and electronic equipment

    CN114265603A

  • Chip program upgrading method and device, electronic equipment and computer readable medium

    CN117492788A