CN107220074B - Method and device for accessing and upgrading supporting layer software function - Google Patents

Method and device for accessing and upgrading supporting layer software function Download PDF

Info

Publication number
CN107220074B
CN107220074B CN201610162733.4A CN201610162733A CN107220074B CN 107220074 B CN107220074 B CN 107220074B CN 201610162733 A CN201610162733 A CN 201610162733A CN 107220074 B CN107220074 B CN 107220074B
Authority
CN
China
Prior art keywords
program
dynamic
upgrading
upgrade
support layer
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201610162733.4A
Other languages
Chinese (zh)
Other versions
CN107220074A (en
Inventor
钟伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Banma Zhixing Network Hongkong Co Ltd
Original Assignee
Alibaba Group Holding Ltd
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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610162733.4A priority Critical patent/CN107220074B/en
Publication of CN107220074A publication Critical patent/CN107220074A/en
Application granted granted Critical
Publication of CN107220074B publication Critical patent/CN107220074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/62Uninstallation

Landscapes

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

Abstract

The application discloses a method and a device for accessing a support layer software function, and also discloses a method and a device for upgrading the support layer software function, and a method and a device for managing a support layer dynamic upgrading program. The method for accessing the software function of the support layer comprises the following steps: receiving an access request of an application program to a support layer function interface; executing upgrade code corresponding to the functional interface; and the dynamic upgrading program containing the upgrading code is pre-injected into the supporting layer service process through a process merging mechanism, and the function realization code of the function interface is set as the upgrading code. According to the method, after the access request of the application program to the functional interface is received, the upgrade code injected by the process merging mechanism is executed, namely, the application program can still access the upgraded supporting layer software function under the condition that the traditional OTA mode is not adopted for upgrading, so that more complete functions can be provided for a user in time.

Description

Method and device for accessing and upgrading supporting layer software function
Technical Field
The application relates to a system software technology, in particular to a method and a device for accessing a supporting layer software function. The application also relates to a method and a device for upgrading the software function of the supporting layer, and a method and a device for managing the dynamic upgrading program of the supporting layer.
Background
In this way, a mobile device software developer generally needs to maintain version change history, make a full and incremental upgrade package between versions for a mobile device, and push The package to a user using The mobile device. However, since the development of the system software on the mobile device changes rapidly, after a user uses the system software for a while, the system software already releases multiple versions, which is usually difficult to match the differential packages of the latest version and the current version, and only the full package upgrade can be updated. Therefore, it becomes a more commonly adopted method to obtain the whole upgrade package for upgrading the system software.
The system software of the mobile device usually adopts a layered structure, wherein the layered structure usually comprises a support layer software for providing service for the application program, and the support layer software has a strong upgrading requirement because it bears the important responsibility of providing system service for constructing an operating environment for the application program. Taking Android or YunOS as an example of a mobile operating system, a support layer for providing services for an application is generally referred to as a framework layer (framework), and the framework layer includes a series of components required for developing the application, and each component can implement a set of functions (e.g., functions related to making a call, etc.) and provide a corresponding function interface (i.e., API) to the outside. When the application program needs to realize a certain function, the function interface provided by the framework layer can be accessed according to the requirement, and the framework layer executes the realization code of the currently installed framework layer function interface according to the received request.
Based on the above conventional access manner to the support layer function interface, in order to enable the application program to access the upgraded support layer software function, it is usually necessary to download a full upgrade package of the system software for installation. In practical applications there are the following situations:
1) the volume of the whole upgrade package is usually large, and between hundreds of megabytes and several GB bytes, the situation that the download update fails due to insufficient storage space of the mobile equipment often occurs;
2) there are great differences in the modifications of the framework layer software by different mobile device software developers, for example: the number of functional interfaces, as well as the internal implementation, may be different, so it is difficult to upgrade the support layer software functions of different product families of different or the same manufacturer with a uniform system software update version.
Therefore, due to the problems existing in the conventional OTA method, the support layer software function cannot be upgraded in time, and the application program cannot naturally access the upgraded support layer software function in time, so that the functions that can be realized by the application program are limited, and the use experience of a user is influenced.
Disclosure of Invention
The embodiment of the application provides an access method and device for supporting layer software functions, and aims to solve the problem that in an OTA (over the air) upgrading mode, an application program cannot access the upgraded supporting layer software functions in time, so that the application program is limited in function. The embodiment of the application also provides a method and a device for upgrading the software function of the supporting layer, and a method and a device for managing the dynamic upgrading program of the supporting layer.
The application provides an access method for supporting layer software functions, which comprises the following steps:
receiving an access request of an application program to a support layer function interface;
executing upgrade code corresponding to the functional interface;
and the dynamic upgrading program containing the upgrading code is pre-injected into the supporting layer service process through a process merging mechanism, and the function realization code of the function interface is set as the upgrading code.
Optionally, the method further includes:
and returning the execution result of the upgrading code to the application program.
Optionally, the support layer includes: a frame layer; the support layer functional interface comprises: functional interfaces provided by components in the framework layer.
Optionally, the dynamic upgrade program including the upgrade code is injected into the support layer service process through a process merging mechanism, including:
in the configuration file of the dynamic upgrading program, the process name of the dynamic upgrading program is specified to be consistent with the supporting layer service process;
and running the dynamic upgrading program to inject the dynamic upgrading program into the supporting layer service process.
Optionally, the function implementation code of the function interface is set as the upgrade code, and is implemented in a Hook manner.
Optionally, in the process of executing the upgrade code corresponding to the functional interface, the method further includes: and calling a function extension interface provided by a function extension program running outside the service process of the support layer.
Optionally, the call operation on the function extension interface is implemented by an interprocess communication mechanism.
Optionally, the dynamic upgrade program is an executable program generated after installing a dynamic upgrade software package, which is obtained from a server and used for upgrading a software function of the support layer, in the host system.
Optionally, in the process of executing the upgrade code corresponding to the functional interface, the method further includes: calling a function extension interface provided by a function extension program which is dynamically loaded and operated outside the service process of the support layer;
the function extension program is an executable program generated after a function extension software package is installed in a host system, and the function extension software package is acquired when the dynamic upgrade software package is acquired from the server.
Correspondingly, the present application also provides an access device for supporting layer software functions, comprising:
an access request receiving unit, configured to receive an access request of an application program to a support layer function interface;
and the upgrading code execution unit is used for executing upgrading codes corresponding to the functional interfaces, wherein a dynamic upgrading program containing the upgrading codes is pre-injected into the supporting layer service process through a process merging mechanism, and the functional implementation codes of the functional interfaces are set as the upgrading codes.
Optionally, the apparatus further comprises:
and the execution result returning unit is used for returning the execution result of the upgrading code execution unit to the application program.
Optionally, the upgrade code execution unit is specifically configured to execute an upgrade code corresponding to the functional interface, and call a functional extension interface provided by a functional extension program running outside a service process of the support layer in a process of executing the upgrade code.
Optionally, the upgrade code execution unit is specifically configured to implement invocation of the function extension interface through an interprocess communication mechanism.
In addition, the application also provides an upgrading method for the software function of the support layer, which comprises the following steps:
running a dynamic upgrading program containing an upgrading code, and injecting the dynamic upgrading program into a supporting layer service process through a process merging mechanism;
and setting the function realization code of the functional interface to be upgraded of the support layer as a corresponding upgrading code.
Optionally, the support layer includes: and a frame layer.
Optionally, the running of the dynamic upgrade program including the upgrade code is performed, and the dynamic upgrade program is injected into the service process of the support layer through a process merging mechanism, and the following method is adopted:
in the configuration file of the dynamic upgrading program, the process name of the dynamic upgrading program is specified in advance to be consistent with the supporting layer service process;
and running the dynamic upgrading program to inject the dynamic upgrading program into the supporting layer service process.
Optionally, the step of setting the function implementation code of the interface to be upgraded of the support layer as the corresponding upgrade code is implemented in a Hook manner.
Optionally, the method is triggered to be executed by the support layer service process in a system initialization stage.
Optionally, the support layer service process triggers the method to execute in the system initialization stage in the following manner:
the dynamic upgrade program registers the following requirements with the system in advance: receiving a preset message of a system initialization stage;
and the support layer service process broadcasts the preset message in a system initialization stage and triggers the method to execute according to the requirement registered in advance by the dynamic upgrading program.
Optionally, the preset message in the system initialization phase includes: a power-on complete message.
Optionally, the method further includes:
and starting a function extension program which runs outside the service process of the support layer and provides function extension service for the dynamic upgrade program.
Optionally, before triggering the execution of the method, the method includes:
sending a software package acquisition request to a server, wherein the request is to acquire a software package for upgrading the software function of the support layer;
acquiring a software package according to information provided by a server, wherein the software package at least comprises a dynamic upgrading software package;
and generating an executable program at least comprising the dynamic upgrading program by installing the acquired software package.
Optionally, in the step of obtaining the software package according to the information provided by the server, the obtained software package not only includes the dynamic upgrade software package, but also includes a function extension software package;
the executable program generated by installing the acquired installation package not only comprises the dynamic upgrading program, but also comprises a function extension program for providing function extension service for the dynamic upgrading program.
Correspondingly, this application still provides an upgrading device to supporting layer software function, includes:
the upgrade code injection unit is used for running a dynamic upgrade program containing upgrade codes and injecting the dynamic upgrade program into a supporting layer service process through a process merging mechanism;
and the upgrading code replacing unit is used for setting the function realization code of the functional interface to be upgraded of the supporting layer as a corresponding upgrading code.
Optionally, the upgrade code injection unit is specifically configured to, in a configuration file of the dynamic upgrade program, pre-specify that a process name for running the dynamic upgrade program is consistent with a support layer service process; and running the dynamic upgrading program to inject the dynamic upgrading program into the supporting layer service process.
Optionally, the upgrade code replacing unit is specifically configured to set a function implementation code of the interface with a function to be upgraded on the support layer as a corresponding upgrade code by using a Hook manner.
Optionally, the apparatus includes:
and the triggering work unit is used for triggering the upgrading code injection unit to work in the system initialization stage by the supporting layer service process.
Optionally, the triggering unit includes:
a message receiving registration subunit, configured to register the following requirements with the system in advance by the dynamic upgrade program: receiving a preset message of a system initialization stage;
and the message broadcasting subunit is used for broadcasting the preset message by the support layer service process in a system initialization stage and triggering the upgrade code injection unit to work according to the requirement registered in advance by the dynamic upgrade program.
Optionally, the apparatus further comprises:
and the function extension program starting unit is used for starting a function extension program which runs outside the service process of the support layer and provides function extension service for the dynamic upgrade program.
Optionally, the apparatus further includes an executable program generation unit; the unit includes:
the software package request subunit is used for sending a software package acquisition request to the server side to request to acquire a software package for upgrading the software function of the support layer;
the software package obtaining subunit is used for obtaining a software package according to the information provided by the server, wherein the software package obtaining subunit at least comprises a dynamic upgrading software package;
and the software package installation subunit is used for generating an executable program at least comprising the dynamic upgrading program by installing the acquired software package.
Optionally, the software package obtaining subunit is specifically configured to obtain a dynamic upgrade software package and a function extension software package according to information provided by the server;
the software package installation subunit is specifically configured to generate the dynamic upgrade program and the function extension program by installing the acquired software package.
In addition, the present application further provides a method for managing a dynamic upgrade program of a support layer, including:
judging whether a dynamic upgrading program for upgrading the software function of the supporting layer is compatible with a host system or not;
and if not, uninstalling the dynamic upgrading program.
Optionally, the determining whether the dynamic upgrade program for upgrading the software function of the support layer is compatible with the host system includes:
and judging whether the dynamic replacement operation executed by the upgrading code contained in the dynamic upgrading program returns a result of successful representation operation, and if not, judging that the dynamic upgrading program is incompatible with the host system.
Optionally, the determining whether the dynamic upgrade program for upgrading the software function of the support layer is compatible with the host system includes:
and judging whether the system restarting condition meets a preset condition due to the fact that the dynamic replacement operation is executed by using the upgrading code contained in the dynamic upgrading program according to the historical starting information of the dynamic upgrading program, and if so, judging that the dynamic upgrading program is incompatible with the host system.
Optionally, the preset conditions include: the restart times are greater than a preset threshold.
Optionally, after determining that the dynamic upgrade program is incompatible with the host system, before uninstalling the dynamic upgrade program, the method includes:
canceling the execution of the dynamic replacement operation.
Optionally, the uninstalling the dynamic upgrade program includes:
prompting a user that the dynamic upgrade program is incompatible with a host system;
and uninstalling the dynamic upgrade program according to the instruction of the user.
Optionally, the dynamic upgrade program is an executable program generated after installing a dynamic upgrade software package acquired from a server in a host system;
when the result of judging whether the dynamic upgrade program for upgrading the software function of the support layer is compatible with the host system is incompatible, the method further comprises the following steps:
collecting and generating the relevant log information of the dynamic upgrading program incompatible with the host system, and uploading the log information to the server.
Optionally, when the result of determining whether the dynamic upgrade program for upgrading the software function of the support layer is compatible with the host system is incompatible, the method further includes:
and unloading the function extension program providing the function extension service for the dynamic upgrade program.
Correspondingly, the present application further provides a device for managing a dynamic upgrade program of a support layer, including:
the compatibility judging unit is used for judging whether a dynamic upgrading program for upgrading the software function of the supporting layer is compatible with the host system;
and the dynamic upgrading program unloading unit is used for unloading the dynamic upgrading program when the output of the compatibility judging unit is incompatible.
Optionally, the compatibility determining unit is specifically configured to determine whether a result indicating that the operation is successful is returned by performing a dynamic replacement operation with an upgrade code included in the dynamic upgrade program, and if not, determine that the dynamic upgrade program is incompatible with the host system.
Optionally, the compatibility determining unit is specifically configured to determine, according to historical start information of the dynamic upgrade program, whether a condition that a system is restarted due to a dynamic replacement operation being executed by an upgrade code included in the dynamic upgrade program satisfies a preset condition, and if so, determine that the dynamic upgrade program is incompatible with the host system.
Optionally, the dynamic upgrade program uninstalling unit includes:
the uninstalling prompt subunit is used for prompting the user that the dynamic upgrade program is incompatible with the host system;
and the unloading execution subunit is used for unloading the dynamic upgrading program according to the instruction of the user.
Optionally, the apparatus further comprises:
the incompatible information uploading unit is used for collecting and generating the relevant log information of the dynamic upgrading program incompatible with the host system when the output of the compatibility judging unit is incompatible, and uploading the log information to the server; the server is a server providing a dynamic upgrade software package corresponding to the dynamic upgrade program.
Optionally, the apparatus further comprises:
and the function extension program unloading unit is used for unloading the function extension program providing the function extension service for the dynamic upgrading program when the output of the compatibility judging unit is incompatible.
Compared with the prior art, the method has the following advantages:
according to the access method for the supporting layer software function, after an access request of an application program to a supporting layer function interface is received, an upgrade code corresponding to the function interface is executed, wherein a dynamic upgrade program containing the upgrade code is injected into a supporting layer service process in advance through a process merging mechanism, and a function implementation code of the function interface is set as the upgrade code.
By adopting the method, after receiving the access request of the application program to the support layer function interface, the original implementation code of the function interface is not executed according to the conventional mode, but the upgrade code injected by using the process merging mechanism is executed, namely, under the condition that the system software is not upgraded by adopting the traditional OTA mode, the application program can still access the upgraded support layer software function, so that more perfect functions can be provided for the user in time, and the use experience of the user can be correspondingly improved.
Drawings
FIG. 1 is a flow chart of an embodiment of a method for upgrading a support layer software function of the present application;
FIG. 2 is a schematic diagram of an embodiment of an upgrade apparatus for supporting layer software functions of the present application;
FIG. 3 is a flow diagram of an embodiment of a method of accessing support layer software functionality according to the present application;
fig. 4 is a schematic processing procedure diagram of a support layer service process receiving an application access request according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an embodiment of an access device to supporting layer software functions of the present application;
FIG. 6 is a flow chart of an embodiment of a method for managing a dynamic upgrade procedure for a support layer according to the present application;
fig. 7 is a schematic diagram of an embodiment of a management apparatus for dynamically upgrading a support layer program according to the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit and scope of this application, and it is therefore not limited to the specific implementations disclosed below.
In the application, a method and a device for accessing the support layer software function, a method and a device for upgrading the support layer software function, and a method and a device for managing a support layer dynamic upgrade program are respectively provided. Details are described in the following examples one by one.
For ease of understanding, the present application provides an embodiment of a method for upgrading software functions of a support layer. Before describing the specific steps of this embodiment, a brief description will be made on the technical solution and the generation process of the dynamic upgrade program.
The core of the technical scheme is as follows: and injecting a dynamic upgrading program containing an upgrading code into the supporting layer service process through a process merging mechanism, and setting a function realization code of a corresponding function interface of the supporting layer as the upgrading code on the basis, so that a light-weight and dynamic upgrading mode of the supporting layer software function is realized, and an application program can access the upgraded supporting layer software function. Compared with the traditional OTA mode for upgrading the system software, the method can realize the dynamic loading of the upgrade code only by process combination and setting the function realization code of the corresponding function interface as the upgrade code, and realize the upgrade of the software function of the supporting layer, thereby providing a quick and light-weight method for upgrading the software function of the supporting layer under the condition of difficult implementation of the OTA.
The support layer described in this embodiment generally refers to a software layer that provides services for an application program in a system software layered architecture, and includes a set of libraries, functions, or components, and provides services for the application program by externally providing a functional interface. When the application program needs to realize a certain system function, the corresponding function interface provided by the supporting layer can be accessed. Taking the Android or YunOS as an example of the mobile operating system, the support layer providing services for the application program may be a framework layer (framework), and the support layer function interface may be a function interface provided by a component in the framework layer.
In order to upgrade the software function of the support layer, in a specific implementation, a dynamic upgrade software package may be obtained from the server, and an executable dynamic upgrade program may be generated by installation. The specific implementation can be as follows: sending a software package acquisition request to a server, wherein the request is to acquire a software package for upgrading the software function of the support layer; acquiring a dynamic upgrade software package according to information provided by a server; and generating an executable dynamic upgrading program by installing the acquired software package. The server can be a cloud.
Taking the implementation in the Android operating system as an example, the server side can generate a corresponding upgrade code for a functional interface to be upgraded of a framework layer, and make a dynamic upgrade software package, generally a software package with an apk suffix; a mobile device (for example, a smart phone) implementing the method can send a request for acquiring a software package for upgrading the framework layer software function to a server according to a certain strategy, for example, periodically, wherein the request can carry information such as a terminal type, an original software package version number and the like; after receiving the request, the server side inquires a dynamic upgrading software package which is matched with the terminal information and can be used for upgrading and installing the mobile equipment, and prompts the mobile equipment to download from a corresponding website; the mobile device downloads and installs the dynamic upgrade software package according to the information provided by the server, so as to generate an executable dynamic upgrade program, wherein the program contains upgrade codes for realizing the upgrade function of a certain or some functional interfaces of the framework layer.
Preferably, the function extension software package can be obtained from the server side, and the function extension program which provides the function extension service for the dynamic upgrading program is installed and generated. In order to implement the technical scheme, a dynamic upgrade program needs to be injected into a support layer service process, the support layer service process generally plays a role in maintaining an application program execution environment in an operating system, in order to ensure stable operation of the support layer service process, the dynamic upgrade program only comprises a minimum set of upgrade codes which need to be dynamically replaced, functions which do not need to be operated in the support layer service process are realized by a function extension program which operates outside the support layer service process, and the upgrade codes provided by the dynamic upgrade program can be used for using extension services provided by the function extension program by calling a function extension interface provided by the function extension program, so that the required functions can be realized, and the stable operation of the support layer is ensured to the maximum extent.
Based on the above consideration, the host device may obtain the function extension software package at the same time as the dynamic upgrade software package is obtained, and generate the dynamic upgrade program and the function extension program providing the function extension service for the dynamic upgrade program by installing the obtained software package.
The technical solution and the generation process of the dynamic upgrade program (and the function extension program) are explained so far. In specific implementation, for the case of first installation and generation of the dynamic upgrade program, steps 101 and 102 in the embodiments provided below may be subsequently performed, and for the case of update installation, a user may be prompted to restart the system, and the steps 101 and 102 are performed in the system initialization process, so as to implement upgrade of the software functions of the support layer. The following describes an embodiment of the method for upgrading the software function of the support layer provided in the present application in detail by taking the implementation of the method in the system initialization stage as an example.
Referring to fig. 1, which is a flowchart of an embodiment of an upgrading method for supporting layer software functions of the present application, the method includes the following steps:
step 101, running a dynamic upgrade program containing an upgrade code, and injecting the dynamic upgrade program into a support layer service process through a process merging mechanism.
In specific implementation, the method may be implemented in the process of initializing a system (hereinafter referred to as a host system) that implements the method, for example, the method may be triggered to be executed by a support layer service process in an initialization stage, so that dynamic upgrade of a support layer software function may be completed in the initialization stage of the host system, and an access request initiated by an application program to a support layer function interface may access an upgraded implementation code. The following description will be given by taking an embodiment on a mobile device using the Android system as an example.
The dynamic upgrade program can register the following requirements with the system in advance by accessing the configuration file and the like: receiving a preset message of a system initialization stage; after the mobile device is started, the Android system executes a standard starting process, a bootstrap (bootloader), a kernel and a framework layer service process are sequentially started, the framework layer service process can broadcast the preset message in an initialization stage, and the framework layer service process triggers the execution of the method and runs the dynamic upgrading program because the dynamic upgrading program registers the requirement for receiving the preset message in advance, so that the dynamic upgrading program can receive the preset message. The preset message generally refers to a message broadcasted by the framework layer service process in the system startup phase, and may be, for example, a power-on completion message or another message.
After the method is triggered to be executed, the method firstly executes the following steps: and running a dynamic upgrading program containing an upgrading code, and injecting the dynamic upgrading program into a supporting layer service process through a process merging mechanism. The process merging mechanism is a task scheduling mechanism for operating a plurality of independent programs or application components in the same operating system process according to a configuration rule. Currently, a mainstream mobile operating system can generally specify a process name of a program or an application component, so that different programs or application components can run in the same process.
For example, an Android mobile operating system may specify a process name of a program or an application component in a configuration file (usually, an Android manifest. For ease of understanding, two separate profile segments of system components are listed below:
profile fragment for system component 1:
Figure BDA0000946242060000111
profile fragment for system component 2:
Figure BDA0000946242060000112
com.android.comp1 and com.android.comp2 are two independent system components, the designated process names are the same and are both com.android.aggregate, and when the two system components are operated, the system searches the process named com.android.aggregate (if the process with the name is not created), and operates the two system components in the process.
Based on the above principle, it may be specified in the configuration file of the dynamic upgrade program that the process name of running the dynamic upgrade program is consistent with the support layer service process, so that when running the dynamic upgrade program, the dynamic upgrade program and the support layer service process may run in the same process space through a process merging mechanism, that is: and injecting a dynamic upgrading program containing upgrading codes into a supporting layer service process to prepare for dynamic replacement in the subsequent step 102.
It should be noted that, in order to avoid the misuse of the process merging mechanism, some mobile operating systems usually set some constraints for the implementation of the process merging mechanism, so in the specific implementation, in addition to specifying the same process name as the service process of the support layer in the configuration file, additional operations can be performed to meet the constraints of the mobile operating system, for example: the dynamic upgrade program is consistent with the digital signature of the support layer, and the user Identifier (ID) of the operating system appointed by the dynamic upgrade program is equal to that of the support layer.
The dynamic upgrading program containing the upgrading code is injected into the supporting layer service process through the process merging mechanism, so that preparation is made for subsequent dynamic replacement operation, the original integrity of the mobile operating system is not broken, and powerful guarantee can be provided for the safe operation of the whole system.
And 102, setting the function realization code of the functional interface to be upgraded of the support layer as a corresponding upgrading code.
After step 101 is executed, the dynamic upgrade program containing the upgrade code has been injected into the support layer service process, and in this step, the function implementation code of the corresponding function interface of the support layer is set as the corresponding upgrade code that has been injected.
The dynamic upgrade program generally includes upgrade codes of a plurality of function interfaces to be upgraded in the support layer, and the upgrade codes are implementation codes for upgrading functions implemented by corresponding function interfaces, and are generally executable codes, which may also be referred to as target codes. For a certain interface of the support layer to be upgraded, after setting the function implementation code thereof as the corresponding upgrade code in the dynamic upgrade program, when the application program initiates an access request to the function interface, the support layer will execute the upgrade code, so that the application program can access the upgraded software function of the support layer, that is: the redefinition of the software functions of the supporting layer is realized.
The function implementation code of the support layer function interface is set as an upgrade code, and two ways of code replacement or redirection may be adopted from the perspective of technical implementation. These two modes will be described below.
Code replacement, namely: and directly replacing the original implementation code of the functional interface to be upgraded with the corresponding upgrading code. For example, the code originally implementing the functional interface is a, and the corresponding upgrade code included in the dynamic upgrade program is a ', then this step may replace a with a ', and then if access to the functional interface by the application program is received, the code actually executed is a '.
(II) redirection, namely: and performing no code replacement operation, and redirecting the access of the interface with the function to be upgraded to the corresponding upgrading code. For example, a pointer value for storing a function implementation code head address of the functional interface may be modified so that the pointer points to a corresponding upgrade code in a dynamic upgrade program, so that if an access to the functional interface by an application program is received, the corresponding upgrade code is executed according to the pointing of the pointer.
In specific implementation, the redirection technology may be implemented in different manners, in this embodiment, a Hook manner is implemented, for example, in an Android system, a Hook manner based on a Java layer may be used, redirection is implemented by using characteristics of a virtual machine and a reflection mechanism of Java, and redirection is implemented by analyzing an ELF (Executable and Linkable Format) file in a Hook manner based on a Native layer (Native).
It should be noted that the operation of this step may be performed by a support layer service process, or may be completed by a dynamic upgrade program. In the second case, the dynamic upgrade program includes not only upgrade code, but also code for executing dynamic replacement function, taking as an example that the method is implemented at the system initialization stage, the support layer service process runs the dynamic upgrade program, and merges and runs the dynamic upgrade program into the support layer service process, and after receiving the preset message registered in advance by the dynamic upgrade program, the dynamic replacement operation can be executed: and searching the upgrading codes of which function interfaces are contained in the dynamic upgrading program, dynamically replacing the function interfaces one by one, and setting the function realization codes as corresponding upgrading codes.
So far, the implementation of the method for upgrading the software function of the support layer provided in this embodiment is described in detail through the foregoing steps 101-102.
It should be noted that if the upgrade code included in the dynamic upgrade program needs to access the function extension service provided by the function extension program when executed, and the generated function extension program is installed before triggering the implementation of the method, the function extension program running outside the support layer service process may also be started, for example: and starting the function extension program in a separate process different from the support layer service process.
In specific implementation, the time for starting the function extension program is flexible, and the function extension service can be provided for the dynamic upgrade program. For example: the function extension program can also register in advance that a preset message in an initialization stage needs to be received, so that the support layer service process can start the function extension program in the initialization stage; or in the case that the upgrade code contained in the dynamic upgrade program needs to access the function extension service, calling and starting the function extension program through an IPC (Inter-Process communication-Inter-Process communication mechanism); or the function extension program can be started to run automatically according to the triggering conditions such as a timer and the change of the network state.
In summary, the method for upgrading a support layer software function provided in this embodiment does not use a conventional OTA method to upgrade a support layer software function, but includes an upgrade code of a functional interface to be upgraded of a support layer in a dynamic upgrade program, and then injects the upgrade code into a support layer service process through a process merging mechanism, and realizes the upgrade of the support layer software function through dynamic replacement.
In the foregoing embodiment, a method for upgrading a support layer software function is provided, and correspondingly, an apparatus for upgrading a support layer software function is also provided in the present application. Please refer to fig. 2, which is a schematic diagram of an embodiment of an upgrading apparatus for supporting layer software functions according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The device for upgrading the software function of the support layer in the embodiment comprises: an upgrade code injection unit 201, configured to run a dynamic upgrade program including an upgrade code, and inject the dynamic upgrade program into a support layer service process through a process merging mechanism; and the upgrade code replacing unit 202 is configured to set the function implementation code of the functional interface to be upgraded in the support layer as a corresponding upgrade code.
Optionally, the upgrade code injection unit is specifically configured to, in a configuration file of the dynamic upgrade program, pre-specify that a process name for running the dynamic upgrade program is consistent with a support layer service process; and running the dynamic upgrading program to inject the dynamic upgrading program into the supporting layer service process.
Optionally, the upgrade code replacing unit is specifically configured to set a function implementation code of the interface with a function to be upgraded on the support layer as a corresponding upgrade code by using a Hook manner.
Optionally, the apparatus includes:
and the triggering work unit is used for triggering the upgrading code injection unit to work in the system initialization stage by the supporting layer service process.
Optionally, the triggering unit includes:
a message receiving registration subunit, configured to register the following requirements with the system in advance by the dynamic upgrade program: receiving a preset message of a system initialization stage;
and the message broadcasting subunit is used for broadcasting the preset message by the support layer service process in a system initialization stage and triggering the upgrade code injection unit to work according to the requirement registered in advance by the dynamic upgrade program.
Optionally, the apparatus further comprises:
and the function extension program starting unit is used for starting a function extension program which runs outside the service process of the support layer and provides function extension service for the dynamic upgrade program.
Optionally, the apparatus further includes an executable program generation unit; the unit includes:
the software package request subunit is used for sending a software package acquisition request to the server side to request to acquire a software package for upgrading the software function of the support layer;
the software package obtaining subunit is used for obtaining a software package according to the information provided by the server, wherein the software package obtaining subunit at least comprises a dynamic upgrading software package;
and the software package installation subunit is used for generating an executable program at least comprising the dynamic upgrading program by installing the acquired software package.
Optionally, the software package obtaining subunit is specifically configured to obtain a dynamic upgrade software package and a function extension software package according to information provided by the server;
the software package installation subunit is specifically configured to generate the dynamic upgrade program and the function extension program by installing the acquired software package.
In addition, the present application also provides an access method for supporting layer software functions, before implementing the method, the method for upgrading supporting layer software functions provided by the present application can be implemented in advance, so as to realize upgrading supporting layer software functions, that is: and injecting a dynamic upgrading program containing an upgrading code into the supporting layer service process through a process merging mechanism, and setting the function realization code of the corresponding function interface as the upgrading code. The dynamic upgrading program is an executable program generated after a dynamic upgrading software package which is acquired from a server and used for upgrading the software function of the support layer is installed in the host system.
After the upgrade of the support layer software function is completed, when the application program accesses the upgraded function interface of the support layer, the upgrade code corresponding to the function interface can be executed by the access method for the support layer software function provided by the application.
Please refer to fig. 3, which is a flowchart illustrating an embodiment of a method for accessing a support layer software function according to the present application, and the method is generally implemented in a support layer service process. The same parts of this embodiment as the steps of the above method embodiments are not described again, and the following description focuses on differences. The method for accessing the software function of the support layer in the embodiment comprises the following steps:
step 301, receiving an access request of an application program to a support layer functional interface.
In this embodiment, the support layer function interface refers to a support layer function interface that has been upgraded, that is: the function realization code is set as the corresponding upgrading code contained in the dynamic upgrading program. When the application program initiates an access request to the functional interface, the step may receive the access request.
Taking an Android system as an example, each component in the framework layer may provide one or more function interfaces to the outside, and when an application needs to access a function capability provided by a certain component (for example, dialing a call, obtaining an IMEI number, or the like), an access request to the corresponding function interface may be initiated, and a framework layer service process may receive the access request.
Step 302, executing the upgrade code corresponding to the functional interface.
Since the function implementation code of the function interface has been set as the corresponding upgrade code, the step executes the upgrade code corresponding to the function interface, so that the upgraded support layer software function can be provided for the application program. In a specific implementation, after the step is executed, the execution result of the upgrade code may be returned to the application program.
Preferably, in the process of executing the upgrade code corresponding to the functional interface, the method further includes: and calling a function extension interface provided by a function extension program running outside the service process of the support layer. The function extension program is an executable program generated after a function extension software package is installed in a host system, and the function extension software package is acquired when the dynamic upgrade software package is acquired from the server.
For example, the upgrade code of the functional interface implements a function of acquiring an IMEI number (international mobile equipment identity) of a mobile device, and in order to provide security, it is further required to check whether a requester has a corresponding acquisition permission, and the permission check function is implemented by a function extension program running outside a support layer service process, in this case, a call code of a permission check interface provided for the function extension program may be included in the upgrade code, so that in this step, when the upgrade code is executed, a call operation of the permission check interface may be correspondingly executed, and a permission check is performed by a corresponding function extension code inside the function extension program, and the upgrade code determines whether the IMEI number may be provided for an application program and performs corresponding processing according to a result returned by the function extension program.
For easy understanding, a specific example is given here in an illustrative manner, please refer to fig. 4, which is a schematic diagram of a processing procedure after a support layer service process receives an application access request, and in the embodiment given in fig. 4, a redirection manner is adopted in advance to set the function implementation code of the function interface 1 as a corresponding upgrade code. Wherein, operation 1 represents a supporting layer service process to receive an access request of an application program to the functional interface 1, operation 2 represents a supporting layer service process to execute an upgrade code of the functional interface 1, and operation 3 represents the upgrade code to call the functional extension interface 1 provided by the functional extension program to realize a required function.
In the above description, an example is given in which the upgrade code calls one function extension interface, and in specific implementation, if a certain function extension interface provided by the function extension program cannot meet the requirement of the upgrade code, the upgrade code may also call other multiple function extension interfaces provided by the function extension program, that is, access multiple function implementations provided by the function extension program, and may also call APIs provided by other processes or components.
In specific implementation, the calling operation of the upgrade code to the function extension interface provided by the function extension program can be realized by using an IPC mechanism. If the function extension program is not started, the function extension program can be started through IPC call, and then the required function extension interface is accessed.
By adopting the preferred embodiment of accessing the function extension interface, some complex functions or functions which cannot accurately evaluate the operation stability can be completed by the function extension program, and the function extension program runs outside the service process of the support layer, so that the support layer can not only use the service provided by the function extension program, but also ensure the stable operation of the support layer.
Now, the above steps 301 and 302 are used to describe in detail the implementation of the access method for supporting layer software functions provided in this embodiment. It can be seen from the above description that, with the above method, after receiving the access request of the application program to the support layer function interface, the original implementation code of the function interface is not executed according to the conventional manner, but the upgrade code which is injected by the process merging mechanism and is dynamically replaced is executed, that is, under the condition that the system software is not upgraded in the conventional OTA manner, the application program can still access the upgraded support layer software function, so that a more complete function can be provided for the user in time, and the use experience of the user can be correspondingly improved.
In the above embodiments, a method for accessing a support layer software function is provided, and correspondingly, an apparatus for accessing a support layer software function is also provided. Please refer to fig. 5, which is a schematic diagram of an embodiment of an access device to support layer software functions according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An access device for supporting layer software functions in this embodiment includes: an access request receiving unit 501, configured to receive an access request of an application program to a support layer functional interface; an upgrade code execution unit 502, configured to execute an upgrade code corresponding to the functional interface, where a dynamic upgrade program including the upgrade code is pre-injected into a support layer service process through a process merging mechanism, and a functional implementation code of the functional interface is set as the upgrade code.
Optionally, the apparatus further comprises:
and the execution result returning unit is used for returning the execution result of the upgrading code execution unit to the application program.
Optionally, the upgrade code execution unit is specifically configured to execute an upgrade code corresponding to the functional interface, and call a functional extension interface provided by a functional extension program running outside a service process of the support layer in a process of executing the upgrade code.
Optionally, the upgrade code execution unit is specifically configured to implement invocation of the function extension interface through an interprocess communication mechanism.
In addition, the application also provides a management method for the dynamic upgrade program of the support layer. Because the mobile device software version implementation difference is large, a dynamic upgrade program for upgrading the support layer software function may have a problem of incompatibility with a host system, and then after the dynamic upgrade program is run and a dynamic replacement operation is executed, the host system may not work normally or even may not start normally. Aiming at the problem, the management method for the dynamic upgrade program of the support layer can detect the compatibility and unload the dynamic upgrade program when the incompatibility is detected, so that a fault detection and recovery mechanism is provided for the technical scheme for the lightweight upgrade of the software function of the support layer, which is provided by the application, and the management method is a beneficial supplement to the technical scheme.
Please refer to fig. 6, which is a flowchart illustrating an embodiment of a method for managing a dynamic upgrade procedure of a support layer according to the present application. The same parts of this embodiment as the steps of the above method embodiments are not described again, and the following description focuses on differences. The management method for the dynamic upgrade program of the support layer in the embodiment comprises the following steps:
step 601, judging whether the dynamic upgrade program for upgrading the support layer software function is compatible with the host system, if so, executing step 603, otherwise, executing step 602.
The incompatibility of the dynamic upgrade program and the host system can have different expression forms, so that different modes can be adopted for judging whether the dynamic upgrade program is incompatible, and two modes are listed in the embodiment:
1) and judging whether the dynamic replacement operation executed by the upgrading code contained in the dynamic upgrading program returns a result of successful representation operation, and if not, judging that the dynamic upgrading program is incompatible with the host system.
For example: in the support layer, a functional interface corresponding to the upgrade code does not exist, or the entry parameter related to the upgrade code is not matched with the entry parameter related to the original implementation code, so that dynamic replacement cannot be performed, and at this time, a failure result is returned by the dynamic replacement operation.
2) And judging whether the system restarting condition meets a preset condition because the dynamic replacement operation is executed by using the upgrading code contained in the dynamic upgrading program according to the historical starting information of the dynamic upgrading program, and if so, judging that the dynamic upgrading program is incompatible with the host system.
During specific implementation, the starting times can be recorded in the starting process of the dynamic upgrading program, and the starting state of the dynamic upgrading program is set to be starting; if the dynamic replacement operation is successfully completed, the starting state of the dynamic upgrading program can be set as successful starting, and the relevant information of the successful starting is recorded. The historical starting information of the dynamic upgrading program recorded by the method can be used as a basis for judging whether the dynamic upgrading program is compatible with the host system.
Because the dynamic upgrade program generally runs in the initialization stage of the host system and executes the dynamic replacement operation, the compatibility may be determined in the initialization stage of the host system and before the dynamic replacement operation is not executed, and the specific implementation may be: and reading the last starting state of the dynamic upgrading program from the recorded historical starting information, and if the starting state is 'starting', indicating that the host system is restarted due to the last execution of the dynamic replacement operation. If the condition of the system restart due to the execution of the dynamic replacement operation satisfies a preset condition, it may be determined that the dynamic upgrade program is not compatible with the host system. For example: if the number of system reboots due to the execution of the dynamic replacement operation is greater than a preset threshold (e.g., 3 times), it may be determined that the dynamic upgrade program is incompatible with the host system.
In specific implementation, when the above determination is performed, the total starting times of the dynamic upgrade program and the history related information of successful starting recorded in the above history starting information may be comprehensively considered, and different preset conditions may be set.
If the judgment result is that: the dynamic upgrading program is incompatible with the host system, and the execution of dynamic replacement operation can be cancelled, so that the host system can be normally started and operated; otherwise, the dynamic replacement operation can be normally executed to realize the upgrade of the software function of the support layer.
Two ways of judging the compatibility of the dynamic upgrade program and the host system are given above, and other judging ways different from the above ways may be adopted in specific implementation. If the dynamic upgrade program is determined to be incompatible with the host system, execution proceeds to step 602.
And step 602, uninstalling the dynamic upgrade program.
Execution up to this step illustrates that the dynamic upgrade program is not compatible with the host system, in which case the dynamic upgrade program may be uninstalled. The specific implementation can be as follows: prompting the user that the dynamic upgrading program is incompatible with the host system, and unloading the dynamic upgrading program according to the instruction of the user.
If the host system is provided with the function extension program which provides the extension function service for the dynamic upgrading program, the function extension program can be uninstalled while the dynamic upgrading program is uninstalled.
In addition, in specific implementation, if the dynamic upgrade program is determined to be incompatible with the host system in step 601, the relevant log information for recording the incompatible state may be collected and generated, and the log information may be uploaded to a server that provides a dynamic upgrade software package (an installation package of the dynamic upgrade program). The log information may include: and dynamically replacing failure reasons, the starting times of a dynamic upgrading program, the context information of a failure site and the like. The server side can analyze and locate the fault reason according to the received log information, and after the fault is eliminated, a new version of dynamic upgrade software package is manufactured and provided for the mobile equipment, so that the mobile equipment can successfully upgrade the software function of the support layer.
Step 603, reserving the dynamic upgrade program.
Execution up to this step illustrates that the dynamic upgrade program is compatible with the host system, and therefore can be retained without having to perform an uninstall operation.
So far, the implementation of the management method for the dynamic upgrade layer program provided in this embodiment is described in detail through step 601-603. It can be seen from the above description that the management method provides a fault detection and recovery method for a dynamic upgrade program, and when it is detected that the dynamic upgrade program is incompatible with a host system, rollback can be performed by uninstalling the dynamic upgrade program, thereby ensuring normal operation of the host system.
In the foregoing embodiment, a method for managing a dynamic upgrade program of a support layer is provided, and correspondingly, a device for managing a dynamic upgrade program of a support layer is also provided in the present application. Please refer to fig. 7, which is a schematic diagram of an embodiment of a management apparatus for a dynamic upgrade procedure of a support layer according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The management device for dynamically upgrading a supporting layer in this embodiment includes: a compatibility determining unit 701, configured to determine whether a dynamic upgrade program for upgrading the software function of the support layer is compatible with the host system; a dynamic upgrade program uninstalling unit 702, configured to uninstall the dynamic upgrade program when the output of the compatibility determining unit is incompatible; a dynamic upgrade program retaining unit 703, configured to retain the dynamic upgrade program when the output of the compatibility determining unit is compatible.
Optionally, the compatibility determining unit is specifically configured to determine whether a result indicating that the operation is successful is returned by performing a dynamic replacement operation with an upgrade code included in the dynamic upgrade program, and if not, determine that the dynamic upgrade program is incompatible with the host system.
Optionally, the compatibility determining unit is specifically configured to determine, according to historical start information of the dynamic upgrade program, whether a condition that a system is restarted due to a dynamic replacement operation being executed by an upgrade code included in the dynamic upgrade program satisfies a preset condition, and if so, determine that the dynamic upgrade program is incompatible with the host system.
Optionally, the dynamic upgrade program uninstalling unit includes:
the uninstalling prompt subunit is used for prompting the user that the dynamic upgrade program is incompatible with the host system;
and the unloading execution subunit is used for unloading the dynamic upgrading program according to the instruction of the user.
Optionally, the apparatus further comprises:
the incompatible information uploading unit is used for collecting and generating the relevant log information of the dynamic upgrading program incompatible with the host system when the output of the compatibility judging unit is incompatible, and uploading the log information to the server; the server is a server providing a dynamic upgrade software package corresponding to the dynamic upgrade program.
Optionally, the apparatus further comprises:
and the function extension program unloading unit is used for unloading the function extension program providing the function extension service for the dynamic upgrading program when the output of the compatibility judging unit is incompatible.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
1. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
2. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (44)

1. A method for accessing support layer software functions, comprising:
receiving an access request of an application program to a support layer function interface;
executing upgrade code corresponding to the functional interface;
wherein, the dynamic upgrade program containing the upgrade code is injected into the support layer service process in advance through a process merging mechanism, and the function implementation code of the function interface is set as the upgrade code; the dynamic upgrading program is an executable program generated after a dynamic upgrading software package which is acquired from a server and used for upgrading the software function of the support layer is installed in the host system.
2. The method of claim 1, further comprising:
and returning the execution result of the upgrading code to the application program.
3. Method of accessing the supported layer software functions according to claim 1, characterized in that the supported layer comprises: a frame layer; the support layer functional interface comprises: functional interfaces provided by components in the framework layer.
4. The method for accessing the software function of the support layer according to claim 1, wherein the dynamic upgrade program containing the upgrade code is injected into the support layer service process through a process merging mechanism, comprising:
in the configuration file of the dynamic upgrading program, the process name of the dynamic upgrading program is specified to be consistent with the supporting layer service process;
and running the dynamic upgrading program to inject the dynamic upgrading program into the supporting layer service process.
5. The method for accessing the software function of the support layer according to claim 1, wherein the function implementation code of the function interface is set as the upgrade code and implemented in a Hook manner.
6. The method of claim 1, wherein in executing the upgrade code corresponding to the functional interface, further comprising: and calling a function extension interface provided by a function extension program running outside the service process of the support layer.
7. The method for accessing the software function of the support layer according to claim 6, wherein the calling operation of the function extension interface is realized by an interprocess communication mechanism.
8. The method of claim 1, wherein in executing the upgrade code corresponding to the functional interface, further comprising: calling a function extension interface provided by a function extension program which is dynamically loaded and operated outside the service process of the support layer;
the function extension program is an executable program generated after a function extension software package is installed in a host system, and the function extension software package is acquired when the dynamic upgrade software package is acquired from the server.
9. An apparatus for accessing support layer software functionality, comprising:
an access request receiving unit, configured to receive an access request of an application program to a support layer function interface;
an upgrade code execution unit, configured to execute an upgrade code corresponding to the functional interface, where a dynamic upgrade program including the upgrade code is injected into a support layer service process in advance through a process merging mechanism, and a function implementation code of the functional interface is set as the upgrade code; the dynamic upgrading program is an executable program generated after a dynamic upgrading software package which is acquired from a server and used for upgrading the software function of the support layer is installed in the host system.
10. The apparatus of claim 9, further comprising:
and the execution result returning unit is used for returning the execution result of the upgrading code execution unit to the application program.
11. The apparatus according to claim 9, wherein the upgrade code execution unit is specifically configured to execute an upgrade code corresponding to the function interface, and invoke a function extension interface provided by a function extension program running outside a support layer service process during execution of the upgrade code.
12. The apparatus according to claim 11, wherein the upgrade code execution unit is specifically configured to implement the call to the function extension interface through an interprocess communication mechanism.
13. A method for upgrading the software function of a support layer is characterized by comprising the following steps:
running a dynamic upgrading program containing an upgrading code, and injecting the dynamic upgrading program into a supporting layer service process through a process merging mechanism; the dynamic upgrading program is an executable program which is generated after a dynamic upgrading software package which is acquired from a server and used for upgrading the software function of the support layer is installed in the host system;
and setting the function realization code of the functional interface to be upgraded of the support layer as a corresponding upgrading code.
14. The method for upgrading software functions of a support layer according to claim 13, wherein the support layer comprises: and a frame layer.
15. The method for upgrading a support layer software function according to claim 13, wherein the running of the dynamic upgrade program including the upgrade code is performed by injecting the dynamic upgrade program into a support layer service process through a process merging mechanism, and the method is implemented as follows:
in the configuration file of the dynamic upgrading program, the process name of the dynamic upgrading program is specified in advance to be consistent with the supporting layer service process;
and running the dynamic upgrading program to inject the dynamic upgrading program into the supporting layer service process.
16. The method for upgrading the software functions of the support layer according to claim 13, wherein the step of setting the function implementation codes of the interfaces of the support layer to be upgraded as corresponding upgrade codes adopts Hook is implemented.
17. The method for upgrading the software functions of the support layer according to claim 13, wherein the method is triggered to be executed by the support layer service process in a system initialization stage.
18. The method for upgrading the software functions of the support layer according to claim 17, wherein the support layer service process triggers the method to execute in a system initialization stage by:
the dynamic upgrade program registers the following requirements with the system in advance: receiving a preset message of a system initialization stage;
and the support layer service process broadcasts the preset message in a system initialization stage and triggers the method to execute according to the requirement registered in advance by the dynamic upgrading program.
19. The method for upgrading the software functions of the support layer according to claim 18, wherein the preset message of the system initialization phase comprises: a power-on complete message.
20. The method for upgrading the software functions of the support layer according to claim 13, further comprising:
and starting a function extension program which runs outside the service process of the support layer and provides function extension service for the dynamic upgrade program.
21. A method for upgrading the software functionality of the support layer according to any of the claims 13-20, comprising, before triggering the execution of the method:
sending a software package acquisition request to a server, wherein the request is to acquire a software package for upgrading the software function of the support layer;
acquiring a software package according to information provided by a server, wherein the software package at least comprises a dynamic upgrading software package;
and generating an executable program at least comprising the dynamic upgrading program by installing the acquired software package.
22. The method for upgrading the software functions of the support layer according to claim 21, wherein in the step of obtaining the software package according to the information provided by the server, the obtained software package not only comprises the dynamic upgrade software package, but also comprises a function extension software package;
the executable program generated by installing the acquired installation package not only comprises the dynamic upgrading program, but also comprises a function extension program for providing function extension service for the dynamic upgrading program.
23. An apparatus for upgrading software functions of a support layer, comprising:
the upgrade code injection unit is used for running a dynamic upgrade program containing upgrade codes and injecting the dynamic upgrade program into a supporting layer service process through a process merging mechanism; the dynamic upgrading program is an executable program which is generated after a dynamic upgrading software package which is acquired from a server and used for upgrading the software function of the support layer is installed in the host system;
and the upgrading code replacing unit is used for setting the function realization code of the functional interface to be upgraded of the supporting layer as a corresponding upgrading code.
24. The device for upgrading supporting layer software functions according to claim 23, wherein the upgrade code injection unit is specifically configured to, in a configuration file of the dynamic upgrade program, pre-specify that a process name for running the dynamic upgrade program is consistent with a supporting layer service process; and running the dynamic upgrading program to inject the dynamic upgrading program into the supporting layer service process.
25. The apparatus for upgrading a software function of a support layer according to claim 23, wherein the upgrade code replacing unit is specifically configured to implement, in a Hook manner, setting a function implementation code of the interface of the support layer with the function to be upgraded as a corresponding upgrade code.
26. The apparatus for upgrading software functions of a support layer according to claim 23, comprising:
and the triggering work unit is used for triggering the upgrading code injection unit to work in the system initialization stage by the supporting layer service process.
27. The apparatus for upgrading software functions of a support layer according to claim 26, wherein the trigger operation unit comprises:
a message receiving registration subunit, configured to register the following requirements with the system in advance by the dynamic upgrade program: receiving a preset message of a system initialization stage;
and the message broadcasting subunit is used for broadcasting the preset message by the support layer service process in a system initialization stage and triggering the upgrade code injection unit to work according to the requirement registered in advance by the dynamic upgrade program.
28. The apparatus for upgrading software functions of a support layer according to claim 23, further comprising:
and the function extension program starting unit is used for starting a function extension program which runs outside the service process of the support layer and provides function extension service for the dynamic upgrade program.
29. An upgrade device for support layer software functions according to any one of claims 23 to 28, further comprising an executable program generating unit; the unit includes:
the software package request subunit is used for sending a software package acquisition request to the server side to request to acquire a software package for upgrading the software function of the support layer;
the software package obtaining subunit is used for obtaining a software package according to the information provided by the server, wherein the software package obtaining subunit at least comprises a dynamic upgrading software package;
and the software package installation subunit is used for generating an executable program at least comprising the dynamic upgrading program by installing the acquired software package.
30. The device for upgrading software functions of a support layer according to claim 29, wherein the software package obtaining subunit is specifically configured to obtain a dynamic upgrade software package and a function extension software package according to information provided by a server;
the software package installation subunit is specifically configured to generate the dynamic upgrade program and the function extension program by installing the acquired software package.
31. A method for managing a dynamic upgrade program of a support layer is characterized by comprising the following steps:
receiving an access request of an application program to a support layer function interface;
judging whether a dynamic upgrading program for upgrading the software function of the supporting layer is compatible with a host system or not;
if not, unloading the dynamic upgrading program;
if the function interface is compatible with the function interface, executing an upgrading code corresponding to the function interface; wherein the dynamic upgrade program containing the upgrade code is injected into a support layer service process in advance through a process merging mechanism, and a function implementation code of the function interface is set as the upgrade code; the dynamic upgrading program is an executable program generated after a dynamic upgrading software package which is acquired from a server and used for upgrading the software function of the support layer is installed in the host system.
32. The method for managing a support layer dynamic upgrade program according to claim 31, wherein said determining whether the dynamic upgrade program for upgrading the support layer software function is compatible with the host system comprises:
and judging whether the dynamic replacement operation executed by the upgrading code contained in the dynamic upgrading program returns a result of successful representation operation, and if not, judging that the dynamic upgrading program is incompatible with the host system.
33. The method for managing a support layer dynamic upgrade program according to claim 31, wherein said determining whether the dynamic upgrade program for upgrading the support layer software function is compatible with the host system comprises:
and judging whether the system restarting condition meets a preset condition due to the fact that the dynamic replacement operation is executed by using the upgrading code contained in the dynamic upgrading program according to the historical starting information of the dynamic upgrading program, and if so, judging that the dynamic upgrading program is incompatible with the host system.
34. The method for managing a dynamic upgrade procedure of a support layer according to claim 33, wherein the preset conditions include: the restart times are greater than a preset threshold.
35. The method for managing a support layer dynamic upgrade program according to claim 33, wherein after said determining that the dynamic upgrade program is incompatible with the host system, before uninstalling the dynamic upgrade program, the method comprises:
canceling the execution of the dynamic replacement operation.
36. The method for managing a dynamic upgrade program of a support layer according to claim 31, wherein said uninstalling said dynamic upgrade program comprises:
prompting a user that the dynamic upgrade program is incompatible with a host system;
and uninstalling the dynamic upgrade program according to the instruction of the user.
37. The method for managing a dynamic upgrade program of a support layer according to claim 31, wherein the dynamic upgrade program is an executable program generated after a dynamic upgrade software package obtained from a server is installed in a host system;
when the result of judging whether the dynamic upgrade program for upgrading the software function of the support layer is compatible with the host system is incompatible, the method further comprises the following steps:
collecting and generating the relevant log information of the dynamic upgrading program incompatible with the host system, and uploading the log information to the server.
38. The method for managing a support layer dynamic upgrade program according to claim 31, wherein when the result of determining whether the dynamic upgrade program for upgrading the support layer software function is compatible with the host system is incompatible, the method further comprises:
and unloading the function extension program providing the function extension service for the dynamic upgrade program.
39. A device for managing a dynamic upgrade procedure for a support layer, comprising:
the access request receiving unit is used for receiving an access request of an application program to the support layer functional interface;
the compatibility judging unit is used for judging whether a dynamic upgrading program for upgrading the software function of the supporting layer is compatible with the host system;
a dynamic upgrade program uninstalling unit, configured to uninstall the dynamic upgrade program when the output of the compatibility determination unit is incompatible;
an upgrade code execution unit, configured to execute an upgrade code corresponding to the functional interface when the output of the compatibility determination unit is compatible, where a dynamic upgrade program including the upgrade code is pre-injected into a support layer service process through a process merging mechanism, and a function implementation code of the functional interface is set as the upgrade code; the dynamic upgrading program is an executable program generated after a dynamic upgrading software package which is acquired from a server and used for upgrading the software function of the support layer is installed in the host system.
40. The device for managing a support layer dynamic upgrade program according to claim 39, wherein the compatibility determining unit is specifically configured to determine whether a result indicating that the operation is successful is returned by performing a dynamic replacement operation using an upgrade code included in the dynamic upgrade program, and if not, determine that the dynamic upgrade program is incompatible with the host system.
41. The device for managing a support layer dynamic upgrade program according to claim 39, wherein the compatibility determining unit is specifically configured to determine, according to historical boot information of the dynamic upgrade program, whether a condition that a system is restarted due to a dynamic replacement operation being performed by an upgrade code included in the dynamic upgrade program satisfies a preset condition, and if so, determine that the dynamic upgrade program is incompatible with a host system.
42. The apparatus for managing the dynamic upgrade program of a support layer according to claim 39, wherein the dynamic upgrade program uninstalling unit comprises:
the uninstalling prompt subunit is used for prompting the user that the dynamic upgrade program is incompatible with the host system;
and the unloading execution subunit is used for unloading the dynamic upgrading program according to the instruction of the user.
43. The apparatus for managing the dynamic upgrade procedure of a support layer according to claim 39, further comprising:
the incompatible information uploading unit is used for collecting and generating the relevant log information of the dynamic upgrading program incompatible with the host system when the output of the compatibility judging unit is incompatible, and uploading the log information to the server; the server is a server providing a dynamic upgrade software package corresponding to the dynamic upgrade program.
44. The apparatus for managing the dynamic upgrade procedure of a support layer according to claim 39, further comprising:
and the function extension program unloading unit is used for unloading the function extension program providing the function extension service for the dynamic upgrading program when the output of the compatibility judging unit is incompatible.
CN201610162733.4A 2016-03-21 2016-03-21 Method and device for accessing and upgrading supporting layer software function Active CN107220074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610162733.4A CN107220074B (en) 2016-03-21 2016-03-21 Method and device for accessing and upgrading supporting layer software function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610162733.4A CN107220074B (en) 2016-03-21 2016-03-21 Method and device for accessing and upgrading supporting layer software function

Publications (2)

Publication Number Publication Date
CN107220074A CN107220074A (en) 2017-09-29
CN107220074B true CN107220074B (en) 2020-10-20

Family

ID=59928338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610162733.4A Active CN107220074B (en) 2016-03-21 2016-03-21 Method and device for accessing and upgrading supporting layer software function

Country Status (1)

Country Link
CN (1) CN107220074B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI649694B (en) * 2017-10-30 2019-02-01 國立臺灣大學 Android dynamic framework and method thereof
CN109101271A (en) * 2018-07-27 2018-12-28 郑州云海信息技术有限公司 A kind of program extended method and relevant apparatus
CN109408197A (en) * 2018-09-29 2019-03-01 上海理想信息产业(集团)有限公司 A kind of implementation method and device of edge calculations engine
CN111124444B (en) * 2018-11-01 2023-12-19 百度在线网络技术(北京)有限公司 Method of code injection, apparatus therefor, computer program product, and storage medium
CN110007935B (en) * 2019-03-29 2022-09-16 创新先进技术有限公司 Processing method, device and equipment for program upgrading
CN110377312B (en) * 2019-07-19 2024-02-06 北京小米移动软件有限公司 Software upgrading method, device and medium
CN113050962B (en) * 2019-12-27 2024-04-26 华为技术有限公司 Mobile service upgrading method, device and terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6266681B1 (en) * 1997-04-08 2001-07-24 Network Commerce Inc. Method and system for inserting code to conditionally incorporate a user interface component in an HTML document
CN101136012A (en) * 2006-08-30 2008-03-05 中兴通讯股份有限公司 Realization method of built-in browsers page quick-speed refreshing mechanism
CN106251195A (en) * 2016-07-25 2016-12-21 四川易想电子商务有限公司 E-commerce system based on B/S structure

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8458698B2 (en) * 2010-11-18 2013-06-04 International Business Machines Corporation Improving performance in a nested virtualized environment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6266681B1 (en) * 1997-04-08 2001-07-24 Network Commerce Inc. Method and system for inserting code to conditionally incorporate a user interface component in an HTML document
CN101136012A (en) * 2006-08-30 2008-03-05 中兴通讯股份有限公司 Realization method of built-in browsers page quick-speed refreshing mechanism
CN106251195A (en) * 2016-07-25 2016-12-21 四川易想电子商务有限公司 E-commerce system based on B/S structure

Also Published As

Publication number Publication date
CN107220074A (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN107220074B (en) Method and device for accessing and upgrading supporting layer software function
US11853774B2 (en) Dynamically loaded plugin architecture
US9009663B2 (en) Cartridge-based package management
KR101793306B1 (en) Virtual application extension points
US7694165B2 (en) Automation of bare metal recoveries
US9928059B1 (en) Automated deployment of a multi-version application in a network-based computing environment
CN107506221B (en) Application program upgrading method, device and equipment
US20230393840A1 (en) File update method and apparatus, device and storage medium
US8667486B2 (en) Automatic provisioning of a software platform to a device ecosystem
WO2016183951A1 (en) System upgrade method and terminal
CN110750280B (en) Android platform-based application upgrading method and system and storage medium
CN111752635A (en) Application program running method and device, computer equipment and storage medium
WO2016082450A1 (en) Method for upgrading user terminal, and user terminal
CN116049207A (en) Application SQL script processing method and device, processor and electronic equipment
CN106293790B (en) application program upgrading method and device based on Firefox operating system
EP2652607A1 (en) Differential flash archive installation
US10552135B1 (en) Reducing a size of an application package
US20150212866A1 (en) Management system for service of multiple operating environments, and methods thereof
CN113641389A (en) Software upgrading method, device and equipment based on OpenCPU
CN112925549A (en) System application upgrading system based on android frame
KR101420026B1 (en) A method, apparatus and computer program for loading files during a boot-up process
WO2019157891A1 (en) Application installation method and application installer generating method
CN114610415B (en) Program starting method, system, storage medium and electronic equipment
CN112527371B (en) Boot loader upgrading method and device, electronic equipment and storage medium
CN108762771B (en) Plug-in unloading method and electronic terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201120

Address after: Room 603, 6 / F, Roche Plaza, 788 Cheung Sha Wan Road, Kowloon, China

Patentee after: Zebra smart travel network (Hong Kong) Limited

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right