WO2024027160A1 - Application deployment method and system, and device - Google Patents

Application deployment method and system, and device Download PDF

Info

Publication number
WO2024027160A1
WO2024027160A1 PCT/CN2023/081267 CN2023081267W WO2024027160A1 WO 2024027160 A1 WO2024027160 A1 WO 2024027160A1 CN 2023081267 W CN2023081267 W CN 2023081267W WO 2024027160 A1 WO2024027160 A1 WO 2024027160A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
deployment
policy
region
session
Prior art date
Application number
PCT/CN2023/081267
Other languages
French (fr)
Chinese (zh)
Inventor
王楠楠
卞盛伟
王烽
齐飞
Original Assignee
华为云计算技术有限公司
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 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2024027160A1 publication Critical patent/WO2024027160A1/en

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Definitions

  • This application relates to the field of cloud technology, and in particular, to an application deployment method, system and device.
  • tenants can deploy applications in cloud data centers by renting resources in cloud data centers.
  • the application can be deployed in one cloud data center or distributed in multiple cloud data centers.
  • the multiple cloud data centers can be located in different regions, that is, the application adopts multi-region How to deploy. This deployment method is suitable for some large-scale applications or applications where the users of the application are distributed in different areas.
  • tenants When renting resources in a cloud data center to deploy applications, tenants need to clearly specify the resources in the cloud data center to be rented and apply for resources from the cloud data center themselves. In fact, tenants may not be able to accurately estimate the resources they need to rent, which also increases the difficulty of application deployment.
  • This application provides an application deployment method, system and equipment to realize automatic deployment of applications in the cloud.
  • embodiments of the present application provide an application deployment method, which can be executed by an application deployment device and a regional application deployment device located in a region.
  • the application deployment device first obtains the installation package and application deployment policy of the application provided by the tenant.
  • the installation package of the application includes the executable file of the application, and the application deployment policy indicates the constraints for deploying the application; the application deployment device obtains the installation package of the application from the tenant.
  • the installation package and application deployment policy of the application it can be determined that the tenant needs to deploy the application.
  • the application deployment device selects a deployment area for the application according to the application deployment policy and installs the application's installation package. Send to zone.
  • the embodiment of the present application does not limit the number of areas selected by the application deployment device for the application. It may be one or multiple areas.
  • the application deployment device instructs the regional application deployment device to create at least one computing instance in the region through the regional application deployment device in the region, and run multiple application processes on the at least one computing instance.
  • the application deployment device may send an application deployment request to a regional application deployment device in a region.
  • the application deployment request is used to request to create a computing instance in the region and run the installation package to create an application process.
  • the application deployment request can carry information about the computing instance to be created, such as the specifications and quantity of the computing instance. Optionally, it can also include the number of application processes to be created on each computing instance.
  • the regional application deployment device can create a computing instance according to the application deployment request, and run the installation package on the computing instance to create multiple application processes.
  • the tenant when the tenant needs to deploy an application, he only needs to simply provide the installation package of the application and some constraints required for deploying the application.
  • the application deployment device can help the application complete the deployment of the application.
  • the tenant does not need to configure each area. resources, simplifying the application deployment process and improving the automation of application deployment.
  • the application deployment device can process the session of the application.
  • the application deployment device can obtain the session processing policy provided by the tenant.
  • the session processing policy includes a policy for allocating processing application processes to each session; when the tenant provides the application deployment policy, it can also provide the session processing policy at the same time.
  • the application deployment device receives a session sent by an access user of the application, it can select a target application process from multiple application processes according to the session processing policy.
  • the target application process is the application process selected for the session in the embodiment of this application.
  • the application deployment device sends the session to the target application process through the regional application deployment device in the area where the target application process is located to process the session. For example, the application deployment device may instruct a regional application deployment device in the region to process the session by the target application process, and the regional application deployment device may send the session to the target application process for processing the session under the instruction.
  • the tenant can be understood as the party that needs to rent resources to deploy applications, and the access user can be understood as the user of the application.
  • the application deployment device can also process the session of the application, ensuring that the application can provide better services to accessing users and ensuring the reliability and effectiveness of application deployment.
  • the application deployment policy indicates the constraints for deploying the application. It can be understood that the application deployment policy provides some scope constraints as a whole. These constraints may not specify specific resources, for example, The number or specifications of computing instances are not specified.
  • the application deployment policy can indicate the deployment cost range of the application or specify a specific deployment cost value.
  • the deployment cost of an application refers to the deployment cost of at least one computing instance that needs to be created to deploy the application. Therefore, the deployment cost range of the application is essentially the deployment cost range of the at least one computing instance.
  • the application deployment policy only needs to indicate the deployment cost range of the application, simplifying the configuration parameters on the tenant side, making the application deployment method simpler, simplifying the application deployment steps, and improving application deployment efficiency.
  • the application deployment policy may also indicate the selection range of the area set by the tenant.
  • Tenants can set the area according to actual needs, so that the application deployment device can better meet the needs of tenants when selecting areas.
  • the area selection range set by the tenant refers to the selection range of the area where the at least one computing instance is located.
  • the session processing policy indicates a delay range for the target application process to process the session.
  • the conversation processing process can meet a certain delay range, so as to meet the basic needs of processing sessions, prevent delays, and ensure the timeliness of session processing.
  • the application deployment device when the application deployment device selects a region to deploy an application according to the application deployment policy, it can obtain the region selection policy.
  • the region selection policy is generated based on the occupancy of physical resources in each region.
  • the region selection policy indicates In order to select the priority of each area to create a new computing instance, that is, the area selection strategy can include the priority of each area.
  • the priority of the area describes the priority of the area when selecting the area for deploying the application; when selecting the area for the application
  • the application deployment device may select a region for deploying the application according to the application deployment policy and the region selection policy.
  • an area that meets the deployment requirements is selected for application deployment based on the current physical resource occupancy of each area, ensuring that the application can be deployed in the selected area.
  • the application deployment device when the application deployment device selects a target application process for the session from multiple application processes according to the session processing policy, it can also obtain the session distribution policy.
  • the session distribution policy is based on the application processes in each area. Generated by the working state, the session distribution policy indicates the priority of selecting each application process to handle the session.
  • the session distribution policy may include the priority of each application process.
  • the priority of the application process describes the selection for the session.
  • the target application process is the priority of the application process; then, the target application process is selected for the session based on the session processing policy and the session distribution policy.
  • the target application process for processing the session is selected based on the current working status of each application process, ensuring that the session can be executed efficiently.
  • the application deployment device can also obtain the regional elasticity policy provided by the tenant.
  • the regional elasticity policy indicates whether to allow elastic scaling of the application process in the region; send the regional elasticity policy to the regional application deployment device; in this way, The regional application deployment device in the region adjusts the number of application processes applied in the region based on the regional elasticity policy.
  • the regional elasticity strategy can dynamically change the number of application processes and improve resource utilization.
  • the region elasticity policy indicates that when the idle ratio of application processes applied in the region is less than the idle threshold, the number of application processes applied in the region is increased. After the increase, the idle ratio of the application processes applied in the region is increased. Equal to the idle threshold, the idle ratio of application processes applied in the area is equal to the ratio of the number of application processes applied in the idle state to the number of application processes applied in the area.
  • the idle ratio of application processes in the area can be close to or equal to the threshold set by the tenant, ensuring that there are idle available application processes in the area, making it easier to cope with the surge in session tasks that need to be processed.
  • the region elasticity policy indicates that when the idle ratio of the application processes applied in the region is greater than the idle threshold, the number of application processes applied in the region is reduced. After the number is reduced, the idle ratio of the application processes applied in the region is Equal to the idle threshold, the idle ratio of application processes applied in the area is equal to the ratio of the number of application processes applied in the idle state to the number of application processes applied in the area.
  • the idle ratio of application processes in the area can be close to the threshold or equal to the threshold, ensuring that there are idle application processes in the area, which makes it easier to cope with the scenario where the number of sessions drops sharply.
  • embodiments of the present application also provide an application deployment system, which is used to execute the method in the above first aspect and each possible implementation of the first aspect.
  • the application deployment system includes an application deployment device and a regional application deployment device. The operations that the application deployment device and the regional application deployment device can perform can be referred to the foregoing description and will not be described again here.
  • embodiments of the present application also provide an application deployment device, which has the behavioral function of implementing the application deployment device in the method example of the first aspect.
  • the beneficial effects can be found in the description of the first aspect, which is not included here.
  • Functions can be implemented by hardware, or by hardware executing corresponding software.
  • Hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the application deployment device includes an installation package management module and a process management module.
  • the application deployment device also includes a session management module. These modules can perform the corresponding functions in the method example of the first aspect. For details, please refer to the detailed description in the method example, which will not be described again here.
  • embodiments of the present application also provide a regional application deployment device, which has the behavioral function of implementing the regional application deployment device in the method example of the first aspect.
  • Functions can be implemented by hardware, or by hardware executing corresponding software.
  • Hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the regional application deployment device includes a deployment module.
  • the regional application deployment device also includes a regional session management module. These modules can perform corresponding functions in the above method examples of the first aspect. For details, please refer to the detailed description in the method examples, which will not be described again here.
  • embodiments of the present application further provide a computing device, which has the ability to implement the above first aspect In the method instance, the function of deploying the behavior of the device is applied.
  • the beneficial effects can be found in the description of the first aspect and will not be described again here.
  • the structure of the computing device includes a processor and a memory, and the processor is configured to support the application deployment device to perform corresponding functions in the method of the first aspect.
  • the memory is coupled to the processor and stores program instructions and data necessary for the communications device.
  • the structure of the communication device also includes a communication interface for communicating with other devices.
  • embodiments of the present application also provide a computing device cluster, which has the function of realizing the behavior of the application deployment device in the method example of the first aspect.
  • the computing device cluster includes at least one computing device.
  • the structure of any computing device includes a processor and a memory.
  • the processor in any computing device is configured to support the application deployment device to execute the above first aspect and each possible method of the first aspect. Some or all of the functions in the implementation.
  • the memory is coupled to the processor and stores program instructions and data necessary for the communications device.
  • the structure of the communication device also includes a communication interface for communicating with other devices.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores instructions, which when run on a computer, cause the computer to execute the above-mentioned first aspect and each possible implementation of the first aspect. method within the method.
  • the present application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the method in the above-mentioned first aspect and each possible implementation of the first aspect.
  • this application also provides a computer chip, which is connected to a memory.
  • the chip is used to read and execute the software program stored in the memory, and execute the method in the above-mentioned first aspect and each possible implementation of the first aspect. .
  • Figure 1 is a schematic diagram of the architecture of a system provided by this application.
  • Figure 2 is a schematic structural diagram of an application deployment device provided by this application.
  • Figure 3 is a schematic structural diagram of a regional application deployment device provided by this application.
  • FIG. 4 is a schematic diagram of an application deployment method provided by this application.
  • Figure 5A is a schematic interface diagram of an application installation package provided by this application.
  • Figure 5B is a schematic diagram of an interface for providing deployment strategies provided by this application.
  • Figure 6 is a schematic diagram of a method for achieving intra-regional resource elasticity provided by this application.
  • Figure 7 is a schematic diagram of an application deployment change method provided by this application.
  • Figure 8 is a schematic interface diagram of a change deployment strategy provided by this application.
  • Figure 9 is a schematic structural diagram of a computing device provided by this application.
  • Figure 10 is a schematic structural diagram of a computing device cluster provided by this application.
  • the installation package of an application includes an executable file of the application, and the executable file of the application includes some data necessary for deploying the application.
  • the executable code of the application or the source code of the application.
  • the executable code is the code that can be directly run by the computing instance (that is, the processor)
  • the source code is the code that needs to be compiled. It cannot be directly recognized by the processor and needs to be processed by the compiler to generate executable code, which is then run by the computing instance (that is, the processor).
  • the tenant needs to deploy an application, for example, deploy the application to the cloud.
  • the user may transmit the installation package of the application to the application deployment device 100 to request the application deployment device 100 to deploy the application. Therefore, the installation package of the application can be understood as a code file including an executable file.
  • An application process may be run in a computing device (or a computing instance on a computing device), and the application process may be formed by running an executable file in the application's installation package. After running, the executable files in the application installation package can form one or more application processes. Multiple application processes can realize the same functions, that is, they can all realize the functions represented by the executable code of the installation package of the application.
  • the deployment parameters of the multiple application processes may be different.
  • the running parameters include but are not limited to: the port range of the application process, the network and bandwidth to which the application process is connected, the region where the application process is located, and the computing instance where the application process is located.
  • the status of the application process is divided into two types, one is the idle state, and there are no sessions that need to be processed on the idle application process.
  • the application process running in the area also has a monitoring function.
  • This monitoring function is manifested in two aspects. On the one hand, it monitors the working status of the application process itself.
  • the working status of the application process includes but is not limited to: the status of the application process (such as busy or idle), and the session status of the application process (such as the number of sessions processed by the application process and the number of unprocessed sessions).
  • the other aspect is the monitoring of physical resources on the computing device where the application process is located.
  • the application process can monitor the usage of physical resources such as processor, memory, bandwidth, etc. on the computing device.
  • the application process in the area can report the monitored status of itself and the status of the physical resources on the computing device to other devices.
  • the application process in the area can report its own status obtained by monitoring and the status of the physical resources on the computing device to the global resource device, or it can also report its own status obtained by monitoring and the status of the physical resources on the computing device.
  • the status of the physical resources is reported to the regional application deployment device 200 in the area.
  • the application installation package can be regarded as a non-running application and is static.
  • the application process is a running application and is dynamic.
  • the application deployment device 100 creates a process queue under the trigger of the tenant.
  • the process queue includes one or more application processes.
  • the application deployment device 100 selects a region to deploy the application according to the deployment policy provided by the tenant, and determines the computing instances required to deploy the application in each region.
  • the application deployment device 100 can distribute one or more application processes in the process queue on computing instances in a selected area, and run the application processes on the computing instances in the area.
  • the application process in the process queue maintained by the application deployment device 100 there are two kinds of application processes, one is the application process in the process queue maintained by the application deployment device 100, and the other is the application process running in the area.
  • the application processes in the process queue maintained by the application deployment device 100 can be understood as the image of the application processes running in the area on the application deployment device 100 .
  • the operating parameters of the application process in the process queue are consistent with the operating parameters of the application process running in its corresponding area. The difference is that the application process in the process queue is a logical application process and does not process sessions, while the application process running in the area does process sessions.
  • the application deployment device 100 can obtain some operating parameters of the application processes running in the area through the application processes in the process queue.
  • the application deployment device 100 can display the application processes in the process queue to the tenant, so that the tenant can view some operating parameters of the application processes running in the area and understand the running status of the application.
  • a session refers to the tasks that an application process needs to perform.
  • the application is a game application
  • the session can be a game play.
  • the application is a live broadcast application
  • the session can be a live broadcast task.
  • An application process can execute one or more sessions.
  • the access user delivers a session to the application deployment device 100 by operating the application (such as creating the application or creating a certain function in the application).
  • the concept of "area” is introduced, and the area is divided based on the deployment position of the computing device.
  • One or more computing devices with close deployment locations or one or more data centers (the data center includes multiple computing devices) with close deployment locations are divided into one area.
  • the embodiments of this application do not limit the division of areas.
  • the application deployment in a region indicates that the application is deployed in a data center in a certain region or on a computing device in the region.
  • the deployment strategy describes some strategies that need to be followed to deploy applications.
  • the deployment strategy can include some or all of the following information:
  • the application deployment policy describes some conditions that the application needs to meet when deployed.
  • the application deployment policy indicates the constraints of the deployment application area.
  • the constraint can be the deployment cost range of the application (that is, the deployment cost range of the created computing instance), or the selection range of the region for the application (that is, the selection range of the region where the created computing instance is located).
  • the deployment cost refers to the cost range limited by the tenant when deploying the application.
  • the tenant sets the deployment cost of the application to be 500 yuan/month when deploying the application.
  • Different regions require different fees.
  • the number or specifications of computing instances occupied are different, and the fees paid are also different.
  • tenants can control how much it costs to deploy the application by indicating a deployment cost range through a deployment policy.
  • Applications can be deployed in multi-region deployment or single-region deployment, that is, the application can be distributed in multiple regions or in one region.
  • the application deployment policy configured by the tenant can indicate that the application adopts multi-region deployment or single-region deployment.
  • the application deployment policy configured by the tenant can also indicate one or more preferred regions, that is, the region selection when selecting the region to deploy the application. scope.
  • the application deployment policy configured by the tenant can configure priorities for different areas so that the application can be deployed in areas with higher priority.
  • the session processing policy is used to describe the policy of assigning the application process to handle the session of the application.
  • the session processing policy may include a delay range for the application process to process the session (referred to as the session delay range in subsequent descriptions).
  • the session issued by the access user can be converted into a session that the application process needs to process.
  • the delay of this session determines the speed at which the access user obtains service response. The smaller the session delay, the faster the access user can get a response after the session is delivered.
  • the session processing policy can set the delay range that the session needs to meet.
  • the session processing policy indicating the delay range of the session is only for illustration.
  • the embodiments of the present application do not limit the content indicated by the session processing policy.
  • the processing priorities of different types of sessions may also be restricted.
  • the application process of the application created in the region can be used to process sessions, and the running of the application's application process will occupy the resources of the computing instance where it is located.
  • the application process of an application is idle for a long time, it will lead to a waste of resources. If you appropriately reduce the number of application processes or even reduce the number of computing instances, you can effectively avoid resource waste.
  • the application processes in this area are all busy, it means that there are a large number of sessions that need to be processed. In this case, the number of application processes is small, which will affect the session processing efficiency. If the application process is appropriately increased, The number of processes can effectively improve the execution efficiency of the session.
  • there are always some redundant application processes in the application process queue which is also suitable for some scenarios where the number of sessions increases. It can be seen that flexibly adjusting the number of application processes within a region can effectively take into account resource utilization and session processing efficiency.
  • the regional elasticity policy can indicate whether elastic scaling of resources within the region is allowed.
  • the so-called resource elastic scaling refers to the application process that allows the expansion or reduction of applications in a region.
  • the regional elasticity policy can also record the method of resource elasticity in the region.
  • the regional elasticity policy can describe the procedures that need to be followed when expanding or shrinking application processes in the region.
  • the regional elasticity policy can record the triggering conditions and expansion methods of application processes applied in the expansion region.
  • the regional elasticity policy can also record the triggering conditions and reduction methods of application processes applied in the reduction area. If the regional elasticity policy indicates that resource elastic scaling is not allowed in the region, that is, the resources occupied by the application cannot be changed in the region, that is, the number of application processes, the specifications or the number of computing instances of the application cannot be changed.
  • the area elasticity policy can record the trigger condition as the ratio of the number of application processes of the idle application in the area to the total number of application processes of the expanded application (the number of application processes of the idle application).
  • the ratio of the number to the total number of application processes of the expanded application (which may be referred to as the idle ratio) is greater than the first value.
  • the expansion method is to expand the application process of the application in the area with the first value, that is, the idle ratio of the application process of the expanded application is equal to the first value.
  • the area elasticity policy can record that the trigger condition is that the idle ratio is greater than the second value.
  • the reduction method is to reduce the application process of the application in the area by the second value, that is, the idle ratio of the application process after the reduction is equal to the second value.
  • the first value and the second value can be understood as idle ratio thresholds.
  • the application process of the expanded application and the application process of the reduced application can be configured with different idle ratio thresholds, or the same idle ratio threshold can be configured.
  • the resources required for deploying an application are used as a computing instance as an example for explanation.
  • the application process of the application runs in the computing instance.
  • a computing instance refers to an independent running environment built through virtualization of physical resources in the computing device. That is to say, the computing instance forms a relatively independent running environment by occupying physical resources in the computing device. Computing instances on the same computing device do not affect each other and are relatively independent.
  • the computing instance can be a virtual machine (VM) created on the computing device, or a container (container) created on the computing device.
  • the specifications of a computing instance describe the physical resources of the computing device required by the computing instance.
  • the physical resources of the computing device include but are not limited to: processor, memory, and bandwidth.
  • this computing instance also includes bare metal servers, and bare metal servers can be regarded as a "special" computing instance. Bare metal servers are independent servers.
  • the computing instance can monitor its own working status.
  • the working status of the computing instance includes but is not limited to: the physical resources used during the running of the computing instance (such as processor utilization, memory occupancy, bandwidth). occupancy rate, etc.), calculate the number of application processes of applications created on the instance. Compute instances enable the monitored computations to be Report the working status of the example to other devices.
  • the computing instance can report the monitored working status to the regional application deployment device 200 in the area where it is located, and can also report the monitored working status to the global resource device.
  • sessions require the participation of access users, who need to connect to the application through the client.
  • a session can allow one or more access users to connect to the session through the client.
  • a game in a game application is a session, and a game usually requires the participation of one or more access users.
  • the tenant refers to the party that needs to deploy the application, that is, the party that needs to provide the installation package and deployment policy of the application.
  • the access user refers to the party that initiates a session by accessing the application.
  • the tenant can interact with the application deployment device 100, send the application installation package required for deploying the application to the application deployment device 100, and configure a deployment policy for the application.
  • the deployment policy describes the rules to be followed when deploying the application.
  • the deployment policy includes some scope description information, such as constraints for deploying the application.
  • the application deployment device 100 selects a region to deploy the application for the application based on the deployment policy, and creates a computing instance for the application in the region through the regional application deployment device, Run the application process of the application created by the installation package in the computing instance.
  • the application deployment device 100 can also send the session initiated by the access user to the area to request the application process in the area to process the session.
  • tenants need to deploy applications, they only need to provide the application installation package and the corresponding deployment strategy. They do not need to choose the area where the application is deployed, nor do they need to apply for resources to support application deployment in the area.
  • the application deployment device 100 implements area selection and resource application based on the deployment policy. Tenants no longer need to be aware of the underlying resources, which can effectively simplify the application deployment process and improve the efficiency of application deployment.
  • the application deployment system 10 includes an application deployment device 100 and at least one regional application deployment device 200. Any regional application deployment device 200 is located in a region, and any regional application deployment device 200 performs application-related operations in the region, such as implementing application deployment in the region and processing sessions distributed to the region.
  • the application deployment device 100 can deploy applications at the request of tenants, complete region selection, and cooperate with the regional application deployment device 200 in the selected region to implement deployment of applications in the region.
  • the application deployment device 100 can obtain the installation package of the application provided by the tenant and the deployment policy for the application, select a region to deploy the application according to the application deployment policy, and determine the computing instances required to deploy the application in the region. After determining the computing instances required to deploy the application in the area, the application deployment device 100 can initiate an application deployment request to the regional application deployment device 200 in the area.
  • the application deployment request carries the installation package of the application, and the Required computing instance information (such as the number and specifications of computing instances).
  • the application deployment device 100 may respectively initiate application deployment requests to the regional application deployment devices 200 in the multiple areas. If the application deployment device 100 selects a region for the application, the application deployment device 100 may initiate an application deployment request to the regional application deployment device 200 in the region.
  • the regional application deployment device 200 is responsible for application deployment in the region and session processing in the region.
  • the regional application deployment device 200 When an application needs to be deployed in the area, the regional application deployment device 200 will receive an application deployment request. After receiving the application deployment request, it will create the computing required for deploying the application based on the information of the required computing instance. In other words, the regional application deployment device 200 can instruct the computing instance to run the installation package of the application and create an application process of the application in the region.
  • the application deployment device 100 interacts with the regional application deployment device 200 in the region to complete application deployment in the region. After the application is deployed in each area selected by the application deployment device 100, the application can provide services to users who access the application.
  • the application deployment device 100 can process the session of the access user from the application, select an application process for the session to be processed according to the session management policy, and the application deployment device 100 can send the session to the area where the selected application process is located.
  • the regional application deployment device 200 instructs the regional application deployment device 200 to process the session by the application process.
  • the regional application deployment device 200 in the area After receiving the session, the regional application deployment device 200 in the area transmits the session to the selected application process, and the application process processes the session.
  • the application deployment system 10 also includes a global deployment decision-making device 400 and a global resource monitoring device 300.
  • the global resource monitoring device 300 is used to monitor resource usage in each area.
  • the resource usage in the region monitored by the global resource monitoring device 300 includes but is not limited to: the occupancy of physical resources (such as processors, memory, etc.) in the region, the working status of computing instances in the region, The working status of application processes of applications running on computing instances in this area.
  • the global resource monitoring device 300 can report the resource usage in each monitored area to the global deployment decision-making device 400 .
  • the global deployment decision-making device 400 can generate a region selection policy or a session distribution policy after acquiring the resource usage in each region reported by the global resource monitoring device 300 .
  • the region selection strategy provides the priority of each region for deploying applications.
  • the global deployment decision-making device 400 determines whether each region can support application deployment based on the occupancy of physical resources (such as processors, memory, etc.) and/or the working status of computing instances in each region. For example, when the occupancy of physical resources in a certain area is lower than threshold A, that is, there are many physical resources in the idle state in this area, then when a new application needs to be deployed later, this area can be used as a priority for deploying the application. options. For another example, when the occupancy of physical resources in a certain area is higher than threshold A, that is, more physical resources in this area are occupied, then when new applications need to be deployed later, there are fewer idle resources in this area. Physical resources, try to avoid deploying the application in this area.
  • the global deployment decision-making device 400 may determine the priority of selecting each region to newly create a computing instance.
  • the priority of any area describes the priority given to that area when deploying the application.
  • the global deployment decision-making device 400 provides the priority of each region to the application deployment device 100 as a region selection policy.
  • the region selection strategy only forms the priority of each region from the perspective of the occupancy of physical resources in each region, that is, the region selection strategy does not consider the needs of tenants.
  • the application deployment strategy is configured by the tenant and meets the tenant's needs.
  • the application deployment device 100 selects a region to deploy an application, in addition to considering the application deployment policy provided by the tenant, it may also combine the region selection policy provided by the global deployment decision-making device 400.
  • the application deployment device 100 selects deployment according to the application deployment policy and the region selection policy. When applying to areas, the application deployment strategy is the main one to meet the needs of tenants.
  • the session distribution policy provides a priority for selecting the application process of each application to process the session.
  • the application process of each application can be part or all of all application processes of the application.
  • the global deployment decision-making device 400 integrates the working status of the computing instances in each region and the working status of the application processes running on the computing instances in each region, and determines which regions have idle application application processes or how many there are. There are idle application application processes, and in which areas there are no idle application application processes, it can be determined which application processes can handle subsequent received sessions. For example, when there is an idle application process in a certain area, and the usage of physical resources on the computing instance where the application process is located is lower than threshold B, that is, the application process can effectively handle subsequent created sessions. Then when a new session needs to be processed later, the application process of the application can be used as the priority option of the session and has a higher priority.
  • the application process of an application in a certain area is in a busy state, and the usage rate of physical resources on the computing instance where the application process is located is equal to the threshold B, that is, the application process has called the computing instance where the application process is located.
  • the physical resources that can be called cannot guarantee the processing effect of subsequent sessions. It is necessary to try to avoid distributing the session to the application process of the application.
  • the application process of the application has a lower priority.
  • the global deployment decision-making device 400 determines the priority of selecting each application process to handle the session.
  • the priority level of any application process describes the priority given to that application process when selecting an application process for a session.
  • the global deployment decision-making device 400 provides the priority level of each application process as a session distribution policy to the application deployment device 100 .
  • the region selection strategy is only the priority of each application process formed from the perspective of the working status of the computing instances in each region and the working status of the application processes running on the computing instances in each region. That is, the session distribution scheme does not consider the needs of tenants. .
  • the session management policy is configured by the tenant and meets the tenant's needs.
  • the application deployment device 100 selects an application process to process a session, in addition to considering the session management policy provided by the tenant, it can also combine the session distribution policy provided by the global deployment decision-making device 400.
  • the application deployment device 100 selects an application process based on the session management policy and the region selection policy.
  • the session management strategy is the main focus so that the selection of application processes meets the needs of tenants.
  • the application deployment system 10 may also include a client where the application is deployed on the access user side, and the client is used to interact with the application deployment device 100 .
  • the client can be understood as the client software deployed by the application on the access user side, or can also be understood as a dedicated client device.
  • the client can be client software installed on a mobile terminal or a personal computer, such as social software, live broadcast software, and game software.
  • the client can be a dedicated online payment device, and users accessing the application can make payments on the online payment device.
  • Users who access the application can establish a connection with the application deployment device 100 through the client, send a session to the application deployment device 100 through the client, and request services provided by the application.
  • the client can also have a detection function.
  • the client can detect the interaction delay between the client and the application deployment device 100, and can also detect the location of the client, the session between the client and the client. information such as the connection status (such as connected or disconnected).
  • the client can directly report the detected information to the application deployment device 100 (or the regional application deployment device 200 in the area), or it can report the detected information to the application deployment device 100 (or the application process of the session). Regional application deployment device 200) within the region. In this way, the application deployment device 100 determines the application process for the session initiated by the accessing user based on the information reported by the client.
  • the application deployment apparatus 100 can select an application process in an area close to the access user for a session initiated by the access user based on the location of the client, and can also change the processing in time based on the interaction delay between the client and the application deployment apparatus 100. Session application process.
  • the regional application deployment device 200 in the area adjusts the application process for processing the session initiated by the accessing user based on the information reported by the client.
  • the application deployment device 100 may select, based on the location of the client, an application process that is close to the application on a computing instance with stronger computing power or select an application process that is idle for the session initiated by the accessing user.
  • tenants are allowed to configure a regional elastic policy.
  • the application deployment device 100 can deliver the regional elastic policy or indicate the area to the regional application deployment device 200 in the area. Whether the application deployment device 200 allows elastic scaling of resources within the region.
  • an embodiment of the present application provides a schematic structural diagram of an application deployment device 100 .
  • the application deployment device 100 includes an installation package management module 110 , a process management module 120 , and a session management module 130 .
  • the installation package management module 110 can obtain the installation package of the application provided by the tenant, and the installation package management module 110 can also implement the delivery of the installation package of the application. After the process management module 120 selects a region for the application, the installation package management module 110 can deliver the installation package of the application to the region. For example, the installation package of the application can be carried by the process management module 120 to the region.
  • the internal management device is sending an application deployment request. For another example, the installation package management module 110 may separately deliver the installation package of the application to the regional application deployment device 200 in the region.
  • the process management module 120 creates a process queue based on the installation package of the application under the trigger of the tenant, and the process queue includes one or more application processes of the application.
  • the process management module 120 may also receive an application deployment policy configured by the tenant.
  • the process management module 120 needs to create and maintain a process queue before deploying the application in each area, and determine which areas the application process of the application in the process queue needs to be deployed based on the application deployment policy configured by the tenant, or needs to run in Which type of computing instance is used.
  • the process management module 120 can select a region to deploy the application based on the application deployment policy, and determine the computing instances required to deploy the application in the region.
  • the computing instances required to deploy the application determined by the process management module 120 refer to the number of computing instances required for deployment and the specifications of the computing instances.
  • the process management module 120 may send an application deployment request to the regional application deployment device 200 in the area.
  • the application deployment request is used to request to deploy the application in the area.
  • the application deployment request carries information about the computing instance required to deploy the application. , such as the number of computing instances, specifications and quantity of computing instances.
  • the regional application deployment device 200 in the area creates a computing instance according to the application deployment request, and creates one or more application processes of the application on the computing instance.
  • the application process is created by running the application's installation package.
  • the process management module 120 can select multiple regions for the application, and the multiple regions jointly deploy the application to realize multi-region deployment of the application.
  • the process management module 120 can also select a region for the application to implement single-region deployment of the application.
  • the process management module 120 when the process management module 120 selects a region to deploy the application, the process management module 120 can also issue the regional elastic policy or instruction to the regional application deployment device 200 in the region. Whether the regional application deployment device 200 allows elastic scaling of resources within the region.
  • the session management module 130 is responsible for session-level management operations.
  • the session management module 130 may create a session queue in the application deployment device 100.
  • the session queue is used to carry sessions, and the sessions may be sent by access users of the application.
  • the application can normally provide services to users accessing the application.
  • the interaction between the access user and the application here refers to the interaction between the access user and the application deployment device 100 through the client
  • the access user of the application can initiate a session through the client.
  • the session management module 130 in the application deployment device 100 can process the session and write it into the session queue maintained by the session management module 130.
  • the session management module 130 can process the sessions in sequence in the session queue. individual sessions.
  • the session management module 130 may select an application process for the session and send an instruction to the regional application deployment device 200 in the area where the application process is located to indicate the application process in the area.
  • the application process handles the session.
  • the installation package management module 110, the process management module 120, and the session management module 130 can all be implemented by software, or can be implemented by hardware.
  • the implementation of the installation package management module 110 will be introduced next, taking the installation package management module 110 as an example.
  • the implementation of the process management module 120 and the session management module 130 can refer to the implementation of the installation package management module 110 .
  • the installation package management module 110 may be an application program or code block running on the computing device.
  • the computing device may be at least one of a physical host, a virtual machine, a container, and other computing devices. Further, the above computer equipment may be one or more.
  • the installation package management module 110 may be an application running on multiple hosts/virtual machines/containers. It should be noted that multiple hosts/virtual machines/containers used to run the application can be distributed in the same availability zone (AZ) or in different AZs. Multiple hosts/VMs/containers used to run the application can be distributed in the same region or in different regions. Among them, usually a region can include multiple AZs.
  • multiple hosts/VMs/containers used to run the application can be distributed in the same virtual private cloud (VPC) or across multiple VPCs.
  • VPC virtual private cloud
  • the installation package management module 110 may include at least one computing device, such as a server.
  • the installation package management module 110 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL general array logic
  • Multiple computing devices included in the installation package management module 110 may be distributed in the same AZ or in different AZs. Multiple computing devices included in the installation package management module 110 may be distributed in the same region or in different regions. Similarly, multiple computing devices included in the installation package management module 110 may be distributed in the same VPC or in multiple VPCs.
  • the plurality of computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
  • any module among the installation package management module 110, the process management module 120, and the session management module 130 can be used to execute some or all steps in the application deployment method.
  • Figure 3 is a schematic structural diagram of a regional application deployment device 200 provided by an embodiment of the present application.
  • the regional application deployment device 200 is located in a region.
  • the regional application deployment device 200 includes a deployment module 210 and a regional session management module. 220.
  • the deployment module 210 is used to implement application deployment in this area.
  • the deployment module 210 can obtain the application deployment request sent by the application deployment device 100 (that is, the process management module 120), obtain the installation package of the application, and create the required computing instance for deploying the application in the area according to the application deployment request, and can also Run the installation package of the application on the computing instance and create the application process of the application.
  • the computing instances created by the deployment module 210 for deploying the application may be distributed on the one or more computing devices.
  • deployment module 210 may Create computing instances on part or all of the one or more computing devices for deployment of the application, and the total number and specifications of the created computing instances comply with the information about the computing instances carried in the application deployment request.
  • the deployment module 210 may also create one or more application processes of the application on the computing instance, and each application process is created based on the installation package of the application.
  • the deployment module 210 can also realize elastic expansion and contraction of resources within the region.
  • the application deployment device 100 can deliver the regional elasticity policy to the regional deployment device in the region, so that the deployment module 210 implements elastic scaling of resources in the region based on the regional elasticity policy. .
  • the deployment module 210 can perform resource elasticity on its own. For example, the deployment module 210 can determine whether elastic scaling of resources in the region needs to be implemented and how to achieve elastic scaling of resources in the region based on the usage of physical resources in the region, the working status of each computing instance, and the working status of each application process (such as determining the number of application processes for an expanded application or the number of application processes for a reduced application). For another example, the deployment module 210 may determine whether it is necessary to implement elastic scaling of resources in the region and how to implement elastic scaling of resources in the region based on the number of sessions processed in the region.
  • the deployment module 210 needs to expand the application process of the application or reduce the application process of the application.
  • the deployment module 210 can directly manage the computing instances in the area. In this way, the deployment module 210 can directly instruct the computing instances to expand the application process of the application or reduce the application process of the application.
  • the deployment module 210 can also indirectly manage computing instances in the region.
  • the computing instances in the region are equipped with independent management devices.
  • the management device is used to manage the computing instances in the region, such as creating computing instances, deleting computing instances, instructing computing instances to create or cancel application processes, etc.
  • the deployment module 210 may manage computing instances within a region through a management device.
  • the deployment device may send an instruction to the management device, instructing the management device to expand the application process of the application or reduce the application process of the application.
  • the management device may expand the application process of the application or shrink the application process of the application on the computing instance under the direction of the deployment device.
  • the regional session management module 220 is responsible for management operations at the session level within the region.
  • the regional session management module 220 can obtain the session to be processed from the application deployment device 100 (such as the session management module 130), select an application process to process the session in the area, and send the session to the computing instance where the selected application process is located. .
  • the deployment module 210 and the regional session management module 220 can be implemented by software, or can be implemented by hardware.
  • the implementation of the deployment module 210 and the regional session management module 220 is similar to the implementation of the session management module 130 in the above description. The difference is that the deployment module 210 and the regional session management module 220 need to be deployed in the same area.
  • application deployment includes two stages.
  • the first stage is the intra-region application deployment stage, that is, steps 401 to 401. 407.
  • the application deployment device 100 selects a region to deploy the application, determines the computing instances required to deploy the application in the region, and triggers the creation of computing instances and application processes in the selected region.
  • the second stage is the session processing stage, that is, steps 408 to 412.
  • the application deployment device 100 selects an application process for the session and sends it to the regional application deployment device 200 in the area where the application process is located.
  • the regional application deployment device 200 in the region sends the session to the computing instance where the application process is located, and instructs the application process on the computing instance to process the session.
  • Each step is explained below.
  • Step 401 When the tenant needs to deploy an application, the tenant provides the installation package of the application to the installation package management module 110.
  • the application installation package includes the executable code of the application that needs to be deployed.
  • the installation package management module 110 can create an application image for the application.
  • the application image refers to an operating system in which the installation package of the application is installed.
  • the installation package management module 110 may not create an application image. Instead, after selecting a region for deploying the application, it may directly deliver the installation package of the application to the selected region and create the application image itself in the region.
  • the installation package management module 110 can provide the tenant with an interface for transmitting the installation package of the application by deploying a computing device on the tenant side.
  • Figure 5A is a display interface of this interface facing tenants.
  • Figure 5A is only an exemplary interface. In this interface, the tenant is allowed to upload the installation package of the application. After selecting the installation package file of the application, the tenant can click Upload to provide the installation package of the application to the installation package management module 110 .
  • Step 402 The tenant instructs the process management module 120 to create a process queue and provides the process management module 120 with a deployment policy.
  • the tenant can instruct the process management module 120 to create a process queue.
  • the process management module 120 can create an application process of the application based on the installation package of the application, forming a process that includes one or more The process queue of an application process.
  • the tenant does not need to specify the number of application processes applied in the process queue.
  • the number of application processes created by the process management module 120 is equal to the initial value.
  • the process management module 120 can dynamically adjust it during the execution of subsequent steps. The number of application processes in the process queue.
  • the tenant may also provide a deployment policy to the process management module 120, which includes part or all of the application deployment policy, the session management policy, and the regional elasticity policy.
  • a tenant can configure only app deployment policies or session management policies.
  • tenants can configure session management policies and regional elasticity policies.
  • the embodiment of this application does not limit the order in which the tenant provides the installation package of the application, the tenant instructs the creation of a process queue, and provides the deployment policy.
  • the tenant can first provide the installation package of the application, instruct the creation of the process queue, and then configure the deployment strategy.
  • the tenant can also provide the installation package of the application and configure the deployment policy first, and then instruct the creation of the process queue.
  • the tenant can also provide the installation package of the application, instruct the creation of the process queue and provide the deployment strategy at the same time. This is related to the order in which the process management module 120 provides an interface to the installation package of the application provided by the tenant, an interface that instructs the creation of a process queue, and an interface that provides a deployment policy.
  • the process management module 120 can provide the tenant with an interface for configuring deployment policies and an interface for instructing the creation of a process queue by deploying the computing device on the tenant side.
  • Figure 5B is a tenant-oriented display interface of this interface.
  • Figure 5B is only an exemplary interface. In this interface, tenants can configure application deployment strategies, session management strategies, and regional elasticity strategies.
  • tenants can set the application deployment cost range and area selection. You can also set the session delay range. Tenants can also check the option to allow elastic scaling of resources within the region. If the option to allow elastic scaling of resources within the region is selected, the tenant can select or enter the idle ratio.
  • a "Create Process Queue” button is provided. After the tenant configures the deployment policy, the tenant can click the "Create Process Queue” button. In this way, the tenant simultaneously instructs the creation of a process queue and provides a deployment strategy by clicking this button.
  • Step 403 The process management module 120 selects a region to deploy the application according to the deployment policy, and determines the computing instances required to deploy the application in the selected region, such as determining the number of computing instances required to deploy the application in the selected region. and the specifications of the compute instance.
  • the process management module 120 may also determine the number of application processes of the application created on each computing instance. Application processes that create different numbers of applications run on different computing instances. In some scenarios, the process management module 120 may set a minimum number of application processes for applications created by the computing instance. When the process management module 120 determines the number of application processes of the application created on each computing instance, the number may be equal to the minimum number. In this embodiment of the present application, the allowed process management module 120 dynamically adjusts the number of application processes of an application allowed in each area or the number of application processes of an application running on each computing instance after the application is deployed in each area.
  • the process management module 120 may select a region to deploy the application and the computing instances required to deploy the application in the region according to the application deployment policy.
  • An application deployment policy sets constraints from some or all of the application's deployment cost range and the region's selection range.
  • the application can be deployed in some lower-cost areas.
  • the application deployment policy restricts the selection range of the area
  • the area that conforms to the application deployment policy constraints must be selected.
  • the application deployment strategy requires that the application be deployed in North China and Northeast China as much as possible, followed by Central China.
  • priority should be given to whether North China and Northeast China can support application deployment. Only when neither North China nor Northeast China can support application deployment, Central China should be considered.
  • the process management module 120 selects the region to deploy the application and determines the region to be deployed according to the application deployment policy.
  • the way to deploy the compute instances required for applications within a region is also more complex.
  • big data analysis can be performed on historical region selection data and related data of computing instances required for deploying applications in the region, and the analysis results can be integrated into a set of region selection and resource determination algorithms built into the process management module 120 middle.
  • the process management module 120 can input the application deployment policy into the algorithm to obtain the region and the computing instances required for deploying applications in the region.
  • the above-mentioned methods of selecting a region for deploying the application and determining the computing instances required for deploying the application in the region are only exemplary descriptions. Any method that can determine the region through an application deployment policy is applicable to the embodiments of this application.
  • the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400, and the process management module 120 selects the region to deploy the application according to the application deployment policy and the region selection policy. Since the region selection policy can provide the priority of one or more regions, it is convenient for the process management module 120 to quickly select a region for deploying applications. And because the region selection strategy provided by the global decision-making device is obtained from the occupancy of physical resources in each region, it is guaranteed that the final selected region can effectively implement application deployment.
  • the process management module 120 may select a region to deploy the application and the computing instances required to deploy the application in the region according to preset rules. For example, the process management module 120 selects an area to deploy the application at a default deployment cost. The process management module 120 can also analyze the type of executable code in the installation package of the application and estimate the size of the computing instances required to deploy the application.
  • Step 404 The process management module 120 sends an application deployment request to the regional application deployment device 200 (that is, the deployment module 210 in the regional application deployment device 200) in the selected area.
  • the application deployment request is used to request to deploy the application in the selected area. within the area.
  • the application deployment request carries information about the computing instances required to deploy the application in the region and the application image.
  • the application deployment request can also carry the application to be created on each computing instance. The number of processes.
  • the number of application processes to be created on the computing instance is the number pre-agreed between the process management module 120 and the deployment module 210 (for example, the number of application processes to be created on the computing instance is agreed to be The number is equal to the minimum number of application processes that need to be created on the computing instance).
  • the application deployment request does not need to carry the number of application processes that need to be created on each computing instance.
  • the application image carried by the process management module 120 in the application deployment request is used as an example for explanation.
  • the application image is an operating system for installing the application's installation package. It is essentially a code file for the operating system that contains the application's installation package. That is to say, the process management module 120 delivers the application installation package to the region by sending the application image.
  • the process management module 120 can directly carry the application installation package in the application deployment request. In this case, when the deployment module 210 in the area receives the application deployment request, it needs to prepare the application image by itself.
  • the application installation package (or application image) and the information about the computing instance required to deploy the application within the application are carried in an application deployment request, which can effectively reduce the interaction between the process management module 120 and the regional process management module 120 in the region. frequency.
  • the installation package (or application image) of the application may not be carried in the application deployment request.
  • the process management module 120 sends the installation package or application image of the application to the regional process management module in the region through other methods. 120.
  • the deployment module 210 of the area application deployment device 200 in the area can perform steps 405 to 406.
  • Step 405 The deployment module 210 creates a required computing instance for deploying the application according to the application deployment request.
  • the number of calculation instances is not limited here, it can be one or multiple.
  • the deployment module 210 may instruct the computing device in the area to create a computing instance for deploying the application, and the created computing instance meets the relevant information of the computing instance required for deploying the application within the application. That is, the deployment module 210 needs to create computing instances that comply with the quantity and specifications recorded in the relevant information.
  • the deployment module 210 can learn the usage of physical resources in each computing device in the area.
  • the deployment module 210 can select a computing instance based on the usage of physical resources in each computing device in the area.
  • Step 406 The deployment module 210 creates an application process of the application on the created computing instance.
  • the deployment module 210 sends the application image to the computing instance and instructs the computing instance to install the application image.
  • the computing instance installs the application image under the instruction of the deployment device.
  • the deployment module 210 may also indicate the number of application processes of the application that need to be created on the computing instance. After the computing instance installs the application image, an application process of the application is created under the instruction of the deployment module 210 .
  • the application has been deployed in the region. After completing the deployment in the area, the application can provide services to the users who access the application.
  • Step 407 The session management module 130 obtains the session sent by the access user of the application.
  • the access user of the application can establish a connection with the session management module 130 through the client.
  • the access user of the application initiates a session by operating on the client.
  • the application is a game application
  • the user who accesses the application can install the client software of the game application on a mobile terminal or personal computer.
  • Users accessing the application log in to the game by operating the client software and set up a game.
  • the component game essentially initiates a session, which is used to request the application to build the game.
  • the application is a live broadcast application
  • the user who accesses the application can install the client software of the live broadcast application on a mobile terminal or personal computer. Users accessing the application initiate a live broadcast by operating the client software.
  • Asking the user to initiate a live broadcast essentially initiates a session, which is used to request the application to set up a live broadcast.
  • the application is an online payment application, and users accessing the application can perform operations on a dedicated client device for payment. Users accessing the application make online payments by operating the client device.
  • a user accessing an application initiates an online payment, he or she essentially initiates a session, which is used to request the application to make an online payment.
  • Step 408 The session management module 130 places the session in the session queue.
  • the session management module 130 will maintain a session queue, which can carry multiple sessions.
  • the session management module 130 can process each session in sequence according to the order of the sessions in the session queue.
  • Step 409 The session management module 130 extracts the session to be processed from the session queue, and selects an application process for the session to process the session.
  • the session management module 130 In order to be able to process the session, the session management module 130 needs to deliver the session to the area where the application is deployed in a timely manner. When the application is deployed in a multi-region deployment manner, the session management module 130 needs to provide the session from multiple areas. Select an application within a zone. When an application is deployed in a single-region deployment manner, the application process of the application selected by the session management module 130 is the application process of the application in the region where the application is deployed.
  • the application deployment device 100 selects a region for the session according to the session processing policy.
  • the session management module 130 selects the application process of the application in the area with stronger computing device performance from multiple areas, or selects the distance application. Application processes that access applications within the user's immediate area. On the contrary, if the delay required by the session processing policy is high, the session management module 130 selects for the session the application process of the application in an area with moderate computing device performance, or an application process in an area far away from the access user of the application. application process.
  • the session processing policy usually imposes corresponding constraints on session delay range and other aspects, and the way in which the session management module 130 selects an application process for deploying the session according to the session processing policy is also more complicated.
  • big data analysis can be performed on historical session application process selection data, and the analysis results can be integrated into a set of session application process selection algorithms built into the session management module 130 .
  • the session management module 130 can input session processing policies and multiple areas of application deployment into the algorithm to obtain the application process selected for the session.
  • the above-mentioned method of selecting an application process for this session is only an exemplary description, and any method that can determine an application process through a session management policy is applicable to the embodiment of the present application.
  • the client deployed on the access user side of the application has a detection function.
  • the session management module 130 can also obtain the information reported by the client.
  • the session management module 130 can also refer to the client report when selecting an application process for the session. Information.
  • the session management module 130 may select an area close to the location for the session based on the location reported by the client.
  • the session management module 130 can also obtain the session distribution policy from the global decision-making device, and select an application process for the session according to the session processing policy and the session distribution policy. Since the session distribution policy can provide the priority of the application process of each application, it is convenient for the session management module 130 to more efficiently select the application process to process the session. And because the session distribution strategy provided by the global decision-making device is obtained from the working status of the application process in each area, it is guaranteed that the application process finally selected for the session can process the session in time, ensuring session processing efficiency.
  • the session management module 130 selects an application process for the session by itself.
  • the session management module 130 may select an application process for the session based on the session distribution policy, and the session management module 130 may also select an application process for the session based on the information reported by the client.
  • the session management module 130 may also select an application process for the session based on the latency constrained in the application deployment policy.
  • Step 410 The session management module 130 sends the session to the regional session management module 220 in the area where the selected application process is located, instructing the selected application process to process the session.
  • Step 411 After receiving the session, the regional session management module 220 sends the session to the computing instance where the selected application process is located, and instructs the application process to process the session.
  • Step 412 After receiving the session, the computing instance sends the session to the application process and instructs the application process to process the session.
  • the application deployment device 100 when deploying an application using the embodiment of the present application, if the deployment policy configured by the access user of the application includes a regional elastic policy, elastic scaling of resources in the region is allowed.
  • the application deployment device 100 that is, the process management module 120
  • the application deployment device 100 sends the regional elastic policy to the deployer during the application deployment process.
  • a regional application deployment device 200 within the application area.
  • the embodiment of the present application does not limit the manner and timing of the application deployment device 100 sending the regional elasticity policy.
  • the application deployment apparatus 100 may carry the regional elasticity policy in the application deployment request.
  • the application deployment device 100 may not send the regional elastic policy through an application deployment request, but may separately send the regional elastic policy to the regional application deployment device 200 in the region where the application is deployed. That is, the application deployment device 100 can use other messages to carry the regional elasticity policy. If the regional elasticity policy only indicates that elastic scaling of resources in the region is allowed (but does not indicate the method of elastic scaling of resources in the region), the application deployment device 100 may not send the regional elasticity policy, but instead notify the region by sending an indication message. The application deployment device 200 allows elastic expansion and contraction of resources within a region. If the regional elasticity policy only indicates that elastic scaling of resources within the region is not allowed, the application deployment device 100 sends an instruction message to inform the regional application deployment device 200 that elastic scaling of resources within the region is not allowed.
  • an embodiment of the present application provides a method for elastically scaling resources within a region.
  • the method includes:
  • Step 601 The application process of the application deployed in the area reports the monitored status information to the deployment module 210 in the area.
  • the status information includes the working status of the application process.
  • the status information also includes the status of the physical resources on the computing device where the application process is located.
  • Step 602 The deployment module 210 summarizes the status information reported by the application processes of each application, and determines whether to trigger resource elastic scaling in the region based on the summarized status information and the regional elasticity policy.
  • the deployment module 210 determines the current application in the region based on the summarized status information. Whether the status of the application process meets the triggering conditions for the application process applied in the expansion area described by the regional elasticity policy, or whether it meets the triggering conditions for the application process applied in the shrinking area described by the regional elasticity policy.
  • the deployment module 210 can determine whether expansion is needed based on the summarized status information. Application processes for applications in a zone, or to determine whether application processes for applications within a zone need to be scaled down. In this case, the deployment module 210 may preset the triggering conditions for the application process of the application in the expansion area, or the triggering conditions of the application process of the application in the reduction area. The deployment module 210 determines whether a preset triggering condition for an application process applied in an expansion area is met based on the aggregated status information, or whether a preset triggering condition for an application process applied in a reduction area is met.
  • steps 603 to 604 are executed.
  • steps 605 to 606 are executed.
  • the deployment module 210 does not need to perform steps 602 to 606.
  • Step 603 If the status of the application process currently applied in the area meets the triggering condition for expanding the application process applied in the area, the deployment module 210 determines the number of application processes of the application that needs to be expanded.
  • the regional elastic policy describes the idle ratio threshold of the application process applied in the region
  • the current idle ratio of the application process applied in the region is lower than the idle ratio threshold required by the regional elastic policy, it means that there are currently more idle ratios in the region.
  • the application process of the application is in a busy state, and the number of application processes of the application should be appropriately increased to cope with the possible surge in the number of sessions.
  • the deployment module 210 may determine the number of application processes of the application that needs to be expanded according to the idle ratio required by the regional elasticity policy, and ensure that the idle ratio of the application processes of the expanded application can meet the idle ratio threshold required by the regional elasticity policy.
  • the regional elasticity policy describes that the idle ratio threshold of application processes in the region is 4:10.
  • the region The idle ratio of application processes within the application is 3:28.
  • the deployment module 210 can increase the number of application application processes to ensure that the idle ratio of the application processes in the area can meet 4:10.
  • the deployment module 210 can determine to add 14 application application processes, so that the idle ratio of the application processes in the area can be satisfied. The idle ratio of the application process will be close to 4:10.
  • the idle ratio of the application processes in the area may not be strictly equal to what is required by the regional elasticity policy. Idle ratio. Therefore, in actual applications, there is a certain difference between the idle ratio of the application process of the application in the area and the idle ratio required by the area elasticity policy.
  • the deployment module 210 can preset the idle ratio threshold of the application process applied in the region, and the deployment module 210 can adjust the idle ratio according to the preset idle ratio. Ratio determines the number of application processes that scale the application within the region.
  • the above-mentioned method of determining the number of application processes that need to be expanded is only an example, and the embodiment of the present application does not limit the method in which the deployment module 210 in the area determines the number of application processes that need to be expanded.
  • Step 604 The deployment module 210 instructs the computing instance to create a specified number of application processes of the application.
  • the specified quantity is the quantity determined in step 603.
  • the number of application processes that can run on a computing instance is limited, that is, there is a certain limit on the usage of physical resources on the computing instance. If there are many application processes running on a computing instance, and the application processes of these applications are all busy, it is easy to preempt the virtual resources of the computing instance, which will reduce the execution efficiency of the application process itself. Therefore, application processes for applications that require scaling can be distributed across multiple computing instances.
  • the deployment module 210 needs to report the number of application processes of the application running on the computing instance to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can promptly learn the number of application processes. The distribution of application processes.
  • the deployment module 210 can also create a new computing instance to Expand the application's application process on this new compute instance. In this case, the deployment module 210 needs to report the number and specifications of the newly created computing instances to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can learn the deployment status of the application in a timely manner. , that is, clarify the regions that should be deployed and the computing instances required to deploy the application in each region.
  • Step 605 If the status of the application process currently applied in the area meets the triggering condition for reducing the application process applied in the area, the deployment module 210 determines the number of application processes of the application that needs to be reduced.
  • the regional elastic policy describes the idle ratio threshold of the application process applied in the region, if the idle ratio of the application process currently applied in the region is greater than the idle ratio threshold required by the regional elastic policy, it means that there are currently more applications in the region. If the application process is idle, the number of application processes should be appropriately reduced to avoid wasting resources.
  • the deployment module 210 may determine the number of application processes of the application that needs to be reduced according to the idle ratio required by the regional elasticity policy, and ensure that the idle ratio of the application processes of the reduced application can meet the idle ratio threshold required by the regional elasticity policy.
  • the regional elasticity policy describes that the idle ratio threshold of application processes in the region is 4:10.
  • the region The idle ratio of the application process within the application is 18:28.
  • the deployment module 210 can reduce the number of application processes of the application to ensure that the idle ratio of the application processes in the area can meet 4:10.
  • the deployment module 210 can determine to reduce the application processes of 11 applications, so that the idle ratio of the application processes in the area can be reduced. The idle ratio of the application process will be close to 4:10.
  • the idle ratio of the application processes in the area may not be strictly equal to what is required by the regional elasticity policy. Idle ratio. Therefore, in actual applications, there is a certain difference between the idle ratio of the application process of the application in the area and the idle ratio required by the area elasticity policy.
  • the deployment module 210 can preset the idle ratio threshold of the application process applied in the region, and the deployment module 210 can adjust the idle ratio according to the preset idle ratio. The number of application processes than the reduced application within the determined area.
  • the above-mentioned method of determining the number of application processes that need to be reduced is only an example, and the embodiment of the present application does not limit the method in which the deployment module 210 in the area determines the number of application processes that need to be reduced.
  • Step 606 The deployment module 210 instructs the computing instance to log off the application processes of the specified number of applications.
  • the specified quantity here is the quantity determined in step 605.
  • the deployment module 210 may prioritize logging off application processes of applications that are in an idle state. In this case, the deployment module 210 needs to report the number of application processes of the application running on the computing instance to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can promptly learn the number of application processes. The distribution of application processes.
  • the deployment module 210 may first log off the application processes of all applications on the computing instance and delete the computing instance. In this case, the deployment module 210 needs to report the number and specifications of the deleted computing instances to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can learn the deployment status of the application in a timely manner. That is, clarify the regions where it should be deployed and the computing instances required to deploy the application in each region.
  • the application deployment device 100 can adjust the deployment status of the application.
  • Adjusting the deployment status of an application includes but is not limited to: adding new regions, deleting existing regions, and changing the computing instances required to deploy applications in existing regions.
  • the following is an explanation of how tenants change application configuration policies and adjust application deployment with reference to the attached figure. See Figure 7.
  • the method includes:
  • Step 701 The process management module 120 obtains the changed application deployment policy of the tenant.
  • the process management module 120 provides an interface for changing the deployment policy to the tenant through the client, and the tenant can change part or all of the content in the deployment policy through the interface.
  • the process management module 120 can provide the tenant with an interface for changing the deployment policy by deploying the computing device on the tenant side.
  • Figure 8 is a display interface of this interface facing tenants.
  • Figure 8 is only an exemplary interface. In this interface, tenants can change some or all of the application deployment policy, session management policy, and regional elasticity policy.
  • tenants can reset the deployment cost range and region selection range. You can also reset the session delay range. Tenants can also re-select whether to allow elastic scaling of resources within a region. If the option to allow elastic scaling of resources within a region is selected, tenants can select or enter the idle ratio.
  • the tenant can click the “Submit” button, and the tenant can provide the changed deployment policy to the process management module 120 .
  • Step 702 The process management module 120 determines the deployment status of the current application.
  • the deployment status includes but is not limited to the region where it should be deployed, the computing instances occupied by the deployment of the application in each region, and the number of applications running on each computing instance. application process.
  • Step 703 The process management module 120 determines how to adjust the application deployment according to the changed application deployment policy and the current application deployment status, that is, determines whether a new area needs to be added for the application, or whether it is necessary to delete existing areas for the application. region, or determine whether it is necessary to change the computing instances required for deploying applications in existing regions.
  • the process management module 120 can delete some more expensive areas for the application, or appropriately change the deployment in the existing area. Compute instances required by the application, such as reducing the number of compute instances. If the deployment cost constrained by the changed application deployment policy is higher than the deployment cost constrained by the pre-changed application deployment policy, the process management module 120 can add a new area for the application, or appropriately change the requirements for deploying the application in the existing area. Compute instances, such as increasing the number of compute instances.
  • the process management module 120 may delete the first target area. If the changed application deployment policy indicates that the area allows deployment in a second target area, the process management module 120 may add the second target area for the application if time delay and deployment cost permit.
  • the changed application deployment strategy will usually add new constraints in multiple aspects in the application deployment cost range and the region selection range.
  • the process management module 120 will perform the modified application deployment strategy according to the changed application deployment strategy. Determining how to adjust application deployment is also more complex.
  • the above-mentioned methods of selecting the area to deploy the application and the computing instances required to deploy the application in a certain area are only exemplary descriptions. Any method that can determine the area through the changed application deployment policy is applicable to the embodiments of this application.
  • the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400.
  • the process management module 120 determines how to adjust the application deployment according to the changed application deployment policy, the deployment status of the current application, and the region selection policy. Since the area selection policy can provide the priority of each area, it is convenient for the process management module 120 to quickly determine how to adjust application deployment and determine which areas to add or delete.
  • Step 704 If the process management module 120 determines that a new area needs to be added for the application, the process management module 120 can determine the computing instances required to deploy the application in the new area based on the changed application deployment policy and the deployment status of the current application. Optionally, the process management module 120 can also determine the application process of the application that needs to be created on the computing instance. quantity.
  • the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400.
  • the process management module 120 can select a new application for deployment based on the changed application deployment policy, the deployment status of the current application, and the region selection policy. area.
  • Step 705 The process management module 120 sends an application deployment request to the deployment module 210 in the new area.
  • the application deployment request is used to request to deploy the application in the area.
  • the application deployment request carries information about the computing instances required to deploy the application in the region and the application image.
  • the application deployment request can also carry the number of application processes of the application that needs to be created on the computing instance.
  • the deployment module 210 in the new area can deploy the application in the new area according to the application deployment request.
  • the deployment module 210 deploys the application in the new area in a manner similar to steps 405 to 406.
  • steps 405 to 406 please refer to the foregoing description. , which will not be described again here.
  • Step 706 If the process management module 120 determines that the existing area needs to be deleted for the application, the process management module 120 can determine the area that needs to be deleted based on the changed application deployment policy and the deployment status of the current application.
  • the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400.
  • the process management module 120 can determine that the application needs to be deleted based on the changed application deployment policy, the deployment status of the current application, and the region selection policy. Area.
  • Step 707 The process management module 120 sends an application logout request to the deployment module 210 in the area that needs to be deleted.
  • the application logout request is used to request to log out the application in the area.
  • the deployment module 210 may stop the application process of the application in the area and delete the computing instance where the application process is located.
  • the area process management module 120 in the area can stop the application process of the application in the area after the session processing is completed. Delete the computing instance where the application's application process is located.
  • the regional session management module 220 in this area can also send the unprocessed session to the session management module 130 and request the session management module 130 to re-select an area for the unprocessed session.
  • the regional session management module 220 in this area will not process the session.
  • the deployment module 210 can stop the application process of the application in the area and delete the computing instance where the application process is located.
  • Step 708 If the process management module 120 determines that it is necessary to change the computing instances required for deploying applications in the existing area, the process management module 120 determines the change plan for the computing instances in the existing area based on the changed application deployment strategy and the deployment status of the current application. .
  • the change plan of a computing instance describes the specific method of changing the computing instance.
  • the change plan of the computing instance can record the number of changed computing instances and the specific values, and can also record the specifications before and after the change of the computing instance.
  • Step 709 The process management module 120 sends an application change request to the deployment module 210 in the existing area.
  • the application change request is used to request changes to the computing instance in the area.
  • the application change request carries the change plan of the computing instance.
  • the deployment module 210 After receiving the application change request, the deployment module 210 changes the number or specifications of the computing instances in the area according to the change plan of the computing instances.
  • the tenant has changed the application deployment policy for explanation. If the tenant updates the session processing policy, the session management module 130 receives the updated session processing policy. The session management module 130 can This updated session handling policy selects the application process for subsequent received sessions. If the tenant updates the regional elasticity policy, for example, the regional elasticity policy before the update allows elastic expansion and contraction of resources in the region, but the regional elasticity policy after the update does not allow elastic expansion and contraction of resources in the region, the process management module 120 can instruct and notify the deployment module in the region. 210 no longer implements elastic scaling of resources within the region.
  • the process management module 120 can inform the deployment module 210 in the region of the updated regional elasticity policy, So that the deployment module 210 in the area can execute the embodiment shown in FIG. 4 .
  • computing device 900 includes: bus 901, processor 902, memory 903, and communication interface 904.
  • the processor 902, the memory 903 and the communication interface 904 communicate through the bus 901.
  • Computing device 900 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 900.
  • the bus 901 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one line is used in Figure 9, but it does not mean that there is only one bus or one type of bus.
  • Bus 901 may include a path that carries information between various components of computing device 900 (eg, memory 903, processor 902, communications interface 904).
  • the processor 902 may include a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP) or a digital signal processor (DSP). any one or more of them.
  • CPU central processing unit
  • GPU graphics processing unit
  • MP microprocessor
  • DSP digital signal processor
  • Memory 903 may include volatile memory, such as random access memory (RAM).
  • the processor 902 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid state drive (SSD). drive, SSD).
  • ROM read-only memory
  • HDD hard disk drive
  • SSD solid state drive
  • the memory 903 stores executable program code, and the processor 902 executes the executable program code to respectively implement the functions of the aforementioned installation package management module 110, process management module 120, and session management module 130, thereby implementing the application deployment method. That is, the memory 903 stores instructions for executing the application deployment method.
  • executable code is stored in the memory 903, and the processor 902 executes the executable code to implement the functions of the aforementioned application deployment device 100, thereby implementing the application deployment method. That is, the memory 903 stores instructions for executing the application deployment method.
  • the communication interface 904 uses transceiver modules such as, but not limited to, network interface cards and transceivers to implement communication between the computing device 900 and other devices or communication networks.
  • the computing device shown in Figure 9 can also be used to implement the functions of the regional application deployment device.
  • the memory 903 in the computing device stores executable program code, and the processor 902 executes the executable program code to realize the functions of the aforementioned deployment module 210 and the regional session management module 220 respectively, thereby realizing the regional application deployment method. Operations performed by the application deployment device 200. That is, the memory 903 stores instructions for executing the regional application deployment device 200 in the application deployment method.
  • executable code is stored in the memory 903, and the processor 902 executes the executable code to respectively implement the functions of the aforementioned application deployment device 100, thereby realizing the operations performed by the application deployment device 200 in the application deployment method area. That is, the memory 903 stores instructions for executing the regional application deployment device 200 in the application deployment method.
  • the communication interface 904 uses transceiver modules such as, but not limited to, network interface cards and transceivers to implement computing devices. Communication between device 900 and other devices or communication networks.
  • An embodiment of the present application also provides a computing device cluster.
  • the computing device cluster includes at least one computing device.
  • the computing device may be a server, such as a central server, an edge server, or a local server in a local data center.
  • the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
  • the computing device cluster includes at least one computing device 900 .
  • the same instructions for executing the application deployment method may be stored in the memory 903 of one or more computing devices 900 in the computing device cluster.
  • the memory 903 of one or more computing devices 900 in the computing device cluster may also store part of the instructions for executing the application deployment method.
  • a combination of one or more computing devices 900 may collectively execute instructions for performing an application deployment method.
  • the memories 903 in different computing devices 900 in the computing device cluster may store different instructions, respectively used to execute part of the functions of the application deployment device 100 or the regional application deployment device 200 . That is, the instructions stored in the memory 903 in different computing devices 900 can implement the installation of one or more modules in the package management module 110, the process management module 120, the session management module 130, the deployment module 210, and the regional session management module 220. Function.
  • one or more computing devices in a cluster of computing devices may be connected through a network.
  • the network may be a wide area network or a local area network, etc.
  • An embodiment of the present application also provides a computer program product containing instructions.
  • the computer program product may be a software or program product containing instructions capable of running on a computing device or stored in any available medium.
  • the computer program product when executed on at least one computing device, causes at least one computing device to execute an application deployment method, or an application deployment method.
  • An embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that a computing device can store or a data storage device such as a data center that contains one or more available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, tape), optical media (eg, DVD), or semiconductor media (eg, solid state drive), etc.
  • the computer-readable storage medium includes instructions that instruct the computing device to perform an application deployment method, or instruct the computing device to perform an application deployment method.

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

An application deployment method and system, and a device. In the present application, an application deployment apparatus acquires an installment package of an application and an application deployment policy provided by a tenant, the installment package of the application comprising an executable file of the application, and the application deployment policy indicating constraint conditions of deploying the application; the application deployment apparatus selects a deployment region for the application according to the application deployment policy, and transmits the installment package of the application to the region; the application deployment apparatus creates at least one computing instance in the region by means of a regional application deployment apparatus in the region, and runs the installment package on the at least one computing instance to create a plurality of application processes. When the tenant needs to deploy the application, only the installment package of the application and some constraint conditions required for deploying the application need to be simply provided, the application deployment apparatus and the regional application deployment apparatus in the region help the tenant to complete the deployment of the application, and the tenant does not need to configure resources required by regions, thereby simplifying the application deployment process, and improving the degree of automation of application deployment.

Description

一种应用部署方法、***及设备An application deployment method, system and device
相关申请的交叉引用Cross-references to related applications
本申请要求在2022年07月30日提交中国专利局、申请号为202210912556.2、申请名称为“一种应用部署方法、***及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on July 30, 2022, with application number 202210912556.2 and application name "An application deployment method, system and equipment", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本申请涉及云技术领域,尤其涉及一种应用部署方法、***及设备。This application relates to the field of cloud technology, and in particular, to an application deployment method, system and device.
背景技术Background technique
随着云数据中心的普及,租户可以通过租用云数据中心的资源,将应用部署在云数据中心中。在将应用部署在云数据中心时,应用可以部署在一个云数据中心中,也可以分布在多个云数据中心中,该多个云数据中心可位于不同的区域,也即应用采用了多区域部署的方式。这种部署方式适用于一些大型应用、或该应用面向的用户分布在不同区域的应用。With the popularity of cloud data centers, tenants can deploy applications in cloud data centers by renting resources in cloud data centers. When deploying an application in a cloud data center, the application can be deployed in one cloud data center or distributed in multiple cloud data centers. The multiple cloud data centers can be located in different regions, that is, the application adopts multi-region How to deploy. This deployment method is suitable for some large-scale applications or applications where the users of the application are distributed in different areas.
租户在租用云数据中心的资源以部署应用时,需要明确的指定需要租用的云数据中心中的资源,自行向云数据中心申请资源。实际上,租户并不一定能够准确的估算所需租用的资源,这样也增加了应用部署的难度。When renting resources in a cloud data center to deploy applications, tenants need to clearly specify the resources in the cloud data center to be rented and apply for resources from the cloud data center themselves. In fact, tenants may not be able to accurately estimate the resources they need to rent, which also increases the difficulty of application deployment.
发明内容Contents of the invention
本申请提供一种应用部署方法、***及设备,用以实现应用在云端的自动部署。This application provides an application deployment method, system and equipment to realize automatic deployment of applications in the cloud.
第一方面,本申请实施例提供了一种应用部署方法,该方法可以由应用部署装置以及位于区域内的区域应用部署装置配合执行。在该方法中,应用部署装置先获取租户提供的应用的安装包和应用部署策略,应用的安装包包括应用的可执行文件,应用部署策略指示了部署应用的约束条件;应用部署装置在获取租户提供的应用的安装包和应用部署策略时可以确定该租户需要部署该应用,为了帮助该租户部署该应用,应用部署装置根据应用部署策略为该应用选择部署的区域,并将该应用的安装包发送至区域。本申请实施例中并不限定应用部署装置为应用选择的区域的数量,可以为一个,也可以为多个。In the first aspect, embodiments of the present application provide an application deployment method, which can be executed by an application deployment device and a regional application deployment device located in a region. In this method, the application deployment device first obtains the installation package and application deployment policy of the application provided by the tenant. The installation package of the application includes the executable file of the application, and the application deployment policy indicates the constraints for deploying the application; the application deployment device obtains the installation package of the application from the tenant. When the installation package and application deployment policy of the application are provided, it can be determined that the tenant needs to deploy the application. In order to help the tenant deploy the application, the application deployment device selects a deployment area for the application according to the application deployment policy and installs the application's installation package. Send to zone. The embodiment of the present application does not limit the number of areas selected by the application deployment device for the application. It may be one or multiple areas.
应用部署装置通过区域内的区域应用部署装置指示区域应用部署装置在区域创建至少一个计算实例,在至少一个计算实例上运行多个应用进程。例如,应用部署装置可以向区域内的区域应用部署装置发送应用部署请求,该应用部署请求用于请求在该区域内创建计算实例、并运行安装包创建应用进程。该应用部署请求可以携带需创建计算实例的信息,如该计算实例的规格和数量,可选的,还可以包括每个计算实例上需创建的应用进程的数量。区域应用部署装置可以根据应用部署请求创建计算实例,并在计算实例上运行安装包创建多个应用进程。The application deployment device instructs the regional application deployment device to create at least one computing instance in the region through the regional application deployment device in the region, and run multiple application processes on the at least one computing instance. For example, the application deployment device may send an application deployment request to a regional application deployment device in a region. The application deployment request is used to request to create a computing instance in the region and run the installation package to create an application process. The application deployment request can carry information about the computing instance to be created, such as the specifications and quantity of the computing instance. Optionally, it can also include the number of application processes to be created on each computing instance. The regional application deployment device can create a computing instance according to the application deployment request, and run the installation package on the computing instance to create multiple application processes.
通过上述方法,租户在需要部署应用时,仅需简单的提供应用的安装包以及部署应用需要的一些约束条件,应用部署装置就可以帮助应用完成该应用的部署,租户不需要在配置各个区域需要的资源,简化了应用部署的流程,提升了应用部署的自动化程度。 Through the above method, when the tenant needs to deploy an application, he only needs to simply provide the installation package of the application and some constraints required for deploying the application. The application deployment device can help the application complete the deployment of the application. The tenant does not need to configure each area. resources, simplifying the application deployment process and improving the automation of application deployment.
在一种可能的实施方式中,应用在完成部署后,应用部署装置可以处理该应用的会话。应用部署装置可以获取租户提供的会话处理策略,会话处理策略包括为每个会话分配处理应用进程的策略;租户在提供应用部署策略时,也可以同时提供会话处理策略。当应用部署装置接收该应用的访问用户发送的会话时,可以根据会话处理策略从多个应用进程中选择目标应用进程,该目标应用进程即为本申请实施例中为会话所选择的应用进程,应用部署装置通过该目标应用进程所在区域内的区域应用部署装置将会话发送至目标应用进程以处理会话。例如,应用部署装置可以指示该区域内的区域应用部署装置由该目标应用进程处理该会话,该区域应用部署装置可以在该指示下将会话发送至目标应用进程以处理会话。In a possible implementation, after the application is deployed, the application deployment device can process the session of the application. The application deployment device can obtain the session processing policy provided by the tenant. The session processing policy includes a policy for allocating processing application processes to each session; when the tenant provides the application deployment policy, it can also provide the session processing policy at the same time. When the application deployment device receives a session sent by an access user of the application, it can select a target application process from multiple application processes according to the session processing policy. The target application process is the application process selected for the session in the embodiment of this application. The application deployment device sends the session to the target application process through the regional application deployment device in the area where the target application process is located to process the session. For example, the application deployment device may instruct a regional application deployment device in the region to process the session by the target application process, and the regional application deployment device may send the session to the target application process for processing the session under the instruction.
需要说明的是,租户与访问用户存在一定的区别,该租户可以理解为需要租用资源部署应用的一方,访问用户可以理解为该应用的使用方。It should be noted that there is a certain difference between tenants and access users. The tenant can be understood as the party that needs to rent resources to deploy applications, and the access user can be understood as the user of the application.
通过上述方法,应用部署装置在完成应用部署后,还可以处理该应用的会话,保证该应用可以较好的为访问用户提供服务,保证了应用部署的可靠性以及有效性。Through the above method, after completing the application deployment, the application deployment device can also process the session of the application, ensuring that the application can provide better services to accessing users and ensuring the reliability and effectiveness of application deployment.
在一种可能的实施方式中,应用部署策略指示了部署应用的约束条件,可以理解为该应用部署策略从整体上提供了一些范围性的约束条件,这些约束条件可以不指定具体资源,例如,不指定计算实例的数量或者规格。该应用部署策略可以指示应用的部署成本范围或者指定某一个具体的部署成本值。在本申请实施例中,应用的部署成本指的是部署应用需创建的至少一个计算实例的部署成本,故而,应用的部署成本范围其实质上为该至少一个计算实例的部署成本范围。In a possible implementation, the application deployment policy indicates the constraints for deploying the application. It can be understood that the application deployment policy provides some scope constraints as a whole. These constraints may not specify specific resources, for example, The number or specifications of computing instances are not specified. The application deployment policy can indicate the deployment cost range of the application or specify a specific deployment cost value. In this embodiment of the present application, the deployment cost of an application refers to the deployment cost of at least one computing instance that needs to be created to deploy the application. Therefore, the deployment cost range of the application is essentially the deployment cost range of the at least one computing instance.
通过上述方法,应用部署策略仅需指示应用的部署成本范围,简化租户侧的配置参数,使得应用部署的方式更加简单,简化应用部署步骤,提升应用部署效率。Through the above method, the application deployment policy only needs to indicate the deployment cost range of the application, simplifying the configuration parameters on the tenant side, making the application deployment method simpler, simplifying the application deployment steps, and improving application deployment efficiency.
在一种可能的实施方式中,应用部署策略还可以指示租户设置的区域的选择范围。租户可以根据实际需求设置的区域,以便应用部署装置在选择区域时能够更好贴合租户的需求。在本申请实施例中,租户设置的区域选择范围指的是该至少一个计算实例所在区域的选择范围。In a possible implementation, the application deployment policy may also indicate the selection range of the area set by the tenant. Tenants can set the area according to actual needs, so that the application deployment device can better meet the needs of tenants when selecting areas. In this embodiment of the present application, the area selection range set by the tenant refers to the selection range of the area where the at least one computing instance is located.
在一种可能的实施方式中,会话处理策略指示了目标应用进程处理会话的时延范围。话的处理过程能够满足一定的时延范围,这样满足处理会话的基本需求,防止出现延迟,保证会话处理的及时性。In a possible implementation, the session processing policy indicates a delay range for the target application process to process the session. The conversation processing process can meet a certain delay range, so as to meet the basic needs of processing sessions, prevent delays, and ensure the timeliness of session processing.
在一种可能的实施方式中,应用部署装置在根据应用部署策略选择部署应用的区域时,可以获取区域选择策略,区域选择策略是基于各个区域内物理资源的占用情况生成的,区域选择策略指示了选择各个区域以新创建计算实例的优先级,也即该区域选择策略中可以包括各个区域的优先级,区域的优先级描述了部署应用选择区域时该区域的优先程度;在为应用选择区域时,应用部署装置可以根据应用部署策略和区域选择策略选择部署应用的区域。In a possible implementation, when the application deployment device selects a region to deploy an application according to the application deployment policy, it can obtain the region selection policy. The region selection policy is generated based on the occupancy of physical resources in each region. The region selection policy indicates In order to select the priority of each area to create a new computing instance, that is, the area selection strategy can include the priority of each area. The priority of the area describes the priority of the area when selecting the area for deploying the application; when selecting the area for the application When the application deployment device is configured, the application deployment device may select a region for deploying the application according to the application deployment policy and the region selection policy.
通过上述方法,基于各个区域当前物理资源占用情况选择符合部署要求的区域进行应用部署,保证应用能够在所选择区域内完成部署。Through the above method, an area that meets the deployment requirements is selected for application deployment based on the current physical resource occupancy of each area, ensuring that the application can be deployed in the selected area.
在一种可能的实施方式中,应用部署装置在根据会话处理策略从多个应用进程中为会话选择目标应用进程时,还可以获取会话分发策略,会话分发策略是基于各个区域内的应用进程的工作状态生成的,会话分发策略指示了选择各个应用进程以处理所述会话的优先级,会话分发策略可以包括各个应用进程的优先级,应用进程的优先级描述了为会话选择 目标应用进程时该应用进程的优先程度;之后,再根据会话处理策略和会话分发策略为会话选择目标应用进程。In a possible implementation, when the application deployment device selects a target application process for the session from multiple application processes according to the session processing policy, it can also obtain the session distribution policy. The session distribution policy is based on the application processes in each area. Generated by the working state, the session distribution policy indicates the priority of selecting each application process to handle the session. The session distribution policy may include the priority of each application process. The priority of the application process describes the selection for the session. The target application process is the priority of the application process; then, the target application process is selected for the session based on the session processing policy and the session distribution policy.
通过上述方法,基于当前各个应用进程的工作状态选择出处理该会话的目标应用进程,保证会话能够被高效执行。Through the above method, the target application process for processing the session is selected based on the current working status of each application process, ensuring that the session can be executed efficiently.
在一种可能的实施方式中,应用部署装置还可以获取租户提供的区域弹性策略,区域弹性策略指示是否允许在区域内执行应用进程的弹性伸缩;向区域应用部署装置发送区域弹性策略;这样,区域内的区域应用部署装置在区域内基于区域弹性策略调整应用的应用进程的数量。In a possible implementation, the application deployment device can also obtain the regional elasticity policy provided by the tenant. The regional elasticity policy indicates whether to allow elastic scaling of the application process in the region; send the regional elasticity policy to the regional application deployment device; in this way, The regional application deployment device in the region adjusts the number of application processes applied in the region based on the regional elasticity policy.
通过上述方法,区域弹性策略能够动态地改变应用进程的数量,提升资源的利用率。Through the above method, the regional elasticity strategy can dynamically change the number of application processes and improve resource utilization.
在一种可能的实施方式中,区域弹性策略指示当区域内应用的应用进程的空闲比小于空闲阈值时,增加区域内应用的应用进程的数量,增加数量后区域内应用的应用进程的空闲比等于空闲阈值,区域内应用的应用进程的空闲比等于区域内处于空闲状态应用的应用进程的数量与区域内应用的应用进程的数量的比值。In a possible implementation, the region elasticity policy indicates that when the idle ratio of application processes applied in the region is less than the idle threshold, the number of application processes applied in the region is increased. After the increase, the idle ratio of the application processes applied in the region is increased. Equal to the idle threshold, the idle ratio of application processes applied in the area is equal to the ratio of the number of application processes applied in the idle state to the number of application processes applied in the area.
通过上述方法,区域内的应用进程的空闲比能够接近或者等于租户设定的阈值,保证区域内存在空闲的可用应用进程,便于应对需要处理的会话任务激增的场景。Through the above method, the idle ratio of application processes in the area can be close to or equal to the threshold set by the tenant, ensuring that there are idle available application processes in the area, making it easier to cope with the surge in session tasks that need to be processed.
在一种可能的实施方式中,区域弹性策略指示当区域内应用的应用进程的空闲比大于空闲阈值时,减少区域内应用的应用进程的数量,减少数量后区域内应用的应用进程的空闲比等于空闲阈值,区域内应用的应用进程的空闲比等于区域内处于空闲状态应用的应用进程的数量与区域内应用的应用进程的数量的比值。In a possible implementation, the region elasticity policy indicates that when the idle ratio of the application processes applied in the region is greater than the idle threshold, the number of application processes applied in the region is reduced. After the number is reduced, the idle ratio of the application processes applied in the region is Equal to the idle threshold, the idle ratio of application processes applied in the area is equal to the ratio of the number of application processes applied in the idle state to the number of application processes applied in the area.
通过上述方法,区域内应用的应用进程的空闲比能够接近阈值或者等于阈值,保证区域内存在空闲的应用进程,这样便于应对会话数量激减的场景。Through the above method, the idle ratio of application processes in the area can be close to the threshold or equal to the threshold, ensuring that there are idle application processes in the area, which makes it easier to cope with the scenario where the number of sessions drops sharply.
第二方面,本申请实施例还提供了一种应用部署***,该应用部署***用于执行上述第一方面以及第一方面的各个可能的实施方式中的方法,有益效果可以参见第一方面的描述此处不再赘述。该应用部署***包括应用部署装置以及区域应用部署装置,应用部署装置以及区域应用部署装置所能执行的操作可以参见前述说明,此处不再赘述。In a second aspect, embodiments of the present application also provide an application deployment system, which is used to execute the method in the above first aspect and each possible implementation of the first aspect. For beneficial effects, see the first aspect. The description will not be repeated here. The application deployment system includes an application deployment device and a regional application deployment device. The operations that the application deployment device and the regional application deployment device can perform can be referred to the foregoing description and will not be described again here.
第三方面,本申请实施例还提供了一种应用部署装置,该应用部署装置具有实现上述第一方面的方法实例中应用部署装置的行为功能,有益效果可以参见第一方面的描述此处不再赘述。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。在一个可能的设计中,应用部署装置的结构中包括安装包管理模块、进程管理模块。可选的,该应用部署装置还包括会话管理模块,这些模块可以执行上述第一方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a third aspect, embodiments of the present application also provide an application deployment device, which has the behavioral function of implementing the application deployment device in the method example of the first aspect. The beneficial effects can be found in the description of the first aspect, which is not included here. Again. Functions can be implemented by hardware, or by hardware executing corresponding software. Hardware or software includes one or more modules corresponding to the above functions. In a possible design, the structure of the application deployment device includes an installation package management module and a process management module. Optionally, the application deployment device also includes a session management module. These modules can perform the corresponding functions in the method example of the first aspect. For details, please refer to the detailed description in the method example, which will not be described again here.
第四方面,本申请实施例还提供了一种区域应用部署装置,该区域应用部署装置具有实现上述第一方面的方法实例中区域应用部署装置的行为功能,有益效果可以参见第一方面的描述此处不再赘述。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。在一个可能的设计中,区域应用部署装置的结构中包括部署模块。可选的,该区域应用部署装置还包括区域会话管理模块,这些模块可以执行上述第一方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In the fourth aspect, embodiments of the present application also provide a regional application deployment device, which has the behavioral function of implementing the regional application deployment device in the method example of the first aspect. For beneficial effects, please refer to the description of the first aspect. No further details will be given here. Functions can be implemented by hardware, or by hardware executing corresponding software. Hardware or software includes one or more modules corresponding to the above functions. In a possible design, the structure of the regional application deployment device includes a deployment module. Optionally, the regional application deployment device also includes a regional session management module. These modules can perform corresponding functions in the above method examples of the first aspect. For details, please refer to the detailed description in the method examples, which will not be described again here.
第五方面,本申请实施例还提供了一种计算设备,该计算设备具有实现上述第一方面 的方法实例中应用部署装置的行为的功能,有益效果可以参见第一方面的描述此处不再赘述。计算设备的结构中包括处理器和存储器,处理器被配置为支持应用部署装置执行上述第一方面方法中相应的功能。存储器与处理器耦合,其保存通信装置必要的程序指令和数据。通信装置的结构中还包括通信接口,用于与其他设备进行通信。In a fifth aspect, embodiments of the present application further provide a computing device, which has the ability to implement the above first aspect In the method instance, the function of deploying the behavior of the device is applied. The beneficial effects can be found in the description of the first aspect and will not be described again here. The structure of the computing device includes a processor and a memory, and the processor is configured to support the application deployment device to perform corresponding functions in the method of the first aspect. The memory is coupled to the processor and stores program instructions and data necessary for the communications device. The structure of the communication device also includes a communication interface for communicating with other devices.
第六方面,本申请实施例还提供了一种计算设备集群,该计算设备集群具有实现上述第一方面的方法实例中应用部署装置的行为的功能,有益效果可以参见第一方面的描述此处不再赘述。计算设备集群包括至少一个计算设备,任一计算设备的结构中包括处理器和存储器,任一计算设备中的处理器被配置为支持应用部署装置执行上述第一方面以及第一方面的各个可能的实施方式中的部分或全部功能。存储器与处理器耦合,其保存通信装置必要的程序指令和数据。通信装置的结构中还包括通信接口,用于与其他设备进行通信。In a sixth aspect, embodiments of the present application also provide a computing device cluster, which has the function of realizing the behavior of the application deployment device in the method example of the first aspect. For beneficial effects, please refer to the description of the first aspect here. No longer. The computing device cluster includes at least one computing device. The structure of any computing device includes a processor and a memory. The processor in any computing device is configured to support the application deployment device to execute the above first aspect and each possible method of the first aspect. Some or all of the functions in the implementation. The memory is coupled to the processor and stores program instructions and data necessary for the communications device. The structure of the communication device also includes a communication interface for communicating with other devices.
第七方面,本申请还提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面以及第一方面的各个可能的实施方式中的方法。In a seventh aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores instructions, which when run on a computer, cause the computer to execute the above-mentioned first aspect and each possible implementation of the first aspect. method within the method.
第八方面,本申请还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面以及第一方面的各个可能的实施方式中的方法。In an eighth aspect, the present application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the method in the above-mentioned first aspect and each possible implementation of the first aspect.
第九方面,本申请还提供一种计算机芯片,芯片与存储器相连,芯片用于读取并执行存储器中存储的软件程序,执行上述第一方面以及第一方面的各个可能的实施方式中的方法。In a ninth aspect, this application also provides a computer chip, which is connected to a memory. The chip is used to read and execute the software program stored in the memory, and execute the method in the above-mentioned first aspect and each possible implementation of the first aspect. .
附图说明Description of the drawings
图1为本申请提供的一种***的架构示意图;Figure 1 is a schematic diagram of the architecture of a system provided by this application;
图2为本申请提供的一种应用部署装置的结构示意图;Figure 2 is a schematic structural diagram of an application deployment device provided by this application;
图3为本申请提供的一种区域应用部署装置的结构示意图;Figure 3 is a schematic structural diagram of a regional application deployment device provided by this application;
图4为本申请提供的一种应用部署方法示意图;Figure 4 is a schematic diagram of an application deployment method provided by this application;
图5A为本申请提供的一种提供应用的安装包的界面示意图;Figure 5A is a schematic interface diagram of an application installation package provided by this application;
图5B为本申请提供的一种提供部署策略的界面示意图;Figure 5B is a schematic diagram of an interface for providing deployment strategies provided by this application;
图6为本申请提供的一种实现区域内资源弹性的方法示意图;Figure 6 is a schematic diagram of a method for achieving intra-regional resource elasticity provided by this application;
图7为本申请提供的一种应用部署的变更方法示意图;Figure 7 is a schematic diagram of an application deployment change method provided by this application;
图8为本申请提供的一种变更部署策略的界面示意图;Figure 8 is a schematic interface diagram of a change deployment strategy provided by this application;
图9为本申请提供的一种计算设备的结构示意图;Figure 9 is a schematic structural diagram of a computing device provided by this application;
图10为本申请提供的一种计算设备集群的结构示意图。Figure 10 is a schematic structural diagram of a computing device cluster provided by this application.
具体实施方式Detailed ways
在对本申请实施例所提及的一种应用部署方法、***以及设备说明之前,先对本申请实施例中涉及的一些概念进行说明:Before describing an application deployment method, system and device mentioned in the embodiments of this application, some concepts involved in the embodiments of this application are first described:
1、应用的安装包。1. Application installation package.
应用的安装包中包括应用的可执行文件,该应用的可执行文件中包括了部署应用所必须的一些数据。例如,该应用的可执行代码,又例如,该应用的源代码。其中,可执行代码是可以直接被计算实例(也就处理器)运行的代码,源代码是需要经过编译处理的代码, 无法被处理器直接识别,需要经过编译器处理后生成可执行代码,再由计算实例(也就处理器)运行。在本申请实施例中,若租户需要部署应用,如将应用部署到云端。用户可以将应用的安装包传输给应用部署装置100,以请求应用部署装置100部署该应用。因此,该应用的安装包可以理解为包括有可执行文件的代码文件。The installation package of an application includes an executable file of the application, and the executable file of the application includes some data necessary for deploying the application. For example, the executable code of the application, or the source code of the application. Among them, the executable code is the code that can be directly run by the computing instance (that is, the processor), and the source code is the code that needs to be compiled. It cannot be directly recognized by the processor and needs to be processed by the compiler to generate executable code, which is then run by the computing instance (that is, the processor). In this application embodiment, if the tenant needs to deploy an application, for example, deploy the application to the cloud. The user may transmit the installation package of the application to the application deployment device 100 to request the application deployment device 100 to deploy the application. Therefore, the installation package of the application can be understood as a code file including an executable file.
2、应用进程(process)、进程队列。2. Application process (process) and process queue.
在计算设备(或计算设备上的计算实例)中可以运行应用进程,该应用进程是通过运行应用的安装包中的可执行文件可形成的。应用的安装包中的可执行文件在运行之后,可以形成一个或多个应用进程。多个应用进程所能实现的功能相同,也即均能实现该应用的安装包的可执行代码所表征的功能。该多个应用进程的部署参数可能不同,该运行参数包括但不限于:应用进程的端口范围、应用进程所连接的网络和带宽、应用进程所在区域、应用进程所在的计算实例。An application process may be run in a computing device (or a computing instance on a computing device), and the application process may be formed by running an executable file in the application's installation package. After running, the executable files in the application installation package can form one or more application processes. Multiple application processes can realize the same functions, that is, they can all realize the functions represented by the executable code of the installation package of the application. The deployment parameters of the multiple application processes may be different. The running parameters include but are not limited to: the port range of the application process, the network and bandwidth to which the application process is connected, the region where the application process is located, and the computing instance where the application process is located.
本申请实施例中,将应用进程的状态划分为两种,一种为空闲状态,空闲的应用进程上没有需要处理的会话。一种为忙碌状态,处于忙碌状态的应用进程上运行有会议任务或者存在待处理的会话任务。In the embodiment of this application, the status of the application process is divided into two types, one is the idle state, and there are no sessions that need to be processed on the idle application process. One is the busy state. There are conference tasks running on the application process in the busy state or there are pending session tasks.
另外,在本申请实施例中,区域内运行的应用进程还具备监控功能,该监控功能表现在两方面,一方面为对应用进程自身工作状态的监控。应用进程的工作状态包括但不限于:应用进程的状态(如忙碌、或空闲)、应用进程的会话状态(如应用进程已处理的会话数量、未处理的会话数量)。另一方面是对该应用进程所在的计算设备上物理资源的监控。例如,该应用进程可以监控该计算设备上处理器、内存、带宽等物理资源的占用情况。区域内的应用进程可以将监控所得到的自身状态、以及所在计算设备上物理资源的状态上报给其他装置。在本申请实施例中区域内的应用进程可以将监控所得到的自身状态、以及所在计算设备上物理资源的状态上报给全局资源装置,也可以将监控所得到的自身状态、以及所在计算设备上物理资源的状态上报给该区域内的区域应用部署装置200。In addition, in the embodiment of this application, the application process running in the area also has a monitoring function. This monitoring function is manifested in two aspects. On the one hand, it monitors the working status of the application process itself. The working status of the application process includes but is not limited to: the status of the application process (such as busy or idle), and the session status of the application process (such as the number of sessions processed by the application process and the number of unprocessed sessions). The other aspect is the monitoring of physical resources on the computing device where the application process is located. For example, the application process can monitor the usage of physical resources such as processor, memory, bandwidth, etc. on the computing device. The application process in the area can report the monitored status of itself and the status of the physical resources on the computing device to other devices. In the embodiment of this application, the application process in the area can report its own status obtained by monitoring and the status of the physical resources on the computing device to the global resource device, or it can also report its own status obtained by monitoring and the status of the physical resources on the computing device. The status of the physical resources is reported to the regional application deployment device 200 in the area.
需要说明的是,应用的安装包可以看做是未运行的应用程序,是静态的。应用进程为运行中的应用程序,是动态的。It should be noted that the application installation package can be regarded as a non-running application and is static. The application process is a running application and is dynamic.
在本申请实施例中应用部署装置100在租户的触发下创建进程队列。该进程队列包括一个或多个应用进程。应用部署装置100根据租户提供的部署策略选择部署该应用的区域、确定每个区域内部署应用所需的计算实例。应用部署装置100可以将进程队列中一个或多个应用进程分布在选择的区域的计算实例上,在区域内的计算实例上运行应用进程。In this embodiment of the present application, the application deployment device 100 creates a process queue under the trigger of the tenant. The process queue includes one or more application processes. The application deployment device 100 selects a region to deploy the application according to the deployment policy provided by the tenant, and determines the computing instances required to deploy the application in each region. The application deployment device 100 can distribute one or more application processes in the process queue on computing instances in a selected area, and run the application processes on the computing instances in the area.
在本申请实施例中存在两种应用进程,一种为应用部署装置100所维护的进程队列中的应用进程,另一种为区域内运行的应用进程。应用部署装置100所维护的进程队列中的应用进程可以理解为区域内运行的应用进程在应用部署装置100的映像。进程队列中的应用进程与区域内运行的应用进程存在一一对应的关系。进程队列中应用进程的运行参数与其对应的区域内运行的应用进程的运行参数一致。区别在于,进程队列中的应用进程是一种逻辑上的应用进程并不会处理会话,而区域内运行的应用进程会处理会话。应用部署装置100通过进程队列中的应用进程可以获取区域内运行的应用进程的一些运行参数。应用部署装置100可以向租户展示该进程队列中的应用进程,以便租户能够查看区域内运行的应用进程的一些运行参数,了解应用的运行情况。In the embodiment of the present application, there are two kinds of application processes, one is the application process in the process queue maintained by the application deployment device 100, and the other is the application process running in the area. The application processes in the process queue maintained by the application deployment device 100 can be understood as the image of the application processes running in the area on the application deployment device 100 . There is a one-to-one correspondence between the application processes in the process queue and the application processes running in the area. The operating parameters of the application process in the process queue are consistent with the operating parameters of the application process running in its corresponding area. The difference is that the application process in the process queue is a logical application process and does not process sessions, while the application process running in the area does process sessions. The application deployment device 100 can obtain some operating parameters of the application processes running in the area through the application processes in the process queue. The application deployment device 100 can display the application processes in the process queue to the tenant, so that the tenant can view some operating parameters of the application processes running in the area and understand the running status of the application.
3、会话(session)。3. Session.
会话是指应用进程需要执行的任务。例如若该应用为游戏应用,该会话可以为一局游 戏。若该应用为直播应用,该会话可以为一个直播任务。一个应用进程可以执行一个或多个会话。访问用户通过对该应用的操作(如创建该应用或创建该应用中的某一个功能)向应用部署装置100下发会话。A session refers to the tasks that an application process needs to perform. For example, if the application is a game application, the session can be a game play. If the application is a live broadcast application, the session can be a live broadcast task. An application process can execute one or more sessions. The access user delivers a session to the application deployment device 100 by operating the application (such as creating the application or creating a certain function in the application).
4、区域(region)。4. Region.
在本申请实施例中引入“区域”的概念,区域是以计算设备的部署位置为角度划分形成的。将部署位置靠近的一个或多个计算设备或者将部署位置靠近的一个或多个数据中心(数据中心包括多个计算设备)划分为一个区域。本申请实施例并限定区域的划分方式。In the embodiment of this application, the concept of "area" is introduced, and the area is divided based on the deployment position of the computing device. One or more computing devices with close deployment locations or one or more data centers (the data center includes multiple computing devices) with close deployment locations are divided into one area. The embodiments of this application do not limit the division of areas.
在部署应用时,可以将应用分布在多个区域,也即在该多个区域中的计算设备上运行该应用,实现应用的多区域部署;也可以将该应用集中在一个区域,也即在该一个区域的计算设备上运行该应用,实现应用的单区域部署。When deploying an application, you can distribute the application in multiple regions, that is, run the application on computing devices in the multiple regions to achieve multi-regional deployment of the application; you can also concentrate the application in one region, that is, in The application is run on the computing devices in one area to realize single-area deployment of the application.
需要说明的是,应用部署在区域中指示的是应用部署在某个区域内的数据中心或该区域内的计算设备上。It should be noted that the application deployment in a region indicates that the application is deployed in a data center in a certain region or on a computing device in the region.
5、部署策略。5. Deployment strategy.
该部署策略描述了部署应用需要遵循的一些策略,该部署策略可以包括下列信息的部分或全部:This deployment strategy describes some strategies that need to be followed to deploy applications. The deployment strategy can include some or all of the following information:
应用部署策略、会话处理策略、区域弹性策略。Application deployment strategies, session processing strategies, and regional elasticity strategies.
下面分别对这三种策略进行说明:These three strategies are explained below:
1)、应用部署策略。1), apply deployment strategy.
应用部署策略描述了应用在部署时需要满足的一些条件,应用部署策略指示了部署应用区域的约束条件。该约束条件可以为应用的部署成本范围(也即所创建的计算实例的部署成本范围),还可以为该应用的区域的选择范围(也即所创建的计算实例所在区域的选择范围)。The application deployment policy describes some conditions that the application needs to meet when deployed. The application deployment policy indicates the constraints of the deployment application area. The constraint can be the deployment cost range of the application (that is, the deployment cost range of the created computing instance), or the selection range of the region for the application (that is, the selection range of the region where the created computing instance is located).
其中,部署成本是指租户在部署应用时所限定的费用范围,例如,租户在部署应用时设定该应用的部署成本为500元/月。在部署应用时,为该应用选择的区域、以及为区域内为部署应用创建的计算实例均需要支付一定费用的。区域不同,支付的费用不同,所占用的计算实例的数量或规格不同,所支付的费用也不同。为此,租户可以通过部署策略来指示部署成本范围,以控制部署该应用所需花费的费用。The deployment cost refers to the cost range limited by the tenant when deploying the application. For example, the tenant sets the deployment cost of the application to be 500 yuan/month when deploying the application. When deploying an application, you need to pay a certain fee for the region you select for the application and for the computing instances created within the region for deploying the application. Different regions require different fees. The number or specifications of computing instances occupied are different, and the fees paid are also different. To do this, tenants can control how much it costs to deploy the application by indicating a deployment cost range through a deployment policy.
应用可以采用多区域部署或单区域部署的方式进行部署,也即该应用可以分布在多个区域或一个区域中。租户配置的应用部署策略中可以指示应用采用多区域部署或单区域部署,租户所配置的应用部署策略还可以指示优选的一个或多个区域,也即指示在选择部署应用的区域时区域的选择范围。例如,租户所配置的应用部署策略可以为不同区域配置优先等级,以使得该应用能够部署在优先等级较高的区域中。Applications can be deployed in multi-region deployment or single-region deployment, that is, the application can be distributed in multiple regions or in one region. The application deployment policy configured by the tenant can indicate that the application adopts multi-region deployment or single-region deployment. The application deployment policy configured by the tenant can also indicate one or more preferred regions, that is, the region selection when selecting the region to deploy the application. scope. For example, the application deployment policy configured by the tenant can configure priorities for different areas so that the application can be deployed in areas with higher priority.
2)、会话处理策略。2), session processing strategy.
会话处理策略用于描述为该应用的会话分配处理该会话的应用进程的策略。例如该会话处理策略可以包括应用进程处理会话的时延范围(后续说明中简称为会话的时延范围)。The session processing policy is used to describe the policy of assigning the application process to handle the session of the application. For example, the session processing policy may include a delay range for the application process to process the session (referred to as the session delay range in subsequent descriptions).
访问用户下发的会话可以转换为应用进程需要处理的会话,该会话的时延决定了访问用户获取服务响应的速度。会话时延越小,访问用户在下发会话后,可以越快获取响应。会话处理策略中可以设置会话需要满足的时延范围。The session issued by the access user can be converted into a session that the application process needs to process. The delay of this session determines the speed at which the access user obtains service response. The smaller the session delay, the faster the access user can get a response after the session is delivered. The session processing policy can set the delay range that the session needs to meet.
需要说明的是,会话处理策略指示会话的时延范围仅是举例说明,本申请实施例并不限定该会话处理策略所指示的内容,例如还可以约束不同类型的会话的处理优先级。 It should be noted that the session processing policy indicating the delay range of the session is only for illustration. The embodiments of the present application do not limit the content indicated by the session processing policy. For example, the processing priorities of different types of sessions may also be restricted.
3)、区域弹性策略。3), regional flexibility strategy.
当应用部署在区域内,该区域内创建的应用的应用进程可用于处理会话,应用的应用进程的运行会占用所在计算实例的资源。当应用的应用进程长期处于空闲状态,会导致资源浪费,若适量减少应用的应用进程的数量,甚至减少计算实例的数量,能够有效避免资源浪费的情况。当该区域内的应用的应用进程均处于忙碌状态,说明有大量需要处理的会话;在这种情况下,应用的应用进程的数量较少,会影响会话的处理效率,若适当增加应用的应用进程的数量,可以有效提升会话的执行效率。此外,应用的应用进程队列中总是存在一些冗余的应用的应用进程,也适用于一些会话数量激增的场景。可见,区域内部灵活的调整应用的应用进程的数量能够有效兼顾资源的利用率以及会话的处理效率。When an application is deployed in a region, the application process of the application created in the region can be used to process sessions, and the running of the application's application process will occupy the resources of the computing instance where it is located. When the application process of an application is idle for a long time, it will lead to a waste of resources. If you appropriately reduce the number of application processes or even reduce the number of computing instances, you can effectively avoid resource waste. When the application processes in this area are all busy, it means that there are a large number of sessions that need to be processed. In this case, the number of application processes is small, which will affect the session processing efficiency. If the application process is appropriately increased, The number of processes can effectively improve the execution efficiency of the session. In addition, there are always some redundant application processes in the application process queue, which is also suitable for some scenarios where the number of sessions increases. It can be seen that flexibly adjusting the number of application processes within a region can effectively take into account resource utilization and session processing efficiency.
为此,在本申请实施例中允许租户配置区域弹性策略。区域弹性策略可以指示是否允许实现区域内资源弹性伸缩。所谓资源弹性伸缩是指区域内允许扩展或者缩减应用的应用进程。若区域弹性策略指示允许区域内实现资源弹性伸缩,该区域弹性策略还可以记录区域内实现资源弹性伸缩的方式,例如,该区域弹性策略可以描述扩充或缩减区域中应用的应用进程时需遵循的策略。区域弹性策略可以记录扩充区域中应用的应用进程的触发条件、扩充方式。区域弹性策略还可以记录缩减区域中应用的应用进程的触发条件、缩减方式。若区域弹性策略指示不允许区域内实现资源弹性伸缩,也即区域内不能够变更应用所占用的资源,也即不变更应用的应用进程的数量、计算实例的规格或数量。For this reason, in the embodiment of this application, tenants are allowed to configure regional elastic policies. The regional elasticity policy can indicate whether elastic scaling of resources within the region is allowed. The so-called resource elastic scaling refers to the application process that allows the expansion or reduction of applications in a region. If the regional elasticity policy indicates that resource elasticity is allowed in the region, the regional elasticity policy can also record the method of resource elasticity in the region. For example, the regional elasticity policy can describe the procedures that need to be followed when expanding or shrinking application processes in the region. Strategy. The regional elasticity policy can record the triggering conditions and expansion methods of application processes applied in the expansion region. The regional elasticity policy can also record the triggering conditions and reduction methods of application processes applied in the reduction area. If the regional elasticity policy indicates that resource elastic scaling is not allowed in the region, that is, the resources occupied by the application cannot be changed in the region, that is, the number of application processes, the specifications or the number of computing instances of the application cannot be changed.
例如,针对扩充区域中应用的应用进程,该区域弹性策略可以记录触发条件为区域内空闲的应用的应用进程的数量与该扩充后应用的应用进程的总数量的比例(空闲的应用的应用进程的数量与该扩充后应用的应用进程的总数量的比例可以简称为空闲比)大于第一值。扩充方式为以第一值扩充区域中的应用的应用进程,也即扩充后的应用的应用进程的空闲比等于第一值。类似的,针对缩减区域中进程队列,该区域弹性策略可以记录触发条件为空闲比大于第二值。缩减方式为以第二值缩减区域中的应用的应用进程,也即缩减后应用的应用进程的空闲比等于第二值。其中,第一值以及第二值可以理解为空闲比阈值。扩充应用的应用进程与缩减应用的应用进程可以配置不同的空闲比阈值,也可以配置相同的空闲比阈值。For example, for the application processes applied in the expanded area, the area elasticity policy can record the trigger condition as the ratio of the number of application processes of the idle application in the area to the total number of application processes of the expanded application (the number of application processes of the idle application The ratio of the number to the total number of application processes of the expanded application (which may be referred to as the idle ratio) is greater than the first value. The expansion method is to expand the application process of the application in the area with the first value, that is, the idle ratio of the application process of the expanded application is equal to the first value. Similarly, for reducing the process queue in the area, the area elasticity policy can record that the trigger condition is that the idle ratio is greater than the second value. The reduction method is to reduce the application process of the application in the area by the second value, that is, the idle ratio of the application process after the reduction is equal to the second value. The first value and the second value can be understood as idle ratio thresholds. The application process of the expanded application and the application process of the reduced application can be configured with different idle ratio thresholds, or the same idle ratio threshold can be configured.
6、计算实例(instance)。6. Calculate instance.
在本申请实施例中,当应用部署在某一个区域时,需要占用该区域内的资源。在本申请实施例中以部署应用需占用的资源为计算实例为例进行说明,应用的应用进程运行在计算实例中。计算实例是指通过该计算设备中物理资源的虚拟化构建的独立运行环境。也就是说,该计算实例通过占用该计算设备中的物理资源形成相对独立的运行环境。同一个计算设备上的计算实例之间不会互相影响,是相对独立的。该计算实例可以为该计算设备上所创建的虚拟机(virtual machine,VM),也可以为计算设备上所创建的容器(container)。In this embodiment of the present application, when an application is deployed in a certain area, it needs to occupy resources in that area. In the embodiment of this application, the resources required for deploying an application are used as a computing instance as an example for explanation. The application process of the application runs in the computing instance. A computing instance refers to an independent running environment built through virtualization of physical resources in the computing device. That is to say, the computing instance forms a relatively independent running environment by occupying physical resources in the computing device. Computing instances on the same computing device do not affect each other and are relatively independent. The computing instance can be a virtual machine (VM) created on the computing device, or a container (container) created on the computing device.
计算实例的规格描述了计算实例所需占用的计算设备的物理资源,该计算设备的物理资源包括但不限于:处理器、内存、带宽。The specifications of a computing instance describe the physical resources of the computing device required by the computing instance. The physical resources of the computing device include but are not limited to: processor, memory, and bandwidth.
需要说明的是,该计算实例也包括裸金属服务器,裸金属服务器可以看做一种“特殊”的计算实例。裸金属服务器为独立的服务器。It should be noted that this computing instance also includes bare metal servers, and bare metal servers can be regarded as a "special" computing instance. Bare metal servers are independent servers.
在本申请实施例中,计算实例能够监控自身的工作状态,计算实例的工作状态包括但不限于:计算实例运行中以使用的物理资源(如处理器的利用率、内存的占用率、带宽的占用率等)、计算实例上创建的应用的应用进程的数量。计算实例能够将所监控的计算实 例的工作状态上报给其他装置。在本申请实施例中计算实例可以将所监控的工作状态上报给所在区域内的区域应用部署装置200,还可以将所监控的工作状态上报给全局资源装置。In the embodiment of this application, the computing instance can monitor its own working status. The working status of the computing instance includes but is not limited to: the physical resources used during the running of the computing instance (such as processor utilization, memory occupancy, bandwidth). occupancy rate, etc.), calculate the number of application processes of applications created on the instance. Compute instances enable the monitored computations to be Report the working status of the example to other devices. In the embodiment of the present application, the computing instance can report the monitored working status to the regional application deployment device 200 in the area where it is located, and can also report the monitored working status to the global resource device.
7、客户端连接(client request)。7. Client connection (client request).
在一些应用中,会话是需要访问用户参与的,访问用户需要通过客户端连接到应用中的,一个会话可以允许一个或多个访问用户通过客户端连接到该会话中。例如,游戏类应用,游戏类应用中的一局游戏为一个会话,一局游戏通常需要一个或多个访问用户参与。In some applications, sessions require the participation of access users, who need to connect to the application through the client. A session can allow one or more access users to connect to the session through the client. For example, in a game application, a game in a game application is a session, and a game usually requires the participation of one or more access users.
8、访问用户、租户。8. Access users and tenants.
在本申请实施例中租户指的是需要部署应用的一方,也即需要提供应用的安装包以及部署策略的一方,访问用户指的是通过访问该应用,发起会话的一方。In the embodiment of this application, the tenant refers to the party that needs to deploy the application, that is, the party that needs to provide the installation package and deployment policy of the application. The access user refers to the party that initiates a session by accessing the application.
在本申请实施例中,租户可以与应用部署装置100之间进行交互,向该应用部署装置100发送部署应用所需的应用的安装包、并为该应用配置部署策略。该部署策略描述了部署该应用需遵循的规则,该部署策略包括一些范围性的描述信息,如部署应用的约束条件等。应用部署装置100在接收到该应用的安装包以及部署策略的情况下,基于该部署策略为该应用选择部署该应用的区域,并通过区域应用部署装置在该区域中为该应用创建计算实例,在该计算实例中运行安装包创建应用的应用进程。应用部署装置100在该区域部署了该应用之后,应用部署装置100还能够将访问用户发起的会话发送至区域,以请求该区域内的应用进程处理该会话。通过上述方式,租户在需要部署应用时,仅需要提供应用的安装包以及相应的部署策略,不需要自行选择部署在应用的区域,也不需要自行在该区域内申请支持应用部署的资源,而是由应用部署装置100基于该部署策略实现区域的选择以及资源的申请。租户不再需要感知底层资源,能够有效简化应用部署的流程,提升应用部署的效率。In this embodiment of the present application, the tenant can interact with the application deployment device 100, send the application installation package required for deploying the application to the application deployment device 100, and configure a deployment policy for the application. The deployment policy describes the rules to be followed when deploying the application. The deployment policy includes some scope description information, such as constraints for deploying the application. After receiving the installation package and deployment policy of the application, the application deployment device 100 selects a region to deploy the application for the application based on the deployment policy, and creates a computing instance for the application in the region through the regional application deployment device, Run the application process of the application created by the installation package in the computing instance. After the application deployment device 100 deploys the application in the area, the application deployment device 100 can also send the session initiated by the access user to the area to request the application process in the area to process the session. Through the above method, when tenants need to deploy applications, they only need to provide the application installation package and the corresponding deployment strategy. They do not need to choose the area where the application is deployed, nor do they need to apply for resources to support application deployment in the area. The application deployment device 100 implements area selection and resource application based on the deployment policy. Tenants no longer need to be aware of the underlying resources, which can effectively simplify the application deployment process and improve the efficiency of application deployment.
如图1所示,为本申请实施例提供的一种应用部署***结构示意图,该应用部署***10包括应用部署装置100、以及至少一个区域应用部署装置200。任一区域应用部署装置200位于一个区域内,任一区域应用部署装置200执行所在区域内与应用有关的操作,如实现区域内的应用部署,以及处理分发到该区域内的会话。As shown in Figure 1, it is a schematic structural diagram of an application deployment system provided by an embodiment of the present application. The application deployment system 10 includes an application deployment device 100 and at least one regional application deployment device 200. Any regional application deployment device 200 is located in a region, and any regional application deployment device 200 performs application-related operations in the region, such as implementing application deployment in the region and processing sessions distributed to the region.
应用部署装置100能够在租户的请求下部署应用,完成区域的选择以及与所选择的区域内的区域应用部署装置200配合实现该区域内应用的部署。The application deployment device 100 can deploy applications at the request of tenants, complete region selection, and cooperate with the regional application deployment device 200 in the selected region to implement deployment of applications in the region.
应用部署装置100能够获取租户提供的应用的安装包以及针对该应用的部署策略,根据该应用部署策略选择部署该应用的区域,以及确定在该区域内部署该应用所需的计算实例。在确定了该区域内部署该应用所需的计算实例后,应用部署装置100可以向该区域内的区域应用部署装置200发起应用部署请求,该应用部署请求中携带了应用的安装包、以及所需的计算实例的信息(如计算实例的数量以及规格)。The application deployment device 100 can obtain the installation package of the application provided by the tenant and the deployment policy for the application, select a region to deploy the application according to the application deployment policy, and determine the computing instances required to deploy the application in the region. After determining the computing instances required to deploy the application in the area, the application deployment device 100 can initiate an application deployment request to the regional application deployment device 200 in the area. The application deployment request carries the installation package of the application, and the Required computing instance information (such as the number and specifications of computing instances).
若应用部署装置100为该应用选择了多个区域,该应用部署装置100可以分别向该多个区域内的区域应用部署装置200发起应用部署请求。若应用部署装置100为该应用选了一个区域,该应用部署装置100可以向该区域内的区域应用部署装置200发起应用部署请求。If the application deployment device 100 selects multiple areas for the application, the application deployment device 100 may respectively initiate application deployment requests to the regional application deployment devices 200 in the multiple areas. If the application deployment device 100 selects a region for the application, the application deployment device 100 may initiate an application deployment request to the regional application deployment device 200 in the region.
对于任一区域内的区域应用部署装置200,区域应用部署装置200负责该区域内的应用部署,以及区域内的会话处理。For the regional application deployment device 200 in any region, the regional application deployment device 200 is responsible for application deployment in the region and session processing in the region.
当需要在该区域内部署应用时,区域应用部署装置200会接收到应用部署请求,在接收到该应用部署请求后,根据所需的计算实例的信息为该应用创建部署该应用所需的计算 实例,在计算实例上运行安装包创建应用的应用进程,也即区域应用部署装置200可以指示该计算实例运行应用的安装包,在该区域内创建应用的应用进程。When an application needs to be deployed in the area, the regional application deployment device 200 will receive an application deployment request. After receiving the application deployment request, it will create the computing required for deploying the application based on the information of the required computing instance. In other words, the regional application deployment device 200 can instruct the computing instance to run the installation package of the application and create an application process of the application in the region.
应用部署装置100与区域内的区域应用部署装置200之间交互,完成在该区域内的应用部署。当应用部署在应用部署装置100为其所选择的各个区域内后,该应用即可面向应用的访问用户提供服务。应用部署装置100可以处理来自应用的访问用户的会话,根据会话管理策略为该待处理的会话选择处理该会话的应用进程,应用部署装置100可以将该会话发送到所选的应用进程所在区域的区域应用部署装置200,指示区域应用部署装置200由该应用进程处理该会话。The application deployment device 100 interacts with the regional application deployment device 200 in the region to complete application deployment in the region. After the application is deployed in each area selected by the application deployment device 100, the application can provide services to users who access the application. The application deployment device 100 can process the session of the access user from the application, select an application process for the session to be processed according to the session management policy, and the application deployment device 100 can send the session to the area where the selected application process is located. The regional application deployment device 200 instructs the regional application deployment device 200 to process the session by the application process.
该区域内的区域应用部署装置200在接收到该会话后,将该会话传输给所选择的应用进程,该应用进程处理该会话。After receiving the session, the regional application deployment device 200 in the area transmits the session to the selected application process, and the application process processes the session.
可选的,该应用部署***10中还包括全域部署决策装置400以及全域资源监控装置300。Optionally, the application deployment system 10 also includes a global deployment decision-making device 400 and a global resource monitoring device 300.
全域资源监控装置300用于监控各个区域内的资源使用情况。对于任一区域,全域资源监控装置300所监控该区域内的资源使用情况包括但不限于:该区域内物理资源(如处理器、内存等)的占用情况、该区域内计算实例的工作状态、该区域内计算实例上运行的应用的应用进程的工作状态。The global resource monitoring device 300 is used to monitor resource usage in each area. For any region, the resource usage in the region monitored by the global resource monitoring device 300 includes but is not limited to: the occupancy of physical resources (such as processors, memory, etc.) in the region, the working status of computing instances in the region, The working status of application processes of applications running on computing instances in this area.
全域资源监控装置300可以将所监控的各个区域内的资源使用情况上报至全域部署决策装置400。The global resource monitoring device 300 can report the resource usage in each monitored area to the global deployment decision-making device 400 .
全域部署决策装置400在获取了全域资源监控装置300上报的各个区域内的资源使用情况,能够生成区域选择策略,也可以生成会话分发策略。The global deployment decision-making device 400 can generate a region selection policy or a session distribution policy after acquiring the resource usage in each region reported by the global resource monitoring device 300 .
(1)、区域选择策略为部署应用提供各个区域的优先级。(1). The region selection strategy provides the priority of each region for deploying applications.
全域部署决策装置400综合各个区域内物理资源(如处理器、内存等)的占用情况、和/或计算实例的工作状态,确定各个区域是否能够支持应用部署。例如,当某个区域内物理资源的占用情况低于阈值A,也即该区域内存在较多的物理资源处于空闲状态,那么当后续需要部署新的应用,该区域可以作为部署该应用的优先选项。又例如,当某个区域内物理资源的占用情况高于阈值A,也即该区域内存在较多的物理资源已被占用,那么当后续需要部署新的应用,该区域由于存在较少空闲的物理资源,尽量避免将该应用部署在该区域内。The global deployment decision-making device 400 determines whether each region can support application deployment based on the occupancy of physical resources (such as processors, memory, etc.) and/or the working status of computing instances in each region. For example, when the occupancy of physical resources in a certain area is lower than threshold A, that is, there are many physical resources in the idle state in this area, then when a new application needs to be deployed later, this area can be used as a priority for deploying the application. options. For another example, when the occupancy of physical resources in a certain area is higher than threshold A, that is, more physical resources in this area are occupied, then when new applications need to be deployed later, there are fewer idle resources in this area. Physical resources, try to avoid deploying the application in this area.
全域部署决策装置400可以确定选择各个区域以新创建计算实例的优先级。任一个区域的优先级描述了在部署应用时该区域的优先程度。全域部署决策装置400将该各个区域的优先级作为区域选择策略提供给应用部署装置100。区域选择策略仅是从各个区域的物理资源的占用情况的角度形成的各个区域的优先级,也即区域选择策略并未考虑租户的需求。应用部署策略则是由租户配置的,符合租户需求的。The global deployment decision-making device 400 may determine the priority of selecting each region to newly create a computing instance. The priority of any area describes the priority given to that area when deploying the application. The global deployment decision-making device 400 provides the priority of each region to the application deployment device 100 as a region selection policy. The region selection strategy only forms the priority of each region from the perspective of the occupancy of physical resources in each region, that is, the region selection strategy does not consider the needs of tenants. The application deployment strategy is configured by the tenant and meets the tenant's needs.
应用部署装置100在选择部署应用的区域时,除了考虑租户提供的应用部署策略,还可以结合全域部署决策装置400提供的区域选择策略,应用部署装置100在根据应用部署策略以及区域选择策略选择部署应用的区域时,以应用部署策略为主,以符合租户的需求。When the application deployment device 100 selects a region to deploy an application, in addition to considering the application deployment policy provided by the tenant, it may also combine the region selection policy provided by the global deployment decision-making device 400. The application deployment device 100 selects deployment according to the application deployment policy and the region selection policy. When applying to areas, the application deployment strategy is the main one to meet the needs of tenants.
(2)、会话分发策略为处理会话提供选择各个应用的应用进程以处理会话的优先级,该各个应用的应用进程可以为该应用的所有应用进程中的部分或全部。(2) The session distribution policy provides a priority for selecting the application process of each application to process the session. The application process of each application can be part or all of all application processes of the application.
全域部署决策装置400综合各个区域内计算实例的工作状态、各个区域内计算实例上运行的应用的应用进程的工作状态,确定哪些区域存在空闲的应用的应用进程或存在多少 个空闲的应用的应用进程,哪些区域不存在空闲的应用的应用进程,以此可以确定后续接收到的会话能够被哪些应用的应用进程处理。例如,当某个区域存在空闲的应用的应用进程,且该应用的应用进程所在的计算实例上物理资源的使用率低于阈值B,也即该应用的应用进程能够有效处理后续创建的会话,那么当后续需要处理新的会话,该应用的应用进程可以作为该会话的优先选项,具备较高的优先级。又例如,当某个区域内的应用的应用进程处于忙碌状态,且该应用的应用进程所在的计算实例上物理资源的使用率等于阈值B,也即该应用的应用进程已经调用了所在计算实例能够调用的物理资源,无法较好的保证后续会话的处理效果,需尽量避免将该会话分发到该应用的应用进程上,该应用的应用进程的优先级较低。The global deployment decision-making device 400 integrates the working status of the computing instances in each region and the working status of the application processes running on the computing instances in each region, and determines which regions have idle application application processes or how many there are. There are idle application application processes, and in which areas there are no idle application application processes, it can be determined which application processes can handle subsequent received sessions. For example, when there is an idle application process in a certain area, and the usage of physical resources on the computing instance where the application process is located is lower than threshold B, that is, the application process can effectively handle subsequent created sessions. Then when a new session needs to be processed later, the application process of the application can be used as the priority option of the session and has a higher priority. For another example, when the application process of an application in a certain area is in a busy state, and the usage rate of physical resources on the computing instance where the application process is located is equal to the threshold B, that is, the application process has called the computing instance where the application process is located. The physical resources that can be called cannot guarantee the processing effect of subsequent sessions. It is necessary to try to avoid distributing the session to the application process of the application. The application process of the application has a lower priority.
全域部署决策装置400确定选择各个应用进程以处理会话的优先级。任一个应用进程的优先等级描述了为会话选择应用进程时该应用进程的优先程度。全域部署决策装置400将该各个应用进程的优先等级作为会话分发策略提供给应用部署装置100。区域选择策略仅是从各个区域的计算实例的工作状态、各个区域内计算实例上运行的应用进程的工作状态的角度形成的各个应用进程的优先级,也即会话分发方案并未考虑租户的需求。会话管理策略则是由租户配置的,符合租户需求的。The global deployment decision-making device 400 determines the priority of selecting each application process to handle the session. The priority level of any application process describes the priority given to that application process when selecting an application process for a session. The global deployment decision-making device 400 provides the priority level of each application process as a session distribution policy to the application deployment device 100 . The region selection strategy is only the priority of each application process formed from the perspective of the working status of the computing instances in each region and the working status of the application processes running on the computing instances in each region. That is, the session distribution scheme does not consider the needs of tenants. . The session management policy is configured by the tenant and meets the tenant's needs.
应用部署装置100在选择处理会话的应用进程时,除了考虑租户提供的会话管理策略,还可以结合全域部署决策装置400提供的会话分发策略,应用部署装置100在根据会话管理策略以及区域选择策略选择处理会话的应用进程时,以会话管理策略为主,以便应用进程的选择符合租户的需求。When the application deployment device 100 selects an application process to process a session, in addition to considering the session management policy provided by the tenant, it can also combine the session distribution policy provided by the global deployment decision-making device 400. The application deployment device 100 selects an application process based on the session management policy and the region selection policy. When handling session application processes, the session management strategy is the main focus so that the selection of application processes meets the needs of tenants.
可选的,该应用部署***10还可以包括该应用部署在访问用户侧的客户端,该客户端用于与应用部署装置100进行交互。该客户端可以理解为该应用在访问用户侧的部署客户端软件,也可以理解为专用的客户端设备。例如,该客户端可以是安装在移动终端或个人电脑上的客户端软件,如社交软件、直播软件、游戏软件。又例如,该客户端可以为专用的网上缴费设备,应用的访问用户可以在该网上缴费设备上进行缴费。Optionally, the application deployment system 10 may also include a client where the application is deployed on the access user side, and the client is used to interact with the application deployment device 100 . The client can be understood as the client software deployed by the application on the access user side, or can also be understood as a dedicated client device. For example, the client can be client software installed on a mobile terminal or a personal computer, such as social software, live broadcast software, and game software. For another example, the client can be a dedicated online payment device, and users accessing the application can make payments on the online payment device.
应用的访问用户可以通过客户端与应用部署装置100建立连接,通过客户端向应用部署装置100发送会话,请求获取应用提供的服务。Users who access the application can establish a connection with the application deployment device 100 through the client, send a session to the application deployment device 100 through the client, and request services provided by the application.
另外,在本申请实施例中客户端还可以具备检测功能,该客户端可以检测客户端与应用部署装置100之间交互的时延,还可以检测该客户端所在的位置、该客户端与会话的连接状态(如处于连接状态或断开状态)等信息。客户端可以将所检测到的信息直接上报给应用部署装置100(或区域内的区域应用部署装置200),也可以通过处理会话的应用进程将所检测到的信息上报给应用部署装置100(或区域内的区域应用部署装置200)。这样,应用部署装置100根据该客户端上报的信息为访问用户发起的会话确定应用进程。例如,应用部署装置100可以根据客户端所在的位置为访问用户发起的会话选择靠近访问用户的区域内的应用进程,还可以根据客户端与应用部署装置100之间交互的时延及时变更处理该会话的应用进程。区域内的区域应用部署装置200根据该客户端上报的信息为访问用户发起的会话调整处理该会话的应用进程。例如,应用部署装置100可以根据客户端所在的位置为访问用户发起的会话选择靠近算力更强的计算实例上应用的应用进程或者选择空闲的应用的应用进程。In addition, in the embodiment of the present application, the client can also have a detection function. The client can detect the interaction delay between the client and the application deployment device 100, and can also detect the location of the client, the session between the client and the client. information such as the connection status (such as connected or disconnected). The client can directly report the detected information to the application deployment device 100 (or the regional application deployment device 200 in the area), or it can report the detected information to the application deployment device 100 (or the application process of the session). Regional application deployment device 200) within the region. In this way, the application deployment device 100 determines the application process for the session initiated by the accessing user based on the information reported by the client. For example, the application deployment apparatus 100 can select an application process in an area close to the access user for a session initiated by the access user based on the location of the client, and can also change the processing in time based on the interaction delay between the client and the application deployment apparatus 100. Session application process. The regional application deployment device 200 in the area adjusts the application process for processing the session initiated by the accessing user based on the information reported by the client. For example, the application deployment device 100 may select, based on the location of the client, an application process that is close to the application on a computing instance with stronger computing power or select an application process that is idle for the session initiated by the accessing user.
在本申请实施例中,允许租户配置区域弹性策略,在租户配置区域弹性策略的情况下,应用部署装置100可以向区域内的区域应用部署装置200下发该区域弹性策略或指示区域 应用部署装置200是否允许实现区域内资源弹性伸缩。In this embodiment of the present application, tenants are allowed to configure a regional elastic policy. When the tenant configures a regional elastic policy, the application deployment device 100 can deliver the regional elastic policy or indicate the area to the regional application deployment device 200 in the area. Whether the application deployment device 200 allows elastic scaling of resources within the region.
下面具体到该应用部署***10中的应用部署装置100以及区域应用部署装置200,对该应用部署***10中的装置的结构进行说明:The following is specific to the application deployment device 100 and the regional application deployment device 200 in the application deployment system 10, and the structure of the devices in the application deployment system 10 is described:
如图2所示,为本申请实施例提供一种应用部署装置100的结构示意图,该应用部署装置100包括安装包管理模块110、进程管理模块120、以及会话管理模块130。As shown in FIG. 2 , an embodiment of the present application provides a schematic structural diagram of an application deployment device 100 . The application deployment device 100 includes an installation package management module 110 , a process management module 120 , and a session management module 130 .
安装包管理模块110能够获取租户提供的应用的安装包,安装包管理模块110还能够实现应用的安装包的下发。当进程管理模块120在为该应用选择了区域后,安装包管理模块110可以将该应用的安装包下发到该区域,例如,该应用的安装包可以携带在该进程管理模块120向该区域内的管理装置发送应用部署请求中。又例如,安装包管理模块110可以单独将应用的安装包下发该区域内的区域应用部署装置200。The installation package management module 110 can obtain the installation package of the application provided by the tenant, and the installation package management module 110 can also implement the delivery of the installation package of the application. After the process management module 120 selects a region for the application, the installation package management module 110 can deliver the installation package of the application to the region. For example, the installation package of the application can be carried by the process management module 120 to the region. The internal management device is sending an application deployment request. For another example, the installation package management module 110 may separately deliver the installation package of the application to the regional application deployment device 200 in the region.
进程管理模块120在租户的触发下基于该应用的安装包创建进程队列,该进程队列中包括一个或多个应用的应用进程。进程管理模块120还可以接收租户配置的应用部署策略。The process management module 120 creates a process queue based on the installation package of the application under the trigger of the tenant, and the process queue includes one or more application processes of the application. The process management module 120 may also receive an application deployment policy configured by the tenant.
在实际应用中,租户所配置的部署策略中的一些内容实际上是针对应用的应用进程的,如部署该应用的区域的选择范围、会话的时延范围等。故而,进程管理模块120需要将应用部署在各个区域之前,先创建并维护一个进程队列,基于租户配置的应用部署策略确定该进程队列中的应用的应用进程具体需要部署哪些区域,或需要运行在哪种规格的计算实例上。In actual applications, some contents of the deployment policy configured by the tenant are actually specific to the application process, such as the selection range of the area where the application is deployed, the session delay range, etc. Therefore, the process management module 120 needs to create and maintain a process queue before deploying the application in each area, and determine which areas the application process of the application in the process queue needs to be deployed based on the application deployment policy configured by the tenant, or needs to run in Which type of computing instance is used.
进程管理模块120在获取了该部署策略之后,可以基于该应用部署策略选择部署应用的区域、确定在该区域内部署该应用所需的计算实例。在本申请实施例中,进程管理模块120确定的部署该应用所需的计算实例是指部署所需的计算实例的数量以及计算实例的规格。After obtaining the deployment policy, the process management module 120 can select a region to deploy the application based on the application deployment policy, and determine the computing instances required to deploy the application in the region. In this embodiment of the present application, the computing instances required to deploy the application determined by the process management module 120 refer to the number of computing instances required for deployment and the specifications of the computing instances.
在选择了区域以及确定了该区域内部署该应用所需的计算实例。进程管理模块120可以向该区域内的区域应用部署装置200发送应用部署请求,该应用部署请求用于请求在该区域中部署该应用,该应用部署请求携带了部署应用所需的计算实例的信息,如计算实例的数量、计算实例的规格和数量。该区域内的区域应用部署装置200在接收到该应用部署请求后,按照该应用部署请求创建计算实例,并在该计算实例上创建应用的一个或多个应用进程,该一个或多个应用的应用进程是通过运行该应用的安装包创建的。After you select a region and determine the compute instances required to deploy the application within that region. The process management module 120 may send an application deployment request to the regional application deployment device 200 in the area. The application deployment request is used to request to deploy the application in the area. The application deployment request carries information about the computing instance required to deploy the application. , such as the number of computing instances, specifications and quantity of computing instances. After receiving the application deployment request, the regional application deployment device 200 in the area creates a computing instance according to the application deployment request, and creates one or more application processes of the application on the computing instance. The application process is created by running the application's installation package.
本请实施例并不限定该区域的数量,进程管理模块120可以为该应用选择多个区域,该多个区域共同部署该应用,实现该应用的多区域部署。该进程管理模块120也可以为该应用选择一个区域,实现该应用的单区域部署。This embodiment does not limit the number of regions. The process management module 120 can select multiple regions for the application, and the multiple regions jointly deploy the application to realize multi-region deployment of the application. The process management module 120 can also select a region for the application to implement single-region deployment of the application.
另外,若租户还配置了区域弹性策略,进程管理模块120在选择部署该应用的区域的情况下,进程管理模块120还可以向该区域内的区域应用部署装置200下发该区域弹性策略或指示区域应用部署装置200是否允许实现区域内资源弹性伸缩。In addition, if the tenant also configures a regional elastic policy, when the process management module 120 selects a region to deploy the application, the process management module 120 can also issue the regional elastic policy or instruction to the regional application deployment device 200 in the region. Whether the regional application deployment device 200 allows elastic scaling of resources within the region.
会话管理模块130负责会话层面的管理操作。会话管理模块130可以在应用部署装置100中创建会话队列,该会话队列用于承载会话,该会话可以是应用的访问用户发送的。The session management module 130 is responsible for session-level management operations. The session management module 130 may create a session queue in the application deployment device 100. The session queue is used to carry sessions, and the sessions may be sent by access users of the application.
在完成各个区域内应用的部署后,该应用能够正常为该应用的访问用户提供服务。应用的访问用户通过与该应用的交互(这里访问用户与该应用交互是指访问用户通过客户端与该应用部署装置100的交互),应用的访问用户可以通过客户端发起会话。After the deployment of the application in each area is completed, the application can normally provide services to users accessing the application. By interacting with the application (the interaction between the access user and the application here refers to the interaction between the access user and the application deployment device 100 through the client), the access user of the application can initiate a session through the client.
该应用部署装置100中的会话管理模块130可以处理该会话,写入到会话管理模块130所维护的会话队列中,会话管理模块130可以按照该会话队列中会话的先后顺序依次处理 各个会话。针对任一会话,若该应用部署在多个区域时,会话管理模块130可以为该会话选择应用进程,向该应用进程所在的区域内的区域应用部署装置200发送指示,以指示该区域中该应用进程处理该会话。The session management module 130 in the application deployment device 100 can process the session and write it into the session queue maintained by the session management module 130. The session management module 130 can process the sessions in sequence in the session queue. individual sessions. For any session, if the application is deployed in multiple areas, the session management module 130 may select an application process for the session and send an instruction to the regional application deployment device 200 in the area where the application process is located to indicate the application process in the area. The application process handles the session.
其中,安装包管理模块110、进程管理模块120、以及会话管理模块130均可以通过软件实现,或者可以通过硬件实现。Among them, the installation package management module 110, the process management module 120, and the session management module 130 can all be implemented by software, or can be implemented by hardware.
示例性的,接下来以安装包管理模块110为例,介绍安装包管理模块110的实现方式。类似的,进程管理模块120、以及会话管理模块130的实现方式可以参考安装包管理模块110的实现方式。Illustratively, the implementation of the installation package management module 110 will be introduced next, taking the installation package management module 110 as an example. Similarly, the implementation of the process management module 120 and the session management module 130 can refer to the implementation of the installation package management module 110 .
当通过软件实现时,安装包管理模块110可以是运行在计算设备上的应用程序或代码块。其中,计算设备可以是物理主机、虚拟机、容器等计算设备中的至少一种。进一步地,上述计算机设备可以是一台或者多台。例如,安装包管理模块110可以是运行在多个主机/虚拟机/容器上的应用程序。需要说明的是,用于运行该应用程序的多个主机/虚拟机/容器可以分布在相同的可用区(availability zone,AZ)中,也可以分布在不同的AZ中。用于运行该应用程序的多个主机/虚拟机/容器可以分布在相同的区域(region)中,也可以分布在不同的region中。其中,通常一个region可以包括多个AZ。When implemented by software, the installation package management module 110 may be an application program or code block running on the computing device. The computing device may be at least one of a physical host, a virtual machine, a container, and other computing devices. Further, the above computer equipment may be one or more. For example, the installation package management module 110 may be an application running on multiple hosts/virtual machines/containers. It should be noted that multiple hosts/virtual machines/containers used to run the application can be distributed in the same availability zone (AZ) or in different AZs. Multiple hosts/VMs/containers used to run the application can be distributed in the same region or in different regions. Among them, usually a region can include multiple AZs.
同样,用于运行该应用程序的多个主机/虚拟机/容器可以分布在同一个虚拟私有云(virtual private cloud,VPC)中,也可以分布在多个VPC中。其中,通常一个region可以包括多个VPC,而一个VPC中可以包括多个AZ。Likewise, multiple hosts/VMs/containers used to run the application can be distributed in the same virtual private cloud (VPC) or across multiple VPCs. Among them, usually a region can include multiple VPCs, and a VPC can include multiple AZs.
当通过硬件实现时,安装包管理模块110中可以包括至少一个计算设备,如服务器等。或者,安装包管理模块110也可以是利用专用集成电路(application-specific integrated circuit,ASIC)实现、或可编程逻辑器件(programmable logic device,PLD)实现的设备等。其中,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合实现。When implemented by hardware, the installation package management module 110 may include at least one computing device, such as a server. Alternatively, the installation package management module 110 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above-mentioned PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
安装包管理模块110包括的多个计算设备可以分布在相同的AZ中,也可以分布在不同的AZ中。安装包管理模块110包括的多个计算设备可以分布在相同的region中,也可以分布在不同的region中。同样,安装包管理模块110包括的多个计算设备可以分布在同一个VPC中,也可以分布在多个VPC中。其中,所述多个计算设备可以是服务器、ASIC、PLD、CPLD、FPGA和GAL等计算设备的任意组合。Multiple computing devices included in the installation package management module 110 may be distributed in the same AZ or in different AZs. Multiple computing devices included in the installation package management module 110 may be distributed in the same region or in different regions. Similarly, multiple computing devices included in the installation package management module 110 may be distributed in the same VPC or in multiple VPCs. The plurality of computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
需要说明的是,安装包管理模块110、进程管理模块120、以及会话管理模块130中的任一模块均可以用于执行应用部署方法中的部分或全部步骤。It should be noted that any module among the installation package management module 110, the process management module 120, and the session management module 130 can be used to execute some or all steps in the application deployment method.
如图3所示为本申请实施例提供的一种区域应用部署装置200的结构示意图,该区域应用部署装置200位于一个区域内,该区域应用部署装置200包括部署模块210、以及区域会话管理模块220。Figure 3 is a schematic structural diagram of a regional application deployment device 200 provided by an embodiment of the present application. The regional application deployment device 200 is located in a region. The regional application deployment device 200 includes a deployment module 210 and a regional session management module. 220.
部署模块210用于实现该区域内的应用部署。部署模块210可以获取应用部署装置100(也即进程管理模块120)发送的应用部署请求,获取应用的安装包,根据该应用部署请求为在该区域部署该应用创建所需的计算实例,还可以在该计算实例上运行该应用的安装包,创建应用的应用进程。The deployment module 210 is used to implement application deployment in this area. The deployment module 210 can obtain the application deployment request sent by the application deployment device 100 (that is, the process management module 120), obtain the installation package of the application, and create the required computing instance for deploying the application in the area according to the application deployment request, and can also Run the installation package of the application on the computing instance and create the application process of the application.
由于该区域内包括一些地理位置较为接近的一个或多个计算设备,部署模块210为部署该应用所创建的计算实例可以分布在该一个或多个计算设备上。例如,部署模块210可 以为部署为应用在该一个或多个计算设备的部分或全部上创建计算实例,所创建的计算实例的总数以及规格符合应用部署请求中携带的计算实例的信息。Since the area includes one or more computing devices that are geographically close to each other, the computing instances created by the deployment module 210 for deploying the application may be distributed on the one or more computing devices. For example, deployment module 210 may Create computing instances on part or all of the one or more computing devices for deployment of the application, and the total number and specifications of the created computing instances comply with the information about the computing instances carried in the application deployment request.
部署模块210还可以在计算实例上创建应用的一个或多个应用进程,每个应用进程是基于应用的安装包创建的。The deployment module 210 may also create one or more application processes of the application on the computing instance, and each application process is created based on the installation package of the application.
此外,部署模块210还能够实现区域内的资源弹性伸缩。In addition, the deployment module 210 can also realize elastic expansion and contraction of resources within the region.
当租户配置的部署策略中包括区域弹性策略时,应用部署装置100可以向该区域内的区域部署装置下发该区域弹性策略,以便该部署模块210基于该区域弹性策略实现区域内的资源弹性伸缩。When the deployment policy configured by the tenant includes a regional elasticity policy, the application deployment device 100 can deliver the regional elasticity policy to the regional deployment device in the region, so that the deployment module 210 implements elastic scaling of resources in the region based on the regional elasticity policy. .
当租户配置的部署策略不包括区域弹性策略,或区域弹性策略仅指示允许区域内实现资源弹性伸缩但未明确指示资源弹性伸缩的方式时,部署模块210可以自行进行资源弹性伸缩。例如,部署模块210可以根据区域内物理资源的使用情况、各个计算实例的工作状态、以及各个应用进程的工作状态确定是否需要实现区域内的资源弹性伸缩,以及如何实现区域内的资源弹性伸缩(如确定扩充的应用的应用进程的数量或缩减的应用的应用进程的数量)。又例如,部署模块210可以根据区域内所处理的会话的数量确定是否需要实现区域内的资源弹性伸缩,以及如何实现区域内的资源弹性伸缩。When the deployment policy configured by the tenant does not include a regional elasticity policy, or the regional elasticity policy only indicates that resource elasticity is allowed in the region but does not explicitly indicate the method of resource elasticity, the deployment module 210 can perform resource elasticity on its own. For example, the deployment module 210 can determine whether elastic scaling of resources in the region needs to be implemented and how to achieve elastic scaling of resources in the region based on the usage of physical resources in the region, the working status of each computing instance, and the working status of each application process ( Such as determining the number of application processes for an expanded application or the number of application processes for a reduced application). For another example, the deployment module 210 may determine whether it is necessary to implement elastic scaling of resources in the region and how to implement elastic scaling of resources in the region based on the number of sessions processed in the region.
部署模块210在实现区域内的资源弹性伸缩的过程中,需要扩充应用的应用进程或者缩减应用的应用进程。在实际应用中,部署模块210可以直接管理区域内的计算实例,这样,部署模块210可以直接指示计算实例扩充应用的应用进程或缩减应用的应用进程。当然,部署模块210也可以间接管理区域内的计算实例。例如,区域内的计算实例设置有独立的管理装置,该管理装置用于管理区域内的计算实例,如创建计算实例、删除计算实例、指示计算实例创建或注销应用的应用进程等。部署模块210可以通过管理装置管理区域内的计算实例。部署装置可以向管理装置发送指示,指示管理装置扩充应用的应用进程或缩减应用的应用进程。管理装置可以在部署装置的指示下在计算实例上扩充应用的应用进程或缩减应用的应用进程。In the process of realizing elastic scaling of resources in a region, the deployment module 210 needs to expand the application process of the application or reduce the application process of the application. In actual applications, the deployment module 210 can directly manage the computing instances in the area. In this way, the deployment module 210 can directly instruct the computing instances to expand the application process of the application or reduce the application process of the application. Of course, the deployment module 210 can also indirectly manage computing instances in the region. For example, the computing instances in the region are equipped with independent management devices. The management device is used to manage the computing instances in the region, such as creating computing instances, deleting computing instances, instructing computing instances to create or cancel application processes, etc. The deployment module 210 may manage computing instances within a region through a management device. The deployment device may send an instruction to the management device, instructing the management device to expand the application process of the application or reduce the application process of the application. The management device may expand the application process of the application or shrink the application process of the application on the computing instance under the direction of the deployment device.
区域会话管理模块220负责该区域内会话层面的管理操作。区域会话管理模块220可以从应用部署装置100(如会话管理模块130)获取待处理的会话,在区域内选择处理该会话的应用进程,将该会话发送至所选择的应用进程所在的计算实例中。The regional session management module 220 is responsible for management operations at the session level within the region. The regional session management module 220 can obtain the session to be processed from the application deployment device 100 (such as the session management module 130), select an application process to process the session in the area, and send the session to the computing instance where the selected application process is located. .
部署模块210、以及区域会话管理模块220均可以通过软件实现,或者可以通过硬件实现。部署模块210、以及区域会话管理模块220的实现方式与前述说明中会话管理模块130的实现方式类似,区别在于,部署模块210、以及区域会话管理模块220需要部署在同一区域内。The deployment module 210 and the regional session management module 220 can be implemented by software, or can be implemented by hardware. The implementation of the deployment module 210 and the regional session management module 220 is similar to the implementation of the session management module 130 in the above description. The difference is that the deployment module 210 and the regional session management module 220 need to be deployed in the same area.
下面结合图4对本申请实施例提供的一种应用部署方法进行说明,图4所示的实施例中应用部署包括两个阶段,第一个阶段为区域内应用部署阶段,也即步骤401~步骤407,在该阶段中应用部署装置100选择部署该应用的区域、以及确定区域内部署应用的所需的计算实例,并触发该所选择的区域内创建计算实例、创建应用的应用进程。第二阶段为会话处理阶段,也即步骤408~步骤412,在该阶段中应用部署装置100为会话选择应用进程,将会发送至该应用进程所在区域内的区域应用部署装置200。区域内的区域应用部署装置200将该会话发送至应用进程所在的计算实例,指示该计算实例上的该应用进程处理该会话。下面对各个步骤进行说明。An application deployment method provided by the embodiment of the present application will be described below with reference to Figure 4. In the embodiment shown in Figure 4, application deployment includes two stages. The first stage is the intra-region application deployment stage, that is, steps 401 to 401. 407. In this stage, the application deployment device 100 selects a region to deploy the application, determines the computing instances required to deploy the application in the region, and triggers the creation of computing instances and application processes in the selected region. The second stage is the session processing stage, that is, steps 408 to 412. In this stage, the application deployment device 100 selects an application process for the session and sends it to the regional application deployment device 200 in the area where the application process is located. The regional application deployment device 200 in the region sends the session to the computing instance where the application process is located, and instructs the application process on the computing instance to process the session. Each step is explained below.
步骤401:租户在需要部署应用时,向安装包管理模块110提供的应用的安装包,该 应用的安装包中包括需要部署的应用的可执行代码。Step 401: When the tenant needs to deploy an application, the tenant provides the installation package of the application to the installation package management module 110. The application installation package includes the executable code of the application that needs to be deployed.
安装包管理模块110在获取该应用的安装包后,可以为该应用制作应用镜像,应用镜像是指安装了应用的安装包的操作***。当后续为部署该应用选择了区域后,可以将应用镜像下发所选择的区域,这样区域内不需自行制作应用镜像,以便在较短时间内在区域内部署该应用。当然,安装包管理模块110也可以不制作应用镜像,而是在为部署该应用选择了区域后,向所选择的区域直接下发应用的安装包,区域内自行制作应用镜像。After obtaining the installation package of the application, the installation package management module 110 can create an application image for the application. The application image refers to an operating system in which the installation package of the application is installed. When a region is subsequently selected for deploying the application, the application image can be delivered to the selected region. This way, the region does not need to make its own application image, so that the application can be deployed in the region in a shorter time. Of course, the installation package management module 110 may not create an application image. Instead, after selecting a region for deploying the application, it may directly deliver the installation package of the application to the selected region and create the application image itself in the region.
如图5A所示,为本申请实施例提供的一种界面示意图,安装包管理模块110可以通过部署租户侧的计算设备向租户提供传输应用的安装包的接口。图5A为该接口面向租户的显示界面,图5A仅是一种示例性的界面。在该界面中,允许租户上传应用的安装包,租户在选择了应用的安装包文件之后,可以点击上传,将该应用的安装包提供给安装包管理模块110。As shown in FIG. 5A , which is a schematic interface diagram provided by an embodiment of the present application, the installation package management module 110 can provide the tenant with an interface for transmitting the installation package of the application by deploying a computing device on the tenant side. Figure 5A is a display interface of this interface facing tenants. Figure 5A is only an exemplary interface. In this interface, the tenant is allowed to upload the installation package of the application. After selecting the installation package file of the application, the tenant can click Upload to provide the installation package of the application to the installation package management module 110 .
步骤402:租户指示进程管理模块120创建进程队列,并向该进程管理模块120提供部署策略。Step 402: The tenant instructs the process management module 120 to create a process queue and provides the process management module 120 with a deployment policy.
租户在将应用的安装包提供给安装包管理模块110时,租户可以指示进程管理模块120创建进程队列,进程管理模块120可以基于该应用的安装包创建应用的应用进程,形成包括有一个或多个应用进程的进程队列。When the tenant provides the installation package of the application to the installation package management module 110, the tenant can instruct the process management module 120 to create a process queue. The process management module 120 can create an application process of the application based on the installation package of the application, forming a process that includes one or more The process queue of an application process.
租户可以不指定该进程队列中应用的应用进程的数量,进程管理模块120所的创建进程队列应用的应用进程的数量等于初始值,进程管理模块120在执行后续步骤的过程中,可以动态的调整进程队列中的应用的应用进程的数量。The tenant does not need to specify the number of application processes applied in the process queue. The number of application processes created by the process management module 120 is equal to the initial value. The process management module 120 can dynamically adjust it during the execution of subsequent steps. The number of application processes in the process queue.
租户还可以向进程管理模块120提供部署策略,该部署策略中包括应用部署策略、会话管理策略以及区域弹性策略的部分或全部。例如,租户可以仅配置应用部署策略或会话管理策略。又例如,租户可以配置会话管理策略以及区域弹性策略。The tenant may also provide a deployment policy to the process management module 120, which includes part or all of the application deployment policy, the session management policy, and the regional elasticity policy. For example, a tenant can configure only app deployment policies or session management policies. As another example, tenants can configure session management policies and regional elasticity policies.
本申请实施例中并不限定租户提供应用的安装包、租户指示创建进程队列以及提供部署策略的先后顺序,租户可以先提供应用的安装包、指示创建进程队列,之后再配置部署策略。租户也可以先提供应用的安装包,以及配置部署策略,之后再指示创建进程队列,租户也可以同时提供应用的安装包括、指示创建进程队列以及提供部署策略。这与进程管理模块120向租户提供的应用的安装包提供接口、指示创建进程队列接口以及提供的部署策略的接口的先后顺序有关。The embodiment of this application does not limit the order in which the tenant provides the installation package of the application, the tenant instructs the creation of a process queue, and provides the deployment policy. The tenant can first provide the installation package of the application, instruct the creation of the process queue, and then configure the deployment strategy. The tenant can also provide the installation package of the application and configure the deployment policy first, and then instruct the creation of the process queue. The tenant can also provide the installation package of the application, instruct the creation of the process queue and provide the deployment strategy at the same time. This is related to the order in which the process management module 120 provides an interface to the installation package of the application provided by the tenant, an interface that instructs the creation of a process queue, and an interface that provides a deployment policy.
如图5B所示,为本申请实施例提供的一种界面示意图,进程管理模块120可以通过部署租户侧的计算设备向租户提供配置部署策略的接口以及指示创建进程队列接口。图5B为该接口面向租户的显示界面,图5B仅是一种示例性的界面。在该界面中,租户可以配置应用部署策略、会话管理策略以及区域弹性策略。As shown in FIG. 5B , which is a schematic interface diagram provided by an embodiment of the present application, the process management module 120 can provide the tenant with an interface for configuring deployment policies and an interface for instructing the creation of a process queue by deploying the computing device on the tenant side. Figure 5B is a tenant-oriented display interface of this interface. Figure 5B is only an exemplary interface. In this interface, tenants can configure application deployment strategies, session management strategies, and regional elasticity strategies.
在图5B所示的界面中,租户可以设置应用的部署成本范围、区域的选区域。还可以设置会话的时延范围。租户还可以勾选是否允许实现区域内资源弹性伸缩的选项,在选择允许实现区域内资源弹性伸缩的选项的情况下,租户可以选择或输入空闲比。In the interface shown in Figure 5B, tenants can set the application deployment cost range and area selection. You can also set the session delay range. Tenants can also check the option to allow elastic scaling of resources within the region. If the option to allow elastic scaling of resources within the region is selected, the tenant can select or enter the idle ratio.
在图5B所示的界面中,提供了“创建进程队列”的按键,租户在配置了部署策略之后,可以点击该“创建进程队列”。这样,租户通过点击该按键同时指示创建进程队列以及提供部署策略。In the interface shown in Figure 5B, a "Create Process Queue" button is provided. After the tenant configures the deployment policy, the tenant can click the "Create Process Queue" button. In this way, the tenant simultaneously instructs the creation of a process queue and provides a deployment strategy by clicking this button.
步骤403:进程管理模块120根据部署策略选择部署该应用的区域,确定所选择区域内部署该应用所需的计算实例,如确定所选择的区域内部署该应用所需的计算实例的数量 以及计算实例的规格。Step 403: The process management module 120 selects a region to deploy the application according to the deployment policy, and determines the computing instances required to deploy the application in the selected region, such as determining the number of computing instances required to deploy the application in the selected region. and the specifications of the compute instance.
可选的,进程管理模块120还可以确定每个计算实例上创建的应用的应用进程的数量。不同计算实例上运行创建不同数量的应用的应用进程。在一些场景中,进程管理模块120可以设置计算实例创建的应用的应用进程的最小数量。进程管理模块120在确定每个计算实例上创建的应用的应用进程的数量时,该数量可以等于最小数量。在本申请实施例中,允许进程管理模块120在应用在各个区域部署完成后,再动态的调整各个区域内允许的应用的应用进程的数量或各个计算实例上运行的应用的应用进程的数量。Optionally, the process management module 120 may also determine the number of application processes of the application created on each computing instance. Application processes that create different numbers of applications run on different computing instances. In some scenarios, the process management module 120 may set a minimum number of application processes for applications created by the computing instance. When the process management module 120 determines the number of application processes of the application created on each computing instance, the number may be equal to the minimum number. In this embodiment of the present application, the allowed process management module 120 dynamically adjusts the number of application processes of an application allowed in each area or the number of application processes of an application running on each computing instance after the application is deployed in each area.
若部署策略包括应用部署策略,进程管理模块120可以根据应用部署策略选择部署该应用的区域,以及区域内部署该应用所需的计算实例。If the deployment policy includes an application deployment policy, the process management module 120 may select a region to deploy the application and the computing instances required to deploy the application in the region according to the application deployment policy.
应用部署策略从应用的部署成本范围以及区域的选择范围中的部分或全部设置约束条件。An application deployment policy sets constraints from some or all of the application's deployment cost range and the region's selection range.
当应用部署策略约束部署成本范围,且要求部署成本较低,该应用可以部署在一些费用较低的区域。另外,为了进一步保证降低应用的部署成本,在这些区域内可以为该应用准备较少的资源,如创建少量的计算实例,或创建算力较弱的计算实例。When an application deployment strategy constrains the deployment cost range and requires lower deployment costs, the application can be deployed in some lower-cost areas. In addition, in order to further reduce application deployment costs, you can prepare fewer resources for the application in these areas, such as creating a small number of computing instances, or creating computing instances with weak computing power.
当应用部署策略约束了区域的选择范围,在选择部署应用的区域时需要符合该应用部署策略约束的区域。例如,该应用部署策略中要求该应用需要尽量部署在华北、东北这两个区域,华中区域次之。在选择部署应用的区域时应优先考虑华北、东北这两个区域是否能够支持应用的部署,只有在华北、东北这两个区域均无法支持应用的部署的情况下,再考虑华中区域。When the application deployment policy restricts the selection range of the area, when selecting the area to deploy the application, the area that conforms to the application deployment policy constraints must be selected. For example, the application deployment strategy requires that the application be deployed in North China and Northeast China as much as possible, followed by Central China. When selecting a region to deploy applications, priority should be given to whether North China and Northeast China can support application deployment. Only when neither North China nor Northeast China can support application deployment, Central China should be considered.
应需理解的,在实际应用中,应用部署策略通常会在部署成本范围以及区域的选择范围中的多个方面进行相应的约束,进程管理模块120根据应用部署策略选择部署该应用的区域以及确定区域内部署应用所需的计算实例的方式也更加复杂。在实际应用中可以通过对历史的区域选择数据以及区域内部署应用所需的计算实例的相关数据进行大数据分析,将分析结果整合为一套区域选择以及资源确定的算法内置在进程管理模块120中。进程管理模块120可以将应用部署策略输入值该算法,进而获得区域、以及区域内部署应用所需的计算实例。上述选择部署该应用的区域以及确定区域内部署应用所需的计算实例的方式仅是示例性的说明,凡是能够通过应用部署策略确定区域的方式均适用于本申请实施例。It should be understood that in actual applications, application deployment policies usually impose corresponding constraints on multiple aspects in the deployment cost range and region selection range. The process management module 120 selects the region to deploy the application and determines the region to be deployed according to the application deployment policy. The way to deploy the compute instances required for applications within a region is also more complex. In practical applications, big data analysis can be performed on historical region selection data and related data of computing instances required for deploying applications in the region, and the analysis results can be integrated into a set of region selection and resource determination algorithms built into the process management module 120 middle. The process management module 120 can input the application deployment policy into the algorithm to obtain the region and the computing instances required for deploying applications in the region. The above-mentioned methods of selecting a region for deploying the application and determining the computing instances required for deploying the application in the region are only exemplary descriptions. Any method that can determine the region through an application deployment policy is applicable to the embodiments of this application.
可选的,进程管理模块120还可以从全域部署决策装置400获取区域选择策略,进程管理模块120根据应用部署策略以及区域选择策略选择部署该应用的区域。由于区域选择策略能够提供一个或多个区域的优先级,便于进程管理模块120快速的选择部署应用的区域。且由于全局决策装置提供的区域选择策略是从各个区域的物理资源的占用情况所获得的,保证了最终选择的区域能够有效实现应用的部署。Optionally, the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400, and the process management module 120 selects the region to deploy the application according to the application deployment policy and the region selection policy. Since the region selection policy can provide the priority of one or more regions, it is convenient for the process management module 120 to quickly select a region for deploying applications. And because the region selection strategy provided by the global decision-making device is obtained from the occupancy of physical resources in each region, it is guaranteed that the final selected region can effectively implement application deployment.
若部署策略不包括应用部署策略,进程管理模块120可以根据预设的规则选择部署该应用的区域,以及区域内部署该应用所需的计算实例。例如,进程管理模块120以默认的部署成本选择部署应用的区域,进程管理模块120也可以分析该应用的安装包中可执行代码的类型以及体量估算部署该应用的所需的计算实例。If the deployment policy does not include an application deployment policy, the process management module 120 may select a region to deploy the application and the computing instances required to deploy the application in the region according to preset rules. For example, the process management module 120 selects an area to deploy the application at a default deployment cost. The process management module 120 can also analyze the type of executable code in the installation package of the application and estimate the size of the computing instances required to deploy the application.
步骤404:进程管理模块120向所选择的区域内的区域应用部署装置200(也即区域应用部署装置200中的部署模块210)发送应用部署请求,该应用部署请求用于请求将应用部署在该区域内。该应用部署请求中携带该区域内部署该应用所需的计算实例的信息以及应用镜像。可选的,该应用部署请求中还可以携带每个计算实例上需创建的应用的应用 进程的数量。当然,若初始部署该应用时,该计算实例上需创建的应用的应用进程的数量是进程管理模块120与部署模块210预先约定的数量(如约定以计算实例上需创建的应用的应用进程的数量等于计算实例上需创建的应用的应用进程的最小数量),该应用部署请求中还可以不携带每个计算实例上需创建的应用的应用进程的数量。Step 404: The process management module 120 sends an application deployment request to the regional application deployment device 200 (that is, the deployment module 210 in the regional application deployment device 200) in the selected area. The application deployment request is used to request to deploy the application in the selected area. within the area. The application deployment request carries information about the computing instances required to deploy the application in the region and the application image. Optionally, the application deployment request can also carry the application to be created on each computing instance. The number of processes. Of course, when the application is initially deployed, the number of application processes to be created on the computing instance is the number pre-agreed between the process management module 120 and the deployment module 210 (for example, the number of application processes to be created on the computing instance is agreed to be The number is equal to the minimum number of application processes that need to be created on the computing instance). The application deployment request does not need to carry the number of application processes that need to be created on each computing instance.
需要说明的是,在本申请实施例中,以进程管理模块120在应用部署请求中携带的应用镜像为例进行说明。该应用镜像是安装应用的安装包的操作***,实质上是一种包含了应用的安装包的操作***的代码文件。也就是说,进程管理模块120通过发送应用镜像的方式向区域下发了应用的安装包。在实际应用中,进程管理模块120在应用部署请求中可以直接携带应用的安装包,这种情况下,当该区域内的部署模块210在接收到应用部署请求后,需要自行制备应用镜像。另外,应用的安装包(或者应用镜像)以及应用内部署该应用所需的计算实例的信息携带在一个应用部署请求中,可以有效减少进程管理模块120与区域内的区域进程管理模块120的交互次数。事实上,应用的安装包(或者应用镜像)与也可以不携带在应用部署请求中,而是由进程管理模块120将应用的安装包或者应用镜像通过其他方式发送至区域内的区域进程管理模块120。It should be noted that in this embodiment of the present application, the application image carried by the process management module 120 in the application deployment request is used as an example for explanation. The application image is an operating system for installing the application's installation package. It is essentially a code file for the operating system that contains the application's installation package. That is to say, the process management module 120 delivers the application installation package to the region by sending the application image. In actual applications, the process management module 120 can directly carry the application installation package in the application deployment request. In this case, when the deployment module 210 in the area receives the application deployment request, it needs to prepare the application image by itself. In addition, the application installation package (or application image) and the information about the computing instance required to deploy the application within the application are carried in an application deployment request, which can effectively reduce the interaction between the process management module 120 and the regional process management module 120 in the region. frequency. In fact, the installation package (or application image) of the application may not be carried in the application deployment request. Instead, the process management module 120 sends the installation package or application image of the application to the regional process management module in the region through other methods. 120.
对于任一所选择的区域,该区域内的区域应用部署装置200的部署模块210可以执行步骤405~步骤406。For any selected area, the deployment module 210 of the area application deployment device 200 in the area can perform steps 405 to 406.
步骤405:部署模块210根据应用部署请求为部署该应用创建所需的计算实例。这里并不限定计算实例的数量,可以为一个,也可以为多个。Step 405: The deployment module 210 creates a required computing instance for deploying the application according to the application deployment request. The number of calculation instances is not limited here, it can be one or multiple.
部署模块210可以指示所在区域内的计算设备为部署该应用创建计算实例,所创建的计算实例满足该应用内部署该应用所需的计算实例的相关信息。也即部署模块210需要创建符合该相关信息中记录的数量以及规格的计算实例。The deployment module 210 may instruct the computing device in the area to create a computing instance for deploying the application, and the created computing instance meets the relevant information of the computing instance required for deploying the application within the application. That is, the deployment module 210 needs to create computing instances that comply with the quantity and specifications recorded in the relevant information.
部署模块210作为该区域内应用部署的模块,能够获知该区域内各个计算设备中物理资源的使用情况,部署模块210可以根据该区域内各个计算设备中物理资源的使用情况选择能够创建计算实例的一个或多个计算设备,在该一个或多个计算设备上创建计算实例。As a module for application deployment in the area, the deployment module 210 can learn the usage of physical resources in each computing device in the area. The deployment module 210 can select a computing instance based on the usage of physical resources in each computing device in the area. One or more computing devices on which computing instances are created.
步骤406:部署模块210在所创建的计算实例上创建应用的应用进程。Step 406: The deployment module 210 creates an application process of the application on the created computing instance.
部署模块210将应用镜像发送至计算实例,指示计算实例安装该应用镜像,计算实例在部署装置的指示下安装该应用镜像。部署模块210还可以指示该计算实例上需要创建的应用的应用进程的数量。计算实例安装了该应用镜像后,在部署模块210的指示下创建应用的应用进程。The deployment module 210 sends the application image to the computing instance and instructs the computing instance to install the application image. The computing instance installs the application image under the instruction of the deployment device. The deployment module 210 may also indicate the number of application processes of the application that need to be created on the computing instance. After the computing instance installs the application image, an application process of the application is created under the instruction of the deployment module 210 .
至此,应用已经在区域内完成部署。在完成区域内的部署后,该应用可以面向应用的访问用户提供服务。At this point, the application has been deployed in the region. After completing the deployment in the area, the application can provide services to the users who access the application.
步骤407:会话管理模块130获取应用的访问用户发送的会话。Step 407: The session management module 130 obtains the session sent by the access user of the application.
应用的访问用户可以通过客户端与会话管理模块130建立连接应用的访问用户通过在客户端进行操作,发起会话。The access user of the application can establish a connection with the session management module 130 through the client. The access user of the application initiates a session by operating on the client.
例如,该应用为游戏应用,应用的访问用户可以在移动终端或个人电脑上安装该游戏应用的客户端软件。应用的访问用户通过操作该客户端软件登陆该游戏,组建一局游戏。当应用的访问用户登陆该游戏应用,组件游戏实质上是发起了一个会话,该会话用于请求该应用能够组建该游戏。For example, the application is a game application, and the user who accesses the application can install the client software of the game application on a mobile terminal or personal computer. Users accessing the application log in to the game by operating the client software and set up a game. When the access user of the application logs into the game application, the component game essentially initiates a session, which is used to request the application to build the game.
又例如,该应用为直播应用,应用的访问用户可以在移动终端或个人电脑上安装该直播应用的客户端软件。应用的访问用户通过操作该客户端软件发起一场直播。当应用的访 问用户发起一场直播实质上是发起了一个会话,该会话用于请求该应用能够组建直播。For another example, the application is a live broadcast application, and the user who accesses the application can install the client software of the live broadcast application on a mobile terminal or personal computer. Users accessing the application initiate a live broadcast by operating the client software. When the application accesses Asking the user to initiate a live broadcast essentially initiates a session, which is used to request the application to set up a live broadcast.
又例如,该应用为网上缴费应用,应用的访问用户可以在缴费专用的客户端设备上进行操作。应用的访问用户通过操作该客户端设备进行网上缴费。当应用的访问用户发起网上缴费实质上是发起了一个会话,该会话用于请求该应用进行网上缴费。For another example, the application is an online payment application, and users accessing the application can perform operations on a dedicated client device for payment. Users accessing the application make online payments by operating the client device. When a user accessing an application initiates an online payment, he or she essentially initiates a session, which is used to request the application to make an online payment.
步骤408:会话管理模块130将该会话放置在会话队列中。Step 408: The session management module 130 places the session in the session queue.
会话管理模块130会维护一个会话队列,该会话队列能够承载多个会话,会话管理模块130可以按照会话队列中会话的顺序依次处理各个会话。The session management module 130 will maintain a session queue, which can carry multiple sessions. The session management module 130 can process each session in sequence according to the order of the sessions in the session queue.
步骤409:会话管理模块130从会话队列中提取待处理的会话,为该会话选择应用的应用进程,以处理该会话。Step 409: The session management module 130 extracts the session to be processed from the session queue, and selects an application process for the session to process the session.
为了能够处理该会话,会话管理模块130需要将会话及时的下发到部署有该应用的区域内,当应用采用多区域部署的方式部署时,会话管理模块130需要从多个区域中为该会话选择一个区域内的一个应用进程。当应用采用单区域部署的方式部署时,会话管理模块130所选择的应用的应用进程即为该应用部署的区域内的应用的应用进程。In order to be able to process the session, the session management module 130 needs to deliver the session to the area where the application is deployed in a timely manner. When the application is deployed in a multi-region deployment manner, the session management module 130 needs to provide the session from multiple areas. Select an application within a zone. When an application is deployed in a single-region deployment manner, the application process of the application selected by the session management module 130 is the application process of the application in the region where the application is deployed.
针对应用采用多区域部署的方式部署的情况,若部署策略中包括会话处理策略,应用部署装置100根据会话处理策略为该会话选择区域。For the case where the application is deployed in a multi-region deployment manner, if the deployment policy includes a session processing policy, the application deployment device 100 selects a region for the session according to the session processing policy.
若会话处理策略设置了会话时延范围,且要求还会话具备较低的时延,会话管理模块130从多个区域中选择计算设备性能较强的区域内的应用的应用进程,或选择距离应用的访问用户较近的区域内的应用的应用进程。相反的,若会话处理策略所要求的时延较高,会话管理模块130为该会话选择计算设备性能适中的区域内的应用的应用进程,或距离应用的访问用户较远的区域内的应用的应用进程。If the session processing policy sets a session delay range and requires the session to have a lower delay, the session management module 130 selects the application process of the application in the area with stronger computing device performance from multiple areas, or selects the distance application. Application processes that access applications within the user's immediate area. On the contrary, if the delay required by the session processing policy is high, the session management module 130 selects for the session the application process of the application in an area with moderate computing device performance, or an application process in an area far away from the access user of the application. application process.
应需理解的,在实际应用中,会话处理策略通常会在会话时延范围等方面进行相应的约束,会话管理模块130根据会话处理策略为部署该会话选择应用进程的方式也更加复杂。在实际应用中可以通过对历史的会话的应用进程选择数据进行大数据分析,将分析结果整合为一套针对会话的应用进程选择的算法内置在会话管理模块130中。会话管理模块130可以将会话处理策略以及应用部署的多个区域输入至该算法,进而获得为该会话选择应用进程。上述为该会话选择应用进程的方式仅是示例性的说明,凡是能够通过会话管理策略确定应用进程的方式均适用于本申请实施例。It should be understood that in actual applications, the session processing policy usually imposes corresponding constraints on session delay range and other aspects, and the way in which the session management module 130 selects an application process for deploying the session according to the session processing policy is also more complicated. In practical applications, big data analysis can be performed on historical session application process selection data, and the analysis results can be integrated into a set of session application process selection algorithms built into the session management module 130 . The session management module 130 can input session processing policies and multiple areas of application deployment into the algorithm to obtain the application process selected for the session. The above-mentioned method of selecting an application process for this session is only an exemplary description, and any method that can determine an application process through a session management policy is applicable to the embodiment of the present application.
可选的,部署在应用的访问用户侧的客户端具备检测功能,会话管理模块130还可以获取客户端上报的信息,会话管理模块130在为会话选择应用进程时,还可以参考该客户端上报的信息。例如,该会话管理模块130可以根据该客户端上报的位置为该会话选择靠近该位置的区域。Optionally, the client deployed on the access user side of the application has a detection function. The session management module 130 can also obtain the information reported by the client. The session management module 130 can also refer to the client report when selecting an application process for the session. Information. For example, the session management module 130 may select an area close to the location for the session based on the location reported by the client.
可选的,会话管理模块130还可以从全局决策装置获取会话分发策略,根据会话处理策略和会话分发策略为该会话选择应用进程。由于会话分发策略能够提供各个应用的应用进程的优先级,便于会话管理模块130较高效选择出处理该会话的应用进程。且由于全局决策装置提供的会话分发策略是从各个区域的应用进程的工作状态获得的,保证了最终选择为会话所选择的应用进程能够及时处理该会话,确保会话的处理效率。Optionally, the session management module 130 can also obtain the session distribution policy from the global decision-making device, and select an application process for the session according to the session processing policy and the session distribution policy. Since the session distribution policy can provide the priority of the application process of each application, it is convenient for the session management module 130 to more efficiently select the application process to process the session. And because the session distribution strategy provided by the global decision-making device is obtained from the working status of the application process in each area, it is guaranteed that the application process finally selected for the session can process the session in time, ensuring session processing efficiency.
若部署策略中不包括会话处理策略,会话管理模块130自行为该会话选择应用进程。会话管理模块130可以根据该会话分发策略为该会话选择应用进程,会话管理模块130也可以根据该客户端上报的信息为该会话选择应用进程。会话管理模块130还可以根据应用部署策略中约束的时延为该会话选择应用进程。 If the deployment policy does not include a session processing policy, the session management module 130 selects an application process for the session by itself. The session management module 130 may select an application process for the session based on the session distribution policy, and the session management module 130 may also select an application process for the session based on the information reported by the client. The session management module 130 may also select an application process for the session based on the latency constrained in the application deployment policy.
步骤410:会话管理模块130将该会话发送到所选的应用进程所在的区域内的区域会话管理模块220,指示由所选择的应用进程处理该会话。Step 410: The session management module 130 sends the session to the regional session management module 220 in the area where the selected application process is located, instructing the selected application process to process the session.
步骤411:区域会话管理模块220在接收到该会话后,将该会话发送至所选择应用进程所在的计算实例,指示该应用进程处理该会话。Step 411: After receiving the session, the regional session management module 220 sends the session to the computing instance where the selected application process is located, and instructs the application process to process the session.
步骤412:该计算实例在接收到该会话后,将该会话发送给该应用进程,指示该应用进程处理该会话。Step 412: After receiving the session, the computing instance sends the session to the application process and instructs the application process to process the session.
在上述说明中可知,采用本申请实施例在部署应用时,若应用的访问用户所配置部署策略中包括区域弹性策略,则允许实现区域内的资源弹性伸缩。应用部署装置100(也即进程管理模块120)在获取了该部署策略后,若该部署策略中包括有区域弹性策略,应用部署装置100在部署应用的过程中将该区域弹性策略发送给部署该应用的区域内的区域应用部署装置200。本申请实施例并不限定应用部署装置100发送该区域弹性策略的方式以及时机。应用部署装置100可以将该区域弹性策略携带在应用部署请求。应用部署装置100也可以不通过应用部署请求发送给区域弹性策略,而是单独将该区域弹性策略发送给部署该应用的区域内的区域应用部署装置200。也即应用部署装置100可以采用其他消息承载该区域弹性策略。若区域弹性策略仅指示允许实现区域内的资源弹性伸缩(未指示实现区域内的资源弹性伸缩的方式),应用部署装置100可以不发送该区域弹性策略,而是采用发送指示消息的方式告知区域应用部署装置200允许实现区域内的资源弹性伸缩。若区域弹性策略仅指示不允许实现区域内的资源弹性伸缩,应用部署装置100采用发送指示消息的方式告知区域应用部署装置200不允许实现区域内的资源弹性伸缩。As can be seen from the above description, when deploying an application using the embodiment of the present application, if the deployment policy configured by the access user of the application includes a regional elastic policy, elastic scaling of resources in the region is allowed. After the application deployment device 100 (that is, the process management module 120) obtains the deployment policy, if the deployment policy includes a regional elastic policy, the application deployment device 100 sends the regional elastic policy to the deployer during the application deployment process. A regional application deployment device 200 within the application area. The embodiment of the present application does not limit the manner and timing of the application deployment device 100 sending the regional elasticity policy. The application deployment apparatus 100 may carry the regional elasticity policy in the application deployment request. The application deployment device 100 may not send the regional elastic policy through an application deployment request, but may separately send the regional elastic policy to the regional application deployment device 200 in the region where the application is deployed. That is, the application deployment device 100 can use other messages to carry the regional elasticity policy. If the regional elasticity policy only indicates that elastic scaling of resources in the region is allowed (but does not indicate the method of elastic scaling of resources in the region), the application deployment device 100 may not send the regional elasticity policy, but instead notify the region by sending an indication message. The application deployment device 200 allows elastic expansion and contraction of resources within a region. If the regional elasticity policy only indicates that elastic scaling of resources within the region is not allowed, the application deployment device 100 sends an instruction message to inform the regional application deployment device 200 that elastic scaling of resources within the region is not allowed.
下面对实现区域内资源弹性伸缩的方式进行说明:The following describes how to achieve elastic scaling of resources within a region:
如图6所示,为本申请实施例提供的一种区域内资源弹性伸缩的方式,该方法包括:As shown in Figure 6, an embodiment of the present application provides a method for elastically scaling resources within a region. The method includes:
步骤601:区域内部署的应用的应用进程向该区域内的部署模块210上报所监控的状态信息,该状况信息包括应用的应用进程的工作状态。可选的,状态信息还包括该应用的应用进程所在的计算设备上物理资源的状态。Step 601: The application process of the application deployed in the area reports the monitored status information to the deployment module 210 in the area. The status information includes the working status of the application process. Optionally, the status information also includes the status of the physical resources on the computing device where the application process is located.
步骤602:部署模块210将各个应用的应用进程所上报的状态信息进行汇总,根据汇总后的状态信息以及区域弹性策略确定是否触发区域内资源弹性伸缩。Step 602: The deployment module 210 summarizes the status information reported by the application processes of each application, and determines whether to trigger resource elastic scaling in the region based on the summarized status information and the regional elasticity policy.
若区域弹性策略指示允许实现区域内的资源弹性伸缩,且指示了区域弹性策略描述的扩充或缩减区域中应用的应用进程的触发条件,部署模块210根据汇总后的状态信息确定当前该区域内应用的应用进程的状态是否满足区域弹性策略描述的扩充区域中应用的应用进程的触发条件,或是否满足区域弹性策略描述的缩减区域中应用的应用进程的触发条件。If the regional elasticity policy indicates that resource elasticity in the region is allowed to be elastically scaled, and the regional elasticity policy describes the triggering conditions for expanding or reducing the application process in the region, the deployment module 210 determines the current application in the region based on the summarized status information. Whether the status of the application process meets the triggering conditions for the application process applied in the expansion area described by the regional elasticity policy, or whether it meets the triggering conditions for the application process applied in the shrinking area described by the regional elasticity policy.
若区域弹性策略指示允许实现区域内的资源弹性伸缩,但未指示区域弹性策略描述的扩充或缩减区域中应用的应用进程的触发条件,部署模块210可以根据汇总后的状态信息自行确定是否需要扩充区域中应用的应用进程,或确定是否需要缩减区域内的应用的应用进程。在这种情况下,部署模块210中可以预先设置的扩充区域中应用的应用进程的触发条件,或是缩减区域中应用的应用进程的触发条件。部署模块210根据汇总后的状态信息确定是否满足预先设置的扩充区域中应用的应用进程的触发条件,或确定是否满足预先设置的缩减区域中应用的应用进程的触发条件。If the regional elasticity policy indicates that elastic scaling of resources in the region is allowed, but does not indicate the triggering conditions for expanding or reducing the application processes applied in the region as described in the regional elasticity policy, the deployment module 210 can determine whether expansion is needed based on the summarized status information. Application processes for applications in a zone, or to determine whether application processes for applications within a zone need to be scaled down. In this case, the deployment module 210 may preset the triggering conditions for the application process of the application in the expansion area, or the triggering conditions of the application process of the application in the reduction area. The deployment module 210 determines whether a preset triggering condition for an application process applied in an expansion area is met based on the aggregated status information, or whether a preset triggering condition for an application process applied in a reduction area is met.
若当前该区域内应用的应用进程的状态满足扩充区域中应用的应用进程的触发条件,则执行步骤603~604。 If the status of the application process currently applied in the area meets the triggering condition of the application process applied in the extended area, steps 603 to 604 are executed.
若当前该区域内应用的应用进程的状态满足缩减区域中应用的应用进程的触发条件,则执行步骤605~606。If the status of the application process currently applied in the area meets the triggering condition for reducing the application process applied in the area, steps 605 to 606 are executed.
若当前该区域内应用的应用进程的状态既不满足扩充区域中应用的应用进程的触发条件,也不满足缩减区域中应用的应用进程的触发条件,则无需执行后续步骤,继续获取应用的应用进程所上报的状态信息,也即执行步骤601。If the status of the application process currently applied in the area neither satisfies the triggering conditions for the application process applied in the expansion area nor the triggering conditions for the application process applied in the reduction area, there is no need to perform subsequent steps and continue to obtain the application process of the application. The status information reported by the process is executed in step 601.
需要说明的是,若区域弹性策略指示不允许实现区域内的资源弹性伸缩,部署模块210无需执行步骤602~步骤606。It should be noted that if the regional elasticity policy indicates that elastic scaling of resources within the region is not allowed, the deployment module 210 does not need to perform steps 602 to 606.
步骤603:在当前该区域内应用的应用进程的状态满足扩充区域中应用的应用进程的触发条件的情况下,部署模块210确定需要扩充的应用的应用进程的数量。Step 603: If the status of the application process currently applied in the area meets the triggering condition for expanding the application process applied in the area, the deployment module 210 determines the number of application processes of the application that needs to be expanded.
若区域弹性策略中描述了区域内应用的应用进程的空闲比阈值,若当前该区域内应用的应用进程的空闲比低于区域弹性策略所要求的空闲比阈值,说明当前该区域内较多的应用的应用进程处于忙碌状态,应当适当增加应用的应用进程的数量,以应对可能发生的会话数量激增的情况。部署模块210可以按照区域弹性策略所要求的空闲比确定需要扩充的应用的应用进程的数量,保证扩充后的应用的应用进程的空闲比能够满足区域弹性策略所要求的空闲比阈值。If the regional elastic policy describes the idle ratio threshold of the application process applied in the region, if the current idle ratio of the application process applied in the region is lower than the idle ratio threshold required by the regional elastic policy, it means that there are currently more idle ratios in the region. The application process of the application is in a busy state, and the number of application processes of the application should be appropriately increased to cope with the possible surge in the number of sessions. The deployment module 210 may determine the number of application processes of the application that needs to be expanded according to the idle ratio required by the regional elasticity policy, and ensure that the idle ratio of the application processes of the expanded application can meet the idle ratio threshold required by the regional elasticity policy.
例如,区域弹性策略中描述区域内应用的应用进程的空闲比阈值为4:10,当前该区域内部署了28个应用的应用进程,其中,25个应用的应用进程处于忙碌状态,当前该区域内的应用的应用进程的空闲比为3:28。部署模块210可以增加应用的应用进程的数量,以保证区域内应用的应用进程的空闲比能够满足4:10,如部署模块210可以确定增加14个应用的应用进程,这样该区域内的应用的应用进程的空闲比将接近于4:10。For example, the regional elasticity policy describes that the idle ratio threshold of application processes in the region is 4:10. There are currently 28 application application processes deployed in the region. Among them, 25 application application processes are in a busy state. Currently, the region The idle ratio of application processes within the application is 3:28. The deployment module 210 can increase the number of application application processes to ensure that the idle ratio of the application processes in the area can meet 4:10. For example, the deployment module 210 can determine to add 14 application application processes, so that the idle ratio of the application processes in the area can be satisfied. The idle ratio of the application process will be close to 4:10.
需要说明的是,由于应用的应用进程的数量设置以及应用的应用进程的状态总是会变动,导致该区域内的应用的应用进程的空闲比并不一定能够严格的等于区域弹性策略所要求的空闲比。故而在实际应用中,允许该区域内的应用的应用进程的空闲比与区域弹性策略所要求的空闲比之间存在一定差值。It should be noted that because the number of application processes and the status of the application processes are always changing, the idle ratio of the application processes in the area may not be strictly equal to what is required by the regional elasticity policy. Idle ratio. Therefore, in actual applications, there is a certain difference between the idle ratio of the application process of the application in the area and the idle ratio required by the area elasticity policy.
若区域弹性策略未描述区域内应用的应用进程的空闲比阈值,在这种情况下,部署模块210中可以预先设置区域内应用的应用进程的空闲比阈值,部署模块210可以按照预先设置的空闲比确定区域内扩充的应用的应用进程的数量。If the regional elasticity policy does not describe the idle ratio threshold of the application process applied in the region, in this case, the deployment module 210 can preset the idle ratio threshold of the application process applied in the region, and the deployment module 210 can adjust the idle ratio according to the preset idle ratio. Ratio determines the number of application processes that scale the application within the region.
需要说明的是,上述确定需要扩充应用的应用进程的数量的方式仅是举例,本申请实施例并不限定区域内的部署模块210确定需要扩充应用的应用进程的数量的方式。It should be noted that the above-mentioned method of determining the number of application processes that need to be expanded is only an example, and the embodiment of the present application does not limit the method in which the deployment module 210 in the area determines the number of application processes that need to be expanded.
步骤604:部署模块210指示计算实例创建指定数量的应用的应用进程。该指定数量为步骤603中所确定的数量。Step 604: The deployment module 210 instructs the computing instance to create a specified number of application processes of the application. The specified quantity is the quantity determined in step 603.
该区域内,一个计算实例上能够运行的应用的应用进程的数量是有限的,也即该计算实例上物理资源的使用率存在一定的限制。若计算实例上运行较多的应用的应用进程,在这些应用的应用进程均处于忙碌状态的情况下,容易对计算实例的虚拟资源进行抢占,这样会降低应用的应用进程本身的执行效率。故而,需要扩充的应用的应用进程可以分布在多个计算实例上。在这种情况下,部署模块210需要将计算实例上运行的应用的应用进程的数量上报至应用部署装置100(也即进程管理模块120),以使得该应用部署装置100能够及时获知该应用的应用进程的分布情况。In this area, the number of application processes that can run on a computing instance is limited, that is, there is a certain limit on the usage of physical resources on the computing instance. If there are many application processes running on a computing instance, and the application processes of these applications are all busy, it is easy to preempt the virtual resources of the computing instance, which will reduce the execution efficiency of the application process itself. Therefore, application processes for applications that require scaling can be distributed across multiple computing instances. In this case, the deployment module 210 needs to report the number of application processes of the application running on the computing instance to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can promptly learn the number of application processes. The distribution of application processes.
若当前已创建的计算实例无法承担需要扩充的应用的应用进程,如已创建的计算实例上物理资源的使用率大于或等于使用率阈值,部署模块210也可以创建新的计算实例,以 在该新的计算实例上扩充应用的应用进程。在这种情况下,部署模块210需要将新创建的计算实例的数量以及规格上报至应用部署装置100(也即进程管理模块120),以使得该应用部署装置100能够及时获知该应用的部署状态,也即明确该应该部署的区域以及每个区域内部署该应用所需的计算实例。If the currently created computing instance cannot bear the application process of the application that needs to be expanded, if the usage of physical resources on the created computing instance is greater than or equal to the usage threshold, the deployment module 210 can also create a new computing instance to Expand the application's application process on this new compute instance. In this case, the deployment module 210 needs to report the number and specifications of the newly created computing instances to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can learn the deployment status of the application in a timely manner. , that is, clarify the regions that should be deployed and the computing instances required to deploy the application in each region.
步骤605:在当前该区域内应用的应用进程的状态满足缩减区域中应用的应用进程的触发条件的情况下,部署模块210确定需要缩减的应用的应用进程的数量。Step 605: If the status of the application process currently applied in the area meets the triggering condition for reducing the application process applied in the area, the deployment module 210 determines the number of application processes of the application that needs to be reduced.
若区域弹性策略描述了区域内应用的应用进程的空闲比阈值,若当前该区域内应用的应用进程的空闲比大于区域弹性策略所要求的空闲比阈值,说明当前该区域内较多的应用的应用进程处于空闲状态,应当适当减少应用的应用进程的数量,以避免资源浪费。部署模块210可以按照区域弹性策略所要求的空闲比确定需要缩减的应用的应用进程的数量,保证缩减后的应用的应用进程的空闲比能够满足区域弹性策略所要求的空闲比阈值。If the regional elastic policy describes the idle ratio threshold of the application process applied in the region, if the idle ratio of the application process currently applied in the region is greater than the idle ratio threshold required by the regional elastic policy, it means that there are currently more applications in the region. If the application process is idle, the number of application processes should be appropriately reduced to avoid wasting resources. The deployment module 210 may determine the number of application processes of the application that needs to be reduced according to the idle ratio required by the regional elasticity policy, and ensure that the idle ratio of the application processes of the reduced application can meet the idle ratio threshold required by the regional elasticity policy.
例如,区域弹性策略中描述区域内应用的应用进程的空闲比阈值为4:10,当前该区域内部署了28个应用的应用进程,其中,10个应用的应用进程处于忙碌状态,当前该区域内的应用的应用进程的空闲比为18:28。部署模块210可以减少应用的应用进程的数量,以保证区域内应用的应用进程的空闲比能够满足4:10,如部署模块210可以确定缩减11个应用的应用进程,这样该区域内的应用的应用进程的空闲比将接近于4:10。For example, the regional elasticity policy describes that the idle ratio threshold of application processes in the region is 4:10. There are currently 28 application application processes deployed in the region. Among them, 10 application application processes are in a busy state. Currently, the region The idle ratio of the application process within the application is 18:28. The deployment module 210 can reduce the number of application processes of the application to ensure that the idle ratio of the application processes in the area can meet 4:10. For example, the deployment module 210 can determine to reduce the application processes of 11 applications, so that the idle ratio of the application processes in the area can be reduced. The idle ratio of the application process will be close to 4:10.
需要说明的是,由于应用的应用进程的数量设置以及应用的应用进程的状态总是会变动,导致该区域内的应用的应用进程的空闲比并不一定能够严格的等于区域弹性策略所要求的空闲比。故而在实际应用中,允许该区域内的应用的应用进程的空闲比与区域弹性策略所要求的空闲比之间存在一定差值。It should be noted that because the number of application processes and the status of the application processes are always changing, the idle ratio of the application processes in the area may not be strictly equal to what is required by the regional elasticity policy. Idle ratio. Therefore, in actual applications, there is a certain difference between the idle ratio of the application process of the application in the area and the idle ratio required by the area elasticity policy.
若区域弹性策略未描述区域内应用的应用进程的空闲比阈值,在这种情况下,部署模块210中可以预先设置区域内应用的应用进程的空闲比阈值,部署模块210可以按照预先设置的空闲比确定区域内缩减的应用的应用进程的数量。If the regional elasticity policy does not describe the idle ratio threshold of the application process applied in the region, in this case, the deployment module 210 can preset the idle ratio threshold of the application process applied in the region, and the deployment module 210 can adjust the idle ratio according to the preset idle ratio. The number of application processes than the reduced application within the determined area.
需要说明的是,上述确定需要缩减应用的应用进程的数量的方式仅是举例,本申请实施例并不限定区域内的部署模块210确定需要缩减应用的应用进程的数量的方式。It should be noted that the above-mentioned method of determining the number of application processes that need to be reduced is only an example, and the embodiment of the present application does not limit the method in which the deployment module 210 in the area determines the number of application processes that need to be reduced.
步骤606:部署模块210指示计算实例注销指定数量的应用的应用进程。这里的指定数量为步骤605中所确定的数量。Step 606: The deployment module 210 instructs the computing instance to log off the application processes of the specified number of applications. The specified quantity here is the quantity determined in step 605.
部署模块210可以优先注销处于空闲状态的应用的应用进程。在这种情况下,部署模块210需要将计算实例上运行的应用的应用进程的数量上报至应用部署装置100(也即进程管理模块120),以使得该应用部署装置100能够及时获知该应用的应用进程的分布情况。The deployment module 210 may prioritize logging off application processes of applications that are in an idle state. In this case, the deployment module 210 needs to report the number of application processes of the application running on the computing instance to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can promptly learn the number of application processes. The distribution of application processes.
若该区域内的计算实例中其上运行的应用的应用进程均处于空闲的计算实例,部署模块210可以优先注销该计算实例上的所有应用的应用进程,并删除该计算实例。在这种情况下,部署模块210需要将删除的计算实例的数量以及规格上报至应用部署装置100(也即进程管理模块120),以使得该应用部署装置100能够及时获知该应用的部署状态,也即明确该应该部署的区域以及每个区域内部署该应用所需的计算实例。If the application processes of the applications running on the computing instances in the area are all idle computing instances, the deployment module 210 may first log off the application processes of all applications on the computing instance and delete the computing instance. In this case, the deployment module 210 needs to report the number and specifications of the deleted computing instances to the application deployment device 100 (that is, the process management module 120), so that the application deployment device 100 can learn the deployment status of the application in a timely manner. That is, clarify the regions where it should be deployed and the computing instances required to deploy the application in each region.
在本申请实施例中,在应用完成各个区域内的部署后,允许应用的访问用户变更部署策略。若应用的访问用户变更了部署策略,应用部署装置100可以调整该应用的部署状态。In this embodiment of the present application, after the application completes deployment in each area, users accessing the application are allowed to change the deployment policy. If the access user of the application changes the deployment policy, the application deployment device 100 can adjust the deployment status of the application.
调整应用的部署状态包括但不限于:增加新的区域、删除已有的区域、变更已有区域内部署应用所需的计算实例。Adjusting the deployment status of an application includes but is not limited to: adding new regions, deleting existing regions, and changing the computing instances required to deploy applications in existing regions.
下面结合附图以租户变更应用配置策略调整应用的部署的方式进行说明,参见图7, 该方法包括:The following is an explanation of how tenants change application configuration policies and adjust application deployment with reference to the attached figure. See Figure 7. The method includes:
步骤701:进程管理模块120获取租户变更后的应用部署策略。Step 701: The process management module 120 obtains the changed application deployment policy of the tenant.
进程管理模块120通过客户端向租户提供变更部署策略的接口,租户可以通过该接口变更部署策略中的部分或全部内容。The process management module 120 provides an interface for changing the deployment policy to the tenant through the client, and the tenant can change part or all of the content in the deployment policy through the interface.
如图8所示,为本申请实施例提供的一种界面示意图,进程管理模块120可以通过部署租户侧的计算设备向租户提供变更部署策略的接口。图8为该接口面向租户的显示界面,图8仅是一种示例性的界面。在该界面中,租户可以变更应用部署策略、会话管理策略以及区域弹性策略中的部分或全部。As shown in FIG. 8 , which is a schematic interface diagram provided by an embodiment of the present application, the process management module 120 can provide the tenant with an interface for changing the deployment policy by deploying the computing device on the tenant side. Figure 8 is a display interface of this interface facing tenants. Figure 8 is only an exemplary interface. In this interface, tenants can change some or all of the application deployment policy, session management policy, and regional elasticity policy.
在图8所示的界面中,租户可以重新设置部署成本范围、区域的选择范围。还可以重新设置会话的时延范围。租户还可以重新选择是否允许实现区域内资源弹性伸缩的选项,在选择允许实现区域内资源弹性伸缩的选项的情况下,租户可以选择或输入空闲比。In the interface shown in Figure 8, tenants can reset the deployment cost range and region selection range. You can also reset the session delay range. Tenants can also re-select whether to allow elastic scaling of resources within a region. If the option to allow elastic scaling of resources within a region is selected, tenants can select or enter the idle ratio.
在图8所示的界面中,租户可以点击“提交”的按键,租户可以将变更后的部署策略提供给进程管理模块120。In the interface shown in FIG. 8 , the tenant can click the “Submit” button, and the tenant can provide the changed deployment policy to the process management module 120 .
步骤702:进程管理模块120确定当前应用的部署状态,该部署状态包括但不限于应该所部署的区域、每个区域内部署该应用所占用的计算实例、以及每个计算实例上运行的应用的应用进程。Step 702: The process management module 120 determines the deployment status of the current application. The deployment status includes but is not limited to the region where it should be deployed, the computing instances occupied by the deployment of the application in each region, and the number of applications running on each computing instance. application process.
步骤703:进程管理模块120根据变更后的应用部署策略以及当前的应用的部署状态确定调整应用部署的方式,也即确定是否需要为该应用增加新的区域,或确定是否需要为应用删除已有的区域、或确定是否需要变更已有区域内部署应用所需的计算实例。Step 703: The process management module 120 determines how to adjust the application deployment according to the changed application deployment policy and the current application deployment status, that is, determines whether a new area needs to be added for the application, or whether it is necessary to delete existing areas for the application. region, or determine whether it is necessary to change the computing instances required for deploying applications in existing regions.
若变更后的应用部署策略所约束的部署成本低于变更前的应用部署策略所约束的部署成本,进程管理模块120可以为该应用删除一些费用较高的区域,或适当变更已有区域内部署应用所需的计算实例,如减少计算实例的数量。若变更后的应用部署策略所约束的部署成本高于变更前的应用部署策略所约束的部署成本,进程管理模块120可以为该应用增加新的区域,或适当变更已有区域内部署应用所需的计算实例,如增加计算实例的数量。If the deployment cost constrained by the changed application deployment policy is lower than the deployment cost constrained by the pre-changed application deployment policy, the process management module 120 can delete some more expensive areas for the application, or appropriately change the deployment in the existing area. Compute instances required by the application, such as reducing the number of compute instances. If the deployment cost constrained by the changed application deployment policy is higher than the deployment cost constrained by the pre-changed application deployment policy, the process management module 120 can add a new area for the application, or appropriately change the requirements for deploying the application in the existing area. Compute instances, such as increasing the number of compute instances.
若变更后的应用部署策略指示区域不允许部署的第一目标区域,且当前应用部署的区域中包括该第一目标区域,进程管理模块120可以删除该第一目标区域。若变更后的应用部署策略指示区域允许部署的第二目标区域,在时延以及部署成本允许的情况下,进程管理模块120可以为该应用增加该第二目标区域。If the changed application deployment policy indicates that the first target area for deployment is not allowed in the area, and the current application deployment area includes the first target area, the process management module 120 may delete the first target area. If the changed application deployment policy indicates that the area allows deployment in a second target area, the process management module 120 may add the second target area for the application if time delay and deployment cost permit.
应需理解的,在实际应用中,变更后的应用部署策略通常会在应用的部署成本范围以及区域的选择范围中的多个方面增加新的约束,进程管理模块120根据变更后的应用部署策略定调整应用部署的方式的情况也更加复杂。上述选择部署该应用的区域以及定区域内部署应用所需的计算实例的方式仅是示例性的说明,凡是能够通过变更后的应用部署策略确定区域的方式均适用于本申请实施例。It should be understood that in actual applications, the changed application deployment strategy will usually add new constraints in multiple aspects in the application deployment cost range and the region selection range. The process management module 120 will perform the modified application deployment strategy according to the changed application deployment strategy. Determining how to adjust application deployment is also more complex. The above-mentioned methods of selecting the area to deploy the application and the computing instances required to deploy the application in a certain area are only exemplary descriptions. Any method that can determine the area through the changed application deployment policy is applicable to the embodiments of this application.
与步骤403类似,进程管理模块120还可以从全域部署决策装置400获取区域选择策略,进程管理模块120根据变更后的应用部署策略、当前应用的部署状态以及区域选择策略确定调整应用部署的方式。由于区域选择策略能够提供各个区域的优先级,便于进程管理模块120快速的确定调整应用部署的方式,确定增加或删除哪些区域。Similar to step 403, the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400. The process management module 120 determines how to adjust the application deployment according to the changed application deployment policy, the deployment status of the current application, and the region selection policy. Since the area selection policy can provide the priority of each area, it is convenient for the process management module 120 to quickly determine how to adjust application deployment and determine which areas to add or delete.
步骤704:若进程管理模块120确定需要为应用增加新的区域,进程管理模块120可以根据变更后的应用部署策略、当前应用的部署状态确定新的区域内部署该应用所需的计算实例。可选的,进程管理模块120还可以确定计算实例上需要创建的应用的应用进程的 数量。Step 704: If the process management module 120 determines that a new area needs to be added for the application, the process management module 120 can determine the computing instances required to deploy the application in the new area based on the changed application deployment policy and the deployment status of the current application. Optionally, the process management module 120 can also determine the application process of the application that needs to be created on the computing instance. quantity.
可选的,进程管理模块120还可以从全域部署决策装置400获取区域选择策略,进程管理模块120可以根据变更后的应用部署策略、当前应用的部署状态以及区域选择策略为部署该应用选择新的区域。Optionally, the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400. The process management module 120 can select a new application for deployment based on the changed application deployment policy, the deployment status of the current application, and the region selection policy. area.
步骤705:进程管理模块120向新的区域内的部署模块210发送应用部署请求,该应用部署请求用于请求将应用部署在该区域内。该应用部署请求中携带该区域内部署该应用所需的计算实例的信息以及应用镜像。可选的,应用部署请求中还可以携带计算实例上需要创建的应用的应用进程的数量。Step 705: The process management module 120 sends an application deployment request to the deployment module 210 in the new area. The application deployment request is used to request to deploy the application in the area. The application deployment request carries information about the computing instances required to deploy the application in the region and the application image. Optionally, the application deployment request can also carry the number of application processes of the application that needs to be created on the computing instance.
新的区域内的部署模块210可以根据应用部署请求在该新的区域内部署该应用,部署模块210在该新的区域内部署该应用的方式与步骤405~步骤406类似,具体可以参见前述说明,此处不再赘述。The deployment module 210 in the new area can deploy the application in the new area according to the application deployment request. The deployment module 210 deploys the application in the new area in a manner similar to steps 405 to 406. For details, please refer to the foregoing description. , which will not be described again here.
步骤706:若进程管理模块120确定需要为应用删除已有的区域,进程管理模块120可以根据变更后的应用部署策略、当前应用的部署状态确定需要删除的区域。Step 706: If the process management module 120 determines that the existing area needs to be deleted for the application, the process management module 120 can determine the area that needs to be deleted based on the changed application deployment policy and the deployment status of the current application.
可选的,进程管理模块120还可以从全域部署决策装置400获取区域选择策略,进程管理模块120可以根据变更后的应用部署策略、当前应用的部署状态以及区域选择策略为部署该应用确定需要删除的区域。Optionally, the process management module 120 can also obtain the region selection policy from the global deployment decision-making device 400. The process management module 120 can determine that the application needs to be deleted based on the changed application deployment policy, the deployment status of the current application, and the region selection policy. Area.
步骤707:进程管理模块120向需要删除的区域内的部署模块210发送应用注销请求,该应用注销请求用于请求在该区域内注销该应用。Step 707: The process management module 120 sends an application logout request to the deployment module 210 in the area that needs to be deleted. The application logout request is used to request to log out the application in the area.
部署模块210在接收到应用注销请求后,可以停止该区域内的应用的应用进程,删除该应用的应用进程所在的计算实例。After receiving the application logout request, the deployment module 210 may stop the application process of the application in the area and delete the computing instance where the application process is located.
需要说明的是,若需要删除的区域内的应用的应用进程仍存在未处理的会话,该区域内的区域进程管理模块120可以在会话处理完成后,再停止该区域内的应用的应用进程,删除该应用的应用进程所在的计算实例。该区域内的区域会话管理模块220也可以将未处理的会话发送给会话管理模块130,请求该会话管理模块130重新为未处理的会话选择区域,该区域内的区域会话管理模块220将未处理的会话发送给会话管理模块130后,部署模块210可以停止该区域内的应用的应用进程,删除该应用的应用进程所在的计算实例。It should be noted that if the application process of the application in the area that needs to be deleted still has unprocessed sessions, the area process management module 120 in the area can stop the application process of the application in the area after the session processing is completed. Delete the computing instance where the application's application process is located. The regional session management module 220 in this area can also send the unprocessed session to the session management module 130 and request the session management module 130 to re-select an area for the unprocessed session. The regional session management module 220 in this area will not process the session. After the session is sent to the session management module 130, the deployment module 210 can stop the application process of the application in the area and delete the computing instance where the application process is located.
步骤708:若进程管理模块120确定需要变更已有区域内部署应用所需的计算实例,进程管理模块120根据变更后的应用部署策略、当前应用的部署状态确定已有区域内计算实例的变更方案。Step 708: If the process management module 120 determines that it is necessary to change the computing instances required for deploying applications in the existing area, the process management module 120 determines the change plan for the computing instances in the existing area based on the changed application deployment strategy and the deployment status of the current application. .
变更已有区域内部署应用所需的计算实例的情况有很多种,例如,变更计算实例的数量,又例如,变更计算实例的规格。又例如,同时变更计算实例的数量以及规格。There are many situations in which the computing instances required for deploying applications in an existing region are changed, such as changing the number of computing instances or changing the specifications of the computing instances. Another example is changing the number and specifications of computing instances at the same time.
计算实例的变更方案描述了变更计算实例的具体方法,如计算实例的变更方案可以记录变更计算实例的数量以及具体的数值,还可以记录计算实例变更前后的规格。The change plan of a computing instance describes the specific method of changing the computing instance. For example, the change plan of the computing instance can record the number of changed computing instances and the specific values, and can also record the specifications before and after the change of the computing instance.
步骤709:进程管理模块120向已有区域内的部署模块210发送应用变更请求,该应用变更请求用于请求在该区域内变更该计算实例,该应用变更请求中携带有计算实例的变更方案。Step 709: The process management module 120 sends an application change request to the deployment module 210 in the existing area. The application change request is used to request changes to the computing instance in the area. The application change request carries the change plan of the computing instance.
部署模块210在接收到应用变更请求后,根据计算实例的变更方案改变该区域内计算实例的数量或规格。After receiving the application change request, the deployment module 210 changes the number or specifications of the computing instances in the area according to the change plan of the computing instances.
图7所示的实施例中以租户变更了应用部署策略为了进行说明,若租户更新了会话处理策略,会话管理模块130在接收到更新后的会话处理策略,会话管理模块130可以根据 该更新后的会话处理策略为后续接收到的会话选择应用进程。若租户更新了区域弹性策略,如更新前的区域弹性策略允许实现区域内资源弹性伸缩,更新后的区域弹性策略不允许实现区域内资源弹性伸缩,进程管理模块120可以指示告知区域内的部署模块210不再实现区域内资源弹性伸缩。如更新前的区域弹性策略不允许实现区域内资源弹性伸缩,更新后的区域弹性策略允许实现区域内资源弹性伸缩,进程管理模块120可以将更新后的区域弹性策略告知区域内的部署模块210,以使得区域内的部署模块210可以执行如图4所示的实施例。In the embodiment shown in FIG. 7 , the tenant has changed the application deployment policy for explanation. If the tenant updates the session processing policy, the session management module 130 receives the updated session processing policy. The session management module 130 can This updated session handling policy selects the application process for subsequent received sessions. If the tenant updates the regional elasticity policy, for example, the regional elasticity policy before the update allows elastic expansion and contraction of resources in the region, but the regional elasticity policy after the update does not allow elastic expansion and contraction of resources in the region, the process management module 120 can instruct and notify the deployment module in the region. 210 no longer implements elastic scaling of resources within the region. If the regional elasticity policy before the update does not allow elastic scaling of resources within the region, and the regional elasticity policy after the update allows elastic scaling of resources within the region, the process management module 120 can inform the deployment module 210 in the region of the updated regional elasticity policy, So that the deployment module 210 in the area can execute the embodiment shown in FIG. 4 .
本申请还提供一种计算设备900。如图9所示,计算设备900包括:总线901、处理器902、存储器903和通信接口904。处理器902、存储器903和通信接口904之间通过总线901通信。计算设备900可以是服务器或终端设备。应理解,本申请不限定计算设备900中的处理器、存储器的个数。The present application also provides a computing device 900. As shown in Figure 9, computing device 900 includes: bus 901, processor 902, memory 903, and communication interface 904. The processor 902, the memory 903 and the communication interface 904 communicate through the bus 901. Computing device 900 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 900.
总线901可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线901可包括在计算设备900各个部件(例如,存储器903、处理器902、通信接口904)之间传送信息的通路。The bus 901 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one line is used in Figure 9, but it does not mean that there is only one bus or one type of bus. Bus 901 may include a path that carries information between various components of computing device 900 (eg, memory 903, processor 902, communications interface 904).
处理器902可以包括中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。The processor 902 may include a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP) or a digital signal processor (DSP). any one or more of them.
存储器903可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。处理器902还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)。Memory 903 may include volatile memory, such as random access memory (RAM). The processor 902 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid state drive (SSD). drive, SSD).
存储器903中存储有可执行的程序代码,处理器902执行该可执行的程序代码以分别实现前述安装包管理模块110、进程管理模块120、会话管理模块130的功能,从而实现应用部署方法。也即,存储器903上存有用于执行应用部署方法的指令。The memory 903 stores executable program code, and the processor 902 executes the executable program code to respectively implement the functions of the aforementioned installation package management module 110, process management module 120, and session management module 130, thereby implementing the application deployment method. That is, the memory 903 stores instructions for executing the application deployment method.
或者,存储器903中存储有可执行的代码,处理器902执行该可执行的代码以分别实现前述应用部署装置100的功能,从而实现应用部署方法。也即,存储器903上存有用于执行应用部署方法的指令。Alternatively, executable code is stored in the memory 903, and the processor 902 executes the executable code to implement the functions of the aforementioned application deployment device 100, thereby implementing the application deployment method. That is, the memory 903 stores instructions for executing the application deployment method.
通信接口904使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设备900与其他设备或通信网络之间的通信。The communication interface 904 uses transceiver modules such as, but not limited to, network interface cards and transceivers to implement communication between the computing device 900 and other devices or communication networks.
应需理解的是,尽管未示出,如图9所示的计算设备也可以用于实现区域应用部署装置的功能。该计算设备中的存储器903中存储有可执行的程序代码,处理器902执行该可执行的程序代码以分别实现前述部署模块210、区域会话管理模块220的功能,从而实现前述应用部署方法中区域应用部署装置200执行的操作。也即,存储器903上存有用于执行应用部署方法中区域应用部署装置200执行的指令。It should be understood that, although not shown, the computing device shown in Figure 9 can also be used to implement the functions of the regional application deployment device. The memory 903 in the computing device stores executable program code, and the processor 902 executes the executable program code to realize the functions of the aforementioned deployment module 210 and the regional session management module 220 respectively, thereby realizing the regional application deployment method. Operations performed by the application deployment device 200. That is, the memory 903 stores instructions for executing the regional application deployment device 200 in the application deployment method.
或者,存储器903中存储有可执行的代码,处理器902执行该可执行的代码以分别实现前述应用部署装置100的功能,从而实现应用部署方法区域应用部署装置200执行的操作。也即,存储器903上存有用于执行应用部署方法中区域应用部署装置200执行的指令。Alternatively, executable code is stored in the memory 903, and the processor 902 executes the executable code to respectively implement the functions of the aforementioned application deployment device 100, thereby realizing the operations performed by the application deployment device 200 in the application deployment method area. That is, the memory 903 stores instructions for executing the regional application deployment device 200 in the application deployment method.
通信接口904使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设 备900与其他设备或通信网络之间的通信。The communication interface 904 uses transceiver modules such as, but not limited to, network interface cards and transceivers to implement computing devices. Communication between device 900 and other devices or communication networks.
本申请实施例还提供了一种计算设备集群。该计算设备集群包括至少一台计算设备。该计算设备可以是服务器,例如是中心服务器、边缘服务器,或者是本地数据中心中的本地服务器。在一些实施例中,计算设备也可以是台式机、笔记本电脑或者智能手机等终端设备。An embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
如图10所示,所述计算设备集群包括至少一个计算设备900。计算设备集群中的一个或多个计算设备900中的存储器903中可以存有相同的用于执行应用部署方法的指令。As shown in FIG. 10 , the computing device cluster includes at least one computing device 900 . The same instructions for executing the application deployment method may be stored in the memory 903 of one or more computing devices 900 in the computing device cluster.
在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备900的存储器903中也可以分别存有用于执行应用部署方法的部分指令。换言之,一个或多个计算设备900的组合可以共同执行用于执行应用部署方法的指令。In some possible implementations, the memory 903 of one or more computing devices 900 in the computing device cluster may also store part of the instructions for executing the application deployment method. In other words, a combination of one or more computing devices 900 may collectively execute instructions for performing an application deployment method.
需要说明的是,计算设备集群中的不同的计算设备900中的存储器903可以存储不同的指令,分别用于执行应用部署装置100或区域应用部署装置200的部分功能。也即,不同的计算设备900中的存储器903存储的指令可以实现安装包管理模块110、进程管理模块120、会话管理模块130、部署模块210、区域会话管理模块220中的一个或多个模块的功能。It should be noted that the memories 903 in different computing devices 900 in the computing device cluster may store different instructions, respectively used to execute part of the functions of the application deployment device 100 or the regional application deployment device 200 . That is, the instructions stored in the memory 903 in different computing devices 900 can implement the installation of one or more modules in the package management module 110, the process management module 120, the session management module 130, the deployment module 210, and the regional session management module 220. Function.
在一些可能的实现方式中,计算设备集群中的一个或多个计算设备可以通过网络连接。其中,所述网络可以是广域网或局域网等等。In some possible implementations, one or more computing devices in a cluster of computing devices may be connected through a network. Wherein, the network may be a wide area network or a local area network, etc.
本申请实施例还提供了一种包含指令的计算机程序产品。所述计算机程序产品可以是包含指令的,能够运行在计算设备上或被储存在任何可用介质中的软件或程序产品。当所述计算机程序产品在至少一个计算设备上运行时,使得至少一个计算设备执行应用部署方法,或应用部署方法。An embodiment of the present application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions capable of running on a computing device or stored in any available medium. The computer program product, when executed on at least one computing device, causes at least one computing device to execute an application deployment method, or an application deployment method.
本申请实施例还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行应用部署方法,或指示计算设备执行应用部署方法。An embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that a computing device can store or a data storage device such as a data center that contains one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, tape), optical media (eg, DVD), or semiconductor media (eg, solid state drive), etc. The computer-readable storage medium includes instructions that instruct the computing device to perform an application deployment method, or instruct the computing device to perform an application deployment method.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的保护范围。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be used Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent substitutions are made to some of the technical features; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the protection scope of the technical solutions of the various embodiments of the present invention.

Claims (23)

  1. 一种应用部署方法,其特征在于,所述方法包括:An application deployment method, characterized in that the method includes:
    获取租户提供的应用的安装包和应用部署策略,所述应用的安装包包括所述应用的可执行文件,所述应用部署策略包括为所述应用部署区域的约束条件;Obtain the installation package and application deployment policy of the application provided by the tenant. The installation package of the application includes the executable file of the application. The application deployment policy includes constraints for the application deployment area;
    根据所述应用部署策略从多个所述区域中选择部署所述应用的区域,将所述安装包发送至一个或多个所述区域;Select a region to deploy the application from a plurality of the regions according to the application deployment policy, and send the installation package to one or more of the regions;
    在所述区域创建至少一个计算实例,在所述至少一个计算实例上运行所述安装包以创建所述应用的多个应用进程。At least one computing instance is created in the area, and the installation package is run on the at least one computing instance to create multiple application processes of the application.
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    获取所述租户提供的会话处理策略,所述会话处理策略包括为每个会话分配处理应用进程的约束条件;Obtain the session processing policy provided by the tenant, where the session processing policy includes constraints on assigning processing application processes to each session;
    接收所述应用的访问用户发送的会话;Receive sessions sent by access users of the application;
    根据所述会话处理策略从所述多个应用进程中选择目标应用进程,将所述会话分配至所述目标应用进程以处理所述会话。A target application process is selected from the plurality of application processes according to the session processing policy, and the session is assigned to the target application process to process the session.
  3. 如权利要求1所述的方法,其特征在于,所述应用部署策略包括所述至少一个计算实例的部署成本范围。The method of claim 1, wherein the application deployment policy includes a deployment cost range of the at least one computing instance.
  4. 如权利要求3所述的方法,其特征在于,所述应用部署策略包括所述至少一个计算实例所在区域的选择范围。The method of claim 3, wherein the application deployment policy includes a selection range of the area where the at least one computing instance is located.
  5. 如权利要求2所述的方法,其特征在于,所述会话处理策略包括所述目标应用进程处理所述会话的时延范围。The method of claim 2, wherein the session processing policy includes a delay range for the target application process to process the session.
  6. 如权利要求1~5任一项所述的方法,其特征在于,所述根据所述应用部署策略选择部署所述应用的区域,包括:The method according to any one of claims 1 to 5, wherein the selecting an area to deploy the application according to the application deployment policy includes:
    获取区域选择策略,所述区域选择策略是基于各个区域内物理资源的占用情况生成的,所述区域选择策略指示选择各个区域以新创建计算实例的优先级;Obtain a region selection policy, the region selection policy is generated based on the occupancy of physical resources in each region, and the region selection policy indicates the priority of selecting each region to create a new computing instance;
    根据所述应用部署策略和所述区域选择策略选择部署所述应用的区域。A region where the application is deployed is selected according to the application deployment policy and the region selection policy.
  7. 如权利要求2~6任一项所述的方法,其特征在于,所述根据所述会话处理策略从所述多个应用进程中为所述会话选择目标应用进程,包括:The method according to any one of claims 2 to 6, wherein selecting a target application process for the session from the plurality of application processes according to the session processing policy includes:
    获取会话分发策略,所述会话分发策略是基于所述应用的各个应用进程的工作状态生成的,所述会话分发策略指示选择各个应用进程以处理所述会话的优先级;Obtain a session distribution policy, the session distribution policy is generated based on the working status of each application process of the application, and the session distribution policy indicates the priority of selecting each application process to process the session;
    根据所述会话处理策略和所述会话分发策略为所述会话选择所述目标应用进程。The target application process is selected for the session according to the session processing policy and the session distribution policy.
  8. 如权利要求1~5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that the method further includes:
    获取所述租户提供的区域弹性策略,所述区域弹性策略指示是否允许在所述区域内执行应用进程的弹性伸缩;Obtain the regional elasticity policy provided by the tenant. The regional elasticity policy indicates whether to allow elastic scaling of the application process in the region;
    在所述区域内基于所述区域弹性策略调整所述应用的应用进程的数量。The number of application processes of the application is adjusted within the region based on the region elasticity policy.
  9. 如权利要求8所述的方法,其特征在于,所述区域弹性策略指示当所述区域内所述应用的应用进程的空闲比小于空闲阈值时,增加所述区域内所述应用的应用进程的数量,所述区域内所述应用的应用进程的空闲比等于所述区域内处于空闲状态的所述应用的应用进程的数量与所述区域内所述应用的总应用进程的数量的比值。The method of claim 8, wherein the region elasticity policy indicates that when the idle ratio of the application process of the application in the region is less than an idle threshold, increase the idle ratio of the application process of the application in the region. The idle ratio of application processes of the application in the area is equal to the ratio of the number of application processes of the application in an idle state in the area to the total number of application processes of the application in the area.
  10. 如权利要求6所述的方法,其特征在于,所述区域弹性策略指示当所述区域内所述 应用的应用进程的空闲比大于空闲阈值时,减少所述区域内所述应用的应用进程的数量,所述区域内所述应用的应用进程的空闲比等于所述区域内处于空闲状态的所述应用的应用进程的数量与所述区域内所述应用的总应用进程的数量的比值。The method of claim 6, wherein the regional resilience policy indicates that when the region within the region When the idle ratio of the application process of the application is greater than the idle threshold, the number of application processes of the application in the area is reduced, and the idle ratio of the application process of the application in the area is equal to the idle state of the application in the area. The ratio of the number of application processes of an application to the total number of application processes of the application in the region.
  11. 一种应用部署***,其特征在于,所述应用部署***包括应用部署装置以及区域应用部署装置;An application deployment system, characterized in that the application deployment system includes an application deployment device and a regional application deployment device;
    所述应用部署装置,用于获取租户提供的应用的安装包和应用部署策略,所述应用的安装包包括所述应用的可执行文件,所述应用部署策略指示了部署所述应用的约束条件,根据所述应用部署策略选择部署所述应用的区域,向所述区域应用部署装置发送应用部署请求,所述应用部署请求用于请求在所述区域内创建的计算实例、并运行所述安装包创建应用进程;The application deployment device is used to obtain the installation package and application deployment policy of the application provided by the tenant. The installation package of the application includes the executable file of the application. The application deployment policy indicates the constraints for deploying the application. , select an area to deploy the application according to the application deployment policy, and send an application deployment request to the area application deployment device, where the application deployment request is used to request a computing instance created in the area and run the installation Package creation application process;
    所述区域应用部署装置,用于根据所述应用部署请求在所述区域创建至少一个计算实例,在所述至少一个计算实例上运行所述安装包以创建所述应用的多个应用进程。The regional application deployment device is configured to create at least one computing instance in the region according to the application deployment request, and run the installation package on the at least one computing instance to create multiple application processes of the application.
  12. 如权利要求11所述的***,其特征在于,The system of claim 11, wherein:
    所述应用部署装置,还用于获取所述租户提供的会话处理策略,所述会话处理策略包括为每个会话分配处理应用进程的策略,接收所述应用的访问用户发送的会话,根据所述会话处理策略从所述多个应用进程中选择目标应用进程,指示所述区域应用部署装置由所述目标应用处理所述会话;The application deployment device is also configured to obtain the session processing policy provided by the tenant, the session processing policy includes a policy for assigning a processing application process to each session, receive the session sent by the access user of the application, and according to the The session processing policy selects a target application process from the plurality of application processes and instructs the regional application deployment device to process the session by the target application;
    所述区域应用部署装置,用于根据所述指示将所述会话分配至所述目标应用进程以处理所述会话。The regional application deployment device is configured to allocate the session to the target application process according to the instruction to process the session.
  13. 如权利要求11所述的***,其特征在于,所述应用部署策略包括所述至少一个计算实例的部署成本范围。The system of claim 11, wherein the application deployment policy includes a deployment cost range of the at least one computing instance.
  14. 如权利要求13所述的***,其特征在于,所述应用部署策略包括所述至少一个计算实例所在区域的选择范围。The system of claim 13, wherein the application deployment policy includes a selection range of the area where the at least one computing instance is located.
  15. 如权利要求12所述的***,其特征在于,所述会话处理策略包括所述目标应用进程处理所述会话的时延范围。The system of claim 12, wherein the session processing policy includes a delay range for the target application process to process the session.
  16. 如权利要求11~15任一项所述的***,其特征在于,所述应用部署装置根据所述应用部署策略选择部署所述应用的区域,用于:The system according to any one of claims 11 to 15, wherein the application deployment device selects an area to deploy the application according to the application deployment policy, for:
    获取区域选择策略,所述区域选择策略是基于各个区域内物理资源的占用情况生成的,所述区域选择策略指示选择各个区域以新创建计算实例的优先级;Obtain a region selection policy, the region selection policy is generated based on the occupancy of physical resources in each region, and the region selection policy indicates the priority of selecting each region to create a new computing instance;
    根据所述应用部署策略和所述区域选择策略选择部署所述应用的区域。A region where the application is deployed is selected according to the application deployment policy and the region selection policy.
  17. 如权利要求12~16任一项所述的***,其特征在于,所述应用部署装置根据所述会话处理策略从所述多个应用进程中为所述会话选择目标应用进程,用于:The system according to any one of claims 12 to 16, wherein the application deployment device selects a target application process for the session from the plurality of application processes according to the session processing policy, for:
    获取会话分发策略,所述会话分发策略是基于所述应用的各个应用进程的工作状态生成的,所述会话分发策略指示选择各个应用进程以处理所述会话的优先级;Obtain a session distribution policy, the session distribution policy is generated based on the working status of each application process of the application, and the session distribution policy indicates the priority of selecting each application process to process the session;
    根据所述会话处理策略和所述会话分发策略为所述会话选择所述目标应用进程。The target application process is selected for the session according to the session processing policy and the session distribution policy.
  18. 如权利要求11~15任一项所述的***,其特征在于,The system according to any one of claims 11 to 15, characterized in that:
    所述应用部署装置,还用于获取所述租户提供的区域弹性策略,所述区域弹性策略指示是否允许在所述区域内执行应用进程的弹性伸缩,向所述应用部署装置发送所述区域应用部署装置;The application deployment device is also configured to obtain the regional elasticity policy provided by the tenant, the regional elasticity policy indicates whether to allow elastic scaling of the application process in the region, and send the regional application to the application deployment device. deploy device;
    所述区域应用部署装置,用于在所述区域内基于所述区域弹性策略调整所述应用的应 用进程的数量。The regional application deployment device is configured to adjust the application of the application in the region based on the regional elasticity policy. The number of processes used.
  19. 如权利要求18所述的***,其特征在于,所述区域弹性策略指示当所述区域内所述应用的应用进程的空闲比小于空闲阈值时,增加所述区域内所述应用的应用进程的数量,所述区域内所述应用的应用进程的空闲比等于所述区域内处于空闲状态的所述应用的应用进程的数量与所述区域内所述应用的总应用进程的数量的比值。The system of claim 18, wherein the region elasticity policy indicates that when the idle ratio of the application process of the application in the region is less than an idle threshold, increase the idle ratio of the application process of the application in the region. The idle ratio of application processes of the application in the area is equal to the ratio of the number of application processes of the application in an idle state in the area to the total number of application processes of the application in the area.
  20. 如权利要求16所述的***,其特征在于,所述区域弹性策略指示当所述区域内所述应用的应用进程的空闲比大于空闲阈值时,减少所述区域内所述应用的应用进程的数量,所述区域内所述应用的应用进程的空闲比等于所述区域内处于空闲状态的所述应用的应用进程的数量与所述区域内所述应用的总应用进程的数量的比值。The system of claim 16, wherein the region elasticity policy indicates that when the idle ratio of the application process of the application in the region is greater than an idle threshold, reduce the idle ratio of the application process of the application in the region. The idle ratio of application processes of the application in the area is equal to the ratio of the number of application processes of the application in an idle state in the area to the total number of application processes of the application in the area.
  21. 一种计算设备集群,其特征在于,包括至少一个计算设备,每个计算设备包括处理器和存储器;A computing device cluster, characterized by including at least one computing device, each computing device including a processor and a memory;
    所述至少一个计算设备的处理器用于执行所述至少一个计算设备的存储器中存储的指令,以使得所述计算设备集群执行如权利要求1~10任一项所述的方法。The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 10.
  22. 一种包含指令的计算机程序产品,其特征在于,当所述指令被计算设备集群运行时,使得所述计算设备集群执行如权利要求的1~10任一项所述的方法。A computer program product containing instructions, characterized in that, when the instructions are executed by a computing device cluster, the computing device cluster causes the computing device cluster to execute the method according to any one of claims 1 to 10.
  23. 一种计算机可读存储介质,其特征在于,包括计算机程序指令,当所述计算机程序指令由计算设备集群执行时,所述计算设备集群执行如权利要求1~10任一项所述的方法。 A computer-readable storage medium, characterized in that it includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 10.
PCT/CN2023/081267 2022-07-30 2023-03-14 Application deployment method and system, and device WO2024027160A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210912556.2A CN117519958A (en) 2022-07-30 2022-07-30 Application deployment method, system and equipment
CN202210912556.2 2022-07-30

Publications (1)

Publication Number Publication Date
WO2024027160A1 true WO2024027160A1 (en) 2024-02-08

Family

ID=89748303

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/081267 WO2024027160A1 (en) 2022-07-30 2023-03-14 Application deployment method and system, and device

Country Status (2)

Country Link
CN (1) CN117519958A (en)
WO (1) WO2024027160A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190303212A1 (en) * 2018-03-30 2019-10-03 Cisco Technology, Inc. Method for managing application configuration state with cloud based application management techniques
CN111045790A (en) * 2019-12-13 2020-04-21 北京奇艺世纪科技有限公司 Virtual machine deployment method and device
CN112087312A (en) * 2019-06-15 2020-12-15 华为技术有限公司 Method, device and equipment for providing edge service
US20200404076A1 (en) * 2019-06-19 2020-12-24 Hewlett Packard Enterprise Development Lp Method for deploying an application workload on a cluster
CN112698847A (en) * 2020-12-31 2021-04-23 江苏视博云信息技术有限公司 Deployment method, device and system of cloud application
CN114710488A (en) * 2022-03-29 2022-07-05 浪潮云信息技术股份公司 Method, device, equipment and medium for realizing elastic expansion and contraction across available areas

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190303212A1 (en) * 2018-03-30 2019-10-03 Cisco Technology, Inc. Method for managing application configuration state with cloud based application management techniques
CN112087312A (en) * 2019-06-15 2020-12-15 华为技术有限公司 Method, device and equipment for providing edge service
US20200404076A1 (en) * 2019-06-19 2020-12-24 Hewlett Packard Enterprise Development Lp Method for deploying an application workload on a cluster
CN111045790A (en) * 2019-12-13 2020-04-21 北京奇艺世纪科技有限公司 Virtual machine deployment method and device
CN112698847A (en) * 2020-12-31 2021-04-23 江苏视博云信息技术有限公司 Deployment method, device and system of cloud application
CN114710488A (en) * 2022-03-29 2022-07-05 浪潮云信息技术股份公司 Method, device, equipment and medium for realizing elastic expansion and contraction across available areas

Also Published As

Publication number Publication date
CN117519958A (en) 2024-02-06

Similar Documents

Publication Publication Date Title
US11354169B2 (en) Adjusting variable limit on concurrent code executions
Taherizadeh et al. Dynamic multi-level auto-scaling rules for containerized applications
CN107209682B (en) Automatic management of resource adjustments
US10771533B2 (en) Adaptive communication control device
US11252220B2 (en) Distributed code execution involving a serverless computing infrastructure
US10684878B1 (en) Virtual machine management
US9547534B2 (en) Autoscaling applications in shared cloud resources
US8904005B2 (en) Indentifying service dependencies in a cloud deployment
US20180210752A1 (en) Accelerator virtualization method and apparatus, and centralized resource manager
EP2724244B1 (en) Native cloud computing via network segmentation
EP2228719A1 (en) Method of executing a virtual machine, computing system and computer program
WO2018006676A1 (en) Acceleration resource processing method and apparatus and network function virtualization system
US11563636B1 (en) Dynamic management of network policies between microservices within a service mesh
US20130318522A1 (en) Management of Virtual Desktop Infrastructure (VDI) Sessions Using Real-Time Network Conditions
CN109358967B (en) ME platform APP instantiation migration method and server
CN109729106A (en) Handle the method, system and computer program product of calculating task
US11782775B2 (en) Dynamic management of network policies between microservices within a service mesh
US11178252B1 (en) System and method for intelligent distribution of integration artifacts and runtime requests across geographic regions
WO2022100365A1 (en) Method, system, and device for managing artificial intelligence application task, and storage medium
US11461123B1 (en) Dynamic pre-copy and post-copy determination for live migration between cloud regions and edge locations
US10025640B2 (en) Balancing work of tasks at a sending node of a transaction server
WO2024027160A1 (en) Application deployment method and system, and device
US11573839B1 (en) Dynamic scheduling for live migration between cloud regions and edge locations
US10587529B1 (en) Dynamic selection of router groups to manage computing instances
CN115933985A (en) Distributed storage QoS control method and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23848875

Country of ref document: EP

Kind code of ref document: A1