Disclosure of Invention
The embodiment of the invention provides a cloud storage space allocation method and a server, which are used for avoiding the situation that the current cloud storage space allocation is unreasonable.
In a first aspect, the present application provides a cloud storage space allocation method, where the method includes:
the method comprises the steps that a server sets an upper limit value and a lower limit value of a cloud storage space to be allocated to a single user;
the server collects sample data of a plurality of trial users using the cloud storage space, and counts the condition that the sample data exceeds the upper limit value or the lower limit value of the cloud storage space;
the server calculates variance according to the plurality of sample data;
the server judges whether the variance is larger than a preset value or not, and if so, the server adjusts the upper limit value or the lower limit value of the cloud storage space;
and the server determines a cloud storage space value allocated to a single user according to the adjusted upper limit value and lower limit value of the cloud storage space.
Further, the method further comprises:
and the server counts the condition that the newly acquired sample data exceeds the adjusted upper limit value of the cloud storage space or the adjusted lower limit value of the cloud storage space, so as to readjust the upper limit value of the cloud storage space and the lower limit value of the cloud storage space.
Further, the server calculates a variance according to the plurality of sample data, and adopts the following formula:
wherein,
the average value of the X parameter sample cloud storage space is obtained; v (X) is variance, X (t) is variable, and n is sample data number.
Further, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space includes:
if the variance is larger than X, the server adjusts the upper limit value of the cloud storage space to be larger, and adjusts the lower limit value of the cloud storage space to be smaller; if the variance is smaller than Y, the server adjusts the upper limit value of the cloud storage space to be smaller, and adjusts the lower limit value of the cloud storage space to be larger; if the variance is between X and Y, no adjustment is made;
wherein X is greater than Y.
Further, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space includes:
when the variance is larger than X, determining a difference value A between the variance and X, wherein the upper limit value of the adjusted cloud storage space is as follows: (1+ (A/X)). the upper limit value of the original cloud storage space, and the lower limit value of the adjusted cloud storage space is as follows: lower limit value of the cloud storage space/(1 + (A/X)).
Further, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space includes:
when the variance is smaller than Y, determining a difference value B between the variance and Y, wherein the upper limit value of the adjusted cloud storage space is as follows: and the lower limit value of the cloud storage space after adjustment is (1+ (B/Y)) and the lower limit value of the original cloud storage space.
Further, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space includes:
when the variance is larger than X, determining a difference value A between the variance and X, wherein the upper limit value of the adjusted cloud storage space is as follows: (1+ (a/X)). the former cloud storage space upper limit value; the adjusted lower limit value of the cloud storage space is as follows: (1-C) adjusting the upper limit value of the cloud storage space;
when the variance is smaller than Y, determining a difference value B between the variance and Y, wherein the upper limit value of the adjusted cloud storage space is as follows: a protocloud storage space upper limit value/(1 + (B/Y)); the adjusted lower limit value of the cloud storage space is as follows: (1-C) adjusting the upper limit value of the cloud storage space;
and C is the proportion of sample data which exceeds the upper limit value or the lower limit value of the original cloud storage space in the sample data acquired by the server.
Further, when all sample data exceed the upper limit value or the lower limit value of the original cloud storage space, C is 1, the lower limit value of the cloud storage space is 0, and if all sample data do not exceed the upper limit value or the lower limit value of the original cloud storage space, C is 0, the lower limit value of the cloud storage space is equal to the upper limit value of the cloud storage space.
Further, the value of X is half of the current upper limit value of the cloud storage space.
Further, the value of Y and the value of X satisfy the following relationship:
Y=X/2。
further, the server determines a cloud storage space value allocated to a single user according to the adjusted upper limit value and lower limit value of the cloud storage space, and the following formula is adopted:
L=(M+N)/2;
and L is the cloud storage space value determined to be allocated to the single user, M is the adjusted upper limit value of the cloud storage space, and N is the adjusted lower limit value of the cloud storage space.
In a second aspect, the present application provides a server, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the computer program, may implement the cloud storage space allocation method according to any one of claims 1 to 9.
In the embodiment of the invention, a server sets an upper limit value and a lower limit value of a cloud storage space to be allocated to a single user; the method comprises the steps that a server collects sample data of a plurality of trial users using a cloud storage space, and the condition that the sample data exceeds the upper limit value or the lower limit value of the cloud storage space is counted; the server calculates variance according to the plurality of sample data; the server judges whether the variance is larger than a preset value or not, if so, the server adjusts the upper limit value or the lower limit value of the cloud storage space; and the server determines the cloud storage space value allocated to the single user according to the adjusted upper limit value and lower limit value of the cloud storage space. According to the embodiment of the invention, the upper limit value and the lower limit value of the cloud storage space can be dynamically adjusted by the server according to the sample data fluctuation condition, so that the cloud storage space can be reasonably distributed, and the resource waste is avoided.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, an embodiment of a cloud storage space allocation method according to the embodiment of the present invention includes:
s101, a server sets an upper limit value and a lower limit value of a cloud storage space to be allocated to a single user;
s102, a server collects sample data of a plurality of trial users using a cloud storage space, and counts the condition that the sample data exceeds the upper limit value or the lower limit value of the cloud storage space;
s103, the server calculates variance according to the plurality of sample data;
s104, the server judges whether the variance is larger than a preset value or not, and if yes, the server adjusts the upper limit value or the lower limit value of the cloud storage space;
and S105, the server determines the cloud storage space value allocated to the single user according to the adjusted upper limit value and the adjusted lower limit value of the cloud storage space.
In the embodiment of the invention, a server sets an upper limit value and a lower limit value of a cloud storage space to be allocated to a single user; the method comprises the steps that a server collects sample data of a plurality of trial users using a cloud storage space, and the condition that the sample data exceeds the upper limit value or the lower limit value of the cloud storage space is counted; the server calculates variance according to the plurality of sample data; the server judges whether the variance is larger than a preset value or not, if so, the server adjusts the upper limit value or the lower limit value of the cloud storage space; and the server determines the cloud storage space value allocated to the single user according to the adjusted upper limit value and lower limit value of the cloud storage space. According to the embodiment of the invention, the upper limit value and the lower limit value of the cloud storage space can be dynamically adjusted by the server according to the sample data fluctuation condition, so that the cloud storage space can be reasonably distributed, and the resource waste is avoided.
Further, the method further comprises:
and the server counts the condition that the newly acquired sample data exceeds the adjusted upper limit value of the cloud storage space or the adjusted lower limit value of the cloud storage space, so as to readjust the upper limit value of the cloud storage space and the lower limit value of the cloud storage space.
Further, the server calculates a variance according to the plurality of sample data, and adopts the following formula:
wherein,
the average value of the X parameter sample cloud storage space is obtained; v (X) is variance, X (t) is variable, and n is sample data number.
In the embodiment of the present invention, the principle that the server adjusts the upper limit value of the cloud storage space and the lower limit value of the cloud storage space is as follows:
the larger the variance is, the larger the difference between the upper cloud storage space limit value and the lower cloud storage space limit value is, and the smaller the variance is, the smaller the difference between the upper cloud storage space limit value and the lower cloud storage space limit value is. For example, the upper limit value of the original cloud storage space is 10G, the lower limit value of the cloud storage space is 4G, if the variance is greater than X, the upper limit value of the cloud storage space is adjusted to 12G, the lower limit value of the cloud storage space is adjusted to 2G, if the variance is less than Y, the upper limit value of the cloud storage space is adjusted to 8G, the lower limit value of the cloud storage space is adjusted to 6G, X is greater than Y, and if the variance is between X and Y, the variance is not adjusted.
Further, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space includes:
if the variance is larger than X, the server adjusts the upper limit value of the cloud storage space to be larger, and adjusts the lower limit value of the cloud storage space to be smaller; if the variance is smaller than Y, the server adjusts the upper limit value of the cloud storage space to be smaller, and adjusts the lower limit value of the cloud storage space to be larger; if the variance is between X and Y, no adjustment is made; wherein X is greater than Y.
Further, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space includes:
when the variance is larger than X, determining a difference value A between the variance and X, wherein the upper limit value of the adjusted cloud storage space is as follows: (1+ (A/X)). the upper limit value of the original cloud storage space, and the lower limit value of the adjusted cloud storage space is as follows: lower limit value of the cloud storage space/(1 + (A/X)). For example, the upper limit value of the raw cloud storage space is 10G, the lower limit value of the raw cloud storage space is 4G, X is 7, and the variance is 9G, then a is 9-7 ═ 2G, the upper limit value of the adjusted cloud storage space is (1+ (2/7)) × 10 ═ 12.8G, and the lower limit value of the adjusted cloud storage space is 4/(1+ (2/7)) × 3.1G.
Further, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space includes:
when the variance is smaller than Y, determining a difference value B between the variance and Y, wherein the upper limit value of the adjusted cloud storage space is as follows: and the lower limit value of the cloud storage space after adjustment is (1+ (B/Y)) and the lower limit value of the original cloud storage space. For example, the upper limit value of the raw cloud storage space is 10G, the lower limit value of the raw cloud storage space is 4G, Y is 3.5, and the variance is 2, then B is 3.5-2 ═ 1.5G, the upper limit value of the adjusted cloud storage space is 10/(1+ (1.5/3.5)) -7G, and the lower limit value of the adjusted cloud storage space is (1+ (1.5/3.5)) -4 ═ 5.7G.
When the variance is smaller than Y, the upper limit value of the cloud storage space needs to be adjusted down and the lower limit value of the cloud storage space needs to be adjusted up, so that a certain contradiction may occur, that is, the upper limit value of the cloud storage space is lower than the lower limit value of the cloud storage space after the adjustment is completed. That is, the adjusting, by the server, the upper limit value of the cloud storage space or the lower limit value of the cloud storage space may include:
when the variance is larger than X, determining a difference value A between the variance and X, wherein the upper limit value of the adjusted cloud storage space is as follows: (1+ (a/X)). the former cloud storage space upper limit value; the adjusted lower limit value of the cloud storage space is as follows: (1-C) adjusting the upper limit value of the cloud storage space;
when the variance is smaller than Y, determining a difference value B between the variance and Y, wherein the upper limit value of the adjusted cloud storage space is as follows: a protocloud storage space upper limit value/(1 + (B/Y)); the adjusted lower limit value of the cloud storage space is as follows: (1-C) adjusting the upper limit value of the cloud storage space;
and C is the proportion of sample data which exceeds the upper limit value or the lower limit value of the original cloud storage space in the sample data acquired by the server.
Further, when all sample data exceed the upper limit value or the lower limit value of the original cloud storage space, C is 1, the lower limit value of the cloud storage space is 0, and if all sample data do not exceed the upper limit value or the lower limit value of the original cloud storage space, C is 0, the lower limit value of the cloud storage space is equal to the upper limit value of the cloud storage space.
For example, if the upper limit value of the raw cloud storage space is 10, the lower limit value of the raw cloud storage space is 4, Y is 3.5, and the variance is 0.5G, then B is 3.5-0.5 ═ 3, the adjusted upper limit value of the cloud storage space is 10/(1+ (3/3.5)) -5.4G, and the adjusted lower limit value of the cloud storage space is (1+ (3/3.5)) -4 ═ 7.4G, so that the upper limit value of the cloud storage space is lower than the lower limit value of the cloud storage space, which causes a contradiction.
At this time, the upper limit value of the cloud storage space, that is, the upper limit value of the cloud storage space is preferably adjusted to be 5.4G, but the lower limit value of the cloud storage space is adjusted to be (1-C) × the upper limit value, C is a proportion of sample data which exceeds the upper limit value of the original cloud storage space or the lower limit value of the cloud storage space in the sample data acquired by the server, in an extreme case, if all the sample data exceed the upper limit value of the original cloud storage space or the lower limit value of the cloud storage space, C is 1, the lower limit value of the cloud storage space is 0, and if all the sample data do not exceed the upper limit value of the original cloud storage space or the lower limit value of the cloud storage space, C.
For example, the upper limit value of the raw cloud storage space is 10, the lower limit value of the raw cloud storage space is 4, 10 sample data are collected, which are (12G), (9G), (8.5G), (7G), (5G), (4.8G), (4.4G), (4.1G), (3G), and 1G, and the number of the sample data exceeding is 3: 12G, 3G, and 1G, C is 0.3, and after the cloud storage space upper limit value is adjusted to 5.4G, the cloud storage space lower limit value is adjusted to (1-0.3) × 5.4 — 3.8G.
Further, the value of X is half of the current upper limit value of the cloud storage space.
Further, the value of Y and the value of X satisfy the following relationship: and Y is X/2.
Further, the server determines a cloud storage space value allocated to a single user according to the adjusted upper limit value and lower limit value of the cloud storage space, and the following formula is adopted:
L=(M+N)/2;
and L is the cloud storage space value determined to be allocated to the single user, M is the adjusted upper limit value of the cloud storage space, and N is the adjusted lower limit value of the cloud storage space.
As shown in fig. 2, the present invention further provides a server, which includes a memory 201, a processor 202, and a computer program 203 stored in the memory and operable on the processor, wherein when the processor 202 executes the computer program 203, the cloud storage space allocation method according to any embodiment of the foregoing cloud storage space allocation method can be implemented.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.