A traffic verification method and system for microservice version release
By introducing traffic dyeing modules and traffic shunt modules into the microservice link, traffic verification of microservice version release is achieved, and resource waste in traditional methods is solved and efficient microservice version release verification is achieved.
Patent Information
- Application Number
- CN202211502124.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-11-28
AI Technical Summary
The traditional microservice version release method requires cloning a large number of resources when verifying the grayscale environment, resulting in waste of resources. Not all old versions of microservices need to be updated and released, resulting in waste of resources.
By introducing a traffic dyeing module and a traffic shunt module, the traffic verification of the microservice version is realized on the original microservice link, and the use of dyeing marks to separate and allocate traffic, so that the grayscale microservices required for grayscale verification only require a small amount of traffic for verification.
Verification of microservice version release can be completed without cloning an environment, which significantly saves resources and realizes efficient traffic verification of microservice version release.
Smart Images

Figure CN115834497B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of emerging information technologies, and more specifically, to a traffic verification method and system for microservice version release. Background Art
[0002] With the continuous development of software technologies, software development has attracted the key attention of many information technology enterprises, making software development booming. Microservices are a variant of the service-oriented architecture (SOA) architectural style in software development technologies, advocating dividing a single application into a group of small services. Each microservice is divided into layers according to business logic. Except for the first-layer microservices and the last-layer microservices, other microservices have their upstream microservices and downstream microservices. When a microservice version is released, it is necessary to divert traffic for verification. The current microservice can receive the traffic from the upstream microservice or, after executing a business event, forward the request to the downstream microservice. Through the coordination and cooperation between the upstream and downstream microservices, the verification of microservice version release is achieved.
[0003] In the traditional microservice version release method, in order to meet the calls of the new version's upstream and downstream microservices, the gray environment required for verification needs to clone an environment for the new version and conduct traffic verification for the gray microservices of the new version. However, not all old-version microservices need to be updated and released, that is, not all old-version microservices have corresponding gray microservices. Therefore, the newly cloned environment requires a large amount of traffic for verification to meet the verification requirements, resulting in resource waste. Summary of the Invention
[0004] In view of the above problems, this application is proposed to provide a traffic verification method and system for microservice version release to achieve the verification of microservice version release with a small amount of traffic.
[0005] To achieve the above objective, the following specific solutions are proposed:
[0006] A traffic verification method for microservice version release, which is applied to a traffic verification system. The traffic verification system includes a traffic coloring module, a traffic diversion module, and a microservice cluster. The microservice cluster includes several microservice groups differentiated by layers, and some of the microservice groups include gray microservices;
[0007] The method includes:
[0008] Obtain external traffic, and separate the external traffic through the traffic coloring module to obtain colored gray traffic with a coloring identifier;
[0009] Determine whether there are gray microservices in the microservice groups downstream of the traffic coloring module;
[0010] If so, use the colored grayscale traffic as the upper-level traffic, use the grayscale microservices in the microservice group downstream of the traffic coloring module as the target microservices, and transmit the upper-level traffic to the target microservices;
[0011] Determine whether there is a microservice group downstream of the target microservice;
[0012] If there is no microservice group downstream of the target microservice, determine the information that all grayscale microservices in the microservice cluster have completed traffic verification;
[0013] If there is a microservice group downstream of the target microservice, resolve the internal domain name of the target microservice to obtain the IP address of the traffic shunting module;
[0014] Based on the IP address, send a request instruction to the traffic shunting module to request the transmission of secondary traffic, where the secondary traffic is the traffic obtained by transforming the upper-level traffic after the target microservice processes the business event;
[0015] Determine whether the secondary traffic in the request instruction carries the coloring identifier marked on the colored grayscale traffic;
[0016] If so, determine whether there are grayscale microservices in the microservice group downstream of the target microservice;
[0017] If so, use the colored grayscale traffic with the coloring identifier in the secondary traffic as the new upper-level traffic, and transmit the upper-level traffic to the grayscale microservices in the microservice group downstream of the target microservice;
[0018] Use the grayscale microservices in the microservice group downstream of the target microservice as the new target microservices, and return to execute the step of determining whether there is a microservice group downstream of the target microservice.
[0019] Optionally, separating the external traffic through the traffic coloring module to obtain the colored grayscale traffic with the coloring identifier includes:
[0020] Load a preset traffic shunting algorithm into the traffic coloring module to obtain a traffic coloring module integrated with the algorithm;
[0021] Through the traffic coloring module integrated with the algorithm, separate the external traffic according to the total number of grayscale microservices in the microservice cluster to obtain the colored grayscale traffic;
[0022] Perform coloring processing on the colored grayscale traffic through the traffic coloring module integrated with the algorithm to obtain the colored grayscale traffic with the coloring identifier.
[0023] Optionally, each microservice group includes formal microservices, and the method further includes:
[0024] If there is no gray-scaled microservice in the microservice group downstream of the traffic coloring module, the official microservice in the microservice group downstream of the traffic coloring module is used as the target microservice, and the superior traffic is transmitted to the target microservice, and the step of determining whether there is a microservice group downstream of the target microservice is executed.
[0025] Optionally, each microservice group includes an official microservice, and the method further includes:
[0026] If the secondary traffic in the request instruction does not carry the coloring identifier marked on the colored gray-scaled traffic, the secondary traffic is transmitted to the official microservice in the microservice group downstream of the target microservice, and the information that the colored gray-scaled traffic with the coloring identifier has been consumed is determined.
[0027] Optionally, each microservice group includes an official microservice, and the method further includes:
[0028] If there is no gray-scaled microservice in the microservice group downstream of the target microservice, the colored gray-scaled traffic with the coloring identifier in the secondary traffic is used as the new superior traffic, and the superior traffic is transmitted to the official microservice in the microservice group downstream of the target microservice;
[0029] The official microservice in the microservice group downstream of the target microservice is used as the new target microservice, and the step of determining whether there is a microservice group downstream of the target microservice is returned for execution.
[0030] Optionally, the method further includes:
[0031] Obtain non-colored traffic, where the non-colored traffic is separated from the external traffic by the traffic coloring module;
[0032] Transmit the non-colored traffic to the official microservice in the target microservice group downstream of the traffic coloring module.
[0033] Optionally, the traffic verification system further includes a traffic shunting algorithm maintenance module to monitor the resource status of each gray-scaled microservice.
[0034] Optionally, the traffic verification system further includes a domain name system for each gray-scaled microservice to obtain its internal domain name when requesting its downstream microservice.
[0035] Optionally, the traffic verification system further includes a domain name resolution module for each gray-scaled microservice to resolve its internal domain name to the traffic shunting module when requesting its downstream microservice.
[0036] A traffic verification system for microservice version release, including a traffic coloring module, a traffic shunting module, and a microservice cluster. The microservice cluster includes several microservice groups differentiated by levels, and some microservice groups include gray-scale microservices;
[0037] The traffic coloring module obtains external traffic and separates the external traffic to obtain colored gray-scale traffic with a coloring identifier;
[0038] The traffic coloring module determines whether there are gray-scale microservices in the microservice group downstream of it;
[0039] If so, the traffic coloring module uses the colored gray-scale traffic as the superior traffic, the gray-scale microservices in the microservice group downstream of it as the target microservices, and transmits the superior traffic to the target microservices;
[0040] The target microservice determines whether there is a microservice group downstream of it;
[0041] If there is no microservice group downstream of the target microservice, the target microservice determines a message that all gray-scale microservices in the microservice cluster have completed traffic verification;
[0042] If there is a microservice group downstream of the target microservice, the target microservice resolves the internal domain name of the target microservice to obtain the IP address of the traffic shunting module;
[0043] Based on the IP address, the target microservice sends a request instruction to the traffic shunting module to request the transmission of secondary traffic. The secondary traffic is the traffic obtained after transforming the superior traffic after the target microservice processes business events;
[0044] The traffic shunting module determines whether the secondary traffic in the request instruction carries the coloring identifier marked on the colored gray-scale traffic;
[0045] If so, the traffic shunting module determines whether there are gray-scale microservices in the microservice group downstream of the target microservice;
[0046] If so, the traffic shunting module uses the colored gray-scale traffic with the coloring identifier as the new superior traffic, transmits the superior traffic to the gray-scale microservices in the microservice group downstream of the target microservice, and uses the gray-scale microservices in the microservice group downstream of the target microservice as the new target microservices, and returns to the target microservice to execute the step of determining whether there is a microservice group downstream of it.
[0047] With the above technical solution, the present application obtains external traffic through a traffic coloring module, separates the external traffic to obtain colored grayscale traffic with a coloring identifier, determines whether there are grayscale microservices in the microservice group downstream of the traffic coloring module. If so, the colored grayscale traffic is used as the superior traffic, the grayscale microservices in the microservice group downstream of the traffic coloring module are used as the target microservices, and the superior traffic is transmitted to the target microservices. Then, it is determined whether there is a microservice group downstream of the target microservices. If there is no microservice group downstream of the target microservices, it is determined that all grayscale microservices in the microservice cluster have completed traffic verification information. If there is a microservice group downstream of the target microservices, the internal domain name of the target microservice is parsed to obtain the IP address of the traffic shunting module. Based on the IP address, a request instruction for requesting to transmit secondary traffic is sent to the traffic shunting module. The secondary traffic is the traffic obtained by transforming the superior traffic after the target microservice processes the service event. It is determined whether the secondary traffic in the request instruction carries the coloring identifier marked on the colored grayscale traffic. If so, it is determined whether there are grayscale microservices in the microservice group downstream of the target microservices. If so, the colored grayscale traffic with the coloring identifier in the secondary traffic is used as the new superior traffic, the superior traffic is transmitted to the grayscale microservices in the microservice group downstream of the target microservices, and the grayscale microservices in the microservice group downstream of the target microservices are used as the new target microservices, and the step of determining whether there is a microservice group downstream of the target microservices is returned for execution. Thus, it is not necessary to clone an environment for grayscale microservice traffic verification. Only a traffic coloring module and a traffic shunting module need to be introduced into the original microservice link to allocate traffic to the grayscale microservices that need to be verified by grayscale, so that all microservices can complete the verification of microservice version release with only a small amount of traffic, greatly saving resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0049] Figure 1 It is a system architecture diagram of a traffic verification system for implementing microservice version release provided by an embodiment of the present application;
[0050] Figure 2 It is the first process schematic diagram of the traffic verification system provided by the embodiment of the present application for implementing microservice version release;
[0051] Figure 3The second process schematic diagram for the traffic verification system provided by the embodiments of the present application to implement traffic verification for microservice version release;
[0052] Figure 4 The third process schematic diagram for the traffic verification system provided by the embodiments of the present application to implement traffic verification for microservice version release;
[0053] Figure 5 The fourth process schematic diagram for the traffic verification system provided by the embodiments of the present application to implement traffic verification for microservice version release. Detailed implementation manners
[0054] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0055] Figure 1 An optional system architecture of a traffic verification system for implementing microservice version release provided by the embodiments of the present application, as Figure 1 shown. The system architecture may include:
[0056] A traffic coloring module, a traffic shunting module, and a microservice cluster.
[0057] Among them, the microservice cluster may include multiple microservice groups. Each microservice group may include a formal microservice. Some microservice groups may further include a gray-scale microservice in addition to a formal microservice. Each microservice group can be hierarchically distinguished according to the logic of conducting business. For example, the microservice group that executes the business first is at the first layer, and the microservice group that follows the first layer is at the second layer. Each microservice consumes traffic during the process of executing the business and may generate traffic after executing the business. Whether a microservice generates traffic after executing the business is related to the specific business executed.
[0058] Specifically, the formal microservice can represent the microservice that can run normally currently, such as the microservice of the old version. The gray-scale microservice can represent the microservice of the updated release version of the formal microservice in the same microservice group. Therefore, the gray-scale microservice can represent the microservice that needs traffic verification.
[0059] The traffic coloring module can obtain external traffic, separate the external traffic to obtain grayscale traffic and non-grayscale traffic, and mark the grayscale traffic with a coloring identifier. The traffic marked with the coloring identifier will be used for the traffic verification of newly released grayscale microservices. Based on this, the grayscale microservices can process the traffic with the coloring identifier. Then, the traffic without the coloring identifier can be used as formal traffic and flow to the downstream formal microservices.
[0060] It can be understood that there may be no grayscale microservices in some microservice groups. Therefore, when the traffic coloring module transmits the traffic marked with the coloring identifier to the downstream microservice group, it can be transmitted to the formal microservices in the microservice group. In addition to processing formal traffic, the formal microservices can also process the traffic marked with the coloring identifier.
[0061] The traffic shunting module can obtain the traffic transmitted by the upstream microservices, determine whether there is traffic with a coloring identifier in the obtained traffic, and allocate the obtained traffic to the downstream microservice group according to the preset traffic shunting rules.
[0062] Based on Figure 1 the system architecture shown, Figure 2 FIG. shows the first process schematic diagram of the traffic verification method for microservice version release implemented by the traffic verification system provided in the embodiment of the present application. Referring to Figure 2 , the process may include:
[0063] Step S101, obtain external traffic, and separate the external traffic through the traffic coloring module to obtain colored grayscale traffic with a coloring identifier.
[0064] Specifically, the external traffic can be provided by the client, browser or third-party customer. The traffic coloring module is the entry component of the k8s cluster, which can obtain external traffic and can separate the obtained external traffic according to the preset rule algorithm to obtain the grayscale traffic for traffic verification, and obtain the colored grayscale traffic by coloring the grayscale traffic.
[0065] Among them, the traffic verification system further includes a traffic shunting algorithm maintenance module. The preset rule algorithm can be obtained from the traffic shunting algorithm maintenance module in the traffic verification system. The traffic shunting algorithm maintenance module can adjust the rule algorithm for dividing external traffic by monitoring the resource status of each grayscale microservice.
[0066] It can be understood that when the microservice cluster does not include grayscale microservices, all external traffic is used for the operation of all formal microservices. When the microservice cluster includes grayscale microservices, the traffic coloring module can divide a small part of the external traffic for the traffic verification of newly released grayscale microservices.
[0067] Step S102: Determine whether there is a gray-scaled microservice in the microservice group downstream of the traffic coloring module. If so, execute Step S103.
[0068] Specifically, when the traffic coloring module separates external traffic to obtain colored gray-scaled traffic with a coloring identifier, it can indicate that there is a gray-scaled microservice in the microservice cluster that requires traffic verification. Then, it is necessary to determine whether there is a gray-scaled microservice in the microservice group downstream of the traffic coloring module.
[0069] Step S103: Use the colored gray-scaled traffic as the superior traffic, use the gray-scaled microservice in the microservice group downstream of the traffic coloring module as the target microservice, and transmit the superior traffic to the target microservice.
[0070] Specifically, the traffic coloring module can use the colored gray-scaled traffic as the superior traffic, use the gray-scaled microservice in its downstream microservice group as the target microservice, and transmit the superior traffic to the target microservice.
[0071] Step S104: Determine whether there is a microservice group downstream of the target microservice. If not, execute Step S105; if so, execute Step S106.
[0072] Specifically, the target microservice can determine whether there is a microservice group downstream of it.
[0073] Step S105: Determine the information that all gray-scaled microservices in the microservice cluster have completed traffic verification.
[0074] Specifically, the target microservice can determine the message that all gray-scaled microservices in the microservice cluster have completed traffic verification.
[0075] It can be understood that when there is no microservice group downstream of the target microservice, it can indicate that all gray-scaled microservices in the microservice cluster have completed traffic verification, and the external traffic obtained by the traffic coloring module has flowed through all microservice groups in the microservice cluster.
[0076] Step S106: Resolve the internal domain name of the target microservice to obtain the IP address of the traffic shunting module.
[0077] Specifically, when there is a microservice group downstream of the target microservice, the target microservice can resolve the internal domain name of the target microservice to obtain the IP address of the traffic shunting module.
[0078] Among them, the internal domain name of the target microservice can be obtained through the domain name system in the traffic verification system. When the gray-scale microservice is the target microservice and requests its downstream microservice, the internal domain name of the target microservice can be obtained through the domain name system, and then through the domain name resolution module in the traffic verification system, the internal domain name can be resolved to the traffic splitting module, so as to obtain the IP address of the traffic splitting module.
[0079] Step S107: Based on the IP address, send a request instruction for requesting to transmit secondary traffic to the traffic splitting module, where the secondary traffic is the traffic obtained after transforming the upper-level traffic after the target microservice processes the business event.
[0080] Specifically, the target microservice can send a request instruction for requesting to transmit secondary traffic to the traffic splitting module based on the IP address.
[0081] It can be understood that after the target microservice processes its business event, it consumes part of the dyed gray-scale traffic with a dyeing identifier and may generate traffic obtained from the business event. Therefore, the secondary traffic contains both the dyed gray-scale traffic with a dyeing identifier and the traffic without a dyeing identifier.
[0082] Step S108: Determine whether the secondary traffic in the request instruction has a dyeing identifier marked on the dyed gray-scale traffic. If so, execute step S109.
[0083] Specifically, the traffic splitting module can determine whether the secondary traffic in the request instruction has a dyeing identifier marked on the dyed gray-scale traffic.
[0084] Step S109: Determine whether there is a gray-scale microservice in the microservice group downstream of the target microservice. If so, execute step S110.
[0085] Specifically, when the secondary traffic in the request instruction has a dyeing identifier marked on the dyed gray-scale traffic, it can indicate that the dyed gray-scale traffic with a dyeing identifier has not been consumed completely, and the traffic verification for the downstream gray-scale microservice can continue. The traffic splitting module can determine whether there is a gray-scale microservice in the microservice group downstream of the target microservice.
[0086] Step S110: Use the dyed gray-scale traffic with a dyeing identifier in the secondary traffic as the new upper-level traffic, and transmit the upper-level traffic to the gray-scale microservice in the microservice group downstream of the target microservice.
[0087] Specifically, if there is a grayscale microservice in the microservice group downstream of the target microservice, the traffic splitting module may use the colored grayscale traffic with a coloring identifier as the new superior traffic and transmit the superior traffic to the grayscale microservice in the microservice group downstream of the target microservice.
[0088] Step S111: Use the grayscale microservice in the microservice group downstream of the target microservice as the new target microservice, and return to execute step S104.
[0089] Specifically, the target microservice may use the grayscale microservice in the microservice group downstream of the target microservice as the new target microservice.
[0090] The traffic verification method for microservice version release provided in this embodiment obtains external traffic through the traffic coloring module, separates the external traffic to obtain the colored grayscale traffic with a coloring identifier, determines whether there is a grayscale microservice in the microservice group downstream of the traffic coloring module. If so, use the colored grayscale traffic as the superior traffic, use the grayscale microservice in the microservice group downstream of the traffic coloring module as the target microservice, and transmit the superior traffic to the target microservice. Determine whether there is a microservice group downstream of the target microservice. If there is no microservice group downstream of the target microservice, determine that all grayscale microservices in the microservice cluster have completed traffic verification information. If there is a microservice group downstream of the target microservice, resolve the internal domain name of the target microservice to obtain the IP address of the traffic splitting module. Based on the IP address, send a request instruction for requesting to transmit secondary traffic to the traffic splitting module. The secondary traffic is the traffic obtained by transforming the superior traffic after the target microservice processes the service event. Determine whether the secondary traffic in the request instruction has the coloring identifier marked on the colored grayscale traffic. If so, determine whether there is a grayscale microservice in the microservice group downstream of the target microservice. If so, use the colored grayscale traffic with the coloring identifier in the secondary traffic as the new superior traffic, transmit the superior traffic to the grayscale microservice in the microservice group downstream of the target microservice, use the grayscale microservice in the microservice group downstream of the target microservice as the new target microservice, and return to execute the step of determining whether there is a microservice group downstream of the target microservice. Thus, it is not necessary to clone an environment for grayscale microservice traffic verification. Only the traffic coloring module and the traffic splitting module need to be introduced into the original microservice link to allocate traffic to the grayscale microservices that need grayscale verification, enabling all microservices to complete the verification of microservice version release with only a small amount of traffic, greatly saving resources.
[0091] In some embodiments of the present application, the process of separating the external traffic by the traffic coloring module mentioned in the above embodiments to obtain the colored grayscale traffic with a coloring identifier will be introduced. This process may include:
[0092] S1. Load a preset traffic splitting algorithm into the traffic coloring module to obtain a traffic coloring module integrated with the algorithm.
[0093] Specifically, the traffic splitting algorithm may be stored in the traffic splitting algorithm maintenance module of the traffic verification system. When the traffic coloring module needs to separate the external traffic, the traffic splitting algorithm can be loaded.
[0094] S2. Through the traffic coloring module integrated with the algorithm, separate the external traffic according to the total number of gray-scale microservices in the microservice cluster to obtain the colored grayscale traffic.
[0095] Specifically, in the traffic splitting algorithm integrated by the traffic coloring module, the total number of gray-scale microservices and the colored grayscale traffic may have a positive correlation, that is, the more the total number of gray-scale microservices in the microservice cluster, the more the colored grayscale traffic obtained by separating the external traffic.
[0096] S3. Perform coloring processing on the colored grayscale traffic through the traffic coloring module integrated with the algorithm to obtain the colored grayscale traffic with a coloring identifier.
[0097] In some embodiments of the present application, considering that there may not be gray-scale microservices in some microservice groups, the colored grayscale traffic can also be allocated to the formal microservices. Based on this, Figure 3 FIG. shows the second schematic flowchart of the traffic verification method for microservice version release implemented by the traffic verification system provided in the embodiments of the present application. Referring to Figure 3 , this process may include:
[0098] Step S201. Obtain the external traffic and separate the external traffic through the traffic coloring module to obtain the colored grayscale traffic with a coloring identifier.
[0099] Step S202. Determine whether there are gray-scale microservices in the microservice group downstream of the traffic coloring module. If so, execute step S203; if not, execute step S212.
[0100] Step S203. Take the colored grayscale traffic as the upper-level traffic, take the gray-scale microservices in the microservice group downstream of the traffic coloring module as the target microservices, and transmit the upper-level traffic to the target microservices.
[0101] Step S204: Determine whether there is a microservice group downstream of the target microservice. If not, execute Step S205; if so, execute Step S206.
[0102] Step S205: Determine the information that all grayscale microservices in the microservice cluster have completed traffic verification.
[0103] Step S206: Parse the internal domain name of the target microservice to obtain the IP address of the traffic splitting module.
[0104] Step S207: Based on the IP address, send a request instruction to the traffic splitting module to request the transmission of secondary traffic, where the secondary traffic is the traffic obtained after transforming the upper-level traffic after the target microservice processes the business event.
[0105] Step S208: Determine whether the secondary traffic in the request instruction carries a coloring identifier marked on the colored grayscale traffic. If so, execute Step S209.
[0106] Step S209: Determine whether there is a grayscale microservice in the microservice group downstream of the target microservice. If so, execute Step S210.
[0107] Step S210: Use the colored grayscale traffic with the coloring identifier in the secondary traffic as the new upper-level traffic, and transmit the upper-level traffic to the grayscale microservices in the microservice group downstream of the target microservice.
[0108] Step S211: Use the grayscale microservices in the microservice group downstream of the target microservice as the new target microservice, and return to execute Step S204.
[0109] The above Steps S201 - S211 correspond one-to-one with Steps S101 - S111 in the foregoing embodiment. For details, refer to the foregoing introduction and will not be elaborated here.
[0110] Step S212: Use the formal microservices in the microservice group downstream of the traffic coloring module as the target microservice, transmit the upper-level traffic to the target microservice, and execute Step S204.
[0111] It can be understood that the colored grayscale traffic is a part of the traffic separated from the external traffic. When there is no grayscale microservice in the downstream microservice group, it can be used as the traffic for normal business processing and transmitted to the formal microservice for the formal microservice to process the business.
[0112] Further, the formal microservice can preferentially consume the non-colored traffic when processing the business, so that the grayscale microservices downstream of the formal microservice can perform traffic verification through the colored grayscale traffic.
[0113] In some embodiments of the present application, considering that there is no coloring identifier marked on the coloring gray-scale traffic in the secondary traffic, it can be indicated that the coloring gray-scale traffic is consumed when the gray-scale microservice processes the service, and subsequent gray-scale microservices do not need to continue to verify through the coloring gray-scale traffic. Based on this, Figure 4 FIG. 3 shows a third flowchart of the traffic verification method for implementing microservice version release by the traffic verification system provided in the embodiments of the present application. Refer to Figure 4 , this process may include:
[0114] Step S301, obtain external traffic, and separate the external traffic through the traffic coloring module to obtain coloring gray-scale traffic with a coloring identifier.
[0115] Step S302, determine whether there is a gray-scale microservice in the microservice group downstream of the traffic coloring module. If so, execute step S303.
[0116] Step S303, use the coloring gray-scale traffic as the superior traffic, use the gray-scale microservice in the microservice group downstream of the traffic coloring module as the target microservice, and transmit the superior traffic to the target microservice.
[0117] Step S304, determine whether there is a microservice group downstream of the target microservice. If not, execute step S305. If so, execute step S306.
[0118] Step S305, determine the information that all gray-scale microservices in the microservice cluster have completed traffic verification.
[0119] Step S306, resolve the internal domain name of the target microservice to obtain the IP address of the traffic shunting module.
[0120] Step S307, based on the IP address, send a request instruction for requesting to transmit secondary traffic to the traffic shunting module, where the secondary traffic is the traffic obtained after converting the superior traffic after the target microservice processes the service event.
[0121] Step S308, determine whether the secondary traffic in the request instruction has a coloring identifier marked on the coloring gray-scale traffic. If so, execute step S309. If not, execute step S312.
[0122] Step S309, determine whether there is a gray-scale microservice in the microservice group downstream of the target microservice. If so, execute step S310.
[0123] Step S310: Use the dyed grayscale traffic with the dyeing identifier in the secondary traffic as the new superior traffic, and transmit the superior traffic to the grayscale microservice in the microservice group downstream of the target microservice.
[0124] Step S311: Use the grayscale microservice in the microservice group downstream of the target microservice as the new target microservice, and return to execute Step S304.
[0125] The above Steps S301 - S311 correspond one by one to Steps S101 - S111 in the foregoing embodiment. For details, refer to the foregoing introduction and will not be elaborated here.
[0126] Step S312: Transmit the secondary traffic to the official microservice in the microservice group downstream of the target microservice, and determine the information that the dyed grayscale traffic with the dyeing identifier has been consumed.
[0127] It can be understood that when there is no dyeing identifier marked on the dyed grayscale traffic in the secondary traffic of the request instruction, it can indicate that the secondary traffic only contains traffic for the official microservice. Then, the secondary traffic can be all transmitted to the official microservice in the microservice group downstream of the target microservice, and the information that the dyed grayscale traffic has been consumed is determined.
[0128] Furthermore, if there is a grayscale microservice downstream of the target microservice, the grayscale traffic can be divided from the secondary traffic and marked with dyeing for the traffic verification of the grayscale microservice located downstream of the target microservice.
[0129] In some embodiments of the present application, considering that there may not be a grayscale microservice in some microservice groups, the dyed grayscale traffic can also flow to the official microservice. Based on this, Figure 5 FIG. shows the third flowchart of the traffic verification method for implementing microservice version release by the traffic verification system provided in the embodiment of the present application. Refer to Figure 5 , this process may include:
[0130] Step S401: Obtain external traffic, and separate the external traffic through the traffic dyeing module to obtain dyed grayscale traffic with a dyeing identifier.
[0131] Step S402: Determine whether there is a grayscale microservice in the microservice group downstream of the traffic dyeing module. If so, execute Step S403.
[0132] Step S403: Use the dyed grayscale traffic as the superior traffic, use the grayscale microservice in the microservice group downstream of the traffic dyeing module as the target microservice, and transmit the superior traffic to the target microservice.
[0133] Step S404: Determine whether there is a microservice group downstream of the target microservice. If not, execute Step S405; if so, execute Step S406.
[0134] Step S405: Determine the information that all the gray-scale microservices in the microservice cluster have completed traffic verification.
[0135] Step S406: Parse the internal domain name of the target microservice to obtain the IP address of the traffic splitting module.
[0136] Step S407: Based on the IP address, send a request instruction to the traffic splitting module to request the transmission of secondary traffic, where the secondary traffic is the traffic obtained after transforming the upper-level traffic after the target microservice processes the business event.
[0137] Step S408: Determine whether the secondary traffic in the request instruction carries a coloring identifier marked on the colored gray-scale traffic. If so, execute Step S409.
[0138] Step S409: Determine whether there is a gray-scale microservice in the microservice group downstream of the target microservice. If so, execute Step S410; if not, execute Step S412.
[0139] Step S410: Use the colored gray-scale traffic with the coloring identifier in the secondary traffic as the new upper-level traffic, and transmit the upper-level traffic to the gray-scale microservices in the microservice group downstream of the target microservice.
[0140] Step S411: Use the gray-scale microservices in the microservice group downstream of the target microservice as the new target microservice, and return to execute Step S404.
[0141] The above Steps S401 - S411 correspond one-to-one with Steps S101 - S111 in the foregoing embodiment. For details, refer to the foregoing introduction and will not be elaborated here.
[0142] Step S412: Use the colored gray-scale traffic with the coloring identifier in the secondary traffic as the new upper-level traffic, and transmit the upper-level traffic to the formal microservices in the microservice group downstream of the target microservice.
[0143] Step S413: Use the formal microservices in the microservice group downstream of the target microservice as the new target microservice, and return to execute Step S404.
[0144] It can be understood that the secondary traffic is the traffic obtained after the target microservice converts the upper-level traffic after processing the service, including the dyed grayscale traffic with a dyeing identifier and the traffic without a dyeing identifier generated by the target microservice when processing the service. Then, the new target microservice includes non-dyed traffic and dyed grayscale traffic.
[0145] Furthermore, when the new target microservice processes the service, it can preferentially consume the non-dyed traffic to enable the grayscale microservice downstream of the new target microservice to perform traffic verification through the dyed grayscale traffic.
[0146] In some embodiments of the present application, considering that when the traffic dyeing module separates the external traffic, in addition to obtaining the required dyed grayscale traffic, it also obtains most of the non-dyed traffic for the formal microservice. The traffic verification method for version release mentioned in the present application may further include:
[0147] S1. Obtain the non-dyed traffic.
[0148] Specifically, the non-dyed traffic may be obtained by the traffic dyeing module separating the external traffic.
[0149] S2. Transmit the non-dyed traffic to the formal microservice in the target microservice group downstream of the traffic dyeing module.
[0150] It can be understood that by transmitting the non-dyed traffic to the formal microservice, in the environment where the grayscale microservice performs traffic verification, the formal microservice can perform business processing normally without being affected by traffic verification.
[0151] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0152] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0153] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A traffic verification method for microservice version release, characterized in that Applied to a traffic verification system, the traffic verification system includes a traffic coloring module, a traffic shunting module, and a microservice cluster. The microservice cluster includes several microservice groups differentiated by levels, and some of the microservice groups include gray-scale microservices; The method includes: Obtain external traffic, and separate the external traffic through the traffic coloring module to obtain colored gray-scale traffic with a coloring identifier; Determine whether there are gray-scale microservices in the microservice group downstream of the traffic coloring module; If so, use the colored gray-scale traffic as the superior traffic, use the gray-scale microservices in the microservice group downstream of the traffic coloring module as the target microservices, and transmit the superior traffic to the target microservices; Determine whether there is a microservice group downstream of the target microservice; If there is no microservice group downstream of the target microservice, determine the information that all gray-scale microservices in the microservice cluster have completed traffic verification, indicating that the external traffic obtained by the traffic coloring module has flowed through all microservice groups in the microservice cluster; If there is a microservice group downstream of the target microservice, resolve the internal domain name of the target microservice to obtain the IP address of the traffic shunting module; Based on the IP address, send a request instruction to the traffic shunting module to request the transmission of secondary traffic. The secondary traffic is the traffic obtained by transforming the superior traffic after the target microservice processes a business event; Determine whether the secondary traffic in the request instruction has the coloring identifier marked on the colored gray-scale traffic; If so, determine whether there are gray-scale microservices in the microservice group downstream of the target microservice; If so, use the colored gray-scale traffic with the coloring identifier in the secondary traffic as the new superior traffic, and transmit the superior traffic to the gray-scale microservices in the microservice group downstream of the target microservice; Use the gray-scale microservices in the microservice group downstream of the target microservice as the new target microservices, and return to execute the step of determining whether there is a microservice group downstream of the target microservice.
2. The method according to claim 1, characterized in that, Separating the external traffic through the traffic coloring module to obtain colored gray-scale traffic with a coloring identifier includes: Load a preset traffic shunting algorithm into the traffic coloring module to obtain a traffic coloring module integrated with the algorithm; Through the traffic coloring module integrated with the algorithm, separate the external traffic according to the total number of gray-scale microservices in the microservice cluster to obtain colored gray-scale traffic; Perform coloring processing on the colored gray-scale traffic through the traffic coloring module integrated with the algorithm to obtain colored gray-scale traffic with a coloring identifier.
3. The method according to claim 1, wherein Each microservice group includes a formal microservice. The method further includes: If there are no gray-scale microservices in the microservice group downstream of the traffic coloring module, use the formal microservices in the microservice group downstream of the traffic coloring module as the target microservices, transmit the superior traffic to the target microservices, and execute the step of determining whether there is a microservice group downstream of the target microservice.
4. The method according to claim 1, wherein Each microservice group includes a formal microservice. The method further includes: If the secondary traffic in the request instruction does not carry a coloring identifier marked on the colored grayscale traffic, transmit the secondary traffic to the official microservice in the microservice group downstream of the target microservice, and determine the information that the colored grayscale traffic with the coloring identifier has been consumed.
5. The method according to claim 1, wherein Each microservice group includes an official microservice, and the method further includes: If there is no gray microservice in the microservice group downstream of the target microservice, use the colored grayscale traffic with the coloring identifier in the secondary traffic as the new upper-level traffic, and transmit the upper-level traffic to the official microservice in the microservice group downstream of the target microservice; Use the official microservice in the microservice group downstream of the target microservice as the new target microservice, and return to execute the step of determining whether there is a microservice group downstream of the target microservice.
6. The method according to claim 3, wherein It further includes: Obtain non-colored traffic, where the non-colored traffic is obtained by the traffic coloring module separating the external traffic; Transmit the non-colored traffic to the official microservice in the target microservice group downstream of the traffic coloring module.
7. The method according to claim 1, characterized in that The traffic verification system further includes a traffic shunting algorithm maintenance module to monitor the resource status of each gray microservice.
8. The method according to claim 1, wherein The traffic verification system further includes a domain name system for each gray microservice to obtain its internal domain name when requesting its downstream microservice.
9. The method according to any one of claims 1-8, characterized in that, The traffic verification system further includes a domain name resolution module for each gray microservice to resolve its internal domain name to the traffic shunting module when requesting its downstream microservice.
10. A traffic verification system for microservice version release, characterized in that, It includes a traffic coloring module, a traffic shunting module, and a microservice cluster. The microservice cluster includes several microservice groups differentiated by levels, and some microservice groups include gray microservices; The traffic coloring module obtains external traffic and separates the external traffic to obtain colored grayscale traffic with a coloring identifier; The traffic coloring module determines whether there is a gray microservice in the microservice group downstream of it; If so, the traffic coloring module uses the colored grayscale traffic as the upper-level traffic, uses the gray microservice in the microservice group downstream of it as the target microservice, and transmits the upper-level traffic to the target microservice; The target microservice determines whether there is a microservice group downstream of it; If there is no microservice group downstream of the target microservice, the target microservice determines the message that all gray microservices in the microservice cluster have completed traffic verification, indicating that the external traffic obtained by the traffic coloring module has flowed through all microservice groups in the microservice cluster; If there is a microservice group downstream of the target microservice, the target microservice resolves its internal domain name to obtain the IP address of the traffic shunting module; The target microservice sends a request instruction for requesting to transmit secondary traffic to the traffic shunting module based on the IP address. The secondary traffic is the traffic obtained by transforming the upper-level traffic after the target microservice processes the business event; The traffic shunting module determines whether the secondary traffic in the request instruction carries a coloring identifier marked on the colored grayscale traffic; If so, the traffic splitting module determines whether there is a grayscale microservice in the microservice group downstream of the target microservice; If so, the traffic splitting module uses the dyed grayscale traffic with a coloring identifier as the new upper-level traffic, transmits the upper-level traffic to the grayscale microservice in the microservice group downstream of the target microservice, and uses the grayscale microservice in the microservice group downstream of the target microservice as the new target microservice, and returns to the target microservice to execute the step of determining whether there is a microservice group downstream of it.
Citation Information
Patent Citations
Micro-service gray release method based on hybrid framework
CN111580846A
Gray release method, device and system based on user request traffic control
CN111628894A