WO2021143702A1 - 流量分配方法、设备、系统及存储介质 - Google Patents

流量分配方法、设备、系统及存储介质 Download PDF

Info

Publication number
WO2021143702A1
WO2021143702A1 PCT/CN2021/071376 CN2021071376W WO2021143702A1 WO 2021143702 A1 WO2021143702 A1 WO 2021143702A1 CN 2021071376 W CN2021071376 W CN 2021071376W WO 2021143702 A1 WO2021143702 A1 WO 2021143702A1
Authority
WO
WIPO (PCT)
Prior art keywords
container group
requests
component
storage queue
container
Prior art date
Application number
PCT/CN2021/071376
Other languages
English (en)
French (fr)
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 WO2021143702A1 publication Critical patent/WO2021143702A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Definitions

  • This application relates to the field of cloud computing technology, and in particular, to a traffic distribution method, device, system, and storage medium.
  • Serverless architecture can automatically implement back-end work related to virtual machines (VM) and containers, such as autonomous application load balancing, autonomous expansion, etc. Therefore, users do not need to care about how the back-end supports service operation, and Only need to realize the service itself, which can improve development efficiency.
  • VM virtual machines
  • containers such as autonomous application load balancing, autonomous expansion, etc. Therefore, users do not need to care about how the back-end supports service operation, and Only need to realize the service itself, which can improve development efficiency.
  • the method of distributing traffic in the process of autonomous expansion can easily lead to uneven traffic distribution, which leads to a waste of resources.
  • Various aspects of the present application provide a traffic distribution method, device, system, and storage medium, which are used to achieve balanced distribution of traffic, thereby helping to improve resource utilization.
  • An embodiment of the present application provides a data processing system, including: an activation component, a storage queue, a capacity expansion component, and a scheduling component;
  • the activation component is configured to receive a plurality of first requests, and store the plurality of first requests in the storage queue;
  • the expansion component is configured to expand the capacity of the container group in response to the multiple first requests, so as to expand the capacity of at least one first container group;
  • the scheduling component is configured to target that the number of first requests allocated to each first container group is not greater than the number of concurrent requests that it can handle, and allocate the multiple first requests in the storage queue to the At least one first container group.
  • An embodiment of the present application also provides a data processing system, including: an activation component, a storage queue, a capacity expansion component, a scheduling component, and a load balancing component;
  • the activation component is configured to receive a plurality of first requests and a second request during the expansion process of at least one first container group, and store the plurality of first requests and the second request in the storage queue ;
  • the at least one first container group is expanded by the expansion component in response to the multiple first requests;
  • the scheduling component is configured to allocate the multiple first requests in the storage queue to the at least one first container group during the expansion process of the at least one first container group;
  • the load balancing component is configured to balance the second request in the storage queue among the at least one first container group after the expansion of the at least one first container group is successful.
  • the embodiment of the present application also provides a traffic distribution method, including:
  • the multiple first requests in the storage queue are allocated to the at least one first container group.
  • the embodiment of the present application also provides a traffic distribution method, including:
  • the second request in the storage queue is balanced among the at least one first container group.
  • An embodiment of the present application also provides a computer device, including: a memory, a processor, and a communication component; wherein the memory is used to store a computer program;
  • the processor is coupled to the memory, and is configured to execute the computer program for:
  • the multiple first requests in the storage queue are allocated to the at least one first container group.
  • An embodiment of the present application also provides a computer device, including: a memory, a processor, and a communication component; wherein the memory is used to store a computer program;
  • the processor is coupled to the memory, and is configured to execute the computer program for:
  • the second request in the storage queue is balanced among the at least one first container group.
  • the embodiments of the present application also provide a computer-readable storage medium storing computer instructions.
  • the computer instructions When the computer instructions are executed by one or more processors, the one or more processors will cause the one or more processors to execute the steps in the above methods. .
  • the data processing system includes: an activation component, a storage queue, an expansion component, and a scheduling component; wherein the activation component can store multiple requests received in the storage queue; the expansion component can containerize multiple requests The group expands to obtain at least one container group; further, the scheduling component can target that the number of requests allocated to each container group is not greater than the number of concurrent requests that it can handle, and allocate multiple requests in the storage queue to at least one container Groups, so that each container group can be allocated the corresponding number of requests.
  • the serverless system provided in the embodiment of the application does not allocate requests that should be allocated to the container group that is successfully expanded later to the container group that is successfully expanded first, so that the flow balance between the container groups can be achieved, which helps to improve resource utilization. .
  • FIG. 1a is a schematic structural diagram of a data processing system provided by an embodiment of this application.
  • Figure 1b is a schematic structural diagram of another data processing system provided by an embodiment of the application.
  • FIG. 1c is a schematic structural diagram of another data processing system provided by an embodiment of this application.
  • FIG. 2a is a schematic flowchart of a flow distribution method provided by an embodiment of this application.
  • 2b is a schematic flowchart of another traffic distribution method provided by an embodiment of this application.
  • FIG. 3 is a schematic structural diagram of a computer device provided by an embodiment of this application.
  • a data processing system includes an activation component, a storage queue, a capacity expansion component, and a scheduling component.
  • the activation component can store multiple requests received in the storage queue;
  • the expansion component can expand the container group for multiple requests to obtain at least one container group;
  • the scheduling component can store the requests allocated to each container group The number is not greater than the number of concurrent requests that can be processed as the goal, and multiple requests in the storage queue are allocated to at least one container group, so that each container group can be allocated a corresponding number of requests.
  • the serverless system provided in the embodiment of the application does not allocate requests that should be allocated to the container group that is successfully expanded later to the container group that is successfully expanded first, so that the flow balance between the container groups can be achieved, which helps to improve resource utilization. .
  • the corresponding number of container groups can be expanded according to the received request.
  • the expansion process of the container group not only includes the creation process of the container group from scratch, but also includes the health check process after the creation of the container group, that is, the expansion process of the container group includes the container group being in a usable state. (ready state) process.
  • the successful expansion of the container group means that the container group reaches the ready state.
  • multiple container groups can be expanded in parallel, or multiple container groups can be expanded serially.
  • the expansion rate of each first container group will be different, which will result in the failure of simultaneous expansion of multiple first container groups.
  • requests that should be allocated to a container group successfully expanded later are often allocated to the container group successfully expanded first, resulting in waste of resources of the container group successfully expanded later.
  • the number of requests actually received exceeds the number of concurrent requests that it can handle, which may also cause delays or exceptions in the processing of some requests. For example, if the number of requests is 300, and the number of concurrent requests that can be processed by each container group is 100, the number of container groups that need to be expanded is 3. Furthermore, if two container groups are successfully expanded first, then 100 requests are allocated to the container group that is first successfully expanded.
  • the first two container groups that were successfully expanded are known to have processed some of the requests, they will also be allocated to the last container group.
  • the traffic is allocated to the two container groups that were successfully expanded first, and the number of requests allocated to the last successfully expanded container group is less than 100, or even no requests are allocated, which leads to waste of resources for the last successfully expanded container group.
  • FIG. 1a is a schematic structural diagram of a data processing system provided by an embodiment of this application.
  • the data processing system provided in this embodiment may also be referred to as a serverless system.
  • the data processing system includes: an activation component 11, a storage queue 12, an expansion component 13, and a scheduling component 14.
  • the activation component 11, the storage queue 12, the capacity expansion component 13, and the scheduling component 14 may be software modules, applications, services or a physical device with corresponding functions.
  • the activation component 11, the storage queue 12, the capacity expansion component 13, and the scheduling component 14 may be deployed on different physical machines, and may also be deployed in different containers or virtual machines (Virtual Machine, VM). Of course, these containers or virtual machines can be deployed on the same physical machine or on multiple different physical machines.
  • VM Virtual Machine
  • these containers or virtual machines can be deployed on the same physical machine or on multiple different physical machines.
  • these physical machines need to be in the same data processing system cluster.
  • the physical machine may be a single server device, a cloudized server array, or a VM running in a cloudized server array.
  • a physical machine can also refer to other computing devices with corresponding service capabilities, such as terminal devices (running service programs) such as computers and the like.
  • different physical machines may be wirelessly or wiredly connected.
  • network cables or communication optical fibers can be used to connect different physical machines.
  • different physical machines can be connected through mobile network communication.
  • the network standard of the mobile network can be 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G ( Any one of LTE), 4G+ (LTE+), 5G, WiMax, etc.
  • different physical machines may also communicate and connect via Bluetooth, WiFi, infrared, virtual private cloud (Virtual Private Cloud, VPC), or remote direct memory access (RDMA).
  • the activation component 11 can receive the request.
  • the request may be a network request, such as an http request and so on. But it is not limited to this.
  • the activation component 11 may receive the request when the number of instances of the container group in the background of the data processing system is 0.
  • the activation component 11 may also receive the request when the container groups in the background of the data processing system are all working at full capacity. Among them, the full load of the container group means that the requested data processed by the container group at the current moment reaches the number of concurrent requests that it can handle.
  • the request received by the activation component 11 when the number of instances of the container group in the background of the data processing system is 0 or the container group is working at full capacity is defined as the first request.
  • the number of the first request may be one or more. Multiple refers to two or more.
  • the data processing system is mainly described for the balanced distribution of multiple first requests.
  • the activation component 11 may also store the received multiple first requests in the storage queue 12.
  • the capacity expansion component 13 can expand the capacity of the container group in response to multiple first requests, and then expand the capacity of at least one container group.
  • the container group expanded at this stage is defined as the first container group.
  • the number of the first container group can be one or more, and its specific value is determined by the number of the first request.
  • the container group may be implemented as a Pod, where the Pod contains one or more containers.
  • the capacity expansion component 13 may determine the number of container groups M according to the number of multiple first requests and the number of concurrent requests that can be processed by each container group.
  • M is a positive integer, and its specific value is determined by the number of first requests and the number of concurrent requests that can be processed by each container group. Further, the capacity expansion component 13 can expand the capacity of the container group according to the number M of container groups to obtain M first container groups.
  • M is equal to the result of dividing the two; if the number of multiple first requests is not per container If the group can handle an integer multiple of the number of concurrent requests, the result of dividing the two can be rounded up as the value of M.
  • the expansion component 13 can expand the capacity of multiple first container groups in parallel, or expand the capacity of multiple first container groups in series (for example, the first container group 1, the first container group). Container group 2...The first container group M).
  • the scheduling component 14 can allocate the multiple first requests stored in the storage queue 12 to at least one first container group.
  • the number of first requests allocated to each first container group is not greater than (less than or equal to) the number of concurrent requests that it can handle. That is, the scheduling component 14 can target that the number of first requests allocated to each first container group is not greater than the number of concurrent requests it can handle, and allocate the multiple first requests stored in the storage queue 12 to at least one first container. Group.
  • the number of first requests allocated to each first container group may be the same or different, but all are less than or equal to the number of concurrent requests that can be processed by the first container group.
  • the number of concurrent requests that can be processed by each first container group may be the same or different, and in the embodiment of the present application, the number of concurrent requests that can be processed by each first container group is not limited , It can be set by the user, or by the developer of the data processing system, but it is not limited to this.
  • the scheduling component 14 can allocate the first request in real time during the expansion of the container group, that is, every time a first container group is successfully expanded, the call from the storage queue 12 will not be The first number of requests that is greater than the number of concurrent requests that can be processed by the first container group that has been successfully expanded, and the retrieved first request number is allocated to the first container group that has been successfully expanded. For example, assuming that the first container group successfully expanded is the first container group 2, and the number of concurrent requests that the first container group 2 can handle is S, where S is a positive integer, the scheduling component 14 can successfully expand the first container group. In the case of a container group 2, R (R ⁇ S, and R is a positive integer) first requests are retrieved from the storage queue 12, and these R first requests are allocated to the first container group 2.
  • the scheduling component 14 may also distribute the multiple first requests evenly among the at least one first container group after all of the at least one first container group is successfully expanded, and each first container group is allocated to the first request.
  • the total number of a request is less than or equal to the number of concurrent requests it can handle.
  • the data processing system provided by the embodiments of the application includes: an activation component, a storage queue, an expansion component, and a scheduling component; wherein the activation component can store multiple requests received in the storage queue; the expansion component can containerize multiple requests The group expands to obtain at least one container group; further, the scheduling component can target that the number of requests allocated to each container group is not greater than the number of concurrent requests that it can handle, and allocate multiple requests in the storage queue to at least one container Groups, so that each container group can be allocated the corresponding number of requests.
  • the data processing system provided in this embodiment does not allocate requests that should be allocated to a container group that is successfully expanded later to a container group that is successfully expanded first, thereby achieving flow balance between container groups and helping to improve resource utilization. It is especially helpful to improve the resource utilization of the container group after successful expansion.
  • the number of first container groups that need to be expanded is 3. Furthermore, suppose there are two container groups first. If the expansion is successful, the scheduling component 14 allocates 100 requests to the first container group that is successfully expanded first, and before the last first container group is successfully expanded, even if the first two first container groups that were successfully expanded are known to have processed some of the requests , The scheduling component 14 will not allocate the traffic that should be allocated to the last container group to the two container groups that have successfully expanded first. Instead, the scheduling component 14 will retrieve it from the storage queue 12 after the last container group is successfully expanded. The remaining 100 first requests, and these 100 requests are allocated to the last successfully expanded container group, which can achieve traffic balance between the container groups, which helps to improve resource utilization, especially to improve the success of subsequent expansion The resource utilization of the container group.
  • the scheduling component 14 can monitor the status of the currently expanded container group, and when the currently expanded container group is successfully expanded, retrieve a corresponding number of first requests from the storage queue 12, and transfer the corresponding number of The first request is allocated to the container group where the current container is successful.
  • the first container group whose capacity is currently successfully expanded is defined as the first target container group.
  • the corresponding number is less than or equal to the number of concurrent requests that can be processed by the first target container group.
  • the number of first requests that can be processed by each first container group can be set, and the number is defined as the set number.
  • the set number is less than or equal to the number of concurrent requests that can be processed by the first target container group.
  • the number of first requests received by the activation component 11 may not be an integer multiple of the set number, and for the last first container group that has successfully expanded its capacity, the first request allocated to it is less than the set number.
  • the scheduling component 14 can retrieve a set number of first requests from the storage queue 12.
  • the scheduling component 14 can retrieve the remaining first requests from the storage queue 12 and allocate the remaining first requests to the first target container group. Wherein, the number of remaining first requests is less than or equal to the set number.
  • the number of first requests received by the activation component 11 is an integer multiple of the set number, then the number of remaining first requests is equal to the set number; if the number of first requests received by the activation component 11 is If it is not an integral multiple of the set number, the remaining number of first requests is less than the set number.
  • the data processing system further includes: an access endpoint (endpoint) control component 15.
  • the access endpoint control component 15 can write the IP address of the first target container group into the access endpoint when the first target container group is successfully expanded.
  • the scheduling component 14 can detect whether an IP address is added to the access endpoint. If it is detected that an IP address is added to the access endpoint, it is determined that the first target container group is successfully expanded, and the newly added IP address is the first target container group. An IP address of the target container group. Further, the scheduling component 14 can allocate the corresponding number of first requests retrieved above to the first target container group corresponding to the newly added IP address.
  • the corresponding number is equal to the number of first requests remaining in the storage queue 12; if the first target container group is not The last successfully expanded container group among the M first container groups, the corresponding number is equal to the above-mentioned set number.
  • the activation component 11 can not only receive the request when the container group instance in the background of the data processing system is 0, but also can receive the request during the expansion process of the number of instances of the container group from 0-M.
  • the request received by the activation component 11 during the expansion process of the at least one first container group described above is defined as the second request.
  • the number of second requests can be one or more.
  • the activation component 11 may receive the second request during the expansion process of at least one first container group, and store the second request in the storage queue 12.
  • the data processing system provided in the embodiment of the present application will no longer perform container group expansion for the second request.
  • a new scheduling mechanism can be introduced for the scheduling of the second request, and the load balancing component 16 (Service) shown in FIG. 1b is used to perform traffic balancing.
  • the scheduling of the first request is defined as the first-level scheduling; and the scheduling of the second request is defined as the second-level scheduling.
  • the data processing system provided in this embodiment can enter the secondary scheduling mode after successfully expanding the at least one first container group.
  • the load balancing component 16 can successfully expand the capacity of the at least one first container group, and target that the requests currently processed by each first container group are not greater than the number of concurrent requests that can be processed, and store the data in the queue 12
  • the second request is evenly distributed among the at least one first container group.
  • the requests currently processed by the first container group may all be the first request; may also be part of the first request and part of the second request; or all of the requests may be the second request. Regardless of the request received at which stage the requests currently processed by each first container group are received, the total number of these requests is less than or equal to the number of concurrent requests that can be processed by the first container group.
  • the load balancing component 16 may obtain the number of requests currently processed by at least one first container group, and select from the at least one first container group that the number of requests currently processed has not reached the number of concurrent requests corresponding to each. 2. Target container group. Further, the load balancing component 16 retrieves N second requests from the storage queue 12 and allocates the N second requests to the second target container group; where N is less than or equal to the concurrent requests that can be processed by the second target container group The difference between the number and the number of requests currently processed by the second target container group.
  • the data processing system provided by the embodiments of the present application can not only receive at least one request that arrives before the expansion of the first container group and during the expansion process of the at least one first container group, but also can receive the request that arrives after the expansion of the at least one first container group successfully.
  • a request that arrives after at least one first container group is successfully expanded is defined as a third request.
  • the number of third requests can be one or more.
  • the load balancing component 16 may receive the request that arrives after the successful expansion of the at least one first container group. In this way, during the flow distribution, the two hops of the activation component 11 and the storage queue 12 can be reduced, thereby helping to improve the flow distribution and processing efficiency.
  • the load balancing component 16 may also receive the third request after successfully expanding the at least one first container group. Further, the load balancing component 16 can also determine whether the above-mentioned at least one first container group can handle the third request. If the judgment result is yes, the target is that the number of requests currently processed by each first container group is not greater than the number of concurrent requests that can be processed, and the third request is balanced among at least one first container group. Correspondingly, if the judgment result is no, the expansion component 13 is triggered to expand the container group. For ease of description and distinction, the container group expanded by the capacity expansion component 13 in response to the third request is defined as the second container group.
  • the load balancing component 16 can also determine whether the number of requests that can be processed by the at least one first container group currently is greater than or equal to the number of third requests. If the judgment result is yes, it is determined that at least one first container group can process the third request; if the judgment result is no, it is determined that at least one first container group cannot process the third request.
  • the expansion component 13 may expand the container group for the third request to obtain Q second container groups.
  • Q is a positive integer.
  • the expansion component 13 may determine the number of container groups Q according to the number of requests currently processed by at least one first container group, the number of concurrent requests that can be processed by each container group, and the number of third requests, and expand the capacity to Q The second container group. For example, suppose that the number of concurrent requests that can be processed by each container group is 100, the number of at least one first container group is 3, the total number of requests currently processed by these 3 first container groups is 200, and the third request The number of is 250.
  • the expansion component 13 can determine that there are 150 third requests that cannot be included in the 3 first container groups according to the number of requests that can be processed by the three first container groups as 100 and the number of third requests as 250. If the allocation is between, the container group needs to be expanded for these 150 third requests. Further, the capacity expansion component 13 can determine that two second container groups need to be expanded based on the 150 third requests and the number of concurrent requests that can be processed by each container group 100.
  • the load balancing component 15 can target that the number of requests currently processed by each first container group and each second container group is not greater than the number of concurrent requests that can be processed, and place the third request in at least one first container group.
  • Q second container groups are balanced.
  • balancing the third request between at least one first container group and Q second container groups refer to the above-mentioned load balancing component 15 to balance the second request among at least one first container group.
  • the related content of, I won’t repeat it here.
  • the data processing system provided by the embodiment of the present application may also provide a two-level traffic scheduling mode.
  • the two-level traffic scheduling mode will be exemplarily described below with reference to FIG. 1c.
  • Fig. 1c is a schematic structural diagram of another data processing system provided by an embodiment of the application. As shown in FIG. 1c, the system includes: an activation component 11, a storage queue 12, a scheduling component 14, and a load balancing component 16.
  • the data processing system provided in this embodiment can schedule requests received before the expansion of the container group, and can also schedule requests received during the expansion of the container group.
  • the scheduling of requests received before the container group is defined as the first-level traffic scheduling; and the scheduling of the requests received during the expansion of the container group is defined as the second-level traffic scheduling.
  • the activation component 11 may receive the request when the number of instances of the container group in the background of the data processing system is 0. Alternatively, in some embodiments, the activation component 11 may also receive the request when the container groups in the background of the data processing system are all working at full capacity. For ease of description and distinction, in the embodiment of the present application, the request received by the activation component 11 when the number of instances of the container group in the background of the data processing system is 0 or the container group is working at full capacity is defined as the first request. Among them, the scheduling of the first traffic request adopts the first-level traffic scheduling method. As shown in FIG. 1c, the activation component 11 can store the received multiple first requests to the storage queue 12.
  • the capacity expansion component 13 can expand the capacity of the container group in response to multiple first requests, and then expand the capacity of at least one first container group.
  • the capacity expansion component 13 determine the number of the first container group, reference may be made to the relevant content of the foregoing embodiment, which will not be repeated here.
  • the scheduling component 14 can allocate the multiple first requests stored in the storage queue 12 to at least one first container group. Among them, the scheduling component 14 can allocate the first request in real time during the expansion of the container group, that is, every time a first container group is successfully expanded, the first request will be retrieved from the storage queue 12, and the retrieved first request will be retrieved from the storage queue 12. The request is allocated to the first container group that is currently successfully expanded.
  • the activation component 11 may also receive a request during the expansion process of the at least one first container group.
  • the request received at this stage is defined as the second request.
  • the activation component 11 can also store the second request in the storage queue 12.
  • the data processing system provided in this embodiment will not expand the container group for the second request.
  • a new scheduling mechanism can be introduced for the scheduling of the second request, and the load balancing component (Service) 16 shown in FIG. 1c is used to balance the flow of the second request, that is, the second request is allocated using two-level traffic scheduling.
  • the load balancing component 16 can balance the second request in the storage queue 12 among the at least one first container group after successfully expanding the at least one first container group.
  • the data processing system provided in this embodiment adopts a two-level flow scheduling mechanism to perform flow balance on requests received before the expansion of the container group and requests received during the expansion of the container group, respectively.
  • the first-level traffic scheduling can allocate the request received before the container group expansion to the successfully expanded container group during the expansion of the container group, which realizes the flow balance during the dynamic expansion of the container group and helps to improve the resource utilization of the container group.
  • the second-level traffic scheduling can evenly distribute the requests received during the expansion of the container group among the container groups after the container group is fully expanded, which helps to further improve the resource utilization of the container group.
  • the scheduling component 14 can target that the number of first requests allocated to each first container group is not greater than the number of concurrent requests that can be processed, and store the data stored in the storage queue 12
  • the plurality of first requests are allocated to at least one first container group.
  • the number of first requests allocated to each first container group may be the same or different, but all are less than or equal to the number of concurrent requests that can be processed by the first container group.
  • the scheduling component 13 will not allocate the request that should be allocated to the container group that is successfully expanded later to the container group that is successfully expanded first, so that the flow balance between the container groups can be achieved, which helps to improve resource utilization, which is especially helpful. To improve the resource utilization of the container group that is successfully expanded after the expansion.
  • the number of concurrent requests that can be processed by each first container group may be the same or different, and in this embodiment of the application, the number of concurrent requests that can be processed by each first container group is not limited, and it can be autonomous by the user.
  • the setting can also be set by the developer of the data processing system, but it is not limited to this.
  • the load balancing component 16 can successfully expand the capacity of the at least one first container group, and target that the requests currently processed by each first container group are not greater than the number of concurrent requests that can be processed, and store The second request in the queue 12 is evenly distributed among the at least one first container group.
  • the requests currently processed by the first container group may all be the first request; may also be part of the first request and part of the second request; or all of the requests may be the second request. Regardless of the request received at which stage the request currently processed by each first container group is, the total number of these requests is less than or equal to the number of concurrent requests that can be processed by the first container group.
  • the expansion component 14 can calculate the number of container groups that need to be reduced according to the current number of container groups, the number of concurrent requests that can be processed by each container group, and the number of pending requests, and shrink the current container group. .
  • the data processing system can perform traffic scheduling on requests received during the expansion process of the container group, and can also perform traffic scheduling on the requests received during the expansion process of the container group.
  • the request received in the process of shrinking the container group is defined as the fourth request.
  • the load balancing component 16 can receive the fourth request, and target that the number of requests currently processed by each container group is not greater than the number of concurrent requests that it can handle, and place the fourth request in the current existing request. Balance between container groups.
  • the embodiment of the present application also provides a flow distribution method, which will be exemplified below with reference to the figure.
  • FIG. 2a is a schematic flowchart of a flow distribution method provided by an embodiment of the application. As shown in Figure 2a, the method includes:
  • the traffic distribution method provided in this embodiment is applicable to a data processing system, and the system can receive multiple first requests and store the received multiple first requests in a storage queue. Further, the container group can be expanded in response to multiple first requests, and then at least one container group can be expanded. In the embodiment of the present application, for ease of description and distinction, the container group expanded at this stage is defined as the first container group.
  • the number of the first container group may be one or more, and its specific value is determined by the number of the first request.
  • the container group may also be referred to as a Pod, where the Pod includes one or more containers.
  • first container groups can be expanded in parallel, or multiple first container groups can be expanded serially.
  • a plurality of first requests stored in the storage queue may be allocated to at least one first container group.
  • the number of first requests allocated to each first container group is not greater than (less than or equal to) the number of concurrent requests that it can handle.
  • the number of first requests allocated to each first container group may be the same or different, but all are less than or equal to the number of concurrent requests that can be processed by the first container group.
  • the number of concurrent requests that can be processed by each first container group may be the same or different, and in this embodiment of the application, the number of concurrent requests that can be processed by each first container group is not limited. It can be set by the user independently or by the developer of the data processing system, but it is not limited to this.
  • the received multiple requests can be stored in the storage queue; the container group expansion is performed on the multiple requests to obtain at least one container group; further, the number of requests allocated to each container group can be no more than The number of concurrent requests that can be processed is the target, and multiple requests in the storage queue are allocated to at least one container group, so that each container group can be allocated a corresponding number of requests.
  • the requests that should be allocated to the successfully expanded container group will not be allocated to the container group that has successfully expanded first, so that the traffic balance between the container groups can be realized, which helps to improve the resource utilization, especially to improve the subsequent expansion.
  • the resource utilization of the successfully expanded container group is performed on the multiple requests to obtain at least one container group; further, the number of requests allocated to each container group can be no more than The number of concurrent requests that can be processed is the target, and multiple requests in the storage queue are allocated to at least one container group, so that each container group can be allocated a corresponding number of requests.
  • an optional implementation manner of step 203 is: determining the number of container groups M according to the number of multiple first requests and the number of concurrent requests that can be processed by each container group; and proceeding according to the number of container groups M The container group is expanded, and M first container groups are obtained.
  • M is a positive integer, and its specific value is determined by the number of first requests and the number of concurrent requests that can be processed by each container group.
  • M is equal to the result of dividing the two; if the number of multiple first requests is not per container If the group can handle an integer multiple of the number of concurrent requests, the result of dividing the two can be rounded up as the value of M.
  • an optional implementation manner of step 204 is: monitor the status of the currently expanded container group; and when it is monitored that the first target container group is successfully expanded, the corresponding quantity is retrieved from the storage queue And assign a corresponding number of first requests to the first target container group; where the corresponding number is less than or equal to the number of concurrent requests that can be processed by the first target container group.
  • an optional implementation manner to retrieve a corresponding number of first requests from the storage queue is: if it is monitored that the first target container group is successfully expanded, the total number of the first container group successfully expanded is less than M , The set number of first requests is retrieved from the storage queue; where the set number is less than or equal to the number of concurrent requests that can be processed by the first target container group.
  • the total number of the first container group successfully expanded is equal to M, then the remaining first request is retrieved from the storage queue; The request is allocated to the first target container group; wherein the number of remaining first requests is less than or equal to the set number.
  • the IP address of the first target container group may also be written into the access endpoint.
  • an implementation manner for monitoring the status of the currently expanded container group is: monitoring whether an IP address is added to the access endpoint; and when the IP address is added to the access endpoint is monitored, it is determined that the first target container group is successfully expanded. ; Among them, the newly added IP address is the IP address of the first target container group.
  • an implementation manner for allocating the corresponding number of first requests to the first target container group is: allocating the corresponding number of first requests to the first target container group corresponding to the newly added IP address.
  • the data processing system provided in the embodiments of the present application may also receive the second request during the expansion process of the at least one first container group, and store the second request in the storage queue.
  • the second request in the storage queue is placed in at least one first container group.
  • an optional implementation manner for balancing the second request among the at least one first container group is: acquiring the number of requests currently processed by the at least one first container group; selecting from the at least one first container group The second target container group whose number of requests currently processed has not reached the number of concurrent requests; and N second requests are retrieved from the storage queue, and N second requests are allocated to the second target container group; where N It is less than or equal to the difference between the number of concurrent requests that can be processed by the second target container group and the number of requests currently processed by the second target container group.
  • a third request may be received; and it is judged whether at least one first container group can handle the third request; if the result of the judgment is yes, then each first container group The number of requests currently processed is not greater than the number of concurrent requests that can be processed as a goal, and the third request is balanced among at least one first container group.
  • the judgment result is no, determine the number of container groups Q according to the number of requests currently processed by at least one first container group, the number of concurrent requests that can be processed by each container group, and the number of third requests; Q second container group; where Q is a positive integer;
  • the number of requests currently processed by each first container group and each second container group is not greater than the number of concurrent requests that can be processed, and the third request can be placed in at least one first container group and the Qth number of requests. Balance between the two container groups.
  • an embodiment of the present application also provides a computer-readable storage medium storing computer instructions.
  • the computer instructions are executed by one or more processors, one or more processors are caused to execute the steps in the above-mentioned traffic distribution method. .
  • FIG. 2b is a schematic flowchart of another traffic distribution method provided by an embodiment of the application. As shown in Figure 2b, the method includes:
  • the requests received before the expansion of the container group can be scheduled, and the requests received during the expansion of the container group can also be scheduled.
  • the scheduling of the first request received before the container group is defined as the first-level traffic scheduling; and the scheduling of the second request received during the expansion of the container group is defined as the second-level traffic scheduling.
  • the first-level flow scheduling method is adopted for the scheduling of the first flow request.
  • the received multiple first requests may be stored in the storage queue.
  • the container group is expanded in response to the multiple first requests, and then at least one first container group is expanded.
  • the multiple first requests stored in the storage queue may be allocated to at least one first container group.
  • the first request can be allocated in real time during the expansion of the container group, that is, every time a first container group is successfully expanded, the first request is retrieved from the storage queue, and the retrieved first request is allocated to the current The first container group that was successfully expanded.
  • the request may also be received during the expansion process of the at least one first container group.
  • the request received at this stage is defined as the second request.
  • the second request can also be stored in the storage queue.
  • the data processing system provided in this embodiment will not expand the container group for the second request.
  • a new scheduling mechanism can be introduced for the scheduling of the second request, that is, the second request can be allocated by using two-level traffic scheduling.
  • the second request in the storage queue 12 may be evenly distributed among the at least one first container group.
  • a two-level flow scheduling mechanism is used to balance the flows of requests received before the expansion of the container group and requests received during the expansion of the container group.
  • the first-level traffic scheduling can allocate the request received before the container group expansion to the successfully expanded container group during the expansion of the container group, which realizes the flow balance during the dynamic expansion of the container group and helps to improve the resource utilization of the container group.
  • the second-level traffic scheduling can evenly distribute the requests received during the expansion of the container group among the container groups after the container group is fully expanded, which helps to further improve the resource utilization of the container group.
  • the number of first requests allocated to each first container group is not greater than the number of concurrent requests that can be processed as the goal, and the multiple first requests stored in the storage queue Assignment to at least one first container group is requested.
  • the number of first requests allocated to each first container group may be the same or different, but all are less than or equal to the number of concurrent requests that can be processed by the first container group. In this way, the requests that should be allocated to the successfully expanded container group will not be allocated to the container group that has successfully expanded first, so that the traffic balance between the container groups can be realized, which helps to improve the resource utilization, especially to improve the subsequent expansion.
  • the resource utilization of the successfully expanded container group is not greater than the number of concurrent requests that can be processed as the goal, and the multiple first requests stored in the storage queue Assignment to at least one first container group is requested.
  • the number of first requests allocated to each first container group may be the same or different, but all are less than or equal to the number of concurrent requests that can be processed by the first container group.
  • the number of concurrent requests that can be processed by each first container group may be the same or different, and in this embodiment of the application, the number of concurrent requests that can be processed by each first container group is not limited, and it can be autonomous by the user.
  • the setting can also be set by the developer of the data processing system, but it is not limited to this.
  • the current processing request of each first container group is not greater than the number of concurrent requests that can be processed as the goal, and the first container group in the storage queue
  • the second request is for a balanced distribution among at least one first container group.
  • the requests currently processed by the first container group may all be the first request; may also be part of the first request and part of the second request; or all of the requests may be the second request. Regardless of the request received at which stage the request currently processed by each first container group is, the total number of these requests is less than or equal to the number of concurrent requests that can be processed by the first container group.
  • an embodiment of the present application also provides a computer-readable storage medium storing computer instructions.
  • the computer instructions are executed by one or more processors, one or more processors are caused to execute the steps in the above-mentioned traffic distribution method. .
  • the execution subject of each step of the method provided in the foregoing embodiment may be the same device, or different devices may also be the execution subject of the method.
  • the execution subject of steps 202 and 203 may be device A; for another example, the execution subject of step 201 may be device A, and the execution subject of step 202 may be device B; and so on.
  • the embodiments of the present application also provide a computer-readable storage medium storing computer instructions, which, when the computer instructions are executed by one or more processors, cause the one or more processors to execute the steps in the foregoing method.
  • FIG. 3 is a schematic structural diagram of a computer device provided by an embodiment of this application. As shown in FIG. 3, the computer device includes: a memory 30a, a processor 30b, and a communication component 30c.
  • the memory 30a is used to store computer programs.
  • the processor 30b is coupled to the memory 30a, and is configured to execute the computer program for: receiving a plurality of first requests through the communication component 30c, and storing the plurality of first requests in a storage queue; For the multiple first requests, the container group is expanded to expand at least one first container group; and the goal is that the number of first requests allocated to each first container group is not greater than the number of concurrent requests that can be processed, Allocating a plurality of first requests in the storage queue to the at least one first container group.
  • the processor 30b when the processor 30b expands the container group for the plurality of first requests, it is specifically configured to: determine according to the number of the plurality of first requests and the number of concurrent requests that can be processed by each container group The number of container groups is M; and the container group is expanded according to the number of container groups M to obtain M first container groups.
  • M is a positive integer, and its specific value is determined by the number of first requests and the number of concurrent requests that can be processed by each container group.
  • the processor 30b when the processor 30b allocates the plurality of first requests in the storage queue to at least one first container group, it is specifically configured to: monitor the status of the currently expanded container group; and when it monitors the successful expansion When the first target container group is released, a corresponding number of first requests are retrieved from the storage queue, and the corresponding number of first requests are allocated to the first target container group; wherein, the corresponding number is less than or equal to the first target container group The number of concurrent requests that can be processed.
  • the processor 30b retrieves a corresponding number of first requests from the storage queue, it is specifically configured to: if it is detected that the first target container group is successfully expanded, the total number of the first container group successfully expanded is less than M, the set number of first requests is retrieved from the storage queue; where the set number is less than or equal to the number of concurrent requests that can be processed by the first target container group.
  • the processor 30b retrieves a corresponding number of first requests from the storage queue, it is specifically configured to: if it is detected that the first target container group is successfully expanded, the total number of the first container group successfully expanded is less than M, the set number of first requests is retrieved from the storage queue; where the set number is less than or equal to the number of concurrent requests that can be processed by the first target container group.
  • the processor 30b retrieves a corresponding number of first requests from the storage queue, it is specifically configured to: if it is detected that the first target container group is successfully expanded, the total number of the first container group successfully expanded is less than M, the set number of first
  • the processor 30b is further configured to: when the first target container group is successfully expanded, it may also write the IP address of the first target container group into the access endpoint.
  • the processor 30b monitors the status of the currently expanded container group it is specifically used to: monitor whether an IP address is added to the access endpoint; and when it detects that the IP address is added to the access endpoint, determine that the first expansion is successful.
  • Target container group where the newly added IP address is the IP address of the first target container group.
  • the processor 30b allocates the corresponding number of first requests to the first target container group, it is specifically configured to: allocate the corresponding number of first requests to the first target container group corresponding to the newly added IP address.
  • the processor 30b is further configured to: during the expansion process of the at least one first container group, receive the second request through the communication component 30c, and store the second request in the storage queue.
  • the processor 30b is further configured to: after successfully expanding the capacity of at least one first container group, target that the requests currently processed by each first container group are not greater than the number of concurrent requests that can be processed, and store the first container group in the queue.
  • the second request is for a balanced distribution among at least one first container group.
  • the processor 30b when the processor 30b balances the distribution of the second request among the at least one first container group, it is specifically configured to: obtain the number of requests currently processed by the at least one first container group; Select the second target container group whose number of requests currently processed has not reached the number of concurrent requests from the group; and retrieve N second requests from the storage queue, and assign the N second requests to the second target container group; Wherein, N is less than or equal to the difference between the number of concurrent requests that can be processed by the second target container group and the number of requests currently processed by the second target container group.
  • the processor 30b is further configured to: after successfully expanding the at least one first container group, receive the third request through the communication component 30c; and determine whether the at least one first container group can handle the third request ; If the judgment result is yes, the number of requests currently processed by each first container group is not greater than the number of concurrent requests that can be processed as the goal, and the third request is balanced among at least one first container group. Correspondingly, if the judgment result is no, determine the number of container groups Q according to the number of requests currently processed by at least one first container group, the number of concurrent requests that can be processed by each container group, and the number of third requests; Q second container group; where Q is a positive integer;
  • the processor 30b is further configured to: target that the number of requests currently processed by each first container group and each second container group is not greater than the number of concurrent requests that can be processed, and place the third request in at least one first container group. There is a balance between the container group and the Q second container group.
  • the processor 30b may also store the plurality of first requests received by the communication component 30c in the storage queue; for the plurality of first requests, expand the container group to expand the capacity of at least one first container group; During the expansion process of at least one first container group, the multiple first requests in the storage queue are allocated to the at least one first container group; and the second container group received by the communication component 30c during the expansion process of the at least one first container group The request is stored in the storage queue; and after the expansion of the at least one first container group is successful, the second request in the storage queue is balanced among the at least one first container group.
  • the processor 60b allocates the plurality of first requests in the storage queue to at least one first container group, it is specifically configured to: use that the number of first requests allocated to each first container group is not greater than the number of first requests allocated to each first container group.
  • the number of concurrent requests that can be processed is the target, and multiple first requests in the storage queue are allocated to at least one first container group.
  • the computer device may further include: a power supply assembly 30d.
  • some computer devices may also include optional components such as a display 30e and an audio component 30f. Only part of the components are shown schematically in FIG. 3, which does not mean that the computer device must include all the components shown in FIG. 3, nor does it mean that the computer device can only include the components shown in FIG.
  • the memory is used to store computer programs, and can be configured to store other various data to support operations on the computer device.
  • the processor can execute the computer program stored in the memory to realize the corresponding control logic.
  • the memory can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable and programmable Read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable and programmable Read only memory
  • PROM programmable read only memory
  • ROM read only memory
  • magnetic memory flash memory
  • flash memory magnetic disk or optical disk.
  • the processor may be any hardware processing device that can execute the foregoing method logic.
  • the processor may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), or a Microcontroller Unit (MCU); it may also be a Field Programmable Gate Array (Field Programmable Gate Array).
  • FPGA Central Processing Unit
  • PAL Programmable Array Logic
  • GAL General Array Logic
  • CPLD Complex Programmable Logic Device
  • RISC Advanced Reduced Instruction Set
  • RISC Advanced RISC Machines
  • SOC System on Chip
  • the communication component is configured to facilitate wired or wireless communication between the computer device and other devices.
  • Computer equipment can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G, 5G or a combination of them.
  • the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component may also be based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology Or other technologies to achieve.
  • NFC near field communication
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the display may include a liquid crystal display (LCD) and a touch panel (TP). If the display includes a touch panel, the display may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the power supply component is configured to provide power to various components of the computer device.
  • the power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.
  • the audio component may be configured to output and/or input audio signals.
  • the audio component includes a microphone (MIC).
  • MIC microphone
  • the microphone is configured to receive external audio signals.
  • the received audio signal can be further stored in a memory or sent via a communication component.
  • the audio component further includes a speaker for outputting audio signals. For example, for a computer device with language interaction function, voice interaction with the user can be realized through audio components.
  • the computer device provided in this embodiment can store multiple requests received in the storage queue; expand the container group for multiple requests to obtain at least one container group; further, the number of requests allocated to each container group can be obtained
  • the target is not more than the number of concurrent requests that can be processed, and multiple requests in the storage queue are allocated to at least one container group, so that each container group can be allocated a corresponding number of requests.
  • the requests that should be allocated to the successfully expanded container group will not be allocated to the container group that has successfully expanded first, so that the traffic balance between the container groups can be realized, which helps to improve the resource utilization, especially to improve the subsequent expansion.
  • the resource utilization of the successfully expanded container group is not be allocated to the container group that has successfully expanded first, so that the traffic balance between the container groups can be realized, which helps to improve the resource utilization, especially to improve the subsequent expansion.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM).
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请实施例提供一种流量分配方法、设备、系统及存储介质。在本申请实施例中,数据处理系统包括:激活组件、存储队列、扩容组件和调度组件。其中,激活组件可将接收到的多个请求存储至存储队列;扩容组件可针对多个请求进行容器组扩容,得到至少一个容器组;进一步,调度组件便可以每个容器组分配到的请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个请求分配给至少一个容器组。这样,数据处理系统不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率。

Description

流量分配方法、设备、系统及存储介质
本申请要求2020年01月14日递交的申请号为202010038309.5、发明名称为“流量分配方法、设备、系统及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云计算技术领域,尤其涉及一种流量分配方法、设备、系统及存储介质。
背景技术
无服务器(Serverless)架构可自动实现和虚拟机(VM)、容器等相关的后端工作,例如可自主实现应用的负载均衡、自主扩容等,因此,用户无需关心后端如何支撑服务运行,而只需要实现服务本身,从而可提高开发效率。
但是,现有无服务器架构,在自主扩容过程中进行流量分配的方式,容易导致流量分配不均,从而导致资源浪费。
发明内容
本申请的多个方面提供一种流量分配方法、设备、系统及存储介质,用以实现流量均衡分配,进而有助于提高资源利用率。
本申请实施例提供一种数据处理系统,包括:激活组件、存储队列、扩容组件和调度组件;
所述激活组件,用于接收多个第一请求,并将所述多个第一请求存储至所述存储队列;
所述扩容组件,用于针对所述多个第一请求进行容器组扩容,以扩容出至少一个第一容器组;
所述调度组件,用于以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
本申请实施例还提供一种数据处理系统,包括:激活组件、存储队列、扩容组件、调度组件和负载均衡组件;
所述激活组件,用于接收多个第一请求以及在至少一个第一容器组扩容过程中接收第二请求,并将所述多个第一请求和所述第二请求存储至所述存储队列;
其中,所述至少一个第一容器组是所述扩容组件针对所述多个第一请求进行扩容的;
所述调度组件,用于在所述至少一个第一容器组扩容过程中,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组;
所述负载均衡组件,用于在所述至少一个第一容器组扩容成功后,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡。
本申请实施例还提供一种流量分配方法,包括:
接收多个第一请求,并将所述多个第一请求存储至存储队列;
针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
本申请实施例还提供一种流量分配方法,包括:
将接收到的多个第一请求存储至存储队列;
针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
在所述至少一个第一容器组扩容过程中,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组;以及
将所述至少一个第一容器组扩容过程中接收到的第二请求存储至存储队列;
在所述至少一个第一容器组扩容成功后,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡。
本申请实施例还提供一种计算机设备,包括:存储器、处理器和通信组件;其中,所述存储器,用于存储计算机程序;
所述处理器耦合至所述存储器,用于执行所述计算机程序以用于:
通过所述通信组件接收多个第一请求,并将所述多个第一请求存储至存储队列;
针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
本申请实施例还提供一种计算机设备,包括:存储器、处理器和通信组件;其中,所述存储器,用于存储计算机程序;
所述处理器耦合至所述存储器,用于执行所述计算机程序以用于:
将所述通信组件接收到的多个第一请求存储至存储队列;
针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
在所述至少一个第一容器组扩容过程中,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组;以及
将所述通信组件在所述至少一个第一容器组扩容过程中接收到的第二请求存储至存储队列;
并在所述至少一个第一容器组扩容成功后,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡。
本申请实施例还提供一种存储有计算机指令的计算机可读存储介质,当所述计算机指令被一个或多个处理器执行时,致使所述一个或多个处理器执行上述各方法中的步骤。
在本申请实施例中,数据处理系统包括:激活组件、存储队列、扩容组件和调度组件;其中,激活组件可将接收到的多个请求存储至存储队列;扩容组件可针对多个请求进行容器组扩容,得到至少一个容器组;进一步,调度组件便可以每个容器组分配到的请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个请求分配给至少一个容器组,这样,每个容器组均可分配到的相应数量的请求。本申请实施例提供的无服务器系统不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1a为本申请实施例提供的一种数据处理系统的结构示意图;
图1b为本申请实施例提供的另一种数据处理系统的结构示意图;
图1c为本申请实施例提供的又一种数据处理系统的结构示意图;
图2a为本申请实施例提供的一种流量分配方法的流程示意图;
图2b为本申请实施例提供的另一种流量分配方法的流程示意图;
图3为本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在 没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
针对现有无服务器系统流量分配不均,资源利用率较低的技术问题,在本申请一些实施例中提供一种数据处理系统,该系统包括:激活组件、存储队列、扩容组件和调度组件。其中,激活组件可将接收到的多个请求存储至存储队列;扩容组件可针对多个请求进行容器组扩容,得到至少一个容器组;进一步,调度组件便可以每个容器组分配到的请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个请求分配给至少一个容器组,这样,每个容器组均可分配到的相应数量的请求。本申请实施例提供的无服务器系统不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率。
对于数据处理架构系统,可根据接收到的请求,扩容相应数量的容器组。在本申请实施例中,容器组的扩容过程不仅包含容器组从无到有的创建过程,也包含容器组从创建完成之后的健康检查过程,即容器组的扩容过程包含容器组处于可使用状态(ready状态)的过程。相应地,容器组成功扩容是指该容器组达到ready状态。
可选地,若容器组的数量为多个,可并行扩容多个容器组,也可串行扩容多个容器组。但是,即便并行扩容多个第一容器组,对每个第一容器组的扩容速率也会有所差别,进而导致多个第一容器组不能同时扩容成功。
在现有技术中,在容器组扩容过程中,往往会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,从而导致后扩容成功的容器组资源的浪费。另一方面,对于先扩容成功的容器组来说,实际接收到的请求的数量超过了其可处理的并发请求数,还会导致部分请求处理的延迟或异常。例如,假设请求的数量为300个,每个容器组可处理的并发请求数为100个,则需要扩容的容器组的数量为3个,进一步,假设有两个容器组首先扩容成功,则会各分配100个请求给首先扩容成功的容器组,而在最后一个容器组扩充成功之前,若首先扩容成功的2个容器组已知处理了一部分请求,还会将应分配给最后一个容器组的流量分配给先扩容成功的2个容器组,进而导致最后扩容成功的容器组分配到的请求的数量少于100个,甚至分配不到请求,从而导致最后扩容成功的容器组的资源的浪费。
为解决上述技术问题,本申请实施例提供一种新的无服务器系统架构。以下结合附图,详细说明本申请各实施例提供的技术方案。
图1a为本申请实施例提供的一种数据处理系统的结构示意图。在一些实施例中,本实施例提供的数据处理系统,也可称为无服务器(Serverless)系统。如图1a所示,数据 处理系统包括:激活组件11、存储队列12、扩容组件13和调度组件14。
在本实施例中,激活组件11、存储队列12、扩容组件13和调度组件14可以为具有相应功能的软件模块、应用程序、服务或一台实体设备。激活组件11、存储队列12、扩容组件13和调度组件14可以部署在不同的物理机上,也可以部署在不同容器或虚拟机(Virtual Machine,VM)中。当然,这些容器或虚拟机可以部署在同一物理机上,也可以部署在多个不同的物理机上。可选地,对于激活组件11、存储队列12、扩容组件13和调度组件14位于不同的物理机的情况,这些物理机需在同一数据处理系统集群里。
其中,物理机可以为单一服务器设备,也可以云化的服务器阵列,或者为云化的服务器阵列中运行的VM。另外,物理机也可以指具备相应服务能力的其他计算设备,例如电脑等终端设备(运行服务程序)等。
可选地,不同的物理机之间可以是无线或有线连接。例如,不同的物理机之间可采用网线或通信光纤连接。或者,不同物理机之间可以通过移动网络通信连接,相应地,移动网络的网络制式可以为2G(GSM)、2.5G(GPRS)、3G(WCDMA、TD-SCDMA、CDMA2000、UTMS)、4G(LTE)、4G+(LTE+)、5G、WiMax等中的任意一种。可选地,不同物理机之间也可以通过蓝牙、WiFi、红外线、虚拟私有云(Virtual Private Cloud,VPC)或远程直接数据存取(Remote Direct Memory Access,RDMA)等方式通信连接。
在本实施例中,激活组件11可接收请求。其中,请求可为网络请求,如http请求等等。但不限于此。可选地,激活组件11可在数据处理系统后台的容器组的实例数为0的情况下,接收请求。或者,在一些实施例中,激活组件11也可在数据处理系统后台的容器组均满负荷工作的情况下,接收请求。其中,容器组满负荷工作是指:该容器组在当前时刻处理的请求的数据达到其可处理的并发请求数。
为了便于描述和区分,在本申请实施例中,将激活组件11在数据处理系统后台的容器组的实例数为0或容器组均满负荷工作的情况下接收的请求,定义为第一请求。其中,第一请求的数量可以为1个或多个。多个是指2个或2个以上。对于第一请求为1个的情况,由于流量分配机制较为简单,在本实施例中暂不做描述。因此,本申请实施例中,主要对数据处理系统对多个第一请求进行均衡分配进行描述。
如图1a所示,在本实施例中,激活组件11还可将接收到的多个第一请求存储至存储队列12。相应地,扩容组件13可针对多个第一请求进行容器组扩容,进而扩容出至少一个容器组。在本申请实施例中,为了便于描述和区分,将该阶段扩容出的容器组,定义为第一容器组。其中,第一容器组的数量可以为1个或多个,其具体取值由第一请 求的数量决定。在一些实施例中,容器组可实现为Pod,其中,Pod中包含一个或多个容器。
可选地,扩容组件13可根据多个第一请求的数量和每个容器组可处理的并发请求数,确定容器组数量M。其中,M为正整数,其具体取值由第一请求的数量和每个容器组可处理的并发请求数决定。进一步,扩容组件13可按照容器组数量M进行容器组扩容,得到M个第一容器组。
在实际应用中,若多个第一请求的数量为每个容器组可处理的并发请求数的整数倍,则M等于二者相除的结果;若多个第一请求的数量不是每个容器组可处理的并发请求数的整数倍,则可对二者相除的结果向上取整作为M的取值。
可选地,若第一容器组的数量为多个,扩容组件13可并行扩容多个第一容器组,也可串行扩容多个第一容器组(例如:第一容器组1、第一容器组2…第一容器组M)。
进一步,调度组件14便可将存储队列12中存储的多个第一请求分配至至少一个第一容器组。其中,每个第一容器组分配到的第一请求的数量不大于(小于或等于)其可处理的并发请求数。即调度组件14可以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将存储队列12中存储的多个第一请求分配至至少一个第一容器组。其中,每个第一容器组分配到的第一请求的数量可以相同,也可不同,但均小于或等于该第一容器组可处理的并发请求数。
在本申请实施例中,每个第一容器组可处理的并发请求数可以相同,也可不同,且在本申请实施例中,对于每个第一容器组可处理的并发请求数不做限定,其可由用户自主设定,也可由数据处理系统的开发人员设定,但不限于此。
可选地,在本申请实施例中,调度组件14可在容器组扩容过程中,对第一请求进行实时分配,即每成功扩容一个第一容器组,则从存储队列12中调取将不大于当前成功扩容出的第一容器组可处理的并发请求数的第一请求数,并将调取的第一请求数分配给当前成功扩容出的第一容器组。例如,假设当前成功扩容出的第一容器组为第一容器组2,第一容器组2可处理的并发请求数为S个,其中S为正整数,则调度组件14可在成功扩容出第一容器组2时,从存储队列12中调取R(R≤S,且R为正整数)个第一请求,并将这R个第一请求分配给第一容器组2。
或者,调度组件14也可在至少一个第一容器组全部成功扩容之后,再将多个第一请求在至少一个第一容器组之间进行均衡分配,且每个第一容器组分配到的第一请求的总数量小于或等于其可处理的并发请求数。
本申请实施例提供的数据处理系统,包括:激活组件、存储队列、扩容组件和调度组件;其中,激活组件可将接收到的多个请求存储至存储队列;扩容组件可针对多个请求进行容器组扩容,得到至少一个容器组;进一步,调度组件便可以每个容器组分配到的请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个请求分配给至少一个容器组,这样,每个容器组均可分配到的相应数量的请求。本实施例提供的数据处理系统不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率,尤其有助于提高后扩容成功的容器组资源的利用率。
例如,同样假设第一请求的数量为300个,每个容器组可处理的并发请求数为100个,则需要扩容的第一容器组的数量为3个,进一步,假设有两个容器组首先扩容成功,则调度组件14分配100个请求给首先扩容成功的第一容器组,而在最后一个第一容器组扩充成功之前,即便首先扩容成功的2个第一容器组已知处理了一部分请求,调度组件14也不会将应分配给最后一个容器组的流量分配给先扩容成功的2个容器组,而是至最后一个容器组扩容成功之后,调度组件14才从存储队列12中调取剩余的100个第一请求,并将这100个请求分配至最后扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率,尤其有助于提高后扩容成功的容器组资源的利用率。
在本申请实施例中,调度组件14可监测当前扩容的容器组的状态,并在当前扩容的容器组扩容成功时,从存储队列12中调取相应数量的第一请求,并将相应数量的第一请求分配至当前容器成功的容器组。其中,为了便于描述和区分,将当前扩容成功的第一容器组,定义为第一目标容器组。在本实施例中,相应数量小于或等于第一目标容器组可处理的并发请求数。
可选地,在本实施例中,可设定每个第一容器组可处理的第一请求的数量,将该数量定义为设定数量。其中,设定数量小于或等于第一目标容器组可处理的并发请求数。在实际应用中,激活组件11接收到的第一请求的数量可能不为设定数量的整数倍,则对于最后一个扩容成功的第一容器组,其分配到的第一请求小于设定数量。
基于上述分析,若在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量小于M,即第一目标容器组不是至少一个第一容器组中最后一个扩容成功的容器组,则调度组件14可从存储队列12中调取设定数量的第一请求。相应地,在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量等于M,即第一目标容器组是至少一个第一容器组中最后一个扩容成功的容器组,则调度组件14可从存储 队列12中调取剩余的第一请求,并将剩余的第一请求分配至第一目标容器组。其中,剩余的第一请求的数量小于或等于设定数量。在实际应用中,若激活组件11接收到的第一请求的数量为设定数量的整数倍,则剩余的第一请求的数量等于设定数量;若激活组件11接收到的第一请求的数量不是设定数量的整数倍,则剩余的第一请求的数量小于设定数量。
在一些实施例中,如图1b所示,数据处理系统还包括:访问端点(endpoint)控制组件15。其中,访问端点控制组件15可在成功扩容出第一目标容器组时,将第一目标容器组的IP地址写入访问端点。相应地,调度组件14可检测访问端点中是否新增IP地址,若监测到访问端点中新增了IP地址,则确定成功扩容出第一目标容器组,且该新增的IP地址即为第一目标容器组的IP地址。进一步,调度组件14便可将上述调取的相应数量的第一请求分配至新增的IP地址所对应的第一目标容器组。由上述分析可知,若第一目标容器组是M个第一容器组中最后一个扩容成功的容器组,则相应数量等于存储队列12中剩余的第一请求的数量;若第一目标容器组不是M个第一容器组中最后一个扩容成功的容器组,则相应数量等于上述设定数量。
在本申请实施例中,激活组件11不仅可在数据处理系统的后台的容器组实例为0的情况下接收请求,还可在容器组的实例数从0-M的扩容过程中接收请求。在本申请实施例中,为了便于描述和区分,将激活组件11在上述至少一个第一容器组扩容过程中,接收的请求定义为第二请求。其中,第二请求的数量可以为1个或多个。
相应地,激活组件11可在至少一个第一容器组扩容过程中,接收第二请求,并将第二请求存储至存储队列12。对于第二请求,本申请实施例提供的数据处理系统不会再针对第二请求进行容器组扩容。基于此,对于第二请求的调度可引入新的调度机制,采用图1b所示的负载均衡组件16(Service)进行流量均衡。在本实施例中,为了便于描述和区分,将对第一请求的调度,定义为一级调度;并将对第二请求的调度,定义为二级调度。相应地,本实施例提供的数据处理系统,可在成功扩容出上述至少一个第一容器组之后,进入二级调度模式。
相应地,负载均衡组件16可在成功扩容出上述至少一个第一容器组之后,以每个第一容器组当前处理的请求不大于其可处理的并发请求数为目标,将存储队列12中的第二请求在至少一个第一容器组之间进行均衡分配。可选地,在不同的阶段,第一容器组当前处理的请求可能全部为第一请求;也可能部分为第一请求,部分为第二请求;或者全部为第二请求。无论每个第一容器组当前处理的请求为哪个阶段接收到的请求,这些请 求的总数量均小于或等于该第一容器组可处理的并发请求数。
可选地,负载均衡组件16可获取至少一个第一容器组当前处理的请求的数量,并从至少一个第一容器组中选择出当前处理的请求的数量尚未达到各自对应的并发请求数的第二目标容器组。进一步,负载均衡组件16从存储队列12中调取N个第二请求,并将N个第二请求分配给第二目标容器组;其中,N小于或等于第二目标容器组可处理的并发请求数与第二目标容器组当前处理的请求的数量之间的差值。
本申请实施例提供的数据处理系统,不仅可接收至少一个第一容器组扩容之前和至少一个第一容器组扩容过程中到达的请求,还可接收至少一个第一容器组成功扩容之后到达的请求。为了便于描述和区分,在本申请实施例中,将至少一个第一容器组成功扩容之后到达的请求,定义为第三请求。其中,第三请求的数量可以为1个或多个。
进一步,为了提高请求的分配和处理效率,对于至少一个第一容器组成功扩容之后到达的请求可由负载均衡组件16接收。这样,在进行流量分配时,可减少激活组件11和存储队列12这两跳,进而有助于提高流量分配和处理效率。
基于上述分析,在本申请实施例中,负载均衡组件16还可在成功扩容出至少一个第一容器组之后,接收第三请求。进一步,负载均衡组件16还可判断上述至少一个第一容器组是否能够处理第三请求。若判断结果为是,则以每个第一容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将第三请求在至少一个第一容器组之间进行均衡。相应地,若判断结果为否,则触发扩容组件13进行容器组扩容。为了便于描述和区分,将扩容组件13针对第三请求扩容出的容器组,定义为第二容器组。
进一步,负载均衡组件16还可判断至少一个第一容器组当前尚可处理的请求的数量是否大于或等于第三请求的数量。若判决结果为是,则确定至少一个第一容器组能够处理第三请求;若判断结果为否,则确定至少一个第一容器组不能够处理第三请求。
对于至少一个第一容器组不能够处理第三请求的情况,扩容组件13可针对第三请求进行容器组扩容,得到Q个第二容器组。其中,Q为正整数。可选地,扩容组件13可根据至少一个第一容器组当前处理的请求的数量、每个容器组可处理的并发请求数以及第三请求的数量,确定容器组数量Q,并扩容出Q个第二容器组。例如,假设每个容器组可处理的并发请求数为100个,至少一个第一容器组的数量为3个,这3个第一容器组当前处理的请求的总数量为200,且第三请求的数量为250个,这样,3个第一容器组还可处理的请求数量为100个,而第三请求的数量为250个,则可确定这3个第一容器组不能够处理第三请求。相应地,扩容组件13可根据这3个第一容器组还可处理的请求 数量为100个和第三请求的数量为250个,确定出有150个第三请求无法在3个第一容器组之间分配,则需针对这150个第三请求进行容器组扩容。进一步,扩容组件13可根据这150个第三请求和每个容器组可处理的并发请求数100个,确定需要扩容2个第二容器组。
相应地,负载均衡组件15可以每个第一容器组和每个第二容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将第三请求在至少一个第一容器组和Q个第二容器组之间进行均衡。其中,第三请求在至少一个第一容器组和Q个第二容器组之间进行均衡的具体实施方式,可参见上述负载均衡组件15将第二请求在至少一个第一容器组之间进行均衡的相关内容,在此不再赘述。
本申请实施例提供的数据处理系统还可提供两级流量调度模式,下面结合图1c对两级流量调度模式进行示例性说明。
图1c为本申请实施例提供的又一种数据处理系统的结构示意图。如图1c所示,该系统包括:激活组件11、存储队列12、调度组件14和负载均衡组件16。
本实施例提供的数据处理系统,可对容器组扩容之前接收到的请求进行调度,也可对容器组扩容过程中接收到的请求进行调度。在本实施例中,将对容器组之前接收到的请求的调度定义为一级流量调度;并将对容器组扩容过程中接收到的请求的调度定义为二级流量调度。
在本实施例中,激活组件11可在数据处理系统后台的容器组的实例数为0的情况下,接收请求。或者,在一些实施例中,激活组件11也可在数据处理系统后台的容器组均满负荷工作的情况下,接收请求。为了便于描述和区分,在本申请实施例中,将激活组件11在数据处理系统后台的容器组的实例数为0或容器组均满负荷工作的情况下接收的请求,定义为第一请求。其中,对第一流量请求的调度采用一级流量调度方式。如图1c所示,激活组件11可将接收到的多个第一请求存储至存储队列12。相应地,扩容组件13可针对多个第一请求进行容器组扩容,进而扩容出至少一个第一容器组。其中,关于扩容组件13确定第一容器组数量的具体实施方式,可参见上述实施例的相关内容,在此不再赘述。
进一步,调度组件14便可将存储队列12中存储的多个第一请求分配至至少一个第一容器组。其中,调度组件14可在容器组扩容过程中,对第一请求进行实时分配,即每成功扩容一个第一容器组,则从存储队列12中调取第一请求,并将调取的第一请求分配给当前成功扩容出的第一容器组。
在本实施例中,激活组件11还可在至少一个第一容器组的扩容过程中,接收请求。为了便于描述和区分,将该阶段接收到的请求,定义为第二请求。进一步,激活组件11还可将第二请求存储至存储队列12。对于第二请求,本实施例提供的数据处理系统不会再针对第二请求进行容器组扩容。基于此,对于第二请求的调度可引入新的调度机制,采用图1c所示的负载均衡组件(Service)16对第二请求进行流量均衡,即采用二级流量调度对第二请求进行分配。相应地,负载均衡组件16可在成功扩容出上述至少一个第一容器组之后,将存储队列12中的第二请求在至少一个第一容器组之间进行均衡分配。
本实施例提供的数据处理系统,采用两级流量调度机制分别对容器组扩容前接收的请求以及容器组扩容过程中接收的请求进行流量均衡。其中,一级流量调度可在容器组扩容过程中,将容器组扩容前接收的请求分配给扩容成功的容器组,实现了容器组动态扩容过程中的流量均衡,有助于提高容器组资源利用率;二级流量调度可在容器组全部扩容成功之后,将容器组扩容过程中接收到的请求在容器组之间进行均衡分配,有助于进一步提高容器组资源利用率。
在本实施例中,对于一级流量调度模式,调度组件14可以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将存储队列12中存储的多个第一请求分配至至少一个第一容器组。其中,每个第一容器组分配到的第一请求的数量可以相同,也可不同,但均小于或等于该第一容器组可处理的并发请求数。这样,调度组件13不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率,尤其有助于提高后扩容成功的容器组资源的利用率。
其中,每个第一容器组可处理的并发请求数可以相同,也可不同,且在本申请实施例中,对于每个第一容器组可处理的并发请求数不做限定,其可由用户自主设定,也可由数据处理系统的开发人员设定,但不限于此。
对于二级流量调度模式,负载均衡组件16可在成功扩容出上述至少一个第一容器组之后,以每个第一容器组当前处理的请求不大于其可处理的并发请求数为目标,将存储队列12中的第二请求在至少一个第一容器组之间进行均衡分配。可选地,在不同的阶段,第一容器组当前处理的请求可能全部为第一请求;也可能部分为第一请求,部分为第二请求;或者全部为第二请求。无论每个第一容器组当前处理的请求为哪个阶段接收到的请求,这些请求的总数量均小于或等于该第一容器组可处理的并发请求数。
在本申请实施例中,对于图1a、图1b和图1c所提供的数据处理系统,在数据处理 系统后台的容器组实例比较充裕的情况下,即数据处理系统后台的容器组实例可处理的请求数大于当前数据处理系统接收到的请求数的情况下,数据处理系统还可对容器组进行缩容。相应地,扩容组件14可根据当前容器组的数量、每个容器组可处理的并发请求量以及待处理的请求的数量,计算需要缩容的容器组的数量,并对当前容器组进行缩容。
本申请实施例提供的数据处理系统,除了对容器组扩容过程中接收到的请求进行流量调度之外,还可对容器组缩容过程中接收到的请求进行流量调度。为了便于描述和区分,将在容器组缩容过程中接收到的请求定义为第四请求。在容器组缩容过程中,负载均衡组件16可接收第四请求,并以每个容器组当前处理的请求的数量不大于其可处理的并发请求数为目标,将第四请求在当前存在的容器组之间进行均衡。
除了上述系统实施例之外,本申请实施例还提供流量分配方法,下面结合图示进行示例性说明。
图2a为本申请实施例提供的一种流量分配方法的流程示意图。如图2a所示,该方法包括:
201、接收多个第一请求。
202、将多个第一请求存储至存储队列。
203、针对多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组。
204、以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个第一请求分配至至少一个第一容器组。
本实施例提供的流量分配方法适用于数据处理系统,该系统可接收多个第一请求,并将接收到的多个第一请求存储至存储队列。进一步,可针对多个第一请求进行容器组扩容,进而扩容出至少一个容器组。在本申请实施例中,为了便于描述和区分,将该阶段扩容出的容器组,定义为第一容器组。其中,第一容器组的数量可以为1个或多个,其具体取值由第一请求的数量决定。在一些实施例中,容器组又可称为Pod,其中,Pod中包含一个或多个容器。
可选地,若第一容器组的数量为多个,可并行扩容多个第一容器组,也可串行扩容多个第一容器组。
进一步,可将存储队列中存储的多个第一请求分配至至少一个第一容器组。其中,每个第一容器组分配到的第一请求的数量不大于(小于或等于)其可处理的并发请求数。其中,每个第一容器组分配到的第一请求的数量可以相同,也可不同,但均小于或等于该第一容器组可处理的并发请求数。其中,关于对第一请求在至少一个第一容器组之间 进行分配的具体实施方式,可参见上述实施例的相关内容,在此不再赘述。
在本实施例中,每个第一容器组可处理的并发请求数可以相同,也可不同,且在本申请实施例中,对于每个第一容器组可处理的并发请求数不做限定,其可由用户自主设定,也可由数据处理系统的开发人员设定,但不限于此。
在本实施例中,可将接收到的多个请求存储至存储队列;并对多个请求进行容器组扩容,得到至少一个容器组;进一步,可以每个容器组分配到的请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个请求分配给至少一个容器组,这样,每个容器组均可分配到的相应数量的请求。这样,不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率,尤其有助于提高后扩容成功的容器组资源的利用率。
在一些实施例中,步骤203的一种可选实施方式为:根据多个第一请求的数量和每个容器组可处理的并发请求数,确定容器组数量M;并按照容器组数量M进行容器组扩容,得到M个第一容器组。其中,M为正整数,其具体取值由第一请求的数量和每个容器组可处理的并发请求数决定。
在实际应用中,若多个第一请求的数量为每个容器组可处理的并发请求数的整数倍,则M等于二者相除的结果;若多个第一请求的数量不是每个容器组可处理的并发请求数的整数倍,则可对二者相除的结果向上取整作为M的取值。
在本申请实施例中,步骤204的一种可选实施方式为:监测当前扩容的容器组的状态;并在监测到成功扩容出第一目标容器组时,则从存储队列中调取相应数量的第一请求,以及将相应数量的第一请求分配至第一目标容器组;其中,相应数量小于或等于第一目标容器组可处理的并发请求数。
进一步,从存储队列中调取相应数量的第一请求的一种可选实施方式为:若在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量小于M,则从存储队列中调取设定数量的第一请求;其中,设定数量小于或等于第一目标容器组可处理的并发请求数。
相应地,若在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量等于M,则从存储队列中调取剩余的第一请求;并将剩余的第一请求分配至第一目标容器组;其中,剩余的第一请求的数量小于或等于设定数量。
在一些实施例中,在成功扩容出的第一目标容器组时,还可将第一目标容器组的IP地址写入访问端点。相应地,监测当前扩容的容器组的状态的一种实施方式为:监测访 问端点中是否新增IP地址;并在监测到访问端点中新增IP地址时,确定成功扩容出第一目标容器组;其中,新增的IP地址为第一目标容器组的IP地址。
进一步,将相应数量的第一请求分配至第一目标容器组的一种实施方式为:将相应数量的第一请求分配至与新增的IP地址对应的第一目标容器组。
在另一些实施例中,本申请实施例提供的数据处理系统还可在至少一个第一容器组扩容过程中,接收第二请求,并将第二请求存储至存储队列。
进一步,在成功扩容出至少一个第一容器组之后,以每个第一容器组当前处理的请求不大于其可处理的并发请求数为目标,将存储队列中的第二请求在至少一个第一容器组之间进行均衡分配。
进一步,将第二请求在至少一个第一容器组之间进行均衡分配的一种可选实施方式为:获取至少一个第一容器组当前处理的请求的数量;从至少一个第一容器组中选择出当前处理的请求的数量尚未达到并发请求数的第二目标容器组;以及从存储队列中调取N个第二请求,并将N个第二请求分配给第二目标容器组;其中,N小于或等于第二目标容器组可处理的并发请求数与第二目标容器组当前处理的请求的数量之间的差值。
进一步,在成功扩容出至少一个第一容器组之后,还可接收第三请求;并判断至少一个第一容器组是否能够处理第三请求;若判断结果为是,则以每个第一容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将第三请求在至少一个第一容器组之间进行均衡。
相应地,若判断结果为否,则根据至少一个第一容器组当前处理的请求的数量、每个容器组可处理的并发请求数以及第三请求的数量,确定容器组数量Q;并扩容出Q个第二容器组;其中,Q为正整数;
进一步,还可以每个第一容器组和每个第二容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将第三请求在至少一个第一容器组和Q个第二容器组之间进行均衡。
相应地,本申请实施例还提供一种存储有计算机指令的计算机可读存储介质,当计算机指令被一个或多个处理器执行时,致使一个或多个处理器执行上述流量分配方法中的步骤。
图2b为本申请实施例提供的另一种流量分配方法的流程示意图。如图2b所示,该方法包括:
S21、将接收到的多个第一请求存储至存储队列。
S22、针对多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组。
S23、在至少一个第一容器组扩容过程中,将存储队列中的多个第一请求分配至至少一个第一容器组。
S24、将在至少一个第一容器组的扩容过程中接收到第二请求存储至存储队列。
S25、在至少一个第一容器组扩容成功后,将第二请求在至少一个第一容器组之间进行均衡。
在本实施例中,可对容器组扩容之前接收到的请求进行调度,也可对容器组扩容过程中接收到的请求进行调度。在本实施例中,将对容器组之前接收到的第一请求的调度定义为一级流量调度;并将对容器组扩容过程中接收到的第二请求的调度定义为二级流量调度。
在步骤S21-S23中,对第一流量请求的调度采用一级流量调度方式。在步骤S21中,可将接收到的多个第一请求存储至存储队列。并在步骤S22中,针对多个第一请求进行容器组扩容,进而扩容出至少一个第一容器组。其中,关于确定第一容器组数量的具体实施方式,可参见上述实施例的相关内容,在此不再赘述。
进一步,在步骤S23中,便可将存储队列中存储的多个第一请求分配至至少一个第一容器组。其中,可在容器组扩容过程中,对第一请求进行实时分配,即每成功扩容一个第一容器组,则从存储队列中调取第一请求,并将调取的第一请求分配给当前成功扩容出的第一容器组。
在本实施例中,还可在至少一个第一容器组的扩容过程中,接收请求。为了便于描述和区分,将该阶段接收到的请求,定义为第二请求。进一步,在步骤S24中,还可将第二请求存储至存储队列。对于第二请求,本实施例提供的数据处理系统不会再针对第二请求进行容器组扩容。基于此,对于第二请求的调度可引入新的调度机制,即采用二级流量调度对第二请求进行分配。相应地,在步骤S25中,可在成功扩容出上述至少一个第一容器组之后,将存储队列12中的第二请求在至少一个第一容器组之间进行均衡分配。
在本实施例中,采用两级流量调度机制分别对容器组扩容前接收的请求以及容器组扩容过程中接收的请求进行流量均衡。其中,一级流量调度可在容器组扩容过程中,将容器组扩容前接收的请求分配给扩容成功的容器组,实现了容器组动态扩容过程中的流量均衡,有助于提高容器组资源利用率;二级流量调度可在容器组全部扩容成功之后,将容器组扩容过程中接收到的请求在容器组之间进行均衡分配,有助于进一步提高容器 组资源利用率。
在本实施例中,对于一级流量调度模式,可以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将存储队列中存储的多个第一请求分配至至少一个第一容器组。其中,每个第一容器组分配到的第一请求的数量可以相同,也可不同,但均小于或等于该第一容器组可处理的并发请求数。这样,不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率,尤其有助于提高后扩容成功的容器组资源的利用率。
其中,每个第一容器组可处理的并发请求数可以相同,也可不同,且在本申请实施例中,对于每个第一容器组可处理的并发请求数不做限定,其可由用户自主设定,也可由数据处理系统的开发人员设定,但不限于此。
对于二级流量调度模式,可在成功扩容出上述至少一个第一容器组之后,以每个第一容器组当前处理的请求不大于其可处理的并发请求数为目标,将存储队列中的第二请求在至少一个第一容器组之间进行均衡分配。可选地,在不同的阶段,第一容器组当前处理的请求可能全部为第一请求;也可能部分为第一请求,部分为第二请求;或者全部为第二请求。无论每个第一容器组当前处理的请求为哪个阶段接收到的请求,这些请求的总数量均小于或等于该第一容器组可处理的并发请求数。
相应地,本申请实施例还提供一种存储有计算机指令的计算机可读存储介质,当计算机指令被一个或多个处理器执行时,致使一个或多个处理器执行上述流量分配方法中的步骤。
需要说明的是,上述实施例所提供方法的各步骤的执行主体均可以是同一设备,或者,该方法也由不同设备作为执行主体。比如,步骤202和203的执行主体可以为设备A;又比如,步骤201的执行主体可以为设备A,步骤202的执行主体可以为设备B;等等。
另外,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如202、203等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。
相应地,本申请实施例还提供一种存储有计算机指令的计算机可读存储介质,当计算机指令被一个或多个处理器执行时,致使一个或多个处理器执行上述方法中的步骤。
图3为本申请实施例提供的一种计算机设备的结构示意图。如图3所示,该计算机设备包括:存储器30a、处理器30b和通信组件30c。
在本实施例中,存储器30a用于存储计算机程序。处理器30b耦合至所述存储器30a,用于执行所述计算机程序以用于:通过所述通信组件30c接收多个第一请求,并将所述多个第一请求存储至存储队列;针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;并以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
在一些实施例中,处理器30b在将针对所述多个第一请求进行容器组扩容时,具体用于:根据多个第一请求的数量和每个容器组可处理的并发请求数,确定容器组数量M;并按照容器组数量M进行容器组扩容,得到M个第一容器组。其中,M为正整数,其具体取值由第一请求的数量和每个容器组可处理的并发请求数决定。
在另一些实施例中,处理器30b在将存储队列中的多个第一请求分配至至少一个第一容器组时,具体用于:监测当前扩容的容器组的状态;并在监测到成功扩容出第一目标容器组时,则从存储队列中调取相应数量的第一请求,以及将相应数量的第一请求分配至第一目标容器组;其中,相应数量小于或等于第一目标容器组可处理的并发请求数。
进一步,处理器30b在从存储队列中调取相应数量的第一请求时,具体用于:若在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量小于M,则从存储队列中调取设定数量的第一请求;其中,设定数量小于或等于第一目标容器组可处理的并发请求数。相应地,若在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量等于M,则从存储队列中调取剩余的第一请求;并将剩余的第一请求分配至第一目标容器组;其中,剩余的第一请求的数量小于或等于设定数量。
在又一些实施例中,处理器30b还用于:在成功扩容出的第一目标容器组时,还可将第一目标容器组的IP地址写入访问端点。相应地,处理器30b在监测当前扩容的容器组的状态时,具体用于:监测访问端点中是否新增IP地址;并在监测到访问端点中新增IP地址时,确定成功扩容出第一目标容器组;其中,新增的IP地址为第一目标容器组的IP地址。
进一步,处理器30b在将相应数量的第一请求分配至第一目标容器组时,具体用于:将相应数量的第一请求分配至与新增的IP地址对应的第一目标容器组。
在又一些实施例中,处理器30b还用于:在至少一个第一容器组扩容过程中,通过通信组件30c接收第二请求,并将第二请求存储至存储队列。
进一步,处理器30b还用于:在成功扩容出至少一个第一容器组之后,以每个第一容器组当前处理的请求不大于其可处理的并发请求数为目标,将存储队列中的第二请求在至少一个第一容器组之间进行均衡分配。
可选地,处理器30b在将第二请求在至少一个第一容器组之间进行均衡分配时,具体用于:获取至少一个第一容器组当前处理的请求的数量;从至少一个第一容器组中选择出当前处理的请求的数量尚未达到并发请求数的第二目标容器组;以及从存储队列中调取N个第二请求,并将N个第二请求分配给第二目标容器组;其中,N小于或等于第二目标容器组可处理的并发请求数与第二目标容器组当前处理的请求的数量之间的差值。
在其它一些实施例中,处理器30b还用于:在在成功扩容出至少一个第一容器组之后,通过通信组件30c接收第三请求;并判断至少一个第一容器组是否能够处理第三请求;若判断结果为是,则以每个第一容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将第三请求在至少一个第一容器组之间进行均衡。相应地,若判断结果为否,则根据至少一个第一容器组当前处理的请求的数量、每个容器组可处理的并发请求数以及第三请求的数量,确定容器组数量Q;并扩容出Q个第二容器组;其中,Q为正整数;
进一步,处理器30b还用于:以每个第一容器组和每个第二容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将第三请求在至少一个第一容器组和Q个第二容器组之间进行均衡。
在一些实施例中,处理器30b还可将通信组件30c接收到的多个第一请求存储至存储队列;针对多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;在至少一个第一容器组扩容过程中,将存储队列中的多个第一请求分配至至少一个第一容器组;以及将通信组件30c在至少一个第一容器组扩容过程中接收到的第二请求存储至存储队列;并在至少一个第一容器组扩容成功后,将存储队列中的第二请求在至少一个第一容器组之间进行均衡。
可选地,处理器60b在将存储队列中的多个第一请求分配至至少一个第一容器组时,具体用于:以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个第一请求分配至至少一个第一容器组。
在一些可选实施方式中,如图3所示,该计算机设备还可以包括:电源组件30d。可选地,一些计算机设备还可包括:显示器30e和音频组件30f等可选组件。图3中仅 示意性给出部分组件,并不意味着计算机设备必须包含图3所示全部组件,也不意味着计算机设备只能包括图3所示组件。
在本实施例中,存储器用于存储计算机程序,并可被配置为存储其它各种数据以支持在计算机设备上的操作。其中,处理器可执行存储器中存储的计算机程序,以实现相应控制逻辑。存储器可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
在本实施例中,处理器可以为任意可执行上述方法逻辑的硬件处理设备。可选地,处理器可以为中央处理器(Central Processing Unit,CPU)、图形处理器(Graphics Processing Unit,GPU)或微控制单元(Microcontroller Unit,MCU);也可以为现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程阵列逻辑器件(Programmable Array Logic,PAL)、通用阵列逻辑器件(General Array Logic,GAL)、复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD)等可编程器件;或者为先进精简指令集(RISC)处理器(Advanced RISC Machines,ARM)或系统芯片(System on Chip,SOC)等等,但不限于此。
在本实施例中,通信组件被配置为便于计算机设备和其他设备之间有线或无线方式的通信。计算机设备可以接入基于通信标准的无线网络,如WiFi,2G或3G,4G,5G或它们的组合。在一个示例性实施例中,通信组件经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件还可基于近场通信(NFC)技术、射频识别(RFID)技术、红外数据协会(IrDA)技术、超宽带(UWB)技术、蓝牙(BT)技术或其他技术来实现。
在本实施例中,显示器可以包括液晶显示器(LCD)和触摸面板(TP)。如果显示器包括触摸面板,显示器可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。
在本实施例中,电源组件被配置为计算机设备的各种组件提供电力。电源组件可以包括电源管理系统,一个或多个电源,及其他与为电源组件所在设备生成、管理和分配电力相关联的组件。
在本实施例中,音频组件可被配置为输出和/或输入音频信号。例如,音频组件包括一个麦克风(MIC),当音频组件所在设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器或经由通信组件发送。在一些实施例中,音频组件还包括一个扬声器,用于输出音频信号。例如,对于具有语言交互功能的计算机设备,可通过音频组件实现与用户的语音交互等。
本实施例提供的计算机设备,可将接收到的多个请求存储至存储队列;并对多个请求进行容器组扩容,得到至少一个容器组;进一步,可以每个容器组分配到的请求的数量不大于其可处理的并发请求数为目标,将存储队列中的多个请求分配给至少一个容器组,这样,每个容器组均可分配到的相应数量的请求。这样,不会将后扩容成功的容器组应分配到的请求分配给先扩容成功的容器组,进而可实现容器组之间的流量均衡,有助于提高资源利用率,尤其有助于提高后扩容成功的容器组资源的利用率。
需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的范围之内。

Claims (20)

  1. 一种数据处理系统,其特征在于,包括:激活组件、存储队列、扩容组件和调度组件;
    所述激活组件,用于接收多个第一请求,并将所述多个第一请求存储至所述存储队列;
    所述扩容组件,用于针对所述多个第一请求进行容器组扩容,以扩容出至少一个第一容器组;
    所述调度组件,用于以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
  2. 根据权利要求1所述的系统,其特征在于,所述扩容组件在进行容器组扩容时,具体用于:
    根据所述多个第一请求的数量和每个容器组可处理的并发请求数,确定容器组数量M,并按照所述容器组数量M进行容器组扩容,以得到M个第一容器组;其中,M为正整数。
  3. 根据权利要求2所述的系统,其特征在于,所述调度组件,具体用于:
    监测当前扩容的容器组的状态;
    在监测到成功扩容出第一目标容器组时,则从所述存储队列中调取相应数量的第一请求,并将所述相应数量的第一请求分配至所述第一目标容器组;
    所述相应数量小于或等于所述第一目标容器组可处理的并发请求数。
  4. 根据权利要求3所述的系统,其特征在于,所述调度组件,在从所述存储队列中调取相应数量的第一请求时,具体用于:
    若在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量小于M,则从所述存储队列中调取设定数量的第一请求;
    其中,所述设定数量小于或等于所述第一目标容器组可处理的并发请求数。
  5. 根据权利要求4所述的系统,其特征在于,在从所述存储队列中调取相应数量的第一请求时,具体用于:
    若在监测到成功扩容出第一目标容器组时,成功扩容出的第一容器组的总数量等于M,则从所述存储队列中调取剩余的第一请求;
    将所述剩余的第一请求分配至所述第一目标容器组;其中,所述剩余的第一请求的 数量小于或等于所述设定数量。
  6. 根据权利要求3所述的系统,其特征在于,还包括:访问端点控制组件;所述访问端点控制组件还用于:在成功扩容出的第一目标容器组时,将所述第一目标容器组的IP地址写入访问端点;
    所述调度组件监测当前扩容的容器组的状态时,具体用于:
    监测所述访问端点中是否新增IP地址;
    在监测到所述访问端点中新增IP地址时,确定成功扩容出所述第一目标容器组;所述新增的IP地址为所述第一目标容器组的IP地址。
  7. 根据权利要求6所述的系统,其特征在于,所述调度组件在将所述相应数量的第一请求分配至所述第一目标容器组时,具体用于:
    将所述相应数量的第一请求分配至与所述新增的IP地址对应的第一目标容器组。
  8. 根据权利要求1所述的系统,其特征在于,还包括:负载均衡组件;
    所述激活组件,还用于:在所述至少一个第一容器组扩容过程中,接收第二请求,并将所述第二请求存储至所述存储队列;
    所述负载均衡组件,还用于:在成功扩容出所述至少一个第一容器组之后,以每个第一容器组当前处理的请求不大于其可处理的并发请求数为目标,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡分配。
  9. 根据权利要求8所述的系统,其特征在于,所述负载均衡组件,在将所述第二请求在所述至少一个第一容器组之间进行均衡分配时,具体用于:
    获取所述至少一个第一容器组当前处理的请求的数量;
    从所述至少一个第一容器组中选择出当前处理的请求的数量尚未达到所述并发请求数的第二目标容器组;
    从所述存储队列中调取N个第二请求,并将所述N个第二请求分配给所述第二目标容器组;
    其中,N小于或等于所述第二目标容器组可处理的并发请求数与所述第二目标容器组当前处理的请求的数量之间的差值。
  10. 根据权利要求8所述的系统,其特征在于,所述负载均衡组件,还用于:在成功扩容出所述至少一个第一容器组之后,接收第三请求;并判断所述至少一个第一容器组是否能够处理所述第三请求;若判断结果为是,则以每个第一容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将所述第三请求在所述至少一个第一容器组 之间进行均衡。
  11. 根据权利要求10所述的系统,其特征在于,所述负载均衡组件,还用于:若判断结果为否,则触发所述扩容组件进行容器组扩容;
    所述扩容组件,还用于:根据所述至少一个第一容器组当前处理的请求的数量、每个容器组可处理的并发请求数以及所述第三请求的数量,确定容器组数量Q;并扩容出Q个第二容器组;其中,Q为正整数;
    所述负载均衡组件,还用于:以每个第一容器组和每个第二容器组当前处理的请求的数量不大于其可处理的并发请求量为目标,将所述第三请求在所述至少一个第一容器组和所述Q个第二容器组之间进行均衡。
  12. 一种数据处理系统,其特征在于,包括:激活组件、存储队列、扩容组件、调度组件和负载均衡组件;
    所述激活组件,用于接收多个第一请求以及在至少一个第一容器组扩容过程中接收第二请求,并将所述多个第一请求和所述第二请求存储至所述存储队列;
    其中,所述至少一个第一容器组是所述扩容组件针对所述多个第一请求进行扩容的;
    所述调度组件,用于在所述至少一个第一容器组扩容过程中,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组;
    所述负载均衡组件,用于在所述至少一个第一容器组扩容成功后,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡。
  13. 根据权利要求12所述的系统,其特征在于,所述调度组件,具体用于:
    以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
  14. 一种流量分配方法,其特征在于,包括:
    接收多个第一请求,并将所述多个第一请求存储至存储队列;
    针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
    以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
  15. 根据权利要求14所述的方法,其特征在于,还包括:
    在所述至少一个第一容器组扩容过程中,接收第二请求,并将所述第二请求存储至所述存储队列;
    在成功扩容出所述至少一个第一容器组之后,以每个第一容器组当前处理的请求不大于其可处理的并发请求数为目标,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡分配。
  16. 一种流量分配方法,其特征在于,包括:
    将接收到的多个第一请求存储至存储队列;
    针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
    在所述至少一个第一容器组扩容过程中,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组;以及
    将所述至少一个第一容器组扩容过程中接收到的第二请求存储至存储队列;
    在所述至少一个第一容器组扩容成功后,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡。
  17. 根据权利要求16所述的方法,其特征在于,所述将所述存储队列中的多个第一请求分配至所述至少一个第一容器组,包括:
    以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
  18. 一种计算机设备,其特征在于,包括:存储器、处理器和通信组件;其中,所述存储器,用于存储计算机程序;
    所述处理器耦合至所述存储器,用于执行所述计算机程序以用于:
    通过所述通信组件接收多个第一请求,并将所述多个第一请求存储至存储队列;
    针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
    以每个第一容器组分配到的第一请求的数量不大于其可处理的并发请求数为目标,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组。
  19. 一种计算机设备,其特征在于,包括:存储器、处理器和通信组件;其中,所述存储器,用于存储计算机程序;
    所述处理器耦合至所述存储器,用于执行所述计算机程序以用于:
    将所述通信组件接收到的多个第一请求存储至存储队列;
    针对所述多个第一请求,进行容器组扩容,以扩容出至少一个第一容器组;
    在所述至少一个第一容器组扩容过程中,将所述存储队列中的多个第一请求分配至所述至少一个第一容器组;以及
    将所述通信组件在所述至少一个第一容器组扩容过程中接收到的第二请求存储至 存储队列;
    并在所述至少一个第一容器组扩容成功后,将所述存储队列中的第二请求在所述至少一个第一容器组之间进行均衡。
  20. 一种存储有计算机指令的计算机可读存储介质,其特征在于,当所述计算机指令被一个或多个处理器执行时,致使所述一个或多个处理器执行权利要求14-17任一项所述方法中的步骤。
PCT/CN2021/071376 2020-01-14 2021-01-13 流量分配方法、设备、系统及存储介质 WO2021143702A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010038309.5A CN113190324B (zh) 2020-01-14 2020-01-14 流量分配方法、设备、系统及存储介质
CN202010038309.5 2020-01-14

Publications (1)

Publication Number Publication Date
WO2021143702A1 true WO2021143702A1 (zh) 2021-07-22

Family

ID=76863612

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/071376 WO2021143702A1 (zh) 2020-01-14 2021-01-13 流量分配方法、设备、系统及存储介质

Country Status (3)

Country Link
CN (1) CN113190324B (zh)
TW (1) TW202133594A (zh)
WO (1) WO2021143702A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681899A (zh) * 2011-03-14 2012-09-19 金剑 云计算服务平台的虚拟计算资源动态管理系统
CN106453564A (zh) * 2016-10-18 2017-02-22 北京京东尚科信息技术有限公司 弹性云分布式海量请求处理的方法、装置及系统
CN106775990A (zh) * 2016-12-31 2017-05-31 中国移动通信集团江苏有限公司 请求调度方法和装置
CN108076082A (zh) * 2016-11-09 2018-05-25 阿里巴巴集团控股有限公司 一种应用集群的扩容方法、装置和系统
CN109150987A (zh) * 2018-07-27 2019-01-04 北京友普信息技术有限公司 基于主机层和容器层的两层式容器集群弹性扩容方法
US20190347121A1 (en) * 2018-05-11 2019-11-14 International Business Machines Corporation Distributed container image repository service

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9891935B2 (en) * 2015-08-13 2018-02-13 Altera Corporation Application-based dynamic heterogeneous many-core systems and methods
CN109062658B (zh) * 2018-06-29 2021-06-04 优刻得科技股份有限公司 实现计算资源服务化的调度方法、装置、介质、设备及系统
CN109684228B (zh) * 2019-01-07 2022-07-05 武汉斗鱼鱼乐网络科技有限公司 一种性能测试方法、装置、系统和存储介质
CN110321226A (zh) * 2019-07-09 2019-10-11 西安点告网络科技有限公司 主机的自动扩缩容方法、装置、主机及存储介质
CN110333953A (zh) * 2019-07-11 2019-10-15 中国工商银行股份有限公司 数据存储资源调度方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681899A (zh) * 2011-03-14 2012-09-19 金剑 云计算服务平台的虚拟计算资源动态管理系统
CN106453564A (zh) * 2016-10-18 2017-02-22 北京京东尚科信息技术有限公司 弹性云分布式海量请求处理的方法、装置及系统
CN108076082A (zh) * 2016-11-09 2018-05-25 阿里巴巴集团控股有限公司 一种应用集群的扩容方法、装置和系统
CN106775990A (zh) * 2016-12-31 2017-05-31 中国移动通信集团江苏有限公司 请求调度方法和装置
US20190347121A1 (en) * 2018-05-11 2019-11-14 International Business Machines Corporation Distributed container image repository service
CN109150987A (zh) * 2018-07-27 2019-01-04 北京友普信息技术有限公司 基于主机层和容器层的两层式容器集群弹性扩容方法

Also Published As

Publication number Publication date
TW202133594A (zh) 2021-09-01
CN113190324A (zh) 2021-07-30
CN113190324B (zh) 2024-09-13

Similar Documents

Publication Publication Date Title
US10635664B2 (en) Map-reduce job virtualization
CN112565317B (zh) 混合云系统及其数据处理方法、设备及存储介质
CN107241281B (zh) 一种数据处理方法及其装置
CN105339897B (zh) 高效的优先级感知线程调度
US20200396311A1 (en) Provisioning using pre-fetched data in serverless computing environments
EP3698247B1 (en) An apparatus and method for providing a performance based packet scheduler
US20130060834A1 (en) Distributed messaging system connectivity and resource management
KR20210094639A (ko) 리소스 스케줄링 방법 및 장치, 전자 디바이스 및 기록 매체
CN108512715B (zh) 一种业务链路的负载压力测试方法和相关装置
US11740812B2 (en) Data storage device idle time processing
US9804882B2 (en) Configuration manager and method for configuring a host system for processing a processing job in a virtual data-processing environment
WO2018086467A1 (zh) 一种云环境下应用集群资源分配的方法、装置和系统
US20250181745A1 (en) Data access method and system, hardware offloading device, electronic device, and medium
CN111754149A (zh) 司机调度方法、设备及存储介质
CN112953993A (zh) 资源调度方法、设备、网络系统及存储介质
WO2024041056A1 (zh) 储位分配方法和装置、电子设备、计算机可读介质
CN114265713B (zh) Rdma事件管理方法、装置、计算机设备及存储介质
WO2021143702A1 (zh) 流量分配方法、设备、系统及存储介质
US20150220442A1 (en) Prioritizing shared memory based on quality of service
CN113051066B (zh) 内存管理方法、装置、设备及存储介质
CN110688223A (zh) 数据处理方法及相关产品
CN111459653A (zh) 集群调度方法、装置和系统以及电子设备
CN115550283A (zh) 实例的资源分配方法及装置
CN109753340B (zh) 虚拟机快照处理方法、装置及系统
WO2021081813A1 (zh) 多核处理器及其调度方法、设备及存储介质

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: 21741146

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21741146

Country of ref document: EP

Kind code of ref document: A1