CN110162382B - Container-based gray level publishing method, device, computer equipment and storage medium - Google Patents

Container-based gray level publishing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110162382B
CN110162382B CN201910278545.1A CN201910278545A CN110162382B CN 110162382 B CN110162382 B CN 110162382B CN 201910278545 A CN201910278545 A CN 201910278545A CN 110162382 B CN110162382 B CN 110162382B
Authority
CN
China
Prior art keywords
container
application
version application
new
new version
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
Application number
CN201910278545.1A
Other languages
Chinese (zh)
Other versions
CN110162382A (en
Inventor
丁江
王耀武
陈亚殊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910278545.1A priority Critical patent/CN110162382B/en
Publication of CN110162382A publication Critical patent/CN110162382A/en
Application granted granted Critical
Publication of CN110162382B publication Critical patent/CN110162382B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention belongs to the field of cloud computing, and discloses a gray level publishing method, a gray level publishing device, computer equipment and a storage medium based on a container, wherein the method comprises the following steps: acquiring a new container instruction, and creating a new version of application container in an application container engine based on the new container instruction; constructing a gray scale instance of the new version application based on the container of the new version application; obtaining the number of containers of old version application, restarting at least one container of the old version application based on the number of containers of the old version application and a preset gray level strategy, and loading the restarted container with the gray level instance; and acquiring feedback information of the gray scale instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information. The gray release is completed through the container, so that the switching between versions can be facilitated, the waste of gray instances and resources is reduced, the problem of complex rollback operation is avoided, and the efficiency of applying gray release is improved.

Description

Container-based gray level publishing method, device, computer equipment and storage medium
Technical Field
The invention belongs to the field of cloud computing, and particularly relates to a gray level publishing method, device, computer equipment and storage medium based on a container.
Background
The gray level release of the application refers to a release mode of smooth transition on new and old versions of the application, specifically, A/B testing is performed, namely, a part of users continue to use the old version A, a part of users start to use the new version B, if the users approve the new version B, the application range of the new version is gradually expanded until all users are migrated to the new version B. The application gray level release can ensure the stability of the whole system, and the problems can be found and adjusted during the initial gray level release so as to ensure the smooth transition of the application in the new version and the old version.
In order to perfect the functions of the application and meet the demands of the user on the application, new versions of the application are continuously presented. In order to complete gray level release of the application, the conventional method is that an enterprise sets a part of application servers as old version applications and another part of application servers as new version applications through an application server group built in the enterprise, then adjusts the user traffic of the new and old versions of applications through a load balancer, so that a part of user traffic is switched to the new version application, and the corresponding user traffic of the new and old versions is gradually adjusted according to the test result until the user traffic is completely upgraded or rolled back. The disadvantage of this approach is that: because the new version needs to additionally build a set of same environments (comprising server resources and application resources) for gray level release, the environment is only used when gray level release is finished, only one set of environments is used after gray level release is finished, and the other set of environments is idle, so that the resource waste is caused. Secondly, when setting up the environment of the new version application, in order to verify whether the new version has a problem, a certain proportion of user traffic needs to be led into the newly built environment, and an application instance suitable for the proportion needs to be built in the newly built environment. For example, if the original user traffic corresponds to 10 application instances, if 20% of the user traffic needs to be verified, the gray instances corresponding to the new version are 2, and if 40% of the user traffic needs to be verified, the gray instances corresponding to the new version are 4. After the handover is completed, the application instances do not need to correspond to the user traffic, so that the application instances also cause waste of resources. Again, if the gray level is problematic, the version is reissued when rollback is required, and the operation is complex and time consuming.
In summary, the current gray level distribution method has resource waste and lower efficiency.
Disclosure of Invention
The embodiment of the invention provides a gray level release method, a gray level release device, a gray level release computer device and a gray level release storage medium based on a container, which are used for solving the problem of low gray level release efficiency at present.
A container-based gray scale distribution method, comprising:
acquiring a new container instruction, and creating a new version of application container in an application container engine based on the new container instruction;
constructing a gray scale instance of the new version application based on the container of the new version application;
obtaining the number of containers of old version application, restarting at least one container of the old version application based on the number of containers of the old version application and a preset gray level strategy, and loading the restarted container with the gray level instance;
and acquiring feedback information of the gray scale instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information.
A container-based gray scale distribution device, comprising:
the application container creation module is used for obtaining a new container instruction and creating a new version application container in the application container engine based on the new container instruction;
The gray level instance construction module is used for constructing gray level instances of the new version application based on the containers of the new version application;
the gray scale instance loading module is used for acquiring the number of containers of the old version application, restarting at least one container of the old version application based on the number of containers of the old version application and a preset gray scale policy, and loading the restarted container with the gray scale instance;
and the application container adjusting module is used for acquiring feedback information of the gray scale instance and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the container-based gray scale distribution method described above when executing the computer program.
A computer readable storage medium storing a computer program which, when executed by a processor, implements the container-based gray scale distribution method described above.
According to the gray level issuing method, the gray level issuing device, the computer equipment and the storage medium based on the container, through obtaining the newly-built container instruction, newly-built new-version application containers are created in the application container engine based on the newly-built container instruction; then, constructing a gray scale instance of the new version application based on the container of the new version application; the number of the containers of the old version application is obtained, at least one container of the old version application is restarted based on the number of the containers of the old version application and a preset gray level strategy, and the restarted container is loaded with a gray level instance; and finally, acquiring feedback information of the gray level instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information. The gray scale release is completed through the container, and the original production environment is gradually switched to the gray scale environment as only one gray scale example is needed to be constructed, so that the switching between versions can be facilitated, the waste of the gray scale example and resources is reduced, the problem of complex rollback operation is avoided, and the efficiency of applying the gray scale release is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an application environment of a container-based gray scale distribution method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a container-based gray scale distribution method according to an embodiment of the present invention;
FIG. 3 is another flow chart of a container-based gray scale distribution method in an embodiment of the present invention;
FIG. 4 is another flow chart of a container-based gray scale distribution method in an embodiment of the present invention;
FIG. 5 is another flow chart of a container-based gray scale distribution method in an embodiment of the present invention;
FIG. 6 is another flow chart of a container-based gray scale distribution method in an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a container-based gray scale distribution device in accordance with an embodiment of the present invention;
FIG. 8 is another functional block diagram of a container-based gray scale issuing apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a gray scale instance plus module in a container-based gray scale distribution device in accordance with an embodiment of the present application;
FIG. 10 is a schematic diagram of a computer device in accordance with an embodiment of the application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The gray level release method based on the container provided by the application can be applied to an application environment as shown in figure 1, wherein a client communicates with a server through a network, the server acquires a new container instruction through the client, and a new version of application container is newly built based on the new container instruction and an application container engine; then, constructing a gray scale instance of the new version application based on the container of the new version application; the number of the containers of the old version application is obtained, and at least one container of the old version application is restarted and then a gray instance is loaded based on the number of the containers of the old version application and a preset gray policy; and finally, acquiring feedback information of the gray scale instance through the client, and adjusting the capacity of the container corresponding to the new version application and the old version application according to the feedback information. The clients may be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a gray level distribution method based on a container is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
s10: and acquiring a new container instruction, and creating a new version of the container of the application in the application container engine based on the new container instruction.
The application container engine (Docker) is an application container engine of an open source container Platform, and the container Platform refers to a set of Platform-as-a-Service (PaaS) Platform which is built based on a Docker container and provides middleware services. The development tester can be packaged and applied to the Docker container, and as the Docker container has independent IP of external service, a user can access the IP of the external service of the Docker container through the client so as to obtain corresponding application software service. It should be noted that, since the Docker containers adopt a sandbox mechanism, there will not be any interface between them, so that the application versions of the Docker containers may be different and have no influence on each other.
Specifically, the server side obtains a new container instruction through the client side, and when the new container instruction is obtained, the server side builds a new version of the application container in the application container engine according to the new container instruction. For example, a development tester clicks a corresponding control or button on the container platform to generate a new container instruction, the server side obtains the new container instruction, and then creates a corresponding Docker container according to the new container instruction. The new version application refers to an application needing gray level release. It will be appreciated that a new version application may be released in parallel for multiple, i.e., multiple, new version applications, and accordingly multiple Docker containers need to be created. Optionally, the new container instruction includes information such as a name of the new version application, the number of created containers, and an application version number.
S20: and constructing the gray scale instance of the new version application based on the container of the new version application.
The gray scale instance refers to an instance corresponding to gray scale release. It can be appreciated that, because the new version application includes more files, when the gray scale instance is constructed, a development tester can deploy the files designated by the new version application into the container as the gray scale instance; multiple containers may also be created according to the needs of gray level distribution, where each container is a gray level instance. It should be understood that the gray scale example corresponds to a gray scale environment, as opposed to a production environment. The grayscale environment refers to an environment for verifying the corresponding application of the new version, and the production environment refers to an environment corresponding to the (old version) application currently being used. Before and after gray level release, the production environment corresponds to all user traffic, i.e. all users are applying in the old version or in the new version; and when the gray level is released, a part of users correspond to the production environment, and a part of users correspond to the gray level environment.
Specifically, the client sends the new version application to the server, and then the server constructs a mirror image of the new version application in the Docker container through Dockerfile, and the generated mirror image is the gray scale instance formed in the Docker container. Wherein, dockerfile is a script composed of a series of commands and parameters, through which a user of the container can be enabled to generate a mirror image corresponding to the application. Optionally, after the service end builds the gray level instance of the new version application through the Docker container, the built gray level instance can be initially verified and then gray level release can be performed. The preliminary verification means that a separate entrance is provided in the Docker container to enable a development tester to access the gray scale instance, and whether the gray scale instance can normally operate is verified.
S30: and obtaining the number of the containers of the old version application, restarting at least one container of the old version application based on the number of the containers of the old version application and a preset gray level strategy, and loading the restarted container with a gray level instance.
Optionally, the number of containers of the old version application is generally plural, specifically may be determined according to the user traffic corresponding to the old version application, and the more the user traffic corresponding to the old version application is, the more the number of containers required by the old version application is.
The preset gray level strategy is a strategy preset by the server side and used for verifying gray level release, namely, a user flow with a certain proportion is led into a gray level environment to verify new version application. The preset gray level policy may be specifically set according to actual needs, which is not limited herein. For example, if the number of containers applied in the old version is 10, the preset gray level policy is to restart 20% of the containers and load the gray level instance, then restart 2 containers (10×20% =2), and load the restarted 2 containers with the gray level instance. Optionally, the preset gray scale policy includes a step-by-step verification process policy, that is, a policy of gradually switching the original production environment to the gray scale environment. For example, the preset greyscale policy may be sequentially verified step by step in a verification order that switches 20%, 40%, 60%, 80% and 100% of containers applied by old versions to a greyscale environment. When the preset gray level strategy uses a step-by-step verification process strategy, the server can determine whether to enter the verification of the next stage according to feedback information received by the gray level instance before the verification proportion is enlarged. For example, when the verification percentage of the container of the old version application is switched from 20% to 40%, if the feedback information received by the gray scale instance is positive or the feedback information of the positive reaches the preset proportion, it is determined that the verification of the next stage (i.e., 60%) can be performed. It should be appreciated that the preset gray scale policies herein are for a new version of the application.
Specifically, the server acquires the number of containers of the old version application, restarts at least one container of the old version application according to the number of containers of the old version application and a preset gray level strategy, and loads the restarted container with a gray level instance. When the server selects the restarted container, the container may be selected according to the input of the client, or may be selected randomly, which is not limited herein.
S40: and acquiring feedback information of the gray level instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information.
The feedback information of the gray level instance refers to feedback information of the user on the new version application, namely comments put forward by the user on the new version application, such as troublesome operation, error reporting, inconvenience for the old version application, and the like. Optionally, the feedback information can be collected by a development tester through an application release platform, and then the preset gray level strategy is adjusted according to the collected feedback information and sent to the server through the client, and the server adjusts the number of containers corresponding to the new version application and the old version application according to the adjusted preset gray level strategy. It can be understood that, because the opinion of the feedback information of each user is not true, when the feedback information of the users is counted, a certain amount of feedback information of the users, for example, 50% of feedback information of the users is counted, and then the preset gray scale strategy is adjusted according to the opinion reflected in the feedback information set of the users. Optionally, when the negative information of the feedback information of the gray scale instance is less, increasing the number of containers corresponding to the new version application, and correspondingly reducing the number of containers corresponding to the old version application until the version is upgraded; and when the negative information of the feedback information of the gray level instance is more, reducing the number of containers corresponding to the new version application, and correspondingly increasing the number of containers corresponding to the old version application until the version rolls back. It can be understood that when the negative information of the feedback information of the gray level instance is more, the increase of the number of containers corresponding to the new version application can be suspended, the feedback information for implementing the remedial measure is collected by adding the remedial measure such as the patch, and if the negative information is reduced, the number of containers corresponding to the new version application is correspondingly increased; if the negative information is not reduced, then the rollback operation is considered to be performed.
In the embodiment corresponding to fig. 2, a new version of the application container is created in the application container engine based on the new container instruction by acquiring the new container instruction; then, constructing a gray scale instance of the new version application based on the container of the new version application; the number of the containers of the old version application is obtained, at least one container of the old version application is restarted based on the number of the containers of the old version application and a preset gray level strategy, and the restarted container is loaded with a gray level instance; and finally, acquiring feedback information of the gray level instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information. The gray scale release is completed through the container, and the original production environment is gradually switched to the gray scale environment as only one gray scale example is needed to be constructed, so that the switching between versions can be facilitated, the waste of the gray scale example and resources is reduced, the problem of complex rollback operation is avoided, and the efficiency of applying the gray scale release is improved.
In an embodiment, as shown in fig. 3, before step S10, that is, before the step of obtaining the new container instruction and newly creating the new version of the container of the application container engine based on the new container instruction, the gray level publishing method based on the container provided in the embodiment further includes:
S51: it is monitored whether a new version of the application exists.
Optionally, the new version application is stored in the Redis system, and the server monitors the Redis system through a monitoring tool to monitor whether the Redis system has the new version application. The Redis system is an open-source Application Program Interface (API) which is written by using ANSIC language, supports network, can be based on a log type and Key Value pair (Key-Value) database of memory and can be persistent, and provides multiple languages. Optionally, the server may employ zabbix monitoring tools to monitor new versions of applications. Wherein the zabbix monitoring tool can monitor various network parameters and provide a flexible notification mechanism to facilitate handling of various problems. Specifically, the server may set a new version application in the Redis system as a monitoring object and set a corresponding monitoring item, so that the zabbix monitoring tool can monitor whether the Redis system has the new version application. For example, if the Redis system adds an application version with the same name as the current application, the zabbix monitoring tool compares the version of the added application with the version number of the version of the current application, and if the version number of the added application is greater than the version number of the current application, the zabbix monitoring tool determines that a new version application exists and sends monitoring information for monitoring the new version application to the server.
S52: and if the new version application exists, acquiring the name, version number and number of the new version application, and generating a new container instruction according to the name, the version number and the number.
Specifically, the server side judges according to the monitoring information of the monitoring tool, if the new version application exists according to the monitoring information, the server side obtains the name, version number and number of the new version application from a corresponding position (Redis system), and then generates a new container instruction according to the information of the name, version number and number of the new version application so as to establish a container of the new version application according to the new container instruction.
In the embodiment corresponding to fig. 3, by monitoring whether a new version application exists, if so, acquiring the name, version number and number of the new version application, and generating a new container instruction according to the name, version number and number of the new version application. By monitoring whether the new version application exists or not, if the new version application exists, a new container instruction is automatically generated, so that a corresponding new version application container can be more conveniently created on a container platform, errors of manual operation are reduced, and the efficiency of gray level release verification is improved.
In one embodiment, the preset gray scale policy includes at least one of: the method for loading the gray instance on the container of the new version application includes the steps of (a) allowing the percentage of online traffic of the new version application to be used, allowing the user account type of the new version application to be used, allowing the user terminal attribute of the new version application to be used and the user attribute of the new version application to be used, as shown in fig. 4, in step S30, namely, obtaining the number of containers of the old version application, restarting at least one container of the old version application based on the number of containers of the old version application and a preset gray policy, and loading the restarted container with the gray instance, specifically including the following steps:
S31: and inputting a preset gray level strategy into the load equalizer, and generating a gray level verification instruction according to the number of containers applied by the old version and the preset gray level strategy.
Where the percentage of online traffic allowed to use the new version application refers to the number of online users allowed to use the new version application in the beginning of the development of the new version application, e.g., 5% of online traffic is allowed to use the new version application. The user account types allowing use of the new version application refer to which types of users are allowed to use the new version application, for example, the user account types are divided into an internal user account and an external user account, and when gray verification is performed, the internal user account is allowed to use the new version application first. The user terminal attribute allowing the new version application to be used refers to allowing the user terminal attribute meeting a certain condition to use the new version application, and the user terminal attribute can be the attribute of resolution, speed, memory size and the like of the user terminal, for example, when gray verification is performed, the user terminal with larger memory or faster memory is preferentially allowed to use the new version application. The user attribute allowing use of the new version application means that a user whose attribute satisfies a certain condition is allowed to use the new version application, and the user attribute is, for example, attribute of gender, age, occupation, or the like. It is to be understood that the preset gray level policy may be a combination of the above several, or may be one of the above, and is set according to actual needs, which is not specifically limited herein.
Optionally, the preset gray scale policy may be input by the client and then sent to the server. It will be appreciated that in order to verify the greyscale environment and ensure that the switching is as smooth as possible, for example, the preset greyscale strategy may be formulated in a range that is progressively extended from one city, one province to the whole country.
Wherein the load balancer is a hardware device that distributes network requests to available servers in a cluster of servers, manages web data traffic to the available servers, and increases the effective network bandwidth. Alternatively, the load balancer is connected to the front end of the container, which may be ng ix or F5. Preferably, the load balancer is nginnx. Where Nginx is a high performance HTTP and reverse proxy server and also an IMAP/POP3/SMTP server.
Specifically, the service end takes the gray level strategy input by the client as a preset gray level strategy, and then inputs the preset gray level strategy into the load balancer at the front end of the container, so that the load balancer generates a gray level verification instruction on the basis of the preset gray level strategy. The gray scale verification instruction refers to an instruction for verifying how much proportion of user traffic is led into the gray scale environment.
S32: and restarting at least one container of the old version application based on the gray verification instruction, and loading the restarted container with the new version application.
Specifically, the server restarts at least one container loading the old version application according to the gray verification instruction of the load balancer, and loads the restarted container with the new version application, and at this time, the containers loaded with the new version application are switched from the production environment to the gray environment. For example, if the number of containers of the old version application is 10, the gray verification instruction is to switch 20% of the containers to the new version application, and the gray verification instruction is to restart the 2 containers of the old version application, and then load the restarted 2 containers into the new version application. Optionally, when the load balancer selects the restarted container according to the gray verification instruction, the load balancer may be selected according to the input of the client, or may be selected randomly, which is not limited herein.
In the embodiment corresponding to fig. 4, a gray verification instruction is generated according to the number of containers applied by the old version and the preset gray policy by inputting the preset gray policy into the load balancer; and restarting at least one container of the old version application based on the gray verification instruction, and loading the restarted container with the new version application. Through inputting the preset gray level strategy into the load balancer, the load balancer restarts the corresponding container and then loads the new version application so as to verify the gray level release, the characteristics of the load balancer can be utilized to better control the production environment and the user flow corresponding to the gray level environment, so that the gray level release is as smooth as possible, and the stability of the gray level release is improved.
In an embodiment, the preset gray scale policy includes a first preset proportion and a second preset proportion, as shown in fig. 5, in step S40, feedback information of a gray scale instance is obtained, and the number of containers corresponding to the new version application and the old version application is adjusted according to the feedback information, which specifically includes the following steps:
s41: if the front feedback information in the feedback information reaches the first preset proportion, restarting the container of the unloaded old-version application, and loading the restarted container with the new-version application.
The positive feedback information is positive feedback information proposed by the user, for example, feedback information that the user considers that the new version is good in application, good in characteristics, good in function, and meets the use requirement.
The first preset ratio may be set according to practical situations, for example, 80%, 90%, 95%, or the like, and is not limited herein.
Optionally, the feedback information can be collected through channels such as an application release platform, a QQ/WeChat user group or a voting investigation, and then collected and tidied. Optionally, after the feedback information is collected, the feedback information can be automatically sorted through NLP (natural language processing), the collected feedback information is automatically summarized and classified into positive feedback information and negative feedback information, and the corresponding proportion of the positive feedback information and the negative feedback information is calculated. For example, the user's "good, or functional" ratings are categorized as positive feedback information, and the user's "bad, stuck, or interface unfriendly" ratings are categorized as negative feedback information. If there are 800 pieces of positive feedback information and 200 pieces of negative feedback information, the proportion of the positive feedback information is 800/(800+200) =80%.
Specifically, the server judges according to the statistical feedback information, if the proportion of the positive feedback information in the total feedback information reaches a first preset proportion, restarting the container of the old version application which is not loaded with the new version application, loading the restarted container with the new version application, switching all the old version application into the new version application, and finishing the upgrading of the application; at this time, the original gray scale environment is changed to a production environment. Optionally, when the preset gray level policy is verified step by step, in each verification stage, if the front feedback information reaches a first preset proportion in the total feedback information, the next verification stage may be entered. In addition, when the preset gray level policy is verified step by step, the first preset ratio set at each stage may be set to a different ratio, which is not limited herein.
It should be noted that, after the new version application is loaded after the container is restarted, since the IP address outside the container is unchanged, the original production flow is correspondingly switched to the container of the new version application, so as to complete the upgrade of the application version. Optionally, after the version is upgraded, the container for constructing the gray instance of the new version application can be loaded into the old version application, and if the new version application suddenly appears with a large range of unstable feedback information, the new version application can be timely switched to the old version application, so that the rollback of the version is completed.
S42: and if the negative feedback information in the feedback information reaches a second preset proportion, restarting the container loaded with the new version application, and loading the restarted container with the old version application.
The negative feedback information refers to negative feedback information proposed by a user, for example, the new version is considered to be not good for application, the BUG exists, the characteristics or functions are not good, the use is inconvenient, and the like.
The second preset ratio may be set according to practical situations, for example, may be 30%, 40%, 50%, or the like, and is not limited herein.
Specifically, the server judges according to the statistical feedback information, if the proportion of the negative feedback information in the total feedback information reaches a second preset proportion, the container loaded with the new version application is restarted, the restarted container is loaded with the old version application, and the gray environment is switched to the production environment again. Optionally, when the preset gray level policy is step-by-step verification, the server may set the preset gray level policy at each verification stage, and if the proportion of the negative feedback information in the total feedback information reaches the second preset proportion, perform the rollback operation.
In the embodiment corresponding to fig. 5, if the front feedback information in the feedback information reaches the first preset proportion, restarting the container of the unloaded old-version application, and loading the restarted container with the new-version application; and if the negative feedback information in the feedback information reaches a second preset proportion, restarting the container loaded with the new version application, and loading the restarted container with the old version application. The number of the containers corresponding to the new version application and the old version application is adjusted and switched according to the positive feedback information and the negative feedback information in the statistical feedback information, so that the versions can be smoothly switched; in addition, the container is used for completing the switching of the versions, so that the waste of resources can be reduced, and the efficiency of gray level release is improved.
In an embodiment, the preset gray level policy includes a mapping relationship between user location information and version application, as shown in fig. 6, before step S40, that is, before the step of obtaining feedback information of a gray level instance, and adjusting the number of containers corresponding to a new version application and an old version application according to the feedback information, the container-based gray level publishing method provided in this embodiment may further include the following steps:
s61: and acquiring a user access request, and extracting user position information according to the user access request.
Wherein, the user access request refers to a request of accessing the container by the user to access the application in the container. It can be understood that the user access request is first sent to the server through the client, and the server can extract the corresponding user location information according to the user access request, so as to accurately distribute the user access request to the corresponding container according to the user location information.
Specifically, the server side obtains a user access request through the client side, obtains an IP address of a user according to the user access request, and extracts user position information according to the IP address.
S62: and acquiring the target version application corresponding to the user position information according to the user position information and the mapping relation.
The mapping relationship between the user location information and the version application refers to a corresponding relationship between whether the version application of the area corresponding to the user location information is a new version application or an old version application. The corresponding relation between the user position information and the version application can be determined by the production environment and the gray scale environment, if the region corresponding to the user position information is the production environment, the old version application is used, and if the region corresponding to the user position information is the gray scale environment, the new version application is used. For example, if the preset gray level policy is to switch the beijing city into the gray level environment for gray level release, the beijing city corresponds to the gray level environment, and other areas are production environments; and if the user position information is Beijing city, the corresponding gray environment is adopted, and the target version application is a new version application. Optionally, the mapping relation between the user location information and the version application may be stored in a database of the server in the form of a mapping table, and the server may determine, according to the user location information and the mapping table, the target version application corresponding to the user.
Specifically, the server matches the mapping relationship with the obtained user position information, and obtains the corresponding version application in the mapping relationship as the target version application.
S63: and forwarding the user access request to a container corresponding to the target version application.
Specifically, the server distributes the user access request to a container corresponding to the target version application according to the acquired information of the target version application. For example, if the user location information is Beijing, and the container of the Beijing user is switched to the container of the new version application, the server allocates the user access request to the container corresponding to the switched new version application; if the container of the Beijing user is the original generation environment, the server distributes the user access request to the container corresponding to the old version application.
In the embodiment corresponding to fig. 6, the user access request is obtained, the user location information is extracted according to the user access request, then the target version application corresponding to the user location information is applied according to the user location information and the mapping relation, and finally the user access request is forwarded to the container corresponding to the target version application. By distributing the user access request to the container corresponding to the target version application, the user flow can be accurately distributed, so that the gray environment is verified, the verification of gray release is successfully completed, and the version upgrading or rollback operation is completed.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In an embodiment, there is provided a container-based gradation issuing apparatus that corresponds one-to-one to the container-based gradation issuing method in the above embodiment. As shown in fig. 7, the container-based gray scale distribution device includes an application container new building module 10, a gray scale instance construction module 20, a gray scale instance loading module 30, and an application container adjustment module 40. The functional modules are described in detail as follows:
the application container creation module 10 is configured to obtain a new container instruction, and create a new version of application container in the application container engine based on the new container instruction;
a gray scale instance construction module 20, configured to construct a gray scale instance of the new version application based on the container of the new version application;
the gray scale instance loading module 30 is configured to obtain the number of containers of the old version application, restart at least one container of the old version application based on the number of containers of the old version application and a preset gray scale policy, and load the restarted container with a gray scale instance;
And the application container adjusting module 40 is used for acquiring feedback information of the gray scale instance and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information.
Further, as shown in fig. 8, the gray level issuing device based on the container provided in the present embodiment further includes a container instruction generating module 50, where the container instruction generating module 50 includes an application monitoring unit 51 and an instruction generating unit 52;
an application monitoring unit 51 for monitoring whether a new version application exists;
the instruction generating unit 52 is configured to, when a new version application exists, obtain a name, a version number, and a number of the new version application, and generate a new container instruction according to the name, the version number, and the number.
Further, the preset gray scale policy includes at least one of: the percentage of online traffic allowed to use the new version application, the user account type allowed to use the new version application, the user terminal attribute allowed to use the new version application, and the user attribute allowed to use the new version application; as shown in fig. 9, the gradation example loading module 30 includes a verification instruction generation unit 31 and an application loading unit 32;
a verification instruction generating unit 31, configured to input a preset gray level policy into the load balancer, and generate a gray level verification instruction according to the number of containers applied by the old version and the preset gray level policy;
The application loading unit 32 is configured to restart at least one container of the old version application based on the gray verification instruction, and load the restarted container with the new version application.
Further, the preset gray scale policy includes a first preset ratio and a second preset ratio, and the application container adjusting module 40 is further configured to:
restarting the unloaded container of the old version application when the front feedback information in the feedback information reaches a first preset proportion, and loading the restarted container with the new version application;
and restarting the container loaded with the new version application when the negative feedback information in the feedback information reaches a second preset proportion, and loading the restarted container with the old version application.
Further, the preset gray level policy includes a mapping relationship between user location information and version application, and the container-based gray level publishing device provided in this embodiment further includes an access request distribution module, where the access request distribution module is configured to:
acquiring a user access request, and extracting user position information according to the user access request;
acquiring a target version application corresponding to the user position information according to the user position information and the mapping relation;
and forwarding the user access request to a container corresponding to the target version application.
The specific definition of the container-based gradation issuing apparatus may be referred to the definition of the container-based gradation issuing method hereinabove, and will not be described in detail herein. The respective modules in the above-described container-based gradation issuing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing gray scale examples, preset gray scale strategies, feedback information of the gray scale examples and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a container-based gray scale distribution method.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
acquiring a new container instruction, and creating a new version of application container in an application container engine based on the new container instruction;
constructing a gray scale instance of the new version application based on the container of the new version application;
obtaining the number of containers of the old version application, restarting at least one container of the old version application based on the number of the containers of the old version application and a preset gray level strategy, and loading the restarted container with a gray level instance;
and acquiring feedback information of the gray level instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a new container instruction, and creating a new version of application container in an application container engine based on the new container instruction;
constructing a gray scale instance of the new version application based on the container of the new version application;
Obtaining the number of containers of the old version application, restarting at least one container of the old version application based on the number of the containers of the old version application and a preset gray level strategy, and loading the restarted container with a gray level instance;
and acquiring feedback information of the gray level instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (9)

1. A container-based gray scale distribution method, comprising:
acquiring a new container instruction, and creating a new version of application container in an application container engine based on the new container instruction;
Constructing a gray scale instance of the new version application based on the container of the new version application;
obtaining the number of containers of old version application, restarting at least one container of the old version application based on the number of containers of the old version application and a preset gray level strategy, and loading the restarted container with the gray level instance;
acquiring feedback information of the gray scale instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information;
the preset gray scale strategy comprises a first preset proportion and a second preset proportion;
the obtaining feedback information of the gray scale instance, and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information, includes:
if the front feedback information in the feedback information reaches the first preset proportion, restarting the unloaded container of the old version application, and loading the restarted container with the new version application;
and if the negative feedback information in the feedback information reaches the second preset proportion, restarting the container loaded with the new version application, and loading the restarted container with the old version application.
2. The container-based gray scale distribution method according to claim 1, wherein, before the obtaining of the new container instruction, the new container engine is applied to new containers of new-version applications based on the new container instruction, the container-based gray scale distribution method further comprises:
monitoring whether the new version application exists;
and if the new version application exists, acquiring the name, version number and number of the new version application, and generating the new container instruction according to the name, the version number and the number.
3. The container-based gray scale distribution method according to claim 1, wherein the preset gray scale policy includes at least one of: a percentage of online traffic allowed to use the new version application, a user account type allowed to use the new version application, a user terminal attribute allowed to use the new version application, and a user attribute allowed to use the new version application;
the obtaining the number of the containers of the old version application, restarting at least one container of the old version application based on the number of the containers of the old version application and a preset gray level policy, and loading the restarted container with the gray level instance comprises the following steps:
Inputting a preset gray level strategy into a load equalizer, and generating a gray level verification instruction according to the number of containers applied by the old version and the preset gray level strategy;
and restarting at least one container of the old version application based on the gray verification instruction, and loading the restarted container into the new version application.
4. The container-based gray scale distribution method according to claim 1, wherein the preset gray scale policy includes a mapping relationship between user location information and version application;
before the feedback information of the gray scale instance is obtained and the number of containers corresponding to the new version application and the old version application is adjusted according to the feedback information, the gray scale release method based on the containers further comprises the following steps:
acquiring a user access request, and extracting the user position information according to the user access request;
acquiring a target version application corresponding to the user position information according to the user position information and the mapping relation;
and forwarding the user access request to a container corresponding to the target version application.
5. A container-based gray scale distribution device, comprising:
The application container creation module is used for obtaining a new container instruction and creating a new version application container in the application container engine based on the new container instruction;
the gray level instance construction module is used for constructing gray level instances of the new version application based on the containers of the new version application;
the gray scale instance loading module is used for acquiring the number of containers of the old version application, restarting at least one container of the old version application based on the number of containers of the old version application and a preset gray scale policy, and loading the restarted container with the gray scale instance;
the application container adjusting module is used for acquiring feedback information of the gray scale instance and adjusting the number of containers corresponding to the new version application and the old version application according to the feedback information;
the application container adjustment module is further configured to:
restarting the unloaded container of the old version application when the front feedback information in the feedback information reaches a first preset proportion, and loading the restarted container with the new version application;
and restarting the container loaded with the new version application when the negative feedback information in the feedback information reaches a second preset proportion, and loading the restarted container with the old version application.
6. The container-based gray scale issuing apparatus according to claim 5, further comprising a container instruction generating module including an application monitoring unit and an instruction generating unit;
the application monitoring unit is used for monitoring whether the new version application exists or not;
and the instruction generating unit is used for acquiring the name, the version number and the number of the new version application when the new version application exists, and generating the newly-built container instruction according to the name, the version number and the number.
7. The container-based gray scale distribution device of claim 5, wherein the preset gray scale policy comprises at least one of: a percentage of online traffic allowed to use the new version application, a user account type allowed to use the new version application, a user terminal attribute allowed to use the new version application, and a user attribute allowed to use the new version application;
the gray scale instance loading module comprises a verification instruction generating unit and an application loading unit;
the verification instruction generation unit is used for inputting a preset gray level strategy into the load equalizer, and generating a gray level verification instruction according to the number of containers applied by the old version and the preset gray level strategy;
The application loading unit is used for restarting at least one container of the old version application based on the gray verification instruction, and loading the restarted container into the new version application.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the container-based gray scale distribution method according to any of claims 1 to 4 when executing the computer program.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the container-based gray scale distribution method according to any of claims 1 to 4.
CN201910278545.1A 2019-04-09 2019-04-09 Container-based gray level publishing method, device, computer equipment and storage medium Active CN110162382B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910278545.1A CN110162382B (en) 2019-04-09 2019-04-09 Container-based gray level publishing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910278545.1A CN110162382B (en) 2019-04-09 2019-04-09 Container-based gray level publishing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110162382A CN110162382A (en) 2019-08-23
CN110162382B true CN110162382B (en) 2023-12-15

Family

ID=67638505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910278545.1A Active CN110162382B (en) 2019-04-09 2019-04-09 Container-based gray level publishing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110162382B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515675A (en) * 2019-08-30 2019-11-29 中国工商银行股份有限公司 Using online method, apparatus, system and readable storage medium storing program for executing
CN110704483A (en) * 2019-09-06 2020-01-17 平安普惠企业管理有限公司 User routing process positioning method, device, storage medium and device
CN110609704B (en) * 2019-09-19 2023-03-21 聚好看科技股份有限公司 Method, device and system for adjusting gray scale of service program version
CN110716730B (en) * 2019-10-14 2023-09-26 网易(杭州)网络有限公司 Gray release method, device, equipment and computer readable storage medium
CN110912734B (en) * 2019-10-31 2022-07-22 北京浪潮数据技术有限公司 Method and device for realizing multi-dimensional gray scale release of container application by cloud management platform
CN113127023B (en) * 2019-12-31 2024-04-09 华为技术有限公司 Service upgrading method, device and system
CN111399875B (en) * 2020-03-06 2023-09-05 咪咕文化科技有限公司 Gray scale upgrading control method and device, electronic equipment and storage medium
CN111770002B (en) * 2020-06-12 2022-02-25 南京领行科技股份有限公司 Test data forwarding control method and device, readable storage medium and electronic equipment
CN111813601B (en) * 2020-07-09 2023-08-08 中国工商银行股份有限公司 Micro-service rollback method and device for stateful distributed cluster
CN111949311B (en) * 2020-08-12 2023-08-25 中国工商银行股份有限公司 Gray level release method and system
CN112446714A (en) * 2020-12-11 2021-03-05 上海中通吉网络技术有限公司 Server upgrading method, device and equipment for express after-sale work order processing system
CN112783729A (en) * 2021-01-29 2021-05-11 北京三快在线科技有限公司 Exception handling method and exception handling device for gray scale release
CN113946353B (en) * 2021-09-30 2022-08-09 北京五八信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN115168162B (en) * 2022-09-08 2022-12-06 江苏博云科技股份有限公司 Multi-gray-scale issuing method and device based on ingess controller in container environment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018103320A1 (en) * 2016-12-08 2018-06-14 上海壹账通金融科技有限公司 Gated launch method, system, server, and storage medium
CN108282507A (en) * 2017-01-06 2018-07-13 阿里巴巴集团控股有限公司 The method, apparatus and electronic equipment using publication are carried out in CaaS environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018103320A1 (en) * 2016-12-08 2018-06-14 上海壹账通金融科技有限公司 Gated launch method, system, server, and storage medium
CN108282507A (en) * 2017-01-06 2018-07-13 阿里巴巴集团控股有限公司 The method, apparatus and electronic equipment using publication are carried out in CaaS environment

Also Published As

Publication number Publication date
CN110162382A (en) 2019-08-23

Similar Documents

Publication Publication Date Title
CN110162382B (en) Container-based gray level publishing method, device, computer equipment and storage medium
KR102493449B1 (en) Edge computing test methods, devices, electronic devices and computer-readable media
US8572679B1 (en) Automatic system upgrade orchestrator
US9031910B2 (en) System and method for maintaining a cluster setup
CN109510842B (en) Method and device for configuring forced access control strategy of industrial control network file
US10884839B2 (en) Processing system for performing predictive error resolution and dynamic system configuration control
CN104834602B (en) A kind of program dissemination method, device and program delivery system
US10452511B2 (en) Server health checking
CN112182089B (en) Report generation method, device and equipment based on data warehouse model
CN114265607A (en) Gray scale publishing method and system, electronic device and storage medium
US9600251B1 (en) Enhancing API service schemes
CN110825425A (en) Configuration data management method and device, electronic equipment and storage medium
CN115454420A (en) Artificial intelligence algorithm model deployment system, method, equipment and storage medium
US11429435B1 (en) Distributed execution budget management system
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN114237862A (en) Resource allocation control device, computer system, and resource allocation control method
CN113076248A (en) Application processing method, device and equipment and readable storage medium
CN116661873A (en) Data parallel processing method, device, computer equipment and storage medium
US20230359976A1 (en) Real-Time Prediction Method, Electronic Device And Non-transitory Computer-Readable Storage Medium
CN116319758A (en) Data migration method, device, electronic equipment and readable storage medium
TWI759096B (en) Building and deployment system and method of shared software solution and computer readable medium
CN113934444A (en) Gray scale distribution method and device, computer storage medium and electronic equipment
CN113326052A (en) Method and device for upgrading service component, computer equipment and storage medium
CN110955647A (en) Database assistance method, database assistance device, computer equipment and storage medium
US11907230B1 (en) System and method for distributed management of hardware based on intent

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