CN108717365A - The method and apparatus for executing function in the application - Google Patents

The method and apparatus for executing function in the application Download PDF

Info

Publication number
CN108717365A
CN108717365A CN201810594986.8A CN201810594986A CN108717365A CN 108717365 A CN108717365 A CN 108717365A CN 201810594986 A CN201810594986 A CN 201810594986A CN 108717365 A CN108717365 A CN 108717365A
Authority
CN
China
Prior art keywords
correspondence
interface
host application
plug
stored
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
CN201810594986.8A
Other languages
Chinese (zh)
Other versions
CN108717365B (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.)
Chengdu kugou business incubator management Co.,Ltd.
Original Assignee
Guangzhou Kugou Computer 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 Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201810594986.8A priority Critical patent/CN108717365B/en
Publication of CN108717365A publication Critical patent/CN108717365A/en
Application granted granted Critical
Publication of CN108717365B publication Critical patent/CN108717365B/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

Landscapes

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

Abstract

The disclosure is directed to a kind of method and apparatus executing function in the application, belong to electronic technology field.The method includes:The first correspondence of pre-stored function and virtual interface information in the plug-in applications of host application is obtained, and obtains the second correspondence of pre-stored virtual interface information and interface message in host application;Based on the first correspondence and the second correspondence, the third correspondence of function and interface message is determined, and store third correspondence;During calling operation plug-in applications by host application, when detecting when executing instruction of objective function, it is based on third correspondence, determines the corresponding target interface information of objective function, calls the corresponding execution code of performance objective interface message.Using the disclosure, it can achieve the purpose that the execution code to plug-in applications is multiplexed.

Description

The method and apparatus for executing function in the application
Technical field
The disclosure is directed to electronic technology fields, especially with respect to a kind of method and dress executing function in the application It sets.
Background technology
Although its major function effect of different application programs may be not quite similar, such as music application and live streaming are answered With in program, music application is mainly used for playing music, and live streaming application program is mainly used for being broadcast live.But it is different Function module with the same function can be provided in application program.For example, live streaming can be arranged in music application Function module, user, which can select to listen to music, can also select to be broadcast live, and live streaming can also be arranged in application program is broadcast live Function module.
During realizing the disclosure, inventor has found to have at least the following problems:
Even if the function of the Implement of Function Module in different application programs is similar, but set in different application programs When setting these function modules, it is still necessary to write the corresponding code of function module respectively, the reusability of code is relatively low.
Invention content
In order to overcome the problems, such as that present in the relevant technologies, present disclose provides following technical schemes:
According to the first aspect of the embodiments of the present disclosure, a kind of method executing function in the application, the side are provided Method includes:
Obtain the first couple of pre-stored function and virtual interface information in the plug-in applications of host application It should be related to, and obtain the second correspondence of pre-stored virtual interface information and interface message in the host application and close System;
Based on first correspondence and second correspondence, determine that the third of function and interface message corresponds to Relationship, and store the third correspondence;
Called by the host application run the plug-in applications during, when detecting target work( When executing instruction of energy is based on the third correspondence, determines that the corresponding target interface information of the objective function, calling are held The corresponding execution code of the row target interface information.
Optionally, pre-stored function and virtual interface letter in the plug-in applications for obtaining host application First correspondence of breath, and obtain the of pre-stored virtual interface information and interface message in the host application Two correspondences, including:
When host application starts, pre-stored work(in the plug-in applications of the host application is obtained First correspondence of energy and virtual interface information, and obtain pre-stored virtual interface information in the host application With the second correspondence of interface message.
Optionally, the interface message in second correspondence and the third correspondence includes Hyper text transfer association Discuss HTTP request interface message, socket Socket interface messages, locating interface information, sharing interface information, pattern interface letter Breath, notification interface information redirect one or more in interface message, application program life cycle interface message.
Optionally, the plug-in applications are stored in the file of the host application in the form of library file In.
Optionally, the method further includes:
During compiling the host application and the plug-in applications, target original is inherited when detecting When the instruction of base class, the correspondence based on the pre-stored former base class in the host application and conversion base class, really Fixed target corresponding with target former base class converts base class;
The category code that base class is converted to pre-stored target in the host application carries out succession processing.
According to the second aspect of the embodiment of the present disclosure, a kind of device executing function in the application, the dress are provided Set including:
Acquisition module, pre-stored function and virtual interface in the plug-in applications for obtaining host application First correspondence of information, and obtain pre-stored virtual interface information and interface message in the host application Second correspondence;
First determining module, for be based on first correspondence and second correspondence, determine function and The third correspondence of interface message, and store the third correspondence;
Second determining module, for calling the process for running the plug-in applications by the host application In, when detecting when executing instruction of objective function, it is based on the third correspondence, determines the corresponding mesh of the objective function Interface message is marked, calls and executes the corresponding execution code of the target interface information.
Optionally, the acquisition module, is used for:
When host application starts, pre-stored work(in the plug-in applications of the host application is obtained First correspondence of energy and virtual interface information, and obtain pre-stored virtual interface information in the host application With the second correspondence of interface message.
Optionally, the interface message in second correspondence and the third correspondence includes Hyper text transfer association Discuss HTTP request interface message, socket Socket interface messages, locating interface information, sharing interface information, pattern interface letter Breath, notification interface information redirect one or more in interface message, application program life cycle interface message.
Optionally, the plug-in applications are stored in the file of the host application in the form of library file In.
Optionally, described device further includes:
Third determining module is used for during compiling the host application and the plug-in applications, When detecting the instruction for inheriting target former base class, it is based on pre-stored former base class and conversion in the host application The correspondence of base class determines that target corresponding with target former base class converts base class;
Inherit module, the category code for converting base class to pre-stored target in the host application carry out after Hold processing.
According to the third aspect of the embodiment of the present disclosure, provide a kind of terminal, the terminal include processor, communication interface, Memory and communication bus, wherein:
The processor, the communication interface and the memory complete mutual communication by the communication bus;
The memory, for storing computer program;
The processor above-mentioned is held for executing the program stored on the memory with realizing in the application The method of row function.
According to the fourth aspect of the embodiment of the present disclosure, a kind of computer readable storage medium is provided, it is described computer-readable It is stored with computer program in storage medium, the computer program is realized when being executed by processor above-mentioned to be held in the application The method of row function.
The technical scheme provided by this disclosed embodiment can include the following benefits:
The method provided by the embodiment of the present disclosure can be based in plug-in applications pre-stored function and virtual The of pre-stored virtual interface information and interface message in the first correspondence and host application of interface message Two correspondences determine the third correspondence of function and interface message.In this way, can will may be implemented in plug-in applications Objective function be transformed into and realized by the corresponding execution code of target interface information in host application.It in turn, can be with Plug-in applications eliminate the dependence of source application, plug-in applications can be accessed in different host applications In, achieve the purpose that the execution code to plug-in applications is multiplexed.
It should be understood that above general description and following detailed description is only exemplary and explanatory, not The disclosure can be limited.
Description of the drawings
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and together with specification for explaining the principles of this disclosure.In the accompanying drawings:
Fig. 1 is a kind of flow diagram of method executing function in the application shown according to an exemplary embodiment It is intended to;
Fig. 2 is the structural representation according to host application and plug-in applications shown in an exemplary embodiment Figure;
Fig. 3 is a kind of structural representation of device executing function in the application shown according to an exemplary embodiment Figure;
Fig. 4 is a kind of structural schematic diagram of terminal shown according to an exemplary embodiment.
Through the above attached drawings, it has been shown that the specific embodiment of the disclosure will be hereinafter described in more detail.These attached drawings It is not intended to limit the scope of this disclosure concept by any means with verbal description, but is by referring to specific embodiments Those skilled in the art illustrate the concept of the disclosure.
Specific implementation mode
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
The embodiment of the present disclosure provides a kind of method executing function in the application, and this method can be by terminal reality It is existing.Wherein, terminal can be mobile phone, tablet computer, desktop computer, notebook computer etc..
Terminal may include the components such as processor, memory.Processor can be CPU (Central Processing Unit, central processing unit) etc., it can be used for during calling operation plug-in applications by host application, When detecting when executing instruction of objective function, it is based on third correspondence, determines the corresponding target interface information of objective function, The corresponding execution code of performance objective interface message is called, processing is waited.Memory can be RAM (Random Access Memory, random access memory), Flash (flash memory) etc. can be used for storing needed for the data received, processing procedure The data etc. generated in data, processing procedure, such as function and virtual interface information the first correspondence.
Terminal can also include transceiver, input part, display unit, audio output part etc..Transceiver can be used for Carry out data transmission with server, transceiver may include bluetooth component, WiFi (Wireless-Fidelity, Wireless Fidelity Technology) component, antenna, match circuit, modem etc..Input part can be touch screen, keyboard, mouse etc..Audio is defeated It can be speaker, earphone etc. to go out component.
System program and application program can be installed in terminal.User during using terminal, based on oneself Different demands can use various application programs.It can be equipped in terminal and have music playback function, direct broadcast function etc. The application program of function.
One exemplary embodiment of the disclosure provides a kind of method executing function in the application, as shown in Figure 1, should The process flow of method may include following step:
Step S110 obtains pre-stored function and virtual interface information in the plug-in applications of host application The first correspondence, and obtain second of pre-stored virtual interface information and interface message in host application and correspond to Relationship.
In force, host application is the program of plug-in applications to be accessed, and plug-in applications can be tool There are the program module of a certain specific function, plug-in applications that can derive from source application.For example, source application is straight Application program is broadcast, has live streaming program module in application program is broadcast live, it can be to the live streaming program module in live streaming application program It is replicated.It is then possible to be handled, then access music and answer as plug-in applications the live streaming program module of duplication With in program.Music application can access live streaming program module as host application, in this way, live streaming program module can To be multiplexed.
Optionally, plug-in applications are stored in the form of library file in the file of host application.
In force, the source code of the plug-in applications of duplication can be packaged, obtains library file.
Due to plug-in applications in source application nor self-existent, be that source application to be depended on is deposited ?.Therefore, it is necessary to by plug-in applications to the releasing of the dependence of source application, could using plug-in applications as One independent application program, and independent application program is accessed into host application.Wherein, dependence include interface according to The succession dependence of the relationship of relying and class.
It, can be by interface of the calling with certain functions, to realize certain functions for interface.Can by interface to Necessary parameter is passed to inside program, program inside executes program and realize program function according to incoming parameter.Therefore, function There are correspondences with interface.For example, if to send out network request, HTTP (HyperText Transfer can be called Protocol, hypertext transfer protocol) request interface.
It can determine the interface in plug-in applications, these interfaces will call the program code in source application originally To realize certain functions.Since present plug-in applications and source application separate, the interface in plug-in applications calls Less than the program code in source application.Therefore, the corresponding program code of plug-in applications setting interface can be individually for. In this way, in plug-in applications calling interface, the program code in plug-in applications can be executed.However, the plug-in unit is answered With the corresponding program code of program, plug-in applications can be only helped to compile the journey without actual functional capability passed through Sequence code.Program code with actual functional capability can be stored in advance in host application.
Due to the interface more than one in plug-in applications, can in plug-in applications pre-stored work( It can be with the first correspondence of virtual interface information.Wherein, when executing an instruction, such as user clicks to enter direct broadcasting room, live streaming Program module needs to send network request to server.When live streaming program module receives the instruction that user clicks to enter direct broadcasting room When, it is carried in instruction corresponding to the identification information for sending network request function.When live streaming program module detects the instruction, It can be based on the first correspondence, determine virtual HTTP request interface message corresponding with network request function is sent.Wherein, it connects Message breath can be interface identifier, interface name.
As shown in Fig. 2, container floor such as Matrix can be arranged in plug-in applications, interface is established in container floor Virtual interface needed for plug-in applications can be all stored in interface library by library.
Can in host application pre-stored virtual interface information and interface message the second correspondence.By Interface in plug-in applications is virtual interface, can not achieve concrete function, and therefore, it is necessary to by host application The corresponding execution code of interface realize concrete function.So, it is thus necessary to determine that the second couple of virtual interface information and interface message It should be related to.
Container floor such as MatrixInception can be set in host application, interface library is established in container floor Such as MatrixProvider, the actual interface docked with the virtual interface needed for plug-in applications can be stored in interface library In.There can also be other program modules in host application, for realizing other functions, such as user program module, use In the personal settings information, user name, head portrait image etc. of record user.
Step S120 is based on the first correspondence and the second correspondence, determines the third pair of function and interface message It should be related to, and store third correspondence.
In force, such as it can be based on the first correspondence and the second correspondence, determine and send network request The corresponding virtual HTTP request interface message of function, then determine HTTP request interface corresponding with virtual HTTP request interface message Information.And so on, the function in plug-in applications can be implemented all by which of host application interface It determines:Based on the first correspondence and the second correspondence, the third correspondence of function and interface message is determined, and Store third correspondence.
After determining third correspondence, live streaming program module can be by calling the HTTP in host application to ask It seeks interface and sends network request function to realize.
Optionally, it when host application starts, obtains and is prestored in the plug-in applications of host application Function and virtual interface information the first correspondence, and obtain pre-stored virtual interface information in host application With the second correspondence of interface message.
In force, can be when host application start, such as during being initialized to application program, obtain The first correspondence of pre-stored function and virtual interface information in the plug-in applications of host application is taken, and is obtained Take the second correspondence of pre-stored virtual interface information and interface message in host application.Then, it can be based on First correspondence and the second correspondence, determine the third correspondence of function and interface message, and store third correspondence Relationship.
Optionally, the interface message in the second correspondence and third correspondence include HTTP request interface message, Socket (socket) interface message, sharing interface information, pattern interface message, notification interface information, is jumped at locating interface information One or more in converting interface information, application program life cycle interface message.
In force, the fortune of plug-in applications can be realized by interface above-mentioned or that other are with different function Row.Wherein, the interface in plug-in applications:HTTP request interface is properly termed as HttpInterface, and Socket interfaces can be with Referred to as SocketInterface, locating interface are properly termed as LocationInterface, and sharing interface is properly termed as ShareInterface, pattern interface are properly termed as StyleInterface, and notification interface is properly termed as NotificationInterface redirects interface and is properly termed as RouterInterface, and application program life cycle interface can With referred to as ApplicationInterface.Interface in host application:HTTP request interface is properly termed as HttpProvider。
Step S130, during calling operation plug-in applications by host application, when detecting target When executing instruction of function is based on third correspondence, determines the corresponding target interface information of objective function, calls performance objective The corresponding execution code of interface message.
In force, when executing an instruction, such as user clicks to enter direct broadcasting room, and live streaming program module is needed to server Send network request.When live streaming program module is received the objective function of direct broadcasting room is clicked to enter with user execute instruction When, it can be based on third correspondence, determine that the corresponding target interface information of objective function in host application, calling are held The corresponding execution code of row target interface information.
It can be in the initialisation process for starting host application, by the corresponding execution of MatrixInception In code injection to Matrix, in this way, during calling operation plug-in applications by host application, work as detection It, can be practical by the corresponding execution code of target interface information in host application to objective function when executing instruction Realize objective function.
Optionally, during compiling host application and plug-in applications, target original is inherited when detecting When the instruction of base class, based in host application pre-stored former base class and conversion base class correspondence, determine with The corresponding target of target former base class converts base class;To pre-stored target in host application convert the category code of base class into Row succession is handled.
In force, it before operation host application and plug-in applications, needs to write or adjust place The execution code of primary application program and plug-in applications.It hereafter, can be to host application and plug-in applications Execution code be compiled.Derived class in script plug-in applications will inherit the base class in source application, however by It is pulled out to come from host application in plug-in applications, therefore, derived class in plug-in applications can not be followed by Hold the base class in host application, such as page controller, alternatively referred to as ControllerInception.At this point it is possible to The base class to be inherited of plug-in applications is pre-set in host application.In this way, execute inherit operation when, can be with Allow the base class derived from Similar integral host application in plug-in applications.In turn, host application and plug-in unit are answered It could correctly be run with program, and the practical preset function of realization.
The method provided by the embodiment of the present disclosure can be based in plug-in applications pre-stored function and virtual The of pre-stored virtual interface information and interface message in the first correspondence and host application of interface message Two correspondences determine the third correspondence of function and interface message.In this way, can will may be implemented in plug-in applications Objective function be transformed into and realized by the corresponding execution code of target interface information in host application.It in turn, can be with Plug-in applications eliminate the dependence of source application, plug-in applications can be accessed in different host applications In, achieve the purpose that the execution code to plug-in applications is multiplexed.
Disclosure another exemplary embodiment provides a kind of device executing function in the application, as shown in figure 3, The device includes:
Acquisition module 310, pre-stored function and virtual in the plug-in applications for obtaining host application First correspondence of interface message, and obtain pre-stored virtual interface information and interface letter in the host application Second correspondence of breath;
First determining module 320 determines function for being based on first correspondence and second correspondence With the third correspondence of interface message, and the third correspondence is stored;
Second determining module 330, for calling the operation plug-in applications by the host application In the process, when detecting when executing instruction of objective function, it is based on the third correspondence, determines that the objective function corresponds to Target interface information, call and execute the corresponding execution code of the target interface information.
Optionally, the acquisition module 310, is used for:
When host application starts, pre-stored work(in the plug-in applications of the host application is obtained First correspondence of energy and virtual interface information, and obtain pre-stored virtual interface information in the host application With the second correspondence of interface message.
Optionally, the interface message in second correspondence and the third correspondence includes Hyper text transfer association Discuss HTTP request interface message, socket Socket interface messages, locating interface information, sharing interface information, pattern interface letter Breath, notification interface information redirect one or more in interface message, application program life cycle interface message.
Optionally, the plug-in applications are stored in the file of the host application in the form of library file In.
Optionally, described device further includes:
Third determining module is used for during compiling the host application and the plug-in applications, When detecting the instruction for inheriting target former base class, it is based on pre-stored former base class and conversion in the host application The correspondence of base class determines that target corresponding with target former base class converts base class;
Inherit module, the category code for converting base class to pre-stored target in the host application carry out after Hold processing.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, explanation will be not set forth in detail herein.
The method provided by the embodiment of the present disclosure can be based in plug-in applications pre-stored function and virtual The of pre-stored virtual interface information and interface message in the first correspondence and host application of interface message Two correspondences determine the third correspondence of function and interface message.In this way, can will may be implemented in plug-in applications Objective function be transformed into and realized by the corresponding execution code of target interface information in host application.It in turn, can be with Plug-in applications eliminate the dependence of source application, plug-in applications can be accessed in different host applications In, achieve the purpose that the execution code to plug-in applications is multiplexed.
It should be noted that:What above-described embodiment provided executes the device of function in the application in the application Execute function when, only the example of the division of the above functional modules, in practical application, can as needed and will be upper It states function distribution to be completed by different function modules, i.e., the internal structure of terminal is divided into different function modules, to complete All or part of function described above.In addition, above-described embodiment provide in the application execute function device with The embodiment of the method for executing function in the application belongs to same design, and specific implementation process refers to embodiment of the method, this In repeat no more.
Fig. 4 shows the structural schematic diagram for the terminal 1800 that one exemplary embodiment of the disclosure provides.The terminal 1800 Can be:Smart mobile phone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) player, laptop or desktop computer.Terminal 1800 is also It may be referred to as other titles such as user equipment, portable terminal, laptop terminal, terminal console.
In general, terminal 1800 includes:Processor 1801 and memory 1802.
Processor 1801 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field- may be used in reason device 1801 Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed Logic array) at least one of example, in hardware realize.Processor 1801 can also include primary processor and coprocessor, master Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.? In some embodiments, processor 1801 can be integrated with GPU (Graphics Processing Unit, image processor), GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 1801 can also wrap AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processors are for handling related machine learning Calculating operation.
Memory 1802 may include one or more computer readable storage mediums, which can To be non-transient.Memory 1802 may also include high-speed random access memory and nonvolatile memory, such as one Or multiple disk storage equipments, flash memory device.In some embodiments, the non-transient computer in memory 1802 can Storage medium is read for storing at least one instruction, at least one instruction is for performed to realize this Shen by processor 1801 Please in embodiment of the method provide in the application execute function method.
In some embodiments, terminal 1800 is also optional includes:Peripheral device interface 1803 and at least one periphery are set It is standby.It can be connected by bus or signal wire between processor 1801, memory 1802 and peripheral device interface 1803.It is each outer Peripheral equipment can be connected by bus, signal wire or circuit board with peripheral device interface 1803.Specifically, peripheral equipment includes: In radio circuit 1804, touch display screen 1805, camera 1806, voicefrequency circuit 1807, positioning component 1808 and power supply 1809 At least one.
Peripheral device interface 1803 can be used for I/O (Input/Output, input/output) is relevant at least one outer Peripheral equipment is connected to processor 1801 and memory 1802.In some embodiments, processor 1801, memory 1802 and periphery Equipment interface 1803 is integrated on same chip or circuit board;In some other embodiments, processor 1801, memory 1802 and peripheral device interface 1803 in any one or two can be realized on individual chip or circuit board, this implementation Example is not limited this.
Radio circuit 1804 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal. Radio circuit 1804 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 1804 is by telecommunications Number being converted to electromagnetic signal is sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit 1804 include:Antenna system, one or more amplifiers, tuner, oscillator, digital signal processor, compiles solution at RF transceivers Code chipset, user identity module card etc..Radio circuit 1804 can by least one wireless communication protocol come with it is other Terminal is communicated.The wireless communication protocol includes but not limited to:WWW, Metropolitan Area Network (MAN), Intranet, each third generation mobile communication network (2G, 3G, 4G and 5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some implementations In example, radio circuit 1804 can also include NFC (Near Field Communication, wireless near field communication) related Circuit, the application are not limited this.
Display screen 1805 is for showing UI (User Interface, user interface).The UI may include figure, text, Icon, video and its their arbitrary combination.When display screen 1805 is touch display screen, display screen 1805 also there is acquisition to exist The ability of the surface of display screen 1805 or the touch signal of surface.The touch signal can be used as control signal to be input to place Reason device 1801 is handled.At this point, display screen 1805 can be also used for providing virtual push button and/or dummy keyboard, it is also referred to as soft to press Button and/or soft keyboard.In some embodiments, display screen 1805 can be one, and the front panel of terminal 1800 is arranged;Another In a little embodiments, display screen 1805 can be at least two, be separately positioned on the different surfaces of terminal 1800 or in foldover design; In still other embodiments, display screen 1805 can be flexible display screen, be arranged on the curved surface of terminal 1800 or fold On face.Even, display screen 1805 can also be arranged to non-rectangle irregular figure, namely abnormity screen.Display screen 1805 can be with Using LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) etc. materials prepare.
CCD camera assembly 1806 is for acquiring image or video.Optionally, CCD camera assembly 1806 includes front camera And rear camera.In general, the front panel in terminal is arranged in front camera, rear camera is arranged at the back side of terminal.? In some embodiments, rear camera at least two is that main camera, depth of field camera, wide-angle camera, focal length are taken the photograph respectively As any one in head, to realize that main camera and the fusion of depth of field camera realize background blurring function, main camera and wide Pan-shot and VR (Virtual Reality, virtual reality) shooting functions or other fusions are realized in angle camera fusion Shooting function.In some embodiments, CCD camera assembly 1806 can also include flash lamp.Flash lamp can be monochromatic temperature flash of light Lamp can also be double-colored temperature flash lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, be can be used for Light compensation under different-colour.
Voicefrequency circuit 1807 may include microphone and loud speaker.Microphone is used to acquire the sound wave of user and environment, and It converts sound waves into electric signal and is input to processor 1801 and handled, or be input to radio circuit 1804 to realize that voice is logical Letter.For stereo acquisition or the purpose of noise reduction, microphone can be multiple, be separately positioned on the different parts of terminal 1800. Microphone can also be array microphone or omnidirectional's acquisition type microphone.Loud speaker is then used to that processor 1801 or radio frequency will to be come from The electric signal of circuit 1804 is converted to sound wave.Loud speaker can be traditional wafer speaker, can also be that piezoelectric ceramics is raised one's voice Device.When loud speaker is piezoelectric ceramic loudspeaker, the audible sound wave of the mankind can be not only converted electrical signals to, can also be incited somebody to action Electric signal is converted to the sound wave that the mankind do not hear to carry out the purposes such as ranging.In some embodiments, voicefrequency circuit 1807 may be used also To include earphone jack.
Positioning component 1808 is used for the current geographic position of positioning terminal 1800, to realize navigation or LBS (Location Based Service, location based service).Positioning component 1808 can be the GPS (Global based on the U.S. Positioning System, global positioning system), China dipper system or Russia Galileo system positioning group Part.
Power supply 1809 is used to be powered for the various components in terminal 1800.Power supply 1809 can be alternating current, direct current Electricity, disposable battery or rechargeable battery.When power supply 1809 includes rechargeable battery, which can have micro USB Battery or wireless charging battery.Wired charging battery is the battery to be charged by Wireline, and wireless charging battery is to pass through The battery of wireless coil charging.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, terminal 1800 further include there are one or multiple sensors 1810.The one or more senses Device 1810 includes but not limited to:Acceleration transducer 1811, gyro sensor 1812, pressure sensor 1813, fingerprint sensing Device 1814, optical sensor 1815 and proximity sensor 1816.
Acceleration transducer 1811 can detect the acceleration in three reference axis of the coordinate system established with terminal 1800 Size.For example, acceleration transducer 1811 can be used for detecting component of the acceleration of gravity in three reference axis.Processor The 1801 acceleration of gravity signals that can be acquired according to acceleration transducer 1811, control touch display screen 1805 is with transverse views Or longitudinal view carries out the display of user interface.Acceleration transducer 1811 can be also used for game or the exercise data of user Acquisition.
Gyro sensor 1812 can be with the body direction of detection terminal 1800 and rotational angle, gyro sensor 1812 Acquisition user can be cooperateed with to act the 3D of terminal 1800 with acceleration transducer 1811.Processor 1801 is according to gyro sensors The data that device 1812 acquires, may be implemented following function:Action induction (for example changing UI according to the tilt operation of user) is clapped Image stabilization, game control when taking the photograph and inertial navigation.
The lower layer of side frame and/or touch display screen 1805 in terminal 1800 can be arranged in pressure sensor 1813.When The gripping signal that user can be detected in the side frame of terminal 1800 to terminal 1800 is arranged in pressure sensor 1813, by Reason device 1801 carries out right-hand man's identification or prompt operation according to the gripping signal that pressure sensor 1813 acquires.Work as pressure sensor 1813 are arranged in the lower layer of touch display screen 1805, are grasped to the pressure of touch display screen 1805 according to user by processor 1801 Make, realization controls the operability control on the interfaces UI.Operability control include button control, scroll bar control, At least one of icon control, menu control.
Fingerprint sensor 1814 is used to acquire the fingerprint of user, is collected according to fingerprint sensor 1814 by processor 1801 Fingerprint recognition user identity, alternatively, by fingerprint sensor 1814 according to the identity of collected fingerprint recognition user.Knowing When the identity for not going out user is trusted identity, the user is authorized to execute relevant sensitive operation, sensitivity behaviour by processor 1801 Work includes solving lock screen, checking encryption information, download software, payment and change setting etc..Fingerprint sensor 1814 can be set Set the front, the back side or side of terminal 1800.When being provided with physical button or manufacturer Logo in terminal 1800, fingerprint sensor 1814 can integrate with physical button or manufacturer Logo.
Optical sensor 1815 is for acquiring ambient light intensity.In one embodiment, processor 1801 can be according to light The ambient light intensity that sensor 1815 acquires is learned, the display brightness of touch display screen 1805 is controlled.Specifically, work as ambient light intensity When higher, the display brightness of touch display screen 1805 is turned up;When ambient light intensity is relatively low, the aobvious of touch display screen 1805 is turned down Show brightness.In another embodiment, the ambient light intensity that processor 1801 can also be acquired according to optical sensor 1815, is moved State adjusts the acquisition parameters of CCD camera assembly 1806.
Proximity sensor 1816, also referred to as range sensor are generally arranged at the front panel of terminal 1800.Proximity sensor 1816 the distance between the front for acquiring user and terminal 1800.In one embodiment, when proximity sensor 1816 is examined When measuring the distance between the front of user and terminal 1800 and tapering into, by processor 1801 control touch display screen 1805 from Bright screen state is switched to breath screen state;When proximity sensor 1816 detect the distance between front of user and terminal 1800 by When gradual change is big, touch display screen 1805 is controlled by processor 1801 and is switched to bright screen state from breath screen state.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal 1800 of structure shown in Fig. 4, can wrap It includes than illustrating more or fewer components, either combine certain components or is arranged using different components.
Those skilled in the art will readily occur to its of the disclosure after considering specification and putting into practice disclosure disclosed herein Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and includes the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are wanted by right It asks and points out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.

Claims (12)

1. a kind of method executing function in the application, which is characterized in that the method includes:
The first correspondence of pre-stored function and virtual interface information in the plug-in applications of host application is obtained to close System, and obtain the second correspondence of pre-stored virtual interface information and interface message in the host application;
Based on first correspondence and second correspondence, determine that the third of function and interface message corresponds to pass System, and store the third correspondence;
Called by the host application run the plug-in applications during, when detecting objective function When executing instruction, it is based on the third correspondence, determines the corresponding target interface information of the objective function, calls and executes institute State the corresponding execution code of target interface information.
2. according to the method described in claim 1, it is characterized in that, in the plug-in applications for obtaining host application First correspondence of pre-stored function and virtual interface information, and obtain pre-stored in the host application Second correspondence of virtual interface information and interface message, including:
When host application starts, obtain in the plug-in applications of the host application pre-stored function and First correspondence of virtual interface information, and obtain pre-stored virtual interface information in the host application and connect Second correspondence of message breath.
3. according to the method described in claim 1, it is characterized in that, in second correspondence and the third correspondence Interface message include HTTP request interface message, socket Socket interface messages, locating interface letter Breath, sharing interface information, pattern interface message, notification interface information redirect interface message, application program life cycle interface letter One or more in breath.
4. according to the method described in claim 1, it is characterized in that, the plug-in applications are stored in the form of library file In the file of the host application.
5. according to the method described in claim 1, it is characterized in that, the method further includes:
During compiling the host application and the plug-in applications, target former base class is inherited when detecting Instruction when, based in the host application pre-stored former base class and conversion base class correspondence, determine with The corresponding target of target former base class converts base class;
The category code that base class is converted to pre-stored target in the host application carries out succession processing.
6. a kind of device executing function in the application, which is characterized in that described device includes:
Acquisition module, pre-stored function and virtual interface information in the plug-in applications for obtaining host application The first correspondence, and obtain second of pre-stored virtual interface information and interface message in the host application Correspondence;
First determining module determines function and interface for being based on first correspondence and second correspondence The third correspondence of information, and store the third correspondence;
Second determining module is used for during calling the operation plug-in applications by the host application, When detecting when executing instruction of objective function, it is based on the third correspondence, determines the corresponding target of the objective function Interface message is called and executes the corresponding execution code of the target interface information.
7. device according to claim 6, which is characterized in that the acquisition module is used for:
When host application starts, obtain in the plug-in applications of the host application pre-stored function and First correspondence of virtual interface information, and obtain pre-stored virtual interface information in the host application and connect Second correspondence of message breath.
8. device according to claim 6, which is characterized in that in second correspondence and the third correspondence Interface message include HTTP request interface message, socket Socket interface messages, locating interface letter Breath, sharing interface information, pattern interface message, notification interface information redirect interface message, application program life cycle interface letter One or more in breath.
9. device according to claim 6, which is characterized in that the plug-in applications are stored in the form of library file In the file of the host application.
10. device according to claim 6, which is characterized in that described device further includes:
Third determining module, for during compiling the host application and the plug-in applications, working as inspection When measuring the instruction for inheriting target former base class, based on the pre-stored former base class in the host application and conversion base class Correspondence, determine corresponding with target former base class target conversion base class;
Module is inherited, the category code for converting base class to pre-stored target in the host application carries out at succession Reason.
11. a kind of terminal, which is characterized in that the terminal includes processor, communication interface, memory and communication bus, wherein:
The processor, the communication interface and the memory complete mutual communication by the communication bus;
The memory, for storing computer program;
The processor, for executing the program stored on the memory, to realize any sides claim 1-5 Method step.
12. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 1-5 any method and steps when the computer program is executed by processor.
CN201810594986.8A 2018-06-11 2018-06-11 Method and device for executing function in application program Active CN108717365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810594986.8A CN108717365B (en) 2018-06-11 2018-06-11 Method and device for executing function in application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810594986.8A CN108717365B (en) 2018-06-11 2018-06-11 Method and device for executing function in application program

Publications (2)

Publication Number Publication Date
CN108717365A true CN108717365A (en) 2018-10-30
CN108717365B CN108717365B (en) 2021-03-30

Family

ID=63912086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810594986.8A Active CN108717365B (en) 2018-06-11 2018-06-11 Method and device for executing function in application program

Country Status (1)

Country Link
CN (1) CN108717365B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460222A (en) * 2018-11-07 2019-03-12 广州虎牙科技有限公司 Modularization method, apparatus, equipment and the storage medium of application program
CN109947504A (en) * 2019-03-29 2019-06-28 上海连尚网络科技有限公司 A kind of method and apparatus executing boarding program in host program
CN110286956A (en) * 2019-05-22 2019-09-27 百度在线网络技术(北京)有限公司 Operation method, device and the electronic equipment of plug-in unit
CN111124444A (en) * 2018-11-01 2020-05-08 百度在线网络技术(北京)有限公司 Code injection method and device, computer program product and storage medium
CN113297024A (en) * 2020-02-21 2021-08-24 北京猎户星空科技有限公司 Hardware management method, algorithm execution method, related device and robot

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699405A (en) * 2009-10-26 2010-04-28 中兴通讯股份有限公司 Method and device for interaction between host program and plug-in and interaction between plug-ins
CN104391700A (en) * 2014-11-11 2015-03-04 百度在线网络技术(北京)有限公司 Method and device for expanding functions of application program
CN106934272A (en) * 2017-02-09 2017-07-07 北京奇虎科技有限公司 The method of calibration and device of a kind of application message
US9952844B1 (en) * 2016-10-24 2018-04-24 International Business Machines Corporation Executing optimized local entry points and function call sites

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699405A (en) * 2009-10-26 2010-04-28 中兴通讯股份有限公司 Method and device for interaction between host program and plug-in and interaction between plug-ins
CN104391700A (en) * 2014-11-11 2015-03-04 百度在线网络技术(北京)有限公司 Method and device for expanding functions of application program
US9952844B1 (en) * 2016-10-24 2018-04-24 International Business Machines Corporation Executing optimized local entry points and function call sites
CN106934272A (en) * 2017-02-09 2017-07-07 北京奇虎科技有限公司 The method of calibration and device of a kind of application message

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124444A (en) * 2018-11-01 2020-05-08 百度在线网络技术(北京)有限公司 Code injection method and device, computer program product and storage medium
CN111124444B (en) * 2018-11-01 2023-12-19 百度在线网络技术(北京)有限公司 Method of code injection, apparatus therefor, computer program product, and storage medium
CN109460222A (en) * 2018-11-07 2019-03-12 广州虎牙科技有限公司 Modularization method, apparatus, equipment and the storage medium of application program
CN109947504A (en) * 2019-03-29 2019-06-28 上海连尚网络科技有限公司 A kind of method and apparatus executing boarding program in host program
CN109947504B (en) * 2019-03-29 2020-12-18 上海连尚网络科技有限公司 Method and equipment for executing hosted program in hosted program
CN110286956A (en) * 2019-05-22 2019-09-27 百度在线网络技术(北京)有限公司 Operation method, device and the electronic equipment of plug-in unit
CN113297024A (en) * 2020-02-21 2021-08-24 北京猎户星空科技有限公司 Hardware management method, algorithm execution method, related device and robot

Also Published As

Publication number Publication date
CN108717365B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN108717365A (en) The method and apparatus for executing function in the application
CN108401124A (en) The method and apparatus of video record
CN108391171A (en) Control method and device, the terminal of video playing
CN108897597A (en) The method and apparatus of guidance configuration live streaming template
CN110333834A (en) Frame frequency method of adjustment and device, display equipment, computer readable storage medium
CN110659127A (en) Method, device and system for processing task
CN110784370B (en) Method and device for testing equipment, electronic equipment and medium
CN108900925A (en) The method and apparatus of live streaming template are set
CN108737897A (en) Video broadcasting method, device, equipment and storage medium
CN110288689A (en) The method and apparatus that electronic map is rendered
CN108563377A (en) The method and apparatus that switching shows the page
CN109828915B (en) Method, device, equipment and storage medium for debugging application program
CN111142838A (en) Audio playing method and device, computer equipment and storage medium
CN109982129A (en) Control method for playing back, device and the storage medium of short-sighted frequency
CN109218751A (en) The method, apparatus and system of recommendation of audio
CN110677713B (en) Video image processing method and device and storage medium
CN109254775A (en) Image processing method, terminal and storage medium based on face
CN108848492A (en) Enabling method, apparatus, terminal and the storage medium of subscriber identification card
CN108509620A (en) Song recognition method and device, storage medium
CN108829582A (en) The method and apparatus of program compatibility
CN111192072A (en) User grouping method and device and storage medium
CN110275655A (en) Lyric display method, device, equipment and storage medium
CN110109770A (en) Adjustment method, device, electronic equipment and medium
CN113843814A (en) Control system, method, device and storage medium for mechanical arm equipment
CN108922533A (en) Determine whether the method and apparatus sung in the real sense

Legal Events

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

Effective date of registration: 20220329

Address after: 4119, 41st floor, building 1, No.500, middle section of Tianfu Avenue, Chengdu hi tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan 610000

Patentee after: Chengdu kugou business incubator management Co.,Ltd.

Address before: No. 315, Huangpu Avenue middle, Tianhe District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right