Call method, component interface device, electronic equipment and the App of App functional module
Technical field
The application is related to field of computer technology, more particularly to a kind of call method, the component interface of App functional module
Device, electronic equipment and App.
Background technology
Mobile terminal apply development field, Native App (locally applied) by extensive development and application,
Native App are one kind based on intelligent terminal native operating sys-tern (such as iOS, Android, WP) and write using primary formula
The third party application of operation.During Native App are developed, each App can form many functional module (work(
Energy component).In fact, between different App, there are many identical functions, for such situation, in opening for new App
During hair, App development efficiency can be improved by the transplanting of functional module.
But, in the prior art, during the transplanting of functional module is carried out, there is following defect:
Due to application environment targeted different App, tactful difference is write, is caused used between different App
The factor such as architecture and UI Component Galleries is differed, when causing the function to migrate can not simply smooth migration, it is necessary to by its
Whole dependence storehouses required for his App functional module cause transition process to introduce a large amount of useless also with target App is entered
Storehouse.
In addition, after finishing migration, adapting to target App's because can also do some in transition process to the functional module of migration
Transformation, so, what is used in latter two App that can cause migration is not same set of code, it is impossible to eaily it is carried out
Upgrade maintenance.
The content of the invention
The invention provides a kind of call method of App functional module, component interface device, electronic equipment and App, with
In the migration process of functional unit, smooth migration is realized, and facilitate the upgrading and maintenance of code.
To reach above-mentioned purpose, embodiments of the invention are adopted the following technical scheme that:
First aspect there is provided a kind of call method of App functional module, including:
Upper application module sends the standard package call instruction for standard package to component interface device;
The standard package call instruction is adapted to by the component interface device, and generation is directed to bottom non-standard features
Non-standard features recalls information;
The component interface device calls the bottom non-standard features according to the non-standard features recalls information.
Second aspect there is provided a kind of component interface device, including:Context module and component manager,
The context module, the standard package for standard package for receiving and recognizing upper application module transmission
Call instruction, and it is sent to the component manager;
The component manager, for the standard package call instruction to be adapted to, generation is non-standard for bottom
The non-standard features recalls information of component, and according to the non-standard features recalls information, call the bottom non-standard features.
The third aspect there is provided a kind of electronic equipment, including:
Memory, for storage program;
Processor, coupled to the memory, for performing described program, for:
Upper application module sends the standard package call instruction for standard package to component interface device;
The standard package call instruction is adapted to by the component interface device, and generation is directed to bottom non-standard features
Non-standard features recalls information;
The component interface device calls the bottom non-standard features according to the non-standard features recalls information.
Fourth aspect there is provided a kind of App, including:
Upper application module, bottom non-standard features and the component interface dress as any one of claim 4-8
Put, the upper application module is called by accessing the component interface device to the bottom non-standard features.
Call method, component interface device, electronic equipment and the App of the functional module for the App that the present invention is provided, using
The component interface device set in App, when upper application module calls bottom component, can first pass through component interface device will
The standard package call instruction that upper application module is issued is adapted to, non-standard features of the generation for bottom non-standard features
Recalls information;Then, component interface device can call bottom non-standard features according to non-standard features recalls information, so that
Mask bottom non-standard features and applying upper difference with target App, facilitate the upgrading and maintenance of code, save exploitation
Cost.
Described above is only the general introduction of technical scheme, in order to better understand the technological means of the application,
And can be practiced according to the content of specification, and in order to allow above and other objects, features and advantages of the application can
Become apparent, below especially exemplified by the embodiment of the application.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the application
Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 is the structural representation of the calling system of the App of embodiment of the present invention functional module;
Fig. 2 is the schematic flow sheet of the call method of the App of the embodiment of the present invention one functional module;
Fig. 3 is the structural representation one of the component interface device of the embodiment of the present invention two;
Fig. 4 is the structural representation two of the component interface device of the embodiment of the present invention two;
Fig. 5 is the structural representation of the electronic equipment of the embodiment of the present invention three.
Fig. 6 is the App of the embodiment of the present invention four structural representation;
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
The present invention is changed in the prior art, when being transplanted to existing locally applied functional unit, it is necessary to will
Whole dependence storehouses required for the functional module of the App cause transition process to introduce a large amount of useless also with target App is entered
The migration process in storehouse, its core concept is, by setting up a component interface device in App, to manage what is generated
Functional unit, the functional unit generated is registered in component interface device as bottom non-standard features, and then component connects
Mouth device provides standard package interface to upper application module, so as to mask bottom non-standard features with target App in application
On difference.Because target App upper application module is not directly to go to call bottom non-standard features, but there is conduct
The component interface device of intermediary interface layer, in the migration process of functional unit, it is not necessary to import and all rely on storehouse, it is only necessary to lead
Enter the dependence storehouse corresponding to the function of target App needs, in addition, during transplanting, it is not necessary to the function of migration
Component carries out any modification because bottom non-standard features have been masked by component interface device completely with upper layer application mould
Difference between the method for calling of block, so as to facilitate the upgrading and maintenance of code, saves development cost.
Specifically, based on this thought, the embodiments of the invention provide calling for App as shown in Figure 1 functional module
The structural representation of system, including:Existing functional unit (bottom non-standard features) in App and each App.In fact, in App
Existing non-standard features should be included in what is existed in App as App intrinsic component, but these non-standard features institute is right
The primary development and application answered may not be the App being currently located, for example, being potentially included in poly- treasured App in Alipay wallet App
Primary component, the primary component in mobile phone Taobao App is potentially included in Alipay wallet App, therefore, is shown as in Fig. 1
Any App can include the primary component developed based on a certain App, and non-standard as the bottom in this App applications
Component, wherein, the corresponding primary component of poly- treasured App can be designated as gathering treasured impl, the corresponding primary components of Alipay wallet App can
Mobile phone Taobao impl can be designated as to be designated as the corresponding primary component of Alipay wallet impl, mobile phone Taobao App.In the system figure
Each non-standard features are separately shown with App, and the App being intended in explanation, the system is any App referred to, such as poly- precious, branch
Pay precious wallet, mobile phone Taobao etc., the App can using itself corresponding primary component as a bottom non-standard features, while
Can be using other App primary component as the non-standard features of itself, and be by component interface in each invocation component
Device calls these bottom non-standard features, therefore App is separately shown with non-standard features.App upper application module will
Want to call any non-standard features to be required for component interface device to be adapted to call instruction, could realize to corresponding nonstandard
Prospective component is called.
Include upper application module and component interface device in an App.
Upper application module, for the service response of response external business side, the standard of being directed to is sent to component interface device
The standard package call instruction of component, to complete the invoked procedure of a standard package, i.e., makes business sound to external business side
The process answered.Here application module can be understood as in App, the inlet module of the service request for obtaining business side, can
To be realized by human-computer interaction interface, such as " self-selected stock " in interactive interface, " information ", " stock market ", " fund details ",
" stock details " etc. it is similar can jump page application module.
Component interface device, as the crucial executive agent of invocation component, it is receiving upper application module transmission
After standard package call instruction, standard package call instruction is adapted to, generation is non-standard for bottom non-standard features
Component call information.In this programme, the upper application module in each App is all in accordance with tune when calling bottom component, in fact
Call instruction is sent with the mode of standard package, it is right according to the function institute needed that the standard package can be understood as target App
The functional unit called can be achieved in the dependence storehouse answered, for example, the poly- precious impl (primary component) included in itself in poly- treasured App is i.e.
The standard package for gathering treasured App can be used as.When actually calling, called bottom component may not be based on current App exploitations
Standard package, it is therefore desirable to standard package call instruction is adapted to by component interface device, generation be directed to current bottom
The non-standard features recalls information of layer non-standard features, then by component interface device according to the non-standard features recalls information pair
Corresponding bottom non-standard features perform invoked procedure.
Further, component interface device may include:Context module, component manager, the storage of standard package sets of interfaces
Unit, tool set and configuration manager.
Context module, the standard package for standard package for receiving and recognizing upper application module transmission is called
Instruction, and it is sent to component manager.Wherein, include upper application module in standard package call instruction and call standard package
Required all relevant informations, information, the call parameters information of such as standard package.Context module is filled as component interface
The inlet module put, has prestored the context on component interface module inside it, can be each in component interface module
The description information of functional module.The instruction that context module can be inputted to external world according to the context prestored is known
Not, the content according to identification is also needed to sometimes, and a certain amount of data filling is carried out to it.For example, what upper application module was sent
The necessary command information of standard package is called for can only be carried in the standard package call instruction of standard package, and for mark
Transfer environment data of prospective component etc. are supplemented after instruction being identified by context module, then by the number of supplement
Together it is sent to component manager to complete the invoked procedure to component according to same standard package call instruction.
Component manager, for standard package call instruction to be adapted to, generation is non-for bottom non-standard features
Standard package recalls information, and according to non-standard features recalls information, call bottom non-standard features.In other words, assembly management
Device is the executive agent that the realization to all component is managed and performed.
Standard package sets of interfaces memory cell, for storage assembly registration table, there be associated record in the component register table
The module information and standard package interface message of bottom non-standard features.
In the standard package call instruction that upper application module is sent, including standard package interface message.Assembly management
Device is adapted to by standard package call instruction, when generation is directed to the non-standard features recalls information of bottom non-standard features,
Can be by performing:
Component register table is searched according to standard package interface message, so as to obtain corresponding with the standard package interface message
The module information of bottom non-standard features, using the module information as non-standard features recalls information, to complete non-standard features
The generating process of recalls information.
Component manager can perform following function:
Create the example of non-standard features and return to caller;
The related various information of query criteria component, including the realization of certain standard package, tool whether are provided in current App
The provider that body is realized is who waits some standard package relevant informations.
Specifically, component interface device when calling bottom non-standard features, can lead to according to non-standard features recalls information
Component manager is crossed according to non-standard features recalls information, finds that bottom non-standard features are corresponding to realize class, and creates bottom
The corresponding example of non-standard features.Wherein, it is between the corresponding class of standard package interface class corresponding with bottom non-standard features
Inheritance.
Configuration manager:For each functional module in component interface device to be managed for configuration, including such as configuration file
The a series of work such as storage, management, parsing, checking.
Tool set:For providing some and component interface device phase to each functional module inside or outside component interface device
The tool-class and tool method of pass, the convenience used for lifting assembly interface arrangement, ease for use.
Technical scheme is further illustrated below by multiple embodiments.
Embodiment one
As shown in Fig. 2 its schematic flow sheet one for the call method of the App of the embodiment of the present invention one functional module,
This method includes:
210, upper application module sends the standard package call instruction for standard package to component interface device.
Specifically, the service request of upper application module response external business side, sends for mark to component interface device
The standard package call instruction of prospective component, to complete the invoked procedure of a standard package, i.e., makes business to external business side
The process of response.Here application module can be understood as in App, the inlet module of the service request for obtaining business side,
Can be realized by human-computer interaction interface, such as " self-selected stock " in interactive interface, " information ", " stock market ", " fund details ",
" stock details " etc. it is similar can jump page application module.
For example, when user clicks on some operable item on interactive interface in App, corresponding application module will be by
The operation of user is considered as external business Fang Xiang and obtains the request of the corresponding business of the action-item, and makes corresponding service response,
The standard package call instruction for being directed to the standard package called required for this service request is sent to component interface device, with
Complete the invoked procedure of a standard package.Wherein, described standard package refers to that each App completes a functional unit tune
Used time, it need to only import the dependence storehouse corresponding to the function of this App needs and the functional unit called can be achieved, for example, above-mentioned carry
And based on some App develop primary component, you can be considered as the corresponding standard package of the App.
Standard package call instruction is adapted to by S220, component interface device, and generation is for bottom non-standard features
Non-standard features recalls information.
Specifically, because the bottom component in current App is that the component of all bottoms (is accordingly to be regarded as by non-standard features here
Non-standard features), therefore, before these non-standard features are called, first the instruction of above-mentioned standard component call is adapted to,
Generation, which is directed in the non-standard features recalls information of bottom non-standard features, the information, may include:Title, the ginseng of non-standard features
Several, storage location, component developer etc..
S230, component interface device calls bottom non-standard features according to non-standard features recalls information.
After component interface device generation non-standard features recalls information, bottom is called according to the non-standard features recalls information
Non-standard features, to complete corresponding funcall.For example, according to non-standard features recalls information, finding non-standard group of bottom
Part is corresponding to realize class, and creates the corresponding example of bottom non-standard features, to complete a funcall.
Further, in order to be quickly adapted to standard package call instruction, non-standard features recalls information is generated,
This programme is prefixed a component register table in component interface device, and associated record has bottom non-standard in the component register table
The module information and standard package interface message of component.Wherein, standard package interface message includes:The corresponding component of standard package
Interface protocol (protocol statements, the type of call parameters, form etc.), and the description information related to standard package etc.;It is nonstandard
The module information of prospective component includes:Title, parameter item, the storage location of non-standard features, component developer etc..
In the standard package call instruction that component interface device is received, the interface message of standard package is contained, therefore,
Component interface device can search component register table according to standard package interface message, obtain and the standard package interface message pair
The module information for the bottom non-standard features answered, and using the module information as non-standard features recalls information, then to nonstandard
Prospective component is performed and called.
The call method of the functional module for the App that the present embodiment is provided, using the component interface device set in App,
When upper application module calls bottom component, the standard group that component interface device issues upper application module can be first passed through
Part call instruction is adapted to, non-standard features recalls information of the generation for bottom non-standard features;Then, component interface is filled
Bottom non-standard features can be called according to non-standard features recalls information by putting, so as to mask bottom non-standard features and mesh
Mark App and applying upper difference, facilitate the upgrading and maintenance of code, save development cost.
Embodiment two
As shown in figure 3, the structural representation one of the component interface device for the embodiment of the present invention two, it includes:Context
Module 310 and component manager 320.
Context module 310, the standard package for standard package for receiving and recognizing upper application module transmission
Call instruction, and it is sent to component manager 320;
Component manager 320, for standard package call instruction to be adapted to, generation is for bottom non-standard features
Non-standard features recalls information, and according to non-standard features recalls information, call bottom non-standard features.
Further, the standard package for standard package that the identification of context module 310 upper application module is sent is adjusted
With instruction, and component manager 320 is sent to, including:
The content of criterion of identification component call instruction, and data are carried out to standard package call instruction according to the result of identification
Supplement, and the data of supplement and standard package call instruction are together sent to component manager.
Further, as shown in figure 4, said modules interface arrangement may also include:
Standard package sets of interfaces memory cell 330, for storage assembly registration table, associated record has bottom in component register table
The module information and standard package interface message of layer non-standard features;
Accordingly, standard package call instruction includes standard package interface message;Standard package call instruction is carried out
Adaptation, generation may include for the non-standard features recalls information of bottom non-standard features:
Component register table is searched according to standard package interface message, bottom corresponding with the standard package interface message is obtained
The module information of non-standard features, regard the module information as non-standard features recalls information.
Further, according to non-standard features recalls information, bottom non-standard features are called to specifically include:According to non-standard
Component call information, finds that bottom non-standard features are corresponding to realize class, and creates the corresponding example of bottom non-standard features.
Further, it is inheritance between the corresponding class of standard package interface class corresponding with bottom non-standard features.
The component interface device that the present embodiment is provided, is arranged in App, is receiving the standard that upper application module is issued
After component call instruction, the instruction is adapted to, non-standard features recalls information of the generation for bottom non-standard features;So
Afterwards, according to non-standard features recalls information, bottom non-standard features are called, so as to mask bottom non-standard features and target
App is applying upper difference, facilitates the upgrading and maintenance of code, saves development cost.
Embodiment three
It disclosed the built-in function and structure of component interface device, the device can be realized as a kind of electronic equipment, such as
Shown in Fig. 5, it is the structural representation of the electronic equipment of the embodiment of the present invention three, is specifically included:Memory 510 and processor
520。
Memory 510, for storage program.
In addition to said procedure, memory 510 is also configured to the other various data of storage to support in electronic equipment
On operation.The example of these data includes the instruction of any application program or method for operating on an electronic device, connection
It is personal data, telephone book data, message, picture, video etc..
Memory 510 can realize by any kind of volatibility or non-volatile memory device or combinations thereof,
Such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), erasable programmable is read-only
Memory (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, flash memory, disk
Or CD.
Processor 520, coupled to memory 510, for performing the program in memory 510, for:
Upper application module sends the standard package call instruction for standard package to component interface device;
The standard package call instruction is adapted to by the component interface device, and generation is directed to bottom non-standard features
Non-standard features recalls information;
The component interface device calls the bottom non-standard features according to the non-standard features recalls information.
Above-mentioned specific processing operation is described in detail in preceding embodiment, will not be repeated here.
Further, as shown in figure 5, electronic equipment can also include:Communication component 530, power supply module 540, audio-frequency assembly
550th, other components such as display 560.Members are only schematically provided in Fig. 5, are not meant to that electronic equipment only includes Fig. 5
Shown component.
Communication component 530 is configured to facilitate the communication of wired or wireless way between electronic equipment and other equipment.Electricity
Sub- equipment can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.It is exemplary at one
In embodiment, communication component 530 receives broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel
Information.In one exemplary embodiment, communication component 530 also includes near-field communication (NFC) module, to promote junction service.
For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) skill can be based in NFC module
Art, bluetooth (BT) technology and other technologies are realized.
Power supply module 540, electric power is provided for the various assemblies of electronic equipment.Power supply module 540 can include power management
System, one or more power supplys, and other generate, manage and distribute the component that electric power is associated with for electronic equipment.
Audio-frequency assembly 550 is configured as output and/or input audio signal.For example, audio-frequency assembly 550 includes a Mike
Wind (MIC), when electronic equipment be in operator scheme, when such as call model, logging mode and speech recognition mode, microphone by with
It is set to reception external audio signal.The audio signal received can be further stored in memory 510 or via communication set
Part 530 is sent.In certain embodiments, audio-frequency assembly 550 also includes a loudspeaker, for exports audio signal.
Display 560 includes screen, and its screen can include liquid crystal display (LCD) and touch panel (TP).If screen
Curtain includes touch panel, and screen may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one
Individual or multiple touch sensors are with the gesture on sensing touch, slip and touch panel.Touch sensor can not only sense tactile
Touch or sliding action border, but also detection and touch or slide related duration and pressure.
Example IV
As shown in fig. 6, the structural representation of the App for the embodiment of the present invention four, it includes:
Upper application module 610, bottom non-standard features 620 and the component interface device 630 as shown in Fig. 4 or Fig. 5,
Wherein, upper application module 610 is called by accessing component interface device 630 to bottom non-standard features 620.
The App that the present embodiment is provided, in the migration process of functional unit, realizes smooth migration, and facilitate code
Upgrading and maintenance.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, performs the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is only to the technical scheme for illustrating the application, rather than its limitations;To the greatest extent
The application is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from each embodiment technology of the application
The scope of scheme.