Grayscale rule configuration, grayscale routing method, device, equipment and storage medium
By grayscale marking and rule configuration of the target microservice instance in the distributed microservice system, the code intrusion risk and dynamic configuration problem during grayscale routing are solved, and grayscale rule configuration is realized without transforming the microservice. and routing.
Patent Information
- Application Number
- CN202011025701.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2040-09-25
AI Technical Summary
The existing technology requires the transformation of microservices when performing grayscale routing in a distributed microservice system, resulting in a high risk of code intrusion, and cannot achieve dynamic configuration and cannot meet diverse grayscale routing scenarios.
By responding to the grayscale mark request of the target microservice instance, marking it as a grayscale instance and storing it in the grayscale instance list, generating and issuing matching grayscale rules to the grayscale agent of the microservice platform, the request is implemented Dynamic routing of information.
Without transforming microservices, it realizes the configuration of grayscale rules and dynamic routing of request information, reduces the risk of code intrusion, and supports diverse grayscale routing scenarios.
Smart Images

Figure CN112181458B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of Internet technology, and in particular to a grayscale rule configuration, grayscale routing method, device, equipment and storage medium. Background Art
[0002] In a distributed microservice system architecture, an HTTP (Hyper Text Transfer Protocol) call usually makes a service call between multiple microservices, and the call link is long. When a new version of some microservices is launched, grayscale verification is required, that is, only traffic with specified characteristics is allowed to enter the new version. In this process, we call it routing to the grayscale version according to grayscale rules. When the grayscale version verification is successful, it is necessary to switch the grayscale version to the official version, that is, allow all traffic to enter the grayscale version. This operation is called grayscale release. If problems are found in the above process, it may be necessary to take the grayscale version offline and update the version, or readjust the grayscale rules for continued observation.
[0003] At present, one method is to carry the version number in the request. For example, only the request with the specified version number can enter the new grayscale version. However, this method requires the service caller and the service provider to agree on the version number in advance, which is intrusive to the business and the grayscale routing rules are not flexible. Another method is to preset the grayscale configuration information. When the specified configuration information is met in the request, the grayscale version can be entered. Among them, the configuration information can be user IP (Internet Protocol), user account, geographic location and other information. However, the grayscale configuration information preset by this method needs to restart the microservice every time it changes, and dynamic configuration cannot be achieved, which cannot meet the diverse grayscale routing scenarios. Another method is to use the browser's cookie information to match the configured grayscale routing value and grayscale address list, and enter the corresponding grayscale address if the match is successful. However, this method will limit the application field to browser access and is not competent for application architectures that do not use cookies. At the same time, the above three methods all have modification points for the microservice itself, resulting in a high risk of code intrusion. Summary of the invention
[0004] The embodiments of the present invention provide a grayscale rule configuration, grayscale routing method, device, equipment and storage medium to configure the grayscale rules without modifying the microservices, thereby providing a basis for the grayscale routing of subsequent request information.
[0005] In a first aspect, an embodiment of the present invention provides a method for configuring a grayscale rule, comprising:
[0006] In response to a grayscale marking request for a target microservice instance in a target microservice, marking the target microservice instance as a grayscale instance, and storing the target microservice instance in a grayscale instance list, wherein the grayscale instance is used to deploy an application to be updated;
[0007] In response to a grayscale rule configuration request for a target grayscale instance, a target grayscale rule matching the target grayscale instance is generated, and the target grayscale rule is sent to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rule stored locally;
[0008] The grayscale rules store routing rules for request information pointing to the grayscale instances.
[0009] In a second aspect, an embodiment of the present invention further provides a grayscale routing method, which is executed by a grayscale agent in a microservice platform, and includes:
[0010] Obtain and cache a list of grayscale instances from a server in real time, and update a locally stored grayscale rule according to a target grayscale rule issued by the server, wherein the grayscale rule stores a routing rule for request information pointing to the grayscale instance;
[0011] When receiving request information pointing to a grayscale instance and determining that the request information meets the forwarding condition, determining the next routing microservice matching the request information according to the locally stored grayscale rule;
[0012] If it is determined according to the grayscale instance list that the next routing microservice includes a target grayscale instance, the request information is forwarded to the target grayscale instance in the next routing microservice.
[0013] In a third aspect, an embodiment of the present invention further provides a grayscale rule configuration device, including:
[0014] A grayscale instance marking module, for responding to a grayscale marking request for a target microservice instance in a target microservice, marking the target microservice instance as a grayscale instance, and storing the target microservice instance in a grayscale instance list, wherein the grayscale instance is used to deploy an application to be updated;
[0015] A target grayscale rule generation module is used to generate a target grayscale rule matching the target grayscale instance in response to a grayscale rule configuration request for the target grayscale instance, and send the target grayscale rule to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rule stored locally;
[0016] The grayscale rules store routing rules for request information pointing to the grayscale instances.
[0017] In a fourth aspect, an embodiment of the present invention further provides a grayscale routing device, which is executed by a grayscale agent in a microservice platform, and includes:
[0018] A grayscale rule updating module is used to obtain and cache a grayscale instance list from a server in real time, and update a locally stored grayscale rule according to a target grayscale rule issued by the server, wherein the grayscale rule stores a routing rule for request information pointing to a grayscale instance;
[0019] A routing microservice determination module is used to determine the next routing microservice matching the request information according to the locally stored grayscale rules when receiving request information pointing to the grayscale instance and determining that the request information meets the forwarding condition;
[0020] A request information forwarding module is used to forward the request information to the target grayscale instance in the next routing microservice if it is determined according to the grayscale instance list that the next routing microservice includes a target grayscale instance.
[0021] In a fifth aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0022] one or more processors;
[0023] a storage device for storing one or more programs,
[0024] When the one or more programs are executed by the one or more processors, the one or more processors implement the grayscale rule configuration method as described in any embodiment of the present invention, or the grayscale routing method as described in any embodiment of the present invention.
[0025] In a sixth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a grayscale rule configuration method as described in any embodiment of the present invention, or a grayscale routing method as described in any embodiment of the present invention.
[0026] The embodiment of the present invention marks the target microservice instance as a grayscale instance in response to a grayscale marking request for a target microservice instance in a target microservice, and stores the target microservice instance in a grayscale instance list, where the grayscale instance is used to deploy an application to be updated; in response to a grayscale rule configuration request for the target grayscale instance, a target grayscale rule matching the target grayscale instance is generated, and the target grayscale rule is sent down to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rules stored locally; wherein, the routing rule for request information pointing to the grayscale instance is stored in the grayscale rule, which solves the problem in the related art that the microservice needs to be modified when performing grayscale routing, resulting in a higher risk of code intrusion, and the configuration of the grayscale rule can be realized without modifying the microservice, providing a basis for the grayscale routing of subsequent request information. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a flow chart of a method for configuring a grayscale rule in Embodiment 1 of the present invention;
[0028] Figure 2 is a flow chart of a method for configuring grayscale rules in Embodiment 2 of the present invention;
[0029] Figure 3 is a flow chart of a grayscale routing method in Embodiment 3 of the present invention;
[0030] Figure 4 is a flow chart of a grayscale routing method in Embodiment 4 of the present invention;
[0031] Figure 5 It is a schematic diagram of the configuration of the grayscale rules and grayscale routing listed in the fourth embodiment of the present invention;
[0032] Figure 6 It is a structural schematic diagram of a grayscale rule configuration device in Embodiment 5 of the present invention;
[0033] Figure 7 is a schematic diagram of the structure of a grayscale routing device in Embodiment 6 of the present invention;
[0034] Figure 8 It is a structural schematic diagram of an electronic device in Embodiment 7 of the present invention. DETAILED DESCRIPTION
[0035] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than to limit the embodiments of the present invention. It is also necessary to explain that, for ease of description, only parts related to the embodiments of the present invention are shown in the accompanying drawings, rather than all structures.
[0036] Embodiment 1
[0037] Figure 1 This is a flow chart of a grayscale rule configuration method in Embodiment 1 of the present invention. This embodiment is applicable to the case of configuring grayscale routing rules. The method can be executed by a grayscale rule configuration device, which can be implemented by software and / or hardware and integrated in an electronic device. Specifically, refer to Figure 1 , the method specifically comprises the following steps:
[0038] Step 110: In response to a grayscale marking request for a target microservice instance in a target microservice, mark the target microservice instance as a grayscale instance, and store the target microservice instance in a grayscale instance list. The grayscale instance is used to deploy the application to be updated.
[0039] Among them, the target microservice can be any microservice in the microservice architecture. A microservice is a small service composed of a single application, which has its own process and lightweight processing. The service is designed according to business functions, deployed in a fully automatic manner, and communicates with other services using HTTP API (HTTP Application Programming Interface). It can be understood that the microservice architecture is to split the complex and bloated single application into fine-grained services. Each split service is independently packaged and deployed, and handed over to a small team for development and operation and maintenance, thereby greatly improving the efficiency of application delivery. Among them, each split service is a microservice. In this embodiment, each microservice can also be understood as an application.
[0040] In a specific implementation, each microservice may include multiple microservice instances, for example, 2, 5, or 10, etc., which is not limited in this embodiment; wherein each embodiment may be the same or different, which is not limited in this embodiment.
[0041] In an optional implementation of this embodiment, when the server receives a grayscale marking request for a target microservice instance in a target microservice, the target microservice instance can be marked as a grayscale instance, wherein the target microservice instance can be any microservice instance in the target microservice, which is not limited in this embodiment.
[0042] Further, the target microservice instance marked as a grayscale instance can be stored in the grayscale instance list of the server. It should be noted that the grayscale instance involved in this embodiment can be used to deploy the application to be updated, that is, the application to be updated is deployed in the grayscale instance, and the grayscale routing to be updated and the grayscale routing can be further realized.
[0043] Step 120: In response to the grayscale rule configuration request for the target grayscale instance, a target grayscale rule matching the target grayscale instance is generated, and the target grayscale rule is sent to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rule stored locally.
[0044] The grayscale rules store routing rules for request information pointing to the grayscale instances.
[0045] In an optional implementation of the present embodiment, after marking the target microservice instance as a grayscale instance and marking the target microservice instance as a grayscale instance, a grayscale rule configuration request for the target grayscale instance can be further responded to, that is, when the server receives the grayscale rule configuration request for the target grayscale instance, it can generate a target grayscale rule that matches the target grayscale instance, and send the generated target grayscale rule to each grayscale agent in the microservice platform to instruct each grayscale agent to update the locally stored grayscale rules.
[0046] It should be noted that the grayscale agent involved in this embodiment can be in the gateway and each microservice instance in the microservice platform (microservice architecture), and this embodiment does not limit it.
[0047] Exemplarily, after marking the target microservice instance as a grayscale instance and storing the target microservice instance in a grayscale instance list, the grayscale rules of the target grayscale instance can be further configured to generate a target grayscale rule that matches the target grayscale instance, and the generated target grayscale rule is sent to each grayscale agent in the microservice platform. When the grayscale agent determines that the newly sent target grayscale rule is inconsistent with its locally stored grayscale rule, it can update the locally stored grayscale rule, that is, update the locally stored grayscale rule to the newly generated target grayscale rule.
[0048] The solution of this embodiment, by responding to the grayscale marking request for the target microservice instance in the target microservice, marks the target microservice instance as a grayscale instance, and stores the target microservice instance in the grayscale instance list, the grayscale instance is used to deploy the application to be updated; in response to the grayscale rule configuration request for the target grayscale instance, a target grayscale rule matching the target grayscale instance is generated, and the target grayscale rule is sent to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rules stored locally; wherein, the routing rule for the request information pointing to the grayscale instance is stored in the grayscale rule, which solves the problem in the related technology that the microservice needs to be modified when performing grayscale routing, resulting in a higher risk of code intrusion, and the configuration of the grayscale rule can be realized without modifying the microservice, providing a basis for the grayscale routing of subsequent request information.
[0049] Embodiment 2
[0050] Figure 2 This is a flow chart of a grayscale rule configuration method in Embodiment 2 of the present invention. This embodiment is a further refinement of the above-mentioned technical solutions. The technical solution in this embodiment can be combined with various optional solutions in one or more of the above-mentioned embodiments. Figure 2 As shown, the configuration method of the grayscale rule may include the following steps:
[0051] Step 210: In response to the grayscale marking request for the target microservice instance in the target microservice, modify the attribute information of the target microservice instance.
[0052] In an optional implementation of this embodiment, when the server receives a grayscale marking request for a target microservice instance, the target microservice instance may be marked as a grayscale instance; optionally, marking the target microservice instance as a grayscale instance may include: modifying attribute information of the target microservice instance, wherein the attribute information of the target microservice instance may include the name or suffix of the target microservice instance.
[0053] Exemplarily, after the server receives a grayscale marking request for a target microservice instance, the server may modify the name of the target microservice instance, for example, by adding or deleting a character in the name of the target microservice instance to determine that the target microservice instance is a grayscale instance.
[0054] In another specific example of this embodiment, after the server receives a grayscale marking request for a target microservice instance, the server may modify the suffix name of the target microservice instance. For example, if the suffix name of the target microservice instance is ".a", the suffix name of the target microservice instance may be modified to ".b" to determine that the target microservice instance is a grayscale instance.
[0055] Step 220: Store the target microservice instance in a grayscale instance list. The grayscale instance is used to deploy the application to be updated.
[0056] Step 230: In response to the grayscale rule configuration request for the target grayscale instance, a target grayscale rule matching the target grayscale instance is generated, and the target grayscale rule is sent to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rule stored locally.
[0057] In an optional implementation of this embodiment, after the server receives a grayscale rule configuration request for a target grayscale instance, it can further generate a target grayscale rule that matches the target grayscale instance, wherein the generated target grayscale rule may include a grayscale rule type and grayscale rule parameters.
[0058] Optionally, generating a target grayscale rule matching the target grayscale instance may include: configuring a grayscale rule type of the target grayscale instance, and determining grayscale rule parameters according to the grayscale rule type.
[0059] In an optional implementation of this embodiment, after the server receives a grayscale rule configuration request for a target grayscale instance, it can further configure a grayscale rule type that matches the target grayscale instance, and determine grayscale rule parameters that match the target grayscale instance based on the configured grayscale rule type.
[0060] Among them, the grayscale rule types involved in this embodiment can be: HTTP Header (request header), HTTP Method (request method), HTTP Parameter (request parameter), HTTP Body (request body), request IP or custom rules, etc., which are not limited in this embodiment.
[0061] In a specific example of the present embodiment, if the grayscale rule type configured to match the target grayscale instance is HTTP Header, then the grayscale rule parameters that match the target grayscale instance are determined according to the configured grayscale rule type (HTTP Header) and can be {"key":"version","mode":"=","value":"2.0"}; if the grayscale rule type configured to match the target grayscale instance is HTTP Body, then the grayscale rule parameters that match the target grayscale instance are determined according to the configured grayscale rule type (HTTP Body) and can be {"key":"$.msgEntity.user.name","mode":"=","value":"Jack"}.
[0062] The solution of this embodiment modifies the attribute information of the target microservice instance in response to the grayscale marking request for the target microservice instance in the target microservice; configures the grayscale rule type that matches the target grayscale instance, and determines the grayscale rule parameters that match the target grayscale instance according to the configured grayscale rule type; realizes the configuration of grayscale rules without increasing the risk of microservice code intrusion, and provides a basis for the grayscale routing of subsequent request information.
[0063] Embodiment 3
[0064] Figure 3 This is a flow chart of a grayscale routing method in Embodiment 3 of the present invention. This embodiment is applicable to the case where grayscale routing is performed on an application to be updated. The method can be executed by a grayscale routing device, which can be implemented by software and / or hardware and integrated in an electronic device. Specifically, refer to Figure 3 , the method specifically comprises the following steps:
[0065] Step 310: Obtain and cache the grayscale instance list from the server in real time, and update the locally stored grayscale rules according to the target grayscale rules issued by the server. The grayscale rules store routing rules for request information pointing to the grayscale instances.
[0066] In this embodiment, the grayscale agent in the microservice platform can be configured in each registered microservice instance in the microservice platform, as well as in the microservice gateway; for example, if a microservice platform contains 5 registered microservices, each microservice contains 2 microservice instances, then a grayscale agent will be configured in 10 microservice instances in the microservice gateway and the microservice gateway.
[0067] In an optional implementation of this embodiment, the grayscale proxy in the microservice platform can obtain and cache the grayscale instance list from the server, and can update the locally stored grayscale rules according to the target grayscale rules issued by the server, wherein the grayscale rules store routing rules for request information pointing to the grayscale instances. It should be noted that the grayscale rules stored in each grayscale proxy involved in this embodiment are the same.
[0068] Optionally, updating the locally stored grayscale rules according to the target grayscale rules sent by the server may include: comparing the target grayscale rules with the locally stored grayscale rules, and when the two are inconsistent, updating the locally stored grayscale rules to the target grayscale rules.
[0069] In an optional implementation of this embodiment, after the grayscale proxy receives the target grayscale rule sent by the server, it can compare the received target grayscale rule with the grayscale rule stored locally. When the received target grayscale rule is inconsistent with the grayscale rule stored locally, or calculate the similarity between the received target grayscale rule and the grayscale rule stored locally, when the similarity is less than a set threshold, the locally stored grayscale rule can be updated to the target grayscale rule sent by the server. The set threshold involved in this embodiment can be a value such as 0.8, 0.75 or 0.9, which is not limited in this embodiment.
[0070] Step 320: When request information pointing to the grayscale instance is received and it is determined that the request information meets the forwarding condition, the next routing microservice matching the request information is determined according to the grayscale rules stored locally.
[0071] In an optional implementation of this embodiment, when it is determined that the received request information is request information pointing to a grayscale instance, and it is further determined that the request information meets the forwarding conditions, the next routing microservice that matches the request information can be determined based on the grayscale rules stored locally in the grayscale proxy.
[0072] Optionally, after receiving the request information, the request information may be compared with the grayscale rule parameters. When the comparison result determines that the request information contains one or more grayscale rule parameters, it may be determined that the received request information is request information pointing to a grayscale instance.
[0073] Optionally, when request information pointing to a grayscale instance is received and it is determined that the request information meets the forwarding conditions, the next routing microservice that matches the request information is determined according to the locally stored grayscale rules, which may include: if the grayscale agent is deployed in the microservice gateway, the request information is forwarded to the next routing microservice; if the grayscale agent is deployed in the microservice instance, whether the microservice instance is a grayscale instance is determined according to the grayscale instance list, and if not, the request information is forwarded to the next routing microservice.
[0074] In the specific implementation, if the grayscale proxy is deployed in the microservice gateway, when it receives request information pointing to the grayscale instance, it can directly forward the request information to the next routing microservice; if the grayscale proxy is deployed in the microservice instance, it can determine whether the current microservice instance is a grayscale instance based on the acquired microservice instance. If not, that is, the current microservice instance is not a pre-configured grayscale instance, the request information can be further forwarded to the next routing microservice.
[0075] Step 330: If it is determined according to the grayscale instance list that the next routing microservice includes the target grayscale instance, the request information is forwarded to the target grayscale instance in the next routing microservice.
[0076] In an optional implementation of this embodiment, when the grayscale agent in the microservice platform receives request information pointing to a grayscale instance and determines that the request information meets the forwarding conditions, it determines the next routing microservice that matches the request information based on the locally stored grayscale rules. If it is determined based on the grayscale instance list that the next routing microservice contains the target grayscale instance, the request information can be forwarded to the target grayscale instance in the next routing microservice.
[0077] Exemplarily, if the grayscale agent in the microservice platform receives request information pointing to a grayscale instance and determines that the request information meets the forwarding conditions, it determines that the next routing microservice matching the request information is microservice B according to the locally stored grayscale rules. It can then determine whether microservice B contains the target grayscale instance according to the grayscale instance list, that is, determine whether microservice B contains the grayscale instance. After determining that microservice B contains the grayscale instance, it can forward the request information pointing to the grayscale instance to the target grayscale instance, thereby allowing the request information pointing to the grayscale instance to participate in grayscale routing.
[0078] The solution of this embodiment obtains and caches the grayscale instance list from the server in real time, and updates the locally stored grayscale rules according to the target grayscale rules issued by the server, wherein the grayscale rules store routing rules for request information pointing to the grayscale instance; when request information pointing to the grayscale instance is received and it is determined that the request information meets the forwarding conditions, the next routing microservice matching the request information is determined according to the locally stored grayscale rules; if it is determined according to the grayscale instance list that the next routing microservice includes the target grayscale instance, the request information is forwarded to the target grayscale instance in the next routing microservice, thereby realizing grayscale routing of the request information without changing the microservice.
[0079] Embodiment 4
[0080] Figure 4 4 is a flowchart of a grayscale routing method in the fourth embodiment of the present invention. This embodiment is a further refinement of the above technical solutions. The technical solution in this embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 4 As shown, the grayscale routing method may include the following steps:
[0081] Step 410: Obtain and cache the grayscale instance list from the server in real time, and update the locally stored grayscale rules according to the target grayscale rules issued by the server. The grayscale rules store routing rules for request information pointing to the grayscale instances.
[0082] Step 420: When request information pointing to the grayscale instance is received and it is determined that the request information meets the forwarding condition, the next routing microservice matching the request information is determined according to the grayscale rules stored locally.
[0083] In an optional implementation of this embodiment, if the grayscale agent is deployed in a microservice instance, determining whether the microservice instance is a grayscale instance based on the grayscale instance list may include: determining whether the grayscale instance list contains the microservice instance, and if so, determining that the microservice instance is a grayscale instance.
[0084] Exemplarily, when the grayscale agent is deployed in a microservice instance, determining whether the microservice instance is a grayscale instance according to the grayscale instance list can be done by determining whether the microservice instance is included in the grayscale instance list. For example, it can be done by determining whether the name, attributes, size and other information of the microservice instance are stored in the grayscale instance list. If so, it can be determined that the microservice instance is a grayscale instance.
[0085] Step 430: If it is determined according to the grayscale instance list that the next routing microservice does not include the target grayscale instance, the request information continues to be forwarded to any microservice instance until the request information is forwarded to the target grayscale instance in the next routing microservice.
[0086] In an optional implementation of this embodiment, after the grayscale agent determines the next routing microservice that matches the request information based on the locally stored grayscale rules, if it further determines based on the grayscale instance list that the next routing microservice does not include the target grayscale instance, it can continue to forward the request information to any microservice instance until the request information is forwarded to the target grayscale instance in the next routing microservice.
[0087] Exemplarily, if the grayscale agent in the microservice platform receives request information pointing to a grayscale instance and determines that the request information meets the forwarding conditions, it determines, based on the locally stored grayscale rules, that the next routing microservice that matches the request information is microservice B. It can then determine whether microservice B contains the target grayscale instance based on the grayscale instance list, that is, determine whether microservice B contains a grayscale instance. When it is determined that microservice B does not contain a grayscale instance, it can forward the request information pointing to the grayscale instance to any grayscale instance of microservice B until the request information is forwarded to the grayscale instance, even if the request information participates in grayscale routing.
[0088] The solution of this embodiment, if it is determined according to the grayscale instance list that the next routing microservice does not include the target grayscale instance, then the request information continues to be forwarded to any microservice instance until the request information is forwarded to the target grayscale instance in the next routing microservice, thereby realizing grayscale routing of the request information without changing the microservice.
[0089] In order to enable those skilled in the art to better understand the embodiments of the present invention, Figure 5 The configuration of grayscale rules and the principle diagram of grayscale routing involved in the embodiments of the present invention are listed.
[0090] like Figure 5As shown, microservice 510 and microservice 520 need to be registered with the service registration center 530, and the grayscale agent 540 needs to be deployed to each microservice instance (such as microservice instance 511, microservice instance 512, microservice instance 521 and microservice instance 522), and exchange information with the grayscale instance control center 550. The microservice instance (for example, microservice instance 522) will be marked as a grayscale instance by the grayscale instance control center 550, and the grayscale instance control center maintains a list of grayscale instances. Each grayscale instance has its own grayscale rule definition and grayscale tracking definition. The grayscale instance control center 550 will send the change of grayscale configuration information to the grayscale update sending module 560, and then the grayscale update sending module 560 will notify each grayscale agent. After receiving the updated grayscale configuration information, the grayscale agent refreshes the information in the memory to take effect in real time. The grayscale routing logic of the request is matched to the grayscale instance by the grayscale agent 540 according to the grayscale rule calculation and then handed over to the load balancer of the microservice for request call. The full-link call path of each request is recorded by the grayscale monitoring module to monitor the correctness of the grayscale routing of the request traffic.
[0091] It should be noted that in the existing microservice architecture, all microservices will be registered with the service registration center 530, such as the microservice gateway 570, microservice 510, and microservice 520; among them, microservice 510 has two microservice instances 511 and 512, and microservice 520 has two microservice instances 521 and 522. This is an example, and there will be many microservices and their instances in actual situations. When the access path of an HTTP request is microservice gateway 570->microservice 510->microservice 520, a microservice instance is selected through the load balancer on the microservice gateway 570 and microservice 510 through the load balancing strategy for calling.
[0092] In an optional implementation of this embodiment, the grayscale agent 540 can be deployed in the deployment unit of each microservice instance in SideCar mode. By manipulating the bytecode through Java Agent, it can intercept the request call of the microservice and cut into the functional logic of the load balancer in the original microservice. The grayscale rule calculation engine in the grayscale agent completes the calculation of the grayscale rules, matches the specified grayscale instance for traffic forwarding, and completes the grayscale routing.
[0093] It should also be noted that if an HTTP request is called multiple times in a microservice, the original request information will be lost. For example, when the request enters microservice A, the request parameter contains user.name information. Microservice A calls microservice B due to business logic, and microservice B calls microservice C due to business logic. When microservice B calls the service interface of microservice C, it does not have the parameter information of user.name. However, the grayscale rule of a grayscale instance of microservice C needs to be matched according to the parameter information of user.name in the original request. For this scenario, the grayscale tracking engine is introduced in this instance. The parameters that need to be grayscale tracked are also configured in the grayscale instance control center. After each request forwarding call, the grayscale agent will carry the grayscale tracking parameter information to the next microservice call, so that the grayscale agent of the subsequent microservice can obtain the grayscale tracking parameter information and calculate the grayscale rules.
[0094] After the grayscale agent is started for the first time, it will access the grayscale instance control center to obtain the grayscale instance list, grayscale rule information and grayscale tracking parameter information, and cache them in the grayscale agent memory. When the grayscale instance control center updates the grayscale instance list, grayscale rule information or grayscale tracking parameter information, it is necessary to enable all grayscale agents to perceive the updated content in real time and refresh the memory. If the grayscale agent uses the method of looping to request the grayscale instance control center, it will inevitably cause a great waste of network traffic and bandwidth occupation, and the pressure on the grayscale instance control center is also very large, and if the information is not updated, the request itself is a useless operation. The present invention adopts a message mechanism and introduces a message middleware. When the grayscale instance control center updates the grayscale information, on the one hand, it saves the data to the database, and at the same time publishes the updated data to the message middleware. All grayscale agents subscribe to the message queue of the message middleware. After receiving the grayscale update message, the memory information of the grayscale agent is immediately refreshed, so as to achieve dynamic update of the grayscale configuration, and it is a near real-time response speed, without causing waste of network requests, and saving unnecessary system expenses. When the next request arrives, the load balancer is intercepted by the grayscale proxy. The grayscale proxy uses the new grayscale rules to compare the request parameters and routes it to the matching grayscale instance, thus completing a dynamic grayscale configuration update.
[0095] Regarding the correctness of the grayscale routing results, this embodiment monitors the traffic of the entire link microservice calls in the system according to the Open Tracing specification. One request is a trace, and one call of a request in each microservice is a span. Therefore, a trace contains multiple spans, each span contains the parameter information of this call, and the parameter information contains the grayscale rule parameters that the grayscale rule needs to match. Each request traffic routed to the grayscale instance is visualized, and the request parameter information can be viewed to monitor whether the request is correctly routed to the grayscale instance.
[0096] Embodiment 5
[0097] Figure 6 Schematic diagram of the structure of a grayscale rule configuration device in Embodiment 5 of the present invention, which can execute the grayscale rule configuration method involved in the above embodiments. Figure 6 The device includes: a grayscale instance marking module 610 and a target grayscale rule generating module 620.
[0098] A grayscale instance marking module 610 is used to respond to a grayscale marking request for a target microservice instance in a target microservice, mark the target microservice instance as a grayscale instance, and store the target microservice instance in a grayscale instance list, where the grayscale instance is used to deploy the application to be updated;
[0099] A target grayscale rule generation module 620 is used to generate a target grayscale rule matching the target grayscale instance in response to a grayscale rule configuration request for the target grayscale instance, and send the target grayscale rule to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rule stored locally;
[0100] The grayscale rules store routing rules for request information pointing to the grayscale instances.
[0101] The solution of this embodiment is to respond to the grayscale marking request for the target microservice instance in the target microservice through the grayscale instance marking module, mark the target microservice instance as a grayscale instance, and store the target microservice instance in the grayscale instance list, and the grayscale instance is used to deploy the application to be updated; respond to the grayscale rule configuration request for the target grayscale instance through the target grayscale rule generation module, generate a target grayscale rule that matches the target grayscale instance, and send the target grayscale rule to each grayscale agent in the microservice platform to instruct each grayscale agent to update the locally stored grayscale rules, which solves the problem in the related technology that microservices need to be modified when performing grayscale routing, resulting in a higher risk of code intrusion. The configuration of grayscale rules can be realized without modifying the microservices, providing a basis for the grayscale routing of subsequent request information.
[0102] Optionally, the grayscale instance marking module 610 is specifically used to modify the attribute information of the target microservice instance; wherein the attribute information includes the name or suffix of the target microservice instance.
[0103] Optionally, the target grayscale rule includes a grayscale rule type and grayscale rule parameters; the target grayscale rule generation module 620 is specifically used to configure the grayscale rule type of the target grayscale instance and determine the grayscale rule parameters according to the grayscale rule type.
[0104] Optionally, the grayscale rule type includes at least one of the following: HTTP Header, HTTP Method, HTTP Parameter, HTTP Body, IP address, or a custom rule.
[0105] The grayscale rule configuration device provided in the embodiment of the present invention can execute the grayscale rule configuration method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0106] Embodiment 6
[0107] Figure 7 Schematic diagram of the structure of a grayscale routing device in Embodiment 6 of the present invention; the device can execute the grayscale routing method involved in the above embodiments. Figure 7 The device includes: a grayscale rule updating module 710, a routing microservice determining module 720 and a request information forwarding module 730.
[0108] Grayscale rule updating module 710 is used to obtain and cache the grayscale instance list from the server in real time, and update the locally stored grayscale rules according to the target grayscale rules issued by the server, in which the routing rules for request information pointing to the grayscale instance are stored;
[0109] The routing microservice determination module 720 is used to determine the next routing microservice matching the request information according to the locally stored grayscale rules when receiving the request information pointing to the grayscale instance and determining that the request information meets the forwarding condition;
[0110] The request information forwarding module 730 is used to forward the request information to the target grayscale instance in the next routing microservice if it is determined according to the grayscale instance list that the next routing microservice includes the target grayscale instance.
[0111] The solution of this embodiment is to obtain and cache the grayscale instance list from the server in real time through the grayscale rule update module, and update the locally stored grayscale rules according to the target grayscale rules issued by the server, and the routing rules of the request information pointing to the grayscale instance are stored in the grayscale rules; when the routing microservice determination module receives the request information pointing to the grayscale instance and determines that the request information meets the forwarding condition, the next routing microservice matching the request information is determined according to the locally stored grayscale rules; the request information is forwarded to the target grayscale instance in the next routing microservice through the request information forwarding module, and the grayscale routing of the request information is realized without changing the microservice.
[0112] Optionally, the grayscale rule updating module 710 is specifically used to compare the target grayscale rule with the locally stored grayscale rule, and when the two are inconsistent, update the locally stored grayscale rule to the target grayscale rule.
[0113] Optionally, the routing microservice determination module 720 includes: a first routing microservice determination submodule and a second routing microservice determination submodule; the first routing microservice determination submodule is used to forward the request information to the next routing microservice if the grayscale agent is deployed in the microservice gateway; the second routing microservice determination submodule is used to determine whether the microservice instance is a grayscale instance according to the grayscale instance list if the grayscale agent is deployed in the microservice instance, and if not, forward the request information to the next routing microservice.
[0114] Optionally, the second routing microservice determines a submodule, specifically for
[0115] It is determined whether the grayscale instance list contains the microservice instance. If so, the microservice instance is determined to be a grayscale instance.
[0116] Optionally, the device also includes: a forwarding module, which is used to continue forwarding the request information to any microservice instance until the request information is forwarded to the target grayscale instance in the next routing microservice if it is determined according to the grayscale instance list that the next routing microservice does not include the target grayscale instance.
[0117] The grayscale routing device provided in the embodiment of the present invention can execute the grayscale routing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0118] Embodiment 7
[0119] Figure 8 is a schematic diagram of the structure of an electronic device in Embodiment 7 of the present invention, such as Figure 8 As shown, the device / terminal / server includes a processor 80, a memory 81, an input device 82 and an output device 83; the number of processors 80 in the device / terminal / server can be one or more. Figure 8 A processor 80 is taken as an example; the processor 80, the memory 81, the input device 82 and the output device 83 in the device / terminal / server can be connected by a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0120] The memory 81, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the grayscale rule configuration method in the embodiment of the present invention (for example, the grayscale instance marking module 610 and the target grayscale rule generation module 620 in the grayscale rule configuration device), or the program instructions / modules corresponding to the grayscale routing method in the embodiment of the present invention (for example, the grayscale rule update module 710, the routing microservice determination module 720 and the request information forwarding module 730 in the grayscale routing device). The processor 80 executes various functional applications and data processing of the device / terminal / server by running the software programs, instructions and modules stored in the memory 81, that is, implements the above-mentioned grayscale rule configuration method or grayscale routing method.
[0121] The memory 81 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 81 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 81 may further include a memory remotely arranged relative to the processor 80, and these remote memories may be connected to the device / terminal / server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0122] The input device 82 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device / terminal / server. The output device 83 may include a display device such as a display screen.
[0123] Embodiment 8
[0124] Embodiment 8 of the present invention further provides a storage medium including computer executable instructions, and when the computer executable instructions are executed by a computer processor, they are used to execute a grayscale rule configuration method, including:
[0125] In response to a grayscale marking request for a target microservice instance in a target microservice, marking the target microservice instance as a grayscale instance, and storing the target microservice instance in a grayscale instance list, where the grayscale instance is used to deploy an application to be updated;
[0126] In response to a grayscale rule configuration request for a target grayscale instance, a target grayscale rule matching the target grayscale instance is generated, and the target grayscale rule is sent to each grayscale agent in the microservice platform to instruct each grayscale agent to update the grayscale rule stored locally;
[0127] The grayscale rules store routing rules for request information pointing to the grayscale instances.
[0128] Alternatively, a grayscale routing method, including:
[0129] Obtain and cache the grayscale instance list from the server in real time, and update the locally stored grayscale rules according to the target grayscale rules issued by the server. The grayscale rules store routing rules for request information pointing to grayscale instances.
[0130] When receiving the request information pointing to the grayscale instance and determining that the request information meets the forwarding conditions, determine the next routing microservice that matches the request information according to the grayscale rules stored locally;
[0131] If it is determined according to the grayscale instance list that the next routing microservice includes the target grayscale instance, the request information is forwarded to the target grayscale instance in the next routing microservice.
[0132] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the method operations described above, and can also execute related operations in the grayscale rule configuration method or grayscale routing method provided by any embodiment of the present invention.
[0133] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0134] It is worth noting that in the above-mentioned grayscale rule configuration method or the embodiment of the grayscale routing method, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0135] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for configuring grayscale rules, characterized in that: include: In response to a grayscale marking request for a target microservice instance in a target microservice, marking the target microservice instance as a grayscale instance, and storing the target microservice instance in a grayscale instance list, wherein the grayscale instance is used to deploy an application to be updated, and the grayscale instance list includes a name, attributes, and size of the target grayscale instance; The target microservice instance is any microservice instance in the target microservice; In response to a grayscale rule configuration request for a target grayscale instance, a target grayscale rule matching the target grayscale instance is generated, and the target grayscale rule is sent to each grayscale agent in the microservice platform to instruct each grayscale agent to update the locally stored grayscale rule; wherein the target grayscale rule includes a grayscale rule type and grayscale rule parameters; the grayscale agent is deployed in a deployment unit of each microservice instance in sidecar mode; the grayscale agent includes a grayscale rule calculation engine and a grayscale tracking engine; the grayscale agent is implemented through Java The agent manipulates the bytecode to intercept the request call of the microservice, thereby cutting into the functional logic of the load balancer in the original microservice, and the grayscale rule calculation engine completes the calculation of the grayscale rule, matches the specified grayscale instance to forward the traffic, so as to complete the grayscale routing; wherein the grayscale rule stores the routing rule of the request information pointing to the grayscale instance; after the grayscale agent is started for the first time, it obtains the grayscale instance list, grayscale rule information and grayscale tracking parameter information by accessing the grayscale instance control center, and caches them in the grayscale agent memory; the grayscale tracking parameter information is the parameter that needs to be grayscale tracked and configured in the grayscale instance control center. In each subsequent request forwarding call, the grayscale agent carries the grayscale tracking parameter information to the next microservice call, so that the grayscale agent of the subsequent microservice obtains the grayscale tracking parameter information and calculates the grayscale rule; wherein, marking the target microservice instance as a grayscale instance includes: Modify the attribute information of the target microservice instance; wherein the attribute information includes the name or suffix of the target microservice instance; Wherein, generating a target grayscale rule matching the target grayscale instance includes: Configuring a grayscale rule type of the target grayscale instance, and determining the grayscale rule parameters according to the grayscale rule type; The grayscale rule type includes at least one of the following: HTTP Header, HTTP Method, HTTP Parameter, HTTP Body, IP or custom rules; The locally stored grayscale rules are updated in one of the following ways: The grayscale proxy compares the received target grayscale rule with the locally stored grayscale rule, and when the two are inconsistent, updates the locally stored grayscale rule to the target grayscale rule; or, The grayscale proxy calculates the similarity between the received target grayscale rule and the locally stored grayscale rule, and when the similarity is less than a set threshold, updates the locally stored grayscale rule to the target grayscale rule.
2. A grayscale routing method, executed by a grayscale agent in a microservice platform, wherein the grayscale agent is deployed in a sidecar mode in a deployment unit of each microservice instance, characterized in that: include: Obtaining and caching a grayscale instance list from a server in real time, and updating a locally stored grayscale rule according to a target grayscale rule issued by the server, wherein the grayscale rule stores a routing rule for request information pointing to the grayscale instance; the grayscale instance list includes the name, attributes, and size of the target grayscale instance; The target grayscale rule includes a grayscale rule type and grayscale rule parameters; the grayscale agent includes a grayscale rule calculation engine and a grayscale tracking engine. The grayscale agent intercepts the request call of the microservice by manipulating the bytecode through Java Agent, thereby cutting into the functional logic of the load balancer in the original microservice. The grayscale rule calculation engine completes the calculation of the grayscale rule and matches the specified grayscale instance for traffic forwarding to complete the grayscale routing; After the grayscale agent is started for the first time, it obtains the grayscale instance list, grayscale rule information and grayscale tracking parameter information by accessing the grayscale instance control center, and caches them in the grayscale agent memory; the grayscale tracking parameter information is the parameter that needs to be grayscale tracked and is configured in the grayscale instance control center. In each subsequent request forwarding call, the grayscale agent carries the grayscale tracking parameter information to the next microservice call, so that the grayscale agent of the subsequent microservice obtains the grayscale tracking parameter information and calculates the grayscale rule; the grayscale instance is marked by modifying the attribute information of the target microservice instance, and the attribute information includes the name or suffix of the target microservice instance; the grayscale rule type includes at least one of the following: HTTP Header, HTTP Method, HTTP Parameter, HTTP Body, IP or custom rule; the target microservice instance is any microservice instance in the target microservice; When receiving request information pointing to a grayscale instance and determining that the request information meets the forwarding condition, determining the next routing microservice matching the request information according to the locally stored grayscale rule; If it is determined according to the grayscale instance list that the next routing microservice includes a target grayscale instance, forwarding the request information to the target grayscale instance in the next routing microservice; Wherein, updating the locally stored grayscale rules according to the target grayscale rules issued by the server includes: Compare the target grayscale rule with the locally stored grayscale rule, and when the two are inconsistent, update the locally stored grayscale rule to the target grayscale rule; or, The similarity between the target grayscale rule and the locally stored grayscale rule is calculated, and when the similarity is less than a set threshold, the locally stored grayscale rule is updated to the target grayscale rule.
3. The method according to claim 2, characterized in that When receiving the request information pointing to the grayscale instance and determining that the request information meets the forwarding condition, determining the next routing microservice matching the request information according to the locally stored grayscale rule, including: If the grayscale proxy is deployed in a microservice instance, it is determined whether the microservice instance is a grayscale instance according to the grayscale instance list, and if not, the request information is forwarded to the next routing microservice.
4. The method according to claim 3, characterized in that If the grayscale agent is deployed in a microservice instance, determining whether the microservice instance is a grayscale instance according to the grayscale instance list includes: Determine whether the grayscale instance list includes the microservice instance, and if so, determine that the microservice instance is a grayscale instance.
5. The method according to claim 2, characterized in that: The method further comprises: If it is determined according to the grayscale instance list that the next routing microservice does not include the target grayscale instance, the request information continues to be forwarded to any microservice instance until the request information is forwarded to the target grayscale instance in the next routing microservice.
6. A grayscale rule configuration device, characterized in that: include: A grayscale instance marking module, for responding to a grayscale marking request for a target microservice instance in a target microservice, marking the target microservice instance as a grayscale instance, and storing the target microservice instance in a grayscale instance list, wherein the grayscale instance is used to deploy an application to be updated; The target microservice instance is any microservice instance in the target microservice; The target grayscale rule generation module is used to respond to the grayscale rule configuration request for the target grayscale instance, generate the target grayscale rule matching the target grayscale instance, and send the target grayscale rule to each grayscale agent in the microservice platform to instruct each grayscale agent to update the locally stored grayscale rule; wherein, the target grayscale rule includes the grayscale rule type and the grayscale rule parameter; the grayscale agent is deployed in the deployment unit of each microservice instance in sidecar mode; the grayscale agent includes a grayscale rule calculation engine and a grayscale tracking engine; the grayscale agent intercepts the request call of the microservice by manipulating the bytecode through JavaAgent, thereby cutting into the load balancing in the original microservice In the functional logic of the scale, the grayscale rule calculation engine completes the calculation of the grayscale rule, matches the specified grayscale instance to forward traffic, and completes the grayscale routing; after the grayscale agent is started for the first time, it obtains the grayscale instance list, grayscale rule information and grayscale tracking parameter information by accessing the grayscale instance control center, and caches them in the grayscale agent memory; the grayscale tracking parameter information is the parameter that needs to be grayscale tracked and is configured in the grayscale instance control center. In each subsequent request forwarding call, the grayscale agent carries the grayscale tracking parameter information to the next microservice call, so that the grayscale agent of the subsequent microservice can obtain the grayscale tracking parameter information and calculate the grayscale rule; Wherein, the grayscale rule stores routing rules for request information pointing to the grayscale instance; The grayscale instance marking module is specifically used for Modify the attribute information of the target microservice instance; wherein the attribute information includes the name or suffix of the target microservice instance; The target grayscale rule generating module is specifically used to configure the grayscale rule type of the target grayscale instance, and determine the grayscale rule parameters according to the grayscale rule type; The grayscale rule type includes at least one of the following: HTTP Header, HTTP Method, HTTP Parameter, HTTP Body, IP or custom rules; The locally stored grayscale rules are updated in one of the following ways: The grayscale proxy compares the received target grayscale rule with the locally stored grayscale rule, and when the two are inconsistent, updates the locally stored grayscale rule to the target grayscale rule; or, The grayscale proxy calculates the similarity between the received target grayscale rule and the locally stored grayscale rule, and when the similarity is less than a set threshold, updates the locally stored grayscale rule to the target grayscale rule.
7. A grayscale routing device, executed by a grayscale agent in a microservice platform, wherein the grayscale agent is deployed in a sidecar mode in a deployment unit of each microservice instance, characterized in that: include: A grayscale rule update module is used to obtain and cache a grayscale instance list from a server in real time, and update the locally stored grayscale rules according to the target grayscale rules issued by the server, wherein the grayscale rules store routing rules for request information pointing to the grayscale instance; the grayscale instance list includes the name, attributes and size of the target grayscale instance; The target grayscale rule includes a grayscale rule type and grayscale rule parameters; the grayscale agent includes a grayscale rule calculation engine and a grayscale tracking engine. The grayscale agent intercepts the request call of the microservice by manipulating the bytecode through Java Agent, thereby cutting into the functional logic of the load balancer in the original microservice. The grayscale rule calculation engine completes the calculation of the grayscale rule and matches the specified grayscale instance for traffic forwarding to complete the grayscale routing; After the grayscale agent is started for the first time, it obtains the grayscale instance list, grayscale rule information and grayscale tracking parameter information by accessing the grayscale instance control center, and caches them in the grayscale agent memory; the grayscale tracking parameter information is the parameter that needs to be grayscale tracked and is configured in the grayscale instance control center. In each subsequent request forwarding call, the grayscale agent carries the grayscale tracking parameter information to the next microservice call, so that the grayscale agent of the subsequent microservice obtains the grayscale tracking parameter information and calculates the grayscale rule; the grayscale instance is marked by modifying the attribute information of the target microservice instance, and the attribute information includes the name or suffix of the target microservice instance; the grayscale rule type includes at least one of the following: HTTP Header, HTTP Method, HTTP Parameter, HTTP Body, IP or custom rule; the target microservice instance is any microservice instance in the target microservice; A routing microservice determination module is used to determine the next routing microservice matching the request information according to the locally stored grayscale rules when receiving request information pointing to the grayscale instance and determining that the request information meets the forwarding condition; A request information forwarding module, configured to forward the request information to the target grayscale instance in the next routing microservice if it is determined according to the grayscale instance list that the next routing microservice includes a target grayscale instance; Wherein, the grayscale rule updating module is specifically used for Compare the target grayscale rule with the locally stored grayscale rule, and when the two are inconsistent, update the locally stored grayscale rule to the target grayscale rule; or, The similarity between the target grayscale rule and the locally stored grayscale rule is calculated, and when the similarity is less than a set threshold, the locally stored grayscale rule is updated to the target grayscale rule.
8. The device according to claim 7, characterized in that The routing microservice determination module includes: a second routing microservice determination submodule; The second routing microservice determination submodule is used to determine whether the microservice instance is a grayscale instance according to the grayscale instance list if the grayscale agent is deployed in the microservice instance, and if not, forward the request information to the next routing microservice.
9. The device according to claim 8, characterized in that The second routing microservice determines a submodule, specifically for Determine whether the grayscale instance list includes the microservice instance, and if so, determine that the microservice instance is a grayscale instance.
10. The device according to claim 7, characterized in that The device also includes: A forwarding module is used to continue forwarding the request information to any microservice instance until the request information is forwarded to the target grayscale instance in the next routing microservice if it is determined according to the grayscale instance list that the next routing microservice does not include the target grayscale instance.
11. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the grayscale rule configuration method as described in claim 1, or the grayscale routing method as described in any one of claims 2-5.
12. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the grayscale rule configuration method according to claim 1, or the grayscale routing method according to any one of claims 2-5.
Citation Information
Patent Citations
Method for issuing application gray level, device and storage medium
CN107145347A
Method, device and system for service grayscale processing and routing server
CN108494867A
User account opening method, system and storage medium
CN109460841A
Micro-service gray release method and device, computer equipment and storage medium
CN109739552A
Micro-service engine based on proxy mode
CN109981789A
