CN111901238B - Dynamic routing service method, device, electronic equipment and storage medium - Google Patents

Dynamic routing service method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111901238B
CN111901238B CN202010658537.2A CN202010658537A CN111901238B CN 111901238 B CN111901238 B CN 111901238B CN 202010658537 A CN202010658537 A CN 202010658537A CN 111901238 B CN111901238 B CN 111901238B
Authority
CN
China
Prior art keywords
routing
service
request
filter
route
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
CN202010658537.2A
Other languages
Chinese (zh)
Other versions
CN111901238A (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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010658537.2A priority Critical patent/CN111901238B/en
Publication of CN111901238A publication Critical patent/CN111901238A/en
Application granted granted Critical
Publication of CN111901238B publication Critical patent/CN111901238B/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/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/26Route discovery packet
    • 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
    • H04L45/745Address table lookup; Address filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention relates to the field of information processing, and discloses a dynamic routing service method. The embodiment of the invention receives a routing request, and utilizes a first filter to verify the legality of the routing request to obtain a legal routing request; utilizing a second filter to perform routing logic processing on the legal routing request to obtain a service route corresponding to the legal routing request, and calling a corresponding routing scheduling strategy according to the service route; and inquiring the service information according to the routing scheduling strategy, carrying out routing processing on the service information obtained by inquiry by using a third filter, and returning a routing result. The invention also provides a dynamic routing service device, electronic equipment and a computer readable storage medium. The embodiment of the invention executes dynamic routing service, supports flexible configuration of a routing scheduling strategy, ensures that the API gateway can quickly find the service route under the conditions of high request, high concurrency and high precision, and acquires the corresponding service information.

Description

Dynamic routing service method, device, electronic equipment and storage medium
Technical Field
The present invention relates to internet technologies, and in particular, to a method and an apparatus for dynamic routing service, an electronic device, and a computer-readable storage medium.
Background
The routing service technology is a technology for supporting the acquisition of service information of a corresponding service system according to a call request of a service consumer based on an API gateway environment, and is particularly important in a micro-service scene. The inventor finds that the traditional route service mode is a static route mode. Most of the static routing modes are URL mapping belonging to rule routing, and corresponding service information is directly obtained without traversing routing rules. Through a static routing mode, flexible configuration of service scheduling strategies cannot be carried out on call requests of different service consumers, and therefore the API cannot be guaranteed to find service routes quickly and acquire corresponding service information.
Disclosure of Invention
Embodiments of the present invention provide a dynamic routing service method, an electronic device, an apparatus, and a computer-readable storage medium, which can execute a dynamic routing service, support flexible configuration of a routing scheduling policy, and ensure that an API gateway finds a service route quickly and obtains corresponding service information.
In order to solve the above technical problem, an embodiment of the present invention provides a dynamic routing service method, where the method includes: receiving a routing request, and verifying the legality of the routing request by using a first filter to obtain a legal routing request; utilizing a second filter to perform routing logic processing on the legal routing request to obtain a service route corresponding to the legal routing request, and calling a corresponding routing scheduling strategy according to the service route; and inquiring the service information according to the routing scheduling strategy, carrying out routing processing on the service information obtained by inquiry by using a third filter, and returning a routing result.
In order to solve the above problem, the present invention further provides a dynamic routing service apparatus, including: the validity checking module is used for receiving the routing request, checking the validity of the routing request by using a first filter and obtaining a legal routing request; the routing scheduling policy module is used for performing routing logic processing on the legal routing request by using a second filter to obtain a service route corresponding to the legal routing request, and calling a corresponding routing scheduling policy according to the service route; and the routing processing module is used for inquiring the service information according to the routing scheduling strategy, carrying out routing processing on the inquired service information by utilizing a third filter and returning a routing result.
In order to solve the above problem, the present invention also provides an electronic device, including: a memory storing at least one instruction; and the processor executes the instructions stored in the memory to realize the dynamic routing service method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, which stores at least one instruction, where the at least one instruction is executed by a processor in an electronic device to implement the dynamic routing service method described above.
The embodiment of the invention can improve the adaptability of the API gateway by filtering the illegal routing requests in the routing requests, simultaneously can ensure the safe matching of the subsequent routing requests, further carries out routing logic processing on the legal routing requests to obtain the corresponding service routes of the legal routing requests in the routing table, and can flexibly expand the corresponding routing scheduling strategies in real time by calling the corresponding routing scheduling strategies according to the service routes, thereby quickly finding the service routes and obtaining the corresponding service information.
Preferably, the method further comprises: and when any one of the first filter, the second filter and the third filter fails to execute, performing error reporting processing by using a fourth filter.
Preferably, the checking the validity of the routing request by using the first filter includes: analyzing the service request type of the routing request; identifying whether the analyzed service request type contains an identity; if the analyzed service request type does not contain the identity, deleting the corresponding routing request; and if the analyzed service request type contains the identity, taking the corresponding routing request as a legal routing request.
Preferably, the performing, by using the second filter, routing logic processing on the legal routing request in a routing table to obtain a service route corresponding to the legal routing request includes: acquiring a request address of the legal routing request; matching the request address with a service route in a preset routing table; and taking the successfully matched service route as the service route corresponding to the legal route request.
Preferably, the routing rule is stored by a data structure of key-value pairs.
The embodiment of the invention stores the routing rule through the data structure of the key value pair, so that the routing rule can be updated in real time when the request address in the routing request changes, the dynamic update of the routing rule is realized, and the problem of the concurrency of API gateways caused by the access of different routing requests to the same service is solved according to the dynamic update of the routing rule.
Preferably, the routing scheduling policy includes: an optimal response performance policy, a polling policy, and a business rule policy.
Preferably, the querying service information according to the routing scheduling policy includes: acquiring corresponding API service according to the routing scheduling strategy; and inquiring the service information according to the API service.
In summary, the embodiment of the present invention can execute dynamic routing service, support flexible configuration of a routing scheduling policy, and ensure that an API gateway finds a service route quickly and obtains corresponding service information.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings which correspond to and are not to be construed as limiting the embodiments, in which elements having the same reference numeral designations represent like elements throughout, and in which the drawings are not to be construed as limiting in scale unless otherwise specified.
FIG. 1 is a diagram of a first application environment of a dynamic routing service method provided by the present invention;
fig. 2 is a schematic diagram of a second application environment of the dynamic routing service method provided in the present invention;
fig. 3 is a flowchart of an implementation of a dynamic routing service method according to a first embodiment of the present invention;
FIG. 4 is a flowchart of validity verification of a routing request according to a second embodiment of the present invention;
FIG. 5 is a flow chart of a routing logic process for routing requests according to a third embodiment of the present invention;
fig. 6 is a schematic data interaction diagram of a dynamic routing service method according to a fourth embodiment of the present invention;
fig. 7 is a block diagram of a dynamic routing service apparatus according to a fifth embodiment of the present invention;
fig. 8 is a schematic internal structural diagram of an electronic device implementing a dynamic routing service method according to a sixth embodiment of the present invention;
the objects, features and advantages of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The core of the embodiment of the invention is to execute the dynamic routing service, support the flexible configuration of a routing scheduling strategy, ensure that an API gateway quickly finds a service route and acquire corresponding service information.
The following is a detailed description of implementation details of the dynamic routing service according to the embodiment of the present invention, and the following is only provided for easy understanding and is not necessary for implementing the present solution. Referring to fig. 1, it is a schematic diagram of a first application environment of the dynamic routing service method provided by the present invention.
The dynamic service routing method of the embodiment of the invention can be applied to a system architecture comprising one or more user sides 2, one or more API gateways 3 and a plurality of services 4.
In the embodiment of the present invention, after receiving a routing request for accessing one of the services 4 sent by a user 2, the API gateway 3 performs routing logic processing on the routing request to generate a routing scheduling policy, acquires a service address corresponding to the routing request according to the routing scheduling policy, and accesses the corresponding service 4 according to the service address.
Preferably, the routing logic process is implemented based on a preset filter, and the preset filter is configured in the API gateway 3 and includes: the filter comprises a first filter, a second filter, a third filter and a fourth filter.
The first filter is a pre-router check router and is used for checking the validity of a routing request sent by a user side 2; the second filter is a check router in the route and is used for inquiring a service route corresponding to a legal route request in a route table and generating a route scheduling strategy according to an inquiry result; the third filter is a post-routing check router and is used for performing routing processing on the service information obtained according to the routing scheduling policy query and returning a routing result; and the fourth filter is an error processing router and is used for carrying out error reporting processing when any one of the first filter, the second filter and the third filter fails to execute. Preferably, in this embodiment of the present invention, the first filter is a pre router, the second filter is a route router, the third filter is a post router, and the fourth filter is an error router.
Further, as shown in fig. 2, it is a schematic diagram of a second application environment of the dynamic routing service method provided by the present invention, and a system architecture of the dynamic routing service method may further include a load balancing component 5 and a service registry 6. The load balancing component 5 is configured to balance load between the routing request of the user end 2 and the API gateway 3. In detail, the routing request sent by the user terminal 2 is subjected to load balancing calculation through the load balancing component 6, and is distributed to the API gateway 3 with a smaller load to perform routing logic processing on the routing request. The service registry 6 is used to store service information for all services 4. In detail, the service 4 registers its service name and service address in the service registry 6, so as to query the service information from the service registry 6, thereby improving the query efficiency of the service information.
Specifically, the detailed implementation of the dynamic routing service method according to the embodiment of the present invention may refer to the descriptions of fig. 3 to fig. 5 below.
Fig. 3 is a flowchart of an implementation of the dynamic routing service method according to the first embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The first preferred embodiment of the dynamic routing service method shown in fig. 3 is applied to an electronic device, which is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like. In this embodiment of the present invention, the electronic device may be the API gateway 3 shown in fig. 1.
The embodiment of the invention can solve the problem that the API gateway can not quickly find the service route and acquire the corresponding service information because the corresponding service is accessed through the static route mapping rule and the route scheduling strategy can not be flexibly configured in the prior art. Preferably, the dynamic routing service method according to the embodiment of the present invention includes the following steps:
s1, receiving a routing request, and verifying the legality of the routing request by using a first filter to obtain a legal routing request.
As described above, the first filter according to the embodiment of the present invention is a pre filter.
The routing request refers to the access requirement of the user terminal 2 to a service 4, and the routing request generally comprises: request parameters and request address.
In one embodiment of the present invention, the pre filter may perform validity verification on the routing request according to whether the request parameter of the routing request includes an identity (token) of the service 4 to be accessed, so as to obtain the valid routing request. The detailed implementation flowchart of the validity verification may refer to the description about fig. 4 described below.
The embodiment of the invention can improve the adaptability of the API gateway and simultaneously ensure the safe matching of the subsequent routing request by filtering the illegal routing request in the routing request.
S2, carrying out routing logic processing on the legal routing request by using a second filter to obtain a service route corresponding to the legal routing request, and calling a corresponding routing scheduling strategy according to the service route.
As described above, the second filter according to the embodiment of the present invention is a route filter.
In the embodiment of the invention, based on the routing rule, the route filter is used for carrying out routing logic processing on the legal routing request, namely, the route filter is used for inquiring the service route corresponding to the legal routing request in a routing table.
In the embodiment of the invention, the routing rule comprises a conditional routing rule and a script routing rule. In one embodiment of the present invention, the conditional routing rule is generated based on a conditional expression, and is used to identify whether a request address in a routing request exists in a routing table; the script routing rule is generated based on a preset application script toolkit and is used for loading a service routing path corresponding to a request address in the routing request.
Preferably, the embodiment of the present invention stores the routing rule by a data structure of a key-value pair (key-value), stores the request address as a key value, and stores the service route as a value. Therefore, when the service 4 corresponding to the request address in the routing request changes, the value in the routing rule can be updated in real time, so that the dynamic update of the routing rule is realized, and according to the dynamic update of the routing rule, the problem of the concurrency of the API gateway caused by the fact that different routing requests access the same service is solved, so that the concurrency of service routing query through a routing table is supported.
It is to be stated that the routing rule will take effect in real time after being dynamically updated, that is, when receiving the next legal routing request, the route filter will query the service route through the routing table according to the updated routing rule, which satisfies the query of the service route by the user without perception.
The Routing table (Routing table), which may also be referred to as Routing Information Base (RIB), is a spreadsheet (file) or class database stored in a router or networked computer for storing paths that point to specific network addresses. In the embodiment of the present invention, the service route of each service 4 is stored in the routing table. Wherein the service route includes, but is not limited to: service addresses, service ports, etc.
Further, in order to quickly query a service route corresponding to a legal routing request in a routing table, in the embodiment of the present invention, a request address in the legal routing request is matched with a path stored in the routing table in advance according to the conditional routing rule, and relevant information in the matched routing rule is persistently stored, so as to facilitate subsequent query of the routing rule. Wherein the relevant information of the routing rule includes: the name of the routing rule, the type of routing rule, and the corresponding routing table path. For example, the name of the routing rule may be call _ control, the type of the routing rule may be String, and the routing table path may be 10.10.10.16/28.
In detail, the detailed implementation flowchart of querying the routing table for the service route corresponding to the legal route request by using the second filter may be referred to the following fig. 5.
Further, the embodiment of the invention calls the corresponding routing scheduling strategy according to the result of the query service routing. The routing scheduling policy according to the embodiment of the present invention includes, but is not limited to: an optimal response performance policy, a polling policy, and a business rule policy.
The optimal response performance strategy refers to that a plurality of services capable of completing user requests are selected from a service list returned during service discovery, the response time of the services is tested respectively, and the service with the optimal response performance is selected to be called as the highest priority strategy; the polling strategy refers to that all the service priorities are equal by default, and the first inquired available service is selected from a service list; the business rule strategy is that different business logic service calls are realized according to different business rules in a business scene.
Preferably, in the embodiment of the present invention, the invoking the corresponding routing scheduling policy according to the query result includes:
if the inquired service route is the service corresponding to the shortest response time in a service list, calling the optimal response performance strategy;
if the inquired service route is the first inquired service in a service list, calling the polling strategy;
and if the inquired service route is the service inquired based on the actual service logic in the service list, calling the service rule strategy.
According to the embodiment of the invention, the service route is obtained according to the query, the corresponding route scheduling strategy is called, the corresponding route scheduling strategy can be flexibly expanded in real time, and the accuracy of the service information query based on the API gateway is improved.
And S3, inquiring the service information according to the routing scheduling strategy, carrying out routing processing on the inquired service information by using a third filter, and returning a routing result.
As described above, the third filter is a post filter.
In the preferred embodiment of the invention, the corresponding API service can be obtained according to the routing scheduling strategy, and the corresponding service information is obtained by inquiring the service registration center according to the API service.
In the embodiment of the present invention, the API service may be understood as an interface that receives the routing request through the API gateway and needs to access the corresponding service.
Further, in the embodiment of the present invention, the service information is returned to the post filter through the path of the API service to perform routing processing, and a routing result is returned. The routing processing may be to perform operations desired by the user on the service information, for example, add an address field of the service information, count the success rate of the routing request, directly respond to the service information and return the service information to the user side, and the like.
Further, another embodiment of the present invention further includes: when the execution of any one of the pre filter, the route filter and the post filter fails, the filter jumps to a fourth filter, such as an error filter, to perform error reporting processing, that is, an error status code is returned to prompt the user that the dynamic service routing service has an error.
For the detailed implementation process of S1 in fig. 3, reference may be made to fig. 4. Fig. 4 is a flowchart of validity verification of a route request according to a second embodiment of the present invention, where the flowchart includes:
and S10, analyzing the service request type of the routing request.
In the embodiment of the invention, the service request type of the routing request is analyzed according to a preset database cluster. The preset database cluster can be formed by combining different databases, and mass service data are stored in the database cluster.
The embodiment of the invention analyzes the service request type of the route request by the following means:
acquiring a request parameter in the routing request, inquiring service data from the database cluster according to the request parameter in the routing request, and identifying the service request type of the routing request according to the inquired service data. Wherein the request parameters include: fields, ids, and attributes, etc.
S11, identifying whether the analyzed service request type contains an identity identifier or not by using the first filter, if the analyzed service request type does not contain the identity identifier, taking the corresponding route request as an illegal route request and deleting the corresponding route request, and if the analyzed service request type contains the identity identifier, taking the corresponding route request as a legal route request.
The embodiment of the invention deletes the routing request based on the identity, thereby realizing the accuracy of the legal verification.
The detailed implementation flow of S2 in fig. 3 can be seen from fig. 5. Fig. 5 is a flowchart of a routing logic process of a routing request according to a third embodiment of the present invention, including:
s20, obtaining the request address of the legal routing request.
The request address refers to a service address path which needs to be accessed by the legal routing request.
S21, matching the request address with the service route in the routing table.
In the embodiment of the invention, the routing table corresponding to the request address is inquired according to the routing table path in the routing rule, the service routing path corresponding to the request address in the routing table is loaded through the script routing rule in the routing rule, and the request address is matched with the service routing in the routing table by using the second filter according to the service routing path.
S22, the successfully matched service route is used as the service route corresponding to the legal route request.
For a better understanding of the embodiments of the present invention, reference may be made to the data interaction diagram of an application instance of the dynamic routing service shown in fig. 6.
Fig. 6 is a schematic diagram of data interaction of a dynamic routing service method according to a fourth embodiment of the present invention. And the user initiates a routing request through the user side, and distributes the routing request to each API gateway to realize load balancing. For the successfully distributed routing request, checking and filtering the routing request through a pre filter in the API gateway; based on a routing rule, utilizing a route filter of the API gateway to inquire a service route corresponding to the legal routing request in a routing table, calling a routing scheduling policy according to an inquired result, searching a corresponding API service according to the routing scheduling policy, acquiring corresponding service information from the service registration center according to the API service, returning the successfully acquired service information to a post filter in the API gateway through an API service path for processing, and returning a routing result. And if any one of the pre filter, the route filter and the post filter fails, skipping to an error filter of the API gateway for error reporting processing.
In summary, the embodiment of the present invention can improve the adaptability of the API gateway by filtering the illegal routing requests in the routing requests, and simultaneously ensure the secure matching of the subsequent routing requests; secondly, the embodiment of the invention stores the routing rule through the data structure of the key value pair, can realize the dynamic update of the routing rule, and solves the problem of the concurrency of API gateway caused by different routing requests accessing the same service according to the dynamic update of the routing rule; furthermore, the embodiment of the invention calls the corresponding routing scheduling strategy according to the service route obtained by query, can flexibly expand the corresponding routing scheduling strategy in real time, and improves the accuracy of service information query based on the API gateway. Therefore, the embodiment of the invention can execute the dynamic routing service, supports the flexible configuration of the routing scheduling strategy, and ensures that the API gateway can quickly find the service route and acquire the corresponding service information.
Fig. 7 is a schematic block diagram of a dynamic routing service apparatus according to a fifth embodiment of the present invention.
The dynamic routing service apparatus 100 of the present invention may be installed in an electronic device. According to the implemented functions, the dynamic routing service device may include a validity checking module 101, a routing scheduling policy module 102, and a routing processing module 103. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions of the respective modules/units are as follows:
the validity checking module 101 is configured to receive a routing request, check validity of the routing request by using a first filter, and obtain a valid routing request.
And the routing scheduling policy module 102 is configured to perform routing logic processing on the legal routing request by using a second filter, obtain a service route corresponding to the legal routing request, and invoke a corresponding routing scheduling policy according to the service route.
And the route processing module 103 is configured to query the service information according to the route scheduling policy, perform route processing on the queried service information by using a third filter, and return a route result.
The module in the device provided by the application can execute the dynamic routing service as the dynamic routing service method, supports the flexible configuration of the routing scheduling strategy, and can obtain the same technical effect as the method embodiment in specific operation, namely, the corresponding routing scheduling strategy can be flexibly expanded in real time, so that the service route can be quickly found, and the corresponding service information can be obtained.
Fig. 8 is a schematic diagram of an internal structure of an electronic device implementing a dynamic routing service method according to a sixth embodiment of the present invention.
The electronic device 1 may be an API gateway and comprise a processor 12, a memory 11 and a bus, and may further comprise a computer program, such as a dynamic routing service program 110, stored in the memory 11 and operable on the processor 12.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, e.g. a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a flash memory Card (FlashCard), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as a code of the dynamic routing service program 110, but also for temporarily storing data that has been output or will be output.
The processor 12 may be formed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed of a plurality of integrated circuits packaged with the same function or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 12 is a control unit (control unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules (for example, executing the dynamic routing service program 110, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 12 or the like.
Fig. 8 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 8 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 12 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device 1 and another electronic device.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The request dynamic routing service program 110 stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 12, a specific implementation method may refer to the description of relevant steps in the embodiments corresponding to fig. 3 to fig. 5, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read-only memory (ROM).
The computer-readable storage medium has stored thereon a dynamic routing service program executable by one or more processors to:
receiving a routing request, and verifying the legality of the routing request by using a first filter to obtain a legal routing request;
utilizing a second filter to perform routing logic processing on the legal routing request to obtain a service route corresponding to the legal routing request, and calling a corresponding routing scheduling strategy according to the service route;
and inquiring the service information according to the routing scheduling strategy, carrying out routing processing on the inquired service information by utilizing a third filter, and returning a routing result.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, functional modules 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 can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it will be obvious that the term "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited may also be implemented by one unit or means through software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the same, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A dynamic routing service method, the method comprising:
receiving a routing request, and verifying the legality of the routing request by using a first filter to obtain a legal routing request;
utilizing a second filter to carry out routing logic processing on the legal routing request to obtain a service route corresponding to the legal routing request, and calling a corresponding routing scheduling strategy according to the service route;
and inquiring the service information according to the routing scheduling strategy, carrying out routing processing on the service information obtained by inquiry by using a third filter, and returning a routing result.
2. The dynamic routing service method of claim 1, further comprising:
and when any one of the first filter, the second filter and the third filter fails to execute, performing error reporting processing by using a fourth filter.
3. The dynamic routing service method of claim 1, wherein the checking the validity of the routing request with the first filter comprises:
analyzing the service request type of the routing request;
identifying whether the analyzed service request type contains an identity;
if the analyzed service request type does not contain the identity, taking the corresponding route request as an illegal route request and deleting the corresponding route request;
and if the analyzed service request type contains the identity, taking the corresponding routing request as a legal routing request.
4. The dynamic routing service method according to claim 3, wherein the performing routing logic processing on the legal routing request in a routing table by using a second filter to obtain a service route corresponding to the legal routing request includes:
acquiring a request address of the legal routing request;
matching the request address with a service route in a routing table;
and taking the successfully matched service route as the service route corresponding to the legal route request.
5. The dynamic routing service method of claim 4, wherein the routing rule is stored by a data structure of key-value pairs.
6. The dynamic routing service method according to any of claims 1 to 5, wherein the routing scheduling policy comprises: an optimal response performance policy, a polling policy, and a business rule policy.
7. The dynamic routing service method of claim 6, wherein the querying service information according to the routing scheduling policy comprises:
acquiring corresponding API service according to the routing scheduling strategy;
and inquiring the service information according to the API service.
8. A dynamic routing service apparatus, the apparatus comprising:
the validity checking module is used for receiving the routing request and checking the validity of the routing request by using the first filter to obtain a valid routing request;
the routing scheduling policy module is used for performing routing logic processing on the legal routing request by using a second filter to obtain a service route corresponding to the legal routing request, and calling a corresponding routing scheduling policy according to the service route;
and the routing processing module is used for inquiring the service information according to the routing scheduling strategy, carrying out routing processing on the inquired service information by utilizing a third filter and returning a routing result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the dynamic routing service method of any of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the dynamic routing service method according to any one of claims 1 to 7.
CN202010658537.2A 2020-07-09 2020-07-09 Dynamic routing service method, device, electronic equipment and storage medium Active CN111901238B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010658537.2A CN111901238B (en) 2020-07-09 2020-07-09 Dynamic routing service method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010658537.2A CN111901238B (en) 2020-07-09 2020-07-09 Dynamic routing service method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111901238A CN111901238A (en) 2020-11-06
CN111901238B true CN111901238B (en) 2022-10-18

Family

ID=73192186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010658537.2A Active CN111901238B (en) 2020-07-09 2020-07-09 Dynamic routing service method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111901238B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112532523B (en) * 2020-11-23 2021-11-12 福建顶点软件股份有限公司 In-process scheduling method based on sub-service routing and storage device
CN113381928B (en) * 2021-06-08 2022-11-08 北京沃东天骏信息技术有限公司 Gateway request chain management method and device, electronic equipment and computer medium
CN113489650B (en) * 2021-06-30 2022-10-21 中国平安人寿保险股份有限公司 Routing method, device and equipment of client and storage medium
CN113704000B (en) * 2021-08-30 2024-05-17 康键信息技术(深圳)有限公司 Service access optimization method, device, equipment and medium
CN114500269B (en) * 2022-01-17 2023-04-07 重庆长安汽车股份有限公司 Method for routing and distributing vehicle-end signals based on custom attributes and vehicle
CN115277863B (en) * 2022-06-27 2024-05-14 中盈优创资讯科技有限公司 Scheduling method of API (application program interface) route

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102255867A (en) * 2010-05-18 2011-11-23 华为技术有限公司 Service request processing method, device and system
CN106992982A (en) * 2017-03-31 2017-07-28 中国人民解放军信息工程大学 A kind of dynamic routing protocol based on SDN performs body and realizes device and method
CN108667660A (en) * 2018-05-08 2018-10-16 腾讯科技(深圳)有限公司 The method and apparatus and route system of routing management and business routing

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100450067C (en) * 2005-11-18 2009-01-07 华为技术有限公司 Service apparatus exchange network and exchange method
CN1997074A (en) * 2006-12-27 2007-07-11 华为技术有限公司 System, device and method for strategy-based routing mode
CN105450757A (en) * 2015-12-02 2016-03-30 联动优势电子商务有限公司 Service management method and system
CN106686094A (en) * 2016-12-30 2017-05-17 郑州云海信息技术有限公司 Micro-service architecture
US10791056B2 (en) * 2018-04-16 2020-09-29 Citrix Systems, Inc. Policy based service routing
CN109597854A (en) * 2018-10-31 2019-04-09 深圳壹账通智能科技有限公司 A kind of method for routing of service request, device, computer equipment and computer storage medium
CN110958180B (en) * 2019-11-14 2024-05-21 微民保险代理有限公司 Gateway routing method, intelligent gateway, electronic device and computer storage medium
CN111314226A (en) * 2020-03-04 2020-06-19 厦门靠谱云股份有限公司 Method for dynamically configuring multi-protocol downstream service forwarding in zuul gateway

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102255867A (en) * 2010-05-18 2011-11-23 华为技术有限公司 Service request processing method, device and system
CN106992982A (en) * 2017-03-31 2017-07-28 中国人民解放军信息工程大学 A kind of dynamic routing protocol based on SDN performs body and realizes device and method
CN108667660A (en) * 2018-05-08 2018-10-16 腾讯科技(深圳)有限公司 The method and apparatus and route system of routing management and business routing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于GPON的策略路由设计与实现;刘晓晨;《信息与电脑(理论版)》;20170508(第09期);全文 *

Also Published As

Publication number Publication date
CN111901238A (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN111901238B (en) Dynamic routing service method, device, electronic equipment and storage medium
US9218169B2 (en) Callpath finder
CN107633016B (en) Data processing method and device and electronic equipment
US20180293257A1 (en) Method for accessing distributed database and distributed data service apparatus
CN113360519B (en) Data processing method, device, equipment and storage medium
CN111641706A (en) Micro service system creating method and device, electronic equipment and storage medium
CN111225018A (en) Request message processing method and device and electronic equipment
CN115422273A (en) Data lake metadata processing method and device, electronic equipment, medium and product
CN112949278A (en) Data checking method and device, electronic equipment and readable storage medium
CN114281803A (en) Data migration method, device, equipment, medium and program product
CN113434501A (en) Storage method and device of relational database table and readable storage medium
CN105978744A (en) Resource allocation method, device and system
CN110874365B (en) Information query method and related equipment thereof
CN110580312B (en) Data query method, device and computer readable storage medium
US11531706B2 (en) Graph search using index vertices
CN112328656B (en) Service query method, device, equipment and storage medium based on middle platform architecture
CN115022397A (en) Interface parameter simplifying method and device, electronic equipment and storage medium
CN116010389A (en) Data verification method, device, equipment and storage medium
CN109614230A (en) Resource virtualizing method, apparatus and electronic equipment
CN114003661A (en) Offline data entry method and device, electronic equipment and storage medium
CN114727100A (en) Joint debugging method and device for monitoring equipment
CN112686759A (en) Account checking monitoring method, device, equipment and medium
CN111125232A (en) Method and device for accessing public cloud asset information
CN111078571A (en) Test method for simulation response, terminal device and computer readable storage medium
CN110753082A (en) Service calling method and terminal equipment

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