CN108536436A - Method rank method for routing and device of the android system based on URI - Google Patents
Method rank method for routing and device of the android system based on URI Download PDFInfo
- Publication number
- CN108536436A CN108536436A CN201810214764.9A CN201810214764A CN108536436A CN 108536436 A CN108536436 A CN 108536436A CN 201810214764 A CN201810214764 A CN 201810214764A CN 108536436 A CN108536436 A CN 108536436A
- Authority
- CN
- China
- Prior art keywords
- uri
- module
- routing
- mapping table
- calling
- 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.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the present invention discloses a kind of method rank method for routing and device of the android system based on URI, the routing of energy implementation method rank.Method includes:S1, the first module obtain the corresponding URI of the method and obtain the corresponding method names of the URI by inquiring the mapping table of preset URI and method name when calling the method for class of the second module;S2, first module call the corresponding method of the method title, obtain the implementing result of the method.
Description
Technical field
The present embodiments relate to the fields Android, and in particular to a kind of method rank of the android system based on URI
Method for routing and device.
Background technology
Android routings refer to real by URI (Uniform Resource Identifier, uniform resource identifier)
Current bound face is redirected transmits with parameter, and routing plan in the industry can accomplish that being based on java in the code compilation phase explains automatic receive at present
Collect routing relation, avoids the trouble of Active Registration.Called side need to only call router router to transmit URI, certainly by router
The dynamic matching page, injection parameter, and open target pages.But the prior art is not carried out the routing of method rank, i.e., one
The method that module can not directly call the class of another module by router.
Invention content
In view of the shortcomings of the prior art and defect, the embodiment of the present invention provides a kind of android system based on URI's
Method rank method for routing and device.
On the one hand, the embodiment of the present invention proposes a kind of method rank method for routing of the android system based on URI, including:
S1, the first module obtain the corresponding URI of the method, pass through inquiry when calling the method for class of the second module
The mapping table of preset URI and method name obtain the corresponding method names of the URI;
S2, first module call the corresponding method of the method title, obtain the implementing result of the method.
On the other hand, the embodiment of the present invention proposes a kind of method rank route device of the android system based on URI, packet
It includes:
Query unit, for when calling the method for class of the second module, the corresponding URI of the method being obtained, by looking into
Preset URI and the mapping table of method name are ask, the corresponding method names of the URI are obtained;
Call unit obtains the implementing result of the method for calling the corresponding method of the method title.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, including:It processor, memory, bus and is stored in
On memory and the computer program that can run on a processor;
Wherein, the processor, memory complete mutual communication by the bus;
The processor realizes the above method when executing the computer program.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, on the storage medium
It is stored with computer program, which realizes the above method when being executed by processor.
Method rank method for routing and device of the android system provided in an embodiment of the present invention based on URI, the first module
When calling the method for class of the second module, the corresponding URI of the method is obtained first, by inquiring preset URI and method
The mapping table of title obtains the corresponding method names of the URI;Then first module calls the method title corresponding
Method obtains the implementing result of the method, and compared to the prior art, this programme can be routed to another module by URI
The method of class decouples the calling dependence of class, the routing of implementation method rank.
Description of the drawings
Fig. 1 is the flow diagram of method rank method for routing one embodiment of the android system of the present invention based on URI;
Fig. 2 is that the flow of method rank method for routing another embodiment of the android system of the present invention based on URI is illustrated
Figure;
Fig. 3 is the structural schematic diagram of method rank route device one embodiment of the android system of the present invention based on URI;
Fig. 4 is the entity structure schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical solution in the embodiment of the present invention is explicitly described, it is clear that described embodiment is the present invention
A part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not having
The every other embodiment obtained under the premise of creative work is made, the range of protection of the embodiment of the present invention is belonged to.
Referring to Fig. 1, the present embodiment discloses a kind of method rank method for routing of the android system based on URI, including:
S1, the first module obtain the corresponding URI of the method, pass through inquiry when calling the method for class of the second module
The mapping table of preset URI and method name obtain the corresponding method names of the URI;
S2, first module call the corresponding method of the method title, obtain the implementing result of the method.
Method rank method for routing of the android system provided in an embodiment of the present invention based on URI, the first module are being called
When the method for the class of the second module, the corresponding URI of the method is obtained first, by inquiring preset URI and method name
Mapping table obtains the corresponding method names of the URI;Then first module calls the corresponding method of the method title,
The implementing result of the method is obtained, compared to the prior art, this programme can be routed to the side of the class of another module by URI
Method decouples the calling dependence of class, the routing of implementation method rank.
Fig. 2 is that the flow of method rank method for routing another embodiment of the android system of the present invention based on URI is illustrated
Scheme, referring to Fig. 2, on the basis of preceding method embodiment, before the S1, can also include:
In compiling duration the mapping table is generated by scanning the method explained containing routing.
In the present embodiment, it is to be understood that routing is explained for showing that the method and its corresponding of corresponding URI are closed
System is explained by scanning the routing, can generate the mapping table of the method title URI corresponding with its.And have in scanning
Body can utilize the method that annotation processor scanning is explained containing routing.
On the basis of preceding method embodiment, the S2 may include:
First module calls the corresponding method of the method title by the reflex mechanism of java.
It is described by inquiring reflecting for preset URI and method name on the basis of preceding method embodiment referring to Fig. 2
Firing table obtains the corresponding method names of the URI, may include:
The API (Application Programming Interface, application programming interface) of router is called,
The URI is passed into the API, so that the API inquires the mapping table, obtains the corresponding method names of the URI, and
Return to query result.
Referring to Fig. 3, the present embodiment discloses a kind of method rank route device of the android system based on URI, including:
Query unit 1, for when calling the method for class of the second module, the corresponding URI of the method being obtained, by looking into
Preset URI and the mapping table of method name are ask, the corresponding method names of the URI are obtained;
Call unit 2 obtains the implementing result of the method for calling the corresponding method of the method title.
Specifically, the query unit 1 obtains the corresponding URI of the method when calling the method for class of the second module,
By inquiring the mapping table of preset URI and method name, the corresponding method names of the URI are obtained;The call unit 2 is adjusted
With the corresponding method of the method title, the implementing result of the method is obtained.
Method rank route device of the android system provided in an embodiment of the present invention based on URI, the first module are being called
When the method for the class of the second module, the corresponding URI of the method is obtained first with query unit, by inquiring preset URI
With the mapping table of method name, the corresponding method names of the URI are obtained;Then the method title is called using call unit
Corresponding method obtains the implementing result of the method, and compared to the prior art, this programme can be routed to another by URI
The method of the class of module decouples the calling dependence of class, the routing of implementation method rank.
On the basis of aforementioned device embodiment, described device can also include:
Generation unit, for before query unit work, in compiling duration, containing the institute that routing is explained by scanning
Method is stated, the mapping table is generated.
On the basis of aforementioned device embodiment, the call unit specifically can be used for:
First module calls the corresponding method of the method title by the reflex mechanism of java.
On the basis of aforementioned device embodiment, the query unit specifically can be used for:
The API for calling router, the API is passed to by the URI, so that the API inquires the mapping table, is obtained
The corresponding method name of the URI, and return to query result.
Method rank route device of the android system of the present embodiment based on URI can be used for executing preceding method real
The technical solution of example is applied, implementing principle and technical effect are similar, and details are not described herein again.
The present invention has the advantages that:It avoids the code that intermodule directly invokes to rely on, realizes function decoupling, solution
Determined inside Android 99% code coupled problem, good communication scheme can be provided for modularization and modularization
Support.
Fig. 4 shows the entity structure schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention, as shown in figure 4, should
Electronic equipment may include:It processor 11, memory 12, bus 13 and is stored on memory 12 and can be transported on processor 11
Capable computer program;
Wherein, the processor 11, memory 12 complete mutual communication by the bus 13;
The processor 11 realizes the method that above-mentioned each method embodiment is provided when executing the computer program, such as
Including:When calling the method for class of the second module, the corresponding URI of the method is obtained, by inquiring preset URI and method
The mapping table of title obtains the corresponding method names of the URI;The corresponding method of the method title is called, the side is obtained
The implementing result of method.
The embodiment of the present invention provides a kind of non-transient computer readable storage medium, is stored thereon with computer program, should
Realize the method that above-mentioned each method embodiment is provided when computer program is executed by processor, such as including:Calling second
When the method for the class of module, obtains the corresponding URI of the method and obtained by inquiring the mapping table of preset URI and method name
To the corresponding method names of the URI;The corresponding method of the method title is called, the implementing result of the method is obtained.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, the application can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is with reference to method, the flow of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.The fingers such as term "upper", "lower"
The orientation or positional relationship shown is to be based on the orientation or positional relationship shown in the drawings, and is merely for convenience of the description present invention and simplifies
Description, does not indicate or imply the indicated device or element must have a particular orientation, with specific azimuth configuration and behaviour
Make, therefore is not considered as limiting the invention.Unless otherwise clearly defined and limited, term " installation ", " connected ",
" connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;Can be
Mechanical connection can also be electrical connection;It can be directly connected, can also can be indirectly connected through an intermediary two
Connection inside element.For the ordinary skill in the art, above-mentioned term can be understood at this as the case may be
Concrete meaning in invention.
In the specification of the present invention, numerous specific details are set forth.Although it is understood that the embodiment of the present invention can
To put into practice without these specific details.In some instances, well known method, structure and skill is not been shown in detail
Art, so as not to obscure the understanding of this description.Similarly, it should be understood that disclose in order to simplify the present invention and helps to understand respectively
One or more of a inventive aspect, in the above description of the exemplary embodiment of the present invention, each spy of the invention
Sign is grouped together into sometimes in single embodiment, figure or descriptions thereof.However, should not be by the method solution of the disclosure
It releases and is intended in reflection is following:The feature that i.e. the claimed invention requirement ratio is expressly recited in each claim is more
More features.More precisely, as the following claims reflect, inventive aspect is to be less than single reality disclosed above
Apply all features of example.Therefore, it then follows thus claims of specific implementation mode are expressly incorporated in the specific implementation mode,
Wherein each claim itself is as a separate embodiment of the present invention.It should be noted that in the absence of conflict, this
The feature in embodiment and embodiment in application can be combined with each other.The invention is not limited in any single aspect,
It is not limited to any single embodiment, is also not limited to the arbitrary combination and/or displacement of these aspects and/or embodiment.And
And can be used alone of the invention each aspect and/or embodiment or with other one or more aspects and/or its implement
Example is used in combination.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Present invention has been described in detail with reference to the aforementioned embodiments for pipe, it will be understood by those of ordinary skill in the art that:Its according to
So can with technical scheme described in the above embodiments is modified, either to which part or all technical features into
Row equivalent replacement;And these modifications or replacements, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme should all cover in the claim of the present invention and the range of specification.
Claims (10)
1. a kind of method rank method for routing of android system based on URI, which is characterized in that including:
S1, the first module obtain the corresponding URI of the method, are preset by inquiring when calling the method for class of the second module
URI and method name mapping table, obtain the corresponding method names of the URI;
S2, first module call the corresponding method of the method title, obtain the implementing result of the method.
2. according to the method described in claim 1, it is characterized in that, before the S1, further include:
In compiling duration the mapping table is generated by scanning the method explained containing routing.
3. according to the method described in claim 2, it is characterized in that, the S2, including:
First module calls the corresponding method of the method title by the reflex mechanism of java.
4. according to the method described in claim 3, it is characterized in that, described by inquiring reflecting for preset URI and method name
Firing table obtains the corresponding method names of the URI, including:
The API for calling router, the API is passed to by the URI, so that the API inquires the mapping table, is obtained described
The corresponding method names of URI, and return to query result.
5. a kind of method rank route device of android system based on URI, which is characterized in that including:
Query unit, for when calling the method for class of the second module, the corresponding URI of the method being obtained, by inquiring in advance
If URI and method name mapping table, obtain the corresponding method names of the URI;
Call unit obtains the implementing result of the method for calling the corresponding method of the method title.
6. device according to claim 5, which is characterized in that further include:
Generation unit, for before query unit work, in compiling duration, containing the side that routing is explained by scanning
Method generates the mapping table.
7. device according to claim 6, which is characterized in that the call unit is specifically used for:
First module calls the corresponding method of the method title by the reflex mechanism of java.
8. device according to claim 7, which is characterized in that the query unit is specifically used for:
The API for calling router, the API is passed to by the URI, so that the API inquires the mapping table, is obtained described
The corresponding method names of URI, and return to query result.
9. a kind of electronic equipment, which is characterized in that including:Processor, memory, bus and storage on a memory and can located
The computer program run on reason device;
Wherein, the processor, memory complete mutual communication by the bus;
The processor realizes the method as described in any one of claim 1-4 when executing the computer program.
10. a kind of non-transient computer readable storage medium, which is characterized in that be stored with computer journey on the storage medium
Sequence realizes the method as described in any one of claim 1-4 when the computer program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810214764.9A CN108536436A (en) | 2018-03-15 | 2018-03-15 | Method rank method for routing and device of the android system based on URI |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810214764.9A CN108536436A (en) | 2018-03-15 | 2018-03-15 | Method rank method for routing and device of the android system based on URI |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108536436A true CN108536436A (en) | 2018-09-14 |
Family
ID=63483597
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810214764.9A Withdrawn CN108536436A (en) | 2018-03-15 | 2018-03-15 | Method rank method for routing and device of the android system based on URI |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108536436A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110007925A (en) * | 2019-04-01 | 2019-07-12 | 睿驰达新能源汽车科技(北京)有限公司 | A kind of method and device promoting application program runnability |
CN110162296A (en) * | 2019-04-15 | 2019-08-23 | 平安科技(深圳)有限公司 | Generation method, device and the terminal device of application programming interface document |
CN110413352A (en) * | 2019-07-15 | 2019-11-05 | 北京天眼查科技有限公司 | The call method and device of application component |
CN114168111A (en) * | 2021-12-07 | 2022-03-11 | 北京五八信息技术有限公司 | Method, device, product and storage medium for realizing modular routing |
-
2018
- 2018-03-15 CN CN201810214764.9A patent/CN108536436A/en not_active Withdrawn
Non-Patent Citations (2)
Title |
---|
YAEZAKURA: "[Alibaba-ARouter] 简单好用的Android页面路由框架", 《HTTPS://WWW.JIANSHU.COM/P/7CB2CC9B726A?FROM=GROUPMESSAGE》 * |
鱼儿的博客: "JAVA反射+运行时注解实现URL路由", 《HTTPS://YUERBLOG.CC/2018/03/08/JAVA-ROUTER-WITH-ANNOTATION/》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110007925A (en) * | 2019-04-01 | 2019-07-12 | 睿驰达新能源汽车科技(北京)有限公司 | A kind of method and device promoting application program runnability |
CN110162296A (en) * | 2019-04-15 | 2019-08-23 | 平安科技(深圳)有限公司 | Generation method, device and the terminal device of application programming interface document |
CN110413352A (en) * | 2019-07-15 | 2019-11-05 | 北京天眼查科技有限公司 | The call method and device of application component |
CN110413352B (en) * | 2019-07-15 | 2020-11-03 | 北京天眼查科技有限公司 | Calling method and device of application component |
CN114168111A (en) * | 2021-12-07 | 2022-03-11 | 北京五八信息技术有限公司 | Method, device, product and storage medium for realizing modular routing |
CN114168111B (en) * | 2021-12-07 | 2024-04-05 | 北京五八信息技术有限公司 | Method, device, product and storage medium for realizing componentized route |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108536436A (en) | Method rank method for routing and device of the android system based on URI | |
CN107579951B (en) | Service data processing method, service processing method and equipment | |
CN110138606B (en) | Container network configuration method and system | |
RU2409846C2 (en) | Organising resources into collections to facilitate efficient and reliable resource access | |
EP1949595B1 (en) | Method for the construction and execution of a distributed workflow in a communication system | |
US7701944B2 (en) | System and method for crawl policy management utilizing IP address and IP address range | |
CN102902780B (en) | A kind of uniform resource position mark URL dynamic matching method and device | |
CN105681476A (en) | Page skipping method, device and system | |
CN102087594B (en) | Management method and device for extension point and plugins | |
CN104462517A (en) | Data synchronizing method and device | |
KR102274178B1 (en) | Emulating test distributed application on server | |
CN101655795B (en) | Method for creating service embodiment and system thereof | |
CN104869063A (en) | Host route processing method in virtual subnet, related devices and communication system | |
CN112637329B (en) | Identification method, device, equipment and storage medium of multiple application programs | |
CN102325186A (en) | Remote service calling method and system | |
CN104461567A (en) | Method and system for releasing software package | |
CN108885564A (en) | Resource in network virtualization scene places control | |
CN106528108A (en) | WEB development method and device based on code file route | |
CN108469992A (en) | Process-level method for routing and device of the android system based on URI | |
US20100211631A1 (en) | Ubiquitous web service gateway and method | |
CN112235357A (en) | Cross-platform application development system | |
CN102938711B (en) | Network interface information configuring methods and the network equipment | |
CN108733376A (en) | The method and device of multiple Android APP is compiled under modularization using a set of source code | |
CN106126595A (en) | A kind of document down loading method and device | |
CN111262904B (en) | Service agent system and method |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180914 |