CN108595203A - Application function executes method, mobile terminal and computer readable storage medium - Google Patents

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

Info

Publication number
CN108595203A
CN108595203A CN201810401255.7A CN201810401255A CN108595203A CN 108595203 A CN108595203 A CN 108595203A CN 201810401255 A CN201810401255 A CN 201810401255A CN 108595203 A CN108595203 A CN 108595203A
Authority
CN
China
Prior art keywords
application
plug
function
host
executing
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.)
Granted
Application number
CN201810401255.7A
Other languages
Chinese (zh)
Other versions
CN108595203B (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)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

Executing method, mobile terminal and computer readable storage medium, this method the invention discloses a kind of application function includes:Obtain the request for the execution preset function for being sent to host's application;Plug-in application by host's application load for executing function;Function is executed by plug-in application.According to the technique and scheme of the present invention, when host's application, which receives user, executes the request of function, and non-self execution function, after host's application is loaded with the plug-in application of the function, the function is executed by plug-in application, since the function is not realized in host's application, plug-in application realizes the function, so when needing to the function renewal, only need to be performed the exploitation to plug-in application, it is packaged, test, publication, and host's application and other plug-in application need not then be developed, it is packaged, test, publication, it can be seen that workload is greatly reduced, exploitation duration declines to a great extent, the possibility to go wrong is also greatly decreased, be conducive to efficiently complete the update of application function.

Description

Application function executes method, mobile terminal and computer readable storage medium
Technical field
The present invention relates to Internet technical fields more particularly to a kind of application function to execute method, mobile terminal and calculating Machine readable storage medium storing program for executing.
Background technology
In mobile Internet field, with the continuous addition of application new function, the gradual complexity of service logic is issued every time Using the necessary synchronous development of all modules when new version, application, test are repacked, is then issued in major application market. To applying the possibility that the development amount of all modules is big, time-consuming, goes wrong more, seriously affect using more new edition This efficiency is not suitable for the mobile Internet industry of iteratively faster.
Therefore, it is necessary to a kind of new technical solutions, are efficiently updated to the function of application.
Invention content
It is a primary object of the present invention to propose that a kind of application function executes method, mobile terminal and computer-readable storage Medium, it is intended to put forward the function efficiently to application and be updated.
To achieve the above object, the present invention provides a kind of application functions to execute method, including:Acquisition is sent to host and answers Execute the request of preset function;Plug-in application by host application load for executing the function;Pass through institute It states plug-in application and executes the function..
To achieve the above object, the present invention also provides a kind of mobile terminal, the mobile terminal includes processor, storage Device, communication bus;The communication bus is for realizing the connection communication between processor and memory;The processor is for holding The application function stored in line storage executes program, to realize following steps:The execution that acquisition is sent to host's application is default The request of function;Plug-in application by host application load for executing the function;It is held by the plug-in application The row function.
To achieve the above object, described computer-readable to deposit the present invention also provides a kind of computer readable storage medium Storage media is stored with one or more program, and one or more of programs can be executed by one or more processor, To realize the step of application function above-mentioned executes method.
According to above technical scheme, it is known that application function of the invention executes method, mobile terminal and computer-readable deposits Storage media has at least the following advantages:
According to the technique and scheme of the present invention, it when host's application, which receives user, executes the request of function, and non-self holds The row function executes the function, due to host after host's application is loaded with the plug-in application of the function by plug-in application Using not realizing that the function, plug-in application realize the function, so when needing to the function renewal, it is only necessary to complete to plug-in unit Exploitation, packing, test, the publication of application, and host applies and other plug-in application need not then be developed, is packaged, Test, publication, it is seen that workload is greatly reduced, and exploitation duration declines to a great extent, and the possibility to go wrong is also greatly decreased, favorably In the update for efficiently completing application function.
Description of the drawings
The hardware architecture diagram of Fig. 1 mobile terminals of each embodiment to realize the present invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is the flow chart that method is executed according to the application function of one embodiment of the present of invention;
Fig. 4 is the flow chart that method is executed according to the application function of one embodiment of the present of invention;
Fig. 5 is the schematic diagram that method is executed according to the application function of one embodiment of the present of invention;
Fig. 6 is the flow chart that method is executed according to the application function of one embodiment of the present of invention;
Fig. 7 is the schematic diagram that method is executed according to the application function of one embodiment of the present of invention;
Fig. 8 is the schematic diagram that method is executed according to the application function of one embodiment of the present of invention;
Fig. 9 is the block diagram according to the mobile terminal of one embodiment of the present of invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, using for indicating that the suffix of such as " module ", " component " or " unit " of element is only The explanation for being conducive to the present invention, itself does not have a distinctive meaning.Therefore, " module ", " component " or " unit " can mix Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, tablet Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable The shiftings such as media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special Except element for moving purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware architecture diagram of its mobile terminal of each embodiment to realize the present invention, the shifting Moving terminal 100 may include:RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1 Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram, Either combine certain components or different components arrangement.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating Frequency unit 101 can also be communicated with network and other equipment by radio communication.Above-mentioned wireless communication can use any communication Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, TD SDMA), 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 short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102 Sub- mail, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 1 shows Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need It to be omitted in the range for the essence for not changing invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100 When under the isotypes such as formula, speech recognition mode, broadcast reception mode, it is that radio frequency unit 101 or WiFi module 102 are received or The audio data stored in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103 The relevant audio output of peculiar function executed with mobile terminal 100 can also be provided (for example, call signal receives sound, disappears Breath receives sound etc.).Audio output unit 103 may include loud speaker, buzzer etc..
A/V input units 104 are for receiving audio or video signal.A/V input units 104 may include graphics processor (Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode Or the image data of the static images or video obtained by image capture apparatus (such as camera) in image capture mode carries out Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042 Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case of telephone calling model. Microphone 1042 can implement various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition) The noise generated during frequency signal or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general For three axis) size of acceleration, size and the direction of gravity are can detect that when static, can be used to identify the application of mobile phone posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, The other sensors such as hygrometer, thermometer, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode may be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal Family is arranged and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect user on it or neighbouring touch operation (for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071 Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating lever etc. It is one or more, do not limit herein specifically.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel 1061 be to realize the function that outputs and inputs of mobile terminal as two independent components, but in certain embodiments, can The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically It limits.
Interface unit 108 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example, External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with For the transmission data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can include mainly storing program area And storage data field, wherein storing program area can storage program area, application program (such as the sound needed at least one function Sound playing function, image player function etc.) etc.;Storage data field can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place Reason device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111 Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
Embodiment to facilitate the understanding of the present invention, below to the communications network system that is based on of mobile terminal of the present invention into Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention, the communication network system System is the LTE system of universal mobile communications technology, which includes communicating UE (User Equipment, the use of connection successively Family equipment) (the lands Evolved UMTS Terrestrial Radio Access Network, evolved UMTS 201, E-UTRAN Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation 204。
Specifically, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning Journey (backhaul) (such as X2 interface) is connect with other eNodeB2022, and eNodeB2021 is connected to EPC203, ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include MME (Mobility Management Entity, mobility management entity) 2031, HSS (Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way, Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers Such as the function of home location register (not shown) etc, and some are preserved in relation to use such as service features, data rates The dedicated information in family.All customer data can be sent by SGW2034,
PGW2035 can provide UE 201 IP address distribution and other functions, PCRF2036 be business data flow and Strategy and the charging control policy decision point of IP bearing resources, it is selected for strategy and charge execution function unit (not shown) And provide available strategy and charging control decision.
IP operation 204 may include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art it is to be understood that the present invention not only Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with And the following new network system etc., it does not limit herein.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the method for the present invention is proposed.
It should be noted that the embodiment of the present invention is suitable for all mobile platform systems, including but not limited to The platforms such as Android, IOS describe technical scheme of the present invention based on Android platform in following embodiment, not send out this Bright technical solution is limited to Android platform.
As shown in figure 3, a kind of application function execution method is provided in one embodiment of the present of invention, including:
Step S310 obtains the request for the execution preset function for being sent to host's application.
In the present embodiment, the type of preset function is not limited;In embodiment, user uses in advance required If when function, by the interactive operation with mobile terminal, the request for executing the function is sent out to host's application.
Step S320, the plug-in application by host's application load for executing function.
In the present embodiment, host's application does not execute the function directly, but load is exclusively used in executing inserting for the function Part application.
Step S330 executes function by plug-in application.
According to the technical solution of the present embodiment, when host's application, which receives user, executes the request of function, and it is non-self It executes the function and the function is executed by plug-in application, due to place after host's application is loaded with the plug-in application of the function Main application does not realize that the function, plug-in application realize the function, so when needing to the function renewal, it is only necessary to complete to inserting Exploitation, packing, test, the publication of part application, and host's application and other plug-in application need not then be developed, be beaten Packet, test, publication, it is seen that workload is greatly reduced, and exploitation duration declines to a great extent, and the possibility to go wrong is also greatly decreased, Be conducive to efficiently complete the update of application function.
As shown in figure 4, a kind of application function execution method is provided in one embodiment of the present of invention, including:
Step S410 obtains the request for the execution preset function for being sent to host's application.
Step S420 is applied the library relied on based on preset plug-in application by host, loads plug-in application.
In the present embodiment, the library needed for load plug-in application is preset, so that host applies normal load plug-in application simultaneously Normally execute the function.
Step S430 executes function by plug-in application.
In the present embodiment, mounted on the application structure of mobile terminal system as shown in figure 5, being divided into 3 major parts:Local place Main application APK (AndroidPackage, Android platform application installation package), plug-in unit SDK, plugin (plug-in unit) APK.
Local host's (being indicated with Host) applies APK:It is responsible for the communication with server, manages plugin APK, dynamic adds Carry plugin APK etc.;
plugin APK:Independent APP, the relatively independent simple small function of whole realization;
Plug-in unit SDK (Software Development Kit, i.e. Software Development Kit):Local host is dynamic using APK The library that state load plugin APK are relied on.
According to the technical solution of the present embodiment, when host starts using APK, whether there can be presence to server inquiry Plugin APK while being necessary to ensure that the validity of plugin APK and if so, downloading, it is ensured that its be not tampered with also not by It forges, after plugin APK are by safety detection, then starts the extension that plug-in unit Dynamic loading technique does new function.Specific stream Cheng Wei:
1, host reports the App version informations and plugin APK version informations of oneself using APK, is asked to server plugin APK;
2, host downloads plugin APK using APK, and verifies its validity;
3, host uses plug-in unit Dynamic loading technique using APK, does and extends to APP functions;
4, host extends the state of success or not using APK reporting functions.
It can be seen that in the technical solution of the present embodiment, it is main to need to download new plugin when needing to update application function APK, and host need not then update using APK, it means that it only needs to plugin APK exploitations, packing, test, publication i.e. Can, substantially increase the efficiency of more new function.
As shown in fig. 6, a kind of application function execution method is provided in one embodiment of the present of invention, including:
Step S610 obtains the request for the execution preset function for being sent to host's application.
Step S620, according to the path of plug-in application obtain plug-in application class file, by preset host apply and The shared loading tool of plug-in application loads class file, to run plug-in application.
In the present embodiment, it to realize the dynamic load to plugin APK, need the load of solution class and adding for resource The problem of load.That realizes class is loaded with two ways, and independent download tool or plug-in unit and Host are constructed for each plug-in unit It is multiplexed the same loading tool, but if using independent loading tool, needs hook (hook, a kind of computer technology) very More bottom classes may influence whether that system is stablized.
In the present embodiment, using the technology of multiplexing loading tool, it is only necessary to ensure that plug-in unit uses same version with host JAR packets (Java archive file, the code file of Android platform) would not have compatibility issue.Specifically, it loads When Activity (Activity is one and is responsible for the component interacted with user), there are one critically important classes: DexPathList.java stores multiple Element (element) in this class, can be stored in each Element and work as anterior plug-in .class files.DexClassLoader (loading tool that host and plugin APK are multiplexed in the present embodiment) is being loaded When, each Element elements can be traversed, class files therein (class file, i.e. application code file) are once loaded.Pass through DexClassLoader loads the code of plug-in unit, needs the path of incoming plug-in unit apk.Pass through the road of specific plug-in plugin APK Diameter builds Element objects, as shown in Figure 7.The Element of plug-in unit is inserted into Host's by Hook technologies In DexClassLoader, as shown in figure 8, loading multiple plugin plug-in units based on multiple Element.It is plug-in unit by Hook Construct a DexClasssLoader shared with Host, it is only necessary to ensure that plug-in unit uses the JAR packets of same version with host There would not be compatibility issue, can be loaded with the heat of completion code.
Step S630 obtains plug-in application according to the path of plug-in application and executes the resource that function relies on.
In the present embodiment, it is desirable to obtain the resource file of plug-in unit, it is necessary to obtain the Resource (resource) of a plug-in unit Object, comprising a method addAssetPath, (Android is flat in AssetManager.java (Android platform file) Platform technology), the path of apk is passed to as parameter, the resource of plug-in unit is obtained, so just solves the money of each Plugin APK Source loading problem.
Step S640 is resource allocation unique number according to the information of plug-in application.
In the present embodiment, due to there is resource in plug-in unit, also there is resource in Host, when compiling, each resource can dynamically distribute One resource ID, format are:0xPPTTNNNN.It can cause to conflict mutually between plug-in resource and host in this way, therefore in this reality It applies in example, resource is segmented as follows, avoids this problem.
PP:The ID of current plugin APK or host, id are distributed from 0x10 to 0x7e, the resource or 0x7f of host layer, Keep default value.
TT:Resource type (layout, font, pattern etc. are different).
NNNN:The actual number of resource..
Step S650 obtains resource according to unique number and is compiled, to realize function.
According to the technical solution of the present embodiment, this patent uses the plug-in unitization upgrading side of a kind of dynamic replacement and resource transformation Method, which is suitable for the collaborative development of Large Groups function, when there is the extension of new function, does not need each team and all develops Finish just publication APP, it is only necessary to after each team develops the plug-in unit APK of oneself, dynamically be added using APK by host It carries, the technical solution of the present embodiment meets the demand without upgrading APP Quick Extended APP functions, has very much practical value.
As shown in figure 9, providing a kind of mobile terminal in one embodiment of the present of invention, which is characterized in that mobile terminal Including processor 910, memory 920, communication bus 930;Communication bus 930 for realizing processor 910 and memory 920 it Between connection communication;Processor 910 is used to execute the application function stored in memory 920 and executes program, to realize following step Suddenly:
Obtain the request for the execution preset function for being sent to host's application.
In the present embodiment, the type of preset function is not limited;In embodiment, user uses in advance required If when function, by the interactive operation with mobile terminal, the request for executing the function is sent out to host's application.
Plug-in application by host's application load for executing function.
In the present embodiment, host's application does not execute the function directly, but load is exclusively used in executing inserting for the function Part application.
Function is executed by plug-in application.
According to the technical solution of the present embodiment, when host's application, which receives user, executes the request of function, and it is non-self It executes the function and the function is executed by plug-in application, due to place after host's application is loaded with the plug-in application of the function Main application does not realize that the function, plug-in application realize the function, so when needing to the function renewal, it is only necessary to complete to inserting Exploitation, packing, test, the publication of part application, and host's application and other plug-in application need not then be developed, be beaten Packet, test, publication, it is seen that workload is greatly reduced, and exploitation duration declines to a great extent, and the possibility to go wrong is also greatly decreased, Be conducive to efficiently complete the update of application function.
As shown in figure 9, providing a kind of mobile terminal in one embodiment of the present of invention, which is characterized in that mobile terminal Including processor 910, memory 920, communication bus 930;Communication bus 930 for realizing processor 910 and memory 920 it Between connection communication;Processor 910 is used to execute the application function stored in memory 920 and executes program, to realize following step Suddenly:
Obtain the request for the execution preset function for being sent to host's application.
The library relied on based on preset plug-in application is applied by host, loads plug-in application.
In the present embodiment, the library needed for load plug-in application is preset, so that host applies normal load plug-in application simultaneously Normally execute the function.
Function is executed by plug-in application.
In the present embodiment, mounted on the application structure of mobile terminal system as shown in figure 5, being divided into 3 major parts:Local place Main application APK (AndroidPackage, Android platform application installation package), plug-in unit SDK, plugin (plug-in unit) APK.
Local host's (being indicated with Host) applies APK:It is responsible for the communication with server, manages plugin APK, dynamic adds Carry plugin APK etc.;
plugin APK:Independent APP, the relatively independent simple small function of whole realization;
Plug-in unit SDK (Software Development Kit, i.e. Software Development Kit):Local host is dynamic using APK The library that state load plugin APK are relied on.
According to the technical solution of the present embodiment, when host starts using APK, whether there can be presence to server inquiry Plugin APK while being necessary to ensure that the validity of plugin APK and if so, downloading, it is ensured that its be not tampered with also not by It forges, after plugin APK are by safety detection, then starts the extension that plug-in unit Dynamic loading technique does new function.Specific stream Cheng Wei:
1, host reports the App version informations and plugin APK version informations of oneself using APK, is asked to server plugin APK;
2, host downloads plugin APK using APK, and verifies its validity;
3, host uses plug-in unit Dynamic loading technique using APK, does and extends to APP functions;
4, host extends the state of success or not using APK reporting functions.
It can be seen that in the technical solution of the present embodiment, it is main to need to download new plugin when needing to update application function APK, and host need not then update using APK, it means that it only needs to plugin APK exploitations, packing, test, publication i.e. Can, substantially increase the efficiency of more new function.
As shown in figure 9, providing a kind of mobile terminal in one embodiment of the present of invention, which is characterized in that mobile terminal Including processor 910, memory 920, communication bus 930;Communication bus 930 for realizing processor 910 and memory 920 it Between connection communication;Processor 910 is used to execute the application function stored in memory 920 and executes program, to realize following step Suddenly:
Obtain the request for the execution preset function for being sent to host's application.
The class file that plug-in application is obtained according to the path of plug-in application, is applied by preset host and plug-in application is total Loading tool loads class file, to run plug-in application.
In the present embodiment, it to realize the dynamic load to plugin APK, need the load of solution class and adding for resource The problem of load.That realizes class is loaded with two ways, and independent download tool or plug-in unit and Host are constructed for each plug-in unit It is multiplexed the same loading tool, but if using independent loading tool, needs hook (hook, a kind of computer technology) very More bottom classes may influence whether that system is stablized.
In the present embodiment, using the technology of multiplexing loading tool, it is only necessary to ensure that plug-in unit uses same version with host JAR packets (Java archive file, the code file of Android platform) would not have compatibility issue.Specifically, it loads When Activity (Activity is one and is responsible for the component interacted with user), there are one critically important classes: DexPathList.java stores multiple Element (element) in this class, can be stored in each Element and work as anterior plug-in .class files.DexClassLoader (loading tool that host and plugin APK are multiplexed in the present embodiment) is being loaded When, each Element elements can be traversed, class files therein (class file, i.e. application code file) are once loaded.Pass through DexClassLoader loads the code of plug-in unit, needs the path of incoming plug-in unit apk.Pass through the paths specific plug-in plugin APK Element objects are built, as shown in Figure 7.The Element of plug-in unit is inserted into Host's by Hook technologies In DexClassLoader, as shown in figure 8, loading multiple plugin plug-in units based on multiple Element.It is plug-in unit by Hook Construct a DexClasssLoader shared with Host, it is only necessary to ensure that plug-in unit uses the JAR packets of same version with host There would not be compatibility issue, can be loaded with the heat of completion code.
Plug-in application, which is obtained, according to the path of plug-in application executes the resource that function relies on.
In the present embodiment, it is desirable to obtain the resource file of plug-in unit, it is necessary to obtain the Resource (resource) of a plug-in unit Object, comprising a method addAssetPath, (Android is flat in AssetManager.java (Android platform file) Platform technology), the path of apk is passed to as parameter, the resource of plug-in unit is obtained, so just solves the money of each Plugin APK Source loading problem.
It is resource allocation unique number according to the information of plug-in application.
In the present embodiment, due to there is resource in plug-in unit, also there is resource in Host, when compiling, each resource can dynamically distribute One resource ID, format are:0xPPTTNNNN.It can cause to conflict mutually between plug-in resource and host in this way, therefore in this reality It applies in example, resource is segmented as follows, avoids this problem.
PP:The ID of current plugin APK or host, id are distributed from 0x10 to 0x7e, the resource or 0x7f of host layer, Keep default value.
TT:Resource type (layout, font, pattern etc. are different).
NNNN:The actual number of resource.
Resource is obtained according to unique number to be compiled, to realize function.
According to the technical solution of the present embodiment, this patent uses the plug-in unitization upgrading side of a kind of dynamic replacement and resource transformation Method, which is suitable for the collaborative development of Large Groups function, when there is the extension of new function, does not need each team and all develops Finish just publication APP, it is only necessary to after each team develops the plug-in unit APK of oneself, dynamically be added using APK by host It carries, the technical solution of the present embodiment meets the demand without upgrading APP Quick Extended APP functions, has very much practical value.
A kind of computer readable storage medium, computer readable storage medium are additionally provided in one embodiment of the present of invention It is stored with one or more program, one or more program can be executed by one or more processor, following to realize Application function execute method the step of:
Obtain the request for the execution preset function for being sent to host's application.
In the present embodiment, the type of preset function is not limited;In embodiment, user uses in advance required If when function, by the interactive operation with mobile terminal, the request for executing the function is sent out to host's application.
Plug-in application by host's application load for executing function.
In the present embodiment, host's application does not execute the function directly, but load is exclusively used in executing inserting for the function Part application.
Function is executed by plug-in application.
It, can be with the plug-in unit upgrade method of a kind of dynamic replacement and resource transformation according to the technical solution of the present embodiment Realize that the separation of the decoupling and development teams of function module, each team's stand-alone development safeguard the module of oneself, control this module and open Hair progress and product quality, primary module are that each plug-in unit reserves entrance, and provides plug-in unit installation interface in the page, and developing plug finishes Afterwards, there can be the very wide scope of application in dynamic integrity to primary module, can also unload.It meets quick without upgrading App The demand of APP functions is extended, there is practical value very much.
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that process, method, article or device including a series of elements include not only those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this There is also other identical elements in the process of element, method, article or device.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art Going out the part of contribution can be expressed in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal (can be mobile phone, computer, service Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited in above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form, all of these belong to the protection of the present invention.

Claims (10)

1. a kind of application function executes method, which is characterized in that including:
Obtain the request for the execution preset function for being sent to host's application;
Plug-in application by host application load for executing the function;
The function is executed by the plug-in application.
2. according to the method described in claim 1, it is characterized in that, described described for executing by host application load The plug-in application of function, including:
Based on the library that the preset plug-in application relies on, the plug-in application is loaded.
3. according to the method described in claim 1, it is characterized in that, described described for executing by host application load The plug-in application of function, including:
The class file that the plug-in application is obtained according to the path of the plug-in application passes through preset host's application and institute It states the shared loading tool of plug-in application and loads the class file, to run the plug-in application.
4. according to the method described in claim 1, it is characterized in that, described described for executing by host application load The plug-in application of function, including:
The plug-in application, which is obtained, according to the path of the plug-in application executes the resource that the function relies on.
5. according to the method described in claim 4, it is characterized in that, described execute the function, packet by the plug-in application It includes:
It is the resource allocation unique number according to the information of the plug-in application;
The resource is obtained according to the unique number to be compiled, to realize the function.
6. a kind of mobile terminal, which is characterized in that the mobile terminal includes processor, memory, communication bus;The communication Bus is for realizing the connection communication between processor and memory;The processor is for executing the application stored in memory Function executes program, to realize following steps:
Obtain the request for the execution preset function for being sent to host's application;
Plug-in application by host application load for executing the function;
The function is executed by the plug-in application.
7. mobile terminal according to claim 6, which is characterized in that described to be loaded by host application for executing In the plug-in application of the function, the processor executes program for executing the application function, to realize following steps:
Based on the library that the preset plug-in application relies on, the plug-in application is loaded.
8. mobile terminal according to claim 6, which is characterized in that described to be loaded by host application for executing In the plug-in application of the function, the processor executes program for executing the application function, to realize following steps:
The class file that the plug-in application is obtained according to the path of the plug-in application passes through preset host's application and institute It states the shared loading tool of plug-in application and loads the class file, to run the plug-in application.
9. mobile terminal according to claim 6, which is characterized in that described to be loaded by host application for executing In the plug-in application of the function, the processor executes program for executing the application function, to realize following steps:
The plug-in application, which is obtained, according to the path of the plug-in application executes the resource that the function relies on.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage there are one or Multiple programs, one or more of programs can be executed by one or more processor, to realize in claim 1 to 5 Any one of them application function executes the step of method.
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 true CN108595203A (en) 2018-09-28
CN108595203B 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)

Cited By (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
CN111381741A (en) * 2020-03-05 2020-07-07 山东浪潮通软信息科技有限公司 Toolbar plug-in method, device and system
CN112000386A (en) * 2019-05-08 2020-11-27 北京奇虎科技有限公司 Application implementation method and device
CN112148331A (en) * 2020-09-30 2020-12-29 亮风台(上海)信息科技有限公司 Dynamic updating method of host program and terminal equipment
WO2021052167A1 (en) * 2019-09-18 2021-03-25 华为技术有限公司 Method for realizing pluginization of application, and electronic apparatus
CN112667246A (en) * 2021-01-08 2021-04-16 深圳前海微众银行股份有限公司 Application function extension method and device and electronic equipment
CN113220367A (en) * 2021-05-12 2021-08-06 北京百度网讯科技有限公司 Applet running method and device, electronic equipment and storage medium
CN113626105A (en) * 2021-08-18 2021-11-09 赞同科技股份有限公司 SDK system and mobile device of mobile terminal mixed mode
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

Cited By (11)

* 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
WO2021052167A1 (en) * 2019-09-18 2021-03-25 华为技术有限公司 Method for realizing pluginization of application, and electronic apparatus
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
CN112667246A (en) * 2021-01-08 2021-04-16 深圳前海微众银行股份有限公司 Application function extension method and device and electronic 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
CN113626105A (en) * 2021-08-18 2021-11-09 赞同科技股份有限公司 SDK system and mobile device of mobile terminal mixed mode
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

Also Published As

Publication number Publication date
CN108595203B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
CN108595203A (en) Application function executes method, mobile terminal and computer readable storage medium
CN108536481A (en) A kind of application program launching method, mobile terminal and computer storage media
CN109814941A (en) A kind of application starting method, terminal and computer readable storage medium
CN107273139A (en) A kind of method for updating system, equipment and computer-readable recording medium
CN108519886A (en) A kind of APK application installation packages configuration method, server, system and storage medium
CN108549826A (en) Method of calibration, terminal, server and the readable storage medium storing program for executing of application program
CN108600516A (en) Collecting method, mobile terminal and computer readable storage medium
CN109766119A (en) Restore subregion upgrade method, terminal and computer readable storage medium
CN107943494A (en) Distribution method and mobile terminal are applied by all kinds of means
CN109472157A (en) Storage method, mobile terminal and the computer storage medium of application data
CN109002547A (en) Journal file storage method, mobile terminal and computer readable storage medium
CN107347117A (en) A kind of message management method, mobile terminal and computer-readable recording medium
CN110069458A (en) Method, equipment and the storage medium of invalid resource in a kind of deletion Android system
CN108595672A (en) The method, apparatus and readable storage medium storing program for executing of file type are downloaded in a kind of identification
CN108762639A (en) A kind of control method of physical button, mobile terminal and storage medium
CN108984590A (en) A kind of page data methods of exhibiting, terminal and computer readable storage medium
CN108377292A (en) Solve method, terminal, server and the computer storage media of RAM leakage
CN109947519A (en) Hardware-accelerated control method, terminal and computer readable storage medium
CN110209434A (en) A kind of EMS memory management process, device and computer readable storage medium
CN109062688A (en) A kind of memory allocation method, server and mobile terminal
CN109743469A (en) A kind of communication means and mobile terminal based on VOLTE
CN109582565A (en) Prevent the method, terminal and computer storage medium of application crashes
CN109358796A (en) A kind of game visual field sharing method, terminal and readable storage medium storing program for executing
CN108768831A (en) Sharing method, mobile terminal and the computer readable storage medium of chat record
CN108879117A (en) Mobile terminal and its antenna structure

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