Movatterモバイル変換


[0]ホーム

URL:


CN110413352A - The call method and device of application component - Google Patents

The call method and device of application component
Download PDF

Info

Publication number
CN110413352A
CN110413352ACN201910636931.3ACN201910636931ACN110413352ACN 110413352 ACN110413352 ACN 110413352ACN 201910636931 ACN201910636931 ACN 201910636931ACN 110413352 ACN110413352 ACN 110413352A
Authority
CN
China
Prior art keywords
component
mark
application
called
module
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
CN201910636931.3A
Other languages
Chinese (zh)
Other versions
CN110413352B (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.)
Sky Eye Technology Co Ltd
Original Assignee
Sky Eye 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 Sky Eye Technology Co LtdfiledCriticalSky Eye Technology Co Ltd
Priority to CN201910636931.3ApriorityCriticalpatent/CN110413352B/en
Publication of CN110413352ApublicationCriticalpatent/CN110413352A/en
Application grantedgrantedCritical
Publication of CN110413352BpublicationCriticalpatent/CN110413352B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention discloses a kind of call method of application component and devices, wherein method includes: to obtain the component request of application component;According to the component mark inquiry relation mapping table of component request, the component mark of component to be called is determined;It determines that the corresponding component of component to be called is intended to according to component mark, and is intended to activate component to be called according to component.Hereby it is achieved that the calling purpose of application component such as Android inter-module, the application component calling solved between difference Moudle module in the prior art is excessively complicated, cumbersome, the technical issues of causing later maintenance cost higher, reduce usage experience.

Description

The call method and device of application component
Technical field
The present invention relates to application program technical field, in particular to the call method and device of a kind of application component.
Background technique
In the process of development, since projects module is more, need to split into different Moudle modules according to function, stillEach Moudle module is not completely independent, it is sometimes desirable to be called the application component of other Moudle modules, such as supplemented module with moneyWhen supplementing operation with money, if user is not logged in, needs to jump to login page in login module and logged in, need to illustrateIt is between each Moudle module and complementary relationship to be not present, the group of login module can not be got by such as supplementing module with moneyPart identifies object, leads to not directly start login page by the Intent of Android.
In the related technology, the application component of other modules is activated by hidden schematic diagram, or by sending broadcast starting mouldThe application component of block.But the later maintenance of the relevant technologies is excessively complicated, such as changes the call flow of component, could make hiddenThe packet name class name change of the component of schematic diagram starting, joins, no in another example need to be passed to the page of other modules by way of broadcastBut component call is complicated, and maintenance cost is higher, it would be highly desirable to improve.
Summary of the invention
The present invention proposes the call method and device of a kind of application component, to solve difference Moudle module in the prior artBetween component call it is excessively complicated, cumbersome, the technical issues of causing later maintenance cost higher, reduce usage experience.
First aspect present invention embodiment proposes a kind of call method of application component, comprising: obtains application componentComponent request;According to the component mark inquiry relation mapping table of component request, the component mark of component to be called is determined;RootDetermine that the corresponding component of the component to be called is intended to according to component mark, and described wait adjust according to component intention activationUse component.
The call method of the application component of the embodiment of the present invention determines the component mark of component to be called by relation mapping tableKnow, to find corresponding intention, rather than is directly intended to by the component mark building of component, avoids different Moudle modulesBetween the problem of cannot mutually calling, simplify component call, easy to maintain, effective promotion usage experience, preferably meeting makesWith demand, the calling purpose of application component such as Android inter-module is realized, solves difference Moudle module in the prior artBetween component call problem it is excessively complicated, cumbersome, the technical issues of causing later maintenance cost higher, reduce usage experience.
Second inventive embodiments of the invention propose a kind of calling device of application component, comprising: module are obtained, for obtainingThe component of application component is taken to request;Enquiry module, the component mark inquiry relation mapping table for being requested according to the component, reallyThe component mark of fixed component to be called;Calling module, for determining that the component to be called is corresponding according to component markComponent is intended to, and is intended to activate the component to be called according to the component.
The calling device of the application component of the embodiment of the present invention determines the component mark of component to be called by relation mapping tableKnow, to find corresponding intention, rather than is directly intended to by the component mark building of component, avoids different Moudle modulesBetween the problem of cannot mutually calling, simplify component call, easy to maintain, effective promotion usage experience, preferably meeting makesWith demand, the calling purpose of application component such as Android inter-module is realized, solves difference Moudle module in the prior artBetween component call problem it is excessively complicated, cumbersome, the technical issues of causing later maintenance cost higher, reduce usage experience.
Third aspect present invention embodiment proposes a kind of computer equipment, including processor and memory;Wherein, describedProcessor is corresponding with the executable program code to run by reading the executable program code stored in the memoryProgram, with the call method for realizing the application component as described in above-mentioned one side embodiment.
Fourth aspect present invention embodiment proposes a kind of computer readable storage medium, is stored thereon with computer journeySequence realizes the called side of the application component as described in above-mentioned one side embodiment when the computer program is executed by processorMethod.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partially become from the following descriptionObviously, or practice through the invention is recognized.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodimentsObviously and it is readily appreciated that, in which:
Fig. 1 is a kind of flow diagram of the call method of application component provided by the embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of the calling device of application component provided by the embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to endSame or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attachedThe embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
The call method and device of the application component proposed according to embodiments of the present invention are described with reference to the accompanying drawings, first willDescribe the call method of the application component proposed according to embodiments of the present invention with reference to the accompanying drawings.
For in above-mentioned background, mentioning since each Moudle module is not completely independent, it is sometimes desirable to call otherThe component of Moudle module, but between each Moudle module and complementary relationship is not present, it is therefore desirable to a callingProcess, but call flow is excessively complicated in the prior art, cumbersome, not only later maintenance cost is higher, and reduces and use bodyIt tests, is unable to satisfy use demand, all present invention propose a kind of call method of application component, may be implemented to manage and maintain eachThe routing module called between component effectively solves the problems, such as the component call between this disparate modules, keeps component call simpleChange, it is easy to maintain.
Fig. 1 is a kind of flow diagram of the call method of application component provided by the embodiment of the present invention.
As shown in Figure 1, the call method of the application component of the embodiment of the present invention, comprising:
In step s101, the component request of application component is obtained.
It will describe in detail by taking Android component as an example to the calling of application component in following part of the invention.ThoughRight following embodiment is by taking Android component as an example, it will be understood by those skilled in the art that for any application componentIt can be configured by following similar fashion, the present invention simultaneously loses and is limited to Android component.
It is understood that the embodiment of the present invention is to realize to manage and maintain the routing module called between each component, it canThe request of the component of the calling of each Android component is regarded as a route requests, such as opens new page, opens service,So as to externally provide a display intention or hidden schematic diagram according to constructing variable.
In step s 102, according to the component mark inquiry relation mapping table of component request, the group of component to be called is determinedPart mark.
It should be noted that compared with the prior art, the embodiment of the present invention can be identified by component and find corresponding meaningFigure, rather than be directly intended to by the component mark building of component, so as to avoid what cannot mutually be called between disparate modulesProblem.
Wherein, in one embodiment of the invention, requested according to component component mark inquiry relation mapping table itBefore, method further include: each application component is marked by explaining, to generate the component mark of each application component;According to eachThe component mark and component mark of application component pass through class generator production Methods mapping table.
Optionally, in one embodiment of the invention, component mark may include in bytecode, packet name and class name informationIt is one or more.
It is understood that the value being stored in the key-value pair in mapping table can be bytecode, it is also possible to Android groupThe information such as the packet name of part, class name, can be configured as the case may be, be not particularly limited herein.
For example, for the ease of later maintenance and management, as a kind of possible implementation, the embodiment of the present invention pairIn the collection of the module information of Android, it can be explained by addition@Route onto the class of associated component, be given in the noteComponent distributes a unique character string key (such as@Route (key=" login ") is used in above the Activity logged in), intoAnd in compilation process, by annotation processor collect the packet names of all Android components explained by@Route, class name,Bytecode and the corresponding character string key of routing, form the data of a Map structure, wherein key is to obtain from Router noteThe character string key arrived, value be packet name, class name, bytecode Information encapsulation object, to generate Router class, i.e. compiling durationBetween can pass through class generator generate Router class java file.
For module information is formed mapping table, the static state that can be Map in one structure of procedure initialization for generating classMember mTable, wherein key is character string, is worth for call request.It is internal publicly-owned to traverse the module information generation being collected into aboveThe interface Const and static code block of access authority take character string key and module information value, and key are turned capitalizationIt is added in Const interface as member name using key member as value, module information is configured to call by factory class and is askedIt asks, character string key and call request is added in mTable, and then form the relationship map of call request and component markTable.
Further, in one embodiment of the invention, before obtaining the component request of application component, method is also wrappedIt includes: when starting application program, initialization routing, and will be in the memory of relation mapping table deposit routing.
Can with and understand, using explain mark Android component, to component distribute a unique key after, volumeIt translates the phase to collect the key explained and be annotated the class bytecode marked, the mapping table in routing class is generated by class generator, is madeInitialization routing when obtaining application program launching, will be in the Map of mapping relations deposit memory.
In step s 103, it determines that the corresponding component of component to be called is intended to according to component mark, and is intended to according to componentActivate component to be called.
Specifically, dependence library of the Router as the bottom needs each Module module using routing in projectDependent on the library Router, so that compiling duration can obtain all Android components explained by@Route, and will be allThe Android component of Module module is all stored in the same mapping table, realizes that disparate modules pass through the side of key or urlFormula can call directly the Android component of other modules.
Further, in one embodiment of the invention, component request includes call parameters, wherein is anticipated according to componentFigure activates component to be called, comprising: additional call parameters are intended to component, it is to be called to be intended to activation by the component after addingComponent.
It is understood that using key and the parameter for needing to pass to component after the Map of mapping relations deposit memoryCall request is constructed, the key that route internal is requested in mapping table Map by query calls, obtaining needs Android to be startedThe component of component identifies, and determines that the Android component for needing to call is intended to, and gives and be intended to the additional calling ginseng for passing to componentNumber, and then by being intended to activate component to be called.
Further, in one embodiment of the invention, the corresponding component of component to be called is determined according to component markIt is intended to, comprising: the function of search request and/or the function according to url invocation component are added, to determine component by bean enginesIt is intended to.
It is understood that bean engines can be used as the middleware between routing and request, effect is according to characterString key finds corresponding request, and to request corresponding intention additional parameter and flag, and execution request etc..
Wherein, to find corresponding request, as a kind of mode in the cards, the embodiment of the present invention can be RouterClass adds power function, such as adds the function of search request, wherein the call parameters of function are the key of character string type, functionFunction can be according to key search mTable in call request, for another example add the function according to url invocation component, whereinArrange url rule so that parsing url, can obtain component name in path and component type and parameter, by component name andComponent type, constructs corresponding bean engines, and parameter is formed bundle, is added to bean engines, to pass through bean enginesCorresponding intention can be found by character string, rather than is directly intended to by the component mark building of Android component, effectivelyIt avoids the problem that mutually calling between disparate modules.
To sum up, the embodiment of the present invention supports the mode invocation component of url, without giving the longer url of component definition, onlyAs soon as needing a brief title abbreviation, can support to call by way of url
The call flow for simplifying the prior art supports chain type calling
Therefore, the component call problem between disparate modules not only may be implemented in the embodiment of the present invention, and makes component tuneIt is easy to maintain with simplification.
The call method of application component according to an embodiment of the present invention determines the group of component to be called by relation mapping tablePart mark to find corresponding intention, rather than is directly intended to by the component mark building of component, avoids different MoudleThe problem of cannot mutually calling between module, simplifies component call, easy to maintain, effectively promotion usage experience, preferably fullSufficient use demand realizes the calling purpose between application component, solves the group between difference Moudle module in the prior artPart calls problem excessively complicated, cumbersome, the technical issues of causing later maintenance cost higher, reduce usage experience.
Referring next to the calling device for the application component that attached drawing description proposes according to embodiments of the present invention.
Fig. 2 is a kind of structural schematic diagram of the calling device of application component provided by the embodiment of the present invention.
As shown in Fig. 2, the calling device 10 of the application component includes: to obtain module 100, enquiry module and calling module300。
Wherein, the component request that module 100 obtains application component is obtained.The component that enquiry module 200 is requested according to componentMark inquiry relation mapping table determines the component mark of component to be called.Calling module 300 is to be called according to component mark determinationThe corresponding component of component is intended to, and is intended to activate component to be called according to component.Calling device 10 according to an embodiment of the present inventionThe component mark that component to be called can be determined by relation mapping table, to find corresponding intention, rather than directly passes through groupThe component mark building of part is intended to, and avoids the problem of cannot mutually calling between different Moudle modules, keeps component call simpleDan Hua, it is easy to maintain, usage experience is effectively promoted, is preferably satisfied the use demand.
Further, in one embodiment of the present of invention kind, the device 10 of the embodiment of the present invention further include: labeling module andGeneration module.Wherein, labeling module marks each application component by explaining, to generate the component mark of each application component.Generation module passes through class generator production Methods mapping table according to the component of each application component mark and component mark.
Further, in one embodiment of the present of invention kind, the device 10 of the embodiment of the present invention further include: pre- storing module.Wherein, pre- storing module is when starting application program, initialization routing, and will be in the memory of relation mapping table deposit routing.
Further, in one embodiment of the present of invention kind, calling module 300 includes: processing unit.Wherein, processing is singleMember is intended to additional call parameters to component, to be intended to activate component to be called by the component after adding.
Further, in one embodiment of the present of invention kind, calling module 300 is further used for adding the letter of search requestFunction several and/or according to url invocation component, to determine that component is intended to by bean engines.
It should be noted that the explanation of the aforementioned call method embodiment to application component is also applied for the embodimentApplication component calling device, details are not described herein again.
The calling device of application component according to an embodiment of the present invention determines the group of component to be called by relation mapping tablePart mark to find corresponding intention, rather than is directly intended to by the component mark building of component, avoids different MoudleThe problem of cannot mutually calling between module, simplifies component call, easy to maintain, effectively promotion usage experience, preferably fullSufficient use demand realizes the calling purpose between application component, solves the group between difference Moudle module in the prior artPart calls problem excessively complicated, cumbersome, the technical issues of causing later maintenance cost higher, reduce usage experience.
In order to realize above-described embodiment, the embodiment of the present invention also proposes a kind of computer equipment, including processor and storageDevice;Wherein, processor is run and the executable program code by reading the executable program code stored in memoryCorresponding program, with the call method for realizing the application component as described in above-described embodiment.
In order to realize above-described embodiment, the embodiment of the present invention also proposes a kind of computer readable storage medium, stores thereonThere is computer program, the call method of the application component as described in above-described embodiment is realized when which is executed by processor.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importanceOr implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed orImplicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, threeIt is a etc., unless otherwise specifically defined.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically showThe description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or examplePoint is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are notIt must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in officeIt can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this fieldArt personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examplesIt closes and combines.
Although the embodiments of the present invention has been shown and described above, it is to be understood that above-described embodiment is exampleProperty, it is not considered as limiting the invention, those skilled in the art within the scope of the invention can be to above-mentionedEmbodiment is changed, modifies, replacement and variant.

Claims (10)

CN201910636931.3A2019-07-152019-07-15Calling method and device of application componentActiveCN110413352B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910636931.3ACN110413352B (en)2019-07-152019-07-15Calling method and device of application component

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910636931.3ACN110413352B (en)2019-07-152019-07-15Calling method and device of application component

Publications (2)

Publication NumberPublication Date
CN110413352Atrue CN110413352A (en)2019-11-05
CN110413352B CN110413352B (en)2020-11-03

Family

ID=68361480

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910636931.3AActiveCN110413352B (en)2019-07-152019-07-15Calling method and device of application component

Country Status (1)

CountryLink
CN (1)CN110413352B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114416215A (en)*2021-12-282022-04-29北京百度网讯科技有限公司Function calling method and device
CN114546536A (en)*2022-03-212022-05-27北京麟卓信息科技有限公司Method for using same android application by multiple android applications on Linux platform

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102541996A (en)*2011-11-222012-07-04大唐软件技术股份有限公司JDBC (java database connectivity) based data access layer building method and device utilizing same
CN103036855A (en)*2011-09-292013-04-10北京新媒传信科技有限公司Achievement device and method of authority management
US20160283357A1 (en)*2014-03-072016-09-29Tencent Technology (Shenzhen) Company LimitedCall stack relationship acquiring method and apparatus
CN106843871A (en)*2017-01-172017-06-13广州赛意信息科技股份有限公司A kind of design system and method for designing of domain model framework
CN108469992A (en)*2018-03-152018-08-31链家网(北京)科技有限公司Process-level method for routing and device of the android system based on URI
CN108536436A (en)*2018-03-152018-09-14链家网(北京)科技有限公司Method rank method for routing and device of the android system based on URI

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103036855A (en)*2011-09-292013-04-10北京新媒传信科技有限公司Achievement device and method of authority management
CN102541996A (en)*2011-11-222012-07-04大唐软件技术股份有限公司JDBC (java database connectivity) based data access layer building method and device utilizing same
US20160283357A1 (en)*2014-03-072016-09-29Tencent Technology (Shenzhen) Company LimitedCall stack relationship acquiring method and apparatus
CN106843871A (en)*2017-01-172017-06-13广州赛意信息科技股份有限公司A kind of design system and method for designing of domain model framework
CN108469992A (en)*2018-03-152018-08-31链家网(北京)科技有限公司Process-level method for routing and device of the android system based on URI
CN108536436A (en)*2018-03-152018-09-14链家网(北京)科技有限公司Method rank method for routing and device of the android system based on URI

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114416215A (en)*2021-12-282022-04-29北京百度网讯科技有限公司Function calling method and device
CN114546536A (en)*2022-03-212022-05-27北京麟卓信息科技有限公司Method for using same android application by multiple android applications on Linux platform
CN114546536B (en)*2022-03-212022-07-05北京麟卓信息科技有限公司Method for using same android application by multiple android applications on Linux platform

Also Published As

Publication numberPublication date
CN110413352B (en)2020-11-03

Similar Documents

PublicationPublication DateTitle
US10318318B2 (en)Extending user interface of a web console
US20120124061A1 (en)Rich Search Over and Deep Integration with Applications
US20120124062A1 (en)Application Transfer Protocol
KR101784784B1 (en)Managing objects using a client-server bridge
US10068108B2 (en)Method and apparatus for secure signing and utilization of distributed computations
US8972489B2 (en)Providing a client interface for a server-based web application programming interface
US20100313197A1 (en)System and method for operating domain profile using database in core framework for sdr mobile terminals
US20130013377A1 (en)Vendor optimization in aggregated environments
CN102054021A (en)Web portal application customization method and system using profiles
WO2006026918A1 (en)Web service registry and method of operation
US9053134B2 (en)View variants in database schema mapping
CN107797823A (en)Business Rule Management method, apparatus, storage medium and computer equipment
Wagner et al.Context as a service-Requirements, design and middleware support
CN110413352A (en)The call method and device of application component
CN105653351B (en)The optimization method and system of java card virtual machine
Zander et al.Context-driven RDF data replication on mobile devices
US7650609B2 (en)Multi-environment document management system access
US7657609B2 (en)Data transfer in a multi-environment document management system access
US20100299652A1 (en)Apparatus and method for managing components in sca system
AU2013287229A1 (en)Thin client for mapping system
El Hog et al.A User-Aware Approach to Provide Adaptive Web Services.
CN109358972A (en)Blog management method, device and the computer system of middleware client
US20130067458A1 (en)Application site of origin reference scheme
CN111857657A (en)Activity creation method, activity creation device, storage medium and computer equipment
VinoskiYaws: Yet another web server

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp