Full-link gray level control method and device, equipment, storage medium and program product
By obtaining and applying target rules and virtual service rules in the microservice architecture, combined with the use of proxy layer and unique identifiers, full-link grayscale control is realized, solving the problem that traditional methods are difficult to achieve unified grayscale control under the microservice architecture, and reducing resource consumption and business intrusion.
Patent Information
- Application Number
- CN202411736505.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Under the microservice architecture, traditional grayscale control methods are difficult to achieve unified grayscale control of multiple services, and the existing technology performs poorly in terms of resource consumption, configuration difficulty, business intrusion and maintenance costs.
By obtaining the target rules and virtual service rules of the target service architecture, based on these rules and proxy layers, the target service is grayscale controlled, and by generating a unique identifier of the call link, the grayscale control information is transmitted to the remaining services on the call link to realize grayscale control of the entire link.
It realizes grayscale control of the full link in the microservice architecture, avoids resource consumption and configuration complexity, reduces business intrusion and maintenance costs, and supports some grayscale capabilities, allowing some services not to participate in grayscale.
Smart Images

Figure CN119583629A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a full-link grayscale control method, device, equipment, storage medium and program product. Background Art
[0002] With the promotion of microservice architecture, the number of services in the system is increasing, the call relationship is becoming more and more complex, and the requirements for grayscale control capabilities in the business iteration process are also getting higher and higher. Traditional service governance usually only focuses on grayscale control of a single service. Under the microservice architecture, the demand for unified grayscale control of multiple services in the microservice call chain is getting stronger and stronger. The existing technologies usually use physical environment isolation or business transformation to achieve logical environment isolation to achieve full-link grayscale capabilities, which performs poorly in terms of resource consumption, configuration difficulty, business invasiveness, and maintenance costs. Summary of the invention
[0003] Based on this, it is necessary to provide a full-link grayscale control method, device, equipment, storage medium and program product that can extend grayscale control to the entire link without intrusion and simple configuration to address the above technical problems.
[0004] In a first aspect, the present application provides a full-link grayscale control method, including:
[0005] Obtaining target rules and virtual service rules of the target service architecture, and performing grayscale control on the first target service based on the target rules, the virtual service rules, and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service, and a proxy layer corresponding to each service;
[0006] Obtaining grayscale control information of the first target service;
[0007] A unique identifier of the call link of the target service architecture is generated, and based on the unique identifier, the grayscale control information is transparently transmitted to the remaining services on the call link to implement grayscale control of all services in the target service architecture.
[0008] In one of the embodiments, the grayscale control of the first target service based on the target rule, the virtual service rule and the proxy layer of the first target service includes:
[0009] In a case where the first target service needs to receive a first grayscale control request, determining an access version of the first grayscale control request based on the target rule and the virtual service rule;
[0010] Based on the proxy layer, the first grayscale control request is forwarded to an application corresponding to the first target service of a corresponding access version, so as to implement grayscale control of the first target service.
[0011] In one of the embodiments, when the first grayscale control request matches the target rule, the access version includes a baseline version or a test version; when the first grayscale control request matches the virtual service rule, the access version includes a test version.
[0012] In one embodiment, the obtaining grayscale control information of the first target service includes:
[0013] Before the first grayscale control request is forwarded to the application corresponding to the first target service, the first grayscale control request is intercepted based on the proxy layer, and grayscale control information of the first grayscale control request is cached.
[0014] In one embodiment, the proxy layer includes a cache plug-in, and the caching of the grayscale control information of the first grayscale control request includes:
[0015] generating a link tracking header value based on the unique identifier;
[0016] A cache identifier is determined based on the link tracking header value, and the grayscale control information is cached based on the cache identifier.
[0017] In one of the embodiments, transparently transmitting the grayscale control information to the remaining services on the call link based on the unique identifier includes:
[0018] In the case where the first target service sends a new request to the second target service on the call link, obtaining the link tracking header value and the grayscale control information based on the proxy layer of the second target service, wherein the second target service is one of the remaining services on the call link;
[0019] forming a second grayscale control request based on the link tracking header value, the grayscale control information and the new request;
[0020] Based on the proxy layer of the second target service, the second grayscale control request is forwarded to an application corresponding to the second target service to implement grayscale control of the second target service.
[0021] In a second aspect, the present application also provides a full-link grayscale control device, including:
[0022] A first control module is used to obtain a target rule and a virtual service rule of the target service architecture, and perform grayscale control on the first target service based on the target rule, the virtual service rule and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service and a proxy layer corresponding to each service;
[0023] An acquisition module, used to acquire grayscale control information of the first target service;
[0024] The second control module is used to generate a unique identifier of the call link of the target service architecture, and based on the unique identifier, transparently transmit the grayscale control information to the remaining services on the call link to achieve grayscale control of all services in the target service architecture.
[0025] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0026] Obtaining target rules and virtual service rules of the target service architecture, and performing grayscale control on the first target service based on the target rules, the virtual service rules, and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service, and a proxy layer corresponding to each service;
[0027] Obtaining grayscale control information of the first target service;
[0028] A unique identifier of the call link of the target service architecture is generated, and based on the unique identifier, the grayscale control information is transparently transmitted to the remaining services on the call link to implement grayscale control of all services in the target service architecture.
[0029] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0030] Obtaining target rules and virtual service rules of the target service architecture, and performing grayscale control on the first target service based on the target rules, the virtual service rules, and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service, and a proxy layer corresponding to each service;
[0031] Obtaining grayscale control information of the first target service;
[0032] A unique identifier of the call link of the target service architecture is generated, and based on the unique identifier, the grayscale control information is transparently transmitted to the remaining services on the call link to implement grayscale control of all services in the target service architecture.
[0033] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0034] Obtaining target rules and virtual service rules of the target service architecture, and performing grayscale control on the first target service based on the target rules, the virtual service rules, and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service, and a proxy layer corresponding to each service;
[0035] Obtaining grayscale control information of the first target service;
[0036] A unique identifier of the call link of the target service architecture is generated, and based on the unique identifier, the grayscale control information is transparently transmitted to the remaining services on the call link to implement grayscale control of all services in the target service architecture.
[0037] The above-mentioned full-link grayscale control method, device, computer equipment, computer-readable storage medium and computer program product configure a proxy layer for each application in the target service architecture, and implement grayscale control of a single service based on virtual service rules and target rules; the grayscale control information is transparently transmitted in the call chain through a unique identifier, thereby realizing grayscale control of the entire link. This application uses a unique identifier to transparently transmit version control information in the call chain, which is completely transparent to the business, does not require independent deployment of resources, and can implement grayscale control without business transformation, which is more business-friendly. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 1 is a flow chart of a full-link grayscale control method according to an embodiment;
[0040] Figure 2 A schematic diagram of a prior art;
[0041] Figure 3 It is a schematic diagram of another prior art;
[0042] Figure 4 It is a schematic diagram of another prior art;
[0043] Figure 5 This is one of the sub-step flow charts of a full-link grayscale control method;
[0044] Figure 6 This is the second sub-step flow chart of a full-link grayscale control method;
[0045] Figure 7 This is a schematic diagram of the third sub-step flow of a full-link grayscale control method;
[0046] Figure 8 This is a fourth sub-step flow chart of a full-link grayscale control method;
[0047] Fig. 9 This is the fifth sub-step flow chart of a full-link grayscale control method;
[0048] Fig.10 is a flowchart of a full-link grayscale control method in a specific embodiment;
[0049] Fig.11 is a structural block diagram of a full-link grayscale control device in an embodiment;
[0050] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] In a microservice architecture, there are usually multiple microservices, and there is also an ingressgateway that exposes the microservice entrance to the outside world for external access. The architecture is as follows: Figure 2 As shown in the figure, external requests enter the microservice through the ingress gateway. The request link includes three applications (APP1, APP2, APP3), and a registration center for service discovery between microservices.
[0053] The business iteration process of the microservice architecture often involves more than one service. In order to ensure the stability of the iterative update, it is usually necessary to perform grayscale verification before going online, that is, first use a part of the traffic to enter the grayscale environment to verify whether the business function is normal, and then import all the traffic to the new version of the service. When graying microservices, there are some common requirements:
[0054] It is necessary to support unified grayscale control of services on the entire access link; support partial grayscale capabilities, allowing some services to access the production environment version without participating in grayscale. For single services, this problem is relatively simple. You can configure the grayscale policy at the ingress gateway (the ingress gateway is generally a seven-layer HTTP proxy with grayscale control capabilities), such as Figure 3 The request shown is forwarded to the production version by default, and the request whose header matches the grayscale version is forwarded to the grayscale version.
[0055] For scenarios involving multiple microservices, to achieve the grayscale capability of the entire microservice chain, the industry generally has the following processing methods:
[0056] Resource isolation: Figure 4 As shown in the figure, the production and grayscale environments are completely isolated at the resource deployment level (independent service deployment and registration center). Applications are routed to different environments at the ingress gateway by carrying different environment selection headers; the traffic of each environment is only accessed within the current environment. This solution requires a complete deployment of a set of microservices, including the microservice application itself and surrounding supporting components. It consumes a lot of resources, is complex to deploy, has high maintenance costs, and does not support some grayscale capabilities (some microservices do not participate in grayscale and access the production environment version).
[0057] Or Figure 5 Logical isolation shown: The production and grayscale environments reuse a set of application deployment resources and registration centers. In order to achieve service access isolation in different environments, the application needs to be modified. The service needs to be labeled when it is deployed (whether it belongs to the production or grayscale environment). The registration and discovery of the service needs to be modified to only register and discover in the environment corresponding to the service. This solution requires the registration center to support multi-environment isolation, is invasive to the business (supports multi-environment registration), and does not support some grayscale capabilities (some microservices do not participate in grayscale and access the production environment version).
[0058] In one embodiment, Figure 1 As shown, a full-link grayscale control method is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0059] Step 101, obtaining target rules and virtual service rules of the target service architecture, and performing grayscale control on the first target service based on the target rules, the virtual service rules and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, applications corresponding to each service and a proxy layer corresponding to each service;
[0060] Step 102, obtaining grayscale control information of the first target service;
[0061] Step 103, generate a unique identifier of the call link of the target service architecture, and based on the unique identifier, transparently transmit the grayscale control information to the remaining services on the call link to implement grayscale control of all services in the target service architecture.
[0062] Based on the above existing technical defects, this embodiment introduces service grid technology, which is a service governance technology that does not intrude on the business. Service governance is achieved by adding an agent to the application. The microservice architecture using service grid technology is as follows: Figure 6 shown.
[0063] Through the Sidecar Pattern automatic injection technology and traffic interception technology, the service governance capability without business awareness is realized. When multiple services using the service mesh technology communicate with each other, the request to the target service will be intercepted to the local proxy layer of the target service, and then forwarded to the corresponding local application; when the application needs to access the remaining services on the link, the traffic will also be intercepted to the local proxy layer first, and then forwarded to the target application. On the target application side, the traffic will be intercepted again to the local proxy layer, and so on.
[0064] Exemplarily, the present application implements the construction of the proxy layer through the sidecar mode. The sidecar mode is an architectural mode that adds a new abstract layer to the original business logic and is commonly used in microservices and containerized scenarios.
[0065] See also Figure 7 As the microservice architecture becomes more and more complex, the calls generated by a request are numerous and complex, and it is difficult to locate the problem when an exception occurs. Link tracing technology was born to solve this problem. Link tracing technology uses the same unique identifier (traceid) in a call chain. Each microservice uses this unique identifier to report observation data, which is finally aggregated on the link tracing observation platform. The topology of the call chain can be completely restored through the unique identifier and other information, and the time consumption, exceptions and other information of each link in the call chain can be understood.
[0066] In the above-mentioned full-link grayscale control method, a proxy layer is configured for each application in the target service architecture, and grayscale control of a single service is implemented based on virtual service rules and target rules; the grayscale control information is transparently transmitted in the call chain through a unique identifier, thereby achieving grayscale control of the entire link. This application uses a unique identifier to transparently transmit version control information in the call chain, which is completely transparent to the business, does not require independent deployment of resources, and can achieve grayscale control without business transformation, which is more business-friendly.
[0067] In an exemplary embodiment, grayscale control of the first target service is implemented based on target rules, virtual service rules and a proxy layer of the first target service, including: when the first target service needs to receive a first grayscale control request, judging the access version of the first grayscale control request based on the target rules and the virtual service rules; based on the proxy layer, forwarding the first grayscale control request to an application corresponding to the first target service of the corresponding access version, so as to implement grayscale control of the first target service.
[0068] In an exemplary embodiment, when the first grayscale control request matches the target rule, the access version includes a baseline version or a test version; when the first grayscale control request matches the virtual service rule, the access version includes a test version.
[0069] See also Figure 8 , using service grid, you can implement version and traffic control for a single microservice. For example, app1 has two versions, base and test. You need to define a destination rule (DestinationRule) for app1, which defines the base and test versions; then define a virtual service rule (VirtualService) for app1. When the request header matches the virtual service rule, it is routed to the test version.
[0070] Configure DestinationRule (destination rule) and VirtualService (virtual service rule) for services that require full-link grayscale control to implement grayscale control of a single service. Fig. 9 As shown in the figure below, the microservice has deployed a baseline version (base) and a gray version (grey). It is necessary to implement a request to access only the grey or base version. It is not required to deploy the base and grey versions of the service in isolation or use an independent registration center.
[0071] At this time, when accessing the application separately, the base version will be accessed when the header with the tag base is included, and the grey version will be accessed when the header with the tag grey is included. To achieve full-link grayscale control, it is also necessary to transparently transmit grayscale control information on the call chain. Among them, grayscale control information includes version control information. The definition of transparent transmission is: in the call chain, the version control information (such as the version number) of a request will be transparently transmitted from the previous link to the next link without being modified or ignored. This transmission mechanism ensures the consistency and integrity of the version control information in the entire call chain, which helps to track and manage the interaction between different versions of the application between various services.
[0072] In an exemplary embodiment, obtaining grayscale control information of a first target service includes:
[0073] Before the first grayscale control request is forwarded to the application corresponding to the first target service, the first grayscale control request is intercepted based on the proxy layer, and the grayscale control information of the first grayscale control request is cached.
[0074] In an exemplary embodiment, the proxy layer includes a cache plug-in to cache the grayscale control information of the first grayscale control request, including: generating a link tracking header value based on a unique identifier; determining a cache identifier based on the link tracking header value, and caching the grayscale control information based on the cache identifier.
[0075] When the first grayscale control request reaches the application APP1 corresponding to the first target service, the traffic is first intercepted by the service layer of APP1. The custom plug-in in APP1 caches the version control information. The cache key is the value of the link tracking header (that is, the unique identifier of the current call chain, which remains unchanged in this call, and has different unique identifiers for different calls). The cached value is the version control information, which is the value of the first grayscale control request header (base).
[0076] After being processed by the custom plug-in and other proxy layers, the request will be forwarded to the application (APP1), and the application will receive the link tracking header value and the first grayscale control request header.
[0077] By configuring plug-ins on the proxy layer, grayscale control of the entire link is achieved. Traffic label rules are configured for the service layer here. This rule is used to achieve transparent transmission of grayscale control information in the upstream and downstream of the call chain.
[0078] In this embodiment, the above configuration realizes the grayscale control of a single microservice and transparently transmits the grayscale control header on the call link. The final effect is to realize unified grayscale control of the entire link.
[0079] In an exemplary embodiment, transparently transmitting the grayscale control information to the remaining services on the call link based on the unique identifier includes:
[0080] When the first target service sends a new request to the second target service on the calling link, the proxy layer based on the second target service obtains the link tracking header value and grayscale control information, wherein the second target service is one of the remaining services on the calling link; forms a second grayscale control request based on the link tracking header value, the grayscale control information and the new request; and forwards the second grayscale control request to the application corresponding to the second target service based on the proxy layer of the second target service to implement grayscale control of the second target service.
[0081] Because the business is connected to link tracking, when the first target service (such as APP1) sends a request to the outside, it will carry the link tracking header, but will not carry the first grayscale control request header (this header is a custom header and has nothing to do with link tracking. The business does not need to pay attention to it, so it will not be transmitted in the call chain);
[0082] The request sent by APP1 to the outside is first intercepted by the local proxy layer of the service. The custom plug-in obtains the grayscale control information from the cache according to the link tracking header value in the request, and then carries the grayscale control information in the request sent to the outside. The local proxy layer will implement grayscale access to the next service APP2 based on the grayscale control information; when the request reaches APP2, the same processing will be performed, and this cycle will repeat in the entire call chain.
[0083] To explain the full-link grayscale control method of the present application in detail, a most detailed embodiment is described below:
[0084] Exemplarily, the target rules and virtual service rules may be defined according to the following logic:
[0085] DestinationRule:
[0086] host:app1;
[0087] Subsets:
[0088] -name: base;
[0089] matchLabels;
[0090] version: base;
[0091] -name: test;
[0092] matchLabels;
[0093] version: test.
[0094] Virtual Service Rules (VirtualService):
[0095] host: app1;
[0096] routes:
[0097] -match: x-traffic-tag=test;
[0098] destination: test.
[0099] For services that require full-link grayscale control, configure DestinationRule (destination rule) and VirtualService (virtual service) to implement grayscale control of a single service. For more information, see Fig. 9 And the following logic:
[0100] DestinationRule:
[0101] host:APP1;
[0102] Subsets;
[0103] -name: base;
[0104] matchLabels;
[0105] version: base;
[0106] -name: grey;
[0107] matchLabels:
[0108] version: grey.
[0109] VirtualService:
[0110] host: APP1;
[0111] routes:
[0112] -match: x-traffic-tag=base;
[0113] destination: base;
[0114] routes:
[0115] match: x-traffic-tag=grey;
[0116] destination: grey.
[0117] DestinationRule:
[0118] host:APP2;
[0119] Subsets;
[0120] -name: base;
[0121] matchLabels;
[0122] version: base;
[0123] -name: grey;
[0124] matchLabels:
[0125] version: grey.
[0126] VirtualService:
[0127] host: APP1;
[0128] routes:
[0129] -match: x-traffic-tag=base;
[0130] destination: base;
[0131] routes:
[0132] match: x-traffic-tag=grey;
[0133] destination: grey.
[0134] DestinationRule:
[0135] host:APP3;
[0136] Subsets;
[0137] -name: base;
[0138] matchLabels;
[0139] version: base;
[0140] -name: grey;
[0141] matchLabels:
[0142] version: grey.
[0143] VirtualService:
[0144] host: APP1;
[0145] routes:
[0146] -match: x-traffic-tag=base;
[0147] destination: base;
[0148] routes:
[0149] match: x-traffic-tag=grey;
[0150] destination: grey.
[0151] At this time, when accessing APP1, APP2, and APP3 separately, the base version will be accessed when the x-traffic-tag=base header is included, and the grey version will be accessed when the x-traffic-tag=grey header is included. To achieve grayscale control of the entire link, we also need to transparently transmit grayscale control information on the call chain, which is x-traffic-tag.
[0152] By configuring the self-developed plug-in on the sidecar, we can achieve grayscale control of the full-link collaboration. Here, we configure the traffic label rules for the sidecar. The rules are used to implement the transparent transmission of the x-traffic-tag header in the upstream and downstream of the call chain. For traffic label rules, see:
[0153] TrafficLabel:
[0154] host: APP1;
[0155] label:
[0156] header: x-traffic-tag;
[0157] trace-id:x-request-id.
[0158] TrafficLabel:
[0159] host: APP2;
[0160] label:
[0161] header: x-traffic-tag;
[0162] trace-id:x-request-id.
[0163] TrafficLabel:
[0164] host: APP3;
[0165] label:
[0166] header: x-traffic-tag;
[0167] trace-id: x-request-id.
[0168] From the above description, we can know that the above configuration realizes the grayscale control of a single microservice and transparently transmits the grayscale control header on the call link. The final effect is to realize unified grayscale control of the entire link. For example, if the current request carries the x-traffic-tag=base header, the request will flow in the base version of APP1, APP2, and APP3. When the request carries the x-traffic-tag=grey header, the request will flow in the grey version of APP1, APP2, and APP3.
[0169] Through the configuration of virtual service rules and target rules, grayscale control of a single microservice can be achieved. To achieve unified grayscale control of the entire link, the key is to transparently transmit grayscale control information on the call link; this capability can be achieved through custom plug-ins combined with link tracking capabilities. The overall architecture is as follows: Fig.10 .
[0170] The request steps are as follows:
[0171] When the client initiates a request, it carries a version control header, such as x-traffic-tag, and accesses the microservice through the Ingress gateway.
[0172] Ingress gateway accesses APP1. Here, the target rule and virtual service configuration of APP1 are combined to implement grayscale control of access to APP1. In the figure above, the base version of APP1 is accessed. At the same time, as a gateway, Ingress gateway will transparently transmit the user request header, including x-traffic-tag, and will also add the link tracking header x-request-id.
[0173] When the request reaches APP1, the traffic is first intercepted by the sidecar of APP1. The custom plug-in in APP1 caches the version control information. The cache key is the value of the x-request-id header (that is, the traceid of the current call chain, which remains unchanged in this call and has different traceids for different calls). The cached value is the version control information, which is the value of the x-traffic-tag header (base).
[0174] After being processed by the custom plug-in and other sidecars, the request is forwarded to the application (APP1). The application receives the x-request-id and the x-traffic-tag including the grayscale control information.
[0175] Because the business is connected to link tracking, when APP1 sends a request to the outside, it will carry the x-request-id header, but will not carry the x-traffic-tag (this header is a custom header and has nothing to do with link tracking. The business does not need to pay attention to it, so it will not be transmitted in the call chain);
[0176] The request sent by APP1 to the outside is first intercepted by the local sidecar. The custom plug-in obtains the value of x-traffic-tag from the cache according to the value of the x-request-id header in the request, and then carries the grayscale control information in the request sent to the outside, that is, x-traffic-tag: base. The local sidecar will implement grayscale access to the next service APP2 based on this header, that is, access the base version of APP2.
[0177] When the request reaches APP2, the same process will be performed, and this cycle will continue throughout the call chain.
[0178] The benefit of this embodiment is that the ability to transparently transmit version control information in the call chain is realized in the service grid in a non-intrusive way, and the grayscale control capability of the service grid native to a single service is combined to achieve unified grayscale control of the entire link.
[0179] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0180] Based on the same inventive concept, the embodiment of the present application also provides a full-link grayscale control device for implementing the full-link grayscale control method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more full-link grayscale control device embodiments provided below can refer to the limitations of the full-link grayscale control method above, and will not be repeated here.
[0181] In an exemplary embodiment, Fig.11 As shown, a full-link grayscale control device 200 is provided, including: a first control module 201, an acquisition module 202, and a second control module 203, wherein:
[0182] The first control module 201 is used to obtain the target rules and virtual service rules of the target service architecture, and perform grayscale control on the first target service based on the target rules, the virtual service rules and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service and a proxy layer corresponding to each service;
[0183] An acquisition module 202 is used to acquire grayscale control information of a first target service;
[0184] The second control module 203 is used to generate a unique identifier of the call link of the target service architecture, and based on the unique identifier, transparently transmit the grayscale control information to the remaining services on the call link to achieve grayscale control of all services in the target service architecture.
[0185] The first control module 201 is further used for:
[0186] In the case where the first target service needs to receive the first grayscale control request, determining the access version of the first grayscale control request based on the target rule and the virtual service rule;
[0187] Based on the proxy layer, the first grayscale control request is forwarded to the application corresponding to the first target service of the corresponding access version, so as to implement the grayscale control of the first target service.
[0188] The first control module 201 is further used for:
[0189] Before the first grayscale control request is forwarded to the application corresponding to the first target service, the first grayscale control request is intercepted based on the proxy layer, and the grayscale control information of the first grayscale control request is cached.
[0190] The first control module 201 is further used for:
[0191] generating a link tracking header value based on the unique identifier;
[0192] A cache identifier is determined based on a link tracking header value, and grayscale control information is cached based on the cache identifier.
[0193] The first control module 201 is further used for:
[0194] In the case where the first target service sends a new request to the second target service on the call link, the proxy layer based on the second target service obtains the link tracking header value and the grayscale control information, wherein the second target service is one of the remaining services on the call link;
[0195] forming a second grayscale control request based on the link tracking header value, the grayscale control information and the new request;
[0196] Based on the proxy layer of the second target service, the second grayscale control request is forwarded to the application corresponding to the second target service to implement the grayscale control of the second target service.
[0197] Each module in the above-mentioned full-link grayscale control device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0198] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.12As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. 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 the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a full-link grayscale control method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0199] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0200] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0201] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0202] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0203] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0204] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0205] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A full-link grayscale control method, characterized in that: The method comprises: Obtaining target rules and virtual service rules of a target service architecture, and performing grayscale control on the first target service based on the target rules, the virtual service rules, and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service, and a proxy layer corresponding to each service; Obtaining grayscale control information of the first target service; A unique identifier of the call link of the target service architecture is generated, and based on the unique identifier, the grayscale control information is transparently transmitted to the remaining services on the call link to implement grayscale control of all services in the target service architecture.
2. The method according to claim 1, characterized in that The implementing grayscale control of the first target service based on the target rule, the virtual service rule and the proxy layer of the first target service includes: In a case where the first target service needs to receive a first grayscale control request, determining an access version of the first grayscale control request based on the target rule and the virtual service rule; Based on the proxy layer, the first grayscale control request is forwarded to an application corresponding to the first target service of a corresponding access version, so as to implement grayscale control of the first target service.
3. The method according to claim 2, characterized in that When the first grayscale control request matches the target rule, the access version includes a baseline version or a test version; when the first grayscale control request matches the virtual service rule, the access version includes a test version.
4. The method according to claim 3, characterized in that The acquiring the grayscale control information of the first target service includes: Before the first grayscale control request is forwarded to the application corresponding to the first target service, the first grayscale control request is intercepted based on the proxy layer, and grayscale control information of the first grayscale control request is cached.
5. The method according to claim 4, characterized in that The proxy layer includes a cache plug-in, and the caching of the grayscale control information of the first grayscale control request includes: generating a link tracking header value based on the unique identifier; A cache identifier is determined based on the link tracking header value, and the grayscale control information is cached based on the cache identifier.
6. The method according to claim 5, characterized in that The transparently transmitting the grayscale control information to the remaining services on the call link based on the unique identifier includes: In the case where the first target service sends a new request to the second target service on the call link, obtaining the link tracking header value and the grayscale control information based on the proxy layer of the second target service, wherein the second target service is one of the remaining services on the call link; forming a second grayscale control request based on the link tracking header value, the grayscale control information and the new request; Based on the proxy layer of the second target service, the second grayscale control request is forwarded to an application corresponding to the second target service to implement grayscale control of the second target service.
7. A full-link grayscale control device, characterized in that: The device comprises: A first control module is used to obtain a target rule and a virtual service rule of a target service architecture, and perform grayscale control on the first target service based on the target rule, the virtual service rule and the proxy layer of the first target service, wherein the target service architecture includes an entry gateway, an application corresponding to each service and a proxy layer corresponding to each service; An acquisition module, used to acquire grayscale control information of the first target service; The second control module is used to generate a unique identifier of the call link of the target service architecture, and based on the unique identifier, transparently transmit the grayscale control information to the remaining services on the call link to achieve grayscale control of all services in the target service architecture.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Service gray release control method and device and computer equipment
CN112000348A
Front-end and rear-end separated gray release method, front-end server and configuration server
CN114125067A
Gray scale routing control method, gray scale routing component and computer equipment
CN115250233A
Micro-service gray release method, device and system, storage medium and electronic equipment
CN115314547A
Gray traffic forwarding method and device, equipment and medium
CN117354194A