CN108595203B - Application function execution method, mobile terminal and computer readable storage medium - Google Patents

Application function execution method, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN108595203B
CN108595203B CN201810401255.7A CN201810401255A CN108595203B CN 108595203 B CN108595203 B CN 108595203B CN 201810401255 A CN201810401255 A CN 201810401255A CN 108595203 B CN108595203 B CN 108595203B
Authority
CN
China
Prior art keywords
application
plug
function
host
loading
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
CN201810401255.7A
Other languages
Chinese (zh)
Other versions
CN108595203A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201810401255.7A priority Critical patent/CN108595203B/en
Publication of CN108595203A publication Critical patent/CN108595203A/en
Application granted granted Critical
Publication of CN108595203B publication Critical patent/CN108595203B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses an application function execution method, a mobile terminal and a computer readable storage medium, wherein the method comprises the following steps: acquiring a request for executing a preset function, which is sent to a host application; loading a plug-in application for executing the function through the host application; the functions are performed by the plug-in application. According to the technical scheme of the invention, when the host application receives the request of a user for executing the function, the function is not executed by the host application, and after the host application loads the plug-in application with the function, the function is executed by the plug-in application, and as the host application does not realize the function and the plug-in application realizes the function, when the function is required to be updated, only development, packaging, testing and release of the plug-in application are required, and the host application and other plug-in applications do not need to be developed, packaged, tested and released, so that the visible workload is greatly reduced, the possibility of occurrence of problems is greatly reduced, and the updating of the application function is facilitated to be efficiently completed.

Description

Application function execution method, mobile terminal and computer readable storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to an application function execution method, a mobile terminal, and a computer readable storage medium.
Background
In the field of mobile internet, with the continuous addition of new functions of application, business logic is gradually complex, all modules of the application must be synchronously developed each time a new version is released, and the application and test are repackaged and then released in various large application markets. The development workload of all the modules is large, the time consumption is long, the possibility of problems is high, the efficiency of application update versions is seriously affected, and the method is not suitable for the mobile internet industry of rapid iteration.
Therefore, a new technical solution is needed to efficiently update the functions of the application.
Disclosure of Invention
The main object of the present invention is to propose an application function execution method, a mobile terminal and a computer readable storage medium, aiming at efficiently updating the functions of an application.
In order to achieve the above object, the present invention provides an application function execution method, including: acquiring a request for executing a preset function, which is sent to a host application; loading, by the host application, a plug-in application for performing the function; and executing the functions through the plug-in application.
In order to achieve the above object, the present invention also provides a mobile terminal, which includes a processor, a memory, and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory; the processor is configured to execute an application function execution program stored in the memory, so as to implement the following steps: acquiring a request for executing a preset function, which is sent to a host application; loading, by the host application, a plug-in application for performing the function; and executing the functions through the plug-in application.
To achieve the above object, the present invention also provides a computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the aforementioned application function execution method.
According to the above technical solutions, the application function execution method, the mobile terminal and the computer readable storage medium of the present invention have at least the following advantages:
According to the technical scheme of the invention, when the host application receives the request of a user for executing the function, the function is not executed by the host application, and after the host application loads the plug-in application with the function, the function is executed by the plug-in application, and as the host application does not realize the function and the plug-in application realizes the function, when the function is required to be updated, only development, packaging, testing and release of the plug-in application are required, and the host application and other plug-in applications do not need to be developed, packaged, tested and released, so that the visible workload is greatly reduced, the possibility of occurrence of problems is greatly reduced, and the updating of the application function is facilitated to be efficiently completed.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention;
Fig. 2 is a schematic diagram of a wireless communication system of the mobile terminal shown in fig. 1;
FIG. 3 is a flow chart of an application function execution method according to one embodiment of the invention;
FIG. 4 is a flow chart of an application function execution method according to one embodiment of the invention;
FIG. 5 is a schematic diagram of an application function execution method according to one embodiment of the invention;
FIG. 6 is a flow chart of an application function execution method according to one embodiment of the invention;
FIG. 7 is a schematic diagram of an application function execution method according to one embodiment of the invention;
FIG. 8 is a schematic diagram of an application function execution method according to one embodiment of the invention;
fig. 9 is a block diagram of a mobile terminal according to one embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "part" or "unit" for representing elements are used only for facilitating the description of the present invention, and have no particular meaning in themselves. Thus, "module," "component," or "unit" may be used in combination.
The terminal may be implemented in various forms. For example, the terminals described in the present invention may include mobile terminals such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Personal digital assistant (Personal DIGITAL ASSISTANT, PDA), a Portable media player (Portable MEDIA PLAYER, PMP), a navigation device, a wearable device, a smart bracelet, a pedometer, and the like, as well as fixed terminals such as a digital TV, a desktop computer, and the like.
The following description will be given taking a mobile terminal as an example, and those skilled in the art will understand that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for a moving purpose.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal structure shown in fig. 1 is not limiting of the mobile terminal and that the mobile terminal may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile terminal in detail with reference to fig. 1:
The radio frequency unit 101 may be used for receiving and transmitting signals during the information receiving or communication process, specifically, after receiving downlink information of the base station, processing the downlink information by the processor 110; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System ofMobile communication, global System for Mobile communications), GPRS (GENERAL PACKET radio service), CDMA2000 (Code Division Multiple Access, code division multiple Access 2000), WCDMA (Wideband Code Division Multiple Access ), TD-SCDMA (time division-Synchronous Code Division Multiple Access, time division synchronous code division multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency division Duplex Long term evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution, time division Duplex Long term evolution), etc.
WiFi belongs to a short-distance wireless transmission technology, and a mobile terminal can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 102, so that wireless broadband Internet access is provided for the user. Although fig. 1 shows a WiFi module 102, it is understood that it does not belong to the necessary constitution of a mobile terminal, and can be omitted entirely as required within a range that does not change the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the mobile terminal 100. The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive an audio or video signal. The A/V input unit 104 may include A graphics processor (Graphics Processing Unit, GPU) 1041 and A microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g. A camera) in A video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting the audio signal.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1061 and/or the backlight when the mobile terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; as for other sensors such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured in the mobile phone, the detailed description thereof will be omitted.
The display unit 106 is used to display information input by a user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a Liquid crystal display (Liquid CRYSTAL DISPLAY, LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the mobile terminal. In particular, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1071 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 110, and can receive and execute commands sent from the processor 110. Further, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc., as specifically not limited herein.
Further, the touch panel 1071 may overlay the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or thereabout, the touch panel 1071 is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components for implementing the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 may be integrated with the display panel 1061 to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external device can be connected with the mobile terminal 100. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power source 111 (e.g., a battery) for supplying power to the respective components, and preferably, the power source 111 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based will be described below.
Referring to fig. 2, fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention, where the communication network system is an LTE system of a general mobile communication technology, and the LTE system includes a UE (user equipment) 201, an e-UTRAN (Evolved UMTS Terrestrial Radio Access Network ) 202, an epc (Evolved Packet Core, evolved packet core) 203, and an IP service 204 of an operator that are sequentially connected in communication.
Specifically, the UE201 may be the terminal 100 described above, and will not be described herein.
The E-UTRAN202 includes eNodeB2021 and other eNodeB2022, etc. The eNodeB2021 may be connected with other eNodeB2022 by a backhaul (e.g., an X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide access from the UE201 to the EPC 203.
EPC203 may include MME (mobility MANAGEMENT ENTITY ) 2031, hss (Home Subscriber Server, home subscriber server) 2032, other mmes 2033, SGW (SERVING GATE WAY ) 2034, pgw (PDN GATE WAY, packet data network gateway) 2035, PCRF (policy AND CHARGING rules function) 2036, and so on. The MME2031 is a control node that handles signaling between the UE201 and EPC203, providing bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location registers (not shown) and to hold user specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034 and PGW2035 may provide IP address allocation and other functions for UE201, PCRF2036 is a policy and charging control policy decision point for traffic data flows and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem ), or other IP services, etc.
Although the LTE system is described above as an example, it should be understood by those skilled in the art that the present invention is not limited to LTE systems, but may be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and the communication network system, various embodiments of the method of the present invention are provided.
It should be noted that, the embodiments of the present invention are applicable to all mobile platform systems, including but not limited to Android, IOS, and other platforms, and the technical solution of the present invention is described based on an Android platform in the following embodiments, but not limited to an Android platform.
As shown in fig. 3, in one embodiment of the present invention, there is provided an application function execution method, including:
in step S310, a request for executing a preset function is obtained, which is sent to the host application.
In the present embodiment, the type of the preset function is not limited; in an embodiment, when a user needs to use a preset function, a request for executing the function is issued to a host application through an interaction with the mobile terminal.
In step S320, a plug-in application for executing a function is loaded through a host application.
In this embodiment, the host application does not directly perform the function, but loads a plug-in application dedicated to performing the function.
Step S330, the function is executed by the plug-in application.
According to the technical scheme of the embodiment, when the host application receives the request of the user for executing the function, the function is not executed by the host application, and after the host application loads the plug-in application with the function, the function is executed by the plug-in application, and as the host application does not realize the function and the plug-in application realizes the function, when the function needs to be updated, only development, packaging, testing and release of the plug-in application are required, and the host application and other plug-in applications do not need to be developed, packaged, tested and released, so that the visible workload is greatly reduced, the possibility of occurrence of problems is greatly reduced, and the updating of the application function is favorable for being efficiently completed.
As shown in fig. 4, in one embodiment of the present invention, there is provided an application function execution method, including:
in step S410, a request for executing a preset function is obtained, which is sent to the host application.
Step S420, loading the plug-in application through a library on which the host application depends based on the preset plug-in application.
In this embodiment, libraries required for loading the plug-in application are preset for the host application to normally load the plug-in application and normally execute the function.
In step S430, the function is executed by the plug-in application.
In this embodiment, the application structure installed in the mobile terminal system is divided into 3 major parts as shown in fig. 5: local host application APK (AndroidPackage, android platform application installation package), plug-in SDK, plug-in APK.
The local Host (represented by Host) applies APK, which is responsible for communication with a server, managing the plugin APK, dynamically loading the plugin APK and the like;
plugin APK: independent APP, generally realizing relatively independent and simple small functions;
plug-in SDK (Software Development Kit, a software development kit): the local host application APK dynamically loads the library on which the plugin APK depends.
According to the technical scheme of the embodiment, when the host application APK is started, whether the plugin APK exists or not is inquired from the server, if so, downloading is carried out, meanwhile, the validity of the plugin APK needs to be ensured, the plugin APK is ensured not to be tampered or forged, and when the plugin APK passes through security detection, the plug-in dynamic loading technology is started to extend new functions. The specific flow is as follows:
1. the host application APK reports the App version information and the plugin APK version information of the host application APK and requests the plugin APK from the server;
2. The host application APK downloads the plugin APK and verifies the validity of the plugin APK;
3. the host application APK uses a plug-in dynamic loading technology to expand the APP function;
4. The host application APK reports the status of whether the function expansion was successful or not.
Therefore, in the technical scheme of the embodiment, when the application function needs to be updated, only the new plugin APK needs to be downloaded, and the host application APK does not need to be updated, which means that only the plugin APK needs to be developed, packaged, tested and released, thereby greatly improving the efficiency of the updating function.
As shown in fig. 6, in one embodiment of the present invention, there is provided an application function execution method, including:
In step S610, a request for executing a preset function is obtained, which is sent to the host application.
Step S620, obtaining the class file of the plug-in application according to the path of the plug-in application, and loading the class file through a loading tool shared by the preset host application and the plug-in application so as to run the plug-in application.
In this embodiment, to implement dynamic loading of the plugin APK, the problem of class loading and resource loading needs to be solved. There are two ways to implement class loading, and a separate download tool is constructed for each plug-in or the plug-in and the Host multiplex the same load tool, but if a separate load tool is used, a plurality of underlying classes of hook (a computer technology) are needed, which may affect system stability.
In this embodiment, the technology of multiplexing the loading tool is adopted, and compatibility problems can not exist only by ensuring that the plugin and host use the JAR package (Java archive file, code file of Android platform) with the same version. Specifically, when loading an Activity (an Activity is a component responsible for interacting with a user), there is an important class: dexPathList.java, this class stores a number of elements, each of which stores the class file of the current plug-in. When the DexClassLoader (a loading tool for multiplexing host and plug in APK in the embodiment) is loaded, each Element is traversed, and a class file (class file, namely an application code file) in the Element is loaded once. Loading the code of the plug-in by the DexClassLoader requires a path into the plug-in apk. The Element object is built by specifying paths for plug in APK, as shown in fig. 7. The elements of the plug-in are inserted into the DexClassLoader of the Host by Hook technology, as shown in FIG. 8, loading multiple plug-in plug-ins based on multiple elements. Through Hook, dexClasssLoader shared with the Host is constructed for the plug-in, compatibility problems can not exist only by ensuring that the plug-in and the Host use JAR package with the same version, and hot loading of codes can be completed.
Step S630, obtaining the resources on which the plug-in application performs function dependence according to the path of the plug-in application.
In this embodiment, to obtain a Resource file of a plug-in, a Resource object of a plug-in must be obtained, and an assembly manager.java (Android platform file) includes a method ADDASSETPATH (Android platform technology), and an APK path is used as a parameter to be input to obtain a Resource of the plug-in, so that the problem of Resource loading of each plug-in APK is solved.
Step S640, the unique number is allocated to the resource according to the information of the plug-in application.
In this embodiment, since there are resources in the plug-in and resources in the Host, each resource will be dynamically allocated with a resource ID in the format: 0xPPTTNNNN. This causes a conflict between the plug-in resource and host, so in this embodiment, the resource is segmented as follows, avoiding this problem.
PP is the ID of the current plug in APK or host, the ID distribution is from 0x10 to 0x7e, the resource of the host layer is still 0x7f, and the default value is kept.
TT: resource types (different layout, font, style, etc.).
NNNN, the actual number of resources.
Step S650, obtaining the resources according to the unique number for compiling to realize the function.
According to the technical scheme of the embodiment, the plug-in upgrading method for dynamic replacement and resource transformation is used, the function is suitable for collaborative development of large team functions, when a new function is expanded, APP is released without all development of each team, only the APK of the plug-in is dynamically loaded by a host application after the development of the APK of the plug-in is completed by each team, and the technical scheme of the embodiment meets the requirement of rapidly expanding the APP function without upgrading the APP and has practical value.
As shown in fig. 9, in one embodiment of the present invention, there is provided a mobile terminal, wherein the mobile terminal includes a processor 910, a memory 920, and a communication bus 930; the communication bus 930 is used to facilitate connected communication between the processor 910 and the memory 920; the processor 910 is configured to execute an application function execution program stored in the memory 920 to implement the following steps:
a request to execute a preset function is obtained that is sent to a host application.
In the present embodiment, the type of the preset function is not limited; in an embodiment, when a user needs to use a preset function, a request for executing the function is issued to a host application through an interaction with the mobile terminal.
The plug-in application for executing the function is loaded by the host application.
In this embodiment, the host application does not directly perform the function, but loads a plug-in application dedicated to performing the function.
The functions are performed by the plug-in application.
According to the technical scheme of the embodiment, when the host application receives the request of the user for executing the function, the function is not executed by the host application, and after the host application loads the plug-in application with the function, the function is executed by the plug-in application, and as the host application does not realize the function and the plug-in application realizes the function, when the function needs to be updated, only development, packaging, testing and release of the plug-in application are required, and the host application and other plug-in applications do not need to be developed, packaged, tested and released, so that the visible workload is greatly reduced, the possibility of occurrence of problems is greatly reduced, and the updating of the application function is favorable for being efficiently completed.
As shown in fig. 9, in one embodiment of the present invention, there is provided a mobile terminal, wherein the mobile terminal includes a processor 910, a memory 920, and a communication bus 930; the communication bus 930 is used to facilitate connected communication between the processor 910 and the memory 920; the processor 910 is configured to execute an application function execution program stored in the memory 920 to implement the following steps:
a request to execute a preset function is obtained that is sent to a host application.
And loading the plug-in application through a library on which the host application depends based on the preset plug-in application.
In this embodiment, libraries required for loading the plug-in application are preset for the host application to normally load the plug-in application and normally execute the function.
The functions are performed by the plug-in application.
In this embodiment, the application structure installed in the mobile terminal system is divided into 3 major parts as shown in fig. 5: local host application APK (AndroidPackage, android platform application installation package), plug-in SDK, plug-in APK.
The local Host (represented by Host) applies APK, which is responsible for communication with a server, managing the plugin APK, dynamically loading the plugin APK and the like;
plugin APK: independent APP, generally realizing relatively independent and simple small functions;
plug-in SDK (Software Development Kit, a software development kit): the local host application APK dynamically loads the library on which the plugin APK depends.
According to the technical scheme of the embodiment, when the host application APK is started, whether the plugin APK exists or not is inquired from the server, if so, downloading is carried out, meanwhile, the validity of the plugin APK needs to be ensured, the plugin APK is ensured not to be tampered or forged, and when the plugin APK passes through security detection, the plug-in dynamic loading technology is started to extend new functions. The specific flow is as follows:
1. the host application APK reports the App version information and the plugin APK version information of the host application APK and requests the plugin APK from the server;
2. The host application APK downloads the plugin APK and verifies the validity of the plugin APK;
3. the host application APK uses a plug-in dynamic loading technology to expand the APP function;
4. The host application APK reports the status of whether the function expansion was successful or not.
Therefore, in the technical scheme of the embodiment, when the application function needs to be updated, only the new plugin APK needs to be downloaded, and the host application APK does not need to be updated, which means that only the plugin APK needs to be developed, packaged, tested and released, thereby greatly improving the efficiency of the updating function.
As shown in fig. 9, in one embodiment of the present invention, there is provided a mobile terminal, wherein the mobile terminal includes a processor 910, a memory 920, and a communication bus 930; the communication bus 930 is used to facilitate connected communication between the processor 910 and the memory 920; the processor 910 is configured to execute an application function execution program stored in the memory 920 to implement the following steps:
a request to execute a preset function is obtained that is sent to a host application.
And obtaining class files of the plug-in application according to the path of the plug-in application, and loading the class files through a loading tool shared by the preset host application and the plug-in application so as to run the plug-in application.
In this embodiment, to implement dynamic loading of the plugin APK, the problem of class loading and resource loading needs to be solved. There are two ways to implement class loading, and a separate download tool is constructed for each plug-in or the plug-in and the Host multiplex the same load tool, but if a separate load tool is used, a plurality of underlying classes of hook (a computer technology) are needed, which may affect system stability.
In this embodiment, the technology of multiplexing the loading tool is adopted, and compatibility problems can not exist only by ensuring that the plugin and host use the JAR package (Java archive file, code file of Android platform) with the same version. Specifically, when loading an Activity (an Activity is a component responsible for interacting with a user), there is an important class: dexPathList.java, this class stores a number of elements, each of which stores the class file of the current plug-in. When the DexClassLoader (a loading tool for multiplexing host and plug in APK in the embodiment) is loaded, each Element is traversed, and a class file (class file, namely an application code file) in the Element is loaded once. Loading the code of the plug-in by the DexClassLoader requires a path into the plug-in apk. The Element object is built by specifying plug in APK paths as shown in fig. 7. The elements of the plug-in are inserted into the DexClassLoader of the Host by Hook technology, as shown in FIG. 8, loading multiple plug-in plug-ins based on multiple elements. Through Hook, dexClasssLoader shared with the Host is constructed for the plug-in, compatibility problems can not exist only by ensuring that the plug-in and the Host use JAR package with the same version, and hot loading of codes can be completed.
And acquiring the resources on which the execution function of the plug-in application depends according to the path of the plug-in application.
In this embodiment, to obtain a Resource file of a plug-in, a Resource object of a plug-in must be obtained, and an assembly manager.java (Android platform file) includes a method ADDASSETPATH (Android platform technology), and an APK path is used as a parameter to be input to obtain a Resource of the plug-in, so that the problem of Resource loading of each plug-in APK is solved.
And allocating a unique number for the resource according to the information of the plug-in application.
In this embodiment, since there are resources in the plug-in and resources in the Host, each resource will be dynamically allocated with a resource ID in the format: 0xPPTTNNNN. This causes a conflict between the plug-in resource and host, so in this embodiment, the resource is segmented as follows, avoiding this problem.
PP is the ID of the current plug in APK or host, the ID distribution is from 0x10 to 0x7e, the resource of the host layer is still 0x7f, and the default value is kept.
TT: resource types (different layout, font, style, etc.).
NNNN, the actual number of resources.
And acquiring resources according to the unique numbers for compiling so as to realize functions.
According to the technical scheme of the embodiment, the plug-in upgrading method for dynamic replacement and resource transformation is used, the function is suitable for collaborative development of large team functions, when a new function is expanded, APP is released without all development of each team, only the APK of the plug-in is dynamically loaded by a host application after the development of the APK of the plug-in is completed by each team, and the technical scheme of the embodiment meets the requirement of rapidly expanding the APP function without upgrading the APP and has practical value.
In one embodiment of the present invention, there is also provided a computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the following application function execution method:
a request to execute a preset function is obtained that is sent to a host application.
In the present embodiment, the type of the preset function is not limited; in an embodiment, when a user needs to use a preset function, a request for executing the function is issued to a host application through an interaction with the mobile terminal.
The plug-in application for executing the function is loaded by the host application.
In this embodiment, the host application does not directly perform the function, but loads a plug-in application dedicated to performing the function.
The functions are performed by the plug-in application.
According to the technical scheme of the embodiment, the plug-in upgrading method for dynamic replacement and resource transformation can realize decoupling of the functional modules and separation of development teams, each team independently develops and maintains own modules, the development progress and the product quality of the modules are controlled, a main module reserves an inlet for each plug-in on a page and provides a plug-in installation interface, after the plug-in development is finished, the plug-in can be dynamically integrated into the main module and can be unloaded, and the application range is very wide. The method meets the requirement of rapidly expanding the functions of the APP without upgrading the APP, and has practical value.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (5)

1. An application function execution method, comprising:
acquiring a request for executing a preset function, which is sent to a host application;
Loading, by the host application, a plug-in application for performing the function;
Executing the function by the plug-in application;
wherein the loading, by the host application, a plug-in application for performing the function includes:
Obtaining a class file of the plug-in application according to the path of the plug-in application, and loading the class file through a preset loading tool shared by the host application and the plug-in application so as to run the plug-in application;
Acquiring the resource on which the function depends by the plug-in application is executed according to the path of the plug-in application;
According to the information of the plug-in application, a unique number is allocated to the resource;
and acquiring the resources according to the unique numbers for compiling so as to realize the functions.
2. The method of claim 1, wherein loading, by the host application, a plug-in application for performing the function comprises:
and loading the plug-in application based on a preset library on which the plug-in application depends.
3. A mobile terminal, characterized in that the mobile terminal comprises a processor, a memory and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory; the processor is configured to execute an application function execution program stored in the memory, so as to implement the following steps:
acquiring a request for executing a preset function, which is sent to a host application;
Loading, by the host application, a plug-in application for performing the function;
Executing the function by the plug-in application;
Wherein, in the loading of the plug-in application for executing the function by the host application, the processor is configured to execute the application function execution program to implement the following steps:
Obtaining a class file of the plug-in application according to the path of the plug-in application, and loading the class file through a preset loading tool shared by the host application and the plug-in application so as to run the plug-in application;
Acquiring the resource on which the function depends by the plug-in application is executed according to the path of the plug-in application;
According to the information of the plug-in application, a unique number is allocated to the resource;
and acquiring the resources according to the unique numbers for compiling so as to realize the functions.
4. A mobile terminal according to claim 3, wherein the processor is configured to execute the application function execution program in the plug-in application loaded by the host application for executing the function, to implement the steps of:
and loading the plug-in application based on a preset library on which the plug-in application depends.
5. A computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the application function execution method of any one of claims 1-2.
CN201810401255.7A 2018-04-28 2018-04-28 Application function execution method, mobile terminal and computer readable storage medium Active CN108595203B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810401255.7A CN108595203B (en) 2018-04-28 2018-04-28 Application function execution method, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810401255.7A CN108595203B (en) 2018-04-28 2018-04-28 Application function execution method, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108595203A CN108595203A (en) 2018-09-28
CN108595203B true CN108595203B (en) 2024-04-19

Family

ID=63619145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810401255.7A Active CN108595203B (en) 2018-04-28 2018-04-28 Application function execution method, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108595203B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614207A (en) * 2018-10-12 2019-04-12 上海掌门科技有限公司 Processing method, equipment and the computer readable storage medium of boarding application
CN112000386A (en) * 2019-05-08 2020-11-27 北京奇虎科技有限公司 Application implementation method and device
CN112527301B (en) * 2019-09-18 2022-10-25 华为技术有限公司 Method for realizing application plug-in and electronic equipment
CN111381741A (en) * 2020-03-05 2020-07-07 山东浪潮通软信息科技有限公司 Toolbar plug-in method, device and system
CN112148331A (en) * 2020-09-30 2020-12-29 亮风台(上海)信息科技有限公司 Dynamic updating method of host program and terminal equipment
CN112667246B (en) * 2021-01-08 2024-03-01 深圳前海微众银行股份有限公司 Application function expansion method and device and electronic equipment
CN113220367A (en) * 2021-05-12 2021-08-06 北京百度网讯科技有限公司 Applet running method and device, electronic equipment and storage medium
CN113626105B (en) * 2021-08-18 2023-10-27 赞同科技股份有限公司 SDK system of mobile terminal mixed mode and mobile device
CN113726579A (en) * 2021-09-02 2021-11-30 国网信息通信产业集团有限公司 Method and device for realizing power Internet of things communication protocol plug-in

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101561915A (en) * 2009-06-05 2009-10-21 阿里巴巴集团控股有限公司 Plug-in unit acquiring method, system and device thereof
CN102546708A (en) * 2010-12-27 2012-07-04 阿里巴巴集团控股有限公司 Plug-in obtaining method and system as well as relevant devices
CN105955787A (en) * 2016-05-18 2016-09-21 深圳市掌玩网络技术有限公司 Method and device used for loading plug-in of Android system
CN106909406A (en) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 A kind of method and device of the APK plug-in units of loading application programs
CN107479867A (en) * 2017-06-12 2017-12-15 百度在线网络技术(北京)有限公司 Application software plug-in unit operation method and device
CN107832100A (en) * 2017-10-27 2018-03-23 平安普惠企业管理有限公司 A kind of loading method and its terminal of APK plug-in units

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101561915A (en) * 2009-06-05 2009-10-21 阿里巴巴集团控股有限公司 Plug-in unit acquiring method, system and device thereof
CN102546708A (en) * 2010-12-27 2012-07-04 阿里巴巴集团控股有限公司 Plug-in obtaining method and system as well as relevant devices
CN106909406A (en) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 A kind of method and device of the APK plug-in units of loading application programs
CN105955787A (en) * 2016-05-18 2016-09-21 深圳市掌玩网络技术有限公司 Method and device used for loading plug-in of Android system
CN107479867A (en) * 2017-06-12 2017-12-15 百度在线网络技术(北京)有限公司 Application software plug-in unit operation method and device
CN107832100A (en) * 2017-10-27 2018-03-23 平安普惠企业管理有限公司 A kind of loading method and its terminal of APK plug-in units

Also Published As

Publication number Publication date
CN108595203A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN108595203B (en) Application function execution method, mobile terminal and computer readable storage medium
EP3471450A1 (en) Network bandwidth management method, terminal and computer storage medium
CN109766119B (en) Recovery partition upgrade method, terminal and computer readable storage medium
CN109472157B (en) Application data storage method, mobile terminal and computer storage medium
CN109002547B (en) Log file storage method, mobile terminal and computer readable storage medium
CN107818022B (en) Application program interface merging method, mobile terminal and computer readable storage medium
CN107247617B (en) Virtual machine resource allocation method, trial platform and readable storage medium
CN112597115A (en) Container mirror image compression method and device, terminal equipment and medium
CN109725819B (en) Interface display method and device, double-screen double-system terminal and readable storage medium
CN109151081B (en) Production comprehensive testing method and device, intelligent terminal and readable storage medium
CN107748680B (en) Kernel configuration method, terminal and computer readable storage medium
CN107229470B (en) System font switching method, mobile terminal and computer readable storage medium
CN107153551B (en) Font switching method, mobile terminal and computer readable storage medium
CN107463395B (en) Component calling method and device
CN110209434B (en) Memory management method and device and computer readable storage medium
CN112099830A (en) System updating method, equipment and computer readable storage medium
CN112395106A (en) Process management method, mobile terminal, and computer-readable storage medium
CN109743469B (en) VOLTE-based communication method and mobile terminal
CN111931155A (en) Verification code input method, verification code input equipment and storage medium
CN113039517B (en) Audio resource calling method and device and electronic equipment
CN109062688B (en) Memory allocation method, server and mobile terminal
CN107678794B (en) Application program starting interface merging method and mobile terminal
CN108040330B (en) WiFi directional transmission method, mobile terminal and readable storage medium
CN110647418A (en) Exception handling method, server and mobile terminal
CN113407232A (en) Screen projection software compatibility method, equipment and computer readable storage medium

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