Gray release method and device

By automatically adjusting the traffic ratio of new and old version codes, the problems of low manual adjustment efficiency and high error rate in the existing technology are solved, and a more efficient grayscale release process is achieved.

CN119645480AActive Publication Date: 2025-03-18ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411577314.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-03-18
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

The existing grayscale release process relies on technicians to manually adjust the traffic ratio of new and old versions of codes, which is inefficient and error-prone.

Method used

By obtaining the split traffic rules corresponding to the target microservice, the traffic ratio is automatically adjusted according to the operation data of the new version of the target microservice until the new version of the target microservice receives all traffic and completes grayscale release.

Benefits of technology

Automated processing reduces the possibility of human operational errors and improves the efficiency of grayscale release.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645480A_ABST
    Figure CN119645480A_ABST
Patent Text Reader

Abstract

The invention discloses a gray release method and device. And the gray release system obtains a flow segmentation rule corresponding to a target micro-service in the multiple micro-services. And then, according to the flow received by the new-version target micro-service corresponding to the target micro-service in the current time period, obtaining the operation data of the new-version target micro-service in the current time period. And finally, performing flow segmentation on the flow received by the target micro-service according to the operation data of the new-version target micro-service in the current time period and the flow segmentation rule corresponding to the target micro-service, and determining the flow received by the new-version target micro-service in the next time period. And further obtaining operation data of the new-version target micro-service in the next time period, and so on, until the new-version target micro-service receives all the traffic, so as to complete gray release. Therefore, the traffic proportion of the new version code and the old version code is automatically adjusted, the situation of errors caused by manual operation is avoided, and the efficiency of gray release is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more particularly to a method and device for grayscale publishing. Background Art

[0002] At present, many Internet products have a large number of active users. If product updates are released directly, it will cause immeasurable impact when product abnormalities occur.

[0003] Therefore, before the product is officially launched, the new version code of the application can be deployed to the real business environment at the same time as the old version code through the grayscale release method, so that some users continue to use the old version code, and other users start to use the new version code. If there are no abnormalities in the use of the new version code by users, the scope will be gradually expanded until all users use the new version code. In this way, timely feedback from users can be obtained, product functions can be improved, product quality can be improved, and the scope of users affected by product upgrades can be reduced.

[0004] However, the existing grayscale release process often relies on technicians to manually adjust the traffic ratio between the new and old versions of the code. This approach is not only inefficient, but also increases the possibility of errors due to manual operations. Summary of the invention

[0005] This specification provides a method, device, storage medium and electronic device for grayscale publishing to improve the efficiency of grayscale publishing.

[0006] This manual adopts the following technical solutions:

[0007] This specification provides a method for grayscale publishing, which is applied to a grayscale publishing system. The grayscale publishing system is a system using a microservice architecture. The grayscale publishing system deploys multiple microservices with a call relationship, and the microservices include a new version microservice and an old version microservice. The method includes:

[0008] Obtain the traffic splitting rules corresponding to the target microservice among multiple microservices;

[0009] Obtaining operation data of the new version target microservice in the current time period according to the traffic received by the new version target microservice corresponding to the target microservice in the current time period;

[0010] According to the running data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the running data of the new version target microservice in the next time period is further obtained. According to the running data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0011] Optionally, the operation data includes: call duration;

[0012] According to the operation data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the operation data of the new version target microservice in the next time period is further obtained. According to the operation data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice, including:

[0013] If the calling duration of the preset TP indicator of the new version target microservice in the current time period meets the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the calling duration of the preset TP indicator of the new version target microservice in the next time period is further obtained. According to the calling duration of the preset TP indicator of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0014] Optionally, the operation data includes: status information;

[0015] According to the operation data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the operation data of the new version target microservice in the next time period is further obtained. According to the operation data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice, including:

[0016] If the status information returned by the new version target microservice corresponding to the target microservice in the current time period meets the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the status information returned by the new version target microservice in the next time period is further obtained. According to the status information returned by the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0017] Optionally, a first Envoy gateway is deployed between the grayscale release system and the external network;

[0018] Before obtaining the traffic splitting rule corresponding to the target microservice among the multiple microservices, the method further includes:

[0019] Identify whether the multiple microservices are in the blacklist, and if not, set to-be-deployed tags for the multiple microservices that are not in the blacklist;

[0020] Based on the to-be-deployed labels of the multiple microservices, deploy second Envoy gateways corresponding to the multiple microservices, so that the multiple microservices receive and send traffic based on the second Envoy gateway.

[0021] Optionally, before obtaining the traffic splitting rule corresponding to the target microservice among the multiple microservices, the method further includes:

[0022] Adding a prohibited traffic flag to the new version microservices of the multiple microservices;

[0023] According to a preset initial traffic splitting ratio, traffic received by the multiple microservices is split, and traffic received by the new version microservices of the multiple microservices and traffic received by the old version microservices of the multiple microservices are determined;

[0024] Get the traffic splitting rules corresponding to the target microservice among multiple microservices, including:

[0025] A traffic splitting rule corresponding to a target microservice among the multiple microservices is obtained, and a prohibited traffic identifier on a new version microservice of the multiple microservices is removed.

[0026] Optionally, the method further comprises:

[0027] After the new version target microservice receives all traffic, suspend the old version target microservice;

[0028] Detect whether the new version target microservice is abnormal. If so, all traffic received by the target microservice is divided to the old version target microservice.

[0029] Optionally, the microservice architecture is built based on Kubernetes and uses Istio for traffic management.

[0030] This specification provides a grayscale publishing device, which is applied to a grayscale publishing system. The grayscale publishing system is a system using a microservice architecture. The grayscale publishing system deploys multiple microservices with a call relationship, and the microservices include a new version microservice and an old version microservice. The device includes:

[0031] An acquisition module, used to acquire a traffic splitting rule corresponding to a target microservice among multiple microservices;

[0032] An obtaining module, used to obtain the operation data of the new version target microservice in the current time period according to the traffic received by the new version target microservice corresponding to the target microservice in the current time period;

[0033] The calculation module is used to divide the traffic received by the target microservice according to the operation data of the new version target microservice in the current time period and the traffic division rule corresponding to the target microservice, determine the traffic received by the new version target microservice in the next time period, and further calculate the operation data of the new version target microservice in the next time period, and divide the traffic received by the target microservice according to the operation data of the new version target microservice in the next time period and the traffic division rule corresponding to the target microservice, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0034] This specification provides an electronic device, including a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;

[0035] The memory stores machine-readable instructions, and the processor executes the above-mentioned grayscale publishing method by calling the machine-readable instructions.

[0036] This specification provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above-mentioned grayscale release method is implemented.

[0037] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0038] In this specification, the grayscale release system can automatically adjust the traffic ratio of the new and old versions of the code according to the operating data of the new version of the target microservice and the traffic segmentation rules corresponding to the target microservice. This avoids errors caused by human operations and improves the efficiency of grayscale release. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0040] Figure 1 is a flowchart of a method for grayscale publishing shown in an exemplary embodiment;

[0041] Figure 2 is a schematic diagram of traffic segmentation shown in an exemplary embodiment;

[0042] Figure 3 is a schematic diagram of a gateway deployment shown in an exemplary embodiment;

[0043] Figure 4 is a flowchart of a grayscale release shown in an exemplary embodiment;

[0044] Figure 5 is a structural diagram of an electronic device where a grayscale publishing device is located, shown in an exemplary embodiment;

[0045] Figure 6 It is a structural diagram of a grayscale publishing device shown in an exemplary embodiment. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0047] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0048] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the relevant technologies involved in the embodiments of this specification are briefly described below.

[0049] Kubernetes: Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services that facilitates declarative configuration and automation. Kubernetes has a large and rapidly growing ecosystem. Services, support, and tools for Kubernetes are widely available.

[0050] Istio: An open source service mesh that provides the infrastructure required to run and manage distributed microservices architectures.

[0051] Sidecar: Istio will inject a sidecar into the specified service as a network proxy to intercept inbound and outbound traffic.

[0052] Envoy: It is an L7 proxy and communication bus designed for large modern SOA (service-oriented architecture) architectures, with small size and high performance.

[0053] At present, through the grayscale release method, the new version code of the application is deployed to the real business environment at the same time as the old version code, so that some users continue to use the old version code, and other users start to use the new version code. If there are no abnormalities in the use of the new version code by users, the scope is gradually expanded until all users use the new version code. In this way, timely feedback from users can be obtained, product functions can be improved, product quality can be improved, and the scope of users affected by product upgrades can be reduced.

[0054] However, the existing grayscale release process often relies on technicians to manually adjust the traffic ratio between the new and old versions of the code. This approach is not only inefficient, but also increases the possibility of errors due to manual operations.

[0055] Based on this, this specification proposes a technical solution that automatically adjusts the traffic ratio of the new and old versions of the code based on the operating data of the new version of the target microservice and the traffic segmentation rules corresponding to the target microservice. This avoids errors caused by human operations and improves the efficiency of grayscale release.

[0056] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0057] Figure 1 The following is a flowchart of a method for grayscale release shown in an exemplary embodiment, wherein the method specifically includes the following steps:

[0058] S100: Obtain a traffic splitting rule corresponding to a target microservice among multiple microservices.

[0059] S102: Obtaining operation data of the new version target microservice in the current time period according to the traffic received by the new version target microservice corresponding to the target microservice in the current time period.

[0060] S104: According to the operation data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the operation data of the new version target microservice in the next time period is further calculated. According to the operation data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0061] In the embodiment of this specification, the grayscale release system is a system using a microservice architecture, and the microservice architecture can be built based on Kubernetes. Kubernetes can be deployed in a microserver cluster, which is composed of multiple microserver hardware, each of which has an operating system installed.

[0062] Among them, the gray release system deploys multiple microservices with calling relationships. For example, there are chain calls between microservice A, microservice B, and microservice C. Microservice A and microservice B need to be called in sequence before calling microservice C. In addition, microservices include new version microservices and old version microservices. For example, microservice A includes: old version V1, new version V2. Similarly, microservice B includes: old version V1, new version V2. Microservice C includes: old version V1, new version V2.

[0063] In actual applications, the existing grayscale release process often relies on technicians to manually adjust the traffic ratio between the new and old versions of the code. This approach is not only inefficient, but also increases the possibility of errors due to manual operations.

[0064] In the embodiment of the present specification, the grayscale release system can obtain a traffic splitting rule corresponding to a target microservice among multiple microservices. The traffic splitting rule mentioned here can refer to allocating a proportion of traffic corresponding to the set rule to the new version of the microservice when the running data of the new version of the microservice meets the set rule.

[0065] Then, the grayscale release system can obtain the operation data of the new version of the target microservice in the current time period based on the traffic received by the new version of the target microservice corresponding to the target microservice in the current time period. The operation data mentioned here may include: call duration, status information and other data.

[0066] Next, the grayscale release system can split the traffic received by the target microservice according to the operating data of the new version of the target microservice in the current time period and the traffic splitting rules corresponding to the target microservice, determine the traffic received by the new version of the target microservice in the next time period, and further obtain the operating data of the new version of the target microservice in the next time period, and split the traffic received by the target microservice according to the operating data of the new version of the target microservice in the next time period and the traffic splitting rules corresponding to the target microservice, and so on, until the new version of the target microservice receives all the traffic to complete the grayscale release of the new version of the target microservice. Figure 2 shown.

[0067] Figure 2 It is a schematic diagram of a grayscale release shown in an exemplary embodiment.

[0068] exist Figure 2 In the example, there are chain calls between microservices A, B, and C. Microservice A includes: old version microservice A-V1, new version microservice A-V2. Similarly, microservice B includes: old version microservice B-V1, new version microservice B-V2. Microservice C includes: old version microservice C-V1, new version microservice C-V2.

[0069] The grayscale release system can divide the traffic of microservice A, microservice B, and microservice C according to the preset initial traffic division ratio. For example, the traffic ratio of the old version microservice A-V1, the old version microservice B-V1, and the old version microservice C-V1 is 90%, and the traffic ratio of the new version microservice A-V2, the new version microservice B-V2, and the new version microservice C-V2 is 10%.

[0070] If the running data of the new version microservice A-V2 in the next time period meets the traffic splitting rules corresponding to microservice A, the traffic ratio of the new version microservice A-V2 can be adjusted to 30%. Similarly, the traffic ratios of the new version microservice B-V2 and the new version microservice C-V2 are adjusted, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0071] From the above embodiments, it can be seen that the grayscale release system can automatically adjust the traffic ratio of the new and old versions of the code according to the operation data of the new version of the target microservice and the traffic segmentation rules corresponding to the target microservice. Thus, errors caused by human operation are avoided and the efficiency of grayscale release is improved.

[0072] It should be noted that when the traffic passes through the new version of the microservice, a label corresponding to the new version of the microservice will be added to the traffic. Therefore, the traffic can be tracked through the label, which is convenient for traffic management and traffic monitoring. For example, when the traffic passes through the new version of the microservice A-V2, the label corresponding to the new version of the microservice A-V2 is added to the traffic. Then, when the traffic passes through the new version of the microservice B-V2, the label corresponding to the new version of the microservice B-V2 is added to the traffic. Finally, the traffic received by the new version of the microservice C-V2 includes the label corresponding to the new version of the microservice A-V2 and the label corresponding to the new version of the microservice B-V2, so that it is known that the traffic has passed through the new version of the microservice A-V2 and the new version of the microservice B-V2.

[0073] In the embodiment of this specification, the operation data may include: call duration.

[0074] If the call duration of the preset percentage TP (Top Percentile) indicator of the new version target microservice in the current time period meets the traffic segmentation rules corresponding to the target microservice, the grayscale release system can segment the traffic received by the target microservice, determine the traffic received by the new version target microservice in the next time period, and further obtain the call duration of the preset TP indicator of the new version target microservice in the next time period. And according to the call duration of the preset TP indicator of the new version target microservice in the next time period and the traffic segmentation rules corresponding to the target microservice, the traffic received by the target microservice is segmented, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0075] Among them, the TP indicator can be used to describe the value that exceeds a specified percentage in a set of data. For example, the call duration of TP90 refers to the call duration at the 90th percentile among the multiple call durations in the statistical period sorted from small to large. Similarly, the call duration of TP50 refers to the call duration at the 50th percentile among the multiple call durations in the statistical period sorted from small to large. Total times * number of indicators = value of the corresponding TP indicator.

[0076] For example, when the preset TP indicator is TP99, the traffic splitting rules may include: when the call duration of the TP99 indicator of the new version target microservice is at (10, 50) ms, 50% of the traffic is allocated to the new version target microservice. When the call duration of the TP99 indicator of the new version target microservice is at (0, 10) ms, 100% of the traffic is allocated to the new version target microservice.

[0077] If the call duration of the TP99 indicator of the new version target microservice in the current time period is 23ms, which meets the traffic splitting rule, 50% of the traffic is allocated to the new version target microservice.

[0078] If it is further obtained that the call time of the TP99 indicator of the new version target microservice in the next time period is 9ms, the traffic splitting rule is met, and 100% of the traffic is allocated to the new version target microservice to complete the grayscale release of the new version target microservice.

[0079] In the embodiment of this specification, the operation data may also include: status information.

[0080] If the status information returned by the new version of the target microservice corresponding to the target microservice in the current time period meets the traffic splitting rules corresponding to the target microservice, the grayscale release system can split the traffic received by the target microservice, determine the traffic received by the new version of the target microservice in the next time period, and further obtain the status information returned by the new version of the target microservice in the next time period. According to the status information returned by the new version of the target microservice in the next time period and the traffic splitting rules corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version of the target microservice receives all the traffic to complete the grayscale release of the new version of the target microservice.

[0081] The status information may refer to a status code, for example, 200 indicates a successful request, 404 indicates a resource not found, 500 indicates a server error, and the like.

[0082] For example, the traffic splitting rule may include: if the status code in the status information returned by the new version target microservice is that the proportion of successful requests exceeds 90%, 50% of the traffic is allocated to the new version target microservice. If the status code in the status information returned by the new version target microservice is that the proportion of successful requests exceeds 99%, 100% of the traffic is allocated to the new version target microservice.

[0083] If the status code in the status information returned by the new version target microservice in the current time period is that the proportion of successful requests exceeds 90%, and the traffic splitting rule is met, 50% of the traffic is allocated to the new version target microservice.

[0084] If it is further obtained that the status code in the status information returned by the new version of the target microservice in the next time period shows that the proportion of successful requests exceeds 90%, the traffic splitting rule is met, and 100% of the traffic is allocated to the new version of the target microservice to complete the grayscale release of the new version of the target microservice.

[0085] It should be noted that this specification does not limit the traffic splitting rules.

[0086] In practical applications, north-south traffic usually refers to traffic from external networks into the system, and traffic from the system to external networks. It usually involves security, authentication, and authorization requirements. East-west traffic usually refers to traffic between microservices within the system. It usually involves service discovery, load balancing, fault recovery, and fine-grained traffic control requirements.

[0087] Therefore, in a microservice architecture, different technologies are usually used to manage north-south traffic and east-west traffic. For example, NGINX is used to manage north-south traffic, and Kong API Gateway is used to manage east-west traffic. Another example is to use NGINX to manage north-south traffic and Kafka to manage east-west traffic. However, the combination of different technologies will increase the difficulty of development and the complexity of operation and maintenance, and seamless collaboration between different technologies is often difficult to achieve. Furthermore, the above technologies also require technicians to modify the original code, which will increase development time and resource consumption.

[0088] In the embodiments of this specification, the grayscale release system can use Istio for traffic management. Istio can protect the communication between microservices through authentication and authorization, and configure and control the communication between microservices through failover, fault injection and routing rules.

[0089] Istio can deploy a first Envoy gateway between the grayscale release system and the external network, and deploy a second Envoy gateway corresponding to multiple microservices in the grayscale release system. Figure 3 shown.

[0090] Figure 3 It is a schematic diagram of a gateway deployment shown in an exemplary embodiment.

[0091] exist Figure 3 In the example, traffic between the old version microservice A-V1, the new version microservice A-V2, the old version microservice B-V1, the new version microservice B-V2, the old version microservice C-V1, and the new version microservice C-V2 is managed through the second Envoy gateway. Traffic between the grayscale release system and the external network is managed through the first Envoy gateway.

[0092] As can be seen from the above embodiments, the second Envoy gateway corresponding to each microservice manages the traffic between each microservice to control the communication between each microservice, so that the microservice itself does not need to modify the code, reducing development time and resource consumption. In addition, both north-south traffic and east-west traffic use Envoy gateways, which reduces the difficulty of development and the complexity of operation and maintenance, and can also achieve seamless collaboration.

[0093] It should be noted that Istio is not dependent on any platform, which means it can run in a variety of environments, including cloud, local, Kubernetes, etc. For example, microservice deployment on Kubernetes, microservices running on a single virtual machine, etc.

[0094] In actual applications, core microservices often undertake critical service logic. Any changes may have a significant impact on the operation of the entire system. Updating core microservices may introduce new risks. Therefore, core microservices are included in blacklist management. This practice ensures that these core microservices will not be affected by updates that have not been fully tested, thereby protecting the entire system from potential negative impacts.

[0095] Of course, technicians can also determine other microservices that need to be added to the blacklist based on the service logic.

[0096] In the embodiment of the present specification, the grayscale release system can identify whether multiple microservices are in the blacklist, and if not, set the to-be-deployed tags for the multiple microservices that are not in the blacklist.

[0097] Then, the grayscale release system can deploy a second Envoy gateway corresponding to the multiple microservices based on the to-be-deployed tags of the multiple microservices, so that the multiple microservices receive and send traffic based on the second Envoy gateway.

[0098] It can be seen from the above embodiments that traffic management of microservices is performed through the second Envoy gateway, which reduces the risk of new versions of microservices and improves the stability and reliability of the system.

[0099] In actual applications, the new version of microservices may have undiscovered problems or defects. If the new version of the service receives traffic without sufficient testing and verification, it may cause system instability and affect user experience.

[0100] In the embodiment of the present specification, the grayscale release system can add a prohibited traffic flag to a new version of a plurality of microservices.

[0101] Then, the grayscale release system can divide the traffic received by multiple microservices according to the preset initial traffic division ratio, and determine the traffic received by the new version microservices of the multiple microservices and the traffic received by the old version microservices of the multiple microservices.

[0102] Next, after obtaining the traffic segmentation rule corresponding to the target microservice among the multiple microservices, the grayscale release system can remove the prohibited traffic identifiers on the new version microservices of the multiple microservices.

[0103] It can be seen from the above embodiments that the grayscale release system can control the initial traffic ratio received by the new and old versions of microservices, thereby reducing the risks that may be brought by the new version of microservices.

[0104] In actual applications, after the new version of the microservice receives all the traffic, there is still a risk of anomalies. If the old version of the microservice is removed, once a problem occurs in the new version of the microservice, it may cause the entire service to be interrupted, thus affecting the user experience.

[0105] In the embodiment of the present specification, the grayscale release system can suspend the old version target microservice after the new version target microservice receives all traffic.

[0106] Then, the grayscale release system can detect whether there is an abnormality in the new version of the target microservice. If so, all the traffic received by the target microservice will be split to the old version of the target microservice.

[0107] It can be seen from the above embodiments that when an exception occurs in the new version microservice, the traffic can be switched back to the old version microservice, thereby avoiding the degradation of user experience caused by service interruption.

[0108] Figure 4 The figure is a flowchart of a grayscale release shown in an exemplary embodiment.

[0109] exist Figure 4 In the grayscale release system, traffic prohibition flags can be added to new versions of multiple microservices.

[0110] Secondly, according to the preset initial traffic splitting ratio, the traffic received by the multiple microservices is split, the traffic received by the new version microservices of the multiple microservices and the traffic received by the old version microservices of the multiple microservices are determined, and the prohibited traffic marks on the new version microservices of the multiple microservices are removed.

[0111] Then, the split traffic rules corresponding to the target microservice in the multiple microservices are obtained and sent to the Collector in the second Envoy gateway corresponding to the multiple microservices. The Collector can be a plug-in running in Envoy for collecting request indicators.

[0112] Next, the grayscale release system can automatically adjust the traffic ratio of the new and old versions of the code based on the operating data of the new version of the target microservice and the traffic splitting rules corresponding to the target microservice.

[0113] Finally, the grayscale release system can suspend the old version of the target microservice after the new version of the target microservice receives all the traffic. When an exception occurs in the new version of the microservice, the traffic is switched back to the old version of the microservice.

[0114] From the above method, it can be seen that the grayscale release system can automatically adjust the traffic ratio of the new and old versions of the code according to the running data of the new version of the target microservice and the traffic splitting rules corresponding to the target microservice. This avoids errors caused by human operation and improves the efficiency of grayscale release.

[0115] In addition, Istio can deploy the first Envoy gateway between the grayscale release system and the external network, and deploy the second Envoy gateway corresponding to the multiple microservices in the grayscale release system. This makes it unnecessary to modify the code of the microservices themselves, reducing development time and resource consumption. In addition, Envoy gateways are used for both north-south traffic and east-west traffic, reducing the difficulty of development and the complexity of operation and maintenance, and allowing seamless collaboration.

[0116] Corresponding to the above-mentioned embodiment of the method for grayscale publishing, this specification also provides an embodiment of a device for grayscale publishing.

[0117] See also Figure 5 , Figure 5 It is a structural diagram of an electronic device in which a grayscale publishing device is located, which is shown as an exemplary embodiment. At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and of course may also include other required hardware. One or more embodiments of this specification can be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0118] See also Figure 6 , Figure 6 is a structural diagram of a grayscale release device shown in an exemplary embodiment. The grayscale release device can be micro-serviced as follows: Figure 5 In the electronic device shown in the figure, the technical solution of this specification is implemented. The device may include:

[0119] An acquisition module 600 is used to acquire a traffic splitting rule corresponding to a target microservice among multiple microservices;

[0120] Obtaining module 602, for obtaining the operation data of the new version target microservice in the current time period according to the traffic received by the new version target microservice corresponding to the target microservice in the current time period;

[0121] The calculation module 604 is used to split the traffic received by the target microservice according to the operation data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, determine the traffic received by the new version target microservice in the next time period, and further calculate the operation data of the new version target microservice in the next time period, and split the traffic received by the target microservice according to the operation data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0122] Optionally, the operating data includes: call duration; the calculation module 604 is specifically used to split the traffic received by the target microservice if the call duration of the preset TP indicator of the new version target microservice in the current time period meets the traffic splitting rule corresponding to the target microservice, determine the traffic received by the new version target microservice in the next time period, and further obtain the call duration of the preset TP indicator of the new version target microservice in the next time period, and split the traffic received by the target microservice according to the call duration of the preset TP indicator of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0123] Optionally, the operating data includes: status information; the calculation module 604 is specifically used to split the traffic received by the target microservice if the status information returned by the new version target microservice corresponding to the target microservice in the current time period meets the traffic splitting rule corresponding to the target microservice, determine the traffic received by the new version target microservice in the next time period, and further obtain the status information returned by the new version target microservice in the next time period, and split the traffic received by the target microservice according to the status information returned by the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

[0124] Optionally, the acquisition module 600 deploys a first Envoy gateway between the grayscale release system and the external network; it is also specifically used to identify whether the multiple microservices are in the blacklist, and if not, set to-be-deployed labels for the multiple microservices that are not in the blacklist; based on the to-be-deployed labels of the multiple microservices, deploy a second Envoy gateway corresponding to the multiple microservices, so that the multiple microservices receive and send traffic based on the second Envoy gateway.

[0125] Optionally, the acquisition module 600 is further specifically used to add a prohibited traffic identifier on the new version microservices of the multiple microservices; perform traffic segmentation on the traffic received by the multiple microservices according to a preset initial traffic segmentation ratio, determine the traffic received by the new version microservices of the multiple microservices and the traffic received by the old version microservices of the multiple microservices; obtain a traffic segmentation rule corresponding to a target microservice among the multiple microservices, and remove the prohibited traffic identifier on the new version microservice of the multiple microservices.

[0126] Optionally, the computing module 604 is further configured to suspend the old version target microservice after the new version target microservice receives all traffic; detect whether the new version target microservice has an abnormality, and if so, divide all traffic received by the target microservice to the old version target microservice.

[0127] Optionally, the microservice architecture is built based on Kubernetes and uses Istio for traffic management.

[0128] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0129] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.

[0130] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0131] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.

[0132] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0133] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A method for grayscale publishing, the method being applied to a grayscale publishing system, the grayscale publishing system being a system adopting a microservice architecture, the grayscale publishing system deploying a plurality of microservices having a call relationship, the microservices including a new version microservice and an old version microservice; the method comprising: Obtain the traffic splitting rules corresponding to the target microservice among multiple microservices; Obtaining operation data of the new version target microservice in the current time period according to the traffic received by the new version target microservice corresponding to the target microservice in the current time period; According to the running data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the running data of the new version target microservice in the next time period is further obtained. According to the running data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

2. The method according to claim 1, characterized in that The operation data includes: call duration; According to the operation data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the operation data of the new version target microservice in the next time period is further obtained. According to the operation data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice, including: If the calling duration of the preset TP indicator of the new version target microservice in the current time period meets the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the calling duration of the preset TP indicator of the new version target microservice in the next time period is further obtained. According to the calling duration of the preset TP indicator of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

3. The method according to claim 1, characterized in that The operation data includes: status information; According to the operation data of the new version target microservice in the current time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the operation data of the new version target microservice in the next time period is further obtained. According to the operation data of the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice, including: If the status information returned by the new version target microservice corresponding to the target microservice in the current time period meets the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, the traffic received by the new version target microservice in the next time period is determined, and the status information returned by the new version target microservice in the next time period is further obtained. According to the status information returned by the new version target microservice in the next time period and the traffic splitting rule corresponding to the target microservice, the traffic received by the target microservice is split, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

4. The method according to claim 1, characterized in that A first Envoy gateway is deployed between the grayscale release system and the external network; Before obtaining the traffic splitting rule corresponding to the target microservice among the multiple microservices, the method further includes: Identify whether the multiple microservices are in the blacklist, and if not, set to-be-deployed tags for the multiple microservices that are not in the blacklist; Based on the to-be-deployed labels of the multiple microservices, deploy second Envoy gateways corresponding to the multiple microservices, so that the multiple microservices receive and send traffic based on the second Envoy gateway.

5. The method according to claim 1, characterized in that Before obtaining the traffic splitting rule corresponding to the target microservice among the multiple microservices, the method further includes: Adding a prohibited traffic flag to the new version microservices of the multiple microservices; According to a preset initial traffic splitting ratio, traffic received by the multiple microservices is split, and traffic received by the new version microservices of the multiple microservices and traffic received by the old version microservices of the multiple microservices are determined; Get the traffic splitting rules corresponding to the target microservice among multiple microservices, including: A traffic splitting rule corresponding to a target microservice among the multiple microservices is obtained, and a prohibited traffic identifier on a new version microservice of the multiple microservices is removed.

6. The method according to claim 1, characterized in that The method further comprises: After the new version target microservice receives all traffic, suspend the old version target microservice; Detect whether the new version target microservice is abnormal. If so, all traffic received by the target microservice is divided to the old version target microservice.

7. The method according to claim 1, characterized in that The microservice architecture is built on Kubernetes and uses Istio for traffic management.

8. A grayscale publishing device, characterized in that: The device is applied to a grayscale release system, which is a system adopting a microservice architecture. The grayscale release system deploys multiple microservices with a call relationship, and the microservices include a new version microservice and an old version microservice; the device includes: An acquisition module, used to acquire a traffic splitting rule corresponding to a target microservice among multiple microservices; An obtaining module, used to obtain the operation data of the new version target microservice in the current time period according to the traffic received by the new version target microservice corresponding to the target microservice in the current time period; The calculation module is used to divide the traffic received by the target microservice according to the operation data of the new version target microservice in the current time period and the traffic division rule corresponding to the target microservice, determine the traffic received by the new version target microservice in the next time period, and further calculate the operation data of the new version target microservice in the next time period, and divide the traffic received by the target microservice according to the operation data of the new version target microservice in the next time period and the traffic division rule corresponding to the target microservice, and so on, until the new version target microservice receives all the traffic to complete the grayscale release of the new version target microservice.

9. An electronic device, characterized in that: It includes a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 7 by calling the machine-readable instructions.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Gray release method and system, electronic equipment and storage medium

    CN114265607A

  • Application publishing method and device based on micro-service architecture, and computer equipment

    CN114385207A

  • Node publishing method and device and storage medium

    CN116466985A

  • Traffic distribution method and device suitable for gray release and computer equipment

    CN118250329A

  • Traffic isolation method, apparatus, and system, and computer-readable storage medium

    WO2024078025A1