CN113315824B - Application gray scale publishing method and device and application gray scale publishing system - Google Patents
Application gray scale publishing method and device and application gray scale publishing system Download PDFInfo
- Publication number
- CN113315824B CN113315824B CN202110563158.XA CN202110563158A CN113315824B CN 113315824 B CN113315824 B CN 113315824B CN 202110563158 A CN202110563158 A CN 202110563158A CN 113315824 B CN113315824 B CN 113315824B
- Authority
- CN
- China
- Prior art keywords
- gateway
- grayscale
- application
- traffic
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本申请实施例提供一种应用的灰度发布方法、装置及应用的灰度发布系统,涉及计算机技术领域。该方法包括接收针对当前应用的、灰度发布的流量分配规则数据;根据预设的网关与应用的映射关系数据获取与当前应用对应的网关;调用配置管理中心接口,将所述流量分配规则数据发送至所述网关,以使所述网关根据所述流量分配规则实现所述当前应用的灰度发布,实现新版本流量可精确控制的灰度发布,从而解决相关技术在发布上线应用时可能对用户操作产生较大影响的问题。
Embodiments of the present application provide a method and device for distributing gray levels of applications, and a system for distributing gray levels of applications, which relate to the technical field of computers. The method includes receiving traffic distribution rule data released in grayscale for the current application; obtaining the gateway corresponding to the current application according to the preset mapping relationship data between the gateway and the application; calling the interface of the configuration management center to convert the traffic distribution rule data Send it to the gateway, so that the gateway can implement the gray-scale release of the current application according to the traffic distribution rules, and realize the gray-scale release of the new version of the traffic that can be precisely controlled, so as to solve the problem that related technologies may have when releasing online applications. Problems where user actions have a large impact.
Description
技术领域technical field
本申请涉及计算机技术领域,具体而言,涉及一种应用的灰度发布方法、装置及应用的灰度发布系统。The present application relates to the field of computer technology, and in particular, relates to an applied gray scale release method, device and applied gray scale release system.
背景技术Background technique
现有的应用发布方法包括两种,一种是全量滚动发布,只能对线上所有应用实例一次性的全量发布,发布完成后对新版本进行回归验证,如果新版本应用存在bug,则可能对用户操作产生较大影响,也可能产生较多的脏数据;另一种是分批发布,可以通过发布指定数量的新版本实例,完成对新版本应用的验证,但只能通过新版本容器实例数与旧版本容器实例数的比例来控制新版本应用的流量,同样存在影响较多用户的可能。There are two existing application release methods. One is full rolling release, which can only release all online application instances at one time. After the release is completed, regression verification is performed on the new version. It has a great impact on user operations, and may also generate more dirty data; the other is batch release, which can complete the verification of the new version of the application by publishing a specified number of new version instances, but only through the new version container The ratio of the number of instances to the number of container instances of the old version is used to control the traffic of the new version of the application, which may also affect more users.
发明内容Contents of the invention
本申请实施例的目的在于提供一种应用的灰度发布方法、装置及应用的灰度发布系统,实现新版本流量可精确控制的灰度发布,从而解决现有方法在发布上线应用时可能对用户操作产生较大影响的问题。The purpose of the embodiments of the present application is to provide a grayscale release method and device for an application, and a grayscale release system for an application, so as to realize the grayscale release of new version traffic that can be precisely controlled, so as to solve the problems that may occur when the existing method publishes an online application. Problems where user actions have a large impact.
本申请实施例提供了一种应用的灰度发布方法,该方法包括:An embodiment of the present application provides a method for grayscale release of an application, which includes:
接收针对当前应用的、灰度发布的流量分配规则数据;Receive grayscale published traffic distribution rule data for the current application;
根据预设的网关与应用的映射关系数据获取与所述当前应用对应的网关;Acquiring the gateway corresponding to the current application according to the preset mapping relationship data between the gateway and the application;
调用配置管理中心接口,将所述流量分配规则数据发送至所述网关,以使所述网关根据所述流量分配规则实现所述当前应用的灰度发布。Calling the interface of the configuration management center to send the traffic distribution rule data to the gateway, so that the gateway implements the gray release of the current application according to the traffic distribution rule.
在上述实现过程中,通过流量分配规则数据对新版本容器实例数量进行控制,进行新版本流量可精确控制的灰度发布,从而解决现有方法在发布上线应用时可能对用户操作产生较大影响的问题。In the above implementation process, the number of new version container instances is controlled through traffic distribution rule data, and the gray scale release of the new version traffic can be precisely controlled, so as to solve the problem that the existing method may have a great impact on user operations when publishing online applications The problem.
进一步地,所述流量分配规则数据包括灰度容器数量和灰度流量比例,所述接收针对当前应用的、灰度发布的流量分配规则数据,包括:Further, the traffic distribution rule data includes grayscale container quantity and grayscale traffic ratio, and receiving grayscale published traffic distribution rule data for the current application includes:
接收用户通过灰度数据配置界面发送的灰度容器数量;Receive the number of grayscale containers sent by the user through the grayscale data configuration interface;
修改控制应用副本数的副本数属性值,以控制灰度应用实例数量;Modify the copy number attribute value that controls the number of application copies to control the number of grayscale application instances;
在所述灰度应用实例的启动脚本中添加灰度标记,以使所述网关通过所述灰度标记找到灰度应用实例;Adding a grayscale tag to the startup script of the grayscale application instance, so that the gateway can find the grayscale application instance through the grayscale tag;
接收用户通过灰度数据配置界面发送的灰度流量比例,以使所述网关将对应所述灰度流量比例的流量发送至对应的灰度应用实例。Receive the grayscale traffic ratio sent by the user through the grayscale data configuration interface, so that the gateway sends the traffic corresponding to the grayscale traffic ratio to the corresponding grayscale application instance.
在上述实现过程中,通过灰度容器数量控制灰度应用实例数量,并通过添加灰度标记,为后续网关中对灰度应用实例进行流量分配做准备。In the above implementation process, the number of grayscale application instances is controlled by the number of grayscale containers, and by adding grayscale tags, preparations are made for traffic allocation to grayscale application instances in subsequent gateways.
进一步地,在所述根据预设的网关与应用的映射关系数据获取与所述当前应用对应的网关的步骤之前,所述方法还包括:Further, before the step of obtaining the gateway corresponding to the current application according to the preset mapping relationship data between the gateway and the application, the method further includes:
接收网关管理界面通过网关管理服务发送的网关与应用的映射关系数据;Receive the mapping relationship data between the gateway and the application sent by the gateway management interface through the gateway management service;
存储所述映射关系数据至数据库。storing the mapping relationship data in a database.
在上述实现过程中,将网关与应用的映射关系存入MySQL数据库,后续在应用进行发布时,能够获取到该应用对应的流量入口网关。In the above implementation process, the mapping relationship between the gateway and the application is stored in the MySQL database, and the traffic entry gateway corresponding to the application can be obtained later when the application is released.
进一步地,所述调用配置管理中心接口,将所述流量分配规则数据发送至所述网关,包括:Further, the calling configuration management center interface, and sending the traffic distribution rule data to the gateway include:
根据所述流量分配规则数据生成灰度流量配置数据结构,所述灰度流量配置数据结构包括网关ID和流量比例;Generate a gray-scale traffic configuration data structure according to the traffic distribution rule data, the gray-scale traffic configuration data structure includes a gateway ID and a traffic ratio;
调用配置管理中心接口,将所述网关ID和对应的流量比例下发至对应的网关。Call the interface of the configuration management center, and deliver the gateway ID and the corresponding traffic ratio to the corresponding gateway.
在上述实现过程中,将网关ID和对应的流量比例下发至对应的网关,使得该网关能够按照该流量比例对新版本实例分配流量。In the above implementation process, the gateway ID and the corresponding traffic ratio are sent to the corresponding gateway, so that the gateway can allocate traffic to the new version instance according to the traffic ratio.
进一步地,所述网关根据所述流量分配规则实现所述当前应用的灰度发布,包括:Further, the gateway realizes the gray release of the current application according to the traffic distribution rule, including:
所述网关将所述应用发布、并运行于云主机上或k8s容器平台上。The gateway publishes and runs the application on a cloud host or a k8s container platform.
在上述实现过程中,将应用运行在普通云主机上,并非运行在容器中,因此该方法并不限定发布和运行对象。In the above implementation process, the application is run on a common cloud host, not in a container, so this method does not limit the publishing and running objects.
进一步地,所述网关为灰度流量比例控制路由,包括Spring Cloud Zuul网关和/或Kong网关。Further, the gateway controls routing for the proportion of gray traffic, including Spring Cloud Zuul gateway and/or Kong gateway.
在上述实现过程中,只要具有灰度流量比例控制路由均可应用于该方法中。In the above implementation process, as long as there is a gray-scale traffic ratio control route, it can be applied to this method.
本申请实施例还提供一种应用的灰度发布装置,所述装置包括:The embodiment of the present application also provides an application gray scale release device, the device includes:
接收模块,用于接收针对当前应用的、灰度发布的流量分配规则数据;The receiving module is used to receive traffic distribution rule data published in gray scale for the current application;
网关获取模块,用于根据预设的网关与应用的映射关系数据获取与所述当前应用对应的网关;A gateway obtaining module, configured to obtain the gateway corresponding to the current application according to the preset mapping relationship data between the gateway and the application;
下发模块,用于调用配置管理中心接口,将所述流量分配规则数据发送至所述网关,以使所述网关根据所述流量分配规则实现所述当前应用的灰度发布。A delivery module, configured to call the interface of the configuration management center, and send the data of the traffic distribution rules to the gateway, so that the gateway can implement gray-scale release of the current application according to the traffic distribution rules.
在上述实现过程中,通过对新版本流量进行精确控制的灰度发布,使得开发或测试人员可以在白天随时对应用进行线上发布操作,因为可以通过精准的流量控制来规避发布上线应用时产生问题而带来的风险和损失,且而不用像现有方法一样,只能在深夜流量低峰时段进行新应用的上线发布,提高便利性。In the above implementation process, through the grayscale release of the new version traffic with precise control, developers or testers can release the application online at any time during the day, because precise traffic control can be used to avoid the occurrence of problems when releasing the online application. Risks and losses caused by problems, and instead of the existing method, new applications can only be released online during low-peak traffic hours in the middle of the night to improve convenience.
本申请实施例还提供一种应用的灰度发布系统,所述系统包括:The embodiment of the present application also provides an application gray scale release system, the system includes:
灰度数据配置界面,用于接收用户发送的流量分配规则数据,并将所述流量分配规则数据发送至网关管理服务;Gray scale data configuration interface, used to receive the traffic distribution rule data sent by the user, and send the traffic distribution rule data to the gateway management service;
所述网关管理服务,用于将所述流量分配规则数据存储至数据库,并在应用发布时,调用配置管理中心接口,基于预先存储的网关与应用的映射关系数据将所述流量分配规则数据发送至与当前应用对应的网关;The gateway management service is used to store the traffic distribution rule data in a database, and when the application is published, call the interface of the configuration management center to send the traffic distribution rule data based on the pre-stored mapping relationship data between the gateway and the application to the gateway corresponding to the current application;
配置管理中心,与多个网关连接,用于向所述网关下发流量分配规则数据,以使所述网关根据所述流量分配规则实现所述当前应用的灰度发布。The configuration management center is connected to a plurality of gateways, and is configured to issue traffic distribution rule data to the gateways, so that the gateways can realize the gray release of the current application according to the traffic distribution rules.
在上述实现过程中,通过灰度数据配置界面、网关管理服务、配置管理中心以及网关的相互配合,在灰度发布时实现对新版本流量的精确控制。In the above implementation process, through the cooperation of grayscale data configuration interface, gateway management service, configuration management center and gateway, precise control of the traffic of the new version is realized when grayscale releases.
进一步地,所述网关还用于在对新版本实例进行回归测试时,在http测试请求的请求头中添加应用实例启动标记后,将所述http测试请求发送至所述新版版本实例。Further, the gateway is also used for sending the http test request to the new version instance after adding an application instance start tag in the request header of the http test request when performing a regression test on the new version instance.
在上述实现过程中,在网关中通过应用实例启动标记进行流量按百分比路由,同时针对特定header标签的http测试请求进行特定路由,直接路由到新版本实例,进行有效地回归测试。In the above implementation process, the traffic is routed by percentage through the application instance startup tag in the gateway, and at the same time, specific routing is performed for the http test request with a specific header tag, and it is directly routed to the new version instance for effective regression testing.
本申请实施例还提供一种电子设备,所述电子设备包括存储器以及处理器,所述存储器用于存储计算机程序,所述处理器运行所述计算机程序以使所述电子设备执行上述中任一项所述的应用的灰度发布方法。The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform any of the above The grayscale publishing method of the application described in the item.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings that need to be used in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, so It should not be regarded as a limitation on the scope, and those skilled in the art can also obtain other related drawings according to these drawings without creative work.
图1为本申请实施例提供的一种应用的灰度发布方法的流程图;FIG. 1 is a flow chart of an applied gray scale publishing method provided by an embodiment of the present application;
图2为本申请实施例提供的对灰度发布的流量分配比例修改流程图;FIG. 2 is a flow chart for modifying the traffic distribution ratio for gray release provided by the embodiment of the present application;
图3为本申请实施例提供的灰度发布系统的结构框图;Fig. 3 is a structural block diagram of the grayscale release system provided by the embodiment of the present application;
图4为本申请实施例提供的调整灰度容器数量的界面示意图;FIG. 4 is a schematic diagram of an interface for adjusting the number of grayscale containers provided by the embodiment of the present application;
图5为本申请实施例提供的调整灰度流量比例的界面示意图;Fig. 5 is a schematic diagram of the interface for adjusting the gray flow ratio provided by the embodiment of the present application;
图6为本申请实施例提供的流量比例分配示意图;FIG. 6 is a schematic diagram of flow ratio distribution provided by the embodiment of the present application;
图7为本申请实施例提供的灰度发布装置的结构框图;FIG. 7 is a structural block diagram of a grayscale release device provided by an embodiment of the present application;
图8为本申请实施例提供的灰度发布装置的具体结构框图;FIG. 8 is a specific structural block diagram of a grayscale distribution device provided by an embodiment of the present application;
图9为本申请实施例提供的回归测试示意图。FIG. 9 is a schematic diagram of a regression test provided in the embodiment of the present application.
图标:icon:
100-接收模块;101-容器数量接收模块;102-修改模块;103-标记模块;104-流量比例接收模块;200-网关获取模块;210-存储模块;300-下发模块;301-数据结构生成模块;302-调用模块;11-网关管理服务;12-灰度数据配置界面;13-MySQL数据库;14-配置管理中心;15-网关;16-网关管理界面。100-receiving module; 101-container quantity receiving module; 102-modification module; 103-marking module; 104-flow ratio receiving module; 200-gateway acquisition module; 210-storage module; Generation module; 302-calling module; 11-gateway management service; 12-grayscale data configuration interface; 13-MySQL database; 14-configuration management center; 15-gateway; 16-gateway management interface.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second" and the like are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
请参看图1,图1为本申请实施例提供的一种应用的灰度发布方法的流程图。该方法通过精准控制新版本的流量从而实现精准控制的进行灰度发布的目的。Please refer to FIG. 1 . FIG. 1 is a flow chart of an application grayscale publishing method provided by an embodiment of the present application. This method precisely controls the traffic of the new version to achieve the purpose of precise and controlled gray scale release.
该方法可基于k8s(容器编排管理工具)容器平台并结合Spring Cloud Gateway网关实现新版本容器实例数量的精准可控,其中,Spring Cloud Gateway网关是springcloud微服务治理框架中的网关组件,负责将外部流量请求分发路由到各个微服务。当然,也可以使用其他类型的灰度流量比例控制路由实现,比如通过Spring Cloud Zuul网关或Kong网关实现,对于网关的类型在此不做任何限定。This method can be based on the k8s (container orchestration management tool) container platform and combined with the Spring Cloud Gateway gateway to achieve precise controllability of the number of new version container instances. Among them, the Spring Cloud Gateway gateway is a gateway component in the springcloud microservice governance framework. Traffic requests are distributed and routed to each microservice. Of course, you can also use other types of grayscale traffic ratio control routing implementations, such as through Spring Cloud Zuul gateway or Kong gateway, and there is no limitation on the type of gateway.
该方法具体包括以下步骤:The method specifically includes the following steps:
步骤S100:接收针对当前应用的、灰度发布的流量分配规则数据;Step S100: receiving traffic distribution rule data released in grayscale for the current application;
其中,流量分配规则数据包括灰度容器数量和灰度流量比例,如图2所示,为对灰度发布的流量分配比例修改流程图,对该步骤具体可以包括:Among them, the traffic allocation rule data includes the number of grayscale containers and the grayscale traffic ratio. As shown in Figure 2, the flow chart is modified for the traffic distribution ratio published by grayscale. This step can specifically include:
步骤S101:接收用户通过灰度数据配置界面12发送的灰度容器数量;Step S101: receiving the number of grayscale containers sent by the user through the grayscale
步骤S102:修改控制应用副本数的副本数属性值,以控制灰度应用实例数量;Step S102: Modify the copy number attribute value controlling the number of application copies to control the number of gray scale application instances;
步骤S103:在所述灰度应用实例的启动脚本中添加灰度标记,以使所述网关15通过所述灰度标记找到灰度应用实例;Step S103: adding a grayscale mark in the startup script of the grayscale application instance, so that the
步骤S104:接收用户通过灰度数据配置界面12发送的灰度流量比例,以使所述网关15将对应所述灰度流量比例的流量发送至对应的灰度应用实例。Step S104: Receive the grayscale traffic ratio sent by the user through the grayscale
如图3所示,为灰度发布系统的结构框图,其中,灰度数据配置界面12可为多媒体发布系统(如轻舟CD发布系统)的配置界面,在其上进行应用发布时,发布的过程中可以控制新版本容器实例的数量,也可控制达到新版本容器实例的流量百分比。As shown in Figure 3, it is a structural block diagram of the grayscale distribution system, wherein the grayscale
如图4所示,为调整灰度容器数量的界面示意图。可以在操作界面上修改灰度容器数量,在操作界面上修改灰度容器数量后,底层通过k8s容器管理平台,修改控制应用副本数的deployment的副本数属性值,达到控制灰度应用实例数量的目的。As shown in Figure 4, it is a schematic diagram of the interface for adjusting the number of gray scale containers. You can modify the number of grayscale containers on the operation interface. After modifying the number of grayscale containers on the operation interface, the bottom layer uses the k8s container management platform to modify the copy number attribute value of the deployment that controls the number of application copies, so as to control the number of grayscale application instances. Purpose.
对于灰度应用实例,通过在灰度应用实例的启动脚本中添加启动参数(做灰度标记),如:eureka.instance.metadataMap.version=grayTest,以为后续网关15对灰度应用实例进行流量分配做好准备,通过灰度标记可准确找到需要分配流量的灰度应用实例。For grayscale application instances, by adding startup parameters (marked as grayscale) in the startup script of grayscale application instances, such as: eureka.instance.metadataMap.version=grayTest, traffic distribution for
如图5所示,为调整灰度流量比例的界面示意图,可以在操作界面上修改灰度流量比例。在操作界面上修改灰度流量比例后,后续可通过网关15与应用的映射关系找到对应的网关15,更新网关15针对当前应用的灰度流量分配规则,完成流量针对灰度容器实例的精准分配。As shown in Figure 5, it is a schematic diagram of the interface for adjusting the grayscale flow ratio, and the grayscale flow ratio can be modified on the operation interface. After modifying the grayscale traffic ratio on the operation interface, you can find the
步骤S200:根据预设的网关15与应用的映射关系数据获取与所述当前应用对应的网关15;Step S200: Obtain the
在该步骤之前,还需要:Before this step, you also need:
步骤S210:接收网关管理界面16通过网关管理服务11发送的网关15与应用的映射关系数据;Step S210: receiving the mapping relationship data between the
步骤S211:存储所述映射关系数据至数据库。Step S211: storing the mapping relationship data in a database.
由于不同的应用可能对应不同的网关15,因此需要通过网关管理界面16如轻舟网关管理界面16维护网关15与应用的映射关系。通过网关管理服务11如Gateway AdminService服务将网关15与应用的映射关系存入MySQL数据库13,以便后续在应用进行发布时,能够获取到该应用对应的流量入口网关15。Since different applications may correspond to
步骤S300:调用配置管理中心14接口,将所述流量分配规则数据发送至所述网关15,以使网关15根据流量分配规则实现当前应用的灰度发布。Step S300: call the interface of the
该步骤具体可以包括:This step can specifically include:
步骤S301:根据所述流量分配规则数据生成灰度流量配置数据结构,所述灰度流量配置数据结构包括网关ID和流量比例;Step S301: Generate a grayscale traffic configuration data structure according to the traffic distribution rule data, and the grayscale traffic configuration data structure includes a gateway ID and a traffic ratio;
下发至网关15的灰度流量配置数据结构如下:The grayscale traffic configuration data structure sent to the
步骤S302:调用配置管理中心14接口,将所述网关ID和对应的流量比例下发至对应的网关15。Step S302: call the interface of the
应用发布过程中,可以控制新版本容器实例的数量,也可控制达到新版本容器实例的流量百分比。During the application publishing process, you can control the number of container instances of the new version and the percentage of traffic reaching the container instances of the new version.
通过上述中维护更新的应用与网关15关联关系,找到应用对应的网关15,然后调用apollo配置中的新接口,更新网关15中针对该应用的灰度流量分配规则,完成流量针对灰度容器实例的精准分配。Find the
如图6所示,为流量比例分配示意图,在用户发起http请求时,网关15利用灰度应用实例的标记(灰度标记)如eureka.instance.metadataMap.version=grayTest,将10%的用户流量分配到新版本实例,而稳定版本的3个实例平均分配剩下的90%的用户流量,从而达到新版本流量精确控制的目的,解决了现有方法在发布上线应用时可能对用户操作产生较大影响的问题。As shown in Figure 6, it is a schematic diagram of traffic ratio distribution. When a user initiates an http request, the
此外,应用除了运行在k8s容器平台外,作为另一种实施方式,应用也运行在普通云主机上,而并非运行在容器中,对于各种微服务应用的运行主体不做限定,以扩大该方法的使用范围。In addition, in addition to the application running on the k8s container platform, as another implementation method, the application also runs on a common cloud host instead of running in a container. There is no restriction on the running subject of various microservice applications, so as to expand the The scope of use of the method.
本申请实施例还提供一种应用的灰度发布装置,应用于上述的应用的灰度发布方法,如图7所示,为灰度发布装置的结构框图,该装置包括:The embodiment of the present application also provides an applied grayscale distribution device, which is applied to the above-mentioned applied grayscale distribution method, as shown in FIG. 7 , which is a structural block diagram of the grayscale distribution device. The device includes:
接收模块100,用于接收针对当前应用的、灰度发布的流量分配规则数据;The receiving
网关获取模块200,用于根据预设的网关15与应用的映射关系数据获取与所述当前应用对应的网关15;A
下发模块300,用于调用配置管理中心14接口,将所述流量分配规则数据发送至所述网关15,以使所述网关根据所述流量分配规则实现所述当前应用的灰度发布。The sending
如图8所示,为灰度发布装置的具体结构框图,其中,接收模块100包括:As shown in FIG. 8 , it is a specific structural block diagram of a grayscale release device, wherein the receiving
容器数量接收模块101,用于接收用户通过灰度数据配置界面12发送的灰度容器数量;The container
修改模块102,用于修改控制应用副本数的副本数属性值,以控制灰度应用实例数量;A
标记模块103,用于在所述灰度应用实例的启动脚本中添加灰度标记,以使所述网关15通过所述灰度标记找到灰度应用实例;A
流量比例接收模块104,接收用户通过灰度数据配置界面12发送的灰度流量比例,以使所述网关15将对应所述灰度流量比例的流量发送至对应的灰度应用实例。The traffic
该装置还包括:存储模块210:The device also includes: a storage module 210:
接收网关管理界面16通过网关管理服务11发送的网关15与应用的映射关系数据;receiving the mapping relationship data between the
存储所述映射关系数据至数据库。storing the mapping relationship data in a database.
下发模块300包括:The
数据结构生成模块301,用于根据所述流量分配规则数据生成灰度流量配置数据结构,所述灰度流量配置数据结构包括网关ID和流量比例;A data
调用模块302,用于调用配置管理中心14接口,将所述网关ID和对应的流量比例下发至对应的网关15。The calling
本申请实施例还提供一种应用的灰度发布系统,其结构框图如图3所示,该系统包括:The embodiment of the present application also provides an applied gray scale publishing system, the structural block diagram of which is shown in Figure 3, the system includes:
灰度数据配置界面12,用于接收用户发送的流量分配规则数据,并将所述流量分配规则数据发送至网关管理服务11;Gray scale
所述网关管理服务11,用于将所述流量分配规则数据存储至数据库,并在应用发布时,调用配置管理中心14接口,将所述流量分配规则数据基于预先存储的网关15与应用的映射关系数据发送至与当前应用对应的网关15;The
配置管理中心14,与多个网关15连接,用于向所述网关15下发流量分配规则数据,以使所述网关根据所述流量分配规则实现所述当前应用的灰度发布。The
此外,还包括MySQL数据库13,用于存储网关15与应用的映射关系数据。由于不同的应用可能对应不同的网关15,因此可将两者的关系数据进行存储,不但有利于及时更新和维护该关系数据,还便于通过该关系数据定位到当前应用对应的网关15。In addition, it also includes a
对于网关15的另外一个作用,在新版本实例上线后,QA人员可利用网关15进行回归测试。For another function of the
如图9所示,为回归测试示意图,当新版本实例上线后,如果需要QA人员先进行回归测试,则不能分配用户流量到新版本实例。QA人员可以在http测试请求的header中增加traffic-tag:grayTest,使得只有QA人员的http测试请求才会打到新版本实例。As shown in Figure 9, it is a schematic diagram of a regression test. When a new version instance is launched, if QA personnel are required to perform a regression test first, user traffic cannot be allocated to the new version instance. QA personnel can add traffic-tag: grayTest to the header of the http test request, so that only the http test request of the QA personnel will hit the new version instance.
在网关15中通过应用实例启动标记进行流量按百分比路由,同时针对带特定header标签(traffic-tag:grayTest)的http请求进行特定路由,直接路由到新版本实例,实现对新版本实例的回归测试。In the
本申请实施例还提供一种电子设备,所述电子设备包括存储器以及处理器,所述存储器用于存储计算机程序,所述处理器运行所述计算机程序以使所述电子设备执行实施例所述的应用的灰度发布方法。The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program so that the electronic device executes the computer program described in the embodiment. The grayscale publishing method of the application.
本申请实施例还提供一种可读存储介质,所述可读存储介质中存储有计算机程序指令,所述计算机程序指令被一处理器读取并运行时,执行实施例所述的应用的灰度发布方法。The embodiment of the present application also provides a readable storage medium, where computer program instructions are stored in the readable storage medium, and when the computer program instructions are read and executed by a processor, the grayscale of the application described in the embodiment is executed. degree release method.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are only illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functions and possible implementations of devices, methods and computer program products according to multiple embodiments of the present application. operate. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or part of code that includes one or more Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
另外,在本申请各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, each functional module in each embodiment of the present application may be integrated to form an independent part, each module may exist independently, or two or more modules may be integrated to form an independent part.
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
以上所述仅为本申请的实施例而已,并不用于限制本申请的保护范围,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。The above descriptions are only examples of the present application, and are not intended to limit the scope of protection of the present application. For those skilled in the art, various modifications and changes may be made to the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included within the protection scope of this application. It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should 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 that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110563158.XA CN113315824B (en) | 2021-05-26 | 2021-05-26 | Application gray scale publishing method and device and application gray scale publishing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110563158.XA CN113315824B (en) | 2021-05-26 | 2021-05-26 | Application gray scale publishing method and device and application gray scale publishing system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113315824A CN113315824A (en) | 2021-08-27 |
CN113315824B true CN113315824B (en) | 2023-04-18 |
Family
ID=77374428
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110563158.XA Active CN113315824B (en) | 2021-05-26 | 2021-05-26 | Application gray scale publishing method and device and application gray scale publishing system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113315824B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114726919B (en) * | 2022-03-22 | 2024-02-13 | 新华三大数据技术有限公司 | Gray scale flow control method, device, computer equipment and storage medium |
CN114422440B (en) * | 2022-03-28 | 2022-07-12 | 北京沃丰时代数据科技有限公司 | Gray scale distribution method and device, electronic equipment and storage medium |
CN114884915B (en) * | 2022-04-19 | 2024-03-26 | 阿里巴巴(中国)有限公司 | Message processing method, device and equipment based on gray release |
CN115102853B (en) * | 2022-06-27 | 2023-07-28 | 平安银行股份有限公司 | Gateway configuration method and device |
CN116633856A (en) * | 2023-05-30 | 2023-08-22 | 中国银行股份有限公司 | Service processing method, device, equipment and storage medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8140658B1 (en) * | 1999-10-06 | 2012-03-20 | Borgia/Cummins, Llc | Apparatus for internetworked wireless integrated network sensors (WINS) |
GB2508004A (en) * | 2012-11-16 | 2014-05-21 | Chris Hagan | Wireless access point for transmitting downloads with means to encourage mobile devices into close proximity whilst downloading |
CN105635084B (en) * | 2014-11-17 | 2018-12-14 | 华为技术有限公司 | Terminal authentication apparatus and method |
FR3031208B1 (en) * | 2014-12-31 | 2018-02-02 | Bull Sas | BOX OF COMMUNICATION AND MANAGEMENT OF EQUIPMENT |
CN107948284B (en) * | 2017-11-24 | 2021-04-16 | 泰康保险集团股份有限公司 | Service offline method, device and system based on micro-service architecture |
CN111181858A (en) * | 2019-12-24 | 2020-05-19 | 浙江大华技术股份有限公司 | Method, system, computer device and storage medium for gray scale distribution |
CN112532490A (en) * | 2020-11-30 | 2021-03-19 | 武汉悦学帮网络技术有限公司 | Regression testing system and method and electronic equipment |
-
2021
- 2021-05-26 CN CN202110563158.XA patent/CN113315824B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113315824A (en) | 2021-08-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113315824B (en) | Application gray scale publishing method and device and application gray scale publishing system | |
US11425053B2 (en) | On-demand resource provisioning | |
US11509729B2 (en) | Field service management mobile offline synchronization | |
KR102151893B1 (en) | Blockchain smart contract update using decentralized decision | |
CN110622192B (en) | Functions-as-a-Service (FAAS) Platforms in Blockchain Networks | |
US10291704B2 (en) | Networked solutions integration using a cloud business object broker | |
CN109408590B (en) | Distributed database expansion method, device, equipment and storage medium | |
US11360966B2 (en) | Information processing system and method of controlling information processing system | |
US8863133B2 (en) | License management in a cluster environment | |
US10311082B2 (en) | Synchronization of offline instances | |
US8028070B2 (en) | Synchronizing tasks between servers | |
US10594839B2 (en) | Virtual assistant skill deployment | |
CN115174158B (en) | Cloud product configuration checking method based on multi-cloud management platform | |
CN110716730B (en) | Gray release method, device, equipment and computer readable storage medium | |
US10956512B2 (en) | Document link migration | |
CN113590483B (en) | Use case operation method and device | |
CN111523927A (en) | Resource sending method, device, equipment and storage medium | |
CN110489512B (en) | Method and apparatus for outputting information | |
CN114819490A (en) | Task release method, device, device and storage medium | |
CN113705837A (en) | Method and device for inquiring maintenance information by multi-brand server | |
CN114722782A (en) | Data application method and device, electronic equipment and storage medium | |
JP7570020B2 (en) | Real estate inheritance presumption system, real estate inheritance presumption method and program | |
US10180830B2 (en) | Information processing device, deployment method, and recording medium | |
EP3757864B1 (en) | Method and system for performing computations in a distributed system | |
CN113450096B (en) | Resource transfer data processing method, device, electronic device and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250714 Address after: 610000 Sichuan Province, Chengdu City, Jinjiang District, Tongbao Street No. 360, 1st Floor, Fuyi 1542A (Self-numbered) Patentee after: Chengdu Yuexuebang Network Technology Co.,Ltd. Country or region after: China Address before: 430205 Hubei Province, Wuhan City, Donghu New Technology Development Zone, No. 8 Xiongzhuang Road, Wuhan, Shuguangxingcheng D District [APP Square Project] 3# 17F-19F Patentee before: Wuhan yuexuebang Network Technology Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |