Multi-version service publishing method and device, computer equipment and storage medium
By obtaining preset publishing strategies and dynamically adjusting traffic allocation, the problems of traditional grayscale publishing complexity and operation and maintenance burden are solved, efficient release and rapid iteration of multi-version services are achieved, and the stability and user experience of version release are ensured.
Patent Information
- Application Number
- CN202411114462.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-03
AI Technical Summary
The traditional grayscale release method is complex in a high concurrency environment and has a high operation and maintenance burden, and cannot effectively cover all functions and usage scenarios of the new version, resulting in low version release efficiency.
By obtaining preset publishing policies, filtering the service versions to be published, deploying them to the server cluster, and creating version routing, dynamically adjusting traffic allocations to ensure requested traffic control and monitoring of each service version.
It realizes the simultaneous release and rapid iteration of multiple service versions, simplifies traffic control, timely discovers and solves problems, avoids affecting the user group, and improves the efficiency and stability of version release.
Smart Images

Figure CN119065705A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for publishing a multi-version service. Background Art
[0002] With the development of computer technology, online application services have emerged. Due to the ever-changing business needs, online application services need to be continuously iterated to meet the needs and user expectations.
[0003] In traditional technology, when version iteration is required, grayscale release is usually adopted. Grayscale release is a strategy widely used in software development and operation and maintenance, which allows new features or changes to be gradually introduced to the user group instead of being released to all users at once. However, the grayscale release method only releases the new version to a part of users (usually a small proportion), and the behavior and feedback of these users may not be sufficient to fully cover all the functions and usage scenarios of the new version. In addition, the grayscale release method requires refined traffic control strategies and monitoring mechanisms to ensure that only a specified proportion of traffic is directed to the new version. This configuration is relatively complex, especially in a high-concurrency environment, and traffic distribution may bring additional operation and maintenance burdens. Summary of the invention
[0004] Based on this, it is necessary to provide a multi-version service publishing method, device, computer equipment and storage medium that can improve the version publishing efficiency of application services in response to the above technical problems.
[0005] In a first aspect, a multi-version service publishing method is provided, the method comprising:
[0006] Obtain a preset release strategy, and determine multiple service versions of the application service to be released according to the preset release strategy; obtain deployment configuration information of each service version, determine the server cluster where each service version needs to be deployed according to the deployment configuration information, and deploy each service version in the server cluster; after each service version is successfully deployed, create a corresponding version route for each service version; and determine the service request end corresponding to each service version according to the preset release strategy, and switch the latest route of each service request end to the version route of each successfully deployed service version.
[0007] In some embodiments, before deploying each service version in the server cluster, the method also includes: determining whether each service version already exists in the server cluster; in response to each service version not existing in the server cluster, entering the step of deploying each service version in the server cluster; in response to each service version already existing in the server cluster, determining whether each service version already existing in the server cluster needs to be updated; in response to each service version already existing in the server cluster needs to be updated, re-entering the step of deploying each service version in the server cluster.
[0008] In some embodiments, each service version is deployed in a server cluster, including: in response to there being multiple server clusters, obtaining a multi-cluster deployment strategy; in response to the multi-cluster deployment strategy being a parallel deployment strategy, deploying each service version in all server clusters at the same time; in response to the multi-cluster deployment strategy being a serial deployment strategy, deploying each service version in each server cluster in turn.
[0009] In some embodiments, after each service version is successfully deployed, the method further includes: updating the number of scheduling units of each successfully deployed service version to be the same as the number of scheduling units of the online version service that has been launched.
[0010] In some embodiments, each service version is deployed in a server cluster, including: obtaining a service configuration file, an image generation file, and a management configuration file corresponding to each service version to build a service version image for each service version; in response to a version deployment instruction, pulling each service version image, controlling a service management plug-in to update the relevant configuration corresponding to each service version in the service management plug-in according to each service version image, and generating a service version revision corresponding to each service version image in the service management plug-in; monitoring the deployment status of each service version revision, and determining that each service version is successfully deployed in the server cluster when the status of each scheduling unit corresponding to each service version revision is in a prepared state.
[0011] In some embodiments, after each service version is successfully deployed, the method also includes: monitoring the request traffic from the service request end; collecting the traffic request index in the scheduling unit corresponding to each service version; in response to the traffic request index being less than a preset threshold, reducing the number of scheduling units corresponding to the service version to a preset minimum value.
[0012] In some embodiments, the method further includes: in response to the traffic request indicator being greater than a preset threshold, increasing the number of scheduling units corresponding to the service version according to the traffic request indicator.
[0013] In a second aspect, a multi-version service publishing device is provided, the device comprising:
[0014] A policy acquisition module is used to acquire a preset release policy and determine multiple service versions of the application service to be released according to the preset release policy;
[0015] The service deployment module is used to obtain the deployment configuration information of each service version, determine the server cluster where each service version needs to be deployed according to the deployment configuration information, and deploy each service version in the server cluster;
[0016] A route creation module, used to create corresponding version routes for each service version after each service version is successfully deployed; and
[0017] The service switching module is used to determine the service request end corresponding to each service version according to the preset release strategy, and switch the latest route of each service request end to the version route of each successfully deployed service version.
[0018] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method of the first aspect is implemented when the processor executes the computer program.
[0019] In a fourth aspect, a computer-readable storage medium stores a computer program, which implements the method of the first aspect when executed by a processor.
[0020] The above-mentioned version service publishing method, device, computer equipment and storage medium screen multiple service versions to be released of the application service according to the preset publishing strategy, deploy each service version to the corresponding server cluster, and after each service version is successfully deployed, create a corresponding version route for each service version, and determine the service request end corresponding to each service version according to the preset publishing strategy, and switch the traffic of each service request end to each newly deployed service version through each version route. Using the multi-version service publishing method of the present application, multiple service versions can be published together, and the control of the request traffic between multiple service versions is simple and clear, so that the performance of each service version can be better controlled and monitored, problems can be discovered and solved in time, and the entire user group can be avoided. Then, new functions and improvements of multiple versions can be tested at the same time, and efficient publishing and rapid iteration can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is an application environment diagram of the multi-version service publishing method in some embodiments;
[0022] Figure 2 A flowchart of a method for publishing a multi-version service in some embodiments;
[0023] Figure 3 A flowchart of a method for publishing a multi-version service in some other embodiments;
[0024] Figure 4 A framework diagram for publishing multiple versions of services in some embodiments;
[0025] Figure 5 A schematic diagram of routing switching for multi-version services in some embodiments;
[0026] Figure 6 A schematic diagram of dynamically adjusting the traffic load corresponding to each service version in some embodiments;
[0027] Figure 7 A schematic diagram of the structure of a multi-version service publishing device in some embodiments;
[0028] Figure 8 1 is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] The multi-version service publishing method provided in this application can be applied to Figure 1 In the application environment shown, the control server 102 communicates with the server cluster 104 and the service request end 106 through the network.
[0031] Specifically, the control server 102 obtains a preset release strategy, determines multiple service versions of the application service to be released according to the preset release strategy; obtains deployment configuration information of each service version, determines the server cluster 104 where each service version needs to be deployed according to the deployment configuration information, and deploys each service version in the server cluster 104; after each service version is successfully deployed, creates a corresponding version route for each service version; and determines the service request end 106 corresponding to each service version according to the preset release strategy, and switches the latest route of each service request end 106 to the version route of each successfully deployed service version.
[0032] Among them, the service request end 106 can be but is not limited to various personal computers, laptops, smart phones, tablets and portable wearable devices, and the control server 102 and the server cluster 104 can be composed of an independent server or multiple servers, which can be a cloud server or a physical server.
[0033] In some embodiments, Figure 2 As shown, a multi-version service publishing method is provided, which is applied to Figure 1Taking the control server in the example as an example, the following steps may be included:
[0034] Step S202: Obtain a preset publishing strategy, and determine multiple service versions of the application service to be published according to the preset publishing strategy.
[0035] The preset release strategy refers to a release strategy preset by an operator, and the preset release strategy may include labels and names of multiple service versions to be released.
[0036] Specifically, a label selector may be set, and the control server may filter the service versions to be released through the label selector according to a preset release strategy.
[0037] Exemplarily, in order to improve the accuracy of screening new versions to be released, each service version may be first verified for release according to its label and name, and the screening phase of the label selector may be entered after verifying that the label and name are not empty.
[0038] Step S204: acquiring deployment configuration information of each service version, determining a server cluster where each service version needs to be deployed according to the deployment configuration information, and deploying each service version in the server cluster.
[0039] The deployment configuration information may include, but is not limited to, labels, names, service configuration files, image generation files, and management configuration files of each service version.
[0040] Specifically, the control server can query the corresponding application service from each server cluster according to the label and name of each service version, thereby determining the server cluster where the service version needs to be deployed, and then the control server can deploy each service version in the determined server cluster according to the deployment configuration information.
[0041] Step S206: After each service version is successfully deployed, a corresponding version route is created for each service version.
[0042] Specifically, after each service version is successfully deployed, the control server can create a corresponding version route for each service version. Each version route uniquely corresponds to one service version.
[0043] Step S208: Determine the service request end corresponding to each service version according to the preset release strategy, and switch the latest route of each service request end to the version route of each successfully deployed service version.
[0044] Specifically, the request end corresponding to each service version can be determined according to the preset release strategy, and the service request of each service request end can be routed to the corresponding service version by switching the latest route of each service request end to the version route of each successfully deployed service version. In this way, multiple service versions can be released at the same time and can be accessed by service request ends of different groups. The control of request traffic between service versions is simple and clear, so that the performance of each service version can be better controlled and monitored, problems can be discovered and solved in time, and the impact on the entire user group can be avoided. Furthermore, new features and improvements of multiple versions can be tested at the same time, rapid iteration can be achieved, and the best solution can be selected for comprehensive release.
[0045] The above-mentioned multi-version service publishing method screens multiple service versions to be released of the application service according to the preset publishing strategy, deploys each service version to the corresponding server cluster, creates a corresponding version route for each service version after each service version is successfully deployed, and determines the service request end corresponding to each service version according to the preset publishing strategy, and switches the traffic of each service request end to each newly deployed service version through each version route. Using the multi-version service publishing method of the present application, the control of the request traffic between each service version is simple and clear, so that the performance of each service version can be better controlled and monitored, problems can be discovered and solved in time, and the entire user group can be avoided. Then, new functions and improvements of multiple versions can be tested at the same time, and efficient release and rapid iteration can be achieved.
[0046] In some embodiments, reference Figure 3 As shown, Figure 3 A schematic flow chart of a multi-version service publishing method in some other embodiments is shown.
[0047] Specifically, before deploying each service version in the server cluster, the method may also include: determining whether each service version already exists in the server cluster; in response to each service version not existing in the server cluster, entering the step of deploying each service version in the server cluster; in response to each service version already existing in the server cluster, determining whether each service version already existing in the server cluster needs to be updated; in response to each service version already existing in the server cluster needs to be updated, re-entering the step of deploying each service version in the server cluster.
[0048] This embodiment can avoid the waste of resources caused by repeated deployment by checking whether the service version to be released already exists in the server cluster before deploying the service version to be released in the server cluster, thereby improving the efficiency of multi-version service release.
[0049] In some embodiments, reference may be made to Figure 3As shown, each service version is deployed in a server cluster, including: in response to the fact that there are multiple server clusters, a multi-cluster deployment strategy is obtained; in response to the multi-cluster deployment strategy being a parallel deployment strategy, each service version is deployed in all server clusters at the same time; in response to the multi-cluster deployment strategy being a serial deployment strategy, each service version is deployed in each server cluster in turn.
[0050] In this embodiment, by determining the number of server clusters that need to deploy each service version to be released, if there is only a single server cluster, each service version can be directly deployed on the server cluster. If there are multiple server clusters that need to be deployed, it can be determined whether to use parallel deployment or serial deployment according to the preset cluster deployment strategy. For example, the deployment method can be determined according to the current resource status of each server cluster and the urgency of each server cluster's demand for each service version.
[0051] This embodiment can flexibly adapt to various publishing scenarios by supporting different deployment strategies of parallel deployment or serial deployment, thereby improving the efficiency of multi-version service publishing.
[0052] In some embodiments, after each service version is successfully deployed, the method further includes: updating the number of scheduling units of each successfully deployed service version to be the same as the number of scheduling units of the online version service that has been launched.
[0053] In this embodiment, if a new service version is deployed, the number of Pod (scheduling unit) copies of the currently deployed service version can be updated after the deployment is successful to make it consistent with the number of Pod (scheduling unit) copies of the online service version that has been online before, thereby ensuring that the online application service is not affected during the process of switching the service request traffic to the newly deployed service version, thereby improving the smooth switching of traffic and further improving the smoothness of the release of multiple service versions.
[0054] In some embodiments, each service version is deployed in a server cluster, including: obtaining a service configuration file, an image generation file, and a management configuration file corresponding to each service version to build a service version image for each service version; in response to a version deployment instruction, pulling each service version image, controlling a service management plug-in to update the relevant configuration corresponding to each service version in the service management plug-in according to each service version image, and generating a service version revision corresponding to each service version image in the service management plug-in; monitoring the deployment status of each service version revision, and determining that each service version is successfully deployed in the server cluster when the status of each scheduling unit corresponding to each service version revision is in a prepared state.
[0055] Below, reference Figure 4 , Figure 4The following is a diagram showing the framework structure of multi-version service release in some embodiments. Figure 4 The specific deployment process of each service version involved in this embodiment is described in detail.
[0056] from Figure 4 As can be seen, the top one is the service creation platform. In this embodiment, the application service involved in this application can be a model service. For example, it can be an AI (Artificial Intelligence) model service developed and trained through a cloud desktop in a cluster, thereby generating a corresponding model file (service configuration file) and storing it in a database. Of course, in other application scenarios, the application service involved in this application can also be other types of application services without limitation.
[0057] Then, the developed model service can be registered to the release control platform. After registration to the release control platform, a service product corresponding to the model service will be generated on the release control platform.
[0058] The release control platform may include a service management module (for example, a knative management module may be used), each model service may be configured with its own corresponding knative configuration (for example, it may include elastic expansion configuration), and each version of the model service may also be configured with its own version of the knative configuration.
[0059] In addition, you can also set up CI (Continuous Integration) pipelines and release pipelines in the release control platform:
[0060] The CI pipeline continuously obtains the service configuration files, image generation files (Dockerfile), and management configuration files (knative configuration) corresponding to each service version of the model service to build the service version image of each service version.
[0061] After the deployment is triggered, the release pipeline pulls the image of each service version, controls the service management plug-in (knative plug-in, for example, knative Service) to update the corresponding configuration of each service version in the service management plug-in according to each service version image, for example, controls the service management plug-in to update or set the routing version and image address, as well as the service's knative expansion configuration, etc., and generates a service version revision (Revision) corresponding to each service version image in the service management plug-in.
[0062] After the service version revisions (Revision) corresponding to each service version image are generated in the service management plug-in of the scheduling platform (for example, the k8s cluster), each Revision will generate a deployment object, and the deployment object will create the corresponding Replica Set and Pod.
[0063] The deployment pipeline monitors the deployment status of the deployment in the service version revision. If all Pods (scheduling units) are in the ready state, then this version is considered to be deployed successfully.
[0064] After successful deployment, the release pipeline creates a unique version route by tagging each Revision, and controls the Routes of the knative Service to switch or update the route.
[0065] Furthermore, the release pipeline can also synchronize deployment results, record deployment status, and generate observation logs. It can also monitor the access status of each service version, control, monitor and analyze the performance of each service version. According to the analysis results, the preset release strategy can be dynamically adjusted to control the correspondence between the latest route of the service request end and each route version.
[0066] In this embodiment, by combining the service management plug-in, it is possible to implement fast and accurate deployment of multi-version services, thereby achieving efficiency in multi-version publishing.
[0067] For example, in combination Figure 5 As shown, a more detailed explanation is given on how to switch the latest route of the service request end to the version route of the successfully deployed service version, so that the latest route of the service request end is updated to the version route and accesses the service version corresponding to the version route. Specifically:
[0068] Application services registered to the release control platform can be called products. Multiple versions of application services can be registered on the release control platform, so that product versions (version 10000, version 10001, and version 1002) corresponding to each service version are generated on the release control platform. Each product version includes a service version image. By updating the image version of knativeservice, a service revision version corresponding to each product version, that is, Revision version (Revision-10000, Revision-10001, and Revision-10002) can be generated.
[0069] A version route (v10000, v10001, and v10002) is created for each Revision version, and different service versions of the application service are called according to different routes. Because there are multiple service versions at the same time, as mentioned earlier, the service request end can call different service versions in the decision-making process, so as to achieve the purpose of observing the running effects of different service versions. At the same time, due to the existence of multiple version routes, multiple traffic strategies can be supported. In addition, the latest route can be supported. Without changing the pre-call process, the latest route can be switched to any version route to complete a traffic switch. Due to the existence of multiple version routes, traffic can be switched arbitrarily, thereby ensuring the stability of the release process and the timeliness of rollback when redeployment is required.
[0070] In some embodiments, after each service version is successfully deployed, the method also includes: monitoring the request traffic from the service request end; collecting the traffic request index in the scheduling unit corresponding to each service version; in response to the traffic request index being less than a preset threshold, reducing the number of scheduling units corresponding to the service version to a preset minimum value.
[0071] In this embodiment, by utilizing the Serverless framework, the request traffic from the service request end is monitored. When the traffic request index is less than the preset threshold, the number of scheduling units corresponding to the service version is reduced to the preset minimum value. By running at the lowest load in the absence of traffic, unnecessary resource waste can be reduced. Even if multiple service versions are deployed, resources can be fully and reasonably scheduled. While supporting multi-version release and flexible use of any version, it does not increase the resource burden and improves resource utilization.
[0072] In some embodiments, the method further includes: in response to the traffic request indicator being greater than a preset threshold, increasing the number of scheduling units corresponding to the service version according to the traffic request indicator.
[0073] In this embodiment, by monitoring the request traffic from the service request end, when the traffic request index is greater than the preset threshold, the number of scheduling units corresponding to the service version can be increased according to the traffic request index, thereby alleviating the resource scheduling pressure of the service version with large request traffic.
[0074] The above two embodiments can improve resource utilization by dynamically adjusting the traffic carrying capacity of the scheduling unit corresponding to each service version while supporting multi-version release and flexible use of any version without increasing resource burden.
[0075] Below, reference Figure 6 As shown, Figure 6A schematic diagram of dynamically adjusting the traffic load corresponding to each service version in some embodiments is shown. Specifically, the following contents are included:
[0076] The request traffic from the service request end is divided by the gateway (Kourier Gateway) into service revisions (Revision) corresponding to different service versions. The request traffic is requested from the Service to the Pod. PodAutoscalre collects the traffic request metrics of the queue-proxy in the Pod in real time, calculates the number of Pods to be expanded based on the current request, and then controls the deployment to expand the Pod. The expanded Pods will be added to this Service, thus completing the expansion of the Pod. The request traffic passes through the Service to the Pod. If PodAutoscalre cannot collect the traffic request metrics from the Pod, or the collected traffic request metrics are less than the preset threshold, it can automatically shrink to 0 or the preset minimum value. In this embodiment, the request traffic allocation ratio allocated by the gateway to each service version can be adjusted according to the preset release strategy. At the same time, the number of Pods can be dynamically adjusted according to the actual request traffic to achieve dynamic resource allocation.
[0077] For example, an actual application scenario is listed below. For example, in an application scenario where an e-commerce platform wants to test a new recommendation algorithm and settlement process, the service versions are as follows:
[0078] Service version 1 (current service version): Use the existing recommendation algorithm and settlement process.
[0079] Service version 2: New recommendation algorithm, old settlement process.
[0080] Service version 3: old recommendation algorithm, new settlement process.
[0081] Service version 4: New recommendation algorithm and new settlement process.
[0082] The preset release strategy is to divide the users of the service request end into four groups, so that they can use these four service versions respectively. The development team can monitor the user behavior, conversion rate, performance data, etc. of each service version, and decide which version to release or make further optimizations based on the results. The multi-version service release method of this application can more flexibly perform functional testing and optimization of multiple versions, ensuring that the final released version is fully verified and optimized, thereby improving user experience and application stability.
[0083] In different scenarios, the preset release strategy can be adjusted according to business needs. For example, the preset release strategy is to select some of the newly developed service versions for release, and to correspond to multiple groups of service request end users for testing for each service version to be released, etc. In other words, the selection of the service version to be released, the correspondence between the service version and the user group of the service request end, the associated server cluster of the service version to be released, and the deployment configuration information of the service version to be released can be configured according to the business, thereby generating a preset release strategy.
[0084] The multi-version service publishing method involved in the embodiment of the present application has at least one of the following advantages:
[0085] 1. Dynamically release multiple versions of application services through the release pipeline, reducing manual operations, improving release efficiency, and making the management and control of multiple versions more convenient. If you rely on manual release operations, it will be difficult to manage and maintain them later.
[0086] 2. By creating a version route for each service version, the service requester can make its own decision or call any version of the service application according to the configuration. The request traffic can be switched arbitrarily to ensure the stability of the release process and the timeliness of system rollback.
[0087] 3. By configuring monitoring and dynamically adjusting strategies, resource utilization can be improved, ensuring that resources are not wasted when multiple versions are released, and any version can be used flexibly.
[0088] It should be understood that although Figure 2 and Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 and Figure 3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0089] In some embodiments, Figure 7 As shown, a multi-version service publishing device is provided, including: a policy acquisition module 710, a service deployment module 720, a routing creation module 730, and a service switching module 740, wherein:
[0090] A policy acquisition module 710 is used to acquire a preset release policy and determine multiple service versions to be released of the application service according to the preset release policy;
[0091] The service deployment module 720 is used to obtain deployment configuration information of each service version, determine the server cluster where each service version needs to be deployed according to the deployment configuration information, and deploy each service version in the server cluster;
[0092] The route creation module 730 is used to create a corresponding version route for each service version after each service version is successfully deployed; and
[0093] The service switching module 740 is used to determine the service request end corresponding to each service version according to the preset release strategy, and switch the latest route of each service request end to the version route of each successfully deployed service version.
[0094] In some embodiments, the service deployment module 720 is also used to determine whether each service version already exists in the server cluster; in response to each service version not existing in the server cluster, enter the step of deploying each service version in the server cluster; in response to each service version already existing in the server cluster, determine whether the service versions already existing in the server cluster need to be updated; in response to each service version already existing in the server cluster need to be updated, re-enter the step of deploying each service version in the server cluster.
[0095] In some embodiments, the service deployment module 720 is also used to obtain a multi-cluster deployment strategy in response to the number of server clusters; in response to the multi-cluster deployment strategy being a parallel deployment strategy, deploy each service version in all server clusters at the same time; in response to the multi-cluster deployment strategy being a serial deployment strategy, deploy each service version in each server cluster in turn.
[0096] In some embodiments, the service deployment module 720 is further configured to update the number of scheduling units of each successfully deployed service version to be the same as the number of scheduling units of the online version service that has been launched.
[0097] In some embodiments, the service deployment module 720 obtains the service configuration file, image generation file and management configuration file corresponding to each service version to build a service version image for each service version; in response to the version deployment instruction, pulls each service version image, controls the service management plug-in to update the relevant configuration corresponding to each service version in the service management plug-in according to each service version image, and generates a service version revision corresponding to each service version image in the service management plug-in; monitors the deployment status of each service version revision, and when the status of each scheduling unit corresponding to each service version revision is in the prepared state, determines that each service version is successfully deployed in the server cluster.
[0098] In some embodiments, the service deployment module 720 is also used to monitor the request traffic from the service request end; collect the traffic request index in the scheduling unit corresponding to each service version; in response to the traffic request index being less than a preset threshold, the number of scheduling units corresponding to the service version is reduced to a preset minimum value.
[0099] In some embodiments, the service deployment module 720 is also used to monitor the request traffic from the service request end; collect the traffic request index in the scheduling unit corresponding to each service version; in response to the traffic request index being greater than a preset threshold, increase the number of scheduling units corresponding to the service version according to the traffic request index.
[0100] For the specific limitations of the multi-version service publishing device, please refer to the limitations of the multi-version service publishing method above, which will not be repeated here. Each module in the above-mentioned multi-version service publishing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0101] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used 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, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a multi-version service publishing method is implemented.
[0102] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0103] In some embodiments, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: obtaining a preset release strategy, and determining multiple service versions of an application service to be released according to the preset release strategy; obtaining deployment configuration information of each service version, and determining a server cluster where each service version needs to be deployed according to the deployment configuration information, and deploying each service version in the server cluster; after each service version is successfully deployed, creating a corresponding version route for each service version; and determining the service request end corresponding to each service version according to the preset release strategy, and switching the latest route of each service request end to the version route of each successfully deployed service version.
[0104] In some embodiments, the processor also implements the following steps when executing the computer program: determining whether each service version already exists in the server cluster; in response to each service version not existing in the server cluster, entering the step of deploying each service version in the server cluster; in response to each service version already existing in the server cluster, determining whether each service version already existing in the server cluster needs to be updated; in response to each service version already existing in the server cluster needs to be updated, re-entering the step of deploying each service version in the server cluster.
[0105] In some embodiments, the processor also implements the following steps when executing the computer program: in response to there being multiple server clusters, obtaining a multi-cluster deployment strategy; in response to the multi-cluster deployment strategy being a parallel deployment strategy, deploying each service version in all server clusters at the same time; in response to the multi-cluster deployment strategy being a serial deployment strategy, deploying each service version in each server cluster in turn.
[0106] In some embodiments, when the processor executes the computer program, the following steps are further implemented: the number of scheduling units of each successfully deployed service version is updated to be the same as the number of scheduling units of the online version service that has been launched.
[0107] In some embodiments, the processor also implements the following steps when executing the computer program: obtaining service configuration files, image generation files, and management configuration files corresponding to each service version to build a service version image for each service version; in response to a version deployment instruction, pulling each service version image, controlling the service management plug-in to update the relevant configuration corresponding to each service version in the service management plug-in according to each service version image, and generating a service version revision corresponding to each service version image in the service management plug-in; monitoring the deployment status of each service version revision, and determining that each service version is successfully deployed in the server cluster when the status of each scheduling unit corresponding to each service version revision is in a prepared state.
[0108] In some embodiments, when the processor executes the computer program, it also implements the following steps: monitor the request traffic from the service request end; collect the traffic request index in the scheduling unit corresponding to each service version; in response to the traffic request index being less than a preset threshold, reduce the number of scheduling units corresponding to the service version to a preset minimum value.
[0109] In some embodiments, when the processor executes the computer program, the following steps are also implemented: in response to the traffic request indicator being greater than a preset threshold, the number of scheduling units corresponding to the service version is increased according to the traffic request indicator.
[0110] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a preset release strategy, and determining multiple service versions of the application service to be released according to the preset release strategy; obtaining deployment configuration information of each service version, determining a server cluster where each service version needs to be deployed according to the deployment configuration information, and deploying each service version in the server cluster; after each service version is successfully deployed, creating a corresponding version route for each service version; and determining the service request end corresponding to each service version according to the preset release strategy, and switching the latest route of each service request end to the version route of each successfully deployed service version.
[0111] In some embodiments, when the computer program is executed by the processor, the following steps are also implemented: determining whether each service version already exists in the server cluster; in response to each service version not existing in the server cluster, entering the step of deploying each service version in the server cluster; in response to each service version already existing in the server cluster, determining whether each service version already existing in the server cluster needs to be updated; in response to each service version already existing in the server cluster needs to be updated, re-entering the step of deploying each service version in the server cluster.
[0112] In some embodiments, when the computer program is executed by the processor, the following steps are also implemented: in response to there being multiple server clusters, a multi-cluster deployment strategy is obtained; in response to the multi-cluster deployment strategy being a parallel deployment strategy, each service version is deployed in all server clusters at the same time; in response to the multi-cluster deployment strategy being a serial deployment strategy, each service version is deployed in each server cluster in turn.
[0113] In some embodiments, when the computer program is executed by the processor, the following steps are further implemented: the number of scheduling units of each successfully deployed service version is updated to be the same as the number of scheduling units of the online version service that has been launched.
[0114] In some embodiments, when the computer program is executed by the processor, the following steps are also implemented: obtaining service configuration files, image generation files, and management configuration files corresponding to each service version to build a service version image for each service version; in response to a version deployment instruction, pulling each service version image, controlling the service management plug-in to update the relevant configuration corresponding to each service version in the service management plug-in according to each service version image, and generating a service version revision corresponding to each service version image in the service management plug-in; monitoring the deployment status of each service version revision, and when the status of each scheduling unit corresponding to each service version revision is in a prepared state, determining that each service version is successfully deployed in the server cluster.
[0115] In some embodiments, when the computer program is executed by the processor, the following steps are also implemented: monitoring the request traffic from the service request end; collecting the traffic request index in the scheduling unit corresponding to each service version; in response to the traffic request index being less than a preset threshold, reducing the number of scheduling units corresponding to the service version to a preset minimum value.
[0116] In some embodiments, when the computer program is executed by the processor, the following steps are also implemented: in response to the traffic request indicator being greater than a preset threshold, the number of scheduling units corresponding to the service version is increased according to the traffic request indicator.
[0117] Those skilled in the art can understand that all or part of the processes in the methods for implementing the above embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile 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. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0118] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for publishing a multi-version service, the method comprising: Obtaining a preset release strategy, and determining multiple service versions of the application service to be released according to the preset release strategy; Obtaining deployment configuration information of each of the service versions, determining a server cluster where each of the service versions needs to be deployed according to the deployment configuration information, and deploying each of the service versions in the server cluster; After each service version is successfully deployed, a corresponding version route is created for each service version; as well as Determine the service request ends corresponding to the service versions respectively according to the preset release strategy, and switch the latest routes of the service request ends to the version routes of the successfully deployed service versions.
2. The method according to claim 1, characterized in that Before deploying each of the service versions in the server cluster, the method further includes: Determining whether each of the service versions already exists in the server cluster; In response to each of the service versions not existing in the server cluster, entering a step of deploying each of the service versions in the server cluster; In response to each of the service versions already existing in the server cluster, determining whether each of the service versions already existing in the server cluster needs to be updated; In response to each of the service versions existing in the server cluster needing to be updated, the step of deploying each of the service versions in the server cluster is re-entered.
3. The method according to claim 1, characterized in that The deploying each of the service versions in the server cluster includes: In response to the server cluster being multiple, obtaining a multi-cluster deployment strategy; In response to the multi-cluster deployment strategy being a parallel deployment strategy, deploying each of the service versions in all of the server clusters simultaneously; In response to the multi-cluster deployment strategy being a serial deployment strategy, each of the service versions is deployed in each of the server clusters in sequence.
4. The method according to claim 1, characterized in that: When each of the service versions is deployed successfully, the method further includes: The number of scheduling units of each successfully deployed service version is updated to be the same as the number of scheduling units of the online version service that has been launched.
5. The method according to claim 1, characterized in that The deploying each of the service versions in the server cluster includes: Obtaining a service configuration file, an image generation file, and a management configuration file corresponding to each of the service versions to construct a service version image for each of the service versions; In response to the version deployment instruction, pull each of the service version images, control the service management plug-in to update the relevant configuration corresponding to each of the service versions in the service management plug-in according to each of the service version images, and generate a service version revision corresponding to each of the service version images in the service management plug-in; The deployment status of each of the service version revisions is monitored, and when the status of each scheduling unit corresponding to each of the service version revisions is in a prepared state, it is determined that each of the service versions is successfully deployed in the server cluster.
6. The method according to any one of claims 1 to 5, characterized in that: When each of the service versions is deployed successfully, the method further includes: Monitor the request traffic from the service request end; Collecting traffic request indicators in the scheduling units corresponding to each of the service versions; In response to the traffic request indicator being less than a preset threshold, the number of scheduling units corresponding to the service version is reduced to a preset minimum value.
7. The method according to claim 6, characterized in that The method further comprises: In response to the traffic request indicator being greater than a preset threshold, the number of scheduling units corresponding to the service version is increased according to the traffic request indicator.
8. A multi-version service publishing device, characterized in that: The device comprises: A policy acquisition module, used to acquire a preset release policy, and determine multiple service versions of the application service to be released according to the preset release policy; A service deployment module, used to obtain deployment configuration information of each service version, determine a server cluster where each service version needs to be deployed according to the deployment configuration information, and deploy each service version in the server cluster; A routing creation module, used to create a corresponding version route for each service version after each service version is successfully deployed; and The service switching module is used to determine the service request end corresponding to each service version according to the preset release strategy, and switch the latest route of each service request end to the version route of each successfully deployed service version.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
