Cloud mobile phone resource allocation method, electronic equipment and computer readable storage medium

By predicting the future resource usage of cloud mobile phones and combining the resource upper limit value in the business package, dynamically allocating cloud mobile phone resources is solved, and the problem of poor resource allocation results in the existing technology is achieved, more accurate and flexible resource allocation is achieved, improving user experience and cost-effectiveness.

CN119696940AActive Publication Date: 2025-03-25CHINA MOBILE INTERNET CO LTD +1

Patent Information

Application Number
CN202411647464.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-25
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

The existing cloud mobile resource allocation method has the problem of poor resource allocation results, which leads to the inability to effectively utilize resources.

Method used

By obtaining the historical resource usage of cloud mobile phones, using the target resource prediction model to predict future resource usage, and dynamically allocate resources based on the resource upper limit value in the business package to achieve more accurate and flexible resource allocation.

Benefits of technology

It improves the accuracy and flexibility of resource allocation, avoids resource waste, improves user experience, and enhances the cost-effectiveness of cloud mobile business packages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696940A_ABST
    Figure CN119696940A_ABST
Patent Text Reader

Abstract

The invention discloses a cloud mobile phone resource allocation method, electronic equipment and a computer readable storage medium, and belongs to the field of Internet. The method comprises the following steps: acquiring a first historical resource usage amount of a first cloud mobile phone, wherein the first historical resource usage amount is a resource amount used by the first cloud mobile phone in a historical time period; based on the first historical resource usage amount and a target resource prediction model, predicting a target resource usage amount of the first cloud mobile phone in a target time period, the target time period being after the historical time period; obtaining a first resource upper limit value of the first cloud mobile phone, wherein the first resource upper limit value is obtained based on a service package of the first cloud mobile phone; and based on the target resource usage amount and the first resource upper limit value, allocating the resource amount used by the first cloud mobile phone in the target time period. The method is used for cloud mobile phone resource allocation, and solves the problem that the resource allocation result is not good enough in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of Internet, and specifically relates to a cloud phone resource allocation method, an electronic device and a computer-readable storage medium. Background Art

[0002] Cloud phones are cloud phones based on virtualization technology. Various applications in cloud phones run in the cloud. By using cloud phone services, the consumption of local resources of physical phones can be greatly reduced. At present, the application scenarios of cloud phones are becoming more and more abundant, such as games, office, education, video, live broadcast and other scenarios. For cloud phone services, how to reasonably allocate the use resources of cloud phones is also very important.

[0003] Related technologies usually allocate fixed resources to users of cloud phone services based on cloud phone business packages. This resource allocation method has the problem of poor resource allocation results. Summary of the invention

[0004] The embodiments of the present application provide a cloud phone resource allocation method, an electronic device, and a computer-readable storage medium, which can solve the problem of poor resource allocation results existing in the resource allocation method used in the related technology.

[0005] In a first aspect, an embodiment of the present application provides a method for allocating cloud phone resources, the method comprising: Acquire 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 in a historical time period; Predicting a target resource usage of the first cloud phone in a target time period based on the first historical resource usage and a target resource prediction model, the target time period being after the historical time period; Obtaining a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on a service package of the first cloud phone; Based on the target resource usage and the first resource upper limit value, the resource usage of the first cloud phone in the target time period is allocated.

[0006] In a second aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0007] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed, the steps of the method described in the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method described in the first aspect.

[0009] At least one of the above technical solutions provided in the embodiments of the present application can achieve the following technical effects: In an embodiment of the present application, the first historical resource usage of the first cloud phone is obtained, and the first historical resource usage is the resource usage used by the first cloud phone in the 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 in the target time period is predicted, and the target time period is after the historical time period; the first resource upper limit value of the first cloud phone is obtained, and the first resource upper limit value is obtained based on the service package of the first cloud phone; based on the target resource usage and the first resource upper limit value, the resource usage used by the first cloud phone in the target time period is allocated. In this way, the target resource usage of the first cloud phone in the target time period after the historical time period can be predicted according to the first historical resource usage used by the first cloud phone in the historical time period, and then the resource usage of the first cloud phone in the target time period is allocated according to the target resource usage and the first resource upper limit value obtained based on the service package of the first cloud phone. Compared with the fixed resource allocation method used in the related technology, this allocation method allocates the resources used in the target time period based on the predicted resource usage in the target time period, so that the resource allocation result is more accurate, and at the same time, more flexible resource allocation can be achieved, which solves the problem of poor resource allocation results in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 It is a flow chart of a method for allocating cloud phone resources provided in an embodiment of the present application; Figure 2 It is a flowchart of another method for allocating cloud phone resources provided in an embodiment of the present application; Figure 3 is a schematic diagram of a target resource prediction model provided in an embodiment of the present application; Figure 4 is a schematic diagram of a residual structure provided in an embodiment of the present application; Figure 5 It is a flowchart of another method for allocating cloud phone resources provided in an embodiment of the present application; Figure 6 It is a flowchart of another method for allocating cloud phone resources provided in an embodiment of the present application; Figure 7 It is a specific flow chart of a method for allocating cloud phone resources provided in an embodiment of the present application; Figure 8 It is a structural block diagram of a cloud phone resource allocation device provided in an embodiment of the present application; Fig. 9 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0012] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0013] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0014] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0015] The cloud phone resource allocation method provided in the embodiment of the present application is applied to the cloud phone service, and in particular, can be applied to allocate the usage amount of the cloud phone within the target time period. Specifically, based on the first historical resource usage of the first cloud phone in the historical time period, the target resource usage of the first cloud phone in the target time period after the historical time period can be predicted, and then the resource usage of the first cloud phone in the target time period can be allocated according to the target resource usage and the first resource upper limit value obtained based on the service package of the first cloud phone.

[0016] The method for allocating cloud phone resources provided in the embodiment of the present application can be executed by a target device, wherein the target device can be one electronic device or multiple electronic devices. That is to say, the method for allocating cloud phone resources provided in the embodiment of the present application can be executed by one electronic device, wherein the electronic device can be a server, such as an independent physical server, a server cluster composed of multiple servers, and a cloud server capable of cloud computing. In the case where the method for allocating cloud phone resources provided in the embodiment of the present application is executed by multiple electronic devices, these multiple electronic devices can form a service cluster, which cooperate with each other to complete each step.

[0017] The following is a detailed description of the cloud phone resource allocation method provided in the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0018] See also Figure 1 , Figure 1 1 is a flow chart of a method for allocating cloud phone resources provided in an embodiment of the present application. Figure 1 As shown, the method comprises the following steps: Step 110: Obtain 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 in a historical time period.

[0019] In an embodiment of the present application, the first historical resource usage may include the historical resource usage collected by the first cloud phone at each sampling point in the historical time period. For example, the historical time period may be a historical day, with one minute as a sampling point, then the historical day includes the historical resource usage collected at 1440 sampling points. Among them, the historical resource usage may be the resource usage related to the operation of the cloud phone, such as memory usage and CPU usage. At each sampling point, the CPU usage and memory usage of the first cloud phone can be collected respectively, and the usage is the average value within 1 minute, which can form a sequence of CPU usage. , the sequence of memory usage , where i is a positive integer less than or equal to n, n=1440.

[0020] 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 in a target time period, where the target time period is after the historical time period.

[0021] In an embodiment of the present application, the target resource prediction model may be a deep learning model for predicting the resource usage of a cloud phone within a target time period. By inputting the first historical resource usage of a first cloud phone within a historical time period into the target resource prediction model, the target resource prediction model may 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 may be resource usage related to the operation of the cloud phone, such as memory usage and CPU usage.

[0022] Step 130: Obtain a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on a service package of the first cloud phone.

[0023] In the embodiment of the present application, before allocating resources to the first cloud phone, the service package of the first cloud phone can be queried and the first resource upper limit value of the first cloud phone can be obtained. In the process of allocating the amount of resources used by the first cloud phone in the target time period, the first resource upper limit value of the first cloud phone can be considered to avoid a large difference with the service package of the first cloud phone, resulting in a poor user experience of the cloud phone or affecting the promotion of the cloud phone package.

[0024] Step 140: Based on the target resource usage and the first resource upper limit, the resources used by the first cloud phone within the target time period are allocated.

[0025] In an embodiment of the present 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 upper limit value agreed upon in the service package of the first cloud phone can be used to allocate the resources used by the first cloud phone within the target time period, so that the resources obtained by the first cloud phone within the target time period are used as much as possible to avoid waste of resources. At the same time, problems such as freezes and crashes can be avoided as much as possible during the operation of the first cloud phone, thereby improving the user's cloud phone experience.

[0026] In an embodiment of the present application, the first historical resource usage of the first cloud phone is obtained, and the first historical resource usage is the resource usage used by the first cloud phone in the 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 in the target time period is predicted, and the target time period is after the historical time period; the first resource upper limit value of the first cloud phone is obtained, and the first resource upper limit value is obtained based on the service package of the first cloud phone; based on the target resource usage and the first resource upper limit value, the resource usage used by the first cloud phone in the target time period is allocated. In this way, the target resource usage of the first cloud phone in the target time period after the historical time period can be predicted according to the first historical resource usage used by the first cloud phone in the historical time period, and then the resource usage of the first cloud phone in the target time period is allocated according to the target resource usage and the first resource upper limit value obtained based on the service package of the first cloud phone. Compared with the fixed resource allocation method used in the related technology, this allocation method allocates the resources used in the target time period based on the predicted resource usage in the target time period, so that the resource allocation result is more accurate, and at the same time, more flexible resource allocation can be achieved, which solves the problem of poor resource allocation results in the related technology.

[0027] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of another method for allocating cloud phone resources provided in an embodiment of the present application. Figure 2 As shown, the method comprises the following steps: Step 210: Obtain 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 in a historical time period.

[0028] Step 220: Input the first historical resource usage into a nonlinear network to obtain a first processing result of the first cloud phone within a target time period.

[0029] In an embodiment of the present application, the target resource prediction model includes a nonlinear network and a linear network, and the nonlinear network and the linear network can be used to predict the resource usage of the first cloud phone in the target time period from different dimensions. Figure 3 , Figure 3 Schematic diagram of a target resource prediction model provided by an embodiment of the present application. Figure 3 As shown, the nonlinear network can be, for example Figure 3 The network of the left branch.

[0030] In one embodiment of the present application, the historical time period includes M historical time intervals, the first historical resource usage includes historical resource usage of the M historical time intervals; the nonlinear network includes M long short-term memory networks (Long Short Term Memory, LSTM) and multi-layer perceptrons (Multi-Layer Perceptron, MLP), the linear network includes an autoregressive model (Autoregressive Model, AR Model), and M is an integer greater than 1. In step 220, the first historical resource usage is input into the nonlinear network to obtain the first processing result of the first cloud phone in the target time period, including: inputting the historical resource usage of the i-th historical time interval in the M historical time intervals into the i-th LSTM in the M LSTMs to obtain the i-th feature extraction result; wherein i is a positive integer, and i is less than or equal to M; obtaining M feature extraction results through the historical resource usage of the M historical time intervals; inputting the M feature extraction results into the MLP to obtain the first processing result of the first cloud phone in the target time period.

[0031] In the embodiment of the present application, the historical time period can be divided into M historical time intervals, and the lengths of the M historical time intervals are the same. For any historical time interval in the M historical time intervals, the historical resource usage in the historical time interval includes the resource usage collected by P sampling points. Figure 3 As shown, the M historical time intervals can be sorted in chronological order to obtain the historical resource usage matrix, such as Figure 3 As shown in the matrix shown in . Among them, a row of the historical resource usage matrix is ​​used to represent the historical resource usage of a historical time interval, and different columns are used to represent the resource usage collected at different sampling points.

[0032] Before inputting the historical resource usage of the i-th historical time interval in the M historical time intervals into the i-th LSTM in the M LSTMs to obtain the i-th feature extraction result, the historical resource usage of the i-th historical time interval may be first subjected to short-term feature extraction in the time dimension. 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 3The first block unit includes a convolutional layer, the second block unit includes a maximum pooling layer (max pool) and three residual structures, the third block unit includes three residual structures, the fourth block unit includes four residual structures, and the fifth block unit includes four residual structures.

[0033] The residual structure can be referred to Figure 4 , Figure 4 Schematic diagram of a residual structure provided in an embodiment of the present application. Figure 4 As shown, the residual structure is used for data with an input dimension of 64, including two 3×3×64 convolution kernels and 64 convolution kernels.

[0034] In an embodiment of the present application, the above five block units can be used to extract short-term features in the time dimension through local dependencies between variables. The ASPP layer can use multiple parallel hole convolutions with different sampling rates, and the features extracted by each sampling rate are further processed in a separate branch and fused to generate the final result. In other words, the given input can be sampled in parallel with hole convolutions at different sampling rates, which is equivalent to capturing the context of the image at multiple scales. Each hole convolution will obtain a larger receptive field, which is more friendly to the detection of large-size targets. The ASPP layer can construct convolution kernels with different receptive fields through different hole rates to achieve multi-scale feature extraction.

[0035] In the embodiment of the present application, 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. In the process of inputting the historical resource usage matrix into the nonlinear network, the historical resource usage of 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 (such as Figure 4 shown , , as well as ), and obtain the short-term feature extraction results of M historical time intervals.

[0036] For the i-th historical time interval in the M historical time intervals, the short-term feature extraction result of the i-th historical time interval in the M historical time intervals can be input into the i-th LSTM network in the M LSTMs to obtain the i-th feature extraction result. Among them, 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.

[0037] like Figure 3 As shown in , there is a one-to-one correspondence between the M historical time intervals and the M LSTM networks. At the same time, there is a chain dependency relationship between the M LSTM networks, that is, one of the inputs of the subsequent LSTM network is one of the outputs of the previous LSTM network. Figure 3 As shown, The output of the network is available as The input of the network, The output of the network is available as That is to say, the historical resource usage in each historical time interval on the First Cloud Phone can use an independent LSTM network to extract implicit features, so as to obtain M historical time intervals through M LSTM network feature extraction. .

[0038] After obtaining the hidden features extracted by M LSTM networks Afterwards, each implicit feature can be input into the MLP to obtain a first processing result, which is the predicted resource usage of the first cloud phone in the target time period obtained based on the nonlinear network, for example Figure 3 In .

[0039] Step 230: Input the first historical resource usage into a linear network to obtain a second processing result of the first cloud phone within a target time period.

[0040] In the embodiment of the present application, the linear network may be as follows: Figure 3 The network structure of the right branch shown in the figure, the linear network may include an AR model. The AR model is a process of using itself as a regression variable, that is, using the linear combination of random variables at several moments in the early stage to describe the linear regression model of random variables at a certain moment in the later stage. The AR model can be used to process time series. The expression of the AR model is shown in the following formula: ; in, is the second processing result, is the M+1-ith historical time interval, a is a constant term, is the natural correlation number, Assume that the mean is equal to 0 and the standard deviation is equal to The random error value of It remains unchanged for any time interval.

[0041] In an embodiment of the present application, the historical resource usage matrix can be input into the AR model to obtain a second processing result, which is the predicted resource usage of the first cloud phone in the target time period obtained based on the linear network, for example Figure 3 In . It can be seen from the above formula that the second processing result is obtained based on the linear combination of the resource usage of the first cloud phone in M ​​historical time intervals plus a constant term and a random error. This method requires fewer resources and can use its own resource usage sequence for prediction, with low calculation amount and simple operation.

[0042] Step 240: Input the first processing result and the second processing result into a fully connected layer to obtain the target resource usage of the first cloud phone within the target time period.

[0043] In the embodiment of the present application, the first processing result and the second processing result have the same dimension, and the first processing result and the second processing result can be spliced ​​according to the dimension to obtain a spliced ​​result. Then, the spliced ​​result can be input into the fully connected layer to obtain the target resource usage of the first cloud phone in the target time period, for example Figure 3 In .

[0044] Step 250: Obtain a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on a service package of the first cloud phone.

[0045] Step 260: Based on the target resource usage and the first resource upper limit, the resources used by the first cloud phone within the target time period are allocated.

[0046] In an embodiment of the present application, a resource prediction method that integrates nonlinear networks and linear networks is provided, which makes the resource prediction result more accurate by predicting the resource usage of the first cloud phone in a target time period from different dimensions.

[0047] See also Figure 5 , Figure 5 FIG. 1 is a flow chart of another method for allocating cloud phone resources provided in an embodiment of the present application. Figure 5 As shown, the method comprises the following steps: Step 510: Obtain 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 in a historical time period.

[0048] 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 in a target time period, where the target time period is after the historical time period.

[0049] Step 530: Obtain a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on a service package of the first cloud phone.

[0050] In an embodiment of the present application, the service package of the first cloud phone can be queried, the CPU usage upper limit and the memory usage upper limit of the first cloud phone can be determined, and the CPU usage upper limit and the memory usage upper limit of the first cloud phone can be merged to obtain the first resource upper limit of the first cloud phone.

[0051] In an embodiment of the present application, after obtaining the first resource upper 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 upper limit value. In other words, it can be determined whether the target resource usage is less than the first resource upper limit value of the first cloud phone. In the case where the target resource usage is less than the first resource upper limit value of the first cloud phone, the following step 540 can be executed; in the case where the target resource usage is greater than or equal to the first resource upper limit value of the first cloud phone, the following step 550 can be executed.

[0052] Step 540: Determine a first resource amount used by the first cloud phone within a target time period, the first resource amount being less than the first resource upper limit; and allocate the first resource amount to the first cloud phone.

[0053] When the target resource usage is less than the first resource upper 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, or even that there are 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 that is less than the first resource upper limit can be determined, and the first resource amount can be allocated to the first cloud phone.

[0054] It should be noted that the first resource amount here can be greater than or equal to the minimum resource amount, which is determined based on the reduction quota of the first cloud phone and the upper limit of the first resource. For example, if the reduction quota of the first cloud phone is 10%, and the upper limit of the first resource of the first cloud phone is 10G, then the minimum resource amount can be 10×(1-10%)=9G, that is, the first resource amount cannot be less than 9G.

[0055] In one embodiment of the present application, the target time period includes a first time interval, and the resource usage of the first cloud phone in the first time interval is less than the first resource upper limit value; determining the first resource amount used by the first cloud phone in the target time period includes: determining a first deviation rate of the first cloud phone in the first time interval, the first deviation rate is based on a first target average value and the first resource upper limit value; the first target average value is the average value of the resource usage of the first cloud phone at multiple time points in the first time interval; based on the first deviation rate, determining the first resource amount used by the first cloud phone in the first time interval.

[0056] In an embodiment of the present application, in order to allocate resources more specifically, a first time interval can be determined from a target time period, and the resource usage of the first cloud phone in the first time interval is less than the first resource upper limit value, and the number of the first time intervals can be one or more. Among them, the target time period may include N time points, 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 in the N time points where the resource usage is less than the first resource upper limit value.

[0057] In an embodiment of the present application, the target resource usage may include the resource usage of the first cloud phone at N time points, and the time points in the N time points where the resource is less than the first resource upper limit value may be marked to obtain a first marking result. Then, the multiple time points included in the first marking result may be clustered according to time, and the clustering algorithm is not restricted here, such as the density-based spatial clustering of applications with noise (DBSCAN), to obtain A clustering results, each of the A clustering results may correspond to a first time interval, and the first time interval corresponding to the clustering result may be obtained based on the most recent time and the most distant time in the clustering result.

[0058] 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, and based on the first deviation rate, the first resource amount 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 upper limit.

[0059] Among them, the first deviation rate is obtained based on the first target average value and the first resource upper limit value, and the first target average value is the average value of resource usage of the first cloud phone at multiple time points in the first time interval. Specifically, the difference between the first target average value and the first resource upper limit value can be determined, and the ratio of the difference to the first resource upper limit value can be determined as the first deviation rate. For example, the first target average value is 8G, the first resource upper limit value is 10G, and the first deviation rate is 20%. At this time, the resource usage can be reduced by 20% based on the first resource upper limit value to obtain the first resource amount.

[0060] In one embodiment of the present application, after determining the first amount of resources used by the first cloud phone within the target time period, the cloud phone resource allocation method, in addition to steps 510 to 550, also includes: determining a first difference between the first amount of resources and the first resource upper limit value, and using the first difference as the amount of resources that the first cloud phone reduces in use within the target time period; based on the first difference, increasing the overdraft amount of the first cloud phone, the overdraft amount being the amount of resources that the first cloud phone can still overdraft when the resource usage of the first cloud phone exceeds the first resource upper limit value.

[0061] In an embodiment of the present application, a concept of overdraft is proposed. When reducing the amount of resources used by the first cloud phone during a target time period, the first difference between the first amount of resources (actual resource usage) and the first resource upper limit value can be determined, and based on the first difference, the overdraft amount of the first cloud phone is increased. In other words, the amount of resources that are reduced in use can be converted into an overdraft amount, and the overdraft amount is the amount of resources that the first cloud phone can still overdraw when the resource usage of the first cloud phone exceeds the first resource upper limit value. In simple terms, the overdraft amount here is similar to the concept of a deposit. If there is still a balance, the balance can be converted into a deposit, and the deposit can be withdrawn and used when there is no balance.

[0062] In an embodiment of the present application, the first difference portion that is used less by the first cloud phone can be used for operation of other cloud phones that have insufficient resources. This can improve the overall user experience of the cloud phone and improve the overall utilization rate of the cloud phone resources.

[0063] In one embodiment of the present application, the first cloud phone is set on a target server; based on the first difference, the overdraft amount of the first cloud phone is increased, including: 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, based on the first difference, increasing the first overdraft amount; when the target server is in an idle state, based on the first difference, increasing the second overdraft amount; wherein the first overdraft amount is greater than the second overdraft amount.

[0064] The overall resource usage of the target server in a busy state is greater than or equal to the overall resource threshold, and the overall resource usage of the target server in an idle state is less than the overall resource threshold.

[0065] In the embodiment of the present application, the amount of resources used by the first cloud phone can be used for the operation of other cloud phones. In the process of increasing the overdraft of the first cloud phone based on the reduced amount of resources used by the first cloud phone, the target server may be in a busy state or an idle state. When the target server is in a busy state, the amount of resources used by the first cloud phone will be used by other cloud phones with a high probability, and have a high value; when the target server is in an idle state, the amount of resources used by the first cloud phone may not be used by any cloud phone, and have a relatively low value.

[0066] Based on this, the present application proposes a resource implementation equivalence principle, whereby the amount of resources used by the first cloud phone increased during the target time period is shared by other cloud phones, and the amount of resources used by the first cloud phone reduced during the target time period can be shared with other cloud phones. At the same time, when the target server is in a busy state and an idle state, the overdraft amount increased based on the same first difference is dynamically adjusted. Specifically, the first overdraft amount increased when the target server is in a busy state is greater than the second overdraft amount increased when the target server is in an idle state.

[0067] Step 550: Determine a second amount of resources used by the first cloud phone within a target time period, where the second amount of resources is greater than or equal to the first resource upper limit; and allocate the second amount of resources to the first cloud phone.

[0068] When the target resource usage is greater than the first resource upper 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. At this time, in order to avoid problems such as freezing and flashback during the operation of the first cloud phone within the target time period, the second resource amount used by the first cloud phone within the target time period that is greater than the first resource upper limit can be determined, and the second resource amount can be allocated to the first cloud phone.

[0069] In one embodiment of the present 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 amount used by 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 is based on a second target average value and the first resource upper limit value; the second target average value is the average value of the resource usage of the first cloud phone at multiple time points in the second time interval; based on the second deviation rate, determining the second resource amount used by the first cloud phone in the second time interval.

[0070] In an embodiment of the present application, the target time period may include a first time interval and a second time interval. The relevant content of the first time interval can refer to the description of step 540 above, and only the second time interval is described in detail here. The target time period includes N time points, N is an integer greater than 1, and the target resource usage includes the resource usage of the first cloud phone at 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.

[0071] In an embodiment of the present application, the target resource usage may include the resource usage of the first cloud phone at N time points, and the time points in the N time points where the resource is greater than or equal to the first resource upper limit value may be marked to obtain a second marking result. Then, the multiple time points included in the second marking result may be clustered according to time, and the clustering algorithm is not restricted here, such as the DBSCAN clustering algorithm, to obtain B clustering results, each of the B clustering results may correspond to a second time interval, and the second time interval corresponding to the clustering result may be obtained based on the most recent time and the most distant time in the clustering result.

[0072] After determining the second time interval within the target time period, the second deviation rate of the first cloud phone within the second time interval can be determined, and based on the second deviation rate, the resource usage of the first cloud phone within the second time interval can be 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 upper limit.

[0073] Among them, the second deviation rate is obtained based on the second target average value and the first resource upper limit value, and the second target average value is the average value of resource usage of the first cloud phone at multiple time points in the second time interval. Specifically, the difference between the second target average value and the first resource upper limit value can be determined, and the ratio of the difference to the first resource upper limit value can be determined as the second deviation rate. For example, the second target average value is 12G, the first resource upper limit value is 10G, and the second deviation rate is 20%. The resource usage can be increased by 20% on the basis of the first resource upper limit value.

[0074] However, considering the promotion of different cloud phone service packages, the increase in resource usage may be limited. Exemplarily, in one embodiment of the present application, based on the second deviation rate, determining the second amount of resources used by the first cloud phone in the second time interval includes: obtaining 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, determining the second amount of resources used by the first cloud phone in the second time interval.

[0075] In the embodiment of the present application, the overdraft limit of the first cloud phone can be determined based on the service package of the first cloud phone. Generally speaking, 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%.

[0076] When the second deviation rate is greater than the overdraft limit, the overdraft limit is used to determine the second resource amount used by the first cloud phone in the second time interval. For example, the target resource usage of the first cloud phone is 12G, the upper limit of the first package of the first cloud phone is 10G, and the overdraft limit of the first cloud phone is 10%. At this time, the second deviation rate of the first cloud phone is 20%, and the second deviation rate is greater than the overdraft limit. Based on the overdraft limit, the resource usage of the first cloud phone in the second time interval is increased, that is, the second resource amount is 11G.

[0077] When the second deviation rate is less than or equal to the overdraft limit, the second resource amount used by the first cloud phone in 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 to determine whether the amount of supplementary resources is less than or equal to the current overdraft amount. For example, if the first resource upper limit is 10G and the second deviation rate is 10%, the amount of supplementary resources is 1G.

[0078] In the case where the amount of supplementary resources is less than or equal to the current overdraft amount, the sum of the first resource upper limit value and the amount of supplementary resources may be determined as the second resource amount. For example, if the amount of supplementary resources is 1G, the current overdraft amount is 2G, and the first resource upper limit value is 10G, then the second resource amount is 11G. In the case where the amount of supplementary resources is greater than the current overdraft amount, the sum of the first resource upper limit value and the current overdraft amount may be determined as the second resource amount. For example, if the amount of supplementary resources is 2G, the current overdraft amount is 1G, and the first resource upper limit value is 10G, then the second resource amount is 11G.

[0079] In one embodiment of the present application, the method for allocating cloud phone resources, in addition to steps 510 to 550, also includes: recording the number of times the first cloud phone appears in the second time interval; when the number is greater than a preset number, pushing cloud phone service package upgrade information to the first cloud phone.

[0080] In the embodiment of the present application, if the second time interval frequently appears in the first cloud phone, it means that the current service package of the first cloud phone cannot meet the operation requirements of the first cloud phone. At this time, the cloud phone service package upgrade information can be pushed to the first cloud phone. In addition, if the number of times the second time interval appears is greater than the preset number of times, the target number of times the second deviation rate is greater than the overdraft limit can be further recorded. If the target number is greater than the preset overdraft number, the cloud phone service package upgrade information is pushed to the first cloud phone to avoid frequent pushes.

[0081] In one embodiment of the present application, after determining the second amount of resources used by the first cloud phone within the target time period, the cloud phone resource allocation method, in addition to steps 510 to 550, also includes: determining a second difference between the second amount of resources and the first resource upper limit, and using the second difference as the amount of resources increased by the first cloud phone within the target time period; based on the second difference, reducing the overdraft amount of the first cloud phone, the overdraft amount being the amount of resources that the first cloud phone can still overdraft when the resource usage of the first cloud phone exceeds the first resource upper limit.

[0082] In an embodiment of the present application, in the process of increasing the amount of resources used by the first cloud phone within the target time period, the amount of resources exchanged is based on the overdraft amount of the first cloud phone. Therefore, after determining the amount of resources used by the first cloud phone within the target time period, the overdraft amount of the first cloud phone can be reduced accordingly to complete the overdraft settlement. Specifically, the second difference between the second amount of resources and the upper limit of the first resource can be determined, and based on the second difference, the overdraft amount of the first cloud phone can be reduced. For example, the overdraft amount of the first cloud phone is 3G, the second amount of resources is 11G, and the upper limit of the first resource is 10G. The second difference can be 1G, and the overdraft amount of the first cloud phone can be reduced from 3G to 2G.

[0083] In one embodiment of the present application, the first cloud phone is set on a target server; based on the second difference, the overdraft amount of the first cloud phone is reduced, including: 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, based on the second difference, reducing the third overdraft amount; when the target server is in an idle state, based on the second difference, reducing the fourth overdraft amount; wherein the third overdraft amount is greater than the fourth overdraft amount.

[0084] In the embodiment of the present application, since the target server provides the first cloud phone with the resources required for operation, in the process of increasing the resource usage of the first cloud phone based on the overdraft amount, the target server may be in a busy state or an idle state. The difficulty of allocating more resource usage to the first cloud phone when the target server is in a busy state is different from the difficulty of allocating more resource usage to the first cloud phone when the target server is in an idle state. Among them, the overall resource usage of the target server in a busy state is greater than or equal to the overall resource threshold, and the overall resource usage of the target server in an idle state is less than the overall resource threshold.

[0085] Based on this, the present application proposes a resource realization equivalence principle, whereby the amount of resources used by the first cloud phone increased during the target time period is shared by other cloud phones, and the amount of resources used by the first cloud phone reduced during the target time period can be shared with other cloud phones. At the same time, when the target server is in a busy state and an idle state, the overdraft amount reduced based on the same second difference is dynamically adjusted. Specifically, the third overdraft amount reduced when the target server is in a busy state is greater than the fourth overdraft amount reduced when the target server is in an idle state.

[0086] It should be noted that it is difficult to achieve a closed resource loop by relying on resource sharing between cloud phones. Therefore, cloud phone manufacturers can also participate in resource sharing and share certain resources with the target server when the target server is busy, so as to increase the liquidity of resource sharing. At the same time, when the target server is idle, some resources can be exchanged for offline computing, further improving the efficiency of overall resource scheduling.

[0087] In an embodiment of the present 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. This provides a method for dynamically adjusting cloud server resources, which can give full play to the performance advantages of the cloud side.

[0088] See also Figure 6 , Figure 6 FIG. 1 is a flow chart of another method for allocating cloud phone resources provided in an embodiment of the present application. Figure 6 As shown, the method comprises the following steps: Step 610: Determine a target time interval of 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.

[0089] In an embodiment of the present application, the first threshold is determined based on the first resource upper limit value of the first cloud phone, and the first threshold may be the first resource upper limit value of the target ratio. For example, the first threshold may be 90% of the first resource upper limit value. In fact, if the resource usage of the cloud phone reaches the first resource upper limit value of the target ratio, it indicates that the cloud phone has reached the performance upper limit. That is, the first cloud phone reaches the performance upper limit within the target time interval. At this time, the operating system may perform peak shaving behaviors, such as frequency reduction or closing background applications, in order to ensure the normal operation of the cloud phone. This situation will cause the collected historical resource usage to be inaccurate, which may be lower than the actual resource usage required in the historical time period. In order to ensure that the target resource prediction model can accurately extract the characteristics of 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.

[0090] In the process of determining the target time interval of the first cloud phone within the historical time period, a sliding window method can be used to determine the target time interval. Specifically, the following method can be used: first obtain the initial time interval length L0, and slide the initial time interval length within the historical time period to determine the initial time interval, and the average value of the historical resource usage collected at each time point within the initial time interval is greater than or equal to the first threshold. Then, the initial time interval is further extended based on the preset extension length, that is, the upper limit and lower limit of the initial time interval are extended, until the average value of the historical resource usage collected at each time point within the initial time interval is less than the first threshold, and the target time interval is obtained. In the above manner, the target time interval that reaches the performance upper limit within the historical time period can be determined, and the historical time period may include one or more target time intervals.

[0091] For example, the length of the initial time interval is 5, the extended length is 2, and the average value of the historical resource usage collected at each time point in the initial time interval is found to be greater than or equal to the first threshold value in three consecutive moves, until the fourth move finds that the historical resource usage collected at each time point in the initial time interval is less than the first threshold value. It can be seen that the first move determines the initial time interval, and the second and third moves further extend the initial time interval, and the length of the target time interval is L=5+2+2=9.

[0092] Step 620: Obtain the second historical resource usage of multiple second cloud phones in the target time interval; wherein the second historical resource usage is less than a second threshold.

[0093] In an embodiment of the present application, the resource usage of the first cloud phone in the target time interval can be fitted by obtaining the second historical resource usage of the second cloud phone in the target time interval. The second historical resource usage of the second cloud phone in the target time interval is data without peak shaving behavior, that is, relatively accurate data. Therefore, the resource usage of the first cloud phone in the target time interval that may have peak shaving behavior can be fitted by the second historical resource usage of the second cloud phone without peak shaving behavior.

[0094] The second historical resource usage of the second cloud phone is less than a second threshold, the second threshold is determined based on the second resource upper limit of the second cloud phone, the second resource upper limit is obtained based on the service package of the second cloud phone, and the second threshold may be the second resource upper limit of the target ratio. For example, the second threshold may be 90% of the second resource upper limit.

[0095] In one embodiment of the present application, the similarity between the first process of the first cloud phone within the target time interval and the second processes of the multiple second cloud phones within the target time interval is greater than a similarity threshold.

[0096] In an embodiment of the present application, the first process includes a process or thread of the first cloud phone whose resource occupancy rate is greater than a third threshold value within the target time interval. The third threshold value may be preset, for example, the third threshold value may be 0.9. The processes of the first cloud phone within the target time interval may be obtained, and the first process whose resource occupancy rate is greater than the third threshold value may be screened out therefrom. For the second cloud phone, K processes of the second cloud phone within the target time interval may be obtained, and the second process whose resource occupancy rate is greater than the third threshold value may be screened out therefrom. The second process includes a process or thread of the second cloud phone whose resource occupancy rate is greater than the third threshold value within the target time interval.

[0097] For any second cloud phone among 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: ; Among them, S is the process similarity between the second cloud phone and the first cloud phone, m is the number of processes or threads in the first process, n is the number of processes or threads in the second process, and Q is the number of identical or similar processes or threads between the first process and the second process. Similarity here means that the types of processes or threads are the same, such as games, short videos, etc. In the case of the same process or thread type, , when the process or thread types are similar, , It is the average of the resource usage of processes or threads of the same or similar type in the first cloud phone and the resource usage in the second cloud phone.

[0098] After determining the process similarity between each of the K second cloud phones and the first cloud phone, K process similarities can be obtained. Based on the K process similarities, the Q second cloud phones with the highest process similarities can be selected from the K process similarities, and the multiple second cloud phones include the Q second cloud phones. Wherein, Q and K are both positive integers, and Q is less than or equal to K.

[0099] Step 630: 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 a fitting result.

[0100] In an embodiment of the present application, the resource usage of the first cloud phone at each sampling point in the target time interval can be averaged to obtain a first average value of the first cloud phone in the target time interval. After determining Q second cloud phones, the second historical resource usage of the Q second cloud phones in the target time interval can be obtained. For any second cloud phone among the Q second cloud phones, the average value of the historical resource usage of the second cloud phone at each sampling point in the target time interval can be determined to obtain Q average values ​​of the Q second cloud phones, and the Q average values ​​are averaged to obtain the second average value.

[0101] After determining the first average value and the second average value, the difference between the first average value and the second average value can be determined, and the difference can be filled into the resource usage of the first cloud phone in the target time interval to obtain a fitting result, thereby completing the fitting of the resource usage of the first cloud phone in the target time interval. The fitting result is the resource usage after the difference between the first average value and the second average value is filled.

[0102] Step 640: Based on the fitting result, obtain the first historical resource usage of the first cloud phone in a historical time period.

[0103] In an embodiment of the present application, for a target time interval in a historical time period, the resource usage of the first cloud phone in the target time interval may be fitted. For a time interval in the historical time period that is not in the target time interval, the resource usage of this part of the interval may not be fitted. The resource usage of the first cloud phone after fitting in the target time interval is integrated with the resource usage of the first cloud phone in the time interval that is not in the target time interval in the historical time period to obtain the first historical resource usage of the first cloud phone in the historical time period.

[0104] Among them, the first historical resource usage includes the CPU usage and memory usage of the first cloud phone in the historical time period. In the process of fitting the resource usage of the first cloud phone in the target time interval in the above steps 610 to 630, the resource usage of different dimensions can be fitted separately, that is, the CPU usage and the memory usage can be fitted separately. After the resource usage of the first cloud phone in the target time interval is fitted in steps 610 to 630, the fitted resource usage of different dimensions can be fused.

[0105] Specifically, the CPU usage and memory usage of the first cloud phone after fitting within the target time interval can be merged into ,in, , and is the preset weight coefficient. By integrating resource usage in different dimensions, generalizing resources is beneficial to subsequent predictions. Separate CPU usage or memory usage is prone to overfitting problems.

[0106] 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 in a target time period, where the target time period is after the historical time period.

[0107] Step 660: Obtain a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on a service package of the first cloud phone.

[0108] Step 670: 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.

[0109] In an embodiment of the present application, a method for fitting the historical resource usage of a first cloud phone based on other cloud phones is provided. The historical resource usage of the first cloud phone after fitting is more accurate and can better reflect the resource usage of the first cloud phone in the historical time period. Accurate historical data can also make the subsequent predicted target resource usage more accurate and obtain more suitable resource allocation results.

[0110] See also Figure 7 , Figure 7 This is a specific flow chart of a method for allocating cloud phone resources provided by an embodiment of the present application. Figure 7 As shown, the method comprises the following steps: Step 710: Determine a target time interval of 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.

[0111] Step 715: Obtain the second historical resource usage of multiple second cloud phones in the target time interval; wherein the second historical resource usage is less than a second threshold.

[0112] Step 720: 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 a fitting result.

[0113] Step 725: Based on the fitting result, obtain the first historical resource usage of the first cloud phone in a historical time period.

[0114] Step 730: Input the first historical resource usage into a nonlinear network to obtain a first processing result of the first cloud phone within a target time period.

[0115] In an embodiment of the present application, 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 multi-layer perceptrons, and the linear network includes an autoregressive model, where M is an integer greater than 1. The first historical resource usage is input into the nonlinear network to obtain the first processing result of the first cloud phone within the target time period, including: inputting the historical resource usage of the i-th historical time interval in the M historical time intervals into the i-th long short-term memory network in the M long short-term memory networks to obtain the i-th feature extraction result. Wherein, i is a positive integer, and i is less than or equal to M; M feature extraction results are obtained through the historical resource usage of the M historical time intervals; the M feature extraction results are input into the multi-layer perceptron to obtain the first processing result of the first cloud phone within the target time period.

[0116] Step 735: Input the first historical resource usage into a linear network to obtain a second processing result of the first cloud phone within a target time period.

[0117] Step 740: Input the first processing result and the second processing result into a fully connected layer to obtain the target resource usage of the first cloud phone within the target time period.

[0118] Step 745: Obtain a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on a service package of the first cloud phone.

[0119] In an embodiment of the present application, after obtaining the first resource upper limit value of the first cloud phone, it is possible to determine 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 upper limit value. In other words, it is possible to determine whether the target resource usage is less than the first resource upper limit value of the first cloud phone. In the case where the target resource usage is less than the first resource upper limit value of the first cloud phone, the following step 750 may be executed; in the case where the target resource usage is greater than or equal to the first resource upper limit value of the first cloud phone, the following step 755 may be executed.

[0120] Step 750: Determine a first resource amount used by the first cloud phone within a target time period, the first resource amount being less than the first resource upper limit; and allocate the first resource amount to the first cloud phone.

[0121] In an embodiment of the present application, the target time period includes a first time interval, and the resource usage of the first cloud phone in the first time interval is less than the first resource upper limit value. Determining the first resource amount used by the first cloud phone in the target time period in step 750 includes: determining a first deviation rate of the first cloud phone in the first time interval, the first deviation rate is obtained based on a first target average value and the first resource upper limit value; the first target average value is the average value of the resource usage of the first cloud phone at multiple time points in the first time interval; based on the first deviation rate, determining the first resource amount used by the first cloud phone in the first time interval.

[0122] Among them, the target time period includes N time points, N is an integer greater than 1, and the target resource usage includes the resource usage of the first cloud phone at 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.

[0123] In an embodiment of the present 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 upper limit is determined, and the first difference is used as the amount of resources that the first cloud phone reduces in use within the target time period; based on the first difference, the overdraft amount of the first cloud phone is increased, and the overdraft amount is the amount of resources that the first cloud phone can still overdraft when the resource usage of the first cloud phone exceeds the first resource upper limit.

[0124] The first cloud phone is set on the target server. In the process of increasing the overdraft amount of the first cloud phone based on the first difference, the following method can be used: 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.

[0125] Step 755: Determine a second amount of resources used by the first cloud phone within a target time period, where the second amount of resources is greater than or equal to the first resource upper limit; and allocate the second amount of resources to the first cloud phone.

[0126] In an embodiment of the present 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. The second amount of resources used by 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 is obtained based on a second target average value and the first resource upper limit value; the second target average value is the average of the resource usage of the first cloud phone at multiple time points in the second time interval; based on the second deviation rate, determining the second amount of resources used by the first cloud phone in the second time interval.

[0127] Among them, the target time period includes N time points, N is an integer greater than 1, and the target resource usage includes the resource usage of the first cloud phone at 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.

[0128] In an embodiment of the present application, the number of times the first cloud phone appears in the second time interval can be recorded; when the number is greater than a preset number, cloud phone service package upgrade information is pushed to the first cloud phone.

[0129] In the process of determining the second amount of resources used by the first cloud phone in the second time interval based on the second deviation rate, the following method may be used: obtaining the current overdraft amount and overdraft limit of the first cloud phone; determining the second amount of resources used by the first cloud phone in the second time interval based on the second deviation rate, the overdraft amount and the overdraft limit.

[0130] After determining the second amount of resources used by the first cloud phone within the target time period, determine a second difference between the second amount of resources and the first resource upper limit, and use the second difference as the amount of resources increased by the first cloud phone within the target time period; based on the second difference, reduce the overdraft amount of the first cloud phone, and the overdraft amount is the amount of resources that the first cloud phone can still overdraft when the resource usage of the first cloud phone exceeds the first resource upper limit.

[0131] The first cloud phone is set on the target server. In the process of reducing the overdraft amount of the first cloud phone based on the second difference, the following method can be used: 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.

[0132] In an embodiment of the present application, the first historical resource usage of the first cloud phone is obtained, and the first historical resource usage is the resource usage used by the first cloud phone in the 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 in the target time period is predicted, and the target time period is after the historical time period; the first resource upper limit value of the first cloud phone is obtained, and the first resource upper limit value is obtained based on the service package of the first cloud phone; based on the target resource usage and the first resource upper limit value, the resource usage used by the first cloud phone in the target time period is allocated. In this way, the target resource usage of the first cloud phone in the target time period after the historical time period can be predicted according to the first historical resource usage used by the first cloud phone in the historical time period, and then the resource usage of the first cloud phone in the target time period is allocated according to the target resource usage and the first resource upper limit value obtained based on the service package of the first cloud phone. Compared with the fixed resource allocation method used in the related technology, this allocation method allocates the resources used in the target time period based on the predicted resource usage in the target time period, so that the resource allocation result is more accurate, and at the same time, more flexible resource allocation can be achieved, which solves the problem of poor resource allocation results in the related technology.

[0133] It is important to understand that Figures 1 to 7 The explanations of the same or corresponding steps in the above may refer to each other. For example, Figure 1 The explanation of step 130 and step 140 in Figure 2 Step 250 and step 260 in .

[0134] At the same time, it should be understood that a cloud phone resource allocation method provided in an embodiment of the present application can have the following beneficial effects: First, based on the resource usage of users when using applications in cloud phones, the possible resource usage in the future is predicted, so that the resources allocated to cloud phones can be increased or decreased, which can fully tap the performance advantages of the cloud, break through the boundaries of virtual mobile phones, and realize dynamic resource allocation on a larger scale. Second, without changing the package, in the event of a short-term operating peak, the temporarily increased resources can effectively respond to demand, ensure the performance release of the application, reduce the occurrence of freezes, flashbacks and other problems, improve the cost-effectiveness of the package, and ensure the user experience. At the same time, it also reduces invalid package upgrades, reduces user costs, reduces resource waste, and is conducive to business promotion. Third, in addition, the implementation of the principle of equivalence when allocating resources and improves the order of dynamic resource scheduling can reduce resource consumption and reduce the cost of resource scheduling as a whole.

[0135] See also Figure 8 , Figure 8 1 is a structural block diagram of a cloud phone resource allocation device provided in an embodiment of the present application. Figure 8 As shown, an embodiment of the present application provides a cloud phone resource allocation device 800, and the cloud phone resource allocation device 800 includes: an acquisition module 810, a prediction module 820 and an allocation module 830.

[0136] The acquisition module 810 is used to acquire a 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 in a historical time period; The prediction module 820 is used to predict the target resource usage of the first cloud phone in a target time period based on the first historical resource usage and the target resource prediction model, and the target time period is after the historical time period; The allocation module 830 is used to obtain a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on the service package of the first cloud phone; and to allocate 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.

[0137] In an embodiment of the present application, the first historical resource usage of the first cloud phone is obtained, and the first historical resource usage is the resource usage used by the first cloud phone in the 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 in the target time period is predicted, and the target time period is after the historical time period; the first resource upper limit value of the first cloud phone is obtained, and the first resource upper limit value is obtained based on the service package of the first cloud phone; based on the target resource usage and the first resource upper limit value, the resource usage used by the first cloud phone in the target time period is allocated. In this way, the target resource usage of the first cloud phone in the target time period after the historical time period can be predicted according to the first historical resource usage used by the first cloud phone in the historical time period, and then the resource usage of the first cloud phone in the target time period is allocated according to the target resource usage and the first resource upper limit value obtained based on the service package of the first cloud phone. Compared with the fixed resource allocation method used in the related technology, this allocation method allocates the resources used in the target time period based on the predicted resource usage in the target time period, so that the resource allocation result is more accurate, and at the same time, more flexible resource allocation can be achieved, which solves the problem of poor resource allocation results in the related technology.

[0138] The cloud phone resource allocation device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be repeated here.

[0139] like Fig. 9As shown, an embodiment of the present application also provides an electronic device 900. The electronic device 900 includes: a processor 910 and a memory 920, and the memory 920 stores a program or instruction, and the program or instruction is executed by the processor 910 to implement the steps of any of the methods described above. For example, when the program is executed by the processor 910, the following process is implemented: obtaining a first historical resource usage of a first cloud phone, the first historical resource usage is the amount of resources used by the first cloud phone in a historical time period; based on the first historical resource usage and the target resource prediction model, predicting the target resource usage of the first cloud phone in a target time period, the target time period is after the historical time period; obtaining a first resource upper limit value of the first cloud phone, the first resource upper limit value is obtained based on the service package of the first cloud phone; based on the target resource usage and the first resource upper limit value, allocating the amount of resources used by the first cloud phone in the target time period. In this way, the target resource usage of the first cloud phone in the target time period after the historical time period can be predicted based on the first historical resource usage of the first cloud phone in the historical time period, and then the resources used by the first cloud phone in the target time period can be allocated according to the target resource usage and the first resource upper limit value obtained based on the service package of the first cloud phone. Compared with the fixed resource allocation method used in 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 can achieve more flexible resource allocation, solving the problem of poor resource allocation results in related technologies.

[0140] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of each embodiment of the method for allocating cloud phone resources are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0141] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0142] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0143] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0144] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0146] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for allocating cloud phone resources, characterized in that: include: Acquire 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 in a historical time period; Predicting a target resource usage of the first cloud phone in a target time period based on the first historical resource usage and a target resource prediction model, the target time period being after the historical time period; Obtaining a first resource upper limit value of the first cloud phone, where the first resource upper limit value is obtained based on a service package of the first cloud phone; Based on the target resource usage and the first resource upper limit value, the resource usage of the first cloud phone in the target time period is allocated.

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 predicting the target resource usage of the first cloud phone in a target time period based on the first historical resource usage and the target resource prediction model includes: Inputting the first historical resource usage into a nonlinear network to obtain a first processing result of the first cloud phone within a target time period; Inputting the first historical resource usage into a linear network to obtain a second processing result of the first cloud phone within a target time period; The first processing result and the second processing result are input into a fully connected layer to obtain the target resource usage of the first cloud phone within a 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 historical resource usage in M ​​historical time intervals; the nonlinear network includes M long short-term memory networks and multi-layer perceptrons, and the linear network includes an autoregressive model, and M is an integer greater than 1; The step of inputting the first historical resource usage into a nonlinear network to obtain a first processing result of the first cloud phone within a target time period includes: Inputting the historical resource usage of the i-th historical time interval in the M historical time intervals into the i-th long short-term memory network in the M long short-term memory networks to obtain the i-th feature extraction result; wherein i is a positive integer, and i is less than or equal to M; Obtain M feature extraction results through the historical resource usage in the M historical time intervals; The M feature extraction results are input into the multi-layer perceptron to obtain a first processing result of the first cloud phone within a target time period.

4. The method according to claim 1, characterized in that The allocating the amount of resources used by the first cloud phone within a target time period based on the target resource usage and the first resource upper limit value includes: When the target resource usage is less than the first resource upper limit, determining a first resource amount used by the first cloud phone within a target time period, the first resource amount being less than the first resource upper limit; and allocating the first resource amount to the first cloud phone; When the target resource usage is greater than or equal to the first resource upper limit value, determine the second resource amount used by the first cloud phone within the target time period, and the second resource amount is greater than or equal to the first resource upper limit value; allocate the second resource amount to the first cloud phone.

5. The method according to claim 4, characterized in that The target time period includes a first time interval, and the resource usage of the first cloud phone in the first time interval is less than the first resource upper limit value; The determining the first resource amount used by the first cloud phone within the target time period includes: Determine a first deviation rate of the first cloud phone in the first time interval, where the first deviation rate is obtained based on a first target average value and the first resource upper limit value; the first target average value is an average value of resource usage of the first cloud phone at multiple time points in the first time interval; Based on the first deviation rate, a first resource amount used by the first cloud phone in the first time interval is determined.

6. The method according to claim 4 or 5, characterized in that: After determining the first resource amount used by the first cloud phone within the target time period, the method further includes: Determine a first difference between the first resource amount and the first resource upper limit, and use the first difference as the amount of resources that the first cloud phone reduces in use during the target time period; Based on the first difference, the overdraft amount of the first cloud phone is increased, and the overdraft amount is the amount of resources that the first cloud phone can still overdraft when the resource usage of the first cloud phone exceeds the first resource upper limit.

7. The method according to claim 4, 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; The determining the second resource amount used by the first cloud phone within the target time period includes: Determine a second deviation rate of the first cloud phone in the second time interval, where the second deviation rate is obtained based on a second target average value and the first resource upper limit value; the second target average value is an average value of resource usage of the first cloud phone at multiple time points in the second time interval; Based on the second deviation rate, a second amount of resources used by the first cloud phone in the second time interval is determined.

8. The method according to claim 7, characterized in that The determining, based on the second deviation rate, a second amount of resources used by the first cloud phone in the second time interval includes: Obtaining 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, a second amount of resources used by the first cloud phone in the second time interval is determined.

9. The method according to any one of claims 4, 7-8, 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 amount and the first resource upper limit, and use the second difference as the amount of resources to be increased 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, where the overdraft amount is the amount of resources that the first cloud phone can still overdraft when the resource usage of the first cloud phone exceeds the first resource upper limit.

10. 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 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.

11. The method according to claim 7, 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 among the N time points where the resource usage is greater than or equal to the first resource upper limit value.

12. The method according to claim 6, characterized in that The first cloud phone is set on the target server; and increasing the overdraft amount of the first cloud phone based on the first difference includes: Acquire the running status of the target server, where the running status includes a busy state and an idle state; When the target server is in a busy state, increasing a first overdraft amount based on the first difference; When the target server is in an idle state, increasing a second overdraft amount based on the first difference; Wherein, the first overdraft amount is greater than the second overdraft amount.

13. The method according to claim 9, characterized in that The first cloud phone is set on the target server; and reducing the overdraft amount of the first cloud phone based on the second difference includes: Acquire the running status of the target server, where the running status includes a busy state and an idle state; When the target server is in a busy state, reducing a third overdraft amount based on the second difference; When the target server is in an idle state, reducing a fourth overdraft amount based on the second difference; Wherein, the third overdraft amount is greater than the fourth overdraft amount.

14. The method according to claim 1, characterized in that The obtaining of the first historical resource usage of the first cloud phone includes: Determine a target time interval of 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; Obtaining second historical resource usage of multiple second cloud phones in 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, fitting the resource usage of the first cloud phone in the target time interval to obtain a fitting result; Based on the fitting result, a first historical resource usage of the first cloud phone in a historical time period is obtained.

15. The method according to claim 7, characterized in that The method further comprises: Recording the number of times the first cloud phone appears in the second time interval; When the number of times is greater than the preset number of times, the cloud phone service package upgrade information is pushed to the first cloud phone.

16. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 15 are implemented.

17. A computer-readable storage medium, characterized in that: The medium stores a program or an instruction, and when the program or the instruction is executed, the steps of the method according to any one of claims 1 to 15 are implemented.

18. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 15 when executed by a processor.

Citation Information

Patent Citations

  • Method and apparatus for allocating resources

    CN109254843A

  • Elastic expansion method based on load regression prediction in cloud environment and readable storage medium

    CN111638959A

  • Virtual mobile phone resource allocation method and device

    CN112764876A

  • Resource configuration method, device and equipment and readable storage medium

    CN114153561A

  • Cloud mobile phone game resource scheduling method and device

    CN115292042A

Cited By

  • Sensor data generation method and device, electronic equipment and storage medium

    CN120639857A

  • Cloud mobile phone virtualization network function optimization method and related equipment

    CN120835007A