WO2021027630A9 - 补丁方法、相关装置及系统 - Google Patents

补丁方法、相关装置及系统 Download PDF

Info

Publication number
WO2021027630A9
WO2021027630A9 PCT/CN2020/106814 CN2020106814W WO2021027630A9 WO 2021027630 A9 WO2021027630 A9 WO 2021027630A9 CN 2020106814 W CN2020106814 W CN 2020106814W WO 2021027630 A9 WO2021027630 A9 WO 2021027630A9
Authority
WO
WIPO (PCT)
Prior art keywords
file
class
electronic device
target class
classes
Prior art date
Application number
PCT/CN2020/106814
Other languages
English (en)
French (fr)
Other versions
WO2021027630A1 (zh
Inventor
任文杰
尹永宏
李英伟
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021027630A1 publication Critical patent/WO2021027630A1/zh
Publication of WO2021027630A9 publication Critical patent/WO2021027630A9/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Definitions

  • This application relates to the field of computer technology, in particular to patch methods, related devices and systems.
  • the current Android package (Android Package, apk) runs on a virtual machine.
  • Android currently uses the Android Runtime (ART) method to execute Java code.
  • ART Android Runtime
  • the terminal when the terminal detects a software update, it needs to download the full patch (that is, the entire apk) to update the software. This will result in slow download speeds, consuming network resources, etc.
  • the embodiment of the present application provides a patch method, which can dynamically load a patch file in a new compiler environment, while ensuring operating efficiency, increasing the speed of patch downloading, and reducing the occupation of network resources.
  • an embodiment of the present application provides a patching method, which is executed by an electronic device, and the method includes: the electronic device receives a differential file sent by a server, and the differential file is generated based on the original installation package and the changed installation package
  • the above-mentioned difference file is a file generated based on the changed file in the above-mentioned original installation package, the above-mentioned difference file is a binary file, and the above-mentioned difference file includes one or more classes; the above-mentioned electronic device loads a target class, and the above-mentioned target class is the above-mentioned Any one of one or more classes.
  • the embodiment of the application can package the modified file into a slice dynamic shared object dso file in the operating environment of a new compiler.
  • This slice dso decouples the coupling relationship between classes, which can ensure the running speed of the APP, but also It can increase the speed of patch download and reduce the occupation of network resources.
  • loading the target class of the electronic device includes: loading the difference file, one or more classes contained in the difference file each include a relocation mark; creating a first type loader, the first type The loader is used to load one or more classes contained in the above-mentioned difference file; in the case of uncertain symbolic links, the above-mentioned first-type loader is used to find the above-mentioned target class; when the above-mentioned target class is found, the above-mentioned target is removed
  • the class contains the relocation mark, and updates the mapping table.
  • the above mapping table contains one or more loaded classes and the parameters corresponding to the above classes.
  • the parameters corresponding to the above classes include at least one of the following: the file where the above class is located, Load the class loader of the above-mentioned class, the relocation mark of the above-mentioned class.
  • the embodiment of the present application may use the relocation mark to control the dynamic loading of the dso file in the process of mapping and positioning.
  • the above-mentioned difference file may also include a relocation mark.
  • the above-mentioned first type loader may also include a relocation mark.
  • loading the target class of the electronic device further includes: in the case of determining the symbolic link, using the original class loader of the electronic device to find the target class, and loading the original class of the electronic device
  • the class loader is a class loader other than the above-mentioned first class loader.
  • the above-mentioned method further includes: loading the above-mentioned target class again.
  • the above-mentioned reloading of the above-mentioned target class includes: detecting a user operation for reloading the above-mentioned target class; in response to the above-mentioned user operation, querying whether there is a parameter corresponding to the above-mentioned target class in the first record table; If yes, execute the function corresponding to the aforementioned target class; if not, execute the aforementioned step of loading the aforementioned electronic device into the target class again.
  • the parameters corresponding to the loaded class can be saved in the first record table.
  • the first record table is first checked to see if there is a parameter corresponding to the class, and if so, you can directly Use this class to realize the response function and improve the operating efficiency of the APP.
  • the above-mentioned reloading the target class includes: detecting a segmentation fault instruction; based on the above-mentioned segmentation fault instruction, executing the step of loading the target class by the electronic device again.
  • the embodiment of the present application adds an exception protection mechanism. After the reloading of the class is passively triggered, the trigger factor information that triggers the reloading of the target class can be recorded, which can avoid triggering again next time.
  • an embodiment of the present application provides a patching method, which is executed by an electronic device, and the method includes: the electronic device receives a first file sent by a server, and the first file is based on the original installation package and the changed installation The file generated by the package, the first file is a file that has changed in the original installation package, the first file is a binary file, and the first file includes one or more classes; the electronic device loads a target class, and the target class is Any one of all classes included in the first file and the second file, the second file is a dynamic file, and the second file includes one or more classes.
  • the embodiments of this application can be applied to scenarios where a new compiler and JVM run mixedly. After binarization, classes that fix problems can be distributed to electronic devices in small decoupled differential packages, and sliced patches are used to repair the interpretation code. , Slice patch can not be coupled with the existing interpretation code, which can not only ensure the running speed of APP, but also increase the speed of patch download and reduce the occupation of network resources.
  • loading the target class of the electronic device includes: loading the first file by using a first compiler, searching whether the target class exists in one or more classes included in the first file, and if it exists, Load the above-mentioned target class; load the above-mentioned second file by using a virtual machine, find whether the above-mentioned target class exists in one or more classes included in the above-mentioned second file, and load the above-mentioned target class if it exists.
  • the first compiler is the aforementioned new compiler.
  • the analysis of the classes in the sliced patch uses a new dynamic loading mechanism for the analysis of the compiler, and the interpreter is used to parse and interpret the code for the classes outside the slice to fix problems on the electronic device side.
  • the interpreter is used to parse and interpret the code for the classes outside the slice to fix problems on the electronic device side.
  • the dex type apk there is no need to instrument the apk source code to support the repair of the slice type, that is, only the repaired type is issued.
  • the foregoing first compiler is used to load the foregoing first file, to find whether the foregoing target class exists in one or more classes included in the foregoing first file, and if it exists, loading the foregoing target class includes: loading In the first file, one or more classes contained in the first file respectively include relocation marks; a first class loader is created, and the first class loader is used to load one or more classes contained in the first file ; In the case of uncertain symbolic links, use the above-mentioned first class loader to find the above-mentioned target class; in the case of finding the above-mentioned target class, remove the relocation mark contained in the above-mentioned target class, and update the mapping table, the above-mentioned mapping table Contains one or more loaded classes and the parameters corresponding to the above classes.
  • the parameters corresponding to the above classes include at least one of the following: the file where the above class is located, the class loader where the above class is loaded, and the relocation mark of the above class .
  • the relocation flag can be used to control the dynamic loading of the dso file in the process of mapping and positioning.
  • the above-mentioned difference file may also include a relocation mark.
  • the above-mentioned first type loader may also include a relocation mark.
  • the above-mentioned using the first compiler to load the above-mentioned first file, searching whether the above-mentioned target class exists in one or more classes included in the above-mentioned first file, and if it exists, loading the above-mentioned target class further includes: In the case of determining the symbolic link, the original class loader of the first compiler is used to find the target class, and the original class loader of the first compiler is a class other than the first class loader. Loader.
  • the first compiler is used to load the first file, to find whether the target class exists in one or more classes included in the first file, and if the target class exists, after the target class is loaded, the The method also includes: loading the above-mentioned target class again.
  • the above-mentioned reloading of the above-mentioned target class includes: detecting a user operation for reloading the above-mentioned target class; in response to the above-mentioned user operation, querying whether there is a parameter corresponding to the above-mentioned target class in the first record table ; If yes, execute the function corresponding to the target class; if not, execute the step of loading the first file with the first compiler again.
  • the parameters corresponding to the loaded class can be saved in the first record table.
  • the first record table is first checked to see if there is a parameter corresponding to the class, and if so, you can directly Use this class to realize the response function and improve the operating efficiency of the APP.
  • the above-mentioned reloading of the above-mentioned target class includes: detecting a segmentation fault instruction; based on the above-mentioned segmentation fault instruction, re-executing the above-mentioned step of loading the above-mentioned first file with the first compiler.
  • the embodiment of the present application adds an exception protection mechanism. After the reloading of the class is passively triggered, the trigger factor information that triggers the reloading of the target class can be recorded, which can avoid triggering again next time.
  • an embodiment of the present application provides a patching method, which is executed by a server.
  • the method includes: the server forms a differential file based on the original installation package and the changed installation package, and the differential file is based on the original installation package.
  • the file generated by the changed file, the difference file is a binary file, and the difference file includes one or more classes; the server sends the difference file to the electronic device so that the electronic device loads the target class, and the target class is the one Or any one of multiple classes.
  • the embodiment of the application can enable the electronic device to package the modified file into a slice dso file in the operating environment of the new compiler.
  • This slice dso decouples the coupling relationship between classes, which can not only ensure the running speed of the APP, but also It can increase the speed of patch download and reduce the occupation of network resources.
  • an embodiment of the present application provides a patching method, which is executed by a server, and the method includes: the server generates a first file based on the original installation package and the changed installation package, and the first file is based on the original installation package.
  • the file generated by the changed file in the package, the first file is a binary file, and the first file includes one or more classes; the server sends the first file to the electronic device so that the electronic device loads the target class.
  • the target class is any one of all classes contained in the first file and the second file, the second file is a dynamic file, and the second file includes one or more classes.
  • the embodiments of this application can make electronic devices suitable for scenarios where a new compiler and JVM run mixedly.
  • classes that fix problems can be delivered to electronic devices in small and decoupled differential packages, and sliced patches are used to Repair the interpretation code.
  • the slice patch can be uncoupled from the existing interpretation code, which can not only ensure the running speed of the APP, but also increase the download speed of the patch and reduce the occupation of network resources.
  • an embodiment of the present application provides an electronic device.
  • the electronic device includes: one or more processors, memories, receivers, and transmitters; the memory, the transmitter, the receiver, and one or more of the foregoing
  • the above-mentioned memory is used to store computer program code, and the above-mentioned computer program code includes instructions.
  • the above-mentioned one or more processors execute the above-mentioned instructions
  • the above-mentioned electronic device executes the first aspect or the first aspect of the embodiments of the present application.
  • the patch method provided by any implementation method.
  • an embodiment of the present application provides an electronic device.
  • the electronic device includes: one or more processors, memories, receivers, and transmitters; the memory, the transmitter, the receiver, and one or more of the foregoing
  • the above-mentioned memory is used to store computer program code, and the above-mentioned computer program code includes instructions.
  • the above-mentioned one or more processors execute the above-mentioned instructions
  • the above-mentioned electronic device executes the second aspect or the second aspect of the embodiments of the present application.
  • the patch method provided by any implementation method.
  • an embodiment of the present application provides a server.
  • the server includes: one or more processors, memories, receivers, transmitters; the memory, the transmitter, the receiver, and the one or more processors.
  • the above-mentioned memory is used to store computer program code, and the above-mentioned computer program code includes instructions.
  • the above-mentioned server executes the patch method provided by the third aspect of the embodiments of the present application.
  • an embodiment of the present application provides a server.
  • the server includes: one or more processors, memories, receivers, and transmitters; the memory, the transmitter, the receiver, and the one or more processors.
  • the above-mentioned memory is used to store computer program code, and the above-mentioned computer program code includes instructions.
  • the above-mentioned server executes the patch method provided by the fourth aspect of the embodiments of the present application.
  • an embodiment of the present application provides a communication system.
  • the communication system includes an electronic device and a server.
  • the electronic device may be the electronic device described in the fifth aspect
  • the server may be the server described in the seventh aspect.
  • an embodiment of the present application provides a communication system.
  • the communication system includes an electronic device and a server.
  • the electronic device may be the electronic device described in the sixth aspect
  • the server may be the server described in the eighth aspect.
  • an embodiment of the present application provides a computer storage medium, including computer instructions, when the computer instructions run on an electronic device, the electronic device is caused to execute the first aspect or any one of the implementation manners of the first aspect The patch method provided.
  • the embodiments of the present application provide a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to execute the second aspect or any implementation manner of the second aspect
  • the patch method provided.
  • the embodiments of the present application provide a computer storage medium, including computer instructions, which when the computer instructions run on a server, cause the server to execute the patch method provided in the third aspect.
  • an embodiment of the present application provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the server to execute the patch method provided in the fourth aspect.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the patch method provided in the first aspect or any one of the implementation manners of the first aspect.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the patch method provided by the second aspect or any one of the second aspects.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the patch method provided in the third aspect.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the patch method provided in the fourth aspect.
  • the computer storage medium of the eleventh aspect or the computer program product of the fifteenth aspect provided above are both used to execute the patch method provided in the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
  • the above-mentioned computer storage medium of the twelfth aspect or the above-mentioned computer program product of the sixteenth aspect provided above are both used to execute the patch method provided by the second aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
  • the above-mentioned computer storage medium of the thirteenth aspect or the above-mentioned computer program product of the seventeenth aspect are both used to execute the patch method provided by the third aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
  • the above-mentioned computer storage medium of the fourteenth aspect or the above-mentioned computer program product of the eighteenth aspect provided above are both used to execute the patch method provided by the fourth aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
  • FIG. 1 is a schematic diagram of the architecture of the communication system involved in this application.
  • Fig. 2 is a schematic diagram of a user interface of an electronic device side using a patch to update software
  • Figure 3 is a schematic diagram of patches used to fix vulnerabilities in the Android operating system
  • Figure 4 is a schematic diagram of a parent delegation mechanism in an existing virtual machine operating environment
  • Fig. 5 is a schematic diagram of the class loading method of the compiler in this application.
  • FIG. 6 is a schematic diagram of the running form of the dynamic shared object dso in the memory when the apk is running after the compiler in this application is static;
  • FIG. 7 is a schematic diagram of the running form of the dso in the memory after the dynamic loading repair provided in the first embodiment of the application;
  • FIG. 8 is a schematic diagram of generating a differential dso file provided in Embodiment 1 of the application.
  • FIG. 9 is a schematic flowchart of a patch method provided in Embodiment 1 of this application.
  • FIG. 10 is a schematic diagram of a flow of loading a target class on the electronic device side according to the first embodiment of the application.
  • Figure 11 is a schematic diagram of the specific implementation process of JNI.findClass
  • Figure 12 is a schematic diagram of the specific implementation process of reloading the target class in the case of active addressing
  • Figure 13 is a schematic diagram of the specific implementation process of reloading the target class in the case of passive addressing
  • FIG. 14 is a schematic diagram of the running form of dex in the memory when the apk is running before staticization
  • 15 is a schematic diagram of the form of dso and dex running in the memory when the apk is running after dynamic loading provided in the second embodiment of the application;
  • FIG. 16 is a schematic diagram of loading a difference file provided in the second embodiment of the application.
  • FIG. 17 is a schematic flowchart of loading target classes on the electronic device side according to the second embodiment of the application.
  • FIG. 18 is a schematic diagram of a structure of the server provided by this application.
  • FIG. 19 is a schematic diagram of a structure of an electronic device provided by this application.
  • FIG. 20 is a schematic diagram of another structure of the communication system and related equipment provided by this application.
  • FIG. 21 is a schematic diagram of the software architecture of the patches involved in this application taking effect.
  • Fig. 1 exemplarily shows the communication system involved in the present application.
  • the communication system may include a server 11 and an electronic device 13, and the electronic device 13 and the server 11 may communicate through a network 12 (such as the Internet).
  • the software developer can generate a patch of the software on the server 11.
  • patch C can be generated by comparing the differences between the new version A and the old version B.
  • the electronic device 13 can download patch C from the server 11 through the network 12, merge the patch C and the locally saved old version B to obtain a new version A, and finally install the new version A to realize the software upgrade from the old version B to the new version A .
  • the electronic device 13 may provide the user interface exemplarily shown in FIG. 2, such as the user interface 21 to the user interface 23, so that the user can understand the software update process.
  • the user interface 21 can be used to present the new version and related information of the patch to the user, such as the version number of the new version (such as 9.0.0.17), the size of the patch (such as 5.76MB), the update log, and the version number of the current version (such as 9.0.0.15).
  • the user interface 22 may be used to present the download progress of the patch to the user.
  • the user interface 23 may be used to present the installation process of the new version to the user.
  • the software developer can generate patches for these multiple old versions.
  • the electronic device can download the corresponding patch according to the old version already locally. For example, for the new version A, multiple patches corresponding to the old versions B1, B2, and B3 are generated on the server 11: patch C1, patch C2, and patch C3.
  • the locally existing old version of the electronic device 13 is B1
  • the electronic device 13 can download the patch C1 from the server 11 to upgrade from the old version B1 to the new version A.
  • the locally existing old version of the electronic device 13 is B2
  • the electronic device 13 can download patch C2 from the server 11 to upgrade from the old version B2 to the new version A.
  • patch C can be used to repair one or more software vulnerabilities, or can be used to add one or more new product features or functions.
  • patch C may include one or more repair applications (application, APP), application framework (application framework), kernel (kernel), hardware driver (hardware driver), etc. Item’s vulnerability repair code. Patch C may also include implementation code for newly added product features or functions.
  • the parent delegation mechanism applied in the Java virtual machine (Java virtual machine, JVM) operating environment in the prior art is introduced.
  • the system will in turn find whether the class has been loaded from the application class loader, extended class loader, and startup class loader. It has been loaded, if it is, there is no need to load it again. If not, the system will use the startup class loader, the extended class loader, and the application class loader to load the class in sequence. Each class loader loads the classes in the corresponding directory, and the specific corresponding relationship is shown in Figure 4.
  • the extension class loader 4 may be the parent class loader of the extension class loader, and the extension class loader may be the parent class loader of the application class loader.
  • the application class loader can be a subclass loader of the extension class loader
  • the extension class loader can be a subclass loader of the startup class loader.
  • the process of loading classes by the compiler in this application is introduced.
  • the compiler in this application is referred to as a compiler for short.
  • the process of loading classes by the compiler can include the following steps:
  • dso is a file in the format of .dso
  • a file in the format of .dso is a file in binary format.
  • Loading dso means loading a binary file in the format of .dso into the memory.
  • the compiler determines the running address in the memory, that is, determines a certain type of symbol reference.
  • loadClass() is used to load the class into the compiler. Loading a class is to find the bytecode file corresponding to the class. The class obtained after loadClass() is an unconnected class.
  • forName() can be used to load the class into the compiler and initialize the class.
  • To initialize the class is to do the corresponding initialization action for the class.
  • the class obtained after forName() is the class that has been initialized.
  • the subclass loader can load the .class bytecode according to the name or location, and then use defineClass to convert the bytecode to class.
  • parent class loader and the child class loader in the compiler environment can be different from those in the JVM operating environment mentioned in FIG. 4.
  • the parent class loader and sub-class loader shown in FIG. 4 should not constitute a limitation to this application.
  • Scenario 1 The scenario where the compiler is running.
  • the following first introduces the state of the dso running in the memory when the apk is running after staticization in the prior art, and then the running state of the dso in the memory after the dynamic loading repair provided in the first embodiment of the present application.
  • Fig. 6 exemplarily shows a schematic diagram of the running form of the dso in the memory when the apk is running after the compiler is static.
  • the static file format can be .dso
  • the .dso file is a binary file.
  • the dso file may contain one or more elements, and each element corresponds to a class, such as class1.dso, class2.dso, class3.dso, etc. as shown in FIG. 6.
  • FIG. 7 exemplarily shows a schematic diagram of the running form of the dso in the memory after the dynamic loading repair provided in the first embodiment of the present application.
  • the dso after dynamic loading and repairing may include a differential file hotfix.dso and files class1.dso, class2.dso, class3.dso, etc. before being dynamically loaded and repaired.
  • the generation process of the difference file hotfix.dso can be implemented on the server side.
  • the server can generate a dynamic differential file hotfix.dex according to the original installation package file old.dex and the changed new installation package file new.dex.
  • the dynamic difference file hotfix.dex is a file changed in the original installation package file old.dex.
  • the dynamic difference file hotfix.dex is statically converted into a difference file hotfix.dso, and the difference file hotfix.dso is sent to the electronic device.
  • the patch method can at least include the following steps:
  • S201 The server generates a dynamic difference file based on the first file and the second file.
  • S202 The server statically converts the above-mentioned dynamic difference file to generate a difference file.
  • S203 The server sends the above-mentioned difference file to the electronic device.
  • the first file is the original installation package file, that is, old.dex in FIG. 8.
  • the second file is the new installation package file after the change, that is, new.dex in Figure 8.
  • the dynamic difference file is hotfix.dex in Fig. 8, and the difference file is hotfix.dso in Fig. 8.
  • S204 may specifically include processes such as loading the dso file into the memory, creating a class loader, loading classes, initializing classes, and searching classes.
  • FIG. 10 exemplarily shows the process of loading the target class by the electronic device.
  • the process of loading the target class can at least include the following steps:
  • the differential file sent by the server is a static binary file.
  • Loading the difference file sent by the server is to load the difference file into the memory.
  • relocation (relocation) marks may be added to one or more classes contained in the difference file.
  • the relocation mark may be a variable in the mapping relationship data structure corresponding to each class in the mapping table.
  • the mapping relationship data structure may also include other variables, such as the file corresponding to the class, the class loader corresponding to the loading of the class, and so on.
  • the first class loader can be used to load the classes contained in the above-mentioned difference file.
  • the target loaded by the first type of loader is the path where the difference file is stored in the memory.
  • S303-S304 can refer to the aforementioned S103-S104, which will not be repeated here.
  • a symbolic link is a symbolic reference
  • a symbolic reference is a string containing the name of the quoted content and may contain some other information about the referenced item. This information can uniquely identify a class, field, and method.
  • the first class loader is used to load the target class in the directory corresponding to the loader.
  • this step may specifically include:
  • the class contained in the directory corresponding to the first class loader can be searched according to the name of the class.
  • the relocation mark can be a variable in the data structure. After the first class loader is used to find the target class, the variable can be removed, that is, the relocation mark is removed, indicating that the target class has been loaded, and the target class can be used directly next time without loading it again.
  • the mapping table may include one or more loaded classes and corresponding parameters of the classes.
  • the parameters corresponding to the class may include at least one of the following: the file where the class is located, the class loader that loads the class, the relocation mark of the class, and so on.
  • the dynamically loaded difference file hotfix.dso may have new classes or original classes.
  • the hot patch scenario can be divided into real-time effective and restart effective.
  • the mapping table can update the mapping relationships of existing classes.
  • the restart takes effect, after restarting the APP, all the previous mapping relationships will disappear, and a new mapping relationship will be re-established.
  • the newly downloaded dso file will be inserted into the front of dexelements, that is, the new mapping table is completely different from the original mapping table.
  • the electronic device loads an a.dso file, and all class analysis files can be obtained from the a.dso file.
  • a new class needs to be parsed, which is not defined in a.dso.
  • it needs to be defined in b.dso downloaded from the server. Only when the b.dso file is downloaded can the code of the new class be parsed and the relocation of the class can be triggered.
  • the electronic device loads the a.dso file and the b.dso file.
  • b.dso is unloaded from the element.
  • the electronic device accesses the class in the b.dso file again, a new b will be triggered. Loading and relocation of .dso files.
  • the target class in its corresponding directory.
  • the target class can be loaded sequentially from the parent class loader to the directory corresponding to the child class loader.
  • the process can include the following steps:
  • S501 A user operation for reloading the target class is detected.
  • the user operation may be, but is not limited to, a touch operation acting on a certain control in the user interface of a certain APP, for example.
  • the parameter corresponding to the target pair exists in the hash table, it can be determined that the target class has been loaded. If it is determined that the class has been loaded, you can directly call the class to execute the corresponding function of the class without reloading, and increase the running speed.
  • the hash table may also be referred to as the first record table.
  • the parameters corresponding to the target class may be, for example, the file where the class is located, the class loader that loads the class, the relocation mark of the class, and so on.
  • the step of loading the differential file sent by the server may be executed again, that is, S301.
  • the process can include the following steps:
  • S602 Based on the segment error instruction, execute the step of loading the difference file sent by the server again.
  • the segfault instruction may be an instruction triggered by an address error.
  • the positioning information can be updated to the relocation mark, and the trigger factor information that triggers the reloading of the target class can be recorded, which can avoid triggering again next time.
  • the embodiment of the application can package the modified file into a slice dso file in the running environment of the compiler.
  • This slice dso decouples the coupling relationship between the classes.
  • the relocation flag is used to control the dso
  • the dynamic loading of files can not only ensure the running speed of the APP, but also increase the speed of patch download and reduce the occupation of network resources.
  • Scenario 2 A scenario where the compiler and JVM run mixedly.
  • the following first introduces the mode of dex running in the memory when the apk is running before staticization in the prior art, and then the running mode of the dso loaded in the memory provided in the second embodiment of the application.
  • FIG. 14 exemplarily shows the morphological diagram of the dex running in the memory when the apk is running before the staticization in the prior art.
  • the file format before staticization can be .dex, and the .dex file can contain one or more elements (element), and each element corresponds to a class, such as class1.dex and class2 as shown in Figure 14. .dex, class3.dex, etc.
  • FIG. 15 exemplarily shows the morphological schematic diagram of the dso and dex running in the memory when the apk is running after dynamic loading provided in the second embodiment of the present application.
  • the apk when the apk runs, it may include a differential file hotfix.dso and the files class1.dex, class2.dex, class3.dex, etc. before staticization.
  • FIG. 16 exemplarily shows a schematic diagram of loading the difference file provided in the second embodiment.
  • the difference file hoxfix.dso can be loaded by the compiler.
  • the files class1.dex, class2.dex, class3.dex, etc. before staticization can be loaded by the Android virtual machine.
  • loading the target class on the electronic device side may include at least the following steps:
  • S701 Determine whether the file is a dso file, if yes, execute S702, if not, execute S706.
  • S702 The compiler determines that the file is a hot patch feature and does not perform symbol positioning.
  • the compiler may process the dso file, and the processing process may include S702-S703, and the Android virtual machine may process the non-dso file, and the processing process may include S704.
  • the process of loading the target class by the compiler can refer to the related description of FIG. 10 in the first embodiment, which is not repeated here.
  • the method provided in this application can be applied to the scenario where the compiler and the JVM run mixedly.
  • the class that fixes the problem can be distributed to the electronic device in a small decoupled differential package, and the sliced patch is used to repair the interpretation code.
  • the slice patch can be uncoupled from the existing interpretation code.
  • the analysis of the class in the slice patch uses the dynamic loading mechanism analyzed by the compiler.
  • the interpreter is used to parse the interpreted code and fix the electronic device side. problem.
  • the dex type apk there is no need to instrument the apk source code to support the repair of the slice type, that is, only the repaired type is issued.
  • FIG. 18 shows a schematic structural diagram of the server 60.
  • the server 60 may be the server 11 in the communication system shown in FIG. 1.
  • the server 60 includes: one or more processors 601, a transmitter 607, and a receiver 609, and is coupled to the processor 601 and the memory 605. These components can be connected through a bus 603 or other ways.
  • FIG. 18 takes the connection through the bus 603 as an example. among them:
  • the transmitter 607 may be used to transmit and process the signal output by the processor 601.
  • the transmitter 607 may send the patch generated by the processor 601 to the electronic device 70.
  • the receiver 609 can be used by the server 60 to receive signals transmitted by other devices (such as the electronic device 70), process the received signals, and output the processed signals to the processor 601.
  • the receiver 609 may receive a patch download request sent by the electronic device 70.
  • the transmitter 607 and the receiver 609 can be regarded as one wireless modem. In the server 60, the number of the transmitter 607 and the receiver 609 may each be one or more.
  • the memory 605 is coupled with the processor 601, and is used to store various software programs and/or multiple sets of instructions.
  • the memory 605 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
  • the memory 605 may store an operating system (hereinafter referred to as the system), such as embedded operating systems such as uCOS, VxWorks, RTLinux, and so on.
  • the memory 605 may also store a network communication program, which may be used to communicate with one or more additional devices, one or more terminal devices, and one or more network devices.
  • the processor 601 can be used to read and execute computer-readable instructions. Specifically, the processor 601 may be used to call a program stored in the memory 605, for example, a program for implementing the patch method provided by one or more embodiments of the present application on the server 60 side, and execute the instructions contained in the program.
  • server 60 shown in FIG. 18 is only an implementation manner of the present application. In actual applications, the server 60 may also include more or fewer components, which is not limited here.
  • FIG. 19 shows a schematic diagram of the structure of the electronic device 70.
  • the electronic device 70 may be the electronic device 13 in the communication system shown in FIG. 1.
  • the electronic device 70 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142 , Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193 , The display screen 194, and the subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 70.
  • the electronic device 70 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the aforementioned memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous transmitter receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may be coupled to the touch sensor 180K, charger, flash, camera module 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the electronic device 70.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera module 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the camera module 193 communicate through a CSI interface to implement the camera function of the electronic device 70.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 70.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera module 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 70, and can also be used to transfer data between the electronic device 70 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect to other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 70.
  • the electronic device 70 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 70. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 70 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 70 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 70.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 70 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the electronic device 70 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 70 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the electronic device 70 implements a display function through a GPU, a display screen 194, and an application processor.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 70 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 70 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, which is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 70 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 70 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 70 may support one or more video codecs. In this way, the electronic device 70 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 70 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 70.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program codes, and the above executable program codes include instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 70.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 70 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 70 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 70 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 70 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 70 may be provided with at least one microphone 170C. In other embodiments, the electronic device 70 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In some other embodiments, the electronic device 70 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 70.
  • the angular velocity of the electronic device 70 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyroscope sensor 180B detects the shake angle of the electronic device 70, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 70 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 70 can use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 70 in various directions (generally three axes). When the electronic device 70 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and used in applications such as horizontal and vertical screen switching, pedometers and so on.
  • the electronic device 70 can measure the distance by infrared or laser.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the electronic device 70 can use the proximity light sensor 180G to detect that the user holds the electronic device 70 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 70 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 70 is in the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 70 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • Touch sensor 180K also called “touch device”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 70, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 70 may receive key input, and generate key signal input related to user settings and function control of the electronic device 70.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 70.
  • the electronic device 70 can display the user interface for downloading patches and updating software as exemplarily shown in FIG. 2 through the display screen 194.
  • the electronic device 70 can detect touch operations in each user interface through the touch sensor 180K, such as a click operation in each user interface (such as a touch operation on an icon, a double-click operation), and for example, an upward or a double-click operation in each user interface. Swipe down, or perform circle-drawing gestures, and so on.
  • the electronic device 70 can detect the motion gesture performed by the user holding the electronic device 70, such as shaking the electronic device, through the gyroscope sensor 180B, the acceleration sensor 180E, and the like.
  • the electronic device 70 can detect non-touch gesture operations through the camera module 193 (eg, a 3D camera, a depth camera).
  • the electronic device 70 may download a patch from the server 60 through the mobile communication module 150 or the wireless communication module 160 to update the software.
  • FIG. 20 is a wireless communication system 100 provided by an embodiment of the present application, as well as a server 80 and an electronic device 90 in the wireless communication system 100.
  • the server 80 may be the server in the foregoing method embodiment
  • the electronic device 90 may be the electronic device in the foregoing method embodiment.
  • the server 80 may include functions or modules or means (means) related to the server in the foregoing method embodiments.
  • the electronic device 90 may include functions or modules or means related to the electronic device in the foregoing method embodiments.
  • the aforementioned functions or modules or units or means can be realized by software, or by hardware, or by hardware executing corresponding software.
  • the server 80 may include: a communication unit 801 and a processing unit 803. among them:
  • the processing unit 803 may be used to generate a difference file based on the original installation package and the changed installation package.
  • the difference file is a file generated based on the changed file in the original installation package, the difference file is a binary file, and the difference file includes one or more classes.
  • the communication unit 801 can be configured to send a differential file to the electronic device 90 so that the electronic device 90 loads a target class, and the target class is any one of one or more classes in the differential file.
  • the electronic device 90 may include: a communication unit 901 and a processing unit 903. among them:
  • the communication unit 901 may be used to receive the differential file sent by the server 80, and for details, please refer to the relevant description of S203, which is not repeated here.
  • the processing unit 903 may be used to load a target class, and the target class is any one of the above-mentioned one or more classes.
  • the target class is any one of the above-mentioned one or more classes.
  • FIG. 21 is a software architecture in which a patch takes effect provided by an embodiment of the present application, as well as servers and electronic devices in the software architecture.
  • the server may be the server in the foregoing method embodiment
  • the electronic device may be the electronic device in the foregoing method embodiment.
  • the server may include functions or modules or means (means) involved in executing the server in the foregoing method embodiments.
  • the electronic device may include functions or modules or means related to the electronic device in the foregoing method embodiments.
  • the aforementioned functions or modules or units or means can be realized by software, or by hardware, or by hardware executing corresponding software.
  • the server may include a patch package tool, patch package archive, and patch package release. among them:
  • the patch package tool is a script running in the background of the server to package the patch file into a compressed file.
  • the overall layout of each file in the compressed file is unique to the patch package.
  • the patch package archive is used to place the patch package to the designated archive address after the patch package tool is photographed, and is used for subsequent server acquisition of the patch package.
  • the patch package release is used by the server to deliver the patch file to the electronic device.
  • the electronic device may include patch package download, patch engine, patch package upgrade, and patch partition. among them:
  • the patch package download is used to receive the patch file issued by the server.
  • Patch package upgrade refers to the operation of downloading, verifying, and installing the patch package by the patch engine after the user has searched for the patch package on the mobile phone and confirmed that he agrees to download the patch package.
  • the patch engine encapsulates the business logic of various types of patches, including the verification of patch files, enabling the patch to take effect, and canceling abnormal patches.
  • the patch partition is an address space on the hard disk of the electronic device, and the binary patch image in the patch package can be burned into this partition.
  • An embodiment of the present application further provides a computer-readable storage medium.
  • the computer-readable storage medium includes one or more program codes, and the one or more programs include instructions.
  • the processor in the server executes the program code At this time, the server executes the patch method on the server side described in the foregoing embodiment.
  • An embodiment of the present application further provides a computer-readable storage medium.
  • the computer-readable storage medium includes one or more program codes, and the one or more programs include instructions.
  • the processor in the electronic device is executing the program
  • the electronic device executes the patch method on the electronic device side described in the foregoing embodiment.
  • An embodiment of the present application also provides a computer program product.
  • the computer program product includes computer-executable instructions, and the computer-executable instructions are stored in a computer-readable storage medium; at least one processor of the server can be read from the computer-readable storage medium. Taking the computer-executed instruction, at least one processor executes the computer-executing instruction to enable the server to implement the patch method on the server side described in the foregoing embodiment.
  • An embodiment of the present application further provides a computer program product.
  • the computer program product includes computer-executable instructions, and the computer-executable instructions are stored in a computer-readable storage medium; at least one processor of the electronic device can be read from the computer-readable storage medium. After reading the computer-executed instruction, at least one processor executes the computer-executed instruction to make the electronic device implement the patch method on the electronic device side described in the foregoing embodiment.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • a software program When implemented using a software program, it can appear in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the disclosed device and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be divided. It can be combined or integrated into another device, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate parts may or may not be physically separate.
  • the parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

一种补丁方法,该方法可以在编译器的运行环境中动态加载补丁文件,在保证运行效率的同时,提升补丁下载的速度,并减少网络资源的占用。该方法可以由服务器基于原安装包文件及变化后的新安装包文件生成动态差分文件,并将该动态差分文件静态化生成差分文件,将该差分文件发送至电子设备,使电子设备可以动态加载该差分文件,解耦类与类之间的耦合关系。

Description

补丁方法、相关装置及系统
本申请要求于2020年08月14日提交中国专利局、申请号为201910750576.2、申请名称为“补丁方法、相关装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及补丁方法、相关装置及系统。
背景技术
当前安卓安装包(Android Package,apk)的运行在虚拟机上实现。Android当前采用的是安卓运行时(Android Runtime,ART)的方式执行Java代码,该方法的缺陷在于运行效率低。
针对该缺陷,一款新的编译器应运而生,该编译器可以将apk的代码进行静态化变化,使得相关代码形态是机器码,运行的时候直接运行机器码。该方式可以极大提高代码的运行效率,但同时也牺牲了代码的动态性。
也即是说,当终端检测到软件更新时,需要下载全量补丁(即整个apk)来更新软件。这会导致下载速度慢、占用网络资源等。
发明内容
本申请实施例提供了一种补丁方法,可以在新的编译器环境下动态加载补丁文件,在保证运行效率的同时,提升补丁下载的速度,并减少网络资源的占用。
第一方面,本申请实施例提供了一种补丁方法,该方法由电子设备执行,该方法包括:电子设备接收服务器发送的差分文件,上述差分文件为基于原安装包以及变化后的安装包生成的文件,上述差分文件为根据上述原安装包中发生变化的文件生成的文件,上述差分文件为二进制文件,上述差分文件包括一个或多个类;上述电子设备加载目标类,上述目标类为上述一个或多个类中的任意一个。
本申请实施例可以在新的编译器的运行环境中,将修改的文件打包成切片动态共享对象dso文件,这个切片dso解耦了类之间的耦合关系,既可保证APP的运行速率,又可提升补丁下载的速度,减少网络资源的占用。
在一种可能的实现方式中,上述电子设备加载目标类包括:加载上述差分文件,上述差分文件中包含的一个或多个类分别包括重定位标记;创建第一类加载器,上述第一类加载器用于加载上述差分文件中包含的一个或多个类;在不确定符号链接的情况下,采用上述第一类加载器查找上述目标类;在查找到上述目标类的情况下,去除上述目标类包含的重定位标记,并更新映射表,上述映射表包含一个或多个已被加载的类及上述类对应的参数,上述类对应的参数包括以下至少一项:上述类所处的文件、加载上述类的类加载器、上述类的重定位标记。
本申请实施例可以在映射定位的过程中,使用重定位标记来控制dso文件的动态加载。
可能地,上述差分文件也可以包括重定位标记。
可能地,上述第一类加载器也可以包括重定位标记。
在一种可能的实现方式中,上述电子设备加载目标类还包括:在确定上述符号链接的情况下,采用上述电子设备原有的类加载器查找上述目标类,上述电子设备原有的类加载器为除上述第一类加载器之外的其他类加载器。
在一种可能的实现方式中,上述电子设备加载目标类之后,上述方法还包括:再次加载上述目标类。
在一种可能的实现方式中,上述再次加载上述目标类包括:检测用于再次加载上述目标类的用户操作;响应于上述用户操作,查询第一记录表中是否存在上述目标类对应的参数;若是,执行上述目标类对应的功能;若否,再次执行上述将上述电子设备加载目标类的步骤。
本申请实施例可将已加载过的类对应的参数保存在第一记录表中,在运行期再次加载目标类时先查询第一记录表中是否有该类对应的参数,若有则可直接使用该类实现响应的功能,提高APP的运行效率。
在一种可能的实现方式中,上述再次加载上述目标类包括:检测到段错误指令;基于上述段错误指令,再次执行上述电子设备加载目标类的步骤。
本申请实施例增加异常保护机制,在被动触发再次加载类后可记录触发再次加载上述目标类的触发因素信息,可避免下次再触发。
第二方面,本申请实施例提供了一种补丁方法,该方法由电子设备执行,该方法包括:电子设备接收服务器发送的第一文件,上述第一文件为基于原安装包以及变化后的安装包生成的文件,上述第一文件为上述原安装包中发生变化的文件,上述第一文件为二进制文件,上述第一文件包括一个或多个类;上述电子设备加载目标类,上述目标类为上述第一文件以及第二文件包含的所有类中的任意一个,上述第二文件为动态文件,上述第二文件包括一个或多个类。
本申请实施例可以适用于新的编译器与JVM混合运行的场景,二进制化之后修复问题的类可以以小的已经解耦的差分包下发至电子设备中,使用切片类补丁来修复解释代码,切片类补丁可以和已有的解释代码不耦合,既可保证APP的运行速率,又可提升补丁下载的速度,减少网络资源的占用。
在一种可能的实现方式中,上述电子设备加载目标类包括:采用第一编译器加载上述第一文件,查找上述第一文件包括的一个或多个类中是否存在上述目标类,若存在则加载上述目标类;采用虚拟机加载上述第二文件,查找上述第二文件包括的一个或多个类中是否存在上述目标类,若存在则加载上述目标类。其中,第一编译器即为前述新的编译器。
本申请实施例运行时对于切片类补丁中类的解析使用新的编译器解析的动态加载机制,对于切片外的类使用解释器来解析解释代码,修复电子设备侧的问题。此外,对于dex类的apk,不需要对apk源代码做插桩操作支持切片类的修复,即只下发修复的类。
在一种可能的实现方式中,上述采用第一编译器加载上述第一文件,查找上述第一文件包括的一个或多个类中是否存在上述目标类,若存在则加载上述目标类包括:加载上述 第一文件,上述第一文件中包含的一个或多个类分别包括重定位标记;创建第一类加载器,上述第一类加载器用于加载上述第一文件中包含的一个或多个类;在不确定符号链接的情况下,采用上述第一类加载器查找上述目标类;在查找到上述目标类的情况下,去除上述目标类包含的重定位标记,并更新映射表,上述映射表包含一个或多个已被加载的类及上述类对应的参数,上述类对应的参数包括以下至少一项:上述类所处的文件、上述类被加载的类加载器、上述类的重定位标记。
本申请实施例在可以在映射定位的过程中,使用重定位标记来控制dso文件的动态加载。
可能地,上述差分文件也可以包括重定位标记。
可能地,上述第一类加载器也可以包括重定位标记。
在一种可能的实现方式中,上述采用第一编译器加载上述第一文件,查找上述第一文件包括的一个或多个类中是否存在上述目标类,若存在则加载上述目标类还包括:在确定上述符号链接的情况下,采用上述第一编译器原有的类加载器查找上述目标类,上述第一编译器原有的类加载器为除上述第一类加载器之外的其他类加载器。
在一种可能的实现方式中,上述采用第一编译器加载上述第一文件,查找上述第一文件包括的一个或多个类中是否存在上述目标类,若存在则加载上述目标类之后,上述方法还包括:再次加载上述目标类。
在一种可能的实现方式中,上述再次加载上述目标类包括:检测到用于再次加载上述目标类的用户操作;响应于上述用户操作,查询第一记录表中是否存在上述目标类对应的参数;若是,执行上述目标类对应的功能;若否,再次执行上述采用第一编译器加载上述第一文件的步骤。
本申请实施例可将已加载过的类对应的参数保存在第一记录表中,在运行期再次加载目标类时先查询第一记录表中是否有该类对应的参数,若有则可直接使用该类实现响应的功能,提高APP的运行效率。
在一种可能的实现方式中,上述再次加载上述目标类包括:检测到段错误指令;基于上述段错误指令,再次执行上述采用第一编译器加载上述第一文件的步骤。
本申请实施例增加异常保护机制,在被动触发再次加载类后可记录触发再次加载上述目标类的触发因素信息,可避免下次再触发。
第三方面,本申请实施例提供了一种补丁方法,该方法由服务器执行,该方法包括:服务器基于原安装包及变化后的安装包成差分文件,上述差分文件为根据上述原安装包中发生变化的文件生成的文件,上述差分文件为二进制文件,上述差分文件包括一个或多个类;上述服务器向电子设备发送上述差分文件,以使上述电子设备加载目标类,上述目标类为上述一个或多个类中的任意一个。
本申请实施例可以使电子设备在新的编译器的运行环境中,将修改的文件打包成切片dso文件,这个切片dso解耦了类之间的耦合关系,既可保证APP的运行速率,又可提升补丁下载的速度,减少网络资源的占用。
第四方面,本申请实施例提供了一种补丁方法,该方法由服务器执行,该方法包括:服务器基于原安装包及变化后的安装包生成第一文件,上述第一文件为根据上述原安装包 中发生变化的文件生成的文件,上述第一文件为二进制文件,上述第一文件包括一个或多个类;上述服务器向电子设备发送上述第一文件,以使上述电子设备加载目标类,上述目标类为上述第一文件以及第二文件包含的所有类中的任意一个,上述第二文件为动态文件,上述第二文件包括一个或多个类。
本申请实施例可以使电子设备适用于新的编译器与JVM混合运行的场景,二进制化之后修复问题的类可以以小的已经解耦的差分包下发至电子设备中,使用切片类补丁来修复解释代码,切片类补丁可以和已有的解释代码不耦合,既可保证APP的运行速率,又可提升补丁下载的速度,减少网络资源的占用。
第五方面,本申请实施例提供了一种电子设备,上述电子设备包括:一个或多个处理器、存储器、接收器、发射器;上述存储器、上述发射器、上述接收器与上述一个或多个处理器耦合;上述存储器用于存储计算机程序代码,上述计算机程序代码包括指令,当上述一个或多个处理器执行上述指令时,上述电子设备执行本申请实施例第一方面或第一方面的任意一种实现方式提供的补丁方法。
第六方面,本申请实施例提供了一种电子设备,上述电子设备包括:一个或多个处理器、存储器、接收器、发射器;上述存储器、上述发射器、上述接收器与上述一个或多个处理器耦合;上述存储器用于存储计算机程序代码,上述计算机程序代码包括指令,当上述一个或多个处理器执行上述指令时,上述电子设备执行本申请实施例第二方面或第二方面的任意一种实现方式提供的补丁方法。
第七方面,本申请实施例提供了一种服务器,上述服务器包括:一个或多个处理器、存储器、接收器、发射器;上述存储器、上述发射器、上述接收器与上述一个或多个处理器耦合;上述存储器用于存储计算机程序代码,上述计算机程序代码包括指令,当上述一个或多个处理器执行上述指令时,上述服务器执行本申请实施例第三方面提供的补丁方法。
第八方面,本申请实施例提供了一种服务器,上述服务器包括:一个或多个处理器、存储器、接收器、发射器;上述存储器、上述发射器、上述接收器与上述一个或多个处理器耦合;上述存储器用于存储计算机程序代码,上述计算机程序代码包括指令,当上述一个或多个处理器执行上述指令时,上述服务器执行本申请实施例第四方面提供的补丁方法。
第九方面,本申请实施例提供了一种通信系统,通信系统包括:电子设备和服务器,其中,电子设备可以是第五方面描述的电子设备,服务器可以是第七方面描述的服务器。
第十方面,本申请实施例提供了一种通信系统,通信系统包括:电子设备和服务器,其中,电子设备可以是第六方面描述的电子设备,服务器可以是八方面描述的服务器。
第十一方面,本申请实施例提供了一种计算机机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第一方面或第一方面的任意一种实现方式提供的补丁方法。
第十二方面,本申请实施例提供了一种计算机机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第二方面或第二方面的任意一种实现方式提供的补丁方法。
第十三方面,本申请实施例提供了一种计算机机存储介质,包括计算机指令,当计算机指令在服务器上运行时,使得服务器执行如第三方面提供的补丁方法。
第十四方面,本申请实施例提供了一种计算机机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得服务器执行如第四方面提供的补丁方法。
第十五方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面或第一方面的任意一种实现方式提供的补丁方法。
第十六方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第二方面或第二方面的任意一种实现方式提供的补丁方法。
第十七方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第三方面提供的补丁方法。
第十八方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第四方面提供的补丁方法。
可以理解地,上述提供的第十一方面上述的计算机存储介质或者第十五方面上述的计算机程序产品均用于执行第一方面所提供的补丁方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。
可以理解地,上述提供的第十二方面上述的计算机存储介质或者第十六方面上述的计算机程序产品均用于执行第二方面所提供的补丁方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。
可以理解地,上述提供的第十三方面上述的计算机存储介质或者第十七方面上述的计算机程序产品均用于执行第三方面所提供的补丁方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。
可以理解地,上述提供的第十四方面上述的计算机存储介质或者第十八方面上述的计算机程序产品均用于执行第四方面所提供的补丁方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。
附图说明
图1为本申请涉及的通信系统的架构的示意图;
图2为电子设备侧使用补丁更新软件的用户界面的示意图;
图3为Android操作系统中补丁用于修复漏洞示意图;
图4为现有的虚拟机运行环境中的双亲委派机制示意图;
图5为本申请中的编译器的类加载的方式示意图;
图6为本申请中的编译器静态化后apk运行时动态共享对象dso在内存中的运行形态示意图;
图7为本申请实施例一提供的动态加载修复之后dso在内存中的运行形态示意图;
图8为本申请实施例一提供的生成差分的dso文件的示意图;
图9为本申请实施例一提供的补丁方法的流程示意图;
图10为本申请实施例一提供的电子设备侧加载目标类的流程示意图;
图11为JNI.findClass的具体实现流程示意图;
图12为主动寻址情况下再次加载目标类的具体实现流程示意图;
图13为被动寻址情况下再次加载目标类的具体实现流程示意图;
图14为现有的静态化前apk运行时dex在内存中运行形态示意图;
图15为本申请实施例二提供的动态加载后apk运行时dso和dex在内存中运行的形态示意图;
图16为本申请实施例二提供的差分文件的加载示意图;
图17为本申请实施例二提供的电子设备侧加载目标类的流程示意图;
图18为本申请提供的服务器的一种结构示意图;
图19为本申请提供的电子设备的一种结构示意图;
图20为本申请提供的通信系统、相关设备的另一种结构示意图;
图21为本申请涉及的补丁生效的软件架构示意图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。
本申请以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。
图1示例性示出了本申请涉及的通信系统。如图1所示,该通信系统可包括服务器11以及电子设备13,电子设备13和服务器11之间可以通过网络12(如互联网)通信。软件开发人员可以在服务器11上生成软件的补丁(patch)。例如,补丁C可通过比较新版本A和旧版本B的差异来生成。电子设备13可以通过网络12从服务器11那下载补丁C,并将补丁C和本地保存的旧版本B合并得到新版本A,最后安装新版本A,以实现软件从旧版本B升级到新版本A。
在检测到新版本时,电子设备13可提供图2示例性所示的用户界面,如用户界面21至用户界面23,以便用户了解软件更新过程。其中,用户界面21可用于向用户呈现新版本以及补丁的相关信息,如新版本的版本号(如9.0.0.17)、补丁的大小(如5.76MB)、更新日志、当前版本的版本号(如9.0.0.15)。用户界面22可用于向用户呈现补丁的下载进度。用户界面23可用于向用户呈现新版本的安装过程。
如果软件已经有多个旧版本,则软件开发人员可以对这多个旧版本分别生成补丁。电子设备可以根据本地已有的旧版本来下载相应的补丁。例如,针对新版本A,服务器11上生成有分别对应旧版本B1、B2、B3的多个补丁:补丁C1、补丁C2、补丁C3。如果电子设备13本地已有的旧版本是B1,则电子设备13可以从服务器11下载补丁C1,以从旧版本B1升级到新版本A。如果电子设备13本地已有的旧版本是B2,则电子设备13可以从服务器11下载补丁C2,以从旧版本B2升级到新版本A。
服务器11上生成的补丁可用于修复一个或多个软件漏洞,或者可用于增加一个或多个新的产品特性或功能。例如,在Android操作系统中,如图3所示,补丁C可以包括修复应用程序(application,APP)、应用框架(application framework)、内核(kernel)、硬件驱动(hardware driver)等一项或多项的漏洞修复代码。补丁C还可以包括新增产品特性或功能的实现代码。
接下来介绍现有技术中应用于Java虚拟机(Java virtual machine,JVM)运行环境中的双亲委派机制。如图4所示,双亲委派机制中,若接收到加载某个类(class)的请求,系 统会依次从应用程序类加载器、扩展类加载器及启动类加载器中查找该类是否已被加载过,若是,则无需再次加载。若否,则系统会依次采用启动类加载器、扩展类加载器、应用程序类加载器加载该类。各个类加载器加载相应目录下的类,具体对应关系如图4所示。图4中启动类加载器可以是扩展类加载器的父类加载器,扩展类加载器可以是应用程序类加载器的父类加载器。也即是说,应用程序类加载器可以是扩展类加载器的子类加载器,扩展类加载器可以是启动类加载器的子类加载器。
接下来介绍本申请中的编译器加载类的过程。以下将本申请中的编译器简称为编译器。如图5所示,编译器加载类的过程可以包括以下几个步骤:
S101:加载动态共享对象(dynamic shared object,dso)。
S102:编译器到内存中确定运行地址。
S103:loadClass()。
S104:forName()。
S105:JNI.findClass()。
具体地,dso即为格式为.dso的文件,格式为.dso的文件即为二进制格式的文件。加载dso即为将格式为.dso的二进制文件加载入内存中。
具体地,编译器到内存中确定运行地址,即确定某类的符号引用。
具体地,loadClass()用于将该类加载到编译器中。加载类即是找到该类对应的字节码文件。loadClass()后得到的类是没有经过连接的类。
具体地,forName()可以用于将该类加载到编译器中并对该类进行初始化。初始化该类即是对该类做相应的初始化动作。forName()后得到的类是已经初始化完成后的类。
具体地,在一种可能的情况下,经过S103及S104后找不到需要被加载的类,则可执行S105,即到JNI.findClass()方法里找该类。具体可以由子类加载器根据名称或位置加载.class字节码,然后使用defineClass将字节码转换为class。
可知,编译器环境下的父类加载器与子类加载器可以与图4中提到的JVM运行环境下的不同。图4中示出的父类加载器与子类加载器不应构成对本申请的限制。
接下来将分为两个使用场景对本申请提供的补丁方法进行介绍。
场景一:编译器运行的场景。
针对该场景,接下来先介绍现有技术中静态化后apk运行时dso在内存中运行的形态,再介绍本申请实施例一提供的动态加载修复后dso在内存中的运行形态。
图6示例性示出了编译器静态化后apk运行时dso在内存中的运行形态示意图。如图6所示,静态化后的文件格式可以是.dso,.dso文件为二进制文件。dso文件中可以包含一个或多个元素(element),每个元素分别对应一个类,如图6中示出的class1.dso、class2.dso、class3.dso等。
图7示例性示出了本申请实施例一提供的动态加载修复之后dso在内存中的运行形态示意图。如图7所示,动态加载修复后的dso中可以包括一个差分文件hotfix.dso以及动态加载修复之前的文件class1.dso、class2.dso、class3.dso等。
接下来介绍差分文件hotfix.dso的生成过程。差分文件hotfix.dso的生成过程可以在服务器侧实现。
如图8所示,服务器可以根据原安装包文件old.dex以及变化后的新安装包文件new.dex生成动态差分文件hotfix.dex。其中,动态差分文件hotfix.dex为原安装包文件old.dex中发生变化的文件。之后,在将该动态差分文件hotfix.dex静态化,转换成差分文件hotfix.dso,将该差分文件hotfix.dso发送至电子设备。
接下来结合图6-图8,介绍本申请实施例一提供的补丁方法。
如图9所示,补丁方法至少可以包括以下几个步骤:
S201:服务器基于第一文件及第二文件生成动态差分文件。
S202:服务器将上述动态差分文件静态化,生成差分文件。
S203:服务器将上述差分文件发送至电子设备。
S204:电子设备加载目标类。
具体地,第一文件为原安装包文件,即图8中的old.dex。第二文件为变化后的新安装包文件,即图8中的new.dex。动态差分文件即为图8中的hotfix.dex,差分文件即为图8中的hotfix.dso。S201-S203的具体过程可参考图8中的描述,此处不赘述。
具体地,S204中具体可以包括将dso文件加载到内存中、创建类加载器、加载类、初始化类、查找类等过程。
接下来详细介绍电子设备接收到服务器发送的差分文件后,如何加载目标类。
图10示例性示出了电子设备加载目标类的过程。如图10所示,加载目标类的过程至少可以包括以下几个步骤:
S301:加载服务器发送的差分文件。
具体地,服务器发送的差分文件为静态化后的二进制文件。加载服务器发送的差分文件即为将该差分文件加载到内存中。
具体地,可以对差分文件中包含的一个或多个类分别添加重定位(relocation)标记。重定位标记可以是映射表中每个类对应的映射关系数据结构中的一个变量。映射关系数据结构还可以包括其他变量,例如该类对应的文件、加载该类对应的类加载器等。
S302:创建第一类加载器。
具体地,第一类加载器可用于加载上述差分文件中包含的类。第一类加载器加载的目标即为上述差分文件在内存中保存的路径。
不限于在差分文件中包含的一个或多个类分别添加重定位标记,再具体实现中,还可以对差分文件添加重定位标记,或者对第一类加载器添加重定位标记,本申请实施例对此不作限定。
S303:loadClass()。
S304:forName()。
具体地,S303-S304可参考前述S103-S104,此处不赘述。
S305:判断是否确定符号链接。若是,执行S308,若否,执行S306。
具体地,符号链接即为符号引用,符号引用是一个字符串,包含被引用的内容的名字并且可能会包含一些其他关于这个被引用项的信息。这些信息可以唯一的识别一个类、字段、方法。
初始化后,可能存在两种结果,确定符号链接或不确定符号链接。在不确定符号链接 的情况下执行S306,在确定符号链接的情况下执行S308。
S306:JNI.findClass()。
具体地,在不确定符号链接的情况下,采用第一类加载器在该加载器对应的目录下加载目标类。
具体地,S306的具体实现步骤可见图11。如图11所示,该步骤具体可以包括:
S401:查找目标类。
具体地,可以根据该类的名称查找第一类加载器对应的目录下包含的类。
S402:设置目标类的关联性。
具体地,查找到目标类后,将该目标类与其对应的符号引用关联起来。
S403:去除重定位标记。
具体地,重定位标记可以是数据结构中的一个变量。在采用第一类加载器查找到该目标类后可去除该变量,即去掉重定位标记,表明该目标类已被加载过,下次可以直接使用该目标类,无需再次加载。
S404:更新映射表。
具体地,映射表中可以包含一个或多个已被加载的类及该类对应的参数。其中,该类对应的参数可以包括以下至少一项:该类所处的文件、加载该类的类加载器、该类的重定位标记等。
具体地,动态加载的差分文件hotfix.dso中可以有新增的类,也可以有原有的类。热补丁场景下可以分为实时生效和重启生效。在实时生效的场景下,映射表可以更新已有类的映射关系。在重启生效的场景下,重启APP后,之前的映射关系会全部消失,重新建立新的映射关系。而新下载的dso文件会插入到dexelements的最前面,即新的映射表与原来的映射表完全不同。
示例性地,电子设备加载了一个a.dso文件,所有的类解析文件都可以从该a.dso文件中获取。在某个业务场景下需要解析一个新类,该类未在a.dso中定义。此时需从服务器下载到的b.dso中定义。只有该b.dso文件被下载到才可解析该新类的代码,触发类的重定位。
示例性地,电子设备加载了a.dso文件以及b.dso文件,在某个业务场景下b.dso从element中卸载,当电子设备再次访问b.dso文件中的类时会触发新的b.dso文件的加载和重定位。
S307:再次加载上述目标类。
具体地,再次加载上述目标类的情形可以分为两种:一种是用户主动触发,另一种是系统被动触发。后面将结合图12和图13分别介绍这两种情形下的再次加载上述目标类的过程,此处暂不详述。
S308:JNI.findClass()。
具体地,在确定符号链接的情况下,采用编译器内除第一类加载器之外的其他类加载器在其对应的目录下加载目标类。具体可以依次从父类加载器到子类加载器对应的目录下加载目标类。
接下来结合图12介绍用户主动触发的情形下再次加载上述目标类的过程。
如图12所示,该过程可以包括以下几个步骤:
S501:检测到用于再次加载该目标类的用户操作。
具体地,用户操作例如可以但不限于是作用于某APP的用户界面中某个控件的触控操作。
S502:响应于该用户操作,查询哈希表中是否存在该目标类对应的参数。
具体地,若哈希表中存在该目标对对应的参数,则可确定该目标类已被加载过。若确定该类已被加载过,则可以直接调用该类,执行该类对应的功能,无需再次加载,提升运行速率。其中,哈希表也可称为第一记录表。其中,目标类对应的参数例如可以是该类所处的文件、加载该类的类加载器、该类的重定位标记等。
S503:若否,再次执行加载服务器发送的差分文件的步骤。
具体地,若确定该类未被加载过,则可再次执行加载服务器发送的差分文件的步骤,即S301。
若在上述过程中发生异常,可输出异常失败的结果。
接下来结合图13介绍系统被动触发的情形下再次加载上述目标类的过程。
如图13所示,该过程可以包括以下几个步骤:
S601:检测到段错误指令。
S602:基于该段错误指令,再次执行加载服务器发送的差分文件的步骤。
具体地,段错误指令可以是地址错误触发的指令。基于该断错误指令再次执行S301后,可将定位信息更新到重定位标记中,并记录触发再次加载上述目标类的触发因素信息,可避免下次再触发。
本申请实施例可以在编译器的运行环境中,将修改的文件打包成切片dso文件,这个切片dso解耦了类之间的耦合关系,在映射定位的过程中,使用重定位标记来控制dso文件的动态加载,既可保证APP的运行速率,又可提升补丁下载的速度,减少网络资源的占用。
场景二:编译器与JVM混合运行的场景。
针对该场景,接下来先介绍现有技术中静态化之前apk运行时dex在内存中运行的形态,再介绍本申请实施例二提供的加载在内存中的dso的运行形态。
图14示例性示出了现有技术中静态化之前apk运行时dex在内存中运行的形态示意图。如图14所示,静态化之前文件格式可以是.dex,.dex文件中可以包含一个或多个元素(element),每个元素对应一个类,如图14中示出的class1.dex、class2.dex、class3.dex等。
图15示例性示出了本申请实施例二提供的动态加载后apk运行时dso和dex在内存中运行的形态示意图。如图15所示apk运行时可以包括一个差分文件hotfix.dso以及静态化之前的文件class1.dex、class2.dex、class3.dex等。
其中,hotfix.dso的生成过程可以参考图8,此处不再赘述。
图16示例性示出了的实施例二提供的差分文件的加载示意图。如图16所示,差分文件hoxfix.dso可以由编译器加载。此外,静态化之前的文件class1.dex、class2.dex、class3.dex等可以由安卓虚拟机加载。
接下来结合实施例一及图17介绍本申请实施例二提供的电子设备侧加载目标类的流 程。
如图17所示,电子设备侧加载目标类至少可以包括以下几个步骤:
S701:判断文件是否为dso文件,若是,执行S702,若否,执行S706。
S702:编译器判定该文件为热补丁特性,不进行符号定位。
S703:编译器加载目标类。
S704:安卓虚拟机加载目标类。
具体地,编译器可对dso文件进行处理,处理过程可包括S702-S703,安卓虚拟机可以对非dso文件进行处理,处理过程可包括S704。
具体地,编译器加载目标类的过程可以参考实施例一中图10的相关描述,此处不赘述。
具体地,安卓虚拟机加载目标类的过程与现有技术一致,此处不详述。
本申请提供的方法可以适用于编译器与JVM混合运行的场景,二进制化之后修复问题的类可以以小的已经解耦的差分包下发至电子设备中,使用切片类补丁来修复解释代码,切片类补丁可以和已有的解释代码不耦合,运行时对于切片类补丁中类的解析使用编译器解析的动态加载机制,对于切片外的类使用解释器来解析解释代码,修复电子设备侧的问题。此外,对于dex类的apk,不需要对apk源代码做插桩操作支持切片类的修复,即只下发修复的类。
下面,基于相同的技术构思,结合附图对本申请实施例提供的相关装置进行介绍。
图18示出了服务器60的一种结构示意图。服务器60可以是图1所示的通信系统中的服务器11。如图18所示,服务器60了包括:一个或多个处理器601、发射器607、接收器609,以及耦合于处理器601和存储器605。这些部件可通过总线603或者其他方式连接,图18以通过总线603连接为例。其中:
发射器607可用于对处理器601输出的信号进行发射处理。例如,发射器607可以向电子设备70发送处理器601生成的补丁。关于补丁的说明,可参考前述内容,这里不再赘述。接收器609可用于服务器60接收其他设备(如电子设备70)发射的信号,并对接收到信号进行处理,输出处理后的信号到处理器601。例如,接收器609可接收电子设备70发送的补丁下载请求。在一些实施例中,发射器607和接收器609可看作一个无线调制解调器。在服务器60中,发射器607和接收器609的数量均可以是一个或者多个。
存储器605与处理器601耦合,用于存储各种软件程序和/或多组指令。具体实现中,存储器605可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器605可以存储操作系统(下述简称系统),例如uCOS、VxWorks、RTLinux等嵌入式操作系统。存储器605还可以存储网络通信程序,该网络通信程序可用于与一个或多个附加设备,一个或多个终端设备,一个或多个网络设备进行通信。
处理器601可用于读取和执行计算机可读指令。具体的,处理器601可用于调用存储于存储器605中的程序,例如本申请的一个或多个实施例提供的补丁方法在服务器60侧的实现程序,并执行该程序包含的指令。
需要说明的,图18所示的服务器60仅仅是本申请的一种实现方式,实际应用中,服务器60还可以包括更多或更少的部件,这里不作限制。
图19示出了电子设备70的一种结构示意图。电子设备70可以是图1所示的通信系统中的电子设备13。如图19所示,电子设备70可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备70的具体限定。在本申请另一些实施例中,电子设备70可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从上述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像模组193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备70的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处 理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像模组193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像模组193通过CSI接口通信,实现电子设备70的摄像功能。处理器110和显示屏194通过DSI接口通信,实现电子设备70的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像模组193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备70充电,也可以用于电子设备70与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备70的结构限定。在本申请另一些实施例中,电子设备70也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备70的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模 块140也可以设置于同一个器件中。
电子设备70的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备70中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备70上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备70上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备70的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备70可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS), 准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备70通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备70可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备70可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将上述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备70可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备70在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备70可以支持一种或多种视频编解码器。这样,电子设备70可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备70的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备70的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,上述可执行程序代码包括指令。 内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备70使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备70的各种功能应用以及数据处理。
电子设备70可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备70可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备70接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备70可以设置至少一个麦克风170C。在另一些实施例中,电子设备70可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备70还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。
陀螺仪传感器180B可以用于确定电子设备70的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备70围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备70抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备70的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。
磁传感器180D包括霍尔传感器。电子设备70可以利用磁传感器180D检测翻盖皮套的开合。
加速度传感器180E可检测电子设备70在各个方向上(一般为三轴)加速度的大小。当电子设备70静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横 竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备70可以通过红外或激光测量距离。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。电子设备70可以利用接近光传感器180G检测用户手持电子设备70贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备70可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备70是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备70可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备70的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备70可以接收按键输入,产生与电子设备70的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备70的接触和分离。
电子设备70可以通过显示屏194显示图2示例性所示的下载补丁、更新软件的用户界面。电子设备70可以通过触摸传感器180K在各个用户界面中检测触控操作,例如在各个用户界面中的点击操作(如在图标上的触摸操作、双击操作),又例如在各个用户界面中的向上或向下的滑动操作,或执行画圆圈手势的操作,等等。在一些实施例中,电子设备70可以通过陀螺仪传感器180B、加速度传感器180E等检测用户手持电子设备70执行的运动手势,例如晃动电子设备。在一些实施例中,电子设备70可以通过摄像模组193(如3D摄像头、深度摄像头)检测非触控的手势操作。
电子设备70可以通过移动通信模块150或无线通信模块160来从服务器60下载补丁,以更新软件。
参见图20,图20是本申请的一个实施例提供的无线通信系统100,以及无线通信系统100中的服务器80、电子设备90。服务器80可以是前述方法实施例中的服务器,电子设 备90可以是前述方法实施例中的电子设备。服务器80可包括执行上述方法实施例中服务器涉及的功能或模块或手段(means)。电子设备90可包括执行上述方法实施例中电子设备涉及的功能或模块或手段(means)。前述功能或模块或单元或手段(means)可以通过软件实现,或者通过硬件实现,也可通过硬件执行相应的软件实现。
如图20所示,服务器80可包括:通信单元801和处理单元803。其中:
处理单元803可用于基于原安装包及变化后的安装包生成差分文件。差分文件为根据原安装包中发生变化的文件生成的文件,差分文件为二进制文件,差分文件包括一个或多个类。
通信单元801可用于可以向电子设备90发送差分文件,以使电子设备90加载目标类,目标类为差分文件中一个或多个类中的任意一个。
如图20所示,电子设备90可包括:通信单元901和处理单元903。其中:
通信单元901可用于接收服务器80发送的差分文件,具体可参考S203的相关描述,此处不赘述。
处理单元903可用于加载目标类,目标类为上述一个或多个类中的任意一个,具体可参考S204的相关描述,此处不赘述。
参见图21,图21是本申请的一个实施例提供的补丁生效的软件架构,以及软件架构中的服务器、电子设备。服务器可以是前述方法实施例中的服务器,电子设备可以是前述方法实施例中的电子设备。服务器可包括执行上述方法实施例中服务器涉及的功能或模块或手段(means)。电子设备可包括执行上述方法实施例中电子设备涉及的功能或模块或手段(means)。前述功能或模块或单元或手段(means)可以通过软件实现,或者通过硬件实现,也可通过硬件执行相应的软件实现。
如图21所示,服务器可包括补丁拍包工具、补丁包归档、补丁包发布。其中:
补丁拍包工具为服务器后台运行的脚本,把补丁文件打包到一个压缩文件中,这个压缩文件内部各个文件的整体布局为补丁包特有。
补丁包归档用于在补丁拍包工具拍出补丁包之后将补丁包放置到指定的归档地址,用于后续服务器获取补丁包。
补丁包发布用于服务器将补丁文件下发给电子设备。
电子设备可以包括补丁包下载、补丁引擎、补丁包升级及补丁分区。其中:
补丁包下载用于接收服务器下发的补丁文件。
补丁包升级指用户在手机上搜索到补丁包后,确认同意下载补丁包后,补丁引擎进行下载、校验、安装补丁包的操作。
补丁引擎封装了各种类型补丁的业务逻辑,包括补丁文件的校验,能使补丁生效,撤销异常补丁等功能。
补丁分区为电子设备硬盘上的一块地址空间,补丁包中二进制补丁镜像可以被烧录到该分区中。
本申请的一个实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括一个或多个程序代码,该一个或多个程序包括指令,当服务器中的处理器在执行该程序代码时,该服务器执行上述实施例描述的服务器侧的补丁方法。
本申请的一个实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括一个或多个程序代码,该一个或多个程序包括指令,当电子设备中的处理器在执行该程序代码时,该电子设备执行上述实施例描述的电子设备侧的补丁方法。
本申请的一个实施例还提供一种计算机程序产品,该计算机程序产品包括计算机执行指令,该计算机执行指令存储在计算机可读存储介质中;服务器的至少一个处理器可以从计算机可读存储介质读取该计算机执行指令,至少一个处理器执行该计算机执行指令使得服务器实施执行上述实施例描述的服务器侧的补丁方法。
本申请的一个实施例还提供一种计算机程序产品,该计算机程序产品包括计算机执行指令,该计算机执行指令存储在计算机可读存储介质中;电子设备的至少一个处理器可以从计算机可读存储介质读取该计算机执行指令,至少一个处理器执行该计算机执行指令使得电子设备实施执行上述实施例描述的电子设备侧的补丁方法。
在上述实施例中,可以全部或部分的通过软件,硬件,固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式出现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。
所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘,硬盘、磁带)、光介质(例如,DVD)或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既 可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (19)

  1. 一种补丁方法,其特征在于,所述方法包括:
    电子设备接收服务器发送的差分文件,所述差分文件为基于原安装包以及变化后的安装包生成的文件,所述差分文件为根据所述原安装包中发生变化的文件生成的文件,所述差分文件为二进制文件,所述差分文件包括一个或多个类;
    所述电子设备加载目标类,所述目标类为所述一个或多个类中的任意一个。
  2. 如权利要求1所述的方法,其特征在于,所述电子设备加载目标类包括:
    加载所述差分文件,所述差分文件中包含的一个或多个类分别包括重定位标记;
    创建第一类加载器,所述第一类加载器用于加载所述差分文件中包含的一个或多个类;
    在不确定符号链接的情况下,采用所述第一类加载器查找所述目标类;
    在查找到所述目标类的情况下,去除所述目标类包含的重定位标记,并更新映射表,所述映射表包含一个或多个已被加载的类及所述类对应的参数,所述类对应的参数包括以下至少一项:所述类所处的文件、加载所述类的类加载器、所述类的重定位标记。
  3. 如权利要求2所述的方法,其特征在于,所述电子设备加载目标类还包括:
    在确定所述符号链接的情况下,采用所述电子设备原有的类加载器查找所述目标类,所述电子设备原有的类加载器为除所述第一类加载器之外的其他类加载器。
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述电子设备加载目标类之后,所述方法还包括:再次加载所述目标类。
  5. 如权利要求4所述的方法,其特征在于,所述再次加载所述目标类包括:
    检测用于再次加载所述目标类的用户操作;
    响应于所述用户操作,查询第一记录表中是否存在所述目标类对应的参数;
    若是,执行所述目标类对应的功能;
    若否,再次执行所述将所述电子设备加载目标类的步骤。
  6. 如权利要求4所述的方法,其特征在于,所述再次加载所述目标类包括:
    检测到段错误指令;
    基于所述段错误指令,再次执行所述电子设备加载目标类的步骤。
  7. 一种补丁方法,其特征在于,所述方法包括:
    电子设备接收服务器发送的第一文件,所述第一文件为基于原安装包以及变化后的安装包生成的文件,所述第一文件为所述原安装包中发生变化的文件,所述第一文件为二进制文件,所述第一文件包括一个或多个类;
    所述电子设备加载目标类,所述目标类为所述第一文件以及第二文件包含的所有类中的任意一个,所述第二文件为动态文件,所述第二文件包括一个或多个类。
  8. 如权利要求7所述的方法,其特征在于,所述电子设备加载目标类包括:
    采用第一编译器加载所述第一文件,查找所述第一文件包括的一个或多个类中是否存在所述目标类,若存在则加载所述目标类;
    采用虚拟机加载所述第二文件,查找所述第二文件包括的一个或多个类中是否存在所述目标类,若存在则加载所述目标类。
  9. 如权利要求8所述的方法,其特征在于,所述采用第一编译器加载所述第一文件,查找所述第一文件包括的一个或多个类中是否存在所述目标类,若存在则加载所述目标类包括:
    加载所述第一文件,所述第一文件中包含的一个或多个类分别包括重定位标记;
    创建第一类加载器,所述第一类加载器用于加载所述第一文件中包含的一个或多个类;
    在不确定符号链接的情况下,采用所述第一类加载器查找所述目标类;
    在查找到所述目标类的情况下,去除所述目标类包含的重定位标记,并更新映射表,所述映射表包含一个或多个已被加载的类及所述类对应的参数,所述类对应的参数包括以下至少一项:所述类所处的文件、所述类被加载的类加载器、所述类的重定位标记。
  10. 如权利要求9所述的方法,其特征在于,所述采用第一编译器加载所述第一文件,查找所述第一文件包括的一个或多个类中是否存在所述目标类,若存在则加载所述目标类还包括:在确定所述符号链接的情况下,采用所述第一编译器原有的类加载器查找所述目标类,所述第一编译器原有的类加载器为除所述第一类加载器之外的其他类加载器。
  11. 如权利要求8-10任一项所述的方法,其特征在于,所述采用第一编译器加载所述第一文件,查找所述第一文件包括的一个或多个类中是否存在所述目标类,若存在则加载所述目标类之后,所述方法还包括:再次加载所述目标类。
  12. 如权利要求11所述的方法,其特征在于,所述再次加载所述目标类包括:
    检测到用于再次加载所述目标类的用户操作;
    响应于所述用户操作,查询第一记录表中是否存在所述目标类对应的参数;
    若是,执行所述目标类对应的功能;
    若否,再次执行所述采用第一编译器加载所述第一文件的步骤。
  13. 如权利要求11所述的方法,其特征在于,所述再次加载所述目标类包括:
    检测到段错误指令;
    基于所述段错误指令,再次执行所述采用第一编译器加载所述第一文件的步骤。
  14. 一种补丁方法,其特征在于,所述方法包括:
    服务器基于原安装包及变化后的安装包成差分文件,所述差分文件为根据所述原安装包中发生变化的文件生成的文件,所述差分文件为二进制文件,所述差分文件包括一个或多个类;
    所述服务器向电子设备发送所述差分文件,以使所述电子设备加载目标类,所述目标类为所述一个或多个类中的任意一个。
  15. 一种补丁方法,其特征在于,所述方法包括:
    服务器基于原安装包及变化后的安装包生成第一文件,所述第一文件为根据所述原安装包中发生变化的文件生成的文件,所述第一文件为二进制文件,所述第一文件包括一个或多个类;
    所述服务器向电子设备发送所述第一文件,以使所述电子设备加载目标类,所述目标类为所述第一文件以及第二文件包含的所有类中的任意一个,所述第二文件为动态文件,所述第二文件包括一个或多个类。
  16. 一种电子设备,其特征在于,所述电子设备包括:一个或多个处理器、存储器、 接收器、发射器;
    所述存储器、所述发射器、所述接收器与所述一个或多个处理器耦合;所述存储器用于存储计算机程序代码,所述计算机程序代码包括指令,当所述一个或多个处理器执行所述指令时,所述电子设备执行如权利要求1-6或权利要求7-13中任意一项所述的补丁方法。
  17. 一种服务器,其特征在于,所述服务器包括:一个或多个处理器、存储器、接收器、发射器;
    所述存储器、所述发射器、所述接收器与所述一个或多个处理器耦合;所述存储器用于存储计算机程序代码,所述计算机程序代码包括指令,当所述一个或多个处理器执行所述指令时,所述服务器执行如权利要求14或15中所述的补丁方法。
  18. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-6或权利要求7-13中任意一项所述的补丁方法。
  19. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在服务器上运行时,使得所述服务器执行如权利要求14或15中所述的补丁方法。
PCT/CN2020/106814 2019-08-14 2020-08-04 补丁方法、相关装置及系统 WO2021027630A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910750576.2 2019-08-14
CN201910750576.2A CN110633090B (zh) 2019-08-14 2019-08-14 补丁方法、相关装置及系统

Publications (2)

Publication Number Publication Date
WO2021027630A1 WO2021027630A1 (zh) 2021-02-18
WO2021027630A9 true WO2021027630A9 (zh) 2021-04-08

Family

ID=68969811

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/106814 WO2021027630A1 (zh) 2019-08-14 2020-08-04 补丁方法、相关装置及系统

Country Status (2)

Country Link
CN (1) CN110633090B (zh)
WO (1) WO2021027630A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10795659B1 (en) * 2017-11-02 2020-10-06 Virtuozzo International Gmbh System and method for live patching processes in user space
CN110633090B (zh) * 2019-08-14 2022-04-12 华为技术有限公司 补丁方法、相关装置及系统
CN112181470B (zh) * 2020-09-22 2024-05-17 京东科技控股股份有限公司 一种部署补丁的方法和装置
CN113900699B (zh) * 2021-05-26 2022-09-27 荣耀终端有限公司 一种系统升级方法和电子设备
CN114443109B (zh) * 2021-07-19 2023-08-22 荣耀终端有限公司 补丁修复方法、电子设备及存储介质
CN113797553A (zh) * 2021-09-17 2021-12-17 网易(杭州)网络有限公司 分包资源下载方法及装置、存储介质、电子设备
CN116149716A (zh) * 2021-11-19 2023-05-23 华为终端有限公司 补丁方法及相关设备
CN115880730B (zh) * 2023-03-08 2023-08-04 杭州八爪鱼微电子有限公司 一种指纹采集方法、系统、指纹采集设备及可读存储介质

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070132774A1 (en) * 2005-12-01 2007-06-14 Samsung Electronics Co., Ltd. System and method for a patch minimization tool
WO2010116676A1 (ja) * 2009-03-30 2010-10-14 日本電気株式会社 サービス提供装置、サービス提供システム、サービス提供装置のデータ処理方法およびコンピュータプログラム
CN102609241B (zh) * 2012-01-19 2018-04-27 中兴通讯股份有限公司 热补丁方法及装置
CN103744709B (zh) * 2014-01-23 2017-02-15 华为技术有限公司 补丁加载方法及装置
CN107168733B (zh) * 2017-04-25 2020-07-17 北京五八信息技术有限公司 差分文件包的生成及应用程序的更新方法、装置和系统
CN109697071B (zh) * 2017-10-24 2022-02-08 腾讯科技(深圳)有限公司 安装包合成方法、装置、终端及存储介质
CN107797820B (zh) * 2017-11-13 2021-03-23 北京百度网讯科技有限公司 用于生成补丁的方法和装置
US11238013B2 (en) * 2018-06-27 2022-02-01 Intel Corporation Scalable access to shared files in a distributed system
CN109582323A (zh) * 2018-11-23 2019-04-05 网易(杭州)网络有限公司 应用安装包的增量更新方法、装置、终端及服务器
CN110109695B (zh) * 2019-04-17 2021-08-27 华为技术有限公司 补丁方法、相关装置及系统
CN112035153B (zh) * 2019-05-14 2021-08-24 腾讯科技(深圳)有限公司 应用更新方法、装置、终端及存储介质
CN110633090B (zh) * 2019-08-14 2022-04-12 华为技术有限公司 补丁方法、相关装置及系统

Also Published As

Publication number Publication date
WO2021027630A1 (zh) 2021-02-18
CN110633090A (zh) 2019-12-31
CN110633090B (zh) 2022-04-12

Similar Documents

Publication Publication Date Title
WO2021027630A9 (zh) 补丁方法、相关装置及系统
WO2021159746A1 (zh) 文件共享方法、系统及相关设备
CN110515646B (zh) 一种差分升级方法及相关设备
CN114968384B (zh) 一种功能调用方法和装置
WO2021073337A1 (zh) 安装插件的方法、装置和存储介质
CN114553814A (zh) 处理推送消息的方法和装置
CN113784331B (zh) 更新用户身份识别模块卡系统数据的方法及装置
CN116048955B (zh) 一种测试方法及电子设备
WO2022111664A1 (zh) 打补丁的方法、相关设备及系统
WO2022111529A1 (zh) 一种应用程序的调试方法及电子设备
WO2022111469A1 (zh) 一种文件共享方法、装置及电子设备
CN114443109B (zh) 补丁修复方法、电子设备及存储介质
WO2021238376A1 (zh) 功能包的加载方法、装置、服务器和电子设备
WO2022022466A1 (zh) 一种确定文件存储位置的方法、装置及终端
CN117348894A (zh) 一种软件升级方法、终端设备及系统
CN113467821A (zh) 应用程序的修复方法、装置、设备及可读存储介质
CN114816973A (zh) 调试代码的方法、装置、电子设备和可读存储介质
WO2024131823A1 (zh) 免安装应用的升级方法及电子设备
CN116048629B (zh) 系统服务切换方法及控制装置、电子设备和存储介质
CN114006969B (zh) 一种窗口启动方法和电子设备
CN114168115B (zh) 通信系统、应用下载方法及设备
WO2023179682A1 (zh) 一种设备协同方法
CN117707562A (zh) 参数更新方法和终端设备
CN116560769A (zh) 应用组件分享方法及相关设备
CN117687708A (zh) 开机方法及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20852501

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20852501

Country of ref document: EP

Kind code of ref document: A1