Service request processing method, system, device, equipment, medium and program product

By directly allocating business requests using the proxy controller and the master server in the remote procedure call service, the time-consuming problem of traffic distribution caused by cross-container forwarding is solved, and efficiency is improved.

CN119135743APending Publication Date: 2024-12-13SHANGHAI ZHONG YUAN NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411120706.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, when traffic is distributed through service grids and sidecar containers, traffic needs to be forwarded across containers, resulting in increased time and low efficiency.

Method used

Deploy the proxy controller and the master server in the remote procedure call service. The master server stores routing configuration information, determines the weight of the microservice based on the latest routing configuration information, and directly assigns the service request to the corresponding microservice to respond to it, avoiding cross-container Forward.

Benefits of technology

It reduces the time-consuming traffic distribution, improves the efficiency of traffic distribution, and avoids the performance losses caused by sidecar container forwarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135743A_ABST
    Figure CN119135743A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a service request processing method, system, device and equipment, a medium and a program product, and relates to the technical field of communication. A proxy controller is also deployed in the first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also comprises a main server; the main server is used for storing routing configuration information; the routing configuration information records the weight of the micro-service of each version, and the weight of the micro-service of any version represents the ratio of the business request required to be responded by the micro-service of the version to the business requests required to be responded by the micro-services of all versions. The method comprises the following steps: for each received service request, determining a micro-service for responding to the service request according to the latest acquired configuration information to be utilized; and issuing the service request to the determined micro-service. Therefore, the traffic does not need to be forwarded across containers, the time consumption of traffic distribution can be reduced, and the efficiency of traffic distribution is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a service request processing method, system, device, equipment, medium and program product. Background Art

[0002] With the development of Internet technology, the number of microservices provided by business platforms and the number of business requests that need to be responded to are increasing. For example, the reverse ranking service used to implement content recommendation in video applications can involve multiple business scenarios. For example, the recommendation of video content displayed on the homepage of the video application, the recommendation of related video content in the promotion page or video playback page, or the recommendation of advertising content displayed in the advertising space, etc.

[0003] The microservices provided by the business platform are often deployed in multiple clusters, and different versions of microservices are gradually put online for implementation. The received business requests need to be distributed to different versions of microservices for response. That is, it is necessary to dynamically distribute the traffic (i.e., business requests) for a large number of received business requests to achieve traffic routing. In the related art, a remote procedure call (e.g., brpc) service responsible for traffic distribution is deployed through a service grid (e.g., Istio). The remote procedure call service needs to forward the business request to the downstream microservice for response through a process running in a separately set sidecar container. That is, traffic forwarding is required through the sidecar container to achieve traffic distribution, and the sidecar container and the remote procedure call service belong to different containers. Therefore, the traffic needs to be forwarded across containers, which increases the time consumption of traffic distribution and is less efficient. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a service request processing method, system, device, equipment, medium and program product to reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution. The specific technical solution is as follows:

[0005] In a first aspect of the implementation of the present application, a business request processing method is first provided, which is applied to a remote procedure call service; a proxy controller is also deployed in a first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also includes a master server; the master server is used to store routing configuration information; the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests required to respond to the microservice of this version to the business requests required to respond to all versions of the microservice;

[0006] The method comprises:

[0007] For each received service request, determine the microservice for responding to the service request according to the most recently acquired configuration information to be used; wherein the configuration information to be used is the routing configuration information obtained from the main server based on the proxy controller;

[0008] Send the business request to the determined microservice.

[0009] Optionally, the configuration information to be used is obtained through the following steps:

[0010] Sending a configuration acquisition request to the main server;

[0011] The locally stored routing configuration information sent by the main server in response to the configuration acquisition request is received to obtain the configuration information to be used.

[0012] Optionally, before sending the configuration acquisition request to the main server, the method further includes:

[0013] Reading an address file pre-generated by the proxy controller and recording the address of the main server from a preset storage space to obtain the address of the main server;

[0014] A first connection request is sent to the main server through the address of the main server, so that the main server establishes a connection with the remote procedure call service in response to the first connection request.

[0015] Optionally, sending a configuration acquisition request to the main server includes:

[0016] When the remote procedure call service is started and a connection is established with the main server, a configuration acquisition request is sent to the main server;

[0017] and / or,

[0018] When receiving notification information sent by the main server indicating that the locally stored routing configuration information has changed, a configuration acquisition request is sent to the main server.

[0019] Optionally, the configuration information to be used is obtained through the following steps:

[0020] Sending a first acquisition request to the proxy controller, so that the proxy controller sends a second acquisition request to the main server in response to the first acquisition request;

[0021] The configuration information forwarded by the proxy controller is received to obtain the configuration information to be used; wherein the configuration information forwarded by the proxy controller is: the routing configuration information sent by the main server to the proxy controller in response to the second acquisition request.

[0022] Optionally, before sending the first acquisition request to the proxy controller, the method further includes:

[0023] Reading an address file pre-generated by the proxy controller and recording the address of the proxy controller from a preset storage space to obtain the address of the proxy controller;

[0024] A second connection request is sent to the proxy controller through the address of the proxy controller, so that the proxy controller establishes a connection with the remote procedure call service in response to the second connection request.

[0025] Optionally, sending a first acquisition request to the proxy controller includes:

[0026] When the remote procedure call service is started and a connection is established with the proxy controller, sending a first acquisition request to the proxy controller;

[0027] and / or,

[0028] When receiving the first notification information sent by the proxy controller, a first acquisition request is sent to the proxy controller; wherein, when receiving the second notification information sent by the main server indicating that the locally stored routing configuration information has changed, the proxy controller sends the first notification information to the remote procedure call service.

[0029] Optionally, for each received service request, determining a microservice for responding to the service request according to the most recently acquired configuration information to be used includes:

[0030] When each service request is received, a random number belonging to a preset interval is generated;

[0031] Determine the subinterval to which the generated random number belongs from the multiple subintervals included in the preset interval; wherein the multiple subintervals correspond one-to-one to the microservices of each version; the weight of any version of the microservice recorded in the configuration information to be used that is most recently obtained is: the ratio of the length of the subinterval corresponding to the microservice of this version to the length of the preset interval;

[0032] The microservice corresponding to the determined subinterval is used as the microservice for responding to the business request.

[0033] In a second aspect of the implementation of the present application, there is also provided a business request processing system, the system comprising: a remote procedure call service, a proxy controller and a main server;

[0034] The main server is used to store routing configuration information; wherein the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests that the microservice of this version needs to respond to the business requests that all versions of the microservice need to respond to;

[0035] The remote procedure call service is used to execute any of the above-mentioned business request processing methods.

[0036] In a third aspect of the implementation of the present application, a business request processing device is also provided, which is applied to a remote procedure call service; a proxy controller is also deployed in a first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also includes a master server; the master server is used to store routing configuration information; the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests that the version of the microservice needs to respond to to the business requests that all versions of the microservice need to respond;

[0037] The device comprises:

[0038] A microservice determination module, for determining, for each received service request, a microservice for responding to the service request according to the most recently acquired configuration information to be used; wherein the configuration information to be used is routing configuration information obtained from the main server based on the proxy controller;

[0039] The business request sending module is used to send the business request to the determined microservice.

[0040] In a fourth aspect of the implementation of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0041] Memory, used to store computer programs;

[0042] The processor is used to implement any of the above-mentioned service request processing methods when executing the program stored in the memory.

[0043] In another aspect of the implementation of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned service request processing methods is implemented.

[0044] In another aspect of the implementation of the present application, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned service request processing methods.

[0045] A business request processing method provided by an embodiment of the present application is applied to a remote procedure call service; a proxy controller is also deployed in a first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also includes a main server; the main server is used to store routing configuration information; the routing configuration information records the weights of microservices of various versions, and the weight of any version of the microservice represents: the ratio of business requests that the microservice of this version needs to respond to the business requests that all versions of the microservice need to respond to; the method includes: for each business request received, according to the latest configuration information to be used obtained, determining the microservice used to respond to the business request; wherein the configuration information to be used is routing configuration information obtained from the main server based on the proxy controller; and issuing the business request to the determined microservice.

[0046] Based on the above processing, the remote procedure call service can obtain the routing configuration information from the main server in advance based on the proxy controller, that is, the remote procedure call service can obtain the routing configuration information in advance. Furthermore, for each business request received, the remote procedure call service can allocate a microservice for responding to the business request according to the weights of each version of the microservice recorded in the obtained routing configuration information, and send the business request to the microservice for responding to the business request. In this way, the business request can be directly sent to the corresponding microservice for response through the remote procedure call service, without the need to forward the business request through the sidecar container. That is, the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0048] Figure 1 A first flow chart of a method for processing a business request provided in an embodiment of the present application;

[0049] Figure 2 A second flow chart of the service request processing method provided in the embodiment of the present application;

[0050] Figure 3 A schematic diagram of a first process for obtaining configuration information to be used in the service request processing method provided in an embodiment of the present application;

[0051] Figure 4 A second flow chart of obtaining configuration information to be used in the service request processing method provided in an embodiment of the present application;

[0052] Figure 5A third flow chart of obtaining configuration information to be used in the service request processing method provided in an embodiment of the present application;

[0053] Figure 6 A fourth flow chart of obtaining configuration information to be used in the service request processing method provided in an embodiment of the present application;

[0054] Figure 7 A schematic diagram of a service grid framework provided in an embodiment of the present application;

[0055] Figure 8 A schematic diagram of the structure of a business request processing system provided in an embodiment of the present application;

[0056] Fig. 9 A schematic diagram of the structure of a service request processing device provided in an embodiment of the present application;

[0057] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0059] With the development of Internet technology, the number of microservices provided by business platforms and the number of business requests that need to be responded to are increasing. For example, the reverse ranking service used to implement content recommendation in video applications can involve multiple business scenarios. For example, the recommendation of video content displayed on the homepage of the video application, the recommendation of related video content in the promotion page or video playback page, or the recommendation of advertising content displayed in the advertising space, etc.

[0060] The microservices provided by the business platform are often deployed in multiple clusters, and different versions of microservices are gradually put online for implementation. The received business requests need to be distributed to different versions of microservices for response. That is, it is necessary to dynamically distribute the traffic (i.e., business requests) for a large number of received business requests to achieve traffic routing. In the related art, a remote procedure call (e.g., brpc) service responsible for traffic distribution is deployed through a service grid (e.g., Istio). The remote procedure call service needs to forward the business request to the downstream microservice for response through a process running in a separately set sidecar container. That is, traffic forwarding is required through the sidecar container to achieve traffic distribution, and the sidecar container and the remote procedure call service belong to different containers. Therefore, the traffic needs to be forwarded across containers, which increases the time consumption of traffic distribution and is less efficient.

[0061] In order to reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution, the embodiment of the present application provides a service request processing method, see Figure 1 , Figure 1 A first flow chart of a business request processing method provided in an embodiment of the present application. The method is applied to a remote procedure call service; a proxy controller is also deployed in the first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also includes a master server; the master server is used to store routing configuration information; the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests that the version of the microservice needs to respond to to the business requests that all versions of the microservice need to respond to. The method includes:

[0062] Step S101: for each received service request, determine the microservice for responding to the service request according to the most recently acquired configuration information to be used.

[0063] The configuration information to be used is routing configuration information obtained from the main server based on the proxy controller.

[0064] Step S102: Send the business request to the determined microservice.

[0065] Based on the above processing, the remote procedure call service can obtain the routing configuration information from the main server in advance based on the proxy controller, that is, the remote procedure call service can obtain the routing configuration information in advance. Furthermore, for each business request received, the remote procedure call service can allocate a microservice for responding to the business request according to the weights of each version of the microservice recorded in the obtained routing configuration information, and send the business request to the microservice for responding to the business request. In this way, the business request can be directly sent to the corresponding microservice for response through the remote procedure call service, without the need to forward the business request through the sidecar container. That is, the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0066] In an embodiment of the present application, a service grid may include multiple containers, and services may be deployed in each container included in the service grid according to business needs. For example, the service grid may be Istio. A remote procedure call service may be deployed in a container in the service grid, and the remote procedure call service may be used for traffic distribution, or the remote procedure call service may also be used for other traffic management functions such as fusing and current limiting. The container to which the remote procedure call service belongs may be referred to as the first container. The service grid also includes a main server, which is used to store routing configuration information. For example, the main server may be the Istio Control Plane in Istio. An agent controller is deployed in each container in the service grid, and the agent controller may communicate with the main server. For example, the agent controller may be the Istio pilot-agent in Istio.

[0067] The user can set the routing configuration information according to the current business needs and upload it to the main server for storage. The remote procedure call service can obtain the routing configuration information from the main server in advance based on the proxy controller, that is, the remote procedure call service can obtain the routing configuration information in advance. When the business needs change, the user can adjust the routing configuration information according to the changed business needs, and the routing configuration information stored locally on the main server is updated accordingly. When the locally stored routing configuration information is updated, the remote procedure call service can obtain the latest routing configuration information. That is, the latest configuration information to be used obtained by the remote procedure call service is the latest routing configuration information. And the remote procedure call service can store the latest configuration information to be used obtained in the designated storage space.

[0068] Subsequently, the remote procedure call service can directly allocate a microservice for responding to each received service request based on the configuration information to be used stored in the specified storage space. The specific process of the remote procedure call service obtaining routing configuration information from the main server based on the proxy controller can refer to the relevant description of the first and second methods in the subsequent embodiments.

[0069] The microservices provided by a business platform are often deployed in multiple clusters. Since the testing of a version of a microservice before going online cannot avoid all risks, problems may still occur when the version of the microservice is officially launched, that is, microservices often have online risks. Therefore, different versions of microservices need to be launched and implemented gradually. For example, when a new version of a microservice is initially launched, a small number of business requests can be sent to the new version of the microservice for response, and other business requests are still responded to by the old version of the microservice. If the new version of the microservice does not have any problems in responding to business requests, the business requests sent to the new version of the microservice for response can be gradually increased until all business requests are sent to the new version of the microservice for response, and the old version of the microservice can be offline. In this way, the transition between the new and old versions of the microservice can be smoothly realized to complete the version upgrade of the microservice.

[0070] The weight of each version of the microservice can be set to adjust the number of business requests that each version of the microservice needs to respond to. The greater the weight of a version of the microservice, the greater the ratio of business requests that this version of the microservice needs to respond to to business requests that all versions of the microservice need to respond to, that is, among all business requests that all versions of the microservice need to respond to, the greater the proportion of business requests that this version of the microservice needs to respond to. This also means that the number of business requests that this version of the microservice needs to respond to is greater. For example, the routing configuration information records that the weight of version A of the microservice is 0.8 and the weight of version B of the microservice is 0.2, which means that version A of the microservice needs to respond to 80% of the business requests and version B of the microservice needs to respond to 20% of the business requests.

[0071] Furthermore, for each received service request, the remote procedure call service can allocate a microservice for responding to the service request according to the weights of each version of the microservice recorded in the acquired routing configuration information, and send the service request to the microservice for responding to the service request. The specific method of allocating microservices to service requests can refer to the description in the subsequent embodiments.

[0072] In one implementation, a configuration management module may be developed in the remote procedure call service to implement the above steps S101 to S102 through the configuration management module. It is understandable that the configuration management module is a program in the remote procedure call service.

[0073] In one embodiment, see Figure 2 , Figure 2 A second flow chart of the service request processing method provided in the embodiment of the present application. Step S101 includes:

[0074] Step S1011: When each service request is received, a random number belonging to a preset interval is generated.

[0075] Step S1012: Determine the sub-interval to which the generated random number belongs from among the multiple sub-intervals included in the preset interval.

[0076] Among them, multiple sub-intervals correspond one-to-one to each version of microservices; the weight of any version of microservice recorded in the latest acquired configuration information to be used is: the ratio of the length of the sub-interval corresponding to the version of the microservice to the length of the preset interval.

[0077] Step S1013: The microservice corresponding to the determined sub-interval is used as the microservice for responding to the business request.

[0078] In an embodiment of the present application, an interval of a specified length (i.e., a preset interval) can be pre-set, and the preset interval can be divided according to the weights of each version of the microservice recorded in the latest routing configuration information to obtain subintervals corresponding to each version of the microservice. Each subinterval corresponds to each version of the microservice. The sum of the lengths of each subinterval is the specified length, and there is no intersection between any two subintervals. The weight of any version of the microservice is the ratio of the length of the subinterval corresponding to the version of the microservice to the length of the preset interval. For example, the weight of the microservice of version A is 0.8, and the weight of the microservice of version B is 0.2. The specified length is 10, such as the preset interval is 1-10. Correspondingly, the subinterval corresponding to the microservice of version A can be 1-8, and the subinterval corresponding to the microservice of version B can be 9-10.

[0079] Furthermore, when each business request is received, a random number belonging to a preset interval can be generated. And the sub-interval to which the generated random number belongs can be determined. The microservice corresponding to the determined sub-interval is the microservice used to respond to the business request. For example, the generated random number is 4, which belongs to the sub-interval 1-8. Accordingly, it can be determined that the microservice used to respond to the business request is a microservice of version A; or, the generated random number is 9, which belongs to the sub-interval 9-10. Accordingly, it can be determined that the microservice used to respond to the business request is a microservice of version B.

[0080] Based on the above processing, the remote procedure call service can allocate a microservice for responding to the service request according to the weights of each version of the microservice recorded in the obtained routing configuration information. In this way, it can further ensure that the remote procedure call service can directly send the service request to the corresponding microservice for response, without forwarding the service request across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0081] In the service request processing method provided in the embodiment of the present application, the remote procedure call service can obtain the routing configuration information through the following method 1 or method 2:

[0082] In method one, the remote procedure call service can establish a connection with the primary server and obtain routing configuration information from the primary server.

[0083] See also Figure 3 , Figure 3 This is a schematic diagram of a first process for obtaining configuration information to be used in the service request processing method provided in an embodiment of the present application. The configuration information to be used is obtained through the following steps:

[0084] Step S301: Send a configuration acquisition request to the main server.

[0085] Step S302: receiving the locally stored routing configuration information sent by the main server in response to the configuration acquisition request, and obtaining the configuration information to be used.

[0086] In an embodiment of the present application, the remote procedure call service can establish a connection with the main server. The specific connection method can refer to the relevant description of steps S303-S304 in the subsequent embodiments. That is, the remote procedure call service can communicate directly with the main server, and accordingly, the remote procedure call service can send a configuration acquisition request to the main server. When receiving the configuration acquisition request, the main server can send the locally stored routing configuration information to the remote procedure call service in response to the configuration acquisition request. The remote procedure call service can also receive the routing configuration information and obtain the configuration information to be used.

[0087] Based on the above processing, the remote procedure call service can directly obtain the routing configuration information from the main server and obtain the configuration information to be used. Subsequently, the remote procedure call service can also allocate the microservice used to respond to the received business request according to the routing configuration information to be used, thereby realizing traffic distribution. That is, the remote procedure call service can directly realize traffic distribution, and the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0088] In one embodiment, Figure 3 Based on Figure 4 , Figure 4 A second flow chart of obtaining configuration information to be used in the service request processing method provided in the embodiment of the present application. Before step S301, the method further includes:

[0089] Step S303: Reading an address file pre-generated by the proxy controller and recording the address of the main server from the preset storage space to obtain the address of the main server.

[0090] Step S304: Send a first connection request to the main server through the address of the main server, so that the main server establishes a connection with the remote procedure call service in response to the first connection request.

[0091] In an embodiment of the present application, the proxy controller may pre-generate an address file that records the address of the primary server and store it in a preset storage space. For example, the proxy controller may be the Istio pilot-agent in Istio, and accordingly, the address file pre-generated by the proxy controller may be a bootstrapfile (a boot program file) automatically generated by the Istio pilot-agent. Accordingly, when the remote procedure call service is started, the address file may be read from the preset storage space to obtain the address of the primary server.

[0092] Furthermore, the remote procedure call service can send a connection request (i.e., a first connection request) to the main server through the address of the main server. When the first connection request is received, the main server can establish a connection with the remote procedure call service in response to the first connection request. When the connection between the main server and the remote procedure call service is established, the remote procedure call service can communicate with the main server.

[0093] Based on the above processing, the remote procedure call service can establish a connection with the main server. Furthermore, the remote procedure call service can directly obtain the routing configuration information from the main server and obtain the configuration information to be used. Subsequently, the remote procedure call service can allocate the microservice used to respond to the received business request according to the routing configuration information to be used, thereby realizing traffic distribution. That is, the remote procedure call service can directly realize traffic distribution, and the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0094] In one embodiment, step S301 includes:

[0095] Step 1: When the remote procedure call service is started and a connection is established with the primary server, a configuration acquisition request is sent to the primary server.

[0096] and / or,

[0097] Step 2: Upon receiving notification information sent by the main server indicating that the locally stored routing configuration information has changed, a configuration acquisition request is sent to the main server.

[0098] In the embodiment of the present application, when the remote procedure call service is started and a connection is established with the main server, the remote procedure call service can send a configuration acquisition request to the main server to obtain routing configuration information, thereby ensuring that the remote procedure call service can distribute traffic according to the routing configuration information after being started.

[0099] When business requirements change, users can adjust the routing configuration information according to the changed business requirements, and accordingly, the routing configuration information stored locally on the master server is updated. When the locally stored routing configuration information is updated, the master server can send a notification message indicating that the locally stored routing configuration information has changed to the remote procedure call service. Accordingly, when receiving the notification message, the remote procedure call service can send a configuration acquisition request to the master server to obtain the changed routing configuration information.

[0100] Based on the above processing, it can be ensured that the remote procedure call service can obtain the routing configuration information after it is started, and when the routing configuration information changes, the remote procedure call service can obtain the changed routing configuration information. In this way, the remote procedure call service can obtain the latest routing configuration information and distribute traffic according to the latest routing configuration information. This can improve the efficiency of traffic distribution while ensuring the accuracy of traffic distribution.

[0101] In addition, compared with the solution in the subsequent method 2 where the remote procedure call service interacts with the main server through the proxy controller, the remote procedure call service in method 1 directly interacts with the main server, which can avoid the problem that the remote procedure call service cannot properly implement traffic distribution due to a proxy controller failure. This can further ensure that traffic distribution can be performed normally.

[0102] In the second mode, the remote procedure call service can establish a connection with the proxy controller and obtain the routing configuration information from the main server through the proxy controller.

[0103] See also Figure 5 , Figure 5 The third flow chart of obtaining the configuration information to be used in the service request processing method provided in the embodiment of the present application is as follows:

[0104] Step S501: Send a first acquisition request to the proxy controller, so that the proxy controller sends a second acquisition request to the main server in response to the first acquisition request.

[0105] Step S502: receiving the configuration information forwarded by the proxy controller, and obtaining the configuration information to be used.

[0106] The configuration information forwarded by the proxy controller is: the routing configuration information sent by the main server to the proxy controller in response to the second acquisition request.

[0107] In an embodiment of the present application, the remote procedure call service can establish a connection with the proxy controller. The specific connection method can refer to the relevant description of steps S503-S504 in the subsequent embodiments. That is, the remote procedure call service can communicate with the proxy controller. The proxy controller can communicate with the main server. Accordingly, the remote procedure call service can send a first acquisition request to the proxy controller. When receiving the first acquisition request, the proxy controller can send a second acquisition request to the main server in response to the first acquisition request.

[0108] When receiving the second acquisition request, the main server can send the locally stored routing configuration information to the proxy controller in response to the second acquisition request. When receiving the routing configuration information, the proxy controller can forward the routing configuration information to the remote procedure call service. The remote procedure call service can also receive the routing configuration information and obtain the configuration information to be used.

[0109] Based on the above processing, the remote procedure call service can obtain the routing configuration information from the main server through the proxy controller to obtain the configuration information to be used. Subsequently, the remote procedure call service can also allocate the microservice used to respond to the received business request according to the routing configuration information to be used, thereby realizing traffic distribution. That is, the remote procedure call service can directly realize traffic distribution, and the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0110] In one embodiment, Figure 5 Based on Figure 6 , Figure 6 The fourth flow chart of obtaining the configuration information to be used in the service request processing method provided in the embodiment of the present application. Before step S501, the method further includes:

[0111] Step S503: reading an address file pre-generated by the proxy controller and recording the address of the proxy controller from the preset storage space to obtain the address of the proxy controller.

[0112] Step S504: sending a second connection request to the proxy controller through the address of the proxy controller, so that the proxy controller establishes a connection with the remote procedure call service in response to the second connection request.

[0113] In an embodiment of the present application, the address file pre-generated by the proxy controller may record the address of the proxy controller itself, and the address file may be stored in a preset storage space. Accordingly, when the remote procedure call service is started, the address file may be read from the preset storage space to obtain the address of the proxy controller. Furthermore, the remote procedure call service may send a connection request (i.e., a second connection request) to the proxy controller through the address of the proxy controller. When the second connection request is received, the proxy controller may establish a connection with the remote procedure call service in response to the second connection request. When the connection between the proxy controller and the remote procedure call service is established, the remote procedure call service may communicate with the proxy controller.

[0114] Based on the above processing, the remote procedure call service can establish a connection with the proxy controller. And the proxy controller can communicate with the main server. Furthermore, the remote procedure call service can obtain the routing configuration information from the main server through the proxy controller to obtain the configuration information to be used. Subsequently, the remote procedure call service can allocate the microservice used to respond to the received business request according to the routing configuration information to be used, thereby realizing traffic distribution. That is, the remote procedure call service can directly realize traffic distribution, and the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0115] In one embodiment, step S501 includes:

[0116] Step 1: When the remote procedure call service is started and a connection is established with the proxy controller, a first acquisition request is sent to the proxy controller.

[0117] and / or,

[0118] Step 2: upon receiving the first notification information sent by the agent controller, sending a first acquisition request to the agent controller.

[0119] When receiving the second notification information sent by the main server indicating that the locally stored routing configuration information has changed, the proxy controller sends the first notification information to the remote procedure call service.

[0120] In an embodiment of the present application, when the remote procedure call service is started and a connection is established with the proxy controller, the remote procedure call service may send a first acquisition request to the proxy controller to obtain routing configuration information from the main server through the proxy controller, thereby ensuring that the remote procedure call service can distribute traffic according to the routing configuration information after being started.

[0121] When business requirements change, users can adjust the routing configuration information according to the changed business requirements, and accordingly, the routing configuration information stored locally on the master server is updated. When the locally stored routing configuration information is updated, the master server can send a second notification message to the proxy controller indicating that the locally stored routing configuration information has changed. When receiving the second notification message, the proxy controller sends a first notification message to the remote procedure call service. Accordingly, when receiving the first notification message, the remote procedure call service can send a first acquisition request to the proxy controller to obtain the changed routing configuration information from the master server through the proxy controller.

[0122] Based on the above processing, it can be ensured that the remote procedure call service can obtain the routing configuration information after it is started, and when the routing configuration information changes, the remote procedure call service can obtain the changed routing configuration information. In this way, the remote procedure call service can obtain the latest routing configuration information and distribute traffic according to the latest routing configuration information. This can improve the efficiency of traffic distribution while ensuring the accuracy of traffic distribution.

[0123] In one embodiment, see Figure 7 , Figure 7 A schematic diagram of a service grid framework provided in an embodiment of the present application. The service grid is an Istio framework, in which the Istio pilot-agent (i.e., the proxy controller in the above embodiment) is responsible for the communication between the Istio Control Plane (also referred to as the Istio control plane, i.e., the main server in the above embodiment) and the brpcapplication (also referred to as the brpc service, i.e., the remote procedure call service in the above embodiment). The Istio control plane is mainly responsible for the distribution and storage of routing configuration information. Figure 7 The Pod or Virtual Machine (container or virtual machine) in the figure indicates the container to which the Istio pilot-agent and the brpc service belong (i.e., the first container in the above embodiment).

[0124] A configuration management module (i.e., the configuration management module in the above embodiment) can be developed in the remote procedure call service. The configuration management module can read the bootstrap file (i.e., the address file in the above embodiment). The address file is automatically generated by the Istio pilot-agent, which can store the address of the Istio control plane or the address of the Istio pilot-agent.

[0125] If the address stored in the address file is the address of the Istio control plane, the configuration management module can establish a bidirectional connection with the Istio control plane through the address of the Istio control plane, monitor the configuration changes of the Istio control plane, and determine the routing strategy of the brpc service according to the configuration changes. That is, the remote procedure call service can obtain the routing configuration information through the method 1 in the above embodiment to obtain the traffic routing strategy. For details, please refer to the relevant description of the above method 1. Figure 7 The process of brpc service directly interacting with Istio control plane to obtain routing configuration information is not shown.

[0126] If the address stored in the address file is the address of the Istio pilot-agent, the remote procedure call service can obtain the routing configuration information through the second method in the above embodiment. Figure 7 As shown, the brpc service can send a request for obtaining routing configuration information (i.e., the first obtaining request in the above embodiment) to the Istio pilot-agent based on the XDS (a standard protocol) protocol and the UDS (a standard protocol) protocol. When receiving the request from the brpc service, the Istiopilot-agent can send a request for obtaining routing configuration information (i.e., the second obtaining request in the above embodiment) to the Istio control plane based on the XDS protocol and the preset secure protocol (i.e., the security protocol). For details, please refer to the relevant description of the above method 2. For example, the preset secure protocol can be HTTPS (Hypertext Transfer Protocol Secure).

[0127] When the routing configuration information in the Istio control plane changes, it can automatically notify the brpc service so that the brpc service can execute the corresponding routing policy according to the latest configuration information. For details, please refer to step 2 or the relevant description of step 2 in the above embodiment.

[0128] In the related art, the Istio-based traffic routing solution requires Istio to set up an additional sidecar container for the brpc service. The process in the sidecar container is responsible for monitoring the configuration changes of the Istio control plane and forwarding traffic. However, the sidecar container and the container to which the brpc service belongs are different containers. Therefore, traffic needs to be forwarded across containers, which will cause performance loss and increase the time consumption. That is, it will increase the time consumption of traffic distribution and reduce the efficiency.

[0129] Based on the service request processing method provided in the embodiment of the present application, there is no need to forward traffic through an additional sidecar container. The brpc service can be directly connected to the Istio control plane or the Istio pilot-agent through the configuration management module to monitor changes in routing configuration information stored in the Istio control plane and implement traffic distribution. While implementing traffic routing, there is no performance loss, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0130] It can be seen that based on the business request processing method provided in the embodiment of the present application, a high-performance traffic routing function based on brpc service can be implemented. A configuration management module can be set inside the brpc library, and the module can be connected to the Istio control plane of the service grid inside the business platform. The routing configuration information is obtained based on the XDS protocol to realize traffic distribution according to the routing configuration information, and dynamic routing of the inverted service can be realized. And there is no need to forward traffic through an additional sidecar container, that is, the sidecar-free container proxy mode is adopted, which can reduce the time consumption of traffic distribution, and then reduce the time consumption of the business platform to provide microservices.

[0131] Based on the same inventive concept, the present application embodiment also provides a service request processing system, see Figure 8 , Figure 8 A schematic diagram of a business request processing system provided in an embodiment of the present application. The system includes: a remote procedure call service 801, an agent controller 802 and a main server 803;

[0132] The main server 803 is used to store routing configuration information; wherein the routing configuration information records the weights of the microservices of each version, and the weight of any version of the microservice represents: the ratio of the business requests that the microservice of this version needs to respond to the business requests that all versions of the microservice need to respond to;

[0133] The remote procedure call service 801 is used to execute any of the service request processing methods described in the above embodiments.

[0134] Based on the business request processing system provided by the embodiment of the present application, the remote procedure call service can obtain the routing configuration information from the main server in advance based on the proxy controller, that is, the remote procedure call service can obtain the routing configuration information in advance. Furthermore, for each business request received, the remote procedure call service can allocate a microservice for responding to the business request to the business request according to the weights of each version of the microservice recorded in the obtained routing configuration information, and send the business request to the microservice for responding to the business request. In this way, the business request can be directly sent to the corresponding microservice for response through the remote procedure call service, without the need to forward the business request through the sidecar container. That is, the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0135] Based on the same inventive concept, the present application embodiment also provides a service request processing device, see Fig. 9 , Fig. 9 A schematic diagram of the structure of a business request processing device provided in an embodiment of the present application. The device is applied to a remote procedure call service; a proxy controller is also deployed in the first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also includes a master server; the master server is used to store routing configuration information; the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests that the microservice of this version needs to respond to the business requests that all versions of the microservice need to respond to;

[0136] The device comprises:

[0137] The microservice determination module 901 is used to determine the microservice used to respond to each received service request according to the latest configuration information to be used obtained; wherein the configuration information to be used is the routing configuration information obtained from the main server based on the proxy controller;

[0138] The business request sending module 902 is used to send the business request to the determined microservice.

[0139] Based on the business request processing device provided by the embodiment of the present application, the remote procedure call service can obtain the routing configuration information from the main server in advance based on the proxy controller, that is, the remote procedure call service can obtain the routing configuration information in advance. Furthermore, for each business request received, the remote procedure call service can allocate a microservice for responding to the business request to the business request according to the weights of each version of the microservice recorded in the obtained routing configuration information, and send the business request to the microservice for responding to the business request. In this way, the business request can be directly sent to the corresponding microservice for response through the remote procedure call service, and there is no need to forward the business request through the sidecar container. That is, the traffic does not need to be forwarded across containers, which can reduce the time consumption of traffic distribution and improve the efficiency of traffic distribution.

[0140] In one embodiment, the apparatus further comprises:

[0141] A configuration acquisition request sending module, used to send a configuration acquisition request to the main server;

[0142] The first receiving module is used to receive the locally stored routing configuration information sent by the main server in response to the configuration acquisition request, and obtain the configuration information to be used.

[0143] In one embodiment, the apparatus further comprises:

[0144] A first reading module is used to read an address file pre-generated by the proxy controller and recording the address of the main server from a preset storage space before sending a configuration acquisition request to the main server, so as to obtain the address of the main server;

[0145] The first connection request sending module is used to send a first connection request to the main server through the address of the main server, so that the main server establishes a connection with the remote procedure call service in response to the first connection request.

[0146] In one embodiment, the configuration acquisition request sending module is specifically used to send a configuration acquisition request to the main server when the remote procedure call service is started and a connection is established with the main server; and / or, when a notification message indicating a change in the locally stored routing configuration information is received from the main server, send a configuration acquisition request to the main server.

[0147] In one embodiment, the apparatus further comprises:

[0148] A first acquisition request sending module, configured to send a first acquisition request to the proxy controller, so that the proxy controller sends a second acquisition request to the main server in response to the first acquisition request;

[0149] The second receiving module is used to receive the configuration information forwarded by the proxy controller to obtain the configuration information to be used; wherein the configuration information forwarded by the proxy controller is: the routing configuration information sent by the main server to the proxy controller in response to the second acquisition request.

[0150] In one embodiment, the apparatus further comprises:

[0151] A second reading module is used to read an address file pre-generated by the proxy controller and recording the address of the proxy controller from a preset storage space before sending a first acquisition request to the proxy controller, so as to obtain the address of the proxy controller;

[0152] The second connection request sending module is used to send a second connection request to the proxy controller through the address of the proxy controller, so that the proxy controller establishes a connection with the remote procedure call service in response to the second connection request.

[0153] In one embodiment, the first acquisition request sending module is specifically used to send a first acquisition request to the proxy controller when the remote procedure call service is started and a connection is established with the proxy controller; and / or, when receiving a first notification message sent by the proxy controller, send a first acquisition request to the proxy controller; wherein, when receiving a second notification message sent by the main server indicating that the locally stored routing configuration information has changed, the proxy controller sends the first notification message to the remote procedure call service.

[0154] In one embodiment, the microservice determination module 901 is specifically configured to generate a random number belonging to a preset interval when each service request is received;

[0155] Determine the subinterval to which the generated random number belongs from the multiple subintervals included in the preset interval; wherein the multiple subintervals correspond one-to-one to the microservices of each version; the weight of any version of the microservice recorded in the configuration information to be used that is most recently obtained is: the ratio of the length of the subinterval corresponding to the microservice of this version to the length of the preset interval;

[0156] The microservice corresponding to the determined subinterval is used as the microservice for responding to the business request.

[0157] The present application also provides an electronic device, such as Fig.10 As shown, it includes a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004.

[0158] Memory 1003, used for storing computer programs;

[0159] The processor 1001 is used to implement the service request processing method described in any of the above embodiments when executing the program stored in the memory 1003.

[0160] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0161] The communication interface is used for communication between the above terminal and other devices.

[0162] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0163] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0164] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the service request processing method described in any of the above embodiments is implemented.

[0165] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the service request processing method described in any one of the above embodiments.

[0166] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0167] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0168] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system, device, equipment, storage medium and program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0169] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A method for processing a business request, characterized in that: Applied to a remote procedure call service; a proxy controller is also deployed in the first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also includes a master server; the master server is used to store routing configuration information; the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests that the version of the microservice needs to respond to to the business requests that all versions of the microservice need to respond to; The method comprises: For each received service request, determine the microservice for responding to the service request according to the most recently acquired configuration information to be used; wherein the configuration information to be used is the routing configuration information obtained from the main server based on the proxy controller; Send the business request to the determined microservice.

2. The method according to claim 1, characterized in that The configuration information to be used is obtained through the following steps: Sending a configuration acquisition request to the main server; The locally stored routing configuration information sent by the main server in response to the configuration acquisition request is received to obtain the configuration information to be used.

3. The method according to claim 2, characterized in that Before sending the configuration acquisition request to the main server, the method further includes: Reading an address file pre-generated by the proxy controller and recording the address of the main server from a preset storage space to obtain the address of the main server; A first connection request is sent to the main server through the address of the main server, so that the main server establishes a connection with the remote procedure call service in response to the first connection request.

4. The method according to claim 2, characterized in that: Sending a configuration acquisition request to the main server includes: When the remote procedure call service is started and a connection is established with the main server, a configuration acquisition request is sent to the main server; and / or, When receiving notification information sent by the main server indicating that the locally stored routing configuration information has changed, a configuration acquisition request is sent to the main server.

5. The method according to claim 1, characterized in that The configuration information to be used is obtained through the following steps: Sending a first acquisition request to the proxy controller, so that the proxy controller sends a second acquisition request to the main server in response to the first acquisition request; The configuration information forwarded by the proxy controller is received to obtain the configuration information to be used; wherein the configuration information forwarded by the proxy controller is: the routing configuration information sent by the main server to the proxy controller in response to the second acquisition request.

6. The method according to claim 5, characterized in that Before sending the first acquisition request to the proxy controller, the method further includes: Reading an address file pre-generated by the proxy controller and recording the address of the proxy controller from a preset storage space to obtain the address of the proxy controller; A second connection request is sent to the proxy controller through the address of the proxy controller, so that the proxy controller establishes a connection with the remote procedure call service in response to the second connection request.

7. The method according to claim 5, characterized in that Sending a first acquisition request to the proxy controller includes: When the remote procedure call service is started and a connection is established with the proxy controller, sending a first acquisition request to the proxy controller; and / or, When receiving the first notification information sent by the proxy controller, a first acquisition request is sent to the proxy controller; wherein, when receiving the second notification information sent by the main server indicating that the locally stored routing configuration information has changed, the proxy controller sends the first notification information to the remote procedure call service.

8. The method according to any one of claims 1 to 7, characterized in that: For each received service request, determining a microservice for responding to the service request according to the most recently acquired configuration information to be used includes: When each service request is received, a random number belonging to a preset interval is generated; Determine the subinterval to which the generated random number belongs from the multiple subintervals included in the preset interval; wherein the multiple subintervals correspond one-to-one to the microservices of each version; the weight of any version of the microservice recorded in the configuration information to be used that is most recently obtained is: the ratio of the length of the subinterval corresponding to the microservice of this version to the length of the preset interval; The microservice corresponding to the determined subinterval is used as the microservice for responding to the business request.

9. A business request processing system, characterized in that: The system includes: a remote procedure call service, an agent controller and a main server; The main server is used to store routing configuration information; wherein the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests that the microservice of this version needs to respond to the business requests that all versions of the microservice need to respond to; The remote procedure call service is used to execute the method described in any one of claims 1-8.

10. A service request processing device, characterized in that: Applied to a remote procedure call service; a proxy controller is also deployed in the first container to which the remote procedure call service belongs, and the service grid to which the first container belongs also includes a master server; the master server is used to store routing configuration information; the routing configuration information records the weights of each version of the microservice, and the weight of any version of the microservice represents: the ratio of the business requests that the version of the microservice needs to respond to to the business requests that all versions of the microservice need to respond to; The device comprises: A microservice determination module, for determining, for each received service request, a microservice for responding to the service request according to the most recently acquired configuration information to be used; wherein the configuration information to be used is routing configuration information obtained from the main server based on the proxy controller; The business request sending module is used to send the business request to the determined microservice.

11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 8 when executing a program stored in a memory.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 8 are implemented.

13. A computer program product, characterized in that When the computer program product is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 8.