Hot repair method, device, computer readable storage medium and terminal equipment

By providing a hotfix method in the Android system to dynamically replace patch files, the problems of slow upgrade speed, large space consumption, high risk and poor user experience in existing technologies are solved, and efficient and safe system upgrades are achieved.

CN114489707BActive Publication Date: 2025-12-19SHENZHEN TCL NEW-TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011155466.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-26
Publication Date
2025-12-19
Estimated Expiration
2040-10-26

AI Technical Summary

Technical Problem

Existing Android system upgrade methods suffer from problems such as slow speed, large space consumption, high risk, low user willingness to upgrade, and long cycle, which affect user experience and market promotion.

Method used

A hotfix method is provided, which reads patch files from a preset push path when a hotfix command is received, and dynamically replaces and repairs Android applications, thereby achieving dynamic patch file replacement at the Linux kernel level.

Benefits of technology

It achieves high efficiency and security in Android system upgrades, reduces the system restart process, and improves user experience and market expansion speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114489707B_ABST
    Figure CN114489707B_ABST
Patent Text Reader

Abstract

The application discloses a hot repair method, device, computer readable storage medium and terminal equipment, and the method comprises the following steps: when a hot repair instruction corresponding to an Android application is received, reading a patch file in a preset push path corresponding to the Android application to obtain a target patch file corresponding to the Android application; and performing hot repair on the Android application according to the target patch file to obtain a repaired Android application. Therefore, the application can perform dynamic replacement of an Android system patch file at a Linux kernel level, so that the Android system upgrade becomes more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Android system technology, and in particular to a hot-fix method, apparatus, computer-readable storage medium, and terminal device. Background Technology

[0002] Android is an operating system based on the Linux kernel. It is widely used in terminal devices such as smartphones, tablets, and televisions. The Android architecture consists of four layers: the Linux kernel layer, the system runtime library layer, the application framework layer, and the application layer.

[0003] After Android devices are manufactured and sold, various system-level vulnerabilities are inevitable. Immediate patching of these vulnerabilities is required. Currently, the most widely used upgrade method for Android is Over-The-Air (OTA) online upgrade. Users download the OTA upgrade package via the network, verify its signature, and then reboot into recovery mode to upgrade. However, OTA, as Android's native upgrade solution, has the following problems: 1) Slow speed: Compilation is slow; even submitting just one line of code requires a complete OTA compilation. 2) Large space consumption: OTA upgrade packages take up a lot of space, and differential upgrades inevitably include various additional files, increasing unnecessary network push overhead. 3) High risk: If an OTA upgrade fails, it can lead to system abnormalities or even complete failure to boot and run normally. 4) Low user willingness to upgrade: The OTA upgrade process involves system reboots, and users are often conservative; as long as the device works, they are satisfied, and the latest version is often not quickly adopted. 5) Long cycle: Pushing system upgrades is a very cautious process, and new features are often difficult to launch quickly, affecting user experience.

[0004] Therefore, existing technologies still need to be improved and enhanced. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a hot-repair method, apparatus, computer-readable storage medium and terminal device to address the shortcomings of the prior art, so as to make Android system upgrades more efficient.

[0006] The technical solution adopted in this invention is as follows:

[0007] In a first aspect, embodiments of the present invention provide a thermal repair method, comprising:

[0008] When a hotfix instruction corresponding to an Android application is received, the patch file in the preset push path of the Android application is read to obtain the target patch file for the Android application.

[0009] According to the target patch file, the Android application is hot-fixed to obtain a repaired Android application.

[0010] In a second aspect, the embodiment of the present application provides a hot-fixing device, comprising:

[0011] The acquisition module is configured to read a patch file in a preset push path corresponding to the Android application to obtain a target patch file corresponding to the Android application when receiving a hot-fixing instruction corresponding to the Android application.

[0012] The repair module is configured to perform hot-fixing on the Android application according to the target patch file to obtain a repaired Android application.

[0013] In a third aspect, the embodiment of the present application provides a computer readable storage medium, which stores one or more programs, and the one or more programs are executable by one or more processors to implement the steps in any one of the above methods.

[0014] In a fourth aspect, the embodiment of the present application provides a terminal device, which comprises a processor, a memory, and a computer readable program stored in the memory and executable by the processor, and the computer readable program is executable by the processor to implement the steps in any one of the above methods.

[0015] Advantages: Compared with the prior art, the present application provides a hot-fixing method, device, computer readable storage medium and terminal device, the method comprising: reading a patch file in a preset push path corresponding to the Android application to obtain a target patch file corresponding to the Android application when receiving a hot-fixing instruction corresponding to the Android application; and performing hot-fixing on the Android application according to the target patch file to obtain a repaired Android application. Thus, the present application can perform dynamic replacement of the Android system patch file at the Linux kernel level to make the Android system upgrade more efficient. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 A flowchart of the hot-fixing method provided by the present application.

[0017] Figure 2 A structure schematic diagram of the hot-fixing device provided by the present application.

[0018] Figure 3 A structure schematic diagram of the terminal device provided by the present application. DETAILED DESCRIPTION

[0019] The application provides a hot repair method, device, computer readable storage medium and terminal equipment, in order to make the purpose, technical scheme and effect of the application more clear and definite, the application will be further described in detail below with reference to the drawings and examples. It should be understood that the specific examples described herein are only used to explain the application and not to limit the application.

[0020] Those skilled in the art can understand that, unless specifically stated, the singular forms "a", "an" and "the" used herein can also include the plural forms. It should be further understood that the phrase "comprising" used in the specification of the application means that the features, integers, steps, operations, elements and / or components exist, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intermediate elements. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any single unit and all combinations of the associated listed items.

[0021] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as that generally understood by those skilled in the art to which the application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood as having meanings consistent with those in the context of the prior art, and should not be interpreted with idealized or overly formal meanings unless specifically defined as such.

[0022] After the Android device is sold, it is inevitable to encounter various system-level vulnerabilities, at which time the system application needs to be repaired immediately. The push upgrade method widely used by Android at present is OTA online upgrade method, in which the user downloads the OTA upgrade package through the network, and after signature verification, restarts into recovery mode for upgrade. However, as the original upgrade scheme of Android, OTA needs to update the whole mobile application, which is too long from the beginning of repair to the end of release in terms of the whole project management. It is also not conducive to user experience and affects market promotion.

[0023] The main purpose of the embodiment is to provide a hot repair method for a lighter Android application. When a manufacturer needs to upgrade a device, only a corresponding patch file (such as an Android framework jar package or an Android runtime library) needs to be compiled and pushed to a specified path on the device. When a user restarts the device next time, the Linux kernel layer automatically identifies the patch file and dynamically replaces it in the system, thereby achieving the effect of hot repair, so that the Android system upgrade is more efficient.

[0024] The content of the application will be further described through the description of the embodiments in combination with the drawings.

[0025] The embodiment provides a hot repair method, as shown in the method, the method comprises the following steps. Figure 1

[0026] S100, when receiving a hot repair instruction corresponding to an Android application, a terminal device reads a patch file in a preset push path corresponding to the Android application to obtain a target patch file corresponding to the Android application.

[0027] Specifically, the preset push path is pre-established, and the preset push path is used to receive a patch file pushed by a server. The Android system framework jar package is generally stored under / system / framework on the device. In the embodiment, the push path of the patch file can be specified to / data / tcl-patch / system / framework, and the / data / tcl-patch / system / framework path is the preset push path. Correspondingly, before reading the patch file in the preset push path corresponding to the Android application to obtain the target patch file corresponding to the Android application when receiving the hot repair instruction corresponding to the Android application, the method further comprises the following steps.

[0028] S10, a terminal device establishes a push path and configures the push path to an Android application, wherein the push path is used to store a patch file corresponding to the Android application.

[0029] In the embodiment, the push path is in a readable and writable state. In actual application, establishing a push path and configuring the push path to an Android application specifically comprises the following steps.

[0030] S11, a terminal device modifies a configuration file corresponding to the Android application to obtain a push path.

[0031] S12, loading the modified configuration file when the system is started, and the terminal device configures the push path to the Android application.

[0032] ​Specifically, the configuration file is the init.rc file that comes with the terminal, so that the terminal device can automatically create a push path when it boots up.

[0033] In this embodiment, the system kernel's `open` function is primarily used to dynamically replace patch files within the Linux kernel, storing the patch files pushed by the server in a preset push path. This invention enables dynamic replacement of Android system patch files at the Linux kernel level, making Android system upgrades more efficient.

[0034] In this embodiment, the terminal device reads the patch file in the preset push path corresponding to the Android application to obtain the target patch file corresponding to the Android application, specifically including:

[0035] S101. Check if there are patch files in the preset push path corresponding to the Android application;

[0036] S102. If a patch file is read from the preset push path, determine the target patch file corresponding to the Android application based on the patch file in the preset push path; or,

[0037] S103. If the patch file in the preset push path is not read, the target patch file corresponding to the Android application is determined according to the patch file in the system default path.

[0038] In this embodiment, taking the services.jar application as an example, when the kernel detects that system_server needs to access / system / framework / services.jar, it first checks whether a patch file exists, i.e., whether / data / tcl-patch / system / framework / services.jar exists. If it exists, the target patch file corresponding to the Android application is obtained based on the patch file in the preset push path. Conversely, if it does not exist, the target patch file corresponding to the Android application is obtained based on the patch file in the system default path. In this embodiment, the patch file in the default path refers to the path where the Android system framework jar package is generally stored on the device, such as under / system / framework / .

[0039] S200: The terminal device performs hot-fix on the Android application based on the target patch file, resulting in a fixed Android application.

[0040] Specifically, in this embodiment, the Android application is hot-fixed based on the read target patch file. The fixed Android application is obtained by loading the target patch file.

[0041] Further, in one implementation of the embodiment, to make the hot repair scheme safer, the Android application is hot repaired based on the read target patch file, and then the repaired Android application is obtained, and the method further comprises:

[0042] The terminal device judges whether the Android application is normally started or not.

[0043] When the Android application is normally started, the terminal device completes the repair of the Android application.

[0044] In the embodiment, after the patch file is loaded, it is further judged whether the Android application can be normally started or not, and when the Android application can be normally started, it is indicated that the repaired file is not problematic, and correspondingly, the hot repair method further comprises:

[0045] When the Android application is abnormally started, the terminal device empties the patch file existing in the preset push path; and the terminal device restarts the Android application. That is to say, if the patch file is pushed and the system is abnormally started, the protection mechanism is triggered, and all the files under / data / tcl-patch are emptied exemplarily. In this way, when the terminal device is restarted, the step of judging whether the patch file exists in the preset push path when the Android application is started can be continuously executed, so that the Android application can be normally run.

[0046] In summary, compared with the prior art, the embodiment has the following advantages:

[0047] The application discloses a hot repair method, which comprises the following steps: when a hot repair instruction corresponding to an Android application is received, reading a patch file in a preset push path corresponding to the Android application to obtain a target patch file corresponding to the Android application; and hot repairing the Android application according to the target patch file to obtain a repaired Android application. Thus, the application can dynamically replace the patch file of the Android system at the linux kernel level, so that the Android system upgrade becomes more efficient.

[0048] Based on the hot repair method, the application further provides a hot repair device, as shown in Figure 2 The device comprises:

[0049] The obtaining module 41 is configured to read a patch file in a preset push path corresponding to an Android application to obtain a target patch file corresponding to the Android application when a hot repair instruction corresponding to the Android application is received.

[0050] The repairing module 42 is configured to hot repair the Android application according to the target patch file to obtain a repaired Android application.

[0051] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned thermal repair device and each module can be referred to the corresponding description in the aforementioned thermal repair method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0052] The aforementioned thermal repair device can be implemented as a computer program, which can, as... Figure 3 It runs on the terminal device shown.

[0053] Based on the above-described hot-fix method, the present invention also provides a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the steps in the hot-fix method of the above embodiments.

[0054] Based on the above-described thermal repair method, the present invention also provides a terminal device, such as... Figure 3 As shown, it includes at least one processor 20; a display screen 21; and a memory 22, and may also include a communications interface 23 and a bus 24. The processor 20, display screen 21, memory 22, and communications interface 23 can communicate with each other via the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setup mode. The communications interface 23 can transmit information. The processor 20 can invoke logical instructions in the memory 22 to execute the methods described in the above embodiments.

[0055] Furthermore, the logical instructions in the aforementioned memory 22 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0056] The memory 22, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, such as program instructions or modules corresponding to the methods in the embodiments of this disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions, or modules stored in the memory 22, thereby implementing the methods in the above embodiments.

[0057] The memory 22 can include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory. For example, various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc., can also be a transitory storage medium.

[0058] In addition, the specific processes of the above-mentioned storage medium and the plurality of instruction processors in the terminal device load and execute have been described in detail in the above-mentioned method, and will not be described one by one here.

[0059] Finally, it should be pointed out that: the above examples are only used to illustrate the technical solutions of the present application, and not to limit it; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A thermal repair method, characterized in that, include: When a hotfix instruction corresponding to an Android application is received, the patch file in the preset push path corresponding to the Android application is read to obtain the target patch file corresponding to the Android application. The Android application is hot-patched according to the target patch file to obtain the repaired Android application. Before receiving the hotfix instruction corresponding to the Android application, the method further includes: A push path is established and configured for the Android application; wherein the push path is used to store patch files corresponding to the Android application. The configuration file is the terminal's init.rc configuration file, which enables the terminal device to automatically create a push path when it boots up, and relies on the system kernel's open function to store the patch files pushed by the server in the preset push path; The step of establishing a push path and configuring the push path to the Android application includes: The configuration file corresponding to the Android application is modified to obtain a push path; the push path is in a readable and writable state. The modified configuration file is loaded when the system boots up, and the push path is configured for the Android application; The step of reading the patch file in the preset push path corresponding to the Android application to obtain the target patch file corresponding to the Android application includes: Check if a patch file exists in the preset push path corresponding to the Android application; If a patch file is found in the preset push path, then the target patch file corresponding to the Android application is determined based on the patch file in the preset push path; or, If the patch file in the preset push path is not read, the target patch file corresponding to the Android application is determined according to the patch file in the system default path; When the kernel detects that system_server needs to access / system / framework / services.jar, it checks whether a patch file exists, specifically whether / data / tcl-patch / system / framework / services.jar exists. If it exists, the target patch file for the Android application is obtained based on the patch file in the preset push path. If it does not exist, the target patch file for the Android application is obtained based on the patch file in the system default path. The patch file in the default path refers to the path where the Android system framework jar package is stored on the device.

2. The method according to claim 1, characterized in that, After performing hotfix on the Android application based on the target patch file to obtain the repaired Android application, the method further includes: When the Android application starts normally, the repair of the Android application is complete.

3. The method according to claim 1, characterized in that, The method further includes: When the Android application fails to start, clear the patch files existing in the preset push path; Restart the Android application.

4. A thermal repair device, characterized in that, include: The acquisition module is used to read the patch file in the preset push path of the Android application when a hotfix instruction corresponding to the Android application is received, and obtain the target patch file corresponding to the Android application. The repair module is used to perform hot repair on the Android application based on the target patch file to obtain the repaired Android application. Before receiving the hotfix instruction corresponding to the Android application, the process also includes: A push path is established and configured for the Android application; wherein the push path is used to store patch files corresponding to the Android application. The configuration file is the terminal's init.rc configuration file, which enables the terminal device to automatically create a push path when it boots up, and relies on the system kernel's open function to store the patch files pushed by the server in the preset push path; The step of establishing a push path and configuring the push path to the Android application includes: The configuration file corresponding to the Android application is modified to obtain a push path; the push path is in a readable and writable state. The modified configuration file is loaded when the system boots up, and the push path is configured for the Android application; The step of reading the patch file in the preset push path corresponding to the Android application to obtain the target patch file corresponding to the Android application includes: Check if a patch file exists in the preset push path corresponding to the Android application; If a patch file is found in the preset push path, then the target patch file corresponding to the Android application is determined based on the patch file in the preset push path; or, If the patch file in the preset push path is not read, the target patch file corresponding to the Android application is determined according to the patch file in the system default path; When the kernel detects that system_server needs to access / system / framework / services.jar, it checks whether a patch file exists, specifically whether / data / tcl-patch / system / framework / services.jar exists. If it exists, the target patch file for the Android application is obtained based on the patch file in the preset push path. If it does not exist, the target patch file for the Android application is obtained based on the patch file in the system default path. The patch file in the default path refers to the path where the Android system framework jar package is stored on the device.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the method as described in any one of claims 1 to 3.

6. A terminal device, characterized in that, The terminal device includes a processor, a memory, and a computer-readable program stored in the memory and executable by the processor, wherein the computer-readable program, when executed by the processor, implements the steps of the method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and terminal for upgrading library files of system application

    CN104182255A