A gray scale switching method and related device

CN122985453APending Publication Date: 2026-10-27CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611184335.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

该种方式在新版本服务运行有问题或者效果达不到预期时,容易影响生产集群的正常运行,生产集群的业务稳定性不尽人意

Benefits of technology

本申请提供一种灰度切换方法及相关设备,其中,该方法应用于灰度切换系统,所述灰度切换系统包括灰度控制平台、生产集群和灰度集群,所述方法包括:当所述灰度集群部署有新版本服务时,所述灰度控制平台获取灰度分流规则,并根据所述灰度分流规则,对所述生产集群和/或所述灰度集群中的第一网关路由规则进行规则更新,得到第二网关路由规则;所述灰度分流规则为百分比分流规则、参数分流规则和路径分流规则中的任意一种;所述生产集群的网关接收来自应用端的API调用请求,并根据所述第二网关路由规则,对所述API调用请求进行请求解析,得到所述API调用请求的目标集群;所述目标集群为所述生产集群或所述灰度集群;所述生产集群的网关将所述API调用请求转发至所述目标集群,以使得所述灰度集群基于所述新版本服务对所述API调用请求进行请求响应,或所述生产集群基于旧版本服务对所述API调用请求进行请求响应;所述旧版本服务为所述新版本服务的在先版本。该方法基于网关根据网关路由规则,对应用端的API调用请求进行请求解析,以将API调用请求转发至生产集群或灰度集群中进行响应;该方法可以在所有API调用请求中的至少一部分API调用请求转发至灰度集群,以使得灰度集群部署的新版本服务响应API调用请求,以及通过生产集群对另外一部分API调用请求进行响应,其可以实现对新版本服务的测试验证的同时,保障生产集群的业务稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985453A_ABST
    Figure CN122985453A_ABST
Patent Text Reader

Abstract

The application provides a gray scale switching method and related equipment, wherein the method obtains a gray scale shunting rule through a gray scale control platform, and updates a first gateway routing rule in a production cluster and / or a gray scale cluster according to the gray scale shunting rule to obtain a second gateway routing rule; the gray scale shunting rule is any one of a percentage shunting rule, a parameter shunting rule and a path shunting rule; a gateway of the production cluster receives an API calling request from an application end, and performs request analysis on the API calling request according to the second gateway routing rule to obtain a target cluster of the API calling request; the gateway of the production cluster forwards the API calling request to the target cluster, so that the gray scale cluster or the production cluster performs request response on the API calling request. The method can effectively improve the business stability of the production cluster. The application relates to the technical field of software development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software development technology, and in particular to a grayscale switching method and related equipment. Background Technology

[0002] As users of the cloud network operation business system continue to increase their functional demands, launching new versions of services in the cloud network operation business system has become a key focus for relevant staff.

[0003] Currently, the common practice is to directly replace the old version of the service with the new version in the production cluster corresponding to the cloud network operation business system, and then use the new version to respond to user functional requirements in order to test and verify the new version. This approach can easily affect the normal operation of the production cluster if the new version has problems or fails to meet expectations, resulting in unsatisfactory business stability.

[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention

[0005] The purpose of this invention is to at least partially solve one of the technical problems existing in the related art.

[0006] The main objective of this application is to propose a grayscale switching method and related equipment, wherein the method can effectively improve the business stability of the production cluster.

[0007] To achieve the above objectives, one aspect of this application proposes a grayscale switching method applied to a grayscale switching system, wherein the grayscale switching system includes a grayscale control platform, a production cluster, and a grayscale cluster, and the method includes: When a new version of the service is deployed in the grayscale cluster, the grayscale control platform obtains the grayscale traffic splitting rules and updates the first gateway routing rules in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rules to obtain the second gateway routing rules; the grayscale traffic splitting rules are any one of percentage traffic splitting rules, parameter traffic splitting rules, and path traffic splitting rules. The gateway of the production cluster receives API call requests from the application and parses the API call requests according to the second gateway routing rules to obtain the target cluster of the API call requests; the target cluster is the production cluster or the grayscale cluster. The gateway of the production cluster forwards the API call request to the target cluster, so that the grayscale cluster responds to the API call request based on the new version of the service, or the production cluster responds to the API call request based on the old version of the service; the old version of the service is a prior version of the new version of the service.

[0008] In some embodiments, if the grayscale traffic splitting rule is a percentage-based traffic splitting rule, updating the first gateway routing rule in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rule to obtain the second gateway routing rule includes: The grayscale splitting rule is analyzed for target objects to obtain a splitting attribute group for the target objects in the grayscale splitting rule. The splitting attribute group includes a first splitting percentage and a second splitting percentage. The first splitting percentage is used to characterize the splitting percentage of the production cluster, and the second splitting percentage is used to characterize the splitting percentage of the grayscale cluster. Based on the traffic splitting attribute group, the traffic splitting attributes of the target object in the first gateway routing rule are replaced to obtain the second gateway routing rule.

[0009] In some embodiments, updating the first gateway routing rule in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rule to obtain the second gateway routing rule includes: Perform routing object analysis on the grayscale splitting rule to obtain the target attribute group of the routing object in the grayscale splitting rule; Based on the target attribute group, the target attributes of the routing objects in the first gateway routing rule are updated to obtain the second gateway routing rule; Wherein, if the grayscale traffic splitting rule is a parameter-based traffic splitting rule, the target attribute group is a parameter attribute group, and the parameter attribute group includes several request header parameters required to split the API call request to the grayscale cluster; or, if the grayscale traffic splitting rule is a path-based traffic splitting rule, the target attribute group is a path attribute group, and the path attribute group includes several routing paths required to split the API call request to the grayscale cluster.

[0010] In some embodiments, obtaining the first gateway routing rules includes: Obtain the original upstream object; the original upstream object is the upstream object of the gateway of the production cluster or the grayscale cluster; The original upstream object is associated with an object to generate a target object and a path object; the target object records the address attribute and traffic splitting percentage attribute of the production cluster, as well as the address attribute and traffic splitting percentage attribute of the grayscale cluster. The first gateway routing rule is obtained based on the original upstream object, the target object, and the path object.

[0011] In some embodiments, the method further includes: When a new version of the service is deployed in the grayscale cluster, the grayscale control platform obtains the grayscale scheduling rules and forwards the grayscale scheduling rules to the target cluster. The target cluster acquires the acquisition tasks and performs cluster analysis on the acquisition tasks according to the gray-scale scheduling rules to obtain the cluster identifier of the acquisition tasks. If the cluster identifier of the data collection task is the same as the cluster identifier of the target cluster, the target cluster will respond to and execute the data collection task; or, if the cluster identifier of the data collection task is different from the cluster identifier of the target cluster, the data collection task will be forwarded to a non-target cluster through the gateway of the target cluster, so that the non-target cluster will respond to and execute the data collection task. The non-target cluster refers to the clusters other than the target cluster in the production cluster and the grayscale cluster.

[0012] In some embodiments, obtaining the gray-scale scheduling rules includes: Obtain several task partitioning dimensions, each of which has a different dimension type; Perform grayscale range analysis on each of the task division dimensions to obtain the grayscale range of each task division dimension; The gray-scale scheduling rules are constructed based on the dimension of each task and the corresponding gray-scale range.

[0013] In some embodiments, the step of performing cluster analysis on the acquisition tasks according to the gray-scale scheduling rules to obtain the cluster identifier of the acquisition tasks includes: The acquisition task is analyzed to obtain several task attributes, and each task attribute corresponds to a task division dimension in the gray-scale scheduling rule. Based on each task attribute, range matching is performed on the corresponding gray range in the gray-scale scheduling rule to obtain matching information for each task attribute; If all the matching information matches, the cluster identifier of the acquisition task is determined as the grayscale cluster identifier; or, if at least one of the matching information does not match, the acquisition task is determined as the production cluster identifier.

[0014] To achieve the above objectives, another aspect of the embodiments of this application proposes a grayscale switching system, including a grayscale control platform, a production cluster, and a grayscale cluster; The grayscale control platform is used to obtain grayscale traffic splitting rules when a new version of the service is deployed in the grayscale cluster, and update the first gateway routing rules in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rules to obtain the second gateway routing rules; the grayscale traffic splitting rules are any one of percentage traffic splitting rules, parameter traffic splitting rules, and path traffic splitting rules. The gateway of the production cluster is used to receive API call requests from the application and, according to the second gateway routing rules, parse the API call requests to obtain the target cluster of the API call requests; the target cluster is the production cluster or the grayscale cluster; the API call requests are forwarded to the target cluster so that the grayscale cluster responds to the API call requests based on the new version of the service, or the production cluster responds to the API call requests based on the old version of the service; the old version of the service is a prior version of the new version of the service.

[0015] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.

[0016] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0017] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of an electronic device reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the method described above.

[0018] The embodiments of this application include at least the following beneficial effects: This application provides a gray-scale switching method and related equipment. The method is applied to a gray-scale switching system, which includes a gray-scale control platform, a production cluster, and a gray-scale cluster. The method includes: when a new version of the service is deployed in the gray-scale cluster, the gray-scale control platform obtains gray-scale routing rules and updates the first gateway routing rules in the production cluster and / or the gray-scale cluster according to the gray-scale routing rules to obtain a second gateway routing rule; the gray-scale routing rules are any one of percentage-based routing rules, parameter-based routing rules, and path-based routing rules; the gateway of the production cluster receives an API call request from an application and parses the API call request according to the second gateway routing rule to obtain the target cluster of the API call request; the target cluster is either the production cluster or the gray-scale cluster; the gateway of the production cluster forwards the API call request to the target cluster, so that the gray-scale cluster responds to the API call request based on the new version of the service, or the production cluster responds to the API call request based on the old version of the service; the old version of the service is a prior version of the new version of the service. This method is based on the gateway parsing API call requests from the application according to the gateway routing rules, and forwarding the API call requests to the production cluster or canary cluster for response. This method can forward at least a portion of all API call requests to the canary cluster, so that the new version of the service deployed in the canary cluster can respond to the API call requests, and the production cluster can respond to another portion of the API call requests. It can achieve the testing and verification of the new version of the service while ensuring the business stability of the production cluster. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating a grayscale switching method provided in an embodiment of this application; Figure 2 This is a detailed flowchart of obtaining the routing rules of the first gateway provided in an embodiment of this application; Figure 3 This is a detailed flowchart of step S110 provided in an embodiment of this application; Figure 4 This is a detailed flowchart of another step S110 provided in the embodiments of this application; Figure 5 This is a schematic diagram of an optional process for a grayscale switching method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the framework of a grayscale switching system provided in an embodiment of this application; Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses / devices and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.

[0021] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”

[0022] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0024] Currently, the common practice is to directly replace the old version of the service with the new version in the production cluster corresponding to the cloud network operation business system, and then use the new version to respond to user functional requirements in order to test and verify the new version. This approach can easily affect the normal operation of the production cluster if the new version has problems or fails to meet expectations, resulting in unsatisfactory business stability.

[0025] It should be noted that the aforementioned related technologies are only used to assist in understanding the technical solutions of this application and do not mean that they belong to the publicly disclosed prior art.

[0026] In view of this, this application provides a gray-scale switching method, which can forward at least a portion of all API call requests to the gray-scale cluster, so that the new version of the service deployed in the gray-scale cluster can respond to the API call requests, and the production cluster can respond to another portion of the API call requests. This method can achieve testing and verification of the new version of the service while ensuring the business stability of the production cluster.

[0027] Specifically, this method, through the gateway routing rules determined by the canary-scale traffic splitting rules, combined with subsequent request parsing, can allocate some API call requests to the canary cluster for processing based on percentage, request header parameters, and request path. This ensures the testing and verification of the new version service while effectively guaranteeing the business stability of the production cluster. Furthermore, this method, through canary-scale scheduling rules to perform cluster analysis on the collection tasks, combined with subsequent content, can allocate some collection tasks to the canary cluster for scheduling based on dimension and canary range. This, too, ensures the testing and verification of the new version service while effectively guaranteeing the business stability of the production cluster.

[0028] The grayscale switching method provided in this application can be applied to software development scenarios. In such scenarios, software service providers can use the method provided in this application to test and verify new version services of their developed business software. This ensures the testing and verification of new version services while effectively guaranteeing the business stability of the production cluster.

[0029] The method provided in this application can be applied to a terminal, a server, or software running on a terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited thereto; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application implementing the method, but is not limited to the above forms.

[0030] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0031] Reference Figure 1 , Figure 1 This is an optional flowchart illustrating a grayscale switching method provided in an embodiment of this application. Figure 1 The method described above is applied to a grayscale switching system, which includes a grayscale control platform, a production cluster, and a grayscale cluster. The method may include, but is not limited to, steps S110 to S130.

[0032] Step S110: When a new version of the service is deployed in the grayscale cluster, the grayscale control platform obtains the grayscale traffic splitting rules and updates the first gateway routing rules in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rules to obtain the second gateway routing rules; the grayscale traffic splitting rules are any one of percentage traffic splitting rules, parameter traffic splitting rules, and path traffic splitting rules. In this embodiment, the production cluster and the gray-scale cluster are two clusters corresponding to the cloud network operation business system. The production cluster is used to run the production services in the cloud network operation business system, which correspond to the old version of the service. The gray-scale cluster is used to verify the functions of the new version of the service in the cloud network operation business system. Specifically, in the cloud network operation business system, the production services may include network scheduling optimization, cloud service performance monitoring and capacity management, cloud service resource activation, cloud network data collection, etc.; while the new version of the service can be the new version of the production services.

[0033] Understandably, in practical applications, when a new version of a service is deployed to a canary cluster, the canary control platform can be used to obtain canary traffic rules. These canary traffic rules are used to switch a small number of user API call requests from the cloud network operation business system to the canary cluster for processing.

[0034] Specifically, the grayscale control platform can obtain the current gateway routing rules used by the gateways in the production cluster and / or grayscale cluster, denoted as the first gateway routing rule; then, based on the information recorded in the grayscale distribution rules, it modifies the information in the first gateway routing rule accordingly to obtain the second gateway routing rule, so that the gateways of the production cluster and / or grayscale cluster can perform rule routing for user API call requests based on the second gateway routing rule.

[0035] It should be noted that the application is the device used by the user, which communicates with the cloud network operation business system. Under normal circumstances, the application is unaware of the existence of the canary cluster, and all API call requests from the application are sent to the gateway of the production cluster. Therefore, in the first implementation, only the routing rules of the first gateway of the production cluster can be updated, so that the gateway of the production cluster can distribute API call requests to the production cluster or the canary cluster based on the routing rules of the second gateway.

[0036] In practical applications, a small number of applications may mistakenly send API call requests to the gateway of the grayscale cluster. Therefore, in the second implementation, the routing rules of the first gateway for the production cluster and the grayscale cluster can be updated so that when the gateway of the grayscale cluster receives an API call request, it can correctly route the API call request to the production cluster or the grayscale cluster based on the normal routing rules of the second gateway.

[0037] Reference Figure 2 In some embodiments, obtaining the first gateway routing rules includes: Step S210: Obtain the original upstream object; the original upstream object is the upstream object of the gateway of the production cluster or the grayscale cluster; Step S220: Generate associated objects for the original upstream object to obtain target objects and path objects; the target object records the address attributes and traffic splitting percentage attributes of the production cluster, as well as the address attributes and traffic splitting percentage attributes of the grayscale cluster. Step S230: Obtain the first gateway routing rule based on the original upstream object, the target object, and the path object.

[0038] In this embodiment of the application, taking the Kong gateway as the gateway of the production cluster as an example, in the first implementation, the original upstream object is used to point to the production cluster. The original upstream object can be an upstream object, and its name can be upstream-prod.

[0039] The generation of associated objects can involve determining the target object and route object of the upstream object. Specifically, the target object can be two target objects. One target object has a `target` attribute that is the production cluster address (i.e., the address attribute of the production cluster) and a `weight` attribute that is the traffic distribution percentage of the production cluster (i.e., the traffic distribution percentage attribute of the production cluster), which can be 1. The other target object has a `target` attribute that is the canary cluster address (i.e., the address attribute of the canary cluster) and a `weight` attribute that is the traffic distribution percentage of the canary cluster (i.e., the traffic distribution percentage attribute of the canary cluster), which can be 0. The route object can be a `route` object, whose `paths` attribute is the URL prefix of the API call request. Then, by binding the two target objects to the upstream object, the first gateway routing rule can be easily obtained by integrating the final original upstream object, target object, and path object.

[0040] In the second implementation, the associated object generation can also generate target objects, route objects, and service objects. The service object can be a service object named `service-prod` with the `host` attribute set to `upstream-prod`. The route object's `service` attribute can also be `service-prod`. Then, by binding the two target objects to the upstream object, the first gateway routing rule can be easily obtained by integrating the final original upstream object, service object, target object, and path object.

[0041] Reference Figure 3 In some embodiments, if the grayscale traffic splitting rule is a percentage-based splitting rule, the step of updating the first gateway routing rule in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rule to obtain the second gateway routing rule includes: Step S310: Perform target object analysis on the grayscale splitting rule to obtain the splitting attribute group of the target object in the grayscale splitting rule. The splitting attribute group includes a first splitting percentage and a second splitting percentage. The first splitting percentage is used to characterize the splitting percentage of the production cluster, and the second splitting percentage is used to characterize the splitting percentage of the grayscale cluster. Step S320: Based on the traffic splitting attribute group, replace the traffic splitting attribute of the target object in the first gateway routing rule to obtain the second gateway routing rule.

[0042] In this embodiment, if the grayscale traffic splitting rule is a percentage-based splitting rule, this percentage-based splitting rule is similar to the aforementioned first gateway routing rule, except that the splitting percentage of the two target objects in the percentage-based splitting rule differs from the splitting percentage of the two target objects in the first gateway routing rule. Specifically, in the percentage-based splitting rule, the splitting percentage of the target object corresponding to the production cluster (i.e., the first splitting percentage) can be any one of 0.7, 0.8, 0.95, etc., while the splitting percentage of the target object corresponding to the grayscale cluster (i.e., the second splitting percentage) can be any one of 0.3, 0.2, 0.05, etc., so that the sum of the first splitting percentage and the second splitting percentage equals 1. It is understandable that the traffic distribution attribute replacement can be to replace the traffic distribution percentage of the target object corresponding to the production cluster in the first gateway routing rule with the first traffic distribution percentage of the traffic distribution attribute group; and to replace the traffic distribution percentage of the target object corresponding to the grayscale cluster in the first gateway routing rule with the second traffic distribution percentage of the traffic distribution attribute group, and then determine the second gateway routing rule based on the replaced first gateway routing rule.

[0043] Reference Figure 4 In some embodiments, updating the first gateway routing rule in the production cluster and / or the grayscale cluster according to the grayscale routing rule to obtain the second gateway routing rule includes: Step S410: Perform routing object analysis on the grayscale splitting rule to obtain the target attribute group of the routing object in the grayscale splitting rule; Step S420: Update the target attributes of the routing objects in the first gateway routing rule according to the target attribute group to obtain the second gateway routing rule; Wherein, if the grayscale traffic splitting rule is a parameter-based traffic splitting rule, the target attribute group is a parameter attribute group, and the parameter attribute group includes several request header parameters required to split the API call request to the grayscale cluster; or, if the grayscale traffic splitting rule is a path-based traffic splitting rule, the target attribute group is a path attribute group, and the path attribute group includes several routing paths required to split the API call request to the grayscale cluster.

[0044] In this embodiment, if the canary deployment rule is a parameter-based deployment rule, the corresponding parameter-based deployment rule may include an original upstream object, a service object, a target object, and a routing object. The original upstream object includes two upstream objects named upstream-gray-1 and upstream-gray-2, where upstream-gray-1 corresponds to the production cluster and upstream-gray-2 corresponds to the canary deployment cluster. The target object includes two target objects, one of which has a target attribute that is the production cluster address and is bound to upstream-gray-1; the other has a target attribute that is the canary deployment cluster address and is bound to upstream-gray-2. The service object includes two service objects, one named service-gray-1 with a host attribute of upstream-gray-1; the other named service-gray-2 with a host attribute of upstream-gray-2. The routing object includes two route objects, one with a service attribute of service-gray-1 and the other with a service attribute of service-gray-2, and the headers attribute contains the parameter name and value used for deployment.

[0045] It is understandable that the parameter attribute group of the parameter routing rule can be easily obtained based on the headers attribute of the service-gray-2 route object. For ease of understanding, this embodiment assumes that the number of request header parameters in the headers attribute is 1, so the headers attribute can be {region:GDY}, which is used to indicate that the request with the request header parameter region=GDY is forwarded to the grayscale cluster.

[0046] In one implementation, updating the target attribute can involve updating the parameter attribute group to the first gateway routing rule and making simple modifications to the first gateway routing rule to obtain a second gateway routing rule that can forward requests containing the request header parameters recorded in the headers attribute to the canary cluster. In another feasible implementation, the parameter attribute group and its associated objects, such as parameter routing rules, can be replaced and updated to the first gateway routing rule to obtain the second gateway routing rule.

[0047] Alternatively, if the grayscale traffic splitting rule is a path traffic splitting rule, the corresponding path traffic splitting rule can also include the original upstream object, service object, target object, and routing object. The content of the original upstream object, service object, and target object in the path traffic splitting rule is similar to the content of the corresponding objects in the aforementioned parameter traffic splitting rule, and can be easily deduced by analogy; therefore, this application will not elaborate further here.

[0048] The routing object in the path routing rule can include two route objects. One route object has a service attribute of service-gray-1, and the other route object has a service attribute of service-gray-2. The paths attribute is the URL path prefix used for routing. The path attribute group of the path routing rule can be simply obtained based on the paths attribute of the service-gray-2 route object. For ease of understanding, this embodiment assumes that the number of request header parameters in the paths attribute is 1, so the paths attribute can be " / ekong / open", which is used to indicate that requests with the URL path prefix " / ekong / open" should be forwarded to the grayscale cluster.

[0049] As for the target attribute update content based on the path attribute group, it is similar to the target attribute update content based on the parameter attribute group mentioned above, and can be easily deduced by analogy. Therefore, this application will not elaborate further here.

[0050] Step S120: The gateway of the production cluster receives an API call request from the application and parses the API call request according to the second gateway routing rules to obtain the target cluster of the API call request; the target cluster is the production cluster or the grayscale cluster. In this embodiment, after obtaining the second gateway routing rule, the canary deployment control platform can distribute the second gateway routing rule to the gateways of the production cluster and / or the canary deployment cluster. Then, the gateway of the production cluster can parse the subsequently received API call requests based on the second gateway routing rule and forward them to the target cluster.

[0051] For illustrative purposes, this embodiment of the application uses the second gateway routing rule updated based on the aforementioned path distribution rule as an example. Request parsing can involve parsing the URL path prefix of the API call request. Specifically, if the URL path prefix of the API call request is " / ekong / open", the target cluster of the API call request can be determined as a grayscale cluster based on the second gateway routing rule; or, if the URL path prefix of the API call request is not " / ekong / open", the target cluster of the API call request can be determined as a production cluster based on the second gateway routing rule.

[0052] It is understandable that for the request parsing situation where the second gateway routing rule is updated based on the aforementioned parameter diversion rule or percentage diversion rule, the same principle applies as described above, and can be easily deduced by analogy. Therefore, this application will not elaborate further here.

[0053] Step S130: The gateway of the production cluster forwards the API call request to the target cluster, so that the grayscale cluster responds to the API call request based on the new version of the service, or the production cluster responds to the API call request based on the old version of the service; the old version of the service is a prior version of the new version of the service.

[0054] In this embodiment, for any API call request received by the gateway of the production cluster, if it is determined that the target cluster of the API call request is a grayscale cluster, the API call request can be forwarded to the grayscale cluster. This allows the grayscale cluster to respond to the API call request based on the new version of the service, thereby achieving the grayscale switching of the API call request from the production cluster to the grayscale cluster. Alternatively, if it is determined that the target cluster of the API call request is the production cluster, the API call request can be forwarded to the production cluster. This allows the production cluster to respond to the API call request based on the old version of the service, ensuring stable response of the API call request in the production cluster and guaranteeing business stability.

[0055] It should be noted that any API call request can be used to retrieve data or trigger specific business operations within the cloud network operation system. For ease of understanding, let's take the example of an API call request triggering cloud service performance monitoring and capacity management within the cloud network operation system. The canary cluster responds to the API call request based on a new version of the service. This response can be the canary cluster executing the new version of the cloud service performance monitoring and capacity management service to provide feedback on performance monitoring and capacity management information to the application corresponding to the API call request. Specifically, performance monitoring information may include network latency, packet loss, throughput, and error rate, while capacity management information may include total capacity, used / remaining capacity, growth rate, peak prediction, and expansion trigger points. The content of other business services is similar to the above.

[0056] The content of the production cluster's request and response to the API call request based on the old version of the service is similar to the content of the gray-scale cluster executing the new version of the business service. It can be simply deduced that the difference is that the production cluster executes the earlier version (old version) of the business service, which will not be elaborated here.

[0057] Reference Figure 5 In some embodiments, the method further includes: Step S510: When a new version of the service is deployed in the grayscale cluster, the grayscale control platform obtains the grayscale scheduling rules and forwards the grayscale scheduling rules to the target cluster. Furthermore, the acquisition of grayscale scheduling rules includes: Obtain several task partitioning dimensions, each of which has a different dimension type; Perform grayscale range analysis on each of the task division dimensions to obtain the grayscale range of each task division dimension; The gray-scale scheduling rules are constructed based on the dimension of each task and the corresponding gray-scale range.

[0058] In this embodiment, the task partitioning dimension is used to characterize the partitioning dimension of subsequent data collection tasks. It may include a region dimension, a model dimension, a network type dimension, and a data type dimension. The region dimension is used to characterize the region attribute of the network element associated with the data collection task, which is usually a province or city. The model dimension is used to characterize the manufacturer and equipment model of the network element associated with the data collection task, and the manufacturer may be an equipment manufacturer. The network type dimension is used to characterize the network type attribute of the network element associated with the data collection task, such as 5G core network, 5G wireless network, new metropolitan area network, etc. The data type dimension is used to characterize the data type of the data collection source associated with the data collection task, such as performance data, traffic data, configuration information, etc.

[0059] For any task partitioning dimension, grayscale range analysis is used to determine the value range of each task partitioning dimension, denoted as the grayscale range. Specifically, taking the region dimension as an example, the grayscale range of this region dimension can be determined as province A and province B. This grayscale range is used to characterize the value range of the collection tasks executed by the grayscale cluster scheduling in the region dimension. The grayscale ranges of other types of task partitioning dimensions are similarly derived and can be easily deduced. As for the grayscale scheduling rules, they can be simply obtained by integrating each task partitioning dimension and its corresponding grayscale range.

[0060] Step S520: The target cluster acquires the acquisition task and performs cluster analysis on the acquisition task according to the gray-scale scheduling rule to obtain the cluster identifier of the acquisition task. Further, the step of performing cluster analysis on the acquisition tasks according to the gray-scale scheduling rules to obtain the cluster identifier of the acquisition tasks includes: The acquisition task is analyzed to obtain several task attributes, and each task attribute corresponds to a task division dimension in the gray-scale scheduling rule. Based on each task attribute, range matching is performed on the corresponding gray range in the gray-scale scheduling rule to obtain matching information for each task attribute; If all the matching information matches, the cluster identifier of the acquisition task is determined as the grayscale cluster identifier; or, if at least one of the matching information does not match, the acquisition task is determined as the production cluster identifier.

[0061] In this embodiment, the acquisition task is used to characterize the data acquisition operation that the cluster needs to schedule and execute. Attribute analysis can be used to analyze the attributes of the network elements / acquisition sources associated with the acquisition task in the cloud network operation business system. Specifically, the acquisition source can be a network entity or data interface endpoint that collects data in the cloud network operation business system, thereby obtaining the task attributes of the acquisition task in each task division dimension.

[0062] For ease of understanding, the embodiments of this application will subsequently use the region dimension and network type dimension in the task division dimensions of attribute analysis as examples. The content of other unmentioned task division dimensions can be deduced by analogy. Attribute analysis can first analyze the region attribute of the network element associated with a certain data collection task. If the region attribute of the network element associated with the data collection task is province A, then province A is determined as a task attribute of the data collection task. Secondly, it can analyze the network type attribute of the network element associated with the data collection task. If the network type attribute of the network element associated with the data collection task is a new type of metropolitan area network, then the new type of metropolitan area network is determined as another task attribute of the data collection task.

[0063] Understandably, for any task attribute, range matching can be achieved by determining whether it falls within the grayscale range of the corresponding task division dimension to obtain matching information for each task attribute. For example, for the task attribute "Province A" in a data collection task, it can be determined whether the task attribute falls within the grayscale range of the region dimension. If the grayscale range of the region dimension includes Province A, matching information indicating a match can be generated; conversely, if the grayscale range of the region dimension does not include Province A, matching information indicating a mismatch can be generated.

[0064] It should be noted that if all the matching information for each task attribute of the data collection task is a match, it means that the data collection task can be scheduled and executed by the gray-scale cluster. In this case, the cluster identifier of the data collection task can be determined as the gray-scale cluster identifier. Alternatively, if at least one task attribute of the data collection task is not a match, it means that the data collection task is scheduled and executed by the production cluster. In this case, the cluster identifier of the data collection task can be determined as the production cluster identifier.

[0065] Step S530: If the cluster identifier of the acquisition task is the same as the cluster identifier of the target cluster, then the target cluster responds to the acquisition task. Alternatively, in step S540, if the cluster identifier of the acquisition task is different from the cluster identifier of the target cluster, the acquisition task is forwarded to a non-target cluster through the gateway of the target cluster, so that the non-target cluster can respond to and execute the acquisition task. The non-target cluster refers to the clusters other than the target cluster in the production cluster and the grayscale cluster.

[0066] In this embodiment, taking the target cluster as a grayscale cluster and the non-target cluster as a production cluster as an example, if the cluster identifier of the collection task is the grayscale cluster identifier, it means that the cluster identifier of the collection task is the same as the cluster identifier of the grayscale cluster. In this case, the collection task can be executed through the grayscale cluster. Specifically, the data collection operation indicated by the collection task is executed through the grayscale cluster, such as collecting performance data, traffic data, configuration information, etc.; or, if the cluster identifier of the collection task is the production cluster identifier, it means that the cluster identifier of the collection task is different from the cluster identifier of the target cluster, the grayscale cluster. In this case, the collection task can be forwarded to the production cluster through the gateway of the production cluster via the gateway of the grayscale cluster, so that the non-target cluster, the production cluster, can execute the collection task.

[0067] It is understandable that the target cluster is the production cluster, and the non-target cluster is the grayscale cluster. The content is similar to the aforementioned content and can be easily deduced, so this application will not elaborate further here.

[0068] Please see Figure 6 This application also provides a grayscale switching system, including a grayscale control platform, a production cluster, and a grayscale cluster. The grayscale control platform 601 is used to obtain grayscale traffic splitting rules when a new version of the service is deployed in the grayscale cluster, and update the first gateway routing rules in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rules to obtain the second gateway routing rules; the grayscale traffic splitting rules are any one of percentage traffic splitting rules, parameter traffic splitting rules, and path traffic splitting rules. The gateway 602 of the production cluster is used to receive API call requests from the application end, and to parse the API call requests according to the second gateway routing rules to obtain the target cluster of the API call request; the target cluster is the production cluster or the grayscale cluster; the API call request is forwarded to the target cluster so that the grayscale cluster responds to the API call request based on the new version service, or the production cluster responds to the API call request based on the old version service; the old version service is a prior version of the new version service.

[0069] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0070] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0071] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0072] Please see Figure 7 , Figure 7 This illustration depicts the hardware structure of an electronic device according to one embodiment. The electronic device includes: The processor 701 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 702 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 702 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 702 and is called and executed by the processor 701. The input / output interface 703 is used to implement information input and output; The communication interface 704 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 705 transmits information between various components of the device (e.g., processor 701, memory 702, input / output interface 703, and communication interface 704); The processor 701, memory 702, input / output interface 703, and communication interface 704 are connected to each other within the device via bus 705.

[0073] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0074] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0075] This application also discloses a computer program product or computer program, which includes computer instructions stored in the aforementioned computer-readable storage medium; the processor of the aforementioned electronic device can read the computer instructions from the aforementioned computer-readable storage medium, and the processor executes the computer instructions, causing the electronic device to perform the aforementioned method embodiment.

[0076] It is understood that the content of the above method embodiments is applicable to this computer program product or computer program embodiment. The specific functions implemented by this computer program product or computer program embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0077] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0078] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0079] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0080] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0081] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0082] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0083] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0084] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0085] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0086] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0087] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0088] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A grayscale switching method, characterized in that, The method, applied to a grayscale switching system, which includes a grayscale control platform, a production cluster, and a grayscale cluster, comprises: When a new version of the service is deployed in the grayscale cluster, the grayscale control platform obtains the grayscale traffic splitting rules and updates the first gateway routing rules in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rules to obtain the second gateway routing rules; the grayscale traffic splitting rules are any one of percentage traffic splitting rules, parameter traffic splitting rules, and path traffic splitting rules. The gateway of the production cluster receives API call requests from the application and parses the API call requests according to the second gateway routing rules to obtain the target cluster of the API call requests; the target cluster is the production cluster or the grayscale cluster. The gateway of the production cluster forwards the API call request to the target cluster, so that the grayscale cluster responds to the API call request based on the new version of the service, or the production cluster responds to the API call request based on the old version of the service; the old version of the service is a prior version of the new version of the service.

2. The method according to claim 1, characterized in that, If the grayscale traffic splitting rule is a percentage-based splitting rule, the step of updating the first gateway routing rule in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rule to obtain the second gateway routing rule includes: The grayscale splitting rule is analyzed for target objects to obtain a splitting attribute group for the target objects in the grayscale splitting rule. The splitting attribute group includes a first splitting percentage and a second splitting percentage. The first splitting percentage is used to characterize the splitting percentage of the production cluster, and the second splitting percentage is used to characterize the splitting percentage of the grayscale cluster. Based on the traffic splitting attribute group, the traffic splitting attributes of the target object in the first gateway routing rule are replaced to obtain the second gateway routing rule.

3. The method according to claim 1, characterized in that, The step of updating the first gateway routing rule in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rule to obtain the second gateway routing rule includes: Perform routing object analysis on the grayscale splitting rule to obtain the target attribute group of the routing object in the grayscale splitting rule; Based on the target attribute group, the target attributes of the routing objects in the first gateway routing rule are updated to obtain the second gateway routing rule; Wherein, if the grayscale traffic splitting rule is a parameter-based traffic splitting rule, the target attribute group is a parameter attribute group, and the parameter attribute group includes several request header parameters required to split the API call request to the grayscale cluster; or, if the grayscale traffic splitting rule is a path-based traffic splitting rule, the target attribute group is a path attribute group, and the path attribute group includes several routing paths required to split the API call request to the grayscale cluster.

4. The method according to any one of claims 1-3, characterized in that, Obtain the routing rules for the first gateway, including: Obtain the original upstream object; the original upstream object is the upstream object of the gateway of the production cluster or the grayscale cluster; The original upstream object is associated with an object to generate a target object and a path object; the target object records the address attribute and traffic splitting percentage attribute of the production cluster, as well as the address attribute and traffic splitting percentage attribute of the grayscale cluster. The first gateway routing rule is obtained based on the original upstream object, the target object, and the path object.

5. The method according to claim 1, characterized in that, The method further includes: When a new version of the service is deployed in the grayscale cluster, the grayscale control platform obtains the grayscale scheduling rules and forwards the grayscale scheduling rules to the target cluster. The target cluster acquires the acquisition tasks and performs cluster analysis on the acquisition tasks according to the gray-scale scheduling rules to obtain the cluster identifier of the acquisition tasks. If the cluster identifier of the data collection task is the same as the cluster identifier of the target cluster, the target cluster will respond to and execute the data collection task; or, if the cluster identifier of the data collection task is different from the cluster identifier of the target cluster, the data collection task will be forwarded to a non-target cluster through the gateway of the target cluster, so that the non-target cluster will respond to and execute the data collection task. The non-target cluster refers to the clusters other than the target cluster in the production cluster and the grayscale cluster.

6. The method according to claim 5, characterized in that, The acquisition of gray-scale scheduling rules includes: Obtain several task partitioning dimensions, each of which has a different dimension type; Perform grayscale range analysis on each of the task division dimensions to obtain the grayscale range of each task division dimension; The gray-scale scheduling rules are constructed based on the dimension of each task and the corresponding gray-scale range.

7. The method according to claim 6, characterized in that, The step of performing cluster analysis on the acquisition tasks according to the gray-scale scheduling rules to obtain the cluster identifier of the acquisition tasks includes: The acquisition task is analyzed to obtain several task attributes, and each task attribute corresponds to a task division dimension in the gray-scale scheduling rule. Based on each task attribute, range matching is performed on the corresponding gray range in the gray-scale scheduling rule to obtain matching information for each task attribute; If all the matching information matches, the cluster identifier of the acquisition task is determined as the grayscale cluster identifier; or, if at least one of the matching information does not match, the acquisition task is determined as the production cluster identifier.

8. A grayscale switching system, characterized in that, This includes a grayscale control platform, a production cluster, and a grayscale cluster; The grayscale control platform is used to obtain grayscale traffic splitting rules when a new version of the service is deployed in the grayscale cluster, and update the first gateway routing rules in the production cluster and / or the grayscale cluster according to the grayscale traffic splitting rules to obtain the second gateway routing rules; the grayscale traffic splitting rules are any one of percentage traffic splitting rules, parameter traffic splitting rules, and path traffic splitting rules. The gateway of the production cluster is used to receive API call requests from the application and, according to the second gateway routing rules, parse the API call requests to obtain the target cluster of the API call requests. The target cluster is either the production cluster or the grayscale cluster; The API call request is forwarded to the target cluster, so that the grayscale cluster responds to the API call request based on the new version of the service, or the production cluster responds to the API call request based on the old version of the service; The older version of the service is the earlier version of the new version of the service.

9. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.