Instance resource scheduling method, device, storage medium and apparatus
By determining the user group to which the user belongs and determining available instances based on configuration information and the number of used instances when receiving the instance resource call request of the user, the problem of low instance resource utilization in the prior art is solved, and more efficient instance resource scheduling is achieved.
Patent Information
- Application Number
- CN202111310540.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-11-05
AI Technical Summary
In the prior art, the operation personnel manually adjust parameters to schedule instance resources, and the use of instance resources cannot be maximized, resulting in unreasonable parameter settings and low instance resource utilization.
When receiving the instance resource call request for the requesting user, determine the user group to which the user belongs, obtain the configuration information of the user group and the number of used instances, determine the available instances of the user group based on the configuration information and the number of used instances, and add the requested user to the queue of the available instances.
It realizes the rational setting of user group parameters to meet the user's instance needs and improves the utilization rate of instance resources.
Smart Images

Figure CN114020433B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to an instance resource scheduling method, equipment, storage medium and device. Background Art
[0002] At present, when instance resources are limited, multiple user groups will compete for instance resources. In the prior art, instance resources are usually scheduled by operators manually adjusting parameters. However, manual scheduling of instance resources cannot maximize the utilization of instance resources, resulting in unreasonable parameter settings and low instance resource utilization.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide an instance resource scheduling method, device, storage medium and apparatus, aiming to solve the technical problem in the prior art that instance resources are scheduled by manual adjustment of parameters by operators, which fails to maximize the utilization of instance resources, resulting in unreasonable parameter settings and low instance resource utilization.
[0005] To achieve the above object, the present invention provides an instance resource scheduling method, which comprises the following steps:
[0006] Upon receiving an instance resource calling request sent by a requesting user, determining a current user group to which the requesting user belongs;
[0007] Acquire configuration information of the current user group and the number of used instances, wherein the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance;
[0008] Determine the available instances for the current user group according to the configuration information and the number of used instances;
[0009] The requesting user is added to the instance resource queue corresponding to the available instance.
[0010] Optionally, before the step of determining the current user group to which the requesting user belongs when receiving the instance resource calling request sent by the requesting user, the step further includes:
[0011] Get the number of input users of each user group and the number of service users of each instance;
[0012] Determine the instance upper limit and instance lower limit of each user group according to the number of input users of each user group and the number of service users of each instance;
[0013] The configuration information of each user group is generated according to the instance upper limit value and the instance lower limit value of each user group.
[0014] Optionally, the step of determining the instance upper limit and instance lower limit of each user group according to the number of input users of each user group and the number of service users of each instance includes:
[0015] Obtaining priority information of each user group, and determining an instance value calculation strategy corresponding to each user group according to the priority information;
[0016] The instance upper limit value and the instance lower limit value of each user group are determined according to the number of input users of each user group, the number of service users of each instance, and the instance value calculation strategy.
[0017] Optionally, the step of obtaining the number of input users of each user group and the number of service users of each instance includes:
[0018] Obtain the average number of input users per unit time for each user group and the average number of service users per unit time for each instance;
[0019] Determining user change information according to the average number of input users per unit time, and segmenting the preset time according to the user change information to obtain multiple time periods;
[0020] The number of input users corresponding to each time period is determined according to the average number of input users per unit time, and the number of service users corresponding to each time period is determined according to the average number of service users per unit time.
[0021] Optionally, the configuration information includes: an instance lower limit value; the step of determining the available instances of the current user group according to the configuration information and the number of used instances includes:
[0022] Extracting the instance lower limit value corresponding to the current user group from the configuration information;
[0023] When the number of used instances is less than the instance lower limit, the exclusive instance corresponding to the current user group is used as the available instance of the current user group, and the exclusive instance is an instance occupied by each user group separately.
[0024] Optionally, the configuration information further includes: an instance upper limit value; after the step of extracting the instance lower limit value corresponding to the current user group from the configuration information, the step further includes:
[0025] When the number of used instances is greater than or equal to the instance lower limit, extracting the instance upper limit corresponding to the current user group from the configuration information;
[0026] When the number of used instances is less than the instance upper limit, a shared instance is used as an available instance of the current user group, and the shared instance is an instance shared by each user group.
[0027] Optionally, when the number of used instances is less than the instance upper limit, the step of using the shared instance as the available instance for the current user group includes:
[0028] When the number of used instances is less than the instance upper limit, determining the number of shared instances according to the instance lower limit of each user group;
[0029] When the number of shared instances is greater than a preset threshold, the shared instances are used as available instances for the current user group.
[0030] In addition, to achieve the above-mentioned purpose, the present invention also proposes an instance resource scheduling device, which includes a memory, a processor, and an instance resource scheduling program stored in the memory and executable on the processor, and the instance resource scheduling program is configured to implement the instance resource scheduling method described above.
[0031] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which an instance resource scheduling program is stored, and when the instance resource scheduling program is executed by a processor, the instance resource scheduling method as described above is implemented.
[0032] In addition, to achieve the above-mentioned purpose, the present invention also proposes an instance resource scheduling device, which includes: a user group determination module, an information acquisition module, an instance determination module and a user addition module;
[0033] The user group determination module is used to determine the current user group to which the requesting user belongs when receiving an instance resource call request sent by the requesting user;
[0034] The information acquisition module is used to acquire configuration information of the current user group and the number of used instances, wherein the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance;
[0035] The instance determination module is used to determine the available instances of the current user group according to the configuration information and the number of used instances;
[0036] Therefore, the user adding module is used to add the requesting user to the instance resource queue corresponding to the available instance.
[0037] The present invention discloses that when an instance resource call request sent by a requesting user is received, the current user group to which the requesting user belongs is determined, configuration information and the number of used instances of the current user group are obtained, the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance, the available instances of the current user group are determined according to the configuration information and the number of used instances, and the requesting user is added to the instance resource queue corresponding to the available instances; since the present invention performs user configuration based on the number of input users of the user group and the number of service users of the instance, user group parameters can be reasonably set to meet the user's instance requirements, and since the present invention performs instance resource scheduling based on the configuration information of the user group and the number of used instances, the utilization rate of instance resources can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the structure of an example resource scheduling device of a hardware operating environment involved in an embodiment of the present invention;
[0039] Figure 2 This is a flow chart of a first embodiment of a resource scheduling method according to an example of the present invention;
[0040] Figure 3 A schematic diagram of a flow chart of a second embodiment of a resource scheduling method according to an example of the present invention;
[0041] Figure 4 A schematic diagram of a flow chart of a third embodiment of a resource scheduling method according to an example of the present invention;
[0042] Figure 5 It is a structural block diagram of the first embodiment of the resource scheduling device of the present invention.
[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] Reference Figure 1 , Figure 1 The diagram is a schematic diagram of the structure of an example resource scheduling device of a hardware operating environment involved in an embodiment of the present invention.
[0046] like Figure 1As shown, the example resource scheduling device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), and the user interface 1003 may also include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable memory (Non-volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0047] Those skilled in the art will understand that Figure 1 The structure shown in the example does not constitute a limitation on the resource scheduling device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0048] like Figure 1 As shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and an example resource scheduling program.
[0049] exist Figure 1 In the instance resource scheduling device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the instance resource scheduling device calls the instance resource scheduling program stored in the memory 1005 through the processor 1001, and executes the instance resource scheduling method provided by the embodiment of the present invention.
[0050] Based on the above hardware structure, an embodiment of the resource scheduling method of the present invention is proposed.
[0051] Reference Figure 2 , Figure 2 The first embodiment of the resource scheduling method of the present invention is a flowchart of the first embodiment of the resource scheduling method of the present invention.
[0052] Step S10: upon receiving the instance resource calling request sent by the requesting user, determining the current user group to which the requesting user belongs.
[0053] It should be understood that the execution subject of the method of this embodiment may be an instance resource scheduling device with data processing, network communication and program running functions, such as a server, etc., or other electronic devices that can achieve the same or similar functions.
[0054] It is understandable that, at present, cloud game instances are a scarce resource. When game instances are limited, multiple user groups will compete for instance resources. In the prior art, resource calls are mainly made in the following ways.
[0055] Method 1: Divide instance resources into user groups in advance, and each user group has its own instance resources. For example, there are 10,000 instances in total and 3 user groups in total. User group A is configured with 2,000 instances, user group B is configured with 3,000 instances, and user group C is configured with 5,000 instances.
[0056] Method 2: All user groups share all instances, and instances are allocated on a first-come, first-served basis.
[0057] Method 3: Each user group pre-configures the initial number of instances, and controls the instances according to the configured number of instances. In addition, a task is started to monitor the number of instances used by each user group, and dynamically adjust the instance number configuration at regular intervals, based on the pre-configured manual configuration.
[0058] However, in method 1, instances cannot be shared. There may be a situation where a user group runs out of instances and there is a queue, while other user groups have remaining instances that are not used, resulting in instance waste. In method 2, some user groups with a small number of users may not be able to obtain instances. In method 3, the dynamic adjustment of instance configuration is not intelligent, and relevant adjustment parameters need to be configured in advance. At the same time, there is a problem of untimely dynamic adjustment of instances.
[0059] In order to overcome the above-mentioned defects, in this embodiment, user configuration is performed based on the number of input users of the user group and the number of service users of the instance, so that the user group parameters can be reasonably set to meet the user's instance needs. In addition, since this embodiment performs instance resource scheduling based on the configuration information of the user group and the number of used instances, the utilization rate of instance resources can be improved.
[0060] It can be understood that this embodiment is applied to the cloud game platform instance scheduling business scenario. For ease of understanding, the following examples are given, but this solution is not limited. The cloud game platform instance scheduling business scenario is as follows: According to different user sources and user attributes, the demand for game instances is also different. The user input is grouped according to the user source and attributes, and the game instance is shared among the user groups. Since the arrival of each group of users is random, in order to avoid a group of users being unable to obtain instances during business peaks, and to ensure that member users do not queue up, the user group instance lower limit can be set for each group of users, that is, the number of instances that the user group can exclusively occupy, and the instances other than the exclusive instances of each user group are used as shared instances for everyone to use together. In order to avoid a group of users actually occupying too many instances, the instance upper limit can be set for each user group. When a user arrives, the exclusive instance of the user group to which he belongs is used first, and other user groups shall not use the exclusive instance of the user group. After the exclusive instance of the user group is used up, if there is a shared instance, the shared instance can be used, and the total number of instances used by the user group shall not exceed the upper limit of the user group instance.
[0061] According to business needs, if the user group is a member user, the instance lower limit should meet the needs of the user group as much as possible, and no instance upper limit is set, so that users in this user group do not have to queue as much as possible; if the user group is a non-member user, the instance lower limit is set to meet the minimum user instance requirements, and the instance upper limit is set at the same time. The instance upper limit should minimize the average queuing time of the user group.
[0062] In the following configuration example, the total number of instances is 6000. The instance lower limit and instance upper limit of user groups A, B, and C are shown in Table 1. The reasonable values of the instance lower limit and instance upper limit to be allocated to each user group can be dynamically calculated through subsequent related algorithms and adjusted in real time.
[0063] Table 1 Example value table
[0064] User Groups Instance lower limit Instance upper limit User Group A (Members) 1000 6000-500-800 User Group B (Non-member) 500 2000 User Group C (Non-member) 800 3000
[0065] It should be noted that the requesting user can initiate an instance resource call request by starting a cloud game.
[0066] It should be understood that determining the current user group to which the requesting user belongs may be performed by extracting an identity identifier from the instance resource call request, and determining the current user group to which the requesting user belongs according to the identity identifier.
[0067] Step S20: Acquire configuration information of the current user group and the number of used instances, wherein the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance.
[0068] It should be noted that the configuration information is used to configure the instance upper limit and instance lower limit of the user group. The instance upper limit may be the total number of instances that the user group can use, and the instance lower limit may be the number of instances that the user group can exclusively use.
[0069] It should be understood that obtaining the number of used instances of the user group may be obtaining the queue length of the instance resource queue corresponding to the user group, and using the queue length as the number of used instances. In a specific implementation, the instance resource queue may be a queue in the game.
[0070] It can be understood that, since the configuration information is generated based on the number of input users of the user group and the number of service users of the instance, the user group can be configured according to actual conditions, thereby improving the reliability of the configuration information.
[0071] Step S30: Determine the available instances of the current user group according to the configuration information and the number of used instances.
[0072] It should be understood that determining the available instances of the current user group based on the configuration information and the number of used instances can be to extract the instance upper limit value and the instance lower limit value from the configuration information, and determine the available instances of the current user group based on the instance upper limit value, the instance lower limit value and the number of used instances.
[0073] Step S40: Add the requesting user to the instance resource queue corresponding to the available instance.
[0074] It should be noted that the instance resource queue can be a queue currently in the game.
[0075] It should be understood that adding the requesting user to the instance resource queue corresponding to the available instance may be adding the requesting user to the queue in the game to call the available instance.
[0076] Furthermore, in order to update the number of shared instances in real time when the instance is returned, after step S40, the following is further included:
[0077] When receiving an instance resource return request, determining to return the instance according to the instance resource return request;
[0078] Determining whether the returned instance is a shared instance;
[0079] If so, the instance information of the returned instance is obtained, and the number of shared instances is updated according to the instance information.
[0080] It should be noted that the instance resource return request can be initiated by the user. For example, the user can initiate the instance resource return request by ending the cloud game.
[0081] It should be understood that determining to return the instance according to the instance resource return request may be to extract the resource identifier from the instance resource return request, and determining to return the instance according to the instance resource return request.
[0082] It can be understood that determining whether the returned instance is a shared instance can be to match the instance identifier of the returned instance with the instance identifier of the shared instance. When the match is successful, the returned instance is determined to be a shared instance; when the match fails, the returned instance is determined not to be a shared instance.
[0083] It should be noted that the instance information of the returned instance may be the number of returned instances and the like.
[0084] It should be understood that updating the number of shared instances according to the instance information may be to add the number of returned instances to the number of shared instances to update the number of shared instances.
[0085] It is understandable that when the instance is returned as a shared instance, the user may also be removed from the instance resource queue.
[0086] In the first embodiment, it is disclosed that when an instance resource call request sent by a requesting user is received, the current user group to which the requesting user belongs is determined, the configuration information and the number of used instances of the current user group are obtained, the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance, the available instances of the current user group are determined according to the configuration information and the number of used instances, and the requesting user is added to the instance resource queue corresponding to the available instances; since this embodiment performs user configuration based on the number of input users of the user group and the number of service users of the instance, the user group parameters can be reasonably set to meet the user's instance needs, and since this embodiment performs instance resource scheduling according to the configuration information of the user group and the number of used instances, the utilization rate of instance resources can be improved.
[0087] Reference Figure 3 , Figure 3 This is a flow chart of the second embodiment of the resource scheduling method of the present invention. Figure 2 The first embodiment shown provides a second embodiment of the resource scheduling method of the present invention.
[0088] In the second embodiment, before step S10, the method further includes:
[0089] Step S01: Obtain the number of input users of each user group and the number of service users of each instance.
[0090] It should be noted that the number of input users may be the number of users arriving in each user group in each time period, and the number of service users may be the number of users served in each instance in each time period.
[0091] It should be understood that the number of input users and the number of service users may be pre-entered by the administrator of the instance resource scheduling device, or may be set by the instance resource scheduling device itself according to actual conditions, and this embodiment does not limit this.
[0092] Furthermore, in order to determine the number of input users of the user group and the number of service users of the instance according to actual conditions, the step S01 includes:
[0093] Obtain the average number of input users per unit time for each user group and the average number of service users per unit time for each instance;
[0094] Determining user change information according to the average number of input users per unit time, and segmenting the preset time according to the user change information to obtain multiple time periods;
[0095] The number of input users corresponding to each time period is determined according to the average number of input users per unit time, and the number of service users corresponding to each time period is determined according to the average number of service users per unit time.
[0096] It should be noted that the average number of input users per unit time may be the average number of users arriving per minute of each user group in a day, and the average number of service users per unit time may be the average number of users served per minute of each instance in a day.
[0097] It should be understood that the average number of users from different user sources is counted for different user groups, and the statistics are divided into three time dimensions according to the characteristics of cloud game users' playing time, namely winter and summer vacations, holidays and working days. The unit time is minutes, and the three dimensions are counted N days ago. The average number of users in each minute of the day can be calculated. The calculation formula is as follows:
[0098]
[0099] Where t is the tth minute of the day, t can be any value from 1 to 1440, C N is the number of users arriving at that minute on day N, λ t is the average number of users arriving in the tth minute of the day. When N is greater than a certain value, λ t tends to be stable, t That is, take this stable value.
[0100] It is understandable that t The calculation method is to take the same time dimension, count the average occupancy time of each user on a single instance, and then take the reciprocal, which is the number of users served per unit time μ t .
[0101] It should be noted that the user change information may be the change rate of the average number of user arrivals between adjacent minutes.
[0102] It should be understood that the user change information is determined according to the average number of input users per unit time, and the preset time is segmented according to the user change information to obtain multiple time periods. The average number of users arriving in the tth minute of a day can be recorded as λ t , when the λ of the t+1th minute t+1 and λ in the previous t minutes t If the change rate is less than 10%, t+1 and the previous t minutes are classified as the same time period; when the λ of the t+1th minute t+1 and λ in the previous t minutes t If the rate of change is higher than 10%, the first t minutes are classified as the same time period, and the next time period is calculated starting from the t+1 minute. The day is divided into segments in turn to obtain multiple time periods.
[0103] It is understandable that determining the number of input users corresponding to each time period according to the average input users per unit time may be calculating the number of input users corresponding to each time period according to the average input users per unit time by using a preset input user number formula. The preset input user number formula is as follows:
[0104]
[0105] Where n is the starting minute of the time period, i is the length of the time period, and λ t is the average number of users arriving in the tth minute of the day, and λ is the number of input users corresponding to the time period.
[0106] It is understandable that determining the number of service users corresponding to each time period according to the number of service users per unit time may be to calculate the number of service users corresponding to each time period according to the number of service users per unit time by using a preset service user number formula. The preset service user number formula is as follows:
[0107]
[0108] Where n is the starting minute of the time period, i is the length of the time period, μ t is the average number of users served in the tth minute of the day, and μ is the number of service users corresponding to the time period.
[0109] Step S02: determining the instance upper limit and instance lower limit of each user group according to the number of input users of each user group and the number of service users of each instance.
[0110] It should be understood that determining the instance upper limit and instance lower limit of each user group according to the number of input users of each user group and the number of service users of each instance can be to use the number of input users and the number of service users as reference information and search the preset instance table for the instance value corresponding to the reference information. The preset instance table contains the correspondence between the reference information and the instance value, and the instance value includes the instance upper limit and the instance lower limit.
[0111] Furthermore, in actual applications, user groups can also be divided into member user groups and non-member user groups. Different user groups correspond to different priorities, and different priorities correspond to different instance values. Therefore, in order to more accurately set the instance upper limit and instance lower limit of the user group, the step S02 includes:
[0112] Obtaining priority information of each user group, and determining an instance value calculation strategy corresponding to each user group according to the priority information;
[0113] The instance upper limit value and the instance lower limit value of each user group are determined according to the number of input users of each user group, the number of service users of each instance, and the instance value calculation strategy.
[0114] It should be understood that in actual applications, each user group has different priorities and can be divided into a member user group and a non-member user group. Different user groups correspond to different instance value calculation strategies. Therefore, in order to make the instance upper limit value and instance lower limit value of each user group more accurate, in this embodiment, the priority information of each user group is obtained, and the instance value calculation strategy corresponding to each user group is determined according to the priority information.
[0115] In a specific implementation, for example, within a unit of time, that is, within each parameter adjustment cycle, based on the parameters λ and μ calculated in the previous step, and knowing the total number of game instances N, the probability P0 of each user group that users can come and play without queuing can be calculated, as well as the probability that the number of users is greater than the number that can be served, that is, the probability that users need to queue up P(N≥k), and the average queuing time W of users can be calculated. q .
[0116] Calculate the instance lower limit of the member user group: According to business requirements, member users should try not to queue up, so P0 should be as large as possible. In the cloud gaming platform scenario, P0>90%, that is, P0>0.9.
[0117] According to the calculation formula (Multi-instance service intensity ρ * =λ / Sμ), substitute the instance number S=(1-N) for calculation, and S when P0>0.9 is the instance lower limit of the user group.
[0118] Calculate the instance lower limit of the non-member user group: The minimum value of non-member users should satisfy the requirement that the instance utilization rate is sufficient and there is no idle instance. That is, the probability that the number of users in the system is greater than the number of instances is large enough. Here we take P(N≥k)>0.9.
[0119] Right now Substitute k=1-N for calculation. When P(N≥k)>0.9, k is the instance lower limit value of the non-member user group.
[0120] Calculate the instance upper limit for non-member user groups:
[0121] (1) Artificially create a non-member queue to increase the non-member payment conversion rate. The maximum number of non-member instances needs to be controlled. At the same time, consider the user queue experience. This can be controlled by controlling the user queue leader. Here, the user queue leader can be controlled to be equal to the number of instances in the game.
[0122] The queue leader Substitute S = (1-N) for calculation, and the value S is the maximum number of non-member instances. If the value S calculated in this step is greater than the value S calculated in the second case below, the smaller value S is used.
[0123] (2) When ∑ the upper limit of instances of non-member user groups + ∑ the lower limit of instances of member user groups ≤ N, the total queuing time of the non-member user group should be minimized.
[0124] That is, satisfying Substitute S = (1-N) for calculation and get ∑W q When it is the minimum value, S is the instance upper limit of each non-member user group.
[0125] Through the above calculation, the instance upper limit and instance lower limit of each user group can be obtained.
[0126] Step S03: generating configuration information of each user group according to the instance upper limit value and the instance lower limit value of each user group.
[0127] It should be understood that generating the configuration information of each user group according to the instance upper limit value and the instance lower limit value may be to use the instance upper limit value and the instance lower limit value as the configuration information of each user group.
[0128] In the second embodiment, it is disclosed to obtain the number of input users of each user group and the number of service users of each instance, determine the instance upper limit value and the instance lower limit value of each user group according to the number of input users of each user group and the number of service users of each instance, and generate the configuration information of each user group according to the instance upper limit value and the instance lower limit value; because the configuration information of each user group can be pre-generated based on the number of input users of each user group and the number of service users of the instance in this embodiment, it can meet the actual needs of users and improve the reliability of configuration information.
[0129] Reference Figure 4 , Figure 4 This is a flow chart of the third embodiment of the resource scheduling method of the present invention. Figure 3 The second embodiment shown provides a third embodiment of the resource scheduling method of the present invention.
[0130] In the third embodiment, the step S30 includes:
[0131] Step S301: extracting the instance lower limit value corresponding to the current user group from the configuration information.
[0132] It should be understood that extracting the instance lower limit value corresponding to the current user group from the configuration information may be extracting the instance lower limit value corresponding to the current user group from the configuration information according to the information identifier, wherein the information identifier is used to indicate the information content.
[0133] It should be noted that the instance lower limit value corresponding to the current user group indicates the number of instances exclusively used by the current user group.
[0134] Step S302: when the number of used instances is less than the instance lower limit, the exclusive instance corresponding to the current user group is used as the available instance of the current user group, and the exclusive instance is an instance occupied by each user group separately.
[0135] It is understandable that when the number of used instances is less than the instance lower limit corresponding to the current user group, it means that the exclusive instances corresponding to the current user group are not all used. Therefore, the exclusive instances corresponding to the current user group can be directly called as the available instances of the current user group.
[0136] Furthermore, in actual applications, there is also a situation where the exclusive instance corresponding to the current user group has been used up. Therefore, the step S302 includes:
[0137] When the number of used instances is greater than or equal to the instance lower limit, extracting the instance upper limit corresponding to the current user group from the configuration information;
[0138] When the number of used instances is less than the instance upper limit, a shared instance is used as an available instance of the current user group, and the shared instance is an instance shared by each user group.
[0139] It should be noted that the instance upper limit corresponding to the current user group indicates the total number of instances that the current user group can use, which is composed of the number of instances exclusively used by the current user group and the number of instances shared by all user groups.
[0140] It should be understood that when the number of used instances is greater than or equal to the instance lower limit, it means that the exclusive instances corresponding to the current user group have been fully used. At this time, it is necessary to determine whether the number of used instances is less than the instance upper limit to determine whether the shared instances corresponding to the current user group are fully used.
[0141] It is understandable that when the number of used instances is greater than or equal to the instance lower limit and less than the instance upper limit, it means that the shared instances corresponding to the current user group are not all used. Therefore, the shared instances can be called as the available instances of the current user group.
[0142] It should be understood that when the number of used instances is greater than or equal to the instance upper limit, it means that all instances available to the current user group have been used. At this time, the requesting user needs to be added to the waiting queue to wait for the release of instance resources.
[0143] Furthermore, in actual applications, there is also a situation where the shared instance is fully occupied due to unreasonable settings. In order to overcome the above drawbacks, when the number of used instances is less than the instance upper limit, the shared instance is used as the available instance of the current user group, including:
[0144] When the number of used instances is less than the instance upper limit, determining the number of shared instances according to the instance lower limit of each user group;
[0145] When the number of shared instances is greater than a preset threshold, the shared instances are used as available instances for the current user group.
[0146] It should be noted that the preset threshold may be preset, for example, the preset threshold may be set to 0.
[0147] It is understandable that, except for the instance exclusively used by each user group, all other instances are shared instances. Therefore, determining the number of shared instances according to the instance lower limit of each user group can be obtained by subtracting the instance lower limit of each user group from the total number of instances.
[0148] It should be understood that when the number of shared instances is greater than the preset threshold, it means that not all shared instances are used. Therefore, the shared instances can be called as available instances of the current user group.
[0149] In the third embodiment, it is disclosed that the instance lower limit value corresponding to the current user group is extracted from the configuration information. When the number of used instances is less than the instance lower limit value, the exclusive instance corresponding to the current user group is used as the available instance of the current user group. The exclusive instance is an instance occupied by each user group separately. Since the instance lower limit value is introduced in this embodiment to determine the available instances of the user group, the reliability of the available instances is improved.
[0150] In addition, an embodiment of the present invention further provides a storage medium, on which an instance resource scheduling program is stored. When the instance resource scheduling program is executed by a processor, the instance resource scheduling method described above is implemented.
[0151] In addition, refer to Figure 5 , the embodiment of the present invention further proposes an instance resource scheduling device, the instance resource scheduling device comprising: a user group determination module 10, an information acquisition module 20, an instance determination module 30 and a user adding module 40;
[0152] The user group determination module 10 is used to determine the current user group to which the requesting user belongs when receiving an instance resource calling request sent by the requesting user.
[0153] It is understandable that, at present, cloud game instances are a scarce resource. When game instances are limited, multiple user groups will compete for instance resources. In the prior art, resource calls are mainly made in the following ways.
[0154] Method 1: Divide instance resources into user groups in advance, and each user group has its own instance resources. For example, there are 10,000 instances in total and 3 user groups in total. User group A is configured with 2,000 instances, user group B is configured with 3,000 instances, and user group C is configured with 5,000 instances.
[0155] Method 2: All user groups share all instances, and instances are allocated on a first-come, first-served basis.
[0156] Method 3: Each user group pre-configures the initial number of instances, and controls the instances according to the configured number of instances. In addition, a task is started to monitor the number of instances used by each user group, and dynamically adjust the instance number configuration at regular intervals, based on the pre-configured manual configuration.
[0157] However, in method 1, instances cannot be shared. There may be a situation where a user group runs out of instances and there is a queue, while other user groups have remaining instances that are not used, resulting in instance waste. In method 2, some user groups with a small number of users may not be able to obtain instances. In method 3, the dynamic adjustment of instance configuration is not intelligent, and relevant adjustment parameters need to be configured in advance. At the same time, there is a problem of untimely dynamic adjustment of instances.
[0158] In order to overcome the above-mentioned defects, in this embodiment, user configuration is performed based on the number of input users of the user group and the number of service users of the instance, so that the user group parameters can be reasonably set to meet the user's instance needs. In addition, since this embodiment performs instance resource scheduling based on the configuration information of the user group and the number of used instances, the utilization rate of instance resources can be improved.
[0159] It can be understood that this embodiment is applied to the cloud game platform instance scheduling business scenario. For ease of understanding, the following examples are given, but this solution is not limited. The cloud game platform instance scheduling business scenario is as follows: According to different user sources and user attributes, the demand for game instances is also different. The user input is grouped according to the user source and attributes, and the game instance is shared among the user groups. Since the arrival of each group of users is random, in order to avoid a group of users being unable to obtain instances during business peaks, and to ensure that member users do not queue up, the user group instance lower limit can be set for each group of users, that is, the number of instances that the user group can exclusively occupy, and the instances other than the exclusive instances of each user group are used as shared instances for everyone to use together. In order to avoid a group of users actually occupying too many instances, the instance upper limit can be set for each user group. When a user arrives, the exclusive instance of the user group to which he belongs is used first, and other user groups shall not use the exclusive instance of the user group. After the exclusive instance of the user group is used up, if there is a shared instance, the shared instance can be used, and the total number of instances used by the user group shall not exceed the upper limit of the user group instance.
[0160] According to business needs, if the user group is a member user, the instance lower limit should meet the needs of the user group as much as possible, and no instance upper limit is set, so that users in this user group do not have to queue as much as possible; if the user group is a non-member user, the instance lower limit is set to meet the minimum user instance requirements, and the instance upper limit is set at the same time. The instance upper limit should minimize the average queuing time of the user group.
[0161] In the following configuration example, the total number of instances is 6000. The instance lower limit and instance upper limit of user groups A, B, and C are shown in Table 1. The reasonable values of the instance lower limit and instance upper limit to be allocated to each user group can be dynamically calculated through subsequent related algorithms and adjusted in real time.
[0162] Table 1 Example value table
[0163] User Groups Instance lower limit Instance upper limit User Group A (Members) 1000 6000-500-800 User Group B (Non-member) 500 2000 User Group C (Non-member) 800 3000
[0164] It should be noted that the requesting user can initiate an instance resource call request by starting a cloud game.
[0165] It should be understood that determining the current user group to which the requesting user belongs may be performed by extracting an identity identifier from the instance resource call request, and determining the current user group to which the requesting user belongs according to the identity identifier.
[0166] The information acquisition module 20 is used to acquire the configuration information of the current user group and the number of used instances, wherein the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance.
[0167] It should be noted that the configuration information is used to configure the instance upper limit and instance lower limit of the user group. The instance upper limit may be the total number of instances that the user group can use, and the instance lower limit may be the number of instances that the user group can exclusively use.
[0168] It should be understood that obtaining the number of used instances of the user group may be obtaining the queue length of the instance resource queue corresponding to the user group, and using the queue length as the number of used instances. In a specific implementation, the instance resource queue may be a queue in the game.
[0169] It can be understood that, since the configuration information is generated based on the number of input users of the user group and the number of service users of the instance, the user group can be configured according to actual conditions, thereby improving the reliability of the configuration information.
[0170] The instance determination module 30 is used to determine the available instances of the current user group according to the configuration information and the number of used instances.
[0171] It should be understood that determining the available instances of the current user group based on the configuration information and the number of used instances can be to extract the instance upper limit value and the instance lower limit value from the configuration information, and determine the available instances of the current user group based on the instance upper limit value, the instance lower limit value and the number of used instances.
[0172] Therefore, the user adding module 40 is used to add the requesting user to the instance resource queue corresponding to the available instance.
[0173] It should be noted that the instance resource queue can be a queue currently in the game.
[0174] It should be understood that adding the requesting user to the instance resource queue corresponding to the available instance may be adding the requesting user to the queue in the game to call the available instance.
[0175] Furthermore, in order to update the number of shared instances in real time when the instance is returned, the instance resource scheduling device further includes:
[0176] The update module is used to determine the return instance according to the instance resource return request when receiving the instance resource return request, judge whether the returned instance is a shared instance, and if so, obtain the instance information of the returned instance and update the number of shared instances according to the instance information.
[0177] It should be noted that the instance resource return request can be initiated by the user. For example, the user can initiate the instance resource return request by ending the cloud game.
[0178] It should be understood that determining to return the instance according to the instance resource return request may be to extract the resource identifier from the instance resource return request, and determining to return the instance according to the instance resource return request.
[0179] It can be understood that determining whether the returned instance is a shared instance can be to match the instance identifier of the returned instance with the instance identifier of the shared instance. When the match is successful, the returned instance is determined to be a shared instance; when the match fails, the returned instance is determined not to be a shared instance.
[0180] It should be noted that the instance information of the returned instance may be the number of returned instances and the like.
[0181] It should be understood that updating the number of shared instances according to the instance information may be to add the number of returned instances to the number of shared instances to update the number of shared instances.
[0182] It is understandable that when the instance is returned as a shared instance, the user may also be removed from the instance resource queue.
[0183] In the present embodiment, it is disclosed that when an instance resource call request sent by a requesting user is received, the current user group to which the requesting user belongs is determined, configuration information and the number of used instances of the current user group are obtained, the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance, the available instances of the current user group are determined according to the configuration information and the number of used instances, and the requesting user is added to the instance resource queue corresponding to the available instances; since the present embodiment performs user configuration based on the number of input users of the user group and the number of service users of the instance, the user group parameters can be reasonably set to meet the user's instance requirements, and since the present embodiment performs instance resource scheduling based on the configuration information of the user group and the number of used instances, the utilization rate of the instance resources can be improved.
[0184] Other embodiments or specific implementations of the example resource scheduling device described in the present invention can refer to the above-mentioned method embodiments, which will not be described in detail here.
[0185] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0186] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In a unit claim that lists several means, several of these means may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order and these words may be interpreted as names.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for enabling an access device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0188] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An instance resource scheduling method, characterized in that: The example resource scheduling method comprises the following steps: Upon receiving an instance resource calling request sent by a requesting user, determining a current user group to which the requesting user belongs; Obtaining configuration information and the number of used instances of the current user group, wherein the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance, wherein obtaining the number of input users of each user group and the number of service users of each instance includes: obtaining the average number of input users per unit time of each user group and the average number of service users per unit time of each instance; determining user change information according to the average number of input users per unit time, and segmenting the preset time according to the user change information to obtain multiple time periods; determining the number of input users corresponding to each time period according to the average number of input users per unit time, and determining the number of service users corresponding to each time period according to the average number of service users per unit time; Determine the available instances for the current user group according to the configuration information and the number of used instances; The requesting user is added to the instance resource queue corresponding to the available instance.
2. The instance resource scheduling method according to claim 1, characterized in that: Before the step of determining the current user group to which the requesting user belongs when receiving the instance resource calling request sent by the requesting user, the step further includes: Get the number of input users of each user group and the number of service users of each instance; Determine the instance upper limit and instance lower limit of each user group according to the number of input users of each user group and the number of service users of each instance; The configuration information of each user group is generated according to the instance upper limit value and the instance lower limit value of each user group.
3. The instance resource scheduling method according to claim 2, characterized in that: The step of determining the instance upper limit and instance lower limit of each user group according to the number of input users of each user group and the number of service users of each instance includes: Obtaining priority information of each user group, and determining an instance value calculation strategy corresponding to each user group according to the priority information; The instance upper limit value and the instance lower limit value of each user group are determined according to the number of input users of each user group, the number of service users of each instance, and the instance value calculation strategy.
4. The instance resource scheduling method according to claim 1, characterized in that: The configuration information includes: an instance lower limit value; the step of determining the available instances of the current user group according to the configuration information and the number of used instances includes: Extracting the instance lower limit value corresponding to the current user group from the configuration information; When the number of used instances is less than the instance lower limit, the exclusive instance corresponding to the current user group is used as the available instance of the current user group, and the exclusive instance is an instance occupied by each user group separately.
5. The instance resource scheduling method according to claim 4, characterized in that: The configuration information further includes: an instance upper limit value; after the step of extracting the instance lower limit value corresponding to the current user group from the configuration information, the step further includes: When the number of used instances is greater than or equal to the instance lower limit, extracting the instance upper limit corresponding to the current user group from the configuration information; When the number of used instances is less than the instance upper limit, a shared instance is used as an available instance of the current user group, and the shared instance is an instance shared by each user group.
6. The instance resource scheduling method according to claim 5, characterized in that: The step of using the shared instance as the available instance for the current user group when the number of used instances is less than the instance upper limit value includes: When the number of used instances is less than the instance upper limit, determining the number of shared instances according to the instance lower limit of each user group; When the number of shared instances is greater than a preset threshold, the shared instances are used as available instances for the current user group.
7. An instance resource scheduling device, characterized in that: The instance resource scheduling device comprises: a memory, a processor, and an instance resource scheduling program stored in the memory and executable on the processor. When the instance resource scheduling program is executed by the processor, the instance resource scheduling method according to any one of claims 1 to 6 is implemented.
8. A storage medium, characterized in that: The storage medium stores an instance resource scheduling program, and when the instance resource scheduling program is executed by the processor, the instance resource scheduling method according to any one of claims 1 to 6 is implemented.
9. An instance resource scheduling device, characterized in that: The instance resource scheduling device comprises: a user group determination module, an information acquisition module, an instance determination module and a user adding module; The user group determination module is used to determine the current user group to which the requesting user belongs when receiving an instance resource call request sent by the requesting user; The information acquisition module is used to acquire the configuration information and the number of used instances of the current user group, wherein the configuration information is pre-generated based on the number of input users of the current user group and the number of service users of each instance, wherein acquiring the number of input users of each user group and the number of service users of each instance comprises: acquiring the average number of input users per unit time of each user group and the average number of service users per unit time of each instance; determining user change information according to the average number of input users per unit time, and segmenting the preset time according to the user change information to obtain a plurality of time periods; determining the number of input users corresponding to each time period according to the average number of input users per unit time, and determining the number of service users corresponding to each time period according to the average number of service users per unit time; The instance determination module is used to determine the available instances of the current user group according to the configuration information and the number of used instances; Therefore, the user adding module is used to add the requesting user to the instance resource queue corresponding to the available instance.
Citation Information
Patent Citations
Dynamic resource scheduling method for large-scale computing clusters
CN107423134A