CN114285904A - Intelligent routing method and device for service - Google Patents

Intelligent routing method and device for service Download PDF

Info

Publication number
CN114285904A
CN114285904A CN202111583939.1A CN202111583939A CN114285904A CN 114285904 A CN114285904 A CN 114285904A CN 202111583939 A CN202111583939 A CN 202111583939A CN 114285904 A CN114285904 A CN 114285904A
Authority
CN
China
Prior art keywords
routing
server
mode
service request
preference
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.)
Pending
Application number
CN202111583939.1A
Other languages
Chinese (zh)
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.)
Shanghai Kingstar Fintech Co Ltd
Original Assignee
Shanghai Kingstar Fintech 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 Shanghai Kingstar Fintech Co Ltd filed Critical Shanghai Kingstar Fintech Co Ltd
Priority to CN202111583939.1A priority Critical patent/CN114285904A/en
Publication of CN114285904A publication Critical patent/CN114285904A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The application discloses an intelligent routing method and device for service, which set various routing strategies and respective matched routing preference parameters aiming at different application modes, such as different production/development modes, and carry out routing processing on service requests according to the routing preference parameters and the routing strategies matched with target application modes to which the service requests belong aiming at the service requests of different application modes.

Description

Intelligent routing method and device for service
Technical Field
The present application belongs to the field of communications technologies, and in particular, to an intelligent routing method and apparatus for services.
Background
The high-load service is generally carried by a server cluster consisting of a plurality of servers, and when a request comes, in order to distribute the request to a back-end server in a balanced manner and enable the request to access to a server address which the request wants to access, a corresponding routing algorithm, namely an intelligent routing algorithm, needs to be designed.
At present, for a high load service, a load balancing program usually selects a server from an address list corresponding to the service through a corresponding load balancing algorithm and rule to provide the service, so as to achieve the purpose of load balancing of the service. Therefore, the current service routing can only realize the routing function according to a specific load balancing algorithm and can not meet various customized requirements.
Disclosure of Invention
In view of this, the present application provides an intelligent routing method and apparatus for services, which are used to overcome the defects existing in the existing routing scheme, so that routing can be better performed for different application scenarios.
The specific technical scheme is as follows:
an intelligent routing method for services, comprising:
acquiring a service request of a requester and a target application mode to which the service request belongs;
selecting a target routing strategy matched with the target application mode from a preset routing strategy set;
determining a target routing preference parameter corresponding to the target application mode; wherein, different application modes respectively correspond to different route preference parameters and route strategies;
and based on the target routing preference parameter, utilizing the target routing strategy to perform routing processing on the service request so as to route the service request to a corresponding server in a server cluster.
Optionally, the obtaining a service request of the requester includes:
and acquiring a service request initiated by a requester through a graphical user interface or a postman interface.
Optionally, the target application mode to which the service request belongs is a corresponding mode in an integrated development mode, a production mode or a local preference mode;
if the target application mode to which the service request belongs is an integrated development mode, the service request is initiated by a requester through a graphical user interface or a postman interface; if the target application mode to which the service request belongs is a production mode, the service request is initiated by a requester through a graphical user interface; and if the target application mode to which the service request belongs is a local preference mode, the service request is initiated by a requester through a postman interface.
Optionally, the determining a target routing preference parameter corresponding to the target application mode includes:
if the target application mode is an integrated development mode, determining that the target routing preference parameter is a first global preference parameter configured for the integrated development mode in advance;
if the target application mode is a production mode, determining that the target routing preference parameter is null;
if the target application mode is a local preference mode, determining that the target routing preference parameter is a local preference parameter and a second global preference parameter which are configured for the local preference mode in advance;
the first global preference parameter, the local preference parameter and the second global preference parameter respectively comprise server addresses of one or more servers corresponding to the preference; the local preference parameter has a higher priority than the second global preference parameter.
Optionally, if the target application mode is an integrated development mode, the performing, based on the target routing preference parameter and using the target routing policy, routing the service request includes:
selecting a first server which is online and meets a preset routing algorithm from all servers indicated by all server addresses in the first global preference parameter;
if the selection is successful, routing the service request to the first server to be passed by the first server to a desired service on a call chain of the integrated development mode;
and if the selection is not successful, selecting a second server which is online and meets a preset routing algorithm from the server cluster, and routing the service request to the second server so that the second server transmits the service request to the required service on the call chain of the integrated development mode.
Optionally, if the target application mode is a production mode, the performing, based on the target routing preference parameter and using the target routing policy, routing the service request includes:
selecting a third server which is online and meets a preset routing algorithm from the server cluster;
routing the service request to the third server for delivery by the third server to a desired service on the production mode call chain.
Optionally, if the target application mode is a local preference mode, the performing, based on the target routing preference parameter and using the target routing policy, routing the service request includes:
judging whether a fourth server indicated by the server address in the local preference parameter can provide the required service online or not; if so, routing the service request to the fourth server, so that the fourth server transmits the service request to a required service on a call chain of the local preference mode;
if not, judging whether the local equipment of the requester can provide the required service on line; if so, routing the service request to the local equipment, so that the local equipment transmits the service request to a required service on a call chain of the local preference mode;
if not, selecting a fifth server which is online and meets a preset routing algorithm from the servers indicated by the server addresses in the second global preference parameter;
if the selection is successful, routing the service request to the fifth server for delivery by the fifth server to a desired service on the invocation chain of the local preference mode;
and if the selection is not successful, selecting a sixth server which is online and meets a preset routing algorithm from the server cluster, and routing the service request to the sixth server so that the sixth server transfers the service request to the required service on the call chain of the local preference mode.
Optionally, selecting an online server that meets a preset routing algorithm from the server cluster includes:
and selecting the servers which are online and meet the requirements of a preset routing algorithm and weight from the server cluster according to a weighted polling mode.
An intelligent routing apparatus for services, comprising:
the request acquisition module is used for acquiring a service request of a requester and a target application mode to which the service request belongs;
the strategy selection module is used for selecting a target routing strategy matched with the target application mode from a preset routing strategy set;
a preference determination module for determining a target routing preference parameter corresponding to the target application mode; wherein, different application modes respectively correspond to different route preference parameters and route strategies;
and the routing processing module is used for carrying out routing processing on the service request by utilizing the target routing strategy based on the target routing preference parameter so as to route the service request to a corresponding server in the server cluster.
Optionally, the preference determining module is specifically configured to:
if the target application mode is an integrated development mode, determining that the target routing preference parameter is a first global preference parameter configured for the integrated development mode in advance;
if the target application mode is a production mode, determining that the target routing preference parameter is null;
if the target application mode is a local preference mode, determining that the target routing preference parameter is a local preference parameter and a second global preference parameter which are configured for the local preference mode in advance;
the first global preference parameter, the local preference parameter and the second global preference parameter respectively comprise server addresses of one or more servers corresponding to the preference; the local preference parameter has a higher priority than the second global preference parameter.
According to the scheme, the intelligent routing method and device for the service set by the application set various routing strategies and the respective matched routing preference parameters aiming at different application modes, such as different production/development modes, and route the service request according to the routing preference parameters and the routing strategies matched with the target application mode to which the service request belongs aiming at the service request of different application modes.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a method for intelligent routing of services provided by the present application;
FIG. 2 is a service routing flow diagram of two application modes of scenario one provided herein;
fig. 3 is a service routing flowchart of two application modes of scenario two provided in the present application;
fig. 4 is a block diagram of an intelligent routing device for services provided by the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
The embodiment of the application discloses an intelligent routing method and device for service, which are used for overcoming the defects of the existing routing scheme and better selecting the route aiming at different application scenes.
Referring to fig. 1, an intelligent routing method for services disclosed in the embodiment of the present application specifically includes the following processing steps:
step 101, obtaining a service request of a requester and a target application mode to which the service request belongs.
Specifically, a service request initiated by a requester through a GUI (graphical user Interface) or a postman Interface may be obtained.
Illustratively, the target application mode to which the service request belongs is a corresponding one of an integrated development mode, a production mode, or a local preference mode.
The production mode mainly refers to the situation of the system in production, and the system can only send message instructions through a GUI (graphical user interface) in the mode; the integrated development mode mainly represents the development stage of the system, and in the mode, developers can send message instructions through a postman interface to test or simulate real scenes and can also send the message instructions through a GUI (graphical user interface); the local preference mode represents the stage of local debugging of the developer, and the developer can use the preference configuration of the local machine based on the scheme of the application, so that the micro service on the local machine can be relatively preferentially routed during debugging.
Correspondingly, if the target application mode to which the service request belongs is an integrated development mode, the service request is initiated by a requester through a GUI (graphical user interface) or a postman interface; if the target application mode to which the service request belongs is a production mode, the service request is initiated by a requester through a GUI; if the target application mode to which the service request belongs is a local preference mode, the service request is initiated by the requester through the postman interface.
And 102, selecting a target routing strategy matched with the target application mode from a preset routing strategy set.
According to the embodiment of the application, various routing strategies and respective matched routing preference parameters are set for different application modes, such as different production/development modes, and the routing preference parameters of the application modes can be configured in a configuration center in advance.
The different application modes correspond to different routing strategies and different routing preference parameters, and the different routing strategies respectively obtain a target server needing to route the service request by executing target server selection based on the routing preference parameters and/or executing target server selection based on the whole server cluster according to different priority orders.
And 103, determining a target routing preference parameter corresponding to the target application mode.
Illustratively, taking the application mode including an integrated development mode, a production mode and a local preference mode as an example, the step 103 may be further implemented as:
11) if the target application mode to which the service request belongs is the integrated development mode, determining that the target routing preference parameter to be adopted is a first global preference parameter configured for the integrated development mode in advance;
12) if the target application mode to which the service request belongs is a production mode, determining that a target routing preference parameter to be adopted is null;
that is, the production mode only needs to guarantee load balancing, and does not need to configure the route preference parameter.
13) And if the target application mode to which the service request belongs is the local preference mode, determining that the target routing preference parameters to be adopted are the local preference parameters and the second global preference parameters which are configured for the local preference mode in advance.
The first global preference parameter, the local preference parameter and the second global preference parameter respectively comprise server addresses of one or more servers which are correspondingly preferred; and the priority of the local preference parameter is higher than that of the second global preference parameter.
The route preference parameters of each application mode are set in an application scene in order to meet certain application conditions, for example, a low-load server needs to be configured for pressure measurement in an integrated development mode, and the production mode only needs to ensure load balance without configuring the route preference parameters, so that the configured route preference parameters can be distinguished according to different scenes and different application modes, for example, the above-mentioned pressure measurement needs to take the low-load server or the high-load server as preference, and configure the server address of the low-load server or the high-load server in a configuration center as the route preference parameters so as to meet personalized requirements.
Further, the first global preference parameter and the second global preference parameter may configure the server addresses of the servers preferred by the corresponding mode in a list manner, and the server address lists corresponding to the first global preference parameter and the second global preference parameter may be different server address lists respectively or may be the same server address list, which is not limited to this.
It should be noted that, when the method of the present application is actually applied, the execution sequence of step 102 and step 103 is not limited, and step 102 may be performed before step 103, or step 103 may be performed after step 103, or step 103 may be performed before step 102, or step 102 may be performed after step 103, or both may be performed in parallel.
And 104, based on the determined target routing preference parameters, utilizing the target routing strategy to perform routing processing on the service request so as to route the service request to a corresponding server in the server cluster.
Finally, the service request is routed based on the target routing preference parameter matched with the target application mode to which the service request belongs and the target routing strategy so as to route the service request to a corresponding server in the server cluster.
In the following, for the case that the target application mode to which the service request belongs is an integrated development mode, a production mode, or a local preference mode, an implementation process for processing the reason of the service request in each mode is provided.
If the target application mode is the integrated development mode, routing the service request based on the target routing preference parameter and the target routing policy matched with the integrated development mode, which can be specifically realized as follows:
21) selecting a first server which is online and meets a preset routing algorithm from the servers indicated by the server addresses in the first global preference parameter;
and each server indicated by each server address in the first global preference parameter is a server with preference tendency selected from a server cluster based on a global angle in the integrated development mode, and the server address of each selected server is configured in a configuration center to form a server address list with preference tendency.
Wherein, the routing algorithm can be designed according to actual requirements. For the case that each server indicated by each server address in the first global preference parameter does not satisfy the routing algorithm, the selection may fail.
22) If the selection is successful, routing the service request to the selected first server so that the first server can transfer the service request to the required service on the call chain of the integrated development mode;
23) and if the selection is not successful, selecting a second server which is online and meets a preset routing algorithm from the server cluster, and routing the service request to the selected second server so that the second server can deliver the service request to the required service on the call chain of the integrated development mode.
Specifically, a server which is online and meets the requirements of a preset routing algorithm and weight can be selected from the server cluster according to a weighted polling mode. Where each server is configured differently, preferably a high-load, low-load machine is configured with a higher weight so that it processes more requests. The weighted round robin algorithm distributes the service requests to the back-end in order and according to the server weight.
If the target application mode is the production mode, routing the service request based on the target routing preference parameter and the target routing policy matched with the production mode, which can be specifically realized as follows:
31) selecting a third server which is online and meets a preset routing algorithm from the server cluster;
32) the service request is routed to the third server for delivery by the third server to the desired service on the production mode call chain.
If the target application mode is the local preference mode, the service request is routed based on the target routing preference parameter matched with the local preference mode and the target routing policy, which can be specifically realized as follows:
41) judging whether a fourth server indicated by the server address in the local preference parameter can provide the required service online or not; if so, routing the service request to a fourth server so that the fourth server transmits the service request to a required service on a call chain of the local preference mode;
the address of the server included in the local preference parameter is the address of the locally preferred server configured to the configuration center for the local preference mode.
42) If not, judging whether the local equipment of the requester can provide the required service on line; if yes, routing the service request to the local equipment of the requester so that the local equipment of the requester transfers the service request to the required service on the call chain of the local preference mode;
43) if not, selecting a fifth server which is online and meets the preset routing algorithm from the servers indicated by the server addresses in the second global preference parameter;
and each server indicated by each server address in the second global preference parameter is a server with preference tendency selected from the server cluster based on the global angle in the local preference mode, and the server address of each selected server is configured in the configuration center to form a server address list with preference tendency in the global angle in the local preference mode.
44) If the selection is successful, routing the service request to a fifth server so that the fifth server can transfer the service request to a required service on a call chain of the local preference mode;
45) and if the selection is not successful, selecting a sixth server which is online and meets a preset routing algorithm from the server cluster, and routing the service request to the sixth server so that the sixth server transfers the service request to the required service on the call chain of the local preference mode.
According to the scheme, the method sets various routing strategies and the respective matched routing preference parameters aiming at different application modes, such as different production/development modes, and carries out routing processing on the service request according to the routing preference parameters and the routing strategies matched with the target application mode to which the service request belongs aiming at the service request of different application modes, so that the defects of the existing routing scheme are overcome, the routing can be better selected aiming at different application scenes, and the customized service routing requirements of different scenes and different production/development modes are met.
An application example of the method of the present application is provided below.
The example divides different application modes into a first scene and a second scene according to differences of call chains, wherein the first scene mainly initiates a message instruction through a GUI (graphical user interface), including an integrated development mode and a production mode, and the second scene initiates a message instruction through a postman interface, including an integrated development mode and a local preference mode. The following describes the service routing process in detail for different modes in each scenario respectively:
(one) scene one
Calling a chain: GUI- > ks-gateway- > Service1- > Service 2;
a1, integrated development mode
With reference to fig. 2, the service routing process in this mode can be specifically implemented as:
101: setting ip1 for integration. ip 2; …, respectively;
the set addresses of the servers are the first global preference parameters.
102: the CUI sends a request to the Gateway;
103: selecting from the server list configured in the step 101; selecting servers which provide services online and meet a routing algorithm from ip1, ip2 and …, and judging whether the selection is successful;
104: if the selection is successful, routing to a server with successful selection;
105: if the selection is not successful, selecting the server cluster according to a weighted polling method aiming at the current online server list of the server cluster;
where each server is configured differently, it is preferable to configure machines that are configured high and low in load with higher weights so that they process more requests. The weighted round robin algorithm distributes the service requests to the back-end in order and according to the server weight.
106: the request command is routed to the selected server, and the server transparently transmits the request command to Service1 and then to Service 2.
a2 production mode
As shown in fig. 2, the service routing process in the production mode can be specifically implemented as:
201: deleting the integration.
The production mode only needs to ensure load balance, and routing preference parameters do not need to be configured.
202: the GUI sends a request instruction to the Gateway;
203: selecting the servers in the server list of the server cluster which is on line at present according to a weighted polling method;
each server configuration is different, and the higher weight of the machine configuration with high configuration and low load can be used for processing more requests. The weighted round robin algorithm distributes the request order and server weight to the back-end.
204: the request command is routed to the selected server, and the server transparently transmits the request command to Service1 and then to Service 2.
(II) scene II
Calling a chain: postman- > ks-gateway- > Service1- > Service 2;
b1, Integrated development mode
Referring to fig. 3 in combination, the service routing process in this mode can be specifically implemented as:
301: setting ip1 for integration. ip 2; …, respectively;
the set addresses of the servers are used as the first global preference parameter.
302: postman sends a request to Gateway;
303: selecting from the server list configured in step 301; and selecting a server which provides services online in ip1, ip2 and … and meets a routing algorithm, and judging whether the selection is successful.
304: if the selection is successful, routing to the server;
305: if the selection is unsuccessful, selecting the servers in the current online server list of the server cluster according to a weighted polling method (each server is configured differently, and a machine with high configuration and low load is configured with higher weight to process more requests;
306: the request instruction is routed to the selected server, and the server transparently transmits the routing instruction to Service1 and then to Service 2.
b2, local development mode
As shown in fig. 3, the service routing process in the local development mode may be specifically implemented as:
401: configuring local preference parameters in a configuration center; for example: reference. server. address 10.254.2.53;
402: postman sends a request instruction to Gateway.
When a request is sent by Postman, an x-kingstar-forwarded-for parameter is newly added in a request header, and the value is an IP address of a development local machine which initiates the request, such as: 10.254.2.54, respectively; the value of the request header is passed all the way to Service 2.
403: when the Gateway is routed to Service1, judging whether 10.254.2.53 is online and providing Service;
404: if so, the request instruction is routed to 10.254.2.53;
405: if not, then a determination 10.254.2.54 is made as to whether online and providing service;
406: if so, the request instruction is routed to 10.254.2.54;
407: if not, judging whether an online server exists in a server list configured in integration.
The server list configured in integration server address is the second global preference parameter described above.
408: if yes, selecting from a server list configured by integration.
409: if not, selecting the current online service list according to a weighted polling method;
410: the request command is routed to the selected server, and the server routing command is transmitted to the Service1 and then to the Service 2.
Corresponding to the above method, an embodiment of the present application further discloses an intelligent routing apparatus for services, as shown in fig. 4, the apparatus includes:
a request obtaining module 10, configured to obtain a service request of a requester and a target application mode to which the service request belongs;
a policy selecting module 20, configured to select a target routing policy matching the target application pattern from a preset routing policy set;
a preference determining module 30 for determining a target routing preference parameter corresponding to the target application mode; wherein, different application modes respectively correspond to different route preference parameters and route strategies;
and the route processing module 40 is configured to perform route processing on the service request by using the target routing policy based on the target routing preference parameter, so as to route the service request to a corresponding server in the server cluster.
In an embodiment, when acquiring a service request of a requester, the request acquiring module 10 is specifically configured to: and acquiring a service request initiated by a requester through a graphical user interface or a postman interface.
In one embodiment, the target application mode to which the service request belongs is a corresponding mode of an integrated development mode, a production mode or a local preference mode;
if the target application mode to which the service request belongs is an integrated development mode, the service request is initiated by a requester through a graphical user interface or a postman interface; if the target application mode to which the service request belongs is a production mode, the service request is initiated by a requester through a graphical user interface; and if the target application mode to which the service request belongs is a local preference mode, the service request is initiated by a requester through a postman interface.
In an embodiment, the preference determining module 30 is specifically configured to:
if the target application mode is an integrated development mode, determining that the target routing preference parameter is a first global preference parameter configured for the integrated development mode in advance;
if the target application mode is a production mode, determining that the target routing preference parameter is null;
if the target application mode is a local preference mode, determining that the target routing preference parameter is a local preference parameter and a second global preference parameter which are configured for the local preference mode in advance;
the first global preference parameter, the local preference parameter and the second global preference parameter respectively comprise server addresses of one or more servers corresponding to the preference; the local preference parameter has a higher priority than the second global preference parameter.
In an embodiment, if the target application mode is an integrated development mode, the route processing module 40 is specifically configured to:
selecting a first server which is online and meets a preset routing algorithm from all servers indicated by all server addresses in the first global preference parameter;
if the selection is successful, routing the service request to the first server to be passed by the first server to a desired service on a call chain of the integrated development mode;
and if the selection is not successful, selecting a second server which is online and meets a preset routing algorithm from the server cluster, and routing the service request to the second server so that the second server transmits the service request to the required service on the call chain of the integrated development mode.
In an embodiment, if the target application mode is a production mode, the route processing module 40 is specifically configured to:
selecting a third server which is online and meets a preset routing algorithm from the server cluster;
routing the service request to the third server for delivery by the third server to a desired service on the production mode call chain.
In an embodiment, if the target application mode is the local preference mode, the route processing module 40 is specifically configured to:
the route processing module 40 is specifically configured to:
in an embodiment, when a server that is online and satisfies a preset routing algorithm is selected from the server cluster, the routing processing module 40 is specifically configured to:
and selecting the servers which are online and meet the requirements of a preset routing algorithm and weight from the server cluster according to a weighted polling mode.
For the intelligent routing device for the service disclosed in the embodiment of the present application, since it corresponds to the intelligent routing method for the service disclosed in the above respective method embodiments, the description is relatively simple, and for the relevant similarities, please refer to the description of the above respective method embodiments, and details are not described here.
To sum up, the method and the device for intelligent routing of services disclosed in the embodiments of the present application configure the routing preference parameters required correspondingly in the configuration center according to different production requirements, development modes, and the like, and select different routing policies in different modes according to the configured routing preference parameters to perform routing processing on the service request, so that routing can be performed better for different application scenarios, and customized requirements of various modes are satisfied. And load balance is guaranteed by means of a weighted polling algorithm.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
For convenience of description, the above system or apparatus is described as being divided into various modules or units by function, respectively. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
Finally, it is further noted that, herein, relational terms such as first, second, third, fourth, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. An intelligent routing method for services, comprising:
acquiring a service request of a requester and a target application mode to which the service request belongs;
selecting a target routing strategy matched with the target application mode from a preset routing strategy set;
determining a target routing preference parameter corresponding to the target application mode; wherein, different application modes respectively correspond to different route preference parameters and route strategies;
and based on the target routing preference parameter, utilizing the target routing strategy to perform routing processing on the service request so as to route the service request to a corresponding server in a server cluster.
2. The method of claim 1, wherein obtaining the service request of the requestor comprises:
and acquiring a service request initiated by a requester through a graphical user interface or a postman interface.
3. The method of claim 2, wherein the target application mode to which the service request belongs is a corresponding one of an integrated development mode, a production mode, or a local preference mode;
if the target application mode to which the service request belongs is an integrated development mode, the service request is initiated by a requester through a graphical user interface or a postman interface; if the target application mode to which the service request belongs is a production mode, the service request is initiated by a requester through a graphical user interface; and if the target application mode to which the service request belongs is a local preference mode, the service request is initiated by a requester through a postman interface.
4. The method of claim 3, wherein determining the target routing preference parameter corresponding to the target application mode comprises:
if the target application mode is an integrated development mode, determining that the target routing preference parameter is a first global preference parameter configured for the integrated development mode in advance;
if the target application mode is a production mode, determining that the target routing preference parameter is null;
if the target application mode is a local preference mode, determining that the target routing preference parameter is a local preference parameter and a second global preference parameter which are configured for the local preference mode in advance;
the first global preference parameter, the local preference parameter and the second global preference parameter respectively comprise server addresses of one or more servers corresponding to the preference; the local preference parameter has a higher priority than the second global preference parameter.
5. The method of claim 4, wherein if the target application mode is an integrated development mode, the routing the service request based on the target routing preference parameter and using the target routing policy comprises:
selecting a first server which is online and meets a preset routing algorithm from all servers indicated by all server addresses in the first global preference parameter;
if the selection is successful, routing the service request to the first server to be passed by the first server to a desired service on a call chain of the integrated development mode;
and if the selection is not successful, selecting a second server which is online and meets a preset routing algorithm from the server cluster, and routing the service request to the second server so that the second server transmits the service request to the required service on the call chain of the integrated development mode.
6. The method of claim 4, wherein if the target application mode is a production mode, the routing the service request based on the target routing preference parameter and using the target routing policy comprises:
selecting a third server which is online and meets a preset routing algorithm from the server cluster;
routing the service request to the third server for delivery by the third server to a desired service on the production mode call chain.
7. The method of claim 4, wherein if the target application mode is a local preference mode, the routing the service request based on the target routing preference parameter and using the target routing policy comprises:
judging whether a fourth server indicated by the server address in the local preference parameter can provide the required service online or not; if so, routing the service request to the fourth server, so that the fourth server transmits the service request to a required service on a call chain of the local preference mode;
if not, judging whether the local equipment of the requester can provide the required service on line; if so, routing the service request to the local equipment, so that the local equipment transmits the service request to a required service on a call chain of the local preference mode;
if not, selecting a fifth server which is online and meets a preset routing algorithm from the servers indicated by the server addresses in the second global preference parameter;
if the selection is successful, routing the service request to the fifth server for delivery by the fifth server to a desired service on the invocation chain of the local preference mode;
and if the selection is not successful, selecting a sixth server which is online and meets a preset routing algorithm from the server cluster, and routing the service request to the sixth server so that the sixth server transfers the service request to the required service on the call chain of the local preference mode.
8. The method according to any one of claims 5-7, wherein selecting a server from a cluster of servers that is online and satisfies a predetermined routing algorithm comprises:
and selecting the servers which are online and meet the requirements of a preset routing algorithm and weight from the server cluster according to a weighted polling mode.
9. An intelligent routing device for services, comprising:
the request acquisition module is used for acquiring a service request of a requester and a target application mode to which the service request belongs;
the strategy selection module is used for selecting a target routing strategy matched with the target application mode from a preset routing strategy set;
a preference determination module for determining a target routing preference parameter corresponding to the target application mode; wherein, different application modes respectively correspond to different route preference parameters and route strategies;
and the routing processing module is used for carrying out routing processing on the service request by utilizing the target routing strategy based on the target routing preference parameter so as to route the service request to a corresponding server in the server cluster.
10. The apparatus of claim 9, wherein the preference determination module is specifically configured to:
if the target application mode is an integrated development mode, determining that the target routing preference parameter is a first global preference parameter configured for the integrated development mode in advance;
if the target application mode is a production mode, determining that the target routing preference parameter is null;
if the target application mode is a local preference mode, determining that the target routing preference parameter is a local preference parameter and a second global preference parameter which are configured for the local preference mode in advance;
the first global preference parameter, the local preference parameter and the second global preference parameter respectively comprise server addresses of one or more servers corresponding to the preference; the local preference parameter has a higher priority than the second global preference parameter.
CN202111583939.1A 2021-12-22 2021-12-22 Intelligent routing method and device for service Pending CN114285904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111583939.1A CN114285904A (en) 2021-12-22 2021-12-22 Intelligent routing method and device for service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111583939.1A CN114285904A (en) 2021-12-22 2021-12-22 Intelligent routing method and device for service

Publications (1)

Publication Number Publication Date
CN114285904A true CN114285904A (en) 2022-04-05

Family

ID=80874004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111583939.1A Pending CN114285904A (en) 2021-12-22 2021-12-22 Intelligent routing method and device for service

Country Status (1)

Country Link
CN (1) CN114285904A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180159920A1 (en) * 2016-12-07 2018-06-07 Alibaba Group Holding Limited Server load balancing method, apparatus, and server device
US20190340583A1 (en) * 2018-05-02 2019-11-07 SOURCE Ltd. System and method for optimizing routing of a scheme of transactions over a computer network
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium
CN113489788A (en) * 2021-07-06 2021-10-08 广州华多网络科技有限公司 Data routing control method, data analysis processing method, data routing control device, data analysis processing device and data analysis processing medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180159920A1 (en) * 2016-12-07 2018-06-07 Alibaba Group Holding Limited Server load balancing method, apparatus, and server device
US20190340583A1 (en) * 2018-05-02 2019-11-07 SOURCE Ltd. System and method for optimizing routing of a scheme of transactions over a computer network
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium
CN113489788A (en) * 2021-07-06 2021-10-08 广州华多网络科技有限公司 Data routing control method, data analysis processing method, data routing control device, data analysis processing device and data analysis processing medium

Similar Documents

Publication Publication Date Title
CN109561141A (en) A kind of selection method and equipment of CDN node
US7843861B2 (en) Coalition formation and service provisioning of bandwidth sharing AD HOC networks
CN103986741B (en) Cloud data system, cloud data center and its method for managing resource
CN108206852A (en) A kind of dialogue-based Service Instance management method and equipment under micro services frame
EP1558001A1 (en) Method and apparatus for operating an open network having a proxy
CN111460504B (en) Service processing method, device, node equipment and storage medium
CN110086886B (en) Dynamic session holding method and device
CN102970379A (en) Method for realizing load balance among multiple servers
CN115242798B (en) Task scheduling method based on edge cloud, electronic equipment and storage medium
Zhou et al. A virtual network embedding scheme with two-stage node mapping based on physical resource migration
CN106713337B (en) Method and system for accessing super computing center and scheduling server
CN110430590A (en) Network is sliced matching process and device
CN110121194A (en) Information transferring method and device, computer storage medium
CN114285852B (en) Service calling method and device based on multi-stage service platform
CN106713353A (en) Intelligent seamless aggregation method and system for geographic information service
US20110153826A1 (en) Fault tolerant and scalable load distribution of resources
CN114064062B (en) Kubernetes platform and load balancing component-based default gray level issuing method and device
CN106130926B (en) A kind of processing method and processing device of message
CN112905338B (en) Automatic computing resource allocation method and device
CN114205280A (en) Application publishing method and flow routing method based on container cloud and service grid
WO2021000694A1 (en) Method for deploying services and scheduling apparatus
CN117149445A (en) Cross-cluster load balancing method and device, equipment and storage medium
CN104253702B (en) A kind of terminal management method and system
CN113366814B (en) Method for managing resource allocation in edge computing system
CN114285904A (en) Intelligent routing method and device for service

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