Cloud phone resource allocation method, electronic device and computer readable storage medium
By obtaining the historical resource usage and service package limits of cloud phones, and using a target resource prediction model to dynamically adjust resource allocation, the problem of unsatisfactory resource allocation results of cloud phones has been solved, achieving more accurate and flexible resource allocation, and improving user experience and resource utilization.
Patent Information
- Application Number
- CN202411647464.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2044-11-18
AI Technical Summary
Existing cloud phone resource allocation methods suffer from poor resource allocation results, leading to resource waste and a poor user experience.
By acquiring the historical resource usage of cloud phones, using a target resource prediction model to predict future resource usage, and combining this with the resource cap of the service package, resource allocation is dynamically adjusted to achieve more accurate and flexible resource allocation.
It improved the accuracy of resource allocation, avoided resource waste, enhanced user experience, and increased resource utilization.
Smart Images

Figure CN119696940B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the Internet field, and specifically relates to a method for allocating cloud mobile phone resources, an electronic device, and a computer-readable storage medium. Background Technology
[0002] A cloud phone is a cloud-based mobile phone using virtualization technology. Various applications run in the cloud, significantly reducing the consumption of local resources on a physical mobile phone. Currently, cloud phones are finding increasingly diverse applications, including gaming, office work, education, video streaming, and live broadcasting. For cloud phone services, the efficient allocation of resources is crucial.
[0003] Related technologies typically allocate fixed resources to users of cloud phone services based on cloud phone service packages. This resource allocation method has the problem of unsatisfactory resource allocation results. Summary of the Invention
[0004] This application provides a method for allocating cloud phone resources, an electronic device, and a computer-readable storage medium, which can solve the problem of unsatisfactory resource allocation results in the resource allocation methods used in related technologies.
[0005] In a first aspect, embodiments of this application provide a method for allocating cloud phone resources, the method comprising:
[0006] Obtain the first historical resource usage of the first cloud phone, where the first historical resource usage is the amount of resources used by the first cloud phone within a historical time period.
[0007] Based on the first historical resource usage and the target resource prediction model, the target resource usage of the first cloud phone is predicted within a target time period, wherein the target time period is after the historical time period.
[0008] Obtain the first resource limit value of the first cloud phone, which is based on the service package of the first cloud phone;
[0009] Based on the target resource usage and the first resource limit, the amount of resources used by the first cloud phone within the target time period is allocated.
[0010] In a second aspect, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0011] Thirdly, embodiments of this application provide a computer-readable storage medium on which a program or instructions are stored, which, when executed, implement the steps of the method described in the first aspect.
[0012] Fourthly, embodiments of this application provide a computer program product comprising a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0013] The at least one technical solution provided in the embodiments of this application can achieve the following technical effects:
[0014] In this embodiment, the first historical resource usage of a first cloud phone is obtained, which is the amount of resources used by the first cloud phone within a historical time period. Based on the first historical resource usage and a target resource prediction model, the target resource usage of the first cloud phone within a target time period is predicted, where the target time period is after the historical time period. A first resource upper limit value for the first cloud phone is obtained, which is derived based on the service package of the first cloud phone. Based on the target resource usage and the first resource upper limit value, the resources used by the first cloud phone within the target time period are allocated. Thus, the target resource usage of the first cloud phone within a target time period can be predicted based on the first historical resource usage within the historical time period. Then, the resources used by the first cloud phone within the target time period are allocated using the target resource usage and the first resource upper limit value derived from the service package of the first cloud phone. Compared to the fixed resource allocation method used in related technologies, this allocation method allocates resources within the target time period based on the predicted resource usage within the target time period, resulting in more accurate resource allocation and more flexible resource allocation, thus solving the problem of unsatisfactory resource allocation results in related technologies. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a method for allocating cloud phone resources according to an embodiment of this application;
[0017] Figure 2This is a flowchart of another cloud phone resource allocation method provided in an embodiment of this application;
[0018] Figure 3 This is a schematic diagram of a target resource prediction model provided in an embodiment of this application;
[0019] Figure 4 This is a schematic diagram of a residual structure provided in an embodiment of this application;
[0020] Figure 5 This is a flowchart of another cloud phone resource allocation method provided in an embodiment of this application;
[0021] Figure 6 This is a flowchart of another cloud phone resource allocation method provided in an embodiment of this application;
[0022] Figure 7 This is a flowchart illustrating a method for allocating cloud phone resources according to an embodiment of this application.
[0023] Figure 8 This is a structural block diagram of a cloud phone resource allocation device provided in an embodiment of this application;
[0024] Figure 9 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0027] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0028] The cloud phone resource allocation method provided in this application is applied to cloud phone services, specifically, it can be used to allocate the amount of resources used by a cloud phone within a target time period. Specifically, based on the first historical resource usage of the first cloud phone during a historical time period, the target resource usage of the first cloud phone in a target time period after the historical time period can be predicted. Then, the amount of resources used by the first cloud phone within the target time period is allocated using the target resource usage and a first resource ceiling value obtained based on the first cloud phone's service package.
[0029] The cloud phone resource allocation method provided in this application embodiment can be executed by a target device, which can be a single electronic device or multiple electronic devices. That is, the cloud phone resource allocation method provided in this application embodiment can be executed by a single electronic device, which can be a server, such as an independent physical server, a server cluster consisting of multiple servers, or a cloud server capable of cloud computing. When the cloud phone resource allocation method provided in this application embodiment is executed by multiple electronic devices, these multiple electronic devices can form a service cluster, and they cooperate to complete each step.
[0030] The method for allocating cloud phone resources provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for allocating cloud phone resources according to an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps:
[0032] Step 110: Obtain the first historical resource usage of the first cloud phone, where the first historical resource usage is the amount of resources used by the first cloud phone within a historical time period.
[0033] In this embodiment, the first historical resource usage may include the historical resource usage collected by the first cloud phone at each sampling point within a historical time period. For example, the historical time period may be one day, with one minute as a sampling point, then one day includes historical resource usage collected at 1440 sampling points. The historical resource usage may be resource usage related to the operation of the cloud phone, such as memory usage and CPU usage. At each sampling point, CPU usage and memory usage in the first cloud phone can be collected separately. This usage is an average value over one minute, forming a sequence of CPU usage. Memory usage sequence , where i is a positive integer less than or equal to n, and n = 1440.
[0034] Step 120: Based on the first historical resource usage and the target resource prediction model, predict the target resource usage of the first cloud phone within a target time period, wherein the target time period is after the historical time period.
[0035] In this embodiment, the target resource prediction model can be a deep learning model used to predict the resource usage of the cloud phone within a target time period. By inputting the first historical resource usage of the first cloud phone within a historical time period into the target resource prediction model, the target resource prediction model can predict the target resource usage of the first cloud phone within a target time period after the historical time period. The target resource usage includes the predicted resource usage of the first cloud phone at each sampling point within the target time period, and the predicted resource usage can be resource usage related to the operation of the cloud phone, such as memory usage and CPU usage.
[0036] Step 130: Obtain the first resource limit value of the first cloud phone, which is based on the service package of the first cloud phone.
[0037] In this embodiment, before allocating resources to the first cloud phone, the service package of the first cloud phone can be queried and the first resource limit value of the first cloud phone can be obtained. During the allocation of resources used by the first cloud phone within a target time period, the first resource limit value of the first cloud phone can be considered to avoid significant differences from the service package of the first cloud phone, which could lead to a poor user experience or hinder the promotion of cloud phone packages.
[0038] Step 140: Based on the target resource usage and the first resource limit, allocate the amount of resources used by the first cloud phone within the target time period.
[0039] In this embodiment of the application, the target resource usage of the first cloud phone within the target time period, predicted by the target resource prediction model, and the first resource limit value agreed upon in the service package of the first cloud phone, can be used to allocate the amount of resources used by the first cloud phone within the target time period. This ensures that the amount of resources acquired by the first cloud phone within the target time period is used as much as possible to avoid resource waste, and at the same time, it avoids problems such as lag and crashes during the operation of the first cloud phone, thereby improving the user's cloud phone experience.
[0040] In this embodiment, the first historical resource usage of a first cloud phone is obtained, which is the amount of resources used by the first cloud phone within a historical time period. Based on the first historical resource usage and a target resource prediction model, the target resource usage of the first cloud phone within a target time period is predicted, where the target time period is after the historical time period. A first resource upper limit value for the first cloud phone is obtained, which is derived based on the service package of the first cloud phone. Based on the target resource usage and the first resource upper limit value, the resources used by the first cloud phone within the target time period are allocated. Thus, the target resource usage of the first cloud phone within a target time period can be predicted based on the first historical resource usage within the historical time period. Then, the resources used by the first cloud phone within the target time period are allocated using the target resource usage and the first resource upper limit value derived from the service package of the first cloud phone. Compared to the fixed resource allocation method used in related technologies, this allocation method allocates resources within the target time period based on the predicted resource usage within the target time period, resulting in more accurate resource allocation and more flexible resource allocation, thus solving the problem of unsatisfactory resource allocation results in related technologies.
[0041] Please see Figure 2 , Figure 2 This is a flowchart illustrating another method for allocating cloud phone resources provided in an embodiment of this application. For example... Figure 2 As shown, the method includes the following steps:
[0042] Step 210: Obtain the first historical resource usage of the first cloud phone, where the first historical resource usage is the amount of resources used by the first cloud phone within a historical time period.
[0043] Step 220: Input the first historical resource usage into the nonlinear network to obtain the first processing result of the first cloud phone within the target time period.
[0044] In this embodiment, the target resource prediction model includes a nonlinear network and a linear network. The nonlinear network and the linear network can be used to predict the resource usage of the first cloud phone during a target time period from different dimensions. (See also...) Figure 3 , Figure 3 This is a schematic diagram of a target resource prediction model provided in an embodiment of this application. For example... Figure 3 As shown, the nonlinear network can be, for example... Figure 3 The network of the left branch in the middle.
[0045] In one embodiment of this application, the historical time period includes M historical time intervals, and the first historical resource usage includes the historical resource usage of the M historical time intervals; the nonlinear network includes M Long Short Term Memory (LSTM) networks and Multi-Layer Perceptron (MLP) networks, and the linear network includes an Autoregressive Model (AR Model), where M is an integer greater than 1. Step 220, which involves inputting the first historical resource usage into the nonlinear network to obtain the first processing result of the first cloud phone within the target time period, includes: inputting the historical resource usage of the i-th historical time interval from the M historical time intervals into the i-th LSTM of the M LSTM networks to obtain the i-th feature extraction result; where i is a positive integer and i is less than or equal to M; obtaining M feature extraction results from the historical resource usage of the M historical time intervals; and inputting the M feature extraction results into the MLP to obtain the first processing result of the first cloud phone within the target time period.
[0046] In this embodiment of the application, the historical time period can be divided into M historical time intervals, and the M historical time intervals are of equal length. For any historical time interval within the M historical time intervals, the historical resource usage within that historical time interval includes the resource usage collected from P sampling points. For example... Figure 3 As shown, the historical resource usage matrix can be obtained by sorting the M historical time intervals in chronological order. Figure 3 The matrix shown is illustrated. In this matrix, one row represents the historical resource usage for a given time interval, and different columns represent the resource usage collected at different sampling points.
[0047] Before inputting the historical resource usage of the i-th historical time interval from the M historical time intervals into the i-th LSTM of the M LSTMs to obtain the i-th feature extraction result, short-term feature extraction in the time dimension can be performed on the historical resource usage of the i-th historical time interval. For example... Figure 3 As shown, the nonlinear network may further include a first block unit, a second block unit, a third block unit, a fourth block unit, and a fifth block unit. Figure 3 The system consists of blocks 1, 2, 3, 4, and 5, and an Atrous Spatial Pyramid Pooling (ASPP) layer. The first block unit comprises a convolutional layer, the second block unit comprises a max pooling layer and three residual structures, the third block unit comprises three residual structures, the fourth block unit comprises four residual structures, and the fifth block unit comprises four residual structures.
[0048] The residual structure can be referenced. Figure 4 , Figure 4 This is a schematic diagram of a residual structure provided in an embodiment of this application. For example... Figure 4 As shown, this residual structure is used for input data with a dimension of 64, including two 3×3×64 convolutional kernels, with a total of 64 kernels.
[0049] In this embodiment, the five block units described above can be used to extract short-term features in the time dimension through local dependencies between variables. The ASPP layer can use multiple parallel dilated convolutions with different sampling rates. The features extracted at each sampling rate are further processed in a separate branch and fused to generate the final result. That is, a given input can be sampled in parallel with dilated convolutions at different sampling rates, which is equivalent to capturing the context of the image at multiple scales. Each dilated convolution obtains a larger receptive field, which is more effective for detecting large-sized targets. The ASPP layer can construct convolution kernels with different receptive fields through different dilation rates to achieve multi-scale feature extraction.
[0050] In this embodiment, the historical resource usage matrix of the first cloud phone can be sequentially input into five basic units for short-term feature extraction, and then input into the ASPP layer for multi-scale feature extraction. During the input of the historical resource usage matrix into the nonlinear network, the historical resource usage for one historical time interval can be input at a time, that is, one row of the historical resource usage matrix can be input at a time (e.g., ...). Figure 4 shown , , as well as This yields short-term feature extraction results for M historical time intervals.
[0051] For the i-th historical time interval out of M historical time intervals, the short-term feature extraction result of the i-th historical time interval can be input into the i-th LSTM network among the M LSTMs to obtain the i-th feature extraction result. The LSTM network can be used to learn long-term dependency information and is suitable for processing and predicting important events with relatively long intervals and delays in time series.
[0052] like Figure 3 As shown, there is a one-to-one correspondence between the M historical time intervals and the M LSTM networks. Furthermore, there is a chain dependency among the M LSTM networks; that is, one input to a later LSTM network is one output of an earlier LSTM network. For example... Figure 3 As shown, The network output can be used as Network input, The network output can be used as The network input. In other words, the historical resource usage within each historical time interval on the first cloud phone can be extracted using an independent LSTM network to obtain the features extracted from M historical time intervals through M LSTM networks. .
[0053] After obtaining the hidden features extracted by M LSTM networks Then, the various latent features can be input into the MLP to obtain the first processing result. This first processing result is the predicted resource usage of the first cloud phone within the target time period, obtained based on a nonlinear network. For example... Figure 3 In .
[0054] Step 230: Input the first historical resource usage into a linear network to obtain the second processing result of the first cloud phone within the target time period.
[0055] In this embodiment of the application, the linear network may be as follows: Figure 3 The network structure of the right branch shown can include an AR model. The AR model is a process of using itself as a regression variable; that is, it uses a linear combination of random variables from several earlier time points to describe a linear regression model of random variables from a later time point. The AR model can be used to process time series data. The expression for the AR model is shown below:
[0056] ;
[0057] in, This is the second processing result. Let a be the (M+1-i)th historical time interval, where a is a constant term. For natural correlation numbers, Assuming the mean can be zero, the standard deviation is equal to The random error value, This remains unchanged for any time interval.
[0058] In this embodiment, a historical resource usage matrix can be input into an AR model to obtain a second processing result. This second processing result is a predicted resource usage of the first cloud phone within a target time period, obtained based on a linear network. For example... Figure 3 In As can be seen from the above formula, the second processing result is obtained by adding a constant term and random error to the linear combination of the resource usage of the first cloud phone in M historical time intervals. This method requires less resources, can use its own resource usage sequence for prediction, has low computational load and is easy to operate.
[0059] Step 240: Input the first processing result and the second processing result into the fully connected layer to obtain the target resource usage of the first cloud phone within the target time period.
[0060] In this embodiment, the first processing result and the second processing result have the same dimension. The first and second processing results can be concatenated according to their dimensions to obtain a concatenated result. Then, the concatenated result can be input into a fully connected layer to obtain the target resource usage of the first cloud phone within a target time period, for example... Figure 3 In .
[0061] Step 250: Obtain the first resource limit value of the first cloud phone, which is based on the service package of the first cloud phone.
[0062] Step 260: Based on the target resource usage and the first resource limit, allocate the amount of resources used by the first cloud phone within the target time period.
[0063] In this application embodiment, a resource prediction method that integrates nonlinear and linear networks is provided. By predicting the resource usage of a first cloud mobile phone within a target time period from different dimensions, the resource prediction results are more accurate.
[0064] Please see Figure 5 , Figure 5 This is a flowchart illustrating another method for allocating cloud phone resources provided in an embodiment of this application. For example... Figure 5 As shown, the method includes the following steps:
[0065] Step 510: Obtain the first historical resource usage of the first cloud phone, where the first historical resource usage is the amount of resources used by the first cloud phone within a historical time period.
[0066] Step 520: Based on the first historical resource usage and the target resource prediction model, predict the target resource usage of the first cloud phone within a target time period, wherein the target time period is after the historical time period.
[0067] Step 530: Obtain the first resource limit value of the first cloud phone, which is obtained based on the service package of the first cloud phone.
[0068] In this embodiment of the application, the service package of the first cloud phone can be queried, the upper limit of CPU usage and the upper limit of memory usage of the first cloud phone can be determined, and the upper limit of CPU usage and the upper limit of memory usage of the first cloud phone can be merged to obtain the first resource upper limit of the first cloud phone.
[0069] In this embodiment, after obtaining the first resource limit value of the first cloud phone, it can be determined whether the service package of the first cloud phone can provide sufficient resources to the first cloud phone based on the predicted target resource usage and the first resource limit value. That is, it can be determined whether the target resource usage is less than the first resource limit value of the first cloud phone. If the target resource usage is less than the first resource limit value of the first cloud phone, step 540 can be executed; if the target resource usage is greater than or equal to the first resource limit value of the first cloud phone, step 550 can be executed.
[0070] Step 540: Determine the first amount of resources used by the first cloud phone within the target time period, wherein the first amount of resources is less than the first resource upper limit; allocate the first amount of resources to the first cloud phone.
[0071] If the target resource usage is less than the first resource limit of the first cloud phone, it can be determined that the current service package of the first cloud phone is sufficient to provide the corresponding resources, and there may even be idle resources in the service package of the first cloud phone. At this time, in order to avoid resource waste and improve resource utilization, the first resource amount used by the first cloud phone within the target time period is determined to be less than the first resource limit, and the first resource amount is allocated to the first cloud phone.
[0072] It is important to note that the first resource quantity here can be greater than or equal to the minimum resource quantity, which is determined based on the first cloud phone's capacity reduction limit and first resource limit. For example, if the first cloud phone's capacity reduction limit is 10% and its first resource limit is 10G, then the minimum resource quantity can be 10 × (1 - 10%) = 9G. In other words, the first resource quantity cannot be less than 9G.
[0073] In one embodiment of this application, the target time period includes a first time interval, and the resource usage of the first cloud phone within the first time interval is less than the first resource upper limit. Determining the first resource usage of the first cloud phone within the target time period includes: determining a first deviation rate of the first cloud phone within the first time interval, the first deviation rate being obtained based on a first target average value and the first resource upper limit; the first target average value being the average of the resource usage of the first cloud phone at multiple time points within the first time interval; and determining the first resource usage of the first cloud phone within the first time interval based on the first deviation rate.
[0074] In this embodiment, to achieve more targeted resource allocation, a first time interval can be determined from the target time period. The resource usage of the first cloud phone within the first time interval is less than the first resource upper limit. The number of first time intervals can be one or multiple. The target time period may include N time points, where N is an integer greater than 1. The target resource usage includes the resource usage of the first cloud phone at the N time points. The first time interval is obtained by clustering the time points among the N time points where the resource usage is less than the first resource upper limit.
[0075] In this embodiment, the target resource usage may include the resource usage of the first cloud phone at N time points. Time points where the resource usage is less than a first resource upper limit can be marked to obtain a first marking result. Then, the multiple time points included in the first marking result can be clustered according to time. No restriction is placed on the clustering algorithm; for example, a density-based clustering method with noise (Density-Based Spatial Clustering of Applications with Noise, DBSCAN) can be used to obtain A clustering results. Each of the A clustering results can correspond to a first time interval. The first time interval corresponding to the clustering result can be obtained based on the most recent and furthest times in the clustering results.
[0076] After determining the first time interval within the target time period, the first deviation rate of the first cloud phone within the first time interval can be determined. Based on the first deviation rate, the first amount of resources used by the first cloud phone within the first time interval can be reduced accordingly to avoid resource waste and improve resource utilization. For example, if the deviation rate is 10%, the resource usage can be reduced by 10% based on the first resource limit.
[0077] The first deviation rate is derived from a first target average value and a first resource limit value. The first target average value is the average resource usage of the first cloud phone at multiple time points within a first time interval. Specifically, the difference between the first target average value and the first resource limit value can be determined, and the ratio of this difference to the first resource limit value is defined as the first deviation rate. For example, if the first target average value is 8G and the first resource limit value is 10G, the first deviation rate is 20%. In this case, the resource usage can be reduced by 20% from the first resource limit value to obtain the first resource amount.
[0078] In one embodiment of this application, after determining the first amount of resources used by the first cloud phone within a target time period, the cloud phone resource allocation method includes, in addition to steps 510 to 550, steps 510 to 550: determining a first difference between the first amount of resources and the first resource upper limit, and using the first difference as the amount of resources reduced by the first cloud phone within the target time period; based on the first difference, increasing the overdraft limit of the first cloud phone, wherein the overdraft limit is the amount of resources that the first cloud phone can still overdraft even when the resource usage of the first cloud phone exceeds the first resource upper limit.
[0079] In this application embodiment, a concept of overdraft is proposed. When reducing the resource usage of a first cloud phone within a target time period, a first difference can be determined between the first resource amount (actual resource usage) and the first resource limit. Based on this first difference, the overdraft of the first cloud phone is increased. In other words, the reduced resource usage can be converted into overdraft, which is the amount of resources the first cloud phone can still use even when its resource usage exceeds the first resource limit. Simply put, this overdraft is similar to the concept of a bank deposit; if there is a balance, it can be converted into a deposit, and the deposit can be withdrawn and used when there is no balance.
[0080] In this embodiment, the first difference portion of the reduced usage of the first cloud phone can be used by other cloud phones with insufficient resources, which can improve the overall user experience of cloud phone users and increase the overall utilization rate of cloud phone resources.
[0081] In one embodiment of this application, the first cloud phone is set on a target server; increasing the overdraft amount of the first cloud phone based on the first difference includes: obtaining the operating status of the target server, the operating status including a busy state and an idle state; when the target server is in a busy state, increasing the first overdraft amount based on the first difference; when the target server is in an idle state, increasing the second overdraft amount based on the first difference; wherein, the first overdraft amount is greater than the second overdraft amount.
[0082] Among them, the overall resource usage of the target server in a busy state is greater than or equal to the overall resource threshold, while the overall resource usage of the target server in an idle state is less than the overall resource threshold.
[0083] In this embodiment, the reduced resource usage of the first cloud phone can be used by other cloud phones. During the process of increasing the overdraft capacity of the first cloud phone based on its reduced resource usage, the target server may be in a busy or idle state. When the target server is busy, the reduced resource usage of the first cloud phone is highly likely to be utilized by other cloud phones and has high value; when the target server is idle, the reduced resource usage of the first cloud phone may not be utilized by any cloud phone and has relatively low value.
[0084] Based on this, this application proposes a resource equivalence principle: the increased resource usage of the first cloud phone during the target time period is shared by other cloud phones, and the reduced resource usage of the first cloud phone during the target time period can be shared with other cloud phones. Simultaneously, the overdraft amount increased based on the same first difference is dynamically adjusted when the target server is in a busy or idle state. Specifically, the first overdraft amount increased when the target server is busy is greater than the second overdraft amount increased when the target server is idle.
[0085] Step 550: Determine the second resource amount used by the first cloud phone within the target time period, wherein the second resource amount is greater than or equal to the first resource upper limit; allocate the second resource amount to the first cloud phone.
[0086] If the target resource usage exceeds the first resource limit of the first cloud phone, it can be determined that the current service package of the first cloud phone is insufficient to provide the corresponding resources. In this case, to avoid problems such as lag and crashes during the operation of the first cloud phone within the target time period, a second resource amount exceeding the first resource limit can be determined for the first cloud phone within the target time period, and the second resource amount can be allocated to the first cloud phone.
[0087] In one embodiment of this application, the target time period includes a second time interval, and the resource usage of the first cloud phone in the second time interval is greater than or equal to the first resource upper limit value; determining the second resource usage of the first cloud phone in the target time period includes: determining a second deviation rate of the first cloud phone in the second time interval, the second deviation rate being obtained based on a second target average value and the first resource upper limit value; the second target average value being the average of the resource usage of the first cloud phone at multiple time points in the second time interval; and determining the second resource usage of the first cloud phone in the second time interval based on the second deviation rate.
[0088] In this embodiment, the target time period may include a first time interval and a second time interval. The details of the first time interval can be found in the description of step 540 above; here, only the second time interval will be described in detail. The target time period includes N time points, where N is an integer greater than 1. The target resource usage includes the resource usage of the first cloud phone at the N time points. The second time interval is obtained by clustering the time points among the N time points where the resource usage is greater than or equal to the first resource upper limit value.
[0089] In this embodiment, the target resource usage may include the resource usage of the first cloud phone at N time points. Time points where the resource usage is greater than or equal to a first resource upper limit can be marked to obtain a second marking result. Then, the multiple time points included in the second marking result can be clustered according to time. No restriction is placed on the clustering algorithm; for example, the DBSCAN clustering algorithm can be used to obtain B clustering results. Each of the B clustering results can correspond to a second time interval. The second time interval corresponding to the clustering result can be obtained based on the most recent and furthest times in the clustering results.
[0090] After determining the second time interval within the target time period, a second deviation rate of the first cloud phone within the second time interval can be determined. Based on the second deviation rate, the resource usage of the first cloud phone within the second time interval is increased accordingly to avoid resource waste and improve resource utilization. For example, if the second deviation rate is 10%, the resource usage can be increased by 10% based on the first resource limit.
[0091] The second deviation rate is derived from a second target average value and a first resource limit value. The second target average value is the average resource usage of the first cloud phone at multiple time points within a second time interval. Specifically, the difference between the second target average value and the first resource limit value can be determined, and the ratio of this difference to the first resource limit value is defined as the second deviation rate. For example, if the second target average value is 12G and the first resource limit value is 10G, then the second deviation rate is 20%, meaning that resource usage can be increased by 20% based on the first resource limit value.
[0092] However, considering the promotion of different cloud phone service packages, the increase in resource usage may be limited. For example, in one embodiment of this application, determining the second amount of resources used by the first cloud phone within the second time interval based on the second deviation rate includes: obtaining the current overdraft amount and overdraft limit of the first cloud phone; and determining the second amount of resources used by the first cloud phone within the second time interval based on the second deviation rate, the overdraft amount, and the overdraft limit.
[0093] In this embodiment, the overdraft limit of the first cloud phone can be determined based on its service package. Generally, the higher the service package level of the cloud phone, the larger the overdraft limit, for example, 30%; the lower the service package level of the cloud phone, the smaller the overdraft limit, for example, 10%.
[0094] If the second deviation rate is greater than the overdraft limit, the overdraft limit is used to determine the second amount of resources used by the first cloud phone in the second time interval. For example, if the target resource usage of the first cloud phone is 12GB, the first package limit of the first cloud phone is 10GB, and the overdraft limit of the first cloud phone is 10%, and the second deviation rate of the first cloud phone is 20%, which is greater than the overdraft limit, then based on the overdraft limit, the resource usage of the first cloud phone in the second time interval is increased, meaning the second resource amount is 11GB.
[0095] If the second deviation rate is less than or equal to the overdraft limit, the second amount of resources used by the first cloud phone within the second time interval can be determined based on the second deviation rate and the current overdraft amount of the first cloud phone. Specifically, the amount of supplementary resources can be determined based on the second deviation rate, and it can be determined whether the amount of supplementary resources is less than or equal to the current overdraft amount. For example, if the first resource limit is 10G and the second deviation rate is 10%, then the amount of supplementary resources is 1G.
[0096] If the replenished resource amount is less than or equal to the current overdraft amount, the sum of the first resource limit and the replenished resource amount can be determined as the second resource amount. For example, if the replenished resource amount is 1G, the current overdraft amount is 2G, and the first resource limit is 10G, then the second resource amount is 11G. If the replenished resource amount is greater than the current overdraft amount, the sum of the first resource limit and the current overdraft amount can be determined as the second resource amount. For example, if the replenished resource amount is 2G, the current overdraft amount is 1G, and the first resource limit is 10G, then the second resource amount is 11G.
[0097] In one embodiment of this application, the cloud phone resource allocation method includes, in addition to steps 510 to 550, steps 510 to 550, steps 510 and 550, respectively: recording the number of times the first cloud phone appears in the second time interval; and, if the number of times exceeds a preset number, pushing cloud phone service package upgrade information to the first cloud phone.
[0098] In this embodiment, if the first cloud phone frequently experiences the second time interval, it indicates that the current service package of the first cloud phone cannot meet its operational needs. In this case, a cloud phone service package upgrade message can be pushed to the first cloud phone. Furthermore, if the number of times the second time interval occurs exceeds a preset number, a target number of times the second deviation rate exceeds the overdraft limit can be recorded. If the target number exceeds the preset overdraft number, then a cloud phone service package upgrade message is pushed to the first cloud phone to avoid frequent pushes.
[0099] In one embodiment of this application, after determining the second amount of resources used by the first cloud phone within a target time period, the cloud phone resource allocation method includes, in addition to steps 510 to 550, steps 510 to 550: determining a second difference between the second amount of resources and the first resource limit value, and using the second difference as the additional amount of resources used by the first cloud phone within the target time period; based on the second difference, reducing the overdraft amount of the first cloud phone, wherein the overdraft amount is the amount of resources that the first cloud phone can still overdraft and use even when the resource usage of the first cloud phone exceeds the first resource limit value.
[0100] In this embodiment, increasing the resource usage of the first cloud phone within a target time period is achieved by exchanging the resource usage for the first cloud phone's overdraft. Therefore, after determining the resource usage of the first cloud phone within the target time period, the overdraft of the first cloud phone can be reduced accordingly to complete the overdraft settlement. Specifically, a second difference between the second resource amount and the first resource limit can be determined, and based on this second difference, the overdraft of the first cloud phone can be reduced. For example, if the overdraft of the first cloud phone is 3G, the second resource amount is 11G, and the first resource limit is 10G, the second difference is 1G, and the overdraft of the first cloud phone can be reduced from 3G to 2G.
[0101] In one embodiment of this application, the first cloud phone is set on a target server; reducing the overdraft amount of the first cloud phone based on the second difference includes: obtaining the operating status of the target server, the operating status including a busy state and an idle state; when the target server is in a busy state, reducing the third overdraft amount based on the second difference; when the target server is in an idle state, reducing the fourth overdraft amount based on the second difference; wherein the third overdraft amount is greater than the fourth overdraft amount.
[0102] In this embodiment, since the target server provides the resources required for the first cloud phone's operation, the target server may be in a busy or idle state during the process of increasing the resource usage of the first cloud phone based on the overdraft limit. The difficulty of allocating more resources to the first cloud phone when the target server is busy differs from the difficulty of allocating more resources when the target server is idle. Specifically, the overall resource usage of the target server in a busy state is greater than or equal to the overall resource threshold, while the overall resource usage of the target server in an idle state is less than the overall resource threshold.
[0103] Based on this, this application proposes a resource equivalence principle: the increased resource usage of the first cloud phone during the target time period is shared by other cloud phones, and the reduced resource usage of the first cloud phone during the target time period can be shared with other cloud phones. Simultaneously, the overdraft amount reduced based on the same second difference is dynamically adjusted when the target server is in a busy or idle state. Specifically, the third overdraft amount reduced when the target server is busy is greater than the fourth overdraft amount reduced when the target server is idle.
[0104] It's important to note that achieving a closed-loop resource system through resource sharing between individual cloud phones is difficult. Therefore, cloud phone vendors can also participate in resource sharing. When the target server is busy, they can share certain resources with it to increase the flow of resources. Simultaneously, when the target server is idle, they can exchange resources for offline computing, further improving the overall efficiency of resource scheduling.
[0105] In this embodiment of the application, when the target resource usage is less than the first resource upper limit, a first resource amount less than the first resource upper limit is allocated to the first cloud phone; when the target resource usage is greater than or equal to the first resource upper limit, a second resource amount greater than or equal to the first resource upper limit is allocated to the first cloud phone, providing a method for dynamically adjusting cloud server resources, which can fully leverage the performance advantages of the cloud.
[0106] Please see Figure 6 , Figure 6 This is a flowchart illustrating another method for allocating cloud phone resources provided in an embodiment of this application. For example... Figure 6 As shown, the method includes the following steps:
[0107] Step 610: Determine the target time interval of the first cloud phone within the historical time period; wherein, the resource usage of the first cloud phone within the target time interval is greater than or equal to a first threshold.
[0108] In this embodiment, the first threshold is determined based on the first resource limit of the first cloud phone. The first threshold can be the first resource limit of the target ratio, for example, 90% of the first resource limit. In fact, if the cloud phone's resource usage reaches the first resource limit of the target ratio, it indicates that the cloud phone has reached its performance limit. That is, the first cloud phone has reached its performance limit within the target time interval. At this time, the operating system may perform peak-shaving behavior, such as reducing the frequency or closing background applications, to ensure the normal operation of the cloud phone. This situation can lead to inaccurate historical resource usage data, which may be lower than the actual resource usage required during the historical time period. To ensure that the target resource prediction model can accurately extract features from historical data, the historical resource usage of the first cloud phone within the target time interval can be fitted to obtain more accurate historical data.
[0109] In determining the target time interval for the first cloud phone within a historical time period, a sliding window approach can be used. Specifically, the following method can be employed: First, obtain the initial time interval length L0. Then, slide the initial time interval across the historical time period to determine the initial time interval. The average historical resource usage collected at each time point within this initial time interval is greater than or equal to a first threshold. Next, further extend the initial time interval based on a preset extension length, i.e., extend the upper and lower limits of the initial time interval, until the average historical resource usage collected at each time point within the initial time interval is less than the first threshold, thus obtaining the target time interval. Through this method, the target time interval for reaching the performance limit within a historical time period can be determined. The historical time period may include one or more target time intervals.
[0110] For example, if the initial time interval length is 5 and the extended length is 2, and after three consecutive moves, the average historical resource usage collected at each time point within the initial time interval is found to be greater than or equal to a first threshold, until the fourth move finds that the historical resource usage collected at each time point within the initial time interval is less than the first threshold, then we can conclude that the first move determines the initial time interval, and the second and third moves further extend the initial time interval, with the target time interval length L = 5 + 2 + 2 = 9.
[0111] Step 620: Obtain the second historical resource usage of multiple second cloud phones within the target time interval; wherein the second historical resource usage is less than a second threshold.
[0112] In this embodiment, the resource usage of the first cloud phone within the target time interval can be fitted by obtaining the second historical resource usage of the second cloud phone within that time interval. The second historical resource usage of the second cloud phone within the target time interval is data without peak-shaving behavior, meaning it is relatively accurate. Therefore, the resource usage of the first cloud phone within the target time interval, which may exhibit peak-shaving behavior, can be fitted using the second historical resource usage of the second cloud phone without peak-shaving behavior.
[0113] Specifically, the second historical resource usage of the second cloud phone is less than a second threshold. This second threshold is determined based on the second resource upper limit of the second cloud phone, which is derived from the service package of the second cloud phone. The second threshold can be the second resource upper limit of the target ratio. For example, the second threshold can be 90% of the second resource upper limit.
[0114] In one embodiment of this application, the similarity between the first process of the first cloud phone within the target time interval and the second processes of the plurality of second cloud phones within the target time interval is greater than a similarity threshold.
[0115] In this embodiment, the first process includes processes or threads of the first cloud phone whose resource utilization rate is greater than a third threshold within a target time interval. The third threshold can be preset, for example, 0.9. Processes of the first cloud phone within the target time interval can be obtained, and processes with resource utilization rates greater than the third threshold can be selected from them. For the second cloud phone, K processes of the second cloud phone within the target time interval can be obtained, and processes with resource utilization rates greater than the third threshold can be selected from them. The second process includes processes or threads of the second cloud phone whose resource utilization rate is greater than the third threshold within the target time interval.
[0116] For any one of the K second cloud phones, the process similarity between the second cloud phone and the first cloud phone can be determined by the following formula:
[0117] ;
[0118] Where S represents the process similarity between the second cloud phone and the first cloud phone, m represents the number of processes or threads in the first process, n represents the number of processes or threads in the second process, and Q represents the number of identical or similar processes or threads between the first and second processes. Similarity here refers to the same type of process or thread, such as games or short videos. When the process or thread types are the same, When process or thread types are similar, , It is the average of the resource utilization rates of processes or threads of the same or similar type in the first cloud phone and the second cloud phone.
[0119] After determining the process similarity between each of the K second cloud phones and the first cloud phone, K process similarity scores are obtained. Based on these K process similarity scores, the Q second cloud phones with the highest similarity scores are selected, and the plurality of second cloud phones includes the Q second cloud phones. Here, Q and K are both positive integers, and Q is less than or equal to K.
[0120] Step 630: Based on the second historical resource usage of the multiple second cloud phones in the target time interval, fit the resource usage of the first cloud phone in the target time interval to obtain the fitting result.
[0121] In this embodiment, the average resource usage of the first cloud phone at each sampling point within the target time interval can be calculated to obtain the first average value of the first cloud phone within the target time interval. After determining Q second cloud phones, the second historical resource usage of the Q second cloud phones within the target time interval can be obtained. For any one of the Q second cloud phones, the average historical resource usage of that second cloud phone at each sampling point within the target time interval can be determined to obtain Q average values of the Q second cloud phones, and the average of the Q average values is taken to obtain the second average value.
[0122] After determining the first average and the second average, the difference between the first average and the second average can be determined, and this difference is used to fill in the resource usage of the first cloud phone within the target time interval, thus obtaining the fitting result and completing the fitting of the resource usage of the first cloud phone within the target time interval. The fitting result is the resource usage after filling in the difference between the first average and the second average.
[0123] Step 640: Based on the fitting results, obtain the first historical resource usage of the first cloud phone within the historical time period.
[0124] In this embodiment, for a target time interval within a historical time period, the resource usage of the first cloud phone within the target time interval can be fitted. For time intervals within the historical time period that are not within the target time interval, the resource usage of these intervals does not need to be fitted. The resource usage of the first cloud phone within the target time interval, fitted together with the resource usage of the first cloud phone in the time intervals within the historical time period that are not within the target time interval, is integrated to obtain the first historical resource usage of the first cloud phone within the historical time period.
[0125] The first historical resource usage includes the CPU and memory usage of the first cloud phone within a historical time period. During the process of fitting the resource usage of the first cloud phone within the target time interval in steps 610-630, different dimensions of resource usage can be fitted separately, i.e., CPU usage and memory usage can be fitted separately. After the resource usage of the first cloud phone within the target time interval is fitted in steps 610-630, the fitted resource usage from different dimensions can be merged.
[0126] Specifically, the CPU usage and memory usage of the first cloud phone within the target time interval can be merged into a single data structure. ,in, , and These are the preset weighting coefficients. By integrating resource usage from different dimensions, resource generalization is beneficial for subsequent predictions. Individual CPU usage or memory usage can easily lead to overfitting.
[0127] Step 650: Based on the first historical resource usage and the target resource prediction model, predict the target resource usage of the first cloud phone within a target time period, wherein the target time period is after the historical time period.
[0128] Step 660: Obtain the first resource limit value of the first cloud phone, which is based on the service package of the first cloud phone.
[0129] Step 670: Based on the target resource usage and the first resource limit, allocate the amount of resources used by the first cloud phone within the target time period.
[0130] In this application embodiment, a method is provided to fit the historical resource usage of a first cloud phone based on other cloud phones. The fitted historical resource usage of the first cloud phone is more accurate and better reflects the resource usage of the first cloud phone in the historical time period. The accurate historical data can also make the subsequent prediction of the target resource usage more accurate and obtain a more suitable resource allocation result.
[0131] Please see Figure 7 , Figure 7 This is a flowchart illustrating a method for allocating cloud phone resources according to an embodiment of this application. Figure 7 As shown, the method includes the following steps:
[0132] Step 710: Determine the target time interval of the first cloud phone within the historical time period; wherein, the resource usage of the first cloud phone within the target time interval is greater than or equal to a first threshold.
[0133] Step 715: Obtain the second historical resource usage of multiple second cloud phones within the target time interval; wherein the second historical resource usage is less than a second threshold.
[0134] Step 720: Based on the second historical resource usage of the multiple second cloud phones in the target time interval, fit the resource usage of the first cloud phone in the target time interval to obtain the fitting result.
[0135] Step 725: Based on the fitting results, obtain the first historical resource usage of the first cloud phone within the historical time period.
[0136] Step 730: Input the first historical resource usage into the nonlinear network to obtain the first processing result of the first cloud phone within the target time period.
[0137] In this embodiment, the target resource prediction model includes a nonlinear network, a linear network, and a fully connected layer. The historical time period includes M historical time intervals, and the first historical resource usage includes the historical resource usage of the M historical time intervals. The nonlinear network includes M long short-term memory networks and a multilayer perceptron, and the linear network includes an autoregressive model, where M is an integer greater than 1. The step of inputting the first historical resource usage into the nonlinear network to obtain the first processing result of the first cloud phone within the target time period includes: inputting the historical resource usage of the i-th historical time interval from the M historical time intervals into the i-th long short-term memory network from the M long short-term memory networks to obtain the i-th feature extraction result. Here, i is a positive integer, and i is less than or equal to M; obtaining M feature extraction results from the historical resource usage of the M historical time intervals; and inputting the M feature extraction results into the multilayer perceptron to obtain the first processing result of the first cloud phone within the target time period.
[0138] Step 735: Input the first historical resource usage into a linear network to obtain the second processing result of the first cloud phone within the target time period.
[0139] Step 740: Input the first processing result and the second processing result into the fully connected layer to obtain the target resource usage of the first cloud phone within the target time period.
[0140] Step 745: Obtain the first resource limit value of the first cloud phone, which is based on the service package of the first cloud phone.
[0141] In this embodiment, after obtaining the first resource limit value of the first cloud phone, it can be determined whether the service package of the first cloud phone can provide sufficient resources to the first cloud phone based on the predicted target resource usage and the first resource limit value. That is, it can be determined whether the target resource usage is less than the first resource limit value of the first cloud phone. If the target resource usage is less than the first resource limit value of the first cloud phone, step 750 can be executed; if the target resource usage is greater than or equal to the first resource limit value of the first cloud phone, step 755 can be executed.
[0142] Step 750: Determine the first amount of resources used by the first cloud phone within the target time period, wherein the first amount of resources is less than the first resource upper limit; allocate the first amount of resources to the first cloud phone.
[0143] In this embodiment of the application, the target time period includes a first time interval, and the resource usage of the first cloud phone within the first time interval is less than the first resource upper limit. Step 750, determining the first resource usage of the first cloud phone within the target time period, includes: determining a first deviation rate of the first cloud phone within the first time interval, the first deviation rate being obtained based on a first target average value and the first resource upper limit; the first target average value being the average of the resource usage of the first cloud phone at multiple time points within the first time interval; and determining the first resource usage of the first cloud phone within the first time interval based on the first deviation rate.
[0144] The target time period includes N time points, where N is an integer greater than 1, and the target resource usage includes the resource usage of the first cloud phone at the N time points; the first time interval is obtained by clustering the time points among the N time points where the resource usage is less than the first resource upper limit value.
[0145] In this embodiment of the application, after determining the first amount of resources used by the first cloud phone within a target time period, a first difference between the first amount of resources and the first resource limit is determined, and the first difference is used as the amount of resources reduced by the first cloud phone within the target time period; based on the first difference, the overdraft limit of the first cloud phone is increased, and the overdraft limit is the amount of resources that the first cloud phone can still overdraft even when the resource usage of the first cloud phone exceeds the first resource limit.
[0146] The first cloud phone is mounted on the target server. In increasing the overdraft amount of the first cloud phone based on the first difference, the following methods can be used: Obtain the operating status of the target server, including a busy state and an idle state; when the target server is in a busy state, increase the first overdraft amount based on the first difference; when the target server is in an idle state, increase the second overdraft amount based on the first difference; wherein the first overdraft amount is greater than the second overdraft amount.
[0147] Step 755: Determine the second resource amount used by the first cloud phone within the target time period, wherein the second resource amount is greater than or equal to the first resource upper limit; allocate the second resource amount to the first cloud phone.
[0148] In this embodiment of the application, the target time period includes a second time interval, and the resource usage of the first cloud phone within the second time interval is greater than or equal to the first resource upper limit. Determining the second resource usage of the first cloud phone within the target time period includes: determining a second deviation rate of the first cloud phone within the second time interval, the second deviation rate being obtained based on a second target average value and the first resource upper limit; the second target average value being the average of the resource usage of the first cloud phone at multiple time points within the second time interval; and determining the second resource usage of the first cloud phone within the second time interval based on the second deviation rate.
[0149] The target time period includes N time points, where N is an integer greater than 1, and the target resource usage includes the resource usage of the first cloud phone at the N time points; the second time interval is obtained by clustering the time points in the N time points where the resource usage is greater than or equal to the first resource upper limit value.
[0150] In this embodiment of the application, the number of times the first cloud phone appears in the second time interval can be recorded; if the number of times exceeds a preset number, cloud phone service package upgrade information is pushed to the first cloud phone.
[0151] In determining the second amount of resources used by the first cloud phone within the second time interval based on the second deviation rate, the following method can be used: obtain the current overdraft amount and overdraft limit of the first cloud phone; determine the second amount of resources used by the first cloud phone within the second time interval based on the second deviation rate, the overdraft amount and the overdraft limit.
[0152] After determining the second amount of resources used by the first cloud phone within the target time period, a second difference between the second amount of resources and the first resource limit is determined, and the second difference is used as the additional amount of resources used by the first cloud phone within the target time period; based on the second difference, the overdraft amount of the first cloud phone is reduced, where the overdraft amount is the amount of resources that the first cloud phone can still overdraft even when its resource usage exceeds the first resource limit.
[0153] The first cloud phone is mounted on the target server. In reducing the overdraft amount of the first cloud phone based on the second difference, the following methods can be used: Obtain the operating status of the target server, including a busy state and an idle state; when the target server is in a busy state, reduce the third overdraft amount based on the second difference; when the target server is in an idle state, reduce the fourth overdraft amount based on the second difference; wherein the third overdraft amount is greater than the fourth overdraft amount.
[0154] In this embodiment, the first historical resource usage of a first cloud phone is obtained, which is the amount of resources used by the first cloud phone within a historical time period. Based on the first historical resource usage and a target resource prediction model, the target resource usage of the first cloud phone within a target time period is predicted, where the target time period is after the historical time period. A first resource upper limit value for the first cloud phone is obtained, which is derived based on the service package of the first cloud phone. Based on the target resource usage and the first resource upper limit value, the resources used by the first cloud phone within the target time period are allocated. Thus, the target resource usage of the first cloud phone within a target time period can be predicted based on the first historical resource usage within the historical time period. Then, the resources used by the first cloud phone within the target time period are allocated using the target resource usage and the first resource upper limit value derived from the service package of the first cloud phone. Compared to the fixed resource allocation method used in related technologies, this allocation method allocates resources within the target time period based on the predicted resource usage within the target time period, resulting in more accurate resource allocation and more flexible resource allocation, thus solving the problem of unsatisfactory resource allocation results in related technologies.
[0155] It is important to understand that Figures 1 to 7 The explanations of the same or corresponding steps can be cross-referenced. For example, Figure 1 The explanations of steps 130 and 140 are applicable to Figure 2 Steps 250 and 260 in the process.
[0156] Meanwhile, it should be understood that the cloud phone resource allocation method provided in this application embodiment can have the following beneficial effects: First, by predicting future resource usage based on the user's resource usage when using applications on the cloud phone, and thereby increasing or decreasing the resources allocated to the cloud phone, the performance advantages of the cloud can be fully utilized, breaking through the boundaries of the virtual phone and achieving dynamic resource allocation on a larger scale. Second, without changing the service plan, the temporarily added resources can effectively meet the demand during short-term peak periods, ensuring the performance release of applications, reducing problems such as lag and crashes, improving the cost-effectiveness of the service plan, ensuring the user experience, reducing invalid service plan upgrades, lowering user costs, reducing resource waste, and facilitating business promotion. Third, in addition, implementing the principle of equivalence when allocating resources improves the order of dynamic resource scheduling, which can reduce overall resource consumption and resource scheduling costs.
[0157] Please see Figure 8 , Figure 8 This is a structural block diagram of a cloud phone resource allocation device provided in an embodiment of this application. Figure 8 As shown in the figure, this application embodiment provides a cloud mobile phone resource allocation device 800, which includes: an acquisition module 810, a prediction module 820 and an allocation module 830.
[0158] The acquisition module 810 is used to acquire the first historical resource usage of the first cloud phone, wherein the first historical resource usage is the amount of resources used by the first cloud phone within a historical time period.
[0159] The prediction module 820 is used to predict the target resource usage of the first cloud phone within a target time period based on the first historical resource usage and the target resource prediction model, wherein the target time period is after the historical time period.
[0160] The allocation module 830 is used to obtain a first resource limit value for the first cloud phone, the first resource limit value being obtained based on the service package of the first cloud phone; and to allocate the amount of resources used by the first cloud phone within the target time period based on the target resource usage and the first resource limit value.
[0161] In this embodiment, the first historical resource usage of a first cloud phone is obtained, which is the amount of resources used by the first cloud phone within a historical time period. Based on the first historical resource usage and a target resource prediction model, the target resource usage of the first cloud phone within a target time period is predicted, where the target time period is after the historical time period. A first resource upper limit value for the first cloud phone is obtained, which is derived based on the service package of the first cloud phone. Based on the target resource usage and the first resource upper limit value, the resources used by the first cloud phone within the target time period are allocated. Thus, the target resource usage of the first cloud phone within a target time period can be predicted based on the first historical resource usage within the historical time period. Then, the resources used by the first cloud phone within the target time period are allocated using the target resource usage and the first resource upper limit value derived from the service package of the first cloud phone. Compared to the fixed resource allocation method used in related technologies, this allocation method allocates resources within the target time period based on the predicted resource usage within the target time period, resulting in more accurate resource allocation and more flexible resource allocation, thus solving the problem of unsatisfactory resource allocation results in related technologies.
[0162] The cloud phone resource allocation device provided in this application embodiment can implement the various processes implemented in the above method embodiments. To avoid repetition, it will not be described again here.
[0163] like Figure 9As shown in the illustration, this application also provides an electronic device 900. The electronic device 900 includes a processor 910 and a memory 920. The memory 920 stores a program or instructions, which, when executed by the processor 910, implement the steps of any of the methods described above. For example, when the program is executed by the processor 910, it implements the following process: obtaining a first historical resource usage of a first cloud phone, where the first historical resource usage is the amount of resources used by the first cloud phone within a historical time period; predicting a target resource usage of the first cloud phone within a target time period based on the first historical resource usage and a target resource prediction model, where the target time period is after the historical time period; obtaining a first resource upper limit value for the first cloud phone, where the first resource upper limit value is obtained based on the service package of the first cloud phone; and allocating the resources used by the first cloud phone within the target time period based on the target resource usage and the first resource upper limit value. In this way, the target resource usage of the first cloud phone in a target time period can be predicted based on the historical resource usage of the first cloud phone during the historical time period. Then, the resource usage of the first cloud phone in the target time period can be allocated based on the target resource usage and the first resource limit value obtained based on the service package of the first cloud phone. Compared with the fixed resource allocation method used by related technologies, this allocation method allocates the resources used in the target time period based on the predicted resource usage in the target time period, which makes the resource allocation result more accurate and enables more flexible resource allocation, thus solving the problem of poor resource allocation results in related technologies.
[0164] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the steps of various embodiments of the cloud phone resource allocation method and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0165] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0166] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0167] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.
[0168] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0169] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0170] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for allocating resources in a cloud phone, characterized in that, include: Obtain the first historical resource usage of the first cloud phone, where the first historical resource usage is the amount of resources used by the first cloud phone within a historical time period. Based on the first historical resource usage and the target resource prediction model, the target resource usage of the first cloud phone is predicted within a target time period, wherein the target time period is after the historical time period. Obtain the first resource limit value of the first cloud phone, which is based on the service package of the first cloud phone; Based on the target resource usage and the first resource limit, the resource usage of the first cloud phone within the target time period is allocated; The allocation of resources used by the first cloud phone within a target time period based on the target resource usage and the first resource limit includes: If the target resource usage is less than the first resource limit, determine the first resource usage of the first cloud phone within the target time period, where the first resource usage is less than the first resource limit; and allocate the first resource usage to the first cloud phone. If the target resource usage is greater than or equal to the first resource limit, determine the second resource usage of the first cloud phone within the target time period, where the second resource usage is greater than or equal to the first resource limit; and allocate the second resource usage to the first cloud phone. After determining the first amount of resources used by the first cloud phone within the target time period, the method further includes: Determine a first difference between the first resource quantity and the first resource upper limit value, and use the first difference as the amount of resources that the first cloud phone reduces its usage during the target time period; Based on the first difference, the overdraft limit of the first cloud phone is increased. The overdraft limit is the amount of resources that the first cloud phone can still overdraft even when its resource usage exceeds the first resource limit.
2. The method according to claim 1, characterized in that, The target resource prediction model includes a nonlinear network, a linear network, and a fully connected layer; the prediction of the target resource usage of the first cloud phone within a target time period based on the first historical resource usage and the target resource prediction model includes: Input the first historical resource usage into a nonlinear network to obtain the first processing result of the first cloud phone within the target time period. Input the first historical resource usage into a linear network to obtain the second processing result of the first cloud phone within the target time period; The first processing result and the second processing result are input into the fully connected layer to obtain the target resource usage of the first cloud phone within the target time period.
3. The method according to claim 2, characterized in that, The historical time period includes M historical time intervals, and the first historical resource usage includes the historical resource usage of the M historical time intervals; the nonlinear network includes M long short-term memory networks and multilayer perceptrons, and the linear network includes an autoregressive model, where M is an integer greater than 1; The step of inputting the first historical resource usage into a nonlinear network to obtain the first processing result of the first cloud phone within the target time period includes: The historical resource usage of the i-th historical time interval among the M historical time intervals is input into the i-th long short-term memory network among the M long short-term memory networks to obtain the i-th feature extraction result; where i is a positive integer and i is less than or equal to M; Based on the historical resource usage over the M historical time intervals, M feature extraction results are obtained; The M feature extraction results are input into the multilayer perceptron to obtain the first processing result of the first cloud phone within the target time period.
4. The method according to claim 1, characterized in that, The target time period includes a first time interval, during which the resource usage of the first cloud phone is less than the first resource upper limit. Determining the amount of resources used by the first cloud phone within the target time period includes: A first deviation rate is determined for the first cloud phone within the first time interval. The first deviation rate is obtained based on a first target average value and a first resource upper limit value. The first target average value is the average resource usage of the first cloud phone at multiple time points within the first time interval. Based on the first deviation rate, the first amount of resources used by the first cloud phone within the first time interval is determined.
5. The method according to claim 1, characterized in that, The target time period includes a second time interval, and the resource usage of the first cloud phone in the second time interval is greater than or equal to the first resource upper limit value. Determining the amount of second resources used by the first cloud phone within the target time period includes: A second deviation rate is determined for the first cloud phone within the second time interval. The second deviation rate is obtained based on a second target average value and a first resource upper limit value. The second target average value is the average resource usage of the first cloud phone at multiple time points within the second time interval. Based on the second deviation rate, the second amount of resources used by the first cloud phone within the second time interval is determined.
6. The method according to claim 5, characterized in that, The step of determining the amount of second resources used by the first cloud phone within the second time interval based on the second deviation rate includes: Obtain the current overdraft amount and overdraft limit of the first cloud phone; Based on the second deviation rate, the overdraft amount, and the overdraft limit, the second amount of resources used by the first cloud phone within the second time interval is determined.
7. The method according to any one of claims 1, 5-6, characterized in that, After determining the amount of second resources used by the first cloud phone within the target time period, the method further includes: Determine a second difference between the second resource quantity and the first resource upper limit value, and use the second difference as the additional resource quantity used by the first cloud phone during the target time period; Based on the second difference, the overdraft amount of the first cloud phone is reduced. The overdraft amount is the amount of resources that the first cloud phone can still overdraft even when the resource usage of the first cloud phone exceeds the first resource limit.
8. The method according to claim 4, characterized in that, The target time period includes N time points, where N is an integer greater than 1, and the target resource usage includes the resource usage of the first cloud phone at the N time points; the first time interval is obtained by clustering the time points among the N time points where the resource usage is less than the first resource upper limit value.
9. The method according to claim 5, characterized in that, The target time period includes N time points, where N is an integer greater than 1, and the target resource usage includes the resource usage of the first cloud phone at the N time points; the second time interval is obtained by clustering the time points in the N time points where the resource usage is greater than or equal to the first resource upper limit value.
10. The method according to claim 1, characterized in that, The first cloud phone is set up on the target server; increasing the overdraft limit of the first cloud phone based on the first difference includes: Obtain the running status of the target server, including busy status and idle status; If the target server is busy, increase the first overdraft amount based on the first difference; If the target server is idle, a second overdraft amount is increased based on the first difference; Wherein, the first overdraft amount is greater than the second overdraft amount.
11. The method according to claim 7, characterized in that, The first cloud phone is set up on the target server; the step of reducing the overdraft of the first cloud phone based on the second difference includes: Obtain the running status of the target server, including busy status and idle status; If the target server is busy, the third overdraft amount is reduced based on the second difference; If the target server is idle, the fourth overdraft amount is reduced based on the second difference; The third overdraft amount is greater than the fourth overdraft amount.
12. The method according to claim 1, characterized in that, The acquisition of the first historical resource usage of the first cloud phone includes: Determine the target time interval for the first cloud phone within a historical time period; wherein, the resource usage of the first cloud phone within the target time interval is greater than or equal to a first threshold. Obtain the second historical resource usage of multiple second cloud phones within the target time interval; wherein the second historical resource usage is less than a second threshold. Based on the second historical resource usage of the multiple second cloud phones in the target time interval, the resource usage of the first cloud phone in the target time interval is fitted to obtain the fitting result; Based on the fitting results, the first historical resource usage of the first cloud phone within the historical time period is obtained.
13. The method according to claim 5, characterized in that, The method further includes: Record the number of times the first cloud phone appears in the second time interval; If the number of times exceeds a preset number, push cloud phone service package upgrade information to the first cloud phone.
14. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that run on the processor, the program or instructions which, when executed by the processor, implement the steps of the method as described in any one of claims 1-13.
15. A computer-readable storage medium, characterized in that, The medium stores a program or instructions that, when executed, implement the steps of the method as described in any one of claims 1-13.
16. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-13.
Citation Information
Patent Citations
Cloud mobile phone game resource scheduling method and device
CN115292042A
Resource planning method and device and related equipment
CN117687767A
Hybrid NR service dynamic resource allocation method and system
CN118804317A