CN109379284B - Route execution method, storage medium, and terminal device - Google Patents

Route execution method, storage medium, and terminal device Download PDF

Info

Publication number
CN109379284B
CN109379284B CN201811081064.3A CN201811081064A CN109379284B CN 109379284 B CN109379284 B CN 109379284B CN 201811081064 A CN201811081064 A CN 201811081064A CN 109379284 B CN109379284 B CN 109379284B
Authority
CN
China
Prior art keywords
routing
route
interface
page
execution
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.)
Active
Application number
CN201811081064.3A
Other languages
Chinese (zh)
Other versions
CN109379284A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811081064.3A priority Critical patent/CN109379284B/en
Publication of CN109379284A publication Critical patent/CN109379284A/en
Application granted granted Critical
Publication of CN109379284B publication Critical patent/CN109379284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Abstract

The invention discloses a route execution method, which comprises the following steps: acquiring a route to be executed containing an execution parameter; determining a routing interface matched with the execution parameter according to the matching relation between the execution parameter and each interface parameter; and calling the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface. In the invention, different routing interfaces and interface parameters are correspondingly arranged on different routing rules, when the to-be-executed route containing the execution parameters is obtained, the routing interface matched with the execution parameters can be determined according to the execution parameters, and the routing interface is called, so that the to-be-executed route can be executed according to the execution parameters and the routing rules corresponding to the routing interface. In other words, in the invention, different routing rules can be adopted to execute the routes to be executed containing different execution parameters, thereby greatly expanding the routing execution function and improving the diversity and flexibility of routing execution. The invention also provides a computer readable storage medium and terminal equipment.

Description

Route execution method, storage medium, and terminal device
Technical Field
The present invention relates to the field of routing control technologies, and in particular, to a routing execution method, a storage medium, and a terminal device.
Background
Routing refers to the act or action of transferring data from one place to another and is key to the internet's ability to provide various network functions. The existing routing execution adopts single function call or independent page routing, and the routing execution function is single, so that the multifunctional requirement cannot be met.
In summary, how to improve the diversity of the routing execution to solve the problem of single routing execution function is an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
Embodiments of the present invention provide a route execution method, a storage medium, and a terminal device, which can expand a route execution function, and improve diversity and flexibility of route execution, so as to solve the problem of a single route execution function.
In a first aspect of the embodiments of the present invention, a method for executing a route is provided, including:
acquiring a route to be executed containing an execution parameter;
determining a routing interface matched with the execution parameter according to the matching relation between the execution parameter and each interface parameter;
and calling the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface.
In a second aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which computer-readable instructions are stored, and when executed by a processor, the computer-readable instructions implement the following steps:
acquiring a route to be executed containing an execution parameter;
determining a routing interface matched with the execution parameter according to the matching relation between the execution parameter and each interface parameter;
and calling the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface.
In a third aspect of the embodiments of the present invention, there is provided a terminal device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, where the processor executes the computer-readable instructions to implement the following steps:
acquiring a route to be executed containing an execution parameter;
determining a routing interface matched with the execution parameter according to the matching relation between the execution parameter and each interface parameter;
and calling the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, different routing interfaces and interface parameters are correspondingly arranged on different routing rules, so that when a to-be-executed route containing an execution parameter is obtained, a routing interface matched with the execution parameter can be determined according to the execution parameter, and the routing interface is called, so that the to-be-executed route can be executed according to the execution parameter and the routing rule corresponding to the routing interface. In other words, in the embodiment of the present invention, different routing rules can be used to execute the to-be-executed routes including different execution parameters, so that the route execution function is greatly expanded, and the diversity and flexibility of the route execution are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a flowchart of an embodiment of a method for performing routing according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating the execution of a to-be-executed route according to a functional routing rule in an embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a process of executing a route to be executed according to a page routing rule in an application scenario according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of executing a to-be-executed route through a page route in another application scenario in the embodiment of the present invention;
FIG. 5 is a block diagram of an embodiment of a route execution device according to the present invention;
fig. 6 is a schematic diagram of a terminal device in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a route execution method, a storage medium and a terminal device, which are used for expanding a route execution function and improving the diversity and flexibility of route execution so as to solve the problem of single route execution function.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a first embodiment of the present invention provides a method for executing a route, where the method for executing a route includes:
and step S101, obtaining a to-be-executed route containing an execution parameter.
The to-be-executed route may be a page route of a page jump class, or a function route of a certain function realization class, for example, a specific operation is executed to obtain an operation result. In this embodiment, when an execution parameter is input externally to request execution of a certain to-be-executed route, the execution parameter may be obtained, so as to determine, according to the execution parameter, a routing function that the to-be-executed route is intended to implement, for example, whether to implement a page routing function or a function routing function.
Further, in this embodiment, before obtaining the to-be-executed route including the execution parameter, the method may include:
and setting each routing rule, and configuring a routing interface corresponding to each routing rule and interface parameters of each routing interface.
In this embodiment, before executing the to-be-executed route, the routing rule may be set, and the routing interface and the interface parameter may be configured at the same time.
In a specific application, the routing rule includes a functional routing rule, and the functional routing rule is an execution mode for implementing functional routing;
the configuring the routing interfaces corresponding to the routing rules and the interface parameters of the routing interfaces may include:
configuring a first routing interface of the functional routing rule, configuring a first interface parameter of the first routing interface according to the execution mode, and defining a parameter specification of the first interface parameter so as to construct a normalized routing object according to the parameter specification.
Specifically, in this embodiment, the function routing rule may include execution manners such as a function call manner and a thread execution manner, and the function call manner may include a block chain function call manner and a delete function call manner, so as to implement diversification and flexibility of function call. The thread execution mode comprises main thread execution and sub-thread execution, so that the performance processing capability in the route execution process is improved through effective thread management.
Therefore, after configuring the first routing interface corresponding to the function routing rule, it is necessary to configure a corresponding first interface parameter for the first routing interface correspondingly, that is, the first interface parameter needs to include a parameter determined by a function calling manner and a parameter determined by a thread executing manner, and a corresponding parameter specification is defined for the first interface parameter, for example, a corresponding parameter type and a parameter representing meaning are defined for each specific parameter, so that after obtaining the route to be executed, a normalized routing object can be constructed according to the parameter specification, for example, a routing object PAHRouterModel shown in the following table is constructed according to the parameter specification:
Figure BDA0001801975680000051
when an external request is made to execute a certain route to be executed and corresponding execution parameters are input, a normalized route object can be constructed according to the parameter specification, after the construction of the route object is completed, each specific parameter of the execution parameters is matched into the route object, and then the route to be executed can be executed by calling the route object, so that the normalization of the parameters during the route calling is realized and the readability of interface calling is enhanced.
In another particular application, the routing rules include page routing rules;
the configuring of the routing interfaces corresponding to the routing rules and the interface parameters of the routing interfaces may include:
and configuring a second routing interface of the page routing rule, and configuring a second interface parameter of the second routing interface according to the execution mode of the page routing rule.
The page routing rule refers to an execution mode for realizing page jump, and the second interface parameter of the second routing interface corresponding to the page routing rule includes a parameter indicating a page jump type and a parameter indicating a page display mode, so that when an external request is made to execute page routing, the input execution parameters need to include a parameter determined by the page jump type and a parameter determined by the page display mode.
And step S102, determining a routing interface matched with the execution parameter according to the matching relation between the execution parameter and each interface parameter.
After the execution parameters are acquired, determining a routing interface matched with the execution parameters according to the matching relationship between the execution parameters and each interface parameter, and if the execution parameters comprise parameters determined by a function calling mode and parameters determined by a thread execution mode, considering that the execution parameters are matched with first interface parameters corresponding to a function routing rule, thus determining that the routing interface matched with the execution parameters is a first routing interface; and when the execution parameter comprises a parameter indicating a page jump type and a parameter indicating a page display mode, the execution parameter is considered to be matched with a second interface parameter corresponding to the page routing rule, so that the routing interface matched with the execution parameter can be determined to be a second routing interface.
Step S103, the routing interface is called, so that the to-be-executed route is executed according to the execution parameter and the routing rule corresponding to the routing interface.
And after the routing interface matched with the execution parameter is determined, executing the route to be executed according to the execution parameter and the routing rule corresponding to the routing interface.
Further, in this embodiment, when the to-be-executed route to be executed is a function route and the determined routing interface is the first routing interface, the step S103 of invoking the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface may include the steps shown in fig. 2:
step S201, judging whether a reusable route object exists in the first route interface;
step S202, if a reusable route object exists, calling the route object from the reusable route object, assigning the called route object according to the execution parameter, and executing the route to be executed according to a function route rule corresponding to the assigned route object;
step S203, if no reusable route object exists, a new route object is constructed according to the parameter specification, the new route object is assigned according to the execution parameter, and the route to be executed is executed according to the function route rule corresponding to the assigned new route object.
Specifically, with regard to the foregoing steps S201 to S203, it can be understood that, initially, no route object may exist in the first route interface, and when a to-be-executed route is obtained, a route object may be created in the first route interface according to the parameter specification, and after the to-be-executed route is completely executed, the route object is continuously saved in the first route interface for use in obtaining the to-be-executed route next time. Therefore, in this embodiment, when a new route to be executed is obtained, it may be first determined whether a reusable route object that is created before and is not in use exists in the first route interface, and if the reusable route object exists, the route object is directly called from the first route interface, and the called route object is assigned according to an execution parameter of the new route to be executed, so that the route to be executed is executed according to a routing rule corresponding to the assigned route object, that is, the route rule corresponding to the assigned route object is called to execute the route to be executed, so as to implement the routing function of the route.
For example, in a specific application, the function routing rule corresponding to the assigned routing object is a delete function calling manner and a main thread executing manner, at this time, the delete function calling manner may be called to execute the to-be-executed route, and meanwhile, the delete function calling manner is set in the main thread to be executed, so as to implement the routing function of the to-be-executed route.
And when no reusable route object exists in the first route interface, if no route object exists in the first route interface, or the first route interface creates a route object but the created route object is in use by other routes to be executed, that is, no idle route object exists in the first route interface, the new route object can be directly created, and after the creation of the new route object is completed, the created new route object can be assigned according to the execution parameters of the routes to be executed, so that the routes to be executed are executed according to the route rules corresponding to the assigned new route object, that is, the route rules corresponding to the assigned new route object are called to execute the routes to be executed, so as to realize the routing function of the router.
Further, when the to-be-executed route to be executed is a functional route, after invoking the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface, the method includes: step a, counting the object number of unused routing objects in the first routing interface; b, if the number of the objects does not exceed a preset threshold value, recovering and resetting all routing objects; and c, if the number of the objects exceeds the preset threshold, acquiring the exceeding number exceeding the preset threshold, releasing the route objects exceeding the number, and recycling and resetting the rest route objects.
As for the above steps a to c, it can be understood that, in this embodiment, an upper limit value that an unused and idle routing object can exist may be set in advance, that is, the preset threshold value may be set in advance to control the creation number of routing objects, so as to facilitate effective management of the routing objects. After each routing execution is finished, the number of the objects of the unused routing objects in the first routing interface can be counted so as to judge whether the number of the objects of the unused routing objects exceeds the preset threshold value, if the number of the objects does not exceed the preset threshold value, all the unused routing objects can be directly recycled and reset so as to assign and call the routing objects when the to-be-executed routing is acquired next time. And if the number of the objects exceeds the preset threshold, further counting the number of the objects exceeding the preset threshold, and then releasing the routing objects exceeding the number to reserve the routing objects of the preset threshold, and recovering and resetting the reserved routing objects, so that assignment calling is conveniently carried out when the to-be-executed route is acquired next time, and the execution efficiency of the to-be-executed route is improved by multiplexing the routing objects.
For example, in a specific application, the preset threshold value set in advance is 5, and after a certain route is executed, it is counted that there are 3 unused route objects in the first route interface, then the 3 route objects can be directly recovered and reset, and when a route to be executed is obtained next time, a specific route object can be directly called from the 3 route objects, and assigned and called, so as to implement the routing function of the route to be executed. And after the other route is executed, counting that 8 unused route objects exist in the first route interface, knowing that the number of the unused route objects in the first route interface is more than 3 than the preset threshold, at this time, selecting 3 route objects from the 8 route objects to release, reserving 5 route objects of the preset threshold, and recovering and resetting the 5 route objects, and when a route to be executed is obtained next time, calling a specific route object from the 5 route objects and assigning and calling the specific route object, thereby realizing the routing function of the route to be executed.
Optionally, in this embodiment, when the to-be-executed route to be executed is a page route and the determined routing interface is a second routing interface, the step S103 of executing the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface may include the steps shown in fig. 3:
and S301, determining the execution mode of the page routing rule according to the execution parameters.
The page routing rule is provided with a plurality of execution modes corresponding to each page display mode, and when an external request is made to execute page routing, the execution parameters need to include parameters indicating the page display modes, so that after the execution parameters are obtained, the specific execution modes can be determined according to the parameters indicating the page display modes in the execution parameters.
Step S302, when the execution mode is that a plurality of pages are displayed in the same page window, setting a page logic stack for storing the URL of each page in the page window according to the page jump sequence.
Specifically, when the determined execution mode is that a plurality of pages are displayed in the same page window, a page logic stack may be set, and the page logic stack may be configured to store the URLs of the pages in the page window according to a page jump sequence. If in a specific application, a first page, a second page and a third page are sequentially opened in the page window, then the URL1 of the first page, the URL2 of the second page and the URL3 of the third page are sequentially saved in the page logic stack, that is, the URL1 is first stacked and located in the bottom of the stack, then the URL2 is stacked and located above the URL1, and finally the URL3 is stacked and located above the URL 2.
Step S303, when receiving the return instruction, determining whether the saved number of URLs in the page logic stack is greater than or equal to 2.
Specifically, when a return instruction for returning to the page is received, it is necessary to determine whether the page that can be returned exists in the current page in the page window, that is, it is necessary to determine whether the number of URLs stored in the page logic stack is greater than or equal to 2.
Step S304, if the saved number is larger than or equal to 2, popping up the first URL at the topmost layer saved in the page logic stack, and acquiring a second URL in the page logic stack, which is next to the first URL, so as to display a page corresponding to the second URL in the page window.
When the saved number of the URLs in the page logic stack is greater than or equal to 2, indicating that the current page in the page window has the page which can be returned, and at the moment, firstly popping up a first URL at the topmost layer saved in the page logic stack, namely popping up the URL corresponding to the current page; then, acquiring a second URL under the first URL, wherein the second URL is the URL of the page; and finally, displaying the page corresponding to the second URL in the page window so as to enable the currently displayed page to be the page, thereby completing the return of the page.
For example, in a specific application, the page logic stack sequentially stores the URL1 of the first page, the URL2 of the second page, and the URL3 of the third page, that is, the currently displayed page in the page window is the third page, so when a return instruction is received, the URL3 in the page logic stack is popped up, the URL2 in the page logic stack is then obtained, and the page corresponding to the URL2 is displayed in the page window, so that the purpose of returning from the third page to the second page is achieved. And when a return instruction is further received, the return from the second page to the first page can be continued.
Step S305, if the saved number is less than 2, popping up the URL saved in the page logic stack, and closing the page window.
When the number of the saved URLs in the page logic stack is smaller than 2, it is indicated that the previous page capable of being returned does not exist in the current page in the page window, that is, only the URL of the current page is saved in the page logic stack, at this time, the URL of the current page saved in the page logic stack can be popped up, and the page window is closed, so as to complete the return function of the current page.
Further, in this embodiment, if some other page window is opened before the page window is opened, after the page window is closed, the user may directly jump to the other page window opened before the page window.
Further, in this embodiment, when the to-be-executed route to be executed is a page route and the determined routing interface is a second routing interface, step S103 may further include, as shown in fig. 4, executing the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface:
step S401, determining the execution mode of the page routing rule according to the execution parameters;
step S402, when the execution mode is that different pages are displayed in different page windows, setting a view control stack for storing the URL of each page and the corresponding page window in page jumping;
and step S403, when an instruction of returning to the specified URL is received, finding the page window corresponding to the specified URL from the view control stack, jumping to the found page window, and displaying the page corresponding to the specified URL in the found page window.
As for the above steps S401 to S403, it can be understood that, when it is determined that the specific execution mode is that different pages are displayed in different page windows according to the execution parameter, a view control stack may be set, so as to save the URL of each page in the page jump and the corresponding page window. If in a specific application, page a is opened in page window a, page B is opened in page window B, page C is opened in page window C, and page D is opened in page window D, then page window a and page a url (a), page window B and page B url (B), page window C and page C url (C), and page window D and page D url (D) are stored in the view control stack, and page window a is stored in association with url (a), page window B is stored in association with url (B), page window C is stored in association with url (C), and page window D is stored in association with url (D). Therefore, when an instruction for returning to the specified URL is received, for example, when the instruction for returning to the URL (B) is received, the page window associated with the URL (B) is first found from the view control stack, that is, the page window B is found, then, the page window B is skipped to, and the page corresponding to the URL (B) is displayed in the page window B, so that the return function of the specified page is completed.
The page routing rule of the embodiment of the invention can effectively manage the page access path, thereby effectively improving the page skipping efficiency.
In the embodiment of the invention, different routing interfaces and interface parameters are correspondingly arranged on different routing rules, so that when a to-be-executed route containing an execution parameter is obtained, a routing interface matched with the execution parameter can be determined according to the execution parameter, and the routing interface is called, so that the to-be-executed route can be executed according to the execution parameter and the routing rule corresponding to the routing interface. In other words, in the embodiment of the present invention, for the to-be-executed routes including different execution parameters, different route execution rules may be used for execution, so that the route execution function is greatly expanded, and the diversity and flexibility of route execution are improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The above mainly describes a route execution method, and a route execution device will be described in detail below.
Fig. 5 is a block diagram illustrating an embodiment of a route execution device according to an embodiment of the present invention. As shown in fig. 5, the route execution device includes:
a route obtaining module 501, configured to obtain a to-be-executed route including an execution parameter;
a route matching module 502, configured to determine, according to a matching relationship between the execution parameter and each interface parameter, a route interface matching the execution parameter;
the route executing module 503 is configured to invoke the route interface, so as to execute the route to be executed according to the execution parameter and the route rule corresponding to the route interface.
Further, the route execution device includes:
and the routing setting module is used for setting each routing rule and configuring the routing interfaces corresponding to each routing rule and the interface parameters of each routing interface.
Preferably, the routing rule includes a functional routing rule, and the functional routing rule is an execution manner for implementing functional routing;
the routing setting module is configured to configure a first routing interface of the functional routing rule, configure a first interface parameter of the first routing interface according to the execution mode, and define a parameter specification of the first interface parameter, so as to construct a normalized routing object according to the parameter specification.
Optionally, the route executing module 503 includes:
an object judgment unit, configured to judge whether a reusable route object exists in the first routing interface;
the object calling unit is used for calling the routing object from the reusable routing object if the reusable routing object exists, assigning the called routing object according to the execution parameter and executing the to-be-executed route according to the function routing rule corresponding to the assigned routing object;
and the object creating unit is used for constructing a new routing object according to the parameter specification if the reusable routing object does not exist, assigning the new routing object according to the execution parameter, and executing the to-be-executed route according to the function routing rule corresponding to the assigned new routing object.
Further, the route execution device includes:
the object counting module is used for counting the number of the objects of the unused routing objects in the first routing interface;
the first recovery module is used for recovering and resetting all routing objects if the number of the objects does not exceed a preset threshold;
and the second recovery module is used for acquiring the exceeding number exceeding the preset threshold value if the number of the objects exceeds the preset threshold value, releasing the exceeding number of the routing objects, and recovering and resetting the rest routing objects.
Preferably, the routing rules comprise page routing rules;
the route setting module is further configured to configure a second route interface of the page route rule, and configure a second interface parameter of the second route interface according to an execution mode of the page route rule.
Optionally, the route executing module 503 further includes:
a first execution mode determining unit, configured to determine an execution mode of the page routing rule according to the execution parameter;
the page logic stack setting unit is used for setting a page logic stack and saving the URL of each page in the page window according to the page jump sequence when the execution mode is that a plurality of pages are displayed in the same page window;
the saving quantity judging unit is used for judging whether the saving quantity of the URLs in the page logic stack is greater than or equal to 2 or not when a return instruction is received;
the first page display unit is used for popping up a first URL (uniform resource locator) at the topmost layer stored in the page logic stack and acquiring a second URL (uniform resource locator) which is next to the first URL in the page logic stack if the stored number is greater than or equal to 2 so as to display a page corresponding to the second URL in the page window;
and the page closing unit is used for popping up the URL stored in the page logic stack and closing the page window if the storage quantity is less than 2.
Further, the route executing module 503 further includes:
a second execution mode determining unit, configured to determine an execution mode of the page routing rule according to the execution parameter;
the view control stack setting unit is used for setting a view control stack and storing the URL of each page and the corresponding page window in the page jump when the execution mode is that different pages are displayed in different page windows;
and the second page display unit is used for finding the page window corresponding to the specified URL from the view control stack, jumping to the found page window and displaying the page corresponding to the specified URL in the found page window when receiving an instruction of returning the specified URL.
Fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61, and computer readable instructions 62 stored in the memory 62 and executable on the processor 60. The processor 60, when executing the computer readable instructions 62, implements the steps in the various embodiments of the route execution method described above, such as steps S101-S103 shown in fig. 1. Alternatively, the processor 60, when executing the computer readable instructions 62, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 501 to 503 shown in fig. 5.
Illustratively, the computer-readable instructions 62 may be divided into one or more modules/units, which are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules/units may be a series of computer-readable instruction segments capable of performing specific functions, which are used to describe the execution process of the computer-readable instructions 62 in the terminal device 6.
The terminal device 6 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device 6 and does not constitute a limitation of terminal device 6 and may include more or less components than those shown, or some components in combination, or different components, for example, the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used to store the computer readable instructions and other instructions and data required by the terminal device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A method for performing routing, comprising:
acquiring a route to be executed containing an execution parameter; the routes to be executed comprise page routes and function routes;
determining a routing interface matched with the execution parameter according to the matching relation between the execution parameter and each interface parameter;
calling the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface;
before obtaining the route to be executed containing the execution parameters, the method comprises the following steps:
setting each routing rule, and configuring a routing interface corresponding to each routing rule and interface parameters of each routing interface;
the routing rule comprises a function routing rule which is an execution mode for realizing function routing; correspondingly, the configuring the routing interfaces corresponding to the routing rules and the interface parameters of the routing interfaces includes:
configuring a first routing interface of the functional routing rule, configuring a first interface parameter of the first routing interface according to the execution mode, and defining a parameter specification of the first interface parameter so as to construct a normalized routing object according to the parameter specification;
the invoking the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface includes:
judging whether a reusable route object exists in the first route interface;
if the reusable route object exists, calling the route object from the reusable route object, assigning the called route object according to the execution parameter, and executing the route to be executed according to a function route rule corresponding to the assigned route object;
if no reusable route object exists, a new route object is constructed according to the parameter specification, the new route object is assigned according to the execution parameter, and the route to be executed is executed according to the functional route rule corresponding to the assigned new route object.
2. The method according to claim 1, wherein after invoking the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface, the method comprises:
counting the number of objects of unused routing objects in the first routing interface;
if the number of the objects does not exceed a preset threshold value, all the routing objects are recycled and reset;
if the number of the objects exceeds the preset threshold, acquiring the exceeding number exceeding the preset threshold, releasing the route objects exceeding the number, and recycling and resetting the rest route objects.
3. The route execution method of claim 1, wherein the routing rule comprises a page routing rule;
the configuring of the routing interfaces corresponding to the routing rules and the interface parameters of the routing interfaces includes:
and configuring a second routing interface of the page routing rule, and configuring a second interface parameter of the second routing interface according to the execution mode of the page routing rule.
4. The method according to claim 3, wherein the executing the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface comprises:
determining an execution mode of the page routing rule according to the execution parameters;
when the execution mode is that a plurality of pages are displayed in the same page window, setting a page logic stack for storing the URL of each page in the page window according to a page jump sequence;
when a return instruction is received, judging whether the saved number of the URLs in the page logic stack is greater than or equal to 2;
if the saved number is greater than or equal to 2, popping up a first URL (uniform resource locator) at the topmost layer saved in the page logic stack, and acquiring a second URL which is next to the first URL in the page logic stack so as to display a page corresponding to the second URL in the page window;
and if the storage quantity is less than 2, popping up the URL stored in the page logic stack, and closing the page window.
5. The method according to claim 3, wherein the executing the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface comprises:
determining an execution mode of the page routing rule according to the execution parameters;
when the execution mode is that different pages are displayed in different page windows, setting a view control stack for storing the URL of each page and the corresponding page window in the page jump;
and when an instruction of returning to the specified URL is received, finding a page window corresponding to the specified URL from the view control stack, jumping to the found page window, and displaying the page corresponding to the specified URL in the found page window.
6. A computer readable storage medium storing computer readable instructions, which when executed by a processor implement the steps of the route execution method according to any one of claims 1 to 5.
7. A terminal device comprising a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, wherein the processor when executing the computer readable instructions performs the steps of:
acquiring a route to be executed containing an execution parameter; the routes to be executed comprise page routes and function routes;
determining a routing interface matched with the execution parameter according to the matching relation between the execution parameter and each interface parameter;
calling the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface;
before obtaining the route to be executed containing the execution parameters, the method comprises the following steps:
setting each routing rule, and configuring a routing interface corresponding to each routing rule and interface parameters of each routing interface;
the routing rule comprises a function routing rule which is an execution mode for realizing function routing; correspondingly, the configuring the routing interfaces corresponding to the routing rules and the interface parameters of the routing interfaces includes:
configuring a first routing interface of the functional routing rule, configuring a first interface parameter of the first routing interface according to the execution mode, and defining a parameter specification of the first interface parameter so as to construct a normalized routing object according to the parameter specification;
the invoking the routing interface to execute the to-be-executed route according to the execution parameter and the routing rule corresponding to the routing interface includes:
judging whether a reusable route object exists in the first route interface;
if the reusable route object exists, calling the route object from the reusable route object, assigning the called route object according to the execution parameter, and executing the route to be executed according to a function route rule corresponding to the assigned route object;
if the reusable route object does not exist, a new route object is constructed according to the parameter specification, the new route object is assigned according to the execution parameter, and the route to be executed is executed according to the function route rule corresponding to the assigned new route object.
CN201811081064.3A 2018-09-17 2018-09-17 Route execution method, storage medium, and terminal device Active CN109379284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811081064.3A CN109379284B (en) 2018-09-17 2018-09-17 Route execution method, storage medium, and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811081064.3A CN109379284B (en) 2018-09-17 2018-09-17 Route execution method, storage medium, and terminal device

Publications (2)

Publication Number Publication Date
CN109379284A CN109379284A (en) 2019-02-22
CN109379284B true CN109379284B (en) 2022-09-27

Family

ID=65404857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811081064.3A Active CN109379284B (en) 2018-09-17 2018-09-17 Route execution method, storage medium, and terminal device

Country Status (1)

Country Link
CN (1) CN109379284B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309005B (en) * 2019-06-28 2022-03-25 百度在线网络技术(北京)有限公司 Function calling method and device, terminal equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6016515A (en) * 1997-04-04 2000-01-18 Microsoft Corporation Method, computer program product, and data structure for validating creation of and routing messages to file object
US6643712B1 (en) * 1997-04-04 2003-11-04 Microsoft Corporation Validating the creation of and routing of messages to file objects
WO2017088703A1 (en) * 2015-11-27 2017-06-01 阿里巴巴集团控股有限公司 Page jumping method and apparatus

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095479A (en) * 2011-11-04 2013-05-08 华为技术有限公司 Method and device of business configuration
EP3101603A1 (en) * 2015-06-04 2016-12-07 Easy Payment Gateway Ltd A method and apparatus for providing an electronic transaction gateway
CN105357275A (en) * 2015-10-12 2016-02-24 江西掌中无限网络科技股份有限公司 Intelligent aggregation interface method and system
US20170178056A1 (en) * 2015-12-18 2017-06-22 International Business Machines Corporation Flexible business task flow
CN107918562B (en) * 2016-10-11 2021-11-26 北京京东尚科信息技术有限公司 Unified interface management method and system
CN106789659B (en) * 2016-12-19 2020-08-11 北京五八信息技术有限公司 Routing method and device of service function
CN108427631B (en) * 2017-02-14 2022-04-12 北京京东尚科信息技术有限公司 Application test system, method, electronic equipment and readable storage medium
CN107392766A (en) * 2017-07-25 2017-11-24 上海壹账通金融科技有限公司 Method for processing business, adapter and computer-readable recording medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6016515A (en) * 1997-04-04 2000-01-18 Microsoft Corporation Method, computer program product, and data structure for validating creation of and routing messages to file object
US6643712B1 (en) * 1997-04-04 2003-11-04 Microsoft Corporation Validating the creation of and routing of messages to file objects
WO2017088703A1 (en) * 2015-11-27 2017-06-01 阿里巴巴集团控股有限公司 Page jumping method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
支持业务需求灵活定制的多态路由系统;张岩等;《电子学报》;20160415(第04期);全文 *

Also Published As

Publication number Publication date
CN109379284A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN107992356B (en) Block chain transaction block processing method, electronic device and readable storage medium
CN106776395B (en) A kind of method for scheduling task and device of shared cluster
CN109417488A (en) The method and apparatus of virtual network function resource management
CN110633135A (en) Asynchronous task allocation method and device, computer equipment and storage medium
CN105468707A (en) Cache-based data processing method and device
CN108829510B (en) Thread binding processing method and device
CN110866208B (en) Page response type layout method, device and equipment
CN109379284B (en) Route execution method, storage medium, and terminal device
CN111913793A (en) Distributed task scheduling method, device, node equipment and system
CN108897858B (en) Distributed cluster index fragmentation evaluation method and device and electronic equipment
CN109002286A (en) Data asynchronous processing method and device based on synchronous programming
CN114221961B (en) Hierarchical DAG blockchain generation method, apparatus, medium, and program product
CN115562840A (en) Task processing method, device and medium
CN110688223B (en) Data processing method and related product
CN115543317A (en) Front-end page development method and device
CN114416329A (en) Computing task deployment method and device, electronic equipment and storage medium
CN110825477A (en) Method, device and equipment for loading graphical interface and storage medium
CN111897612A (en) Page updating method and device, electronic equipment and storage medium
CN111090633A (en) Small file aggregation method, device and equipment of distributed file system
CN104808985B (en) The management method and device of object in application program
CN109067864A (en) Notification message method for pushing, device and electronic equipment
JP2005115620A (en) Task management method and electronic apparatus having task management means
CN111858542B (en) Data processing method, device, equipment and computer readable storage medium
CN111090629B (en) Data file storage method, device, equipment and storage medium
CN115469926A (en) Application operation method and device and related components

Legal Events

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