Upgrading method and device, electronic equipment and storage medium
By decoupling and compressing the target modules in Android system applications, the initial file is generated and upgraded, solving the complex and time-consuming problem of traditional upgrade methods and achieving a faster and more flexible upgrade process.
Patent Information
- Application Number
- CN202510179532.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-06-13
AI Technical Summary
The upgrade method of traditional Android systems is complex and time-consuming. The upgrade of whole packages is wasteful traffic. Differential package upgrade requires the compilation of whole machine software and complex package making rules, resulting in a cumbersome upgrade process.
By decoupling the target module in the application, the initial file is generated and stored in the upgrade storage area, and the initial file is obtained in response to the upgrade instruction to upgrade.
Simplifies the upgrade process, reduces the time and resources required for upgrades, and provides greater flexibility and selectivity, and users can choose to upgrade specific components instead of the entire application.
Smart Images

Figure CN120144162A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technologies, and particularly to an upgrade method, apparatus, electronic device, and computer-readable storage medium. Background Art
[0002] The traditional upgrade method for the Android system is OTA (Over-the-Air) upgrade, which is specifically divided into two methods: full package upgrade and differential package upgrade. When using the full package for upgrade, the entire system will be overwritten and installed, which is applicable to upgrading from any version to the latest version. The volume of the upgrade package is very large, wasting the customer's traffic. When using differential package upgrade, the device needs to download and replace the changed parts.
[0003] However, both of the above two upgrade methods require whole machine software compilation and the use of packaging rules to generate upgradeable script files, and the production process is complex and the upgrade time is also very long. Summary of the Invention
[0004] Embodiments of the present disclosure provide an upgrade method, apparatus, electronic device, and computer-readable storage medium, aiming to at least solve one of the technical problems in the related art to some extent.
[0005] In a first aspect, embodiments of the present disclosure provide an upgrade method, which includes:
[0006] Decouple each target module in at least one application to obtain multiple files corresponding to the target module;
[0007] Generate an initial file corresponding to the target module according to the multiple files corresponding to the target module;
[0008] Store the initial file in the upgrade storage area;
[0009] In response to receiving an upgrade instruction, obtain a target initial file from the upgrade storage area, where the target initial file is used to upgrade the application to be upgraded.
[0010] In a second aspect, embodiments of the present disclosure further provide an upgrade apparatus, which includes:
[0011] A decoupling module, configured to decouple each target module in at least one application to obtain multiple files corresponding to the target module;
[0012] A generating module, configured to generate an initial file corresponding to the target module according to the multiple files corresponding to the target module;
[0013] A storage module, configured to store the initial file in the upgrade storage area;
[0014] An obtaining module, configured to obtain a target initial file from the upgrade storage area in response to receiving an upgrade instruction, where the target initial file is used to upgrade an application to be upgraded.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps in the above-mentioned upgrade method are implemented.
[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned upgrade method are implemented.
[0017] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various alternative implementations of the embodiments of the present disclosure.
[0018] In the embodiments of the present disclosure, first, each target module in at least one application is decoupled to obtain a plurality of files corresponding to the target module, then an initial file corresponding to the target module is generated according to the plurality of files corresponding to the target module, and then the initial file is stored in the upgrade storage area. After that, in response to receiving an upgrade instruction, the target initial file is obtained from the upgrade storage area, and the target initial file is used to upgrade the application to be upgraded. Thus, by splitting an application into multiple target modules and decoupling and compressing and combining each target module of each application, the upgrade process can be simplified, and the time and resources required for upgrading can be reduced. The modular design enables application components to be more easily replaced and upgraded without rewriting or large-scale modification of the entire application. Users can choose to upgrade specific components according to their needs instead of the entire application, which provides greater flexibility and selectivity.
[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the present disclosure, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0021] Figure 1 is a schematic flowchart of the upgrade method provided by the first embodiment of the present disclosure;
[0022] Figure 2 is a schematic diagram of mounting an APEX file to an upgrade partition;
[0023] Figure 3 is a schematic flowchart of the upgrade method provided by the second embodiment of the present disclosure;
[0024] Figure 4 is an exemplary flowchart of an upgrade method;
[0025] Figure 5 is a schematic structural diagram of the upgrade device provided by the embodiments of the present disclosure;
[0026] Figure 6 is a schematic structural diagram of the electronic device provided by the embodiments of the present disclosure. Detailed Description of the Embodiments
[0027] Here, some embodiments of the present disclosure will be described in detail, and their examples are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Various changes, modifications, and equivalents of the methods, devices, and / or systems described herein will become apparent after understanding the present disclosure. For example, the order of the operations described herein is merely an example and is not limited to those set forth herein, but may be changed as will be apparent after understanding the present disclosure, except for operations that must be performed in a specific order. Additionally, descriptions of features known in the art may be omitted for the sake of clarity and conciseness.
[0028] The embodiments described in some of the following embodiments of the present disclosure do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0029] It should be noted that the execution subject of the upgrade method in this embodiment may be an upgrade device, and this device may be configured in any type of electronic device, which is not limited herein.
[0030] In the embodiments of the present disclosure, the "upgrade device" will be used as the execution subject to execute the upgrade method for illustration, which is not limited herein. It should be noted that the description order of the following embodiments does not limit the priority order of the embodiments.
[0031] Figure 1 is a schematic flowchart of the upgrade method provided by the first embodiment of the present disclosure.
[0032] Such asFigure 1 As shown, the method includes:
[0033] Step 101: Decouple each target module in at least one application to obtain multiple files corresponding to the target module.
[0034] Among them, the application can be any type of application.
[0035] Among them, the target module can be the module corresponding to the function to be updated. For example, if application A needs to update the startup component and the Bluetooth component, and module 1 and module 2 in the application are respectively used to implement the functions of the startup component and the Bluetooth component, and thus module 1 and module 2 are the modules to be updated, then module 1 and module 2 can be used as the target modules.
[0036] For example, assume there is a target module named UserManagement, which is responsible for handling operations such as creating, reading, updating, and deleting user information. The upgrade device can decouple it into the following files:
[0037] User.js: Define the structure and behavior of the user object.
[0038] UserService.js: Contain business logic related to users, such as verifying user information, creating new users, etc.
[0039] UserRepository.js: Handle the interaction with the database or other storage systems for storing and retrieving user data.
[0040] UserController.js: Responsible for handling requests from the front end or other services and performing corresponding operations.
[0041] In this way, the functions of the UserManagement target module can be decoupled into multiple smaller and more manageable files, and each file has its clear purpose and responsibility.
[0042] It should be noted that the number and types of files obtained by decoupling different target modules are usually also different, and are not limited here.
[0043] Step 102: Generate an initial file corresponding to the target module according to the multiple files corresponding to the target module.
[0044] Optionally, the target files corresponding to the target module include at least one of the following:
[0045] Permission file;
[0046] Configuration file;
[0047] Binary file;
[0048] Shared object file; or
[0049] Java archive file.
[0050] Optionally, an initial file corresponding to the target module may be generated according to at least one target file among multiple files corresponding to the target module.
[0051] It should be noted that after decoupling the target module, it is necessary to determine the target file from the multiple files obtained by decoupling. Among them, the target file may be a file required for making the initial file. For example, the target file may be a permission file, a configuration file, a binary file, a shared object file, or a Java archive file, which is not limited herein. The number of target files corresponding to different target modules may be different or the same.
[0052] For example, some target modules only require a permission file and a Java archive file, and some target modules require all target files, that is, a permission file, a configuration file, a binary file, a shared object file, or a Java archive file, which is not limited herein.
[0053] Among them, the permission file refers to a file or setting that defines file or directory access permissions. "It should be noted that the permission file in the embodiments of the present disclosure is used to implement permission management, which covers traditional file access permissions and the permission management of SELinux (Security-Enhanced Linux).
[0054] For example, when httpd needs to access a file named fle and needs to obtain the permission of this file from the above directory (such as the upper-level directory or a higher-level directory in the directory structure where the file is located), the httpd process needs sufficient operating system permissions to read, execute, and possibly write to the file. Since the configuration file covers SELinux permissions, httpd is allowed to access specific resources.
[0055] Among them, the configuration file is a file used to store settings and parameters of software, systems, or applications. These files usually exist in text form, but may also exist in binary form. Configuration files allow developers and users to customize the behavior of software according to specific requirements or environments. For example, a database configuration file may contain detailed information about database connections, while a web server configuration file may define how the server responds to client requests.
[0056] Among them, a binary file (bin file) is a file of a computer program or data, and its content is stored in binary form (i.e., a sequence of 0s and 1s). Different from text files, binary files are not stored in a human-readable character form. Binary files usually contain machine code (i.e., instructions that a computer can directly execute), or compressed, encrypted, or encoded data.
[0057] Among them, a shared object file (so file) is a file that contains code and data, and these code and data can be shared by multiple programs at runtime. Shared object files allow programs to dynamically link to them when needed, rather than statically linking at compile time. The benefits of doing this include reducing the memory footprint of the program (because the same libraries can be shared among multiple programs), and making it easier to update and replace library files (because there is no need to recompile the programs that use these libraries).
[0058] Among them, a Java Archive file (JAR file) is a packaging tool used to package multiple Java class files, resource files (such as images and audio), and metadata (such as manifest files) into a compressed file. JAR files are part of the Java platform, and they allow developers to package their applications into a portable and easily distributable format.
[0059] Specifically, when generating the initial file corresponding to each target module, it can be formed by combining the target files after decoupling the target module. For example, some modules need to combine permission files and Java Archive files, and some target modules need all the target files, that is, they need permission files, configuration files, binary files, shared object files, or Java Archive files, which are not limited here.
[0060] For example, the permission file, configuration file, binary file, shared object file, or Java Archive file of a certain target module can be compressed and combined to generate the initial file corresponding to the target module.
[0061] It can be understood that by decoupling the target modules in the application, it is easier to identify and manage the files of each module. This modular processing makes the upgrade process more flexible and efficient, because operations can be performed only on the modules that need to be upgraded, without the need to comprehensively update the entire application. Then, the initial file corresponding to the target module is generated.
[0062] Alternatively, the target files of each target module corresponding to each application can be compressed and combined to obtain the initial file corresponding to each application.
[0063] Among them, the initial file can be a data packet used to support the implementation of a certain function or multiple functions in the application. In the embodiments of the present disclosure, since different target modules of the application correspond to different functions, the initial file obtained by compressing and combining the target files of different target modules can support the function implementation of each target module in the application.
[0064] For example, for application V, there are 5 target modules that need to be updated, and each target module has 3 target files. Therefore, the 15 target files can be compressed and combined together to obtain the initial file corresponding to application V. After that, the initial file can be used to upgrade application V.
[0065] Among them, the initial file can also be an APEX file. For the specific description of the APEX file, reference can be made to the above embodiments, and details will not be elaborated here. The APEX file is a special installation package format in the Android system, which is used to update some system components that are not suitable for the APK installation process. The APEX file is usually a ZIP compressed package, which contains key files such as apex_manifest.json, AndroidManifest.xml, apex_payload.img, and apex_pubkey.
[0066] It can be understood that by splitting the application into multiple target modules, decoupling and compressing and combining each target module of each application, the upgrade process can be simplified, and the time and resources required for the upgrade can be reduced. The use of the cloud server and the component upgrade list enables users to quickly select and download the components that need to be upgraded, further improving the upgrade efficiency. The modular design makes it easier to replace and upgrade application components without having to rewrite or make large-scale modifications to the entire application. Users can choose to upgrade specific components according to their needs instead of the entire application, which provides greater flexibility and selectivity.
[0067] Step 103, store the initial file in the upgrade storage area.
[0068] Among them, the upgrade storage area can be a pre-created upgrade partition.
[0069] It can be understood that the upgrade partition is the storage space in the Android system used to store updatable components. These partitions usually have specific uses and attributes, such as read-only, read-write, etc. By mounting the initial file on the upgrade partition, the system can update these components when needed.
[0070] Such as Figure 2As shown in the figure, first decouple each module (target module) of application A, application B, and application N, and generate the corresponding target files (bin files, so files, jar package files, permission files, and configuration files) for application A, application B, and application N respectively. Then compress and combine the target files of each application into APEX files (initial files), and then it can be verified. After verification, it can be mounted to the upgrade partition, that is, the upgrade storage area.
[0071] Step 104, in response to receiving an upgrade instruction, obtain a target initial file from the upgrade storage area, where the target initial file is used to upgrade the application to be upgraded.
[0072] Among them, the upgrade instruction indicates that there is a current need to upgrade the application to be upgraded. After the upgrade device receives the upgrade instruction, it needs to obtain the corresponding target initial file from the upgrade storage area.
[0073] Specifically, the upgrade device determines the target initial file associated with the upgrade requirement according to the touch operation of the user on the client (for example, the user can click and select the icon of the target initial file on the display interface of the client). Among them, the target initial file can be one or more.
[0074] Furthermore, the user can upload the corresponding target initial file to the cloud server according to the current upgrade requirement or the requirement of the product. After that, the target initial file can be used to upgrade the application to be upgraded.
[0075] In the embodiments of the present disclosure, first decouple each target module in at least one application to obtain multiple files corresponding to the target module. Then, according to the multiple files corresponding to the target module, generate an initial file corresponding to the target module. Then store the initial file in the upgrade storage area. After that, in response to receiving an upgrade instruction, obtain the target initial file from the upgrade storage area, where the target initial file is used to upgrade the application to be upgraded. Thus, by splitting the application into multiple target modules, decoupling and compressing and combining each target module of each application, the upgrade process can be simplified, and the time and resources required for upgrading can be reduced. The modular design makes it easier to replace and upgrade application components without rewriting or large-scale modification of the entire application. The user can select to upgrade specific components according to needs instead of the entire application, which provides greater flexibility and selectivity. Since the target initial file is uploaded to the upgrade storage area, it provides a reliable backup and distribution channel for subsequent upgrades. This reduces the risk of data loss or damage during the upgrade process and reduces the cost caused by upgrade failures.
[0076] Figure 3 It is a schematic flowchart of the upgrade method according to the second embodiment of the present disclosure.
[0077] As Figure 3 shown, the method includes:
[0078] Step 201: Decouple each target module in at least one application to obtain multiple files corresponding to the target module.
[0079] Step 202: Generate an initial file corresponding to the target module according to the multiple files corresponding to the target module.
[0080] Step 203: Store the initial file in the upgrade storage area.
[0081] Step 204: In response to receiving an upgrade instruction, obtain a target initial file from the upgrade storage area, where the target initial file is used to upgrade the application to be upgraded.
[0082] It should be noted that the specific implementation manners of steps 201 - 204 can refer to the above embodiments and will not be elaborated here.
[0083] Step 205: Upload the target initial file to the cloud server.
[0084] Step 206: Send a target trigger instruction to the cloud server.
[0085] Among them, the target trigger instruction indicates notifying the cloud server that the upgrade device is ready for upgrade, so that the cloud server can return a component upgrade list associated with the uploaded target initial file. Among them, the component upgrade list may include each component that can be upgraded currently.
[0086] As a possible implementation manner, after the upgrade device uploads the target initial file to the cloud server, the user can send a target trigger instruction to the cloud server through the upgrade device, and the cloud server can return a component upgrade list to the upgrade device, and the user can select the component to be upgraded in the component upgrade list.
[0087] Step 207: Receive the component upgrade list returned by the cloud server and display the component upgrade list on the client, where the component upgrade list is associated with the initial file.
[0088] Specifically, the upgrade device can receive the component upgrade list returned by the cloud server, and then can display the component upgrade list in the display interface of the client. Optionally, the upgrade device can also receive the upgrade file corresponding to the component upgrade list at the same time.
[0089] Step 208: Determine the component to be upgraded from the component upgrade list according to the user's first selection operation in the client.
[0090] Among them, the component to be upgraded can be the component that the user currently wants to upgrade, such as the System User Interface component, the Launcher component, the Bluetooth component, the wireless network component, the settings component, the High-Definition Multimedia Interface component, the audio playback component, etc., which are not limited here.
[0091] It should be noted that the component to be upgraded requires a corresponding upgrade file to update or replace it in order to improve performance, add new functions or fix security vulnerabilities, so as to achieve optimized update.
[0092] As a possible implementation, the user can select one or more components as the components to be upgraded in the specified operation interface, or the upgrade device can also automatically determine the components to be upgraded, which are not limited here.
[0093] Among them, the first selection operation is the operation for the user to select the component to be upgraded on the client side. For example, click on the icon of the component to be upgraded in the display interface of the client side, which is not limited here.
[0094] Step 209: Upgrade the application to be upgraded based on the component to be upgraded.
[0095] Optionally, the upgrade file can be obtained according to the component to be upgraded first, then the upgrade file is stored in the temporary directory and the system is restarted, and then the upgrade file in the temporary directory is copied to the startup directory of the application to be upgraded, and then the application to be upgraded is upgraded.
[0096] Specifically, the user can upload the corresponding initial file to the cloud server according to the current upgrade requirements or the requirements of the product. Among them, the upgrade file can be a file package, which contains various data required for upgrading each component to be upgraded.
[0097] Specifically, the upgrade device can download the corresponding upgrade file through the identifier of the component to be upgraded. Among them, the upgrade file can be an APEX file, and the upgrade file corresponding to the component to be upgraded can be obtained from the cloud server.
[0098] Among them, APEX is a system module management tool that allows system components to be packaged into separate modules and updated independently of the entire system image. An APEX file is usually a compressed package in ZIP format, which contains multiple files and directories inside, and is used to describe and store the update content of system components.
[0099] It should be noted that if the upgrade file is an APEX file, when using the APEX file for upgrade and update later, the update can be applied without restarting the device or at the next restart, thus reducing the downtime caused by system update and accelerating the system upgrade process.
[0100] As a possible implementation method, the upgrade device can download the upgrade files corresponding to each component to be upgraded from the cloud server and verify the signatures of the upgrade files, so as to ensure the integrity and security of the upgrade files.
[0101] Among them, the temporary directory can be a special directory in the operating system of the upgrade device for storing temporary files, used to store temporary results or support the normal operation of the program. It should be noted that the upgrade device can pre-create a folder as the temporary directory in the non-system disk to store the upgrade files.
[0102] Specifically, after storing the upgrade file in the temporary directory, the system can be restarted.
[0103] It should be noted that restarting the system can clear the residual information of the old version programs or components that may exist in the memory, so as to avoid version conflicts or data inconsistency problems during the upgrade process. Restarting the system can also ensure that all running services and processes have been shut down, which helps to reduce interference and uncertainty during the upgrade process. In some cases, running applications or services may occupy the files or resources to be upgraded. By restarting the system, it can be ensured that these files or resources are in an unoccupied state before the upgrade, thus avoiding potential conflicts.
[0104] Among them, the application to be upgraded can be the application that the user is currently preparing to upgrade. The number of applications to be upgraded can be one, or it can also be multiple, which is not limited here.
[0105] Among them, the startup directory is the basic path for the application program of the application to be upgraded to search for resource files, configuration files, etc. When the application program of the application to be upgraded is running, these files are usually located according to the startup directory.
[0106] As a possible implementation method, the files in the temporary directory can be checked first to ensure that the necessary upgrade files have been prepared in the temporary directory. Then the corresponding application to be upgraded can be determined according to the upgrade files. It should be noted that the number of upgrade files corresponding to one application to be upgraded can be 1, or it can also be multiple.
[0107] For example, if the number of upgrade files corresponding to the application to be upgraded is 1, then the upgrade file can be used to upgrade the entire application to be upgraded, such as updating one or more updatable functions in the application to be upgraded.
[0108] If there are multiple upgrade files corresponding to the application to be upgraded, each upgrade file may be used to update a corresponding function. For example, upgrade file A may be used to update the startup function of the application M to be upgraded, and upgrade file B may be used to update the positioning function of the application M to be upgraded, which is not limited here.
[0109] Therefore, if there is only 1 upgrade file corresponding to the application to be upgraded, the upgrade file can be copied from the temporary directory to the startup directory of the application to be upgraded, and then the entire application to be upgraded can be directly upgraded based on the upgrade file.
[0110] If there are multiple upgrade files corresponding to the application to be upgraded, 1 upgrade file can be copied to the startup directory of the application to be upgraded each time. Then, a certain function of the application to be upgraded can be upgraded based on the upgrade file, and then the other upgrade files can be copied to the startup directory of the application to be upgraded in turn. Thus, each function of the application to be upgraded can be upgraded in turn.
[0111] Optionally, there is one or more applications to be upgraded, and each upgrade file has a corresponding initial file.
[0112] As a possible implementation method, when upgrading the application to be upgraded, the application to be upgraded can be started first. If the application to be upgraded starts successfully, the upgrade file corresponding to the application to be upgraded in the temporary directory can be deleted. If the application to be upgraded fails to start, the upgrade file in the startup directory is replaced with the corresponding initial file.
[0113] Among them, the initial file can be the original file corresponding to the upgrade file. For example, if the upgrade file is used to update the Bluetooth function, the initial file can be the relevant files that implement the Bluetooth function before the application is upgraded, including relevant data for implementing the Bluetooth function, such as configuration parameters, etc.
[0114] Specifically, the application to be upgraded can be started first to verify whether the application can still run normally in the current state.
[0115] If the application to be upgraded starts successfully and runs normally, it can be considered that the current upgrade file is compatible with the current version of the application. In this case, the upgrade file corresponding to the application to be upgraded in the temporary directory can be safely deleted. It should be noted that before deleting the files, the upgrade device needs to ensure that these files are indeed no longer needed and that no other processes are using them.
[0116] If the application to be upgraded fails to start, it may be due to the incompatibility between the upgrade file and the current version of the application, or an error occurred during the upgrade process. In this case, the upgrade file in the startup directory needs to be replaced with the corresponding initial file, that is, the file before the upgrade. Then, the upgrade file in the startup directory can be replaced with the initial file. During the replacement process, ensure that only those files that actually need to be rolled back are replaced to avoid unnecessary interference with other parts of the application. After replacing the files, try to start the application to ensure that the rollback operation is successful and the application can run normally.
[0117] It should be noted that since the components to be upgraded are specified and then the corresponding upgrade files are obtained, only the components that need to be updated are used for the upgrade, thus significantly reducing the size of the upgrade package. There is no need for a full installation and creation of an installation package, improving the efficiency of the upgrade. Since the upgrade files are directly stored in the temporary directory after being obtained, this process simplifies the complex compilation and packaging steps in the traditional upgrade method and reduces the upgrade time. After restarting the system, the upgrade files can be copied to the startup directory of the application to be upgraded without waiting for the entire system to be recompiled or installed, greatly shortening the upgrade time. During the upgrade process, the upgrade files are stored in the temporary directory and copied to the startup directory of the application to be upgraded after restarting the system. This design can reduce the risk of upgrade failure because even if problems occur during the upgrade process, the original application and data can still be retained. The component-based upgrade method also reduces the compatibility issues that may be introduced by upgrading the entire application. The fast upgrade speed and flexible upgrade options can enhance user satisfaction and loyalty.
[0118] As Figure 4 shown, the client first sends a component upgrade request, then obtains a list of upgradable components. After that, the customer selects the module to be upgraded, then downloads the selected components, places the components in the temporary directory, restarts the system, and then copies the files in the temporary directory to the module startup directory. If the application starts successfully, the temporary directory is deleted. If the application fails to start successfully, the APEX file of the initial version is decompressed and the initial version files are copied to the startup directory.
[0119] In the embodiments of the present disclosure, first, each target module in at least one application is decoupled to obtain multiple files corresponding to the target module. Then, based on the multiple files corresponding to the target module, an initial file corresponding to the target module is generated. Next, the initial file is stored in the upgrade storage area. After that, in response to receiving an upgrade instruction, the target initial file is retrieved from the upgrade storage area, and the target initial file is used to upgrade the application to be upgraded. Then, the target initial file is uploaded to the cloud server, and a target trigger instruction is sent to the cloud server. Subsequently, a component upgrade list returned by the cloud server is received and displayed on the client. The component upgrade list is associated with the initial file. Then, according to the user's first selection operation on the client, the component to be upgraded is determined from the component upgrade list. Finally, based on the component to be upgraded, the application to be upgraded is upgraded. Thus, the user can intuitively see the component upgrade list on the client and select the components to be upgraded according to their own needs. This interaction method makes the upgrade process more user-friendly and improves the user's participation and satisfaction. By decoupling the application into multiple target modules, each module can be upgraded independently without a full update of the entire application, thereby improving the pertinence and efficiency of the upgrade. The generated initial file is stored in the upgrade storage area, which is convenient for management and quick access, reducing the data retrieval time during the upgrade process. Uploading the target initial file to the cloud server can utilize the storage and computing capabilities of the cloud to efficiently handle large-scale data transmission and upgrade requests. The cloud server, as a transfer station for upgrade files, can verify and encrypt the uploaded initial file to ensure the integrity and security of the file. Through the component upgrade list returned by the cloud server, the correctness and applicability of the upgrade content can be further verified, avoiding problems such as system crashes or function abnormalities caused by improper upgrades.
[0120] To facilitate better implementation of the upgrade method of the present disclosure, the present disclosure also provides an upgrade device based on the above upgrade method. The meanings of the nouns are the same as those in the above upgrade method, and the specific implementation details can refer to the description in the method embodiments.
[0121] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of the upgrade device provided by the embodiments of the present disclosure. The upgrade device 500 includes:
[0122] A decoupling module 510, configured to decouple each target module in at least one application to obtain multiple files corresponding to the target module;
[0123] A generating module 520, configured to generate an initial file corresponding to the target module according to the multiple files corresponding to the target module;
[0124] A storage module 530 for storing the initial file in an upgrade storage area;
[0125] An acquisition module 540 for acquiring a target initial file from the upgrade storage area in response to receiving an upgrade instruction, where the target initial file is used to upgrade an application to be upgraded.
[0126] Optionally, the generation module is specifically configured to:
[0127] Generate an initial file corresponding to the target module according to at least one target file among multiple files corresponding to the target module;
[0128] Or,
[0129] Compress and combine the target files of each target module corresponding to each application to obtain an initial file corresponding to each application,
[0130] where the target files corresponding to the target module include at least one of the following:
[0131] Permission file;
[0132] Configuration file;
[0133] Binary file;
[0134] Shared object file; or
[0135] Java archive file.
[0136] Optionally, the acquisition module further includes:
[0137] An upload unit for uploading the target initial file to a cloud server;
[0138] A sending unit for sending a target trigger instruction to the cloud server;
[0139] A receiving unit for receiving a component upgrade list returned by the cloud server and displaying the component upgrade list on a client, where the component upgrade list is associated with the initial file;
[0140] A determination unit for determining a component to be upgraded from the component upgrade list according to a first selection operation of a user in the client;
[0141] An upgrade unit for upgrading the application to be upgraded based on the component to be upgraded.
[0142] Optionally, the upgrade unit includes:
[0143] An acquisition subunit for acquiring an upgrade file according to the component to be upgraded;
[0144] A storage subunit, configured to store the upgrade file in a temporary directory and then restart the system;
[0145] A copying subunit, configured to copy the upgrade file in the temporary directory to the startup directory of the application to be upgraded;
[0146] An upgrade subunit, configured to upgrade the application to be upgraded.
[0147] Optionally, the sending unit is further configured to:
[0148] Receive the upgrade file corresponding to the component upgrade list.
[0149] Optionally, there is one or more applications to be upgraded, and the upgrade file has a corresponding initial file. The upgrade subunit is specifically configured to:
[0150] Start the application to be upgraded;
[0151] If the application to be upgraded is successfully started, delete the upgrade file corresponding to the application to be upgraded in the temporary directory;
[0152] If the application to be upgraded fails to start, replace the upgrade file in the startup directory with the corresponding initial file.
[0153] In the embodiments of the present disclosure, first, each target module in at least one application is decoupled to obtain multiple files corresponding to the target module. Then, according to the multiple files corresponding to the target module, an initial file corresponding to the target module is generated. Then, the initial file is stored in the upgrade storage area. Then, in response to receiving an upgrade instruction, the target initial file is obtained from the upgrade storage area, and the target initial file is used to upgrade the application to be upgraded. Thus, by splitting the application into multiple target modules and decoupling and compressing and combining each target module of each application, the upgrade process can be simplified, and the time and resources required for upgrading can be reduced. The modular design enables application components to be more easily replaced and upgraded without having to rewrite or make large-scale modifications to the entire application. Users can choose to upgrade specific components as needed instead of the entire application, which provides greater flexibility and selectivity.
[0154] In addition, the present disclosure further provides an electronic device, as Figure 6 shown, which shows a schematic structural diagram of the electronic device involved in the present disclosure. Specifically:
[0155] The electronic device may include a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, an input unit 604, and other components. Those skilled in the art can understand, Figure 6The structure of the electronic device shown does not limit the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements. Among them:
[0156] The processor 601 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 602, and calling the data stored in the memory 602, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 601 either.
[0157] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.); the data storage area can store data created according to the use of the electronic device. In addition, the memory 602 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 602 can also include a memory controller to provide the processor 601 with access to the memory 602.
[0158] The electronic device also includes a power supply 603 that powers each component. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby realizing functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, a recharge system, a power device debugging circuit, a power converter or inverter, and a power status indicator.
[0159] The electronic device may also include an input unit 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0160] Although not shown, the electronic device may further include a display unit and the like, which will not be elaborated herein. Specifically, in this embodiment, the processor 601 in the electronic device will load the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 will run the applications stored in the memory 602, so as to implement the steps in any of the upgrade methods provided by the embodiments of the present disclosure.
[0161] In the embodiments of the present disclosure, first, each target module in at least one application is decoupled to obtain multiple files corresponding to the target module. Then, according to the multiple files corresponding to the target module, an initial file corresponding to the target module is generated. Then, the initial file is stored in the upgrade storage area. Then, in response to receiving an upgrade instruction, the target initial file is obtained from the upgrade storage area, and the target initial file is used to upgrade the application to be upgraded. Thus, by splitting the application into multiple target modules and decoupling and compressing each target module of each application, the upgrade process can be simplified, and the time and resources required for the upgrade can be reduced. The modular design enables the application components to be more easily replaced and upgraded without having to rewrite or substantially modify the entire application. The user can choose to upgrade specific components as needed instead of the entire application, which provides greater flexibility and selectivity.
[0162] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated herein.
[0163] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0164] Therefore, the present disclosure provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any of the upgrade methods provided by the present disclosure.
[0165] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated herein.
[0166] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0167] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the upgrade methods provided by the present disclosure, the beneficial effects achievable by any of the upgrade methods provided by the present disclosure can be realized. For details, refer to the previous embodiments and will not be elaborated herein.
[0168] The above has introduced in detail an upgrade method, device, electronic device, and computer-readable storage medium provided by the present disclosure. Specific examples are used herein to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, based on the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. An upgrading method, characterized in that: include: Decoupling each target module in at least one application to obtain multiple files corresponding to the target module; Generate an initial file corresponding to the target module according to the multiple files corresponding to the target module; storing the initial file in an upgrade storage area; In response to receiving the upgrade instruction, a target initial file is acquired from the upgrade storage area, wherein the target initial file is used to upgrade the application to be upgraded.
2. The method according to claim 1, characterized in that The step of generating an initial file corresponding to the target module according to the plurality of files corresponding to the target module comprises: Generate an initial file corresponding to the target module according to at least one target file among the multiple files corresponding to the target module; or, The target files of each target module corresponding to each application are compressed and combined to obtain the initial files corresponding to each application. The target file corresponding to the target module includes at least one of the following: Permissions file; Configuration files; Binary files; a shared object file; or Java archive file.
3. The method according to claim 1, characterized in that After acquiring the target initial file from the upgrade storage area in response to receiving the upgrade instruction, the method further includes: Uploading the target initial file to a cloud server; Sending a target trigger instruction to the cloud server; receiving a component upgrade list returned by the cloud server, and displaying the component upgrade list on the client, wherein the component upgrade list is associated with the initial file; Determining a component to be upgraded from the component upgrade list according to a first selection operation of the user in the client; Based on the component to be upgraded, the application to be upgraded is upgraded.
4. The method according to claim 3, characterized in that The step of upgrading the application to be upgraded based on the component to be upgraded includes: Obtaining an upgrade file according to the component to be upgraded; After storing the upgrade file in a temporary directory, restart the system; Copy the upgrade file in the temporary directory to the startup directory of the application to be upgraded; The application to be upgraded is upgraded.
5. The method according to claim 3, characterized in that: After sending the target trigger instruction to the cloud server, the method further includes: The upgrade file corresponding to the component upgrade list is received.
6. The method according to claim 4, characterized in that in, There is one or more applications to be upgraded, the upgrade file has a corresponding initial file, and upgrading the applications to be upgraded includes: Start the application to be upgraded; If the application to be upgraded is successfully started, deleting the upgrade file corresponding to the application to be upgraded in the temporary directory; If the application to be upgraded fails to start, the upgrade file in the startup directory is replaced with the corresponding initial file.
7. An upgrading device, characterized in that: include: A decoupling module, used for decoupling each target module in at least one application to obtain multiple files corresponding to the target module; A generation module, used for generating an initial file corresponding to the target module according to a plurality of files corresponding to the target module; A storage module, used for storing the initial file in an upgrade storage area; The acquisition module is used to acquire a target initial file from the upgrade storage area in response to receiving an upgrade instruction, wherein the target initial file is used to upgrade the application to be upgraded.
8. The device according to claim 7, characterized in that The generation module is specifically used for: Generate an initial file corresponding to the target module according to at least one target file among the multiple files corresponding to the target module; or, The target files of each target module corresponding to each application are compressed and combined to obtain the initial files corresponding to each application. The target file corresponding to the target module includes at least one of the following: Permissions file; Configuration files; Binary files; a shared object file; or Java archive file.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the method according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Upgrade method and apparatus, and electronic device and storage medium
WO2026174979A1