Server gray release method, device, equipment and medium
By intercepting client requests on the data plane side car agent of the service mesh and matching them with the routing policy rules, the service-side grayscale release is realized, which solves the problem that grayscale release depends on client grid in the existing technology, and improves the flexibility and reliability of grayscale release.
Patent Information
- Application Number
- CN202510302676.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-24
AI Technical Summary
In the prior art, grayscale publishing capabilities rely on the client's grid traffic distribution capabilities, resulting in the incomplete or evolution of the client, the cost of upgrading the SDK is high and the cycle is long, and the grayscale-related capabilities are integrated on the client's grid, and the service caller needs to configure the grid to achieve grayscale publishing.
The data plane sidecar agent of the service mesh intercepts the client's inbound request traffic, extracts the feature identifiers in the request, and matches the routing policy rules configured by the service mesh control plane, and distributes the traffic to multiple version instances of the target application based on the matching results, realizing grayscale release of the server.
The grayscale release capability is reduced to the infrastructure level, achieving the universalization and flexibility of the grayscale release function, getting rid of the dependence on upstream callers, reducing the upgrade cost and cycle, and improving the reliability and control of grayscale release.
Smart Images

Figure CN120201071A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and relates to a method, device, equipment and medium for gray release of a server side. Background Art
[0002] Gray Release is a software deployment strategy used to gradually introduce new versions of software or functions into the production environment to reduce risks and timely discover potential problems. Its core idea is to achieve a smooth transition between the old and new versions to ensure the stability and reliability of the system.
[0003] Gray Release is usually achieved by controlling through the upstream client. Common implementation methods include: relying on the upstream load balancer, such as Nginx, to achieve a smooth upgrade of the service provider according to weights or traffic characteristics; or relying on the capabilities of the RPC (Remote Procedure Call) framework. Through the enhancement of the client's load strategy, traffic can be selectively corresponding according to traffic characteristics. For example, the traffic coloring of Dubbo can select nodes of the same color through traffic identifiers to achieve gray release. When evolving to the next-generation microservice framework service mesh, the existing solutions still rely on the grid traffic distribution capabilities of the client to cooperate with the gray release capabilities of the Provider (service provider). However, the above gray release implementation methods require the upstream of the link to have gray capabilities, and only then can the downstream achieve a smooth upgrade through the corresponding capabilities. Most rely on the client capabilities to perform gray release according to the traffic ratio or perform canary release according to traffic characteristics. However, during the imperfect or evolving process of the client, the cost of upgrading the SDK (Software Development Kit) is high and the cycle is long. Even when the microservice evolves to the service mesh, the gray-related capabilities are integrated on the grid of the client, that is, it is required that all service callers are configured with grids to achieve the gray release capabilities through the grid. Summary of the Invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, equipment and medium for gray release of a server side, so that the server side has gray release capabilities, and at the same time, the gray release capabilities are standardized and generalized by using service mesh technology.
[0005] To achieve the above purpose, the present invention is implemented by adopting the following technical solutions:
[0006] In a first aspect, the present invention provides a method for gray release of a server side, including:
[0007] Intercept the inbound request traffic of the client through the sidecar proxy of the data plane of the service mesh, and extract the feature identifier in the request. Among them, multiple version instances of the target application and corresponding routing policy rules are configured in the control plane of the service mesh, and the routing policy rules include gray policies;
[0008] Match the feature identifier with the routing policy rule;
[0009] Based on the matching result of the feature identifier and the routing policy rule, distribute the inbound request traffic of the client to multiple version instances corresponding to the target application according to the gray scale policy.
[0010] Further, the gray scale policy includes a traffic weight method and a request parameter method;
[0011] The traffic weight method is to gradually migrate the traffic by configuring the traffic weights of each version instance of the target application;
[0012] The request parameter method is to accurately route the traffic to the corresponding version instance of the target application according to specific parameters in the request.
[0013] Further, the gray scale policy supports dynamic update, including: receiving an externally input gray scale policy adjustment instruction through an API interface provided by the service mesh control plane, and / or adjusting the gray scale policy based on the running metric data of each version instance of the target application.
[0014] Further, the routing policy rule further includes a routing matching condition and a traffic request method.
[0015] Further, the traffic request method is redirection.
[0016] Further, a specific request header identifier is set in the redirection to avoid a dead loop in the redirection request.
[0017] Further, the gray scale policy supports dynamic update, including: receiving an externally input gray scale policy adjustment instruction through an API interface provided by the service mesh control plane, and / or adjusting the gray scale policy based on the running metric data of each version instance of the target application.
[0018] Further, the service mesh is istio, and the routing policy rule is formulated through VirtualService.
[0019] In a second aspect, the present invention also provides a server-side gray release device, and the device includes:
[0020] A client inbound request traffic interception module, configured to intercept the client's inbound request traffic through the sidecar proxy of the data plane of the service mesh, and extract the feature identifier in the request. Among them, multiple version instances of the target application and corresponding routing policy rules are configured in the control plane of the service mesh, and the routing policy rule includes a gray scale policy;
[0021] A routing policy matching module, configured to match the feature identifier with routing policy rules;
[0022] A client inbound request traffic distribution module, configured to distribute the inbound request traffic of the client to multiple version instances corresponding to the target application according to the grayscale policy based on the matching result of the feature identifier and the routing policy rules.
[0023] In a third aspect, the present invention further provides a computer device, including:
[0024] A memory, configured to store a computer program;
[0025] A processor, configured to execute the computer program to implement the steps of the server-side grayscale release method described above.
[0026] In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the program is executed by a processor to implement the steps of the server-side grayscale release method described above
[0027] Compared with the prior art, the beneficial effects achieved by the present invention:
[0028] The server-side grayscale release method provided by the present invention realizes the server-side grayscale release by adding routing capabilities in the Inbound direction of the service mesh, so that the inbound request traffic of the client is redirected after the routing is matched; in order to solve the problem of possible infinite loops in the redirected requests, the present invention adds specific request header identifiers to the requests within the mesh and the redirected requests. The present invention uses service mesh technology to sink the grayscale release capabilities to the infrastructure level, realizing the generalization of the grayscale release function. As long as the service mesh can support the corresponding communication protocol, there is no need to consider the development language or framework used in the application layer, getting rid of the dependence on the upstream callers, greatly enhancing the flexibility and reliability of the grayscale release, and making the upgrade of complex distributed systems more controllable and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic flowchart of a server-side grayscale release method provided by an embodiment of the present invention;
[0030] Figure 2 It is a schematic structural diagram of distributing inbound request traffic from a client in an embodiment of the present invention;
[0031] Figure 3 It is a schematic structural diagram of a server-side grayscale release device provided by an embodiment of the present invention;
[0032] Figure 4 It is an internal structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The same reference numerals in the drawings denote the same or similar components or parts. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. The embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. Without conflict, the technical features in the embodiments of the present application and the embodiments can be combined with each other.
[0034] The term "and / or" in this article is merely a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0035] Embodiment 1:
[0036] As Figure 1 and Figure 2 shown, an embodiment of the present invention provides a method for gray release of a server. Figure 1 is a schematic flowchart of the method for gray release of the server. This flowchart only shows the logical order of the method in this embodiment. On the premise of non-conflict, in other possible embodiments of the present invention, the steps shown or described can be completed in a different Figure 1 order from that shown.
[0037] The method for gray release of the server provided in this embodiment can be applied to a terminal and can be executed by a gray release device of the server. This device can be implemented in a software and / or hardware manner and can be integrated in the terminal.
[0038] See Figure 1 , the method of the embodiment of the present invention specifically includes the following steps:
[0039] Step 1: Intercept the inbound request traffic of the client through the sidecar proxy of the data plane of the service mesh, and extract the feature identifier in the request. Among them, multiple version instances of the target application and corresponding routing policy rules are configured in the control plane of the service mesh, and the routing policy rules include a gray policy.
[0040] Service Mesh is an infrastructure layer used to handle communication between services. Common functions include traffic management, circuit breaking, monitoring, etc. Implementation products of Service Mesh include Istio, Linkerd, Envoy, and Conduit, etc. In the embodiment of the present invention, Istio is used as the implementation method of Service Mesh.
[0041] The data plane of the service mesh is responsible for handling all network communications between services. It runs beside each service instance through a sidecar proxy, intercepting the traffic in and out of the service. The control plane of the service mesh is responsible for configuring and managing the data plane. It provides functions such as service discovery, traffic management, policy control, and monitoring. The control plane usually communicates with the data plane through APIs to achieve the management and monitoring of services.
[0042] In the control plane of the present invention, multiple version instances of the target application and corresponding routing policy rules are configured. The routing policy rules include gray-scale policies, routing matching conditions, traffic request methods, etc.
[0043] As Figure 2 shown, the requests initiated by users (inbound request traffic from the client) do not go through a fine-grained load balancing policy by default. The traffic may be randomly or distributed to different versions of the Provider (such as v1 or v2) of new and old according to simple rules such as round-robin. Users cannot perceive or control which version their requests are assigned to.
[0044] Service meshes usually support routing capabilities in the outbound request traffic (Outbound) direction, while in the inbound request traffic (Inbound) direction, they perform traffic limiting and authentication capabilities. The present invention breaks through the limitations of this method, adding routing capabilities in the Inbound direction of the mesh, so that after the traffic matches the route, the request is redirected to achieve the ability of server-side gray-scale.
[0045] Specifically, the present invention configures routing in the Inbound direction through VirtualService.
[0046] The present invention intercepts the inbound request traffic of the client through a sidecar proxy and extracts the feature identifier in the request. The feature identifier is an identifiable attribute carried in the network request initiated by the client, used to describe the source, content, user identity, and behavior pattern of the request, etc.
[0047] Step 2: Match the feature identifier with the routing policy rules.
[0048] The feature identifier is used to match the routing matching conditions in the routing policy rules to determine the gray-scale policy and traffic request method of the inbound request traffic of the corresponding client.
[0049] Step 3: Based on the matching result of the feature identifier and the routing policy rules, distribute the inbound request traffic of the client to multiple version instances corresponding to the target application according to the gray-scale policy.
[0050] The grayscale policy includes a traffic weight method and a request parameter method.
[0051] The traffic weight method is to gradually migrate traffic by configuring the traffic weights of each version instance of the target application.
[0052] Take Figure 2 as an example. Suppose the traffic weight of the Provider of version v1 is 10%, and the traffic weight of the Provider of version v2 is 90%. Then, 90% of the inbound request traffic of the clients flowing into the Provider of version v1 is redirected to the Provider of version v2, and 10% of the inbound request traffic of the clients flowing into the Provider of version v2 is redirected to the Provider of version v1.
[0053] The request parameter method is to accurately route traffic to the corresponding target application version instance according to specific parameters in the request. The specific parameters can be Header, Cookie, user ID, etc., as long as they can play an identification role, and there is no limitation.
[0054] The grayscale policy of the present invention supports dynamic update, including: receiving an externally input grayscale policy adjustment instruction through the API interface provided by the service mesh control plane, and / or adjusting the grayscale policy based on the operation metric data of each version instance of the target application.
[0055] Among them, the traffic weight method can dynamically update the traffic weights of each version instance, and the request parameter method can dynamically update the targeted version instance of the client request traffic.
[0056] The operation metric data includes response success rate, request latency, system load metrics, etc. The grayscale policy of each version instance is dynamically adjusted according to the operation metric data to timely reduce the traffic distribution ratio of abnormal versions.
[0057] In addition, as Figure 2 shown, in order to solve the problem of possible dead loops in redirected requests, the present invention adds a specific request header (Header) identifier to the requests within the service mesh and the redirected requests. When performing route matching condition judgment on the server side, if the specific request identifier already exists, there is no need to perform the redirect logic processing, thus solving the dead loop problem.
[0058] Example 2:
[0059] Based on the same inventive concept as in Embodiment 1, an embodiment of the present invention further provides a server-side gray release device for implementing the above-mentioned server-side gray release method. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in the embodiments of the server-side gray release device provided below can refer to the limitations on the server-side gray release method in the foregoing text, and will not be elaborated here.
[0060] As Figure 3 shown, an embodiment of the present invention provides a server-side gray release device, including:
[0061] A client inbound request traffic interception module, configured to intercept the inbound request traffic of the client through the sidecar proxy of the data plane of the service mesh, and extract the feature identifier in the request. Among them, multiple version instances of the target application and corresponding routing policy rules are configured in the control plane of the service mesh, and the routing policy rules include a gray scale policy;
[0062] A routing policy matching module, configured to match the feature identifier with the routing policy rules;
[0063] A client inbound request traffic distribution module, configured to distribute the inbound request traffic of the client to multiple version instances corresponding to the target application according to the gray scale policy based on the matching result of the feature identifier and the routing policy rules.
[0064] Embodiment 3:
[0065] An embodiment of the present invention further provides a computer device, which may be a server, and its internal structure diagram may be as Figure 4 shown. This computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of this computer device is used to provide computing and control capabilities. The memory of this computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of this computer device is used for exchanging information between the processor and external devices. The communication interface of this computer device is used for communicating with external terminals through a network connection. When the computer program is executed by the processor, it implements the server-side gray release method in the foregoing embodiments.
[0066] Those skilled in the art can understand, Figure 4The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. Specifically, the computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different component layout.
[0067] Embodiment 4:
[0068] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the following method are implemented:
[0069] Intercept the inbound request traffic of the client through the sidecar proxy in the data plane of the service mesh, and extract the feature identifier in the request. Among them, multiple version instances of the target application and corresponding routing policy rules are configured in the control plane of the service mesh, and the routing policy rules include a gray-scale policy;
[0070] Match the feature identifier with the routing policy rules;
[0071] Based on the matching result of the feature identifier and the routing policy rules, distribute the inbound request traffic of the client to multiple version instances corresponding to the target application according to the gray-scale policy.
[0072] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0073] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0074] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one or more of the processes and / or blocks Figure 1 one or more of the processes and / or blocks Figure 1 specified in the block or blocks.
[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one or more of the processes and / or blocks Figure 1 one or more of the processes and / or blocks Figure 1 specified in the block or blocks.
[0076] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope of the present invention as protected by the claims. All of these are within the protection scope of the present invention.
Claims
1. A server-side grayscale publishing method, characterized in that: include: The client's inbound request traffic is intercepted by a sidecar proxy of the data plane of the service grid, and a feature identifier in the request is extracted, wherein the control plane of the service grid is configured with multiple version instances of the target application and corresponding routing policy rules, and the routing policy rules include a grayscale policy; Matching the feature identifier with the routing policy rule; Based on the matching result between the feature identifier and the routing policy rule, the inbound request traffic of the client is distributed to the multiple version instances corresponding to the target application according to the grayscale policy.
2. The server-side grayscale publishing method according to claim 1, characterized in that: The grayscale strategy includes a traffic weight method and a request parameter method; The traffic weight method is to gradually migrate traffic by configuring the traffic weight of each version instance of the target application; The request parameter method is to accurately route traffic to the corresponding target application version instance according to specific parameters in the request.
3. The server-side grayscale publishing method according to claim 2, characterized in that: The grayscale strategy supports dynamic updates, including: receiving grayscale strategy adjustment instructions input externally through an API interface provided by the service grid control plane, and / or adjusting the grayscale strategy based on operating indicator data of each version instance of the target application.
4. The server-side grayscale publishing method according to claim 1, characterized in that: The routing policy rules also include routing matching conditions and traffic request methods.
5. The server-side grayscale publishing method according to claim 4 is characterized in that: The traffic request mode is redirection.
6. The server-side grayscale publishing method according to claim 5, characterized in that: A specific request header identifier is set in the redirection to avoid an infinite loop in the redirection request.
7. The server-side grayscale publishing method according to claim 1, characterized in that: The service grid is istio, and the routing policy rules are formulated through VirtualService.
8. A server-side grayscale publishing device, characterized in that: include: A client inbound request traffic interception module is used to intercept the client's inbound request traffic through the sidecar proxy of the data plane of the service grid and extract the feature identifier in the request, wherein the control plane of the service grid is configured with multiple version instances of the target application and corresponding routing policy rules, and the routing policy rules include a grayscale policy; A routing policy matching module, used for matching the feature identifier with routing policy rules; The client inbound request traffic distribution module is used to distribute the client's inbound request traffic to multiple version instances corresponding to the target application according to the grayscale strategy based on the matching result of the feature identifier and the routing policy rule.
9. A computer device, characterized in that: include: Memory for storing computer programs; A processor, used to execute the computer program to implement the steps of the server-side grayscale publishing method described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the server-side grayscale publishing method described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Multi-strategy traffic grayscale distribution method and device, and storage medium
CN121193806A
Grayscale routing method and system based on IP network segment and URL subpath routing strategy
CN121396888A