Background
With the continuous development of data networks, the data volume in the society is larger and larger at present.
The server can obtain a large amount of data samples and analyze the data samples to draw a conclusion, which is a process of processing big data.
For mobile terminals, the use frequency of the photographing function is higher and higher, and more photos are stored on the mobile terminal of the user. In addition, the size of a single picture is larger and larger as the pixels of the camera of the mobile terminal are pulled higher. These situations are superimposed, resulting in an increasing occupation of the storage space of the mobile terminal by the photos.
Therefore, the mobile terminal can remind the user to compress the photos so as to reduce the occupation of the storage space. In the prior art, the upper limit value and the lower limit value of the storage space occupied by the photos of the mobile terminal are generally configured by a server in a unified manner, and when the storage space occupied by the photos exceeds the lower limit value, a user is reminded to compress the photos; and when the storage space occupied by the photos exceeds the upper limit value, the photos are automatically compressed.
However, some neglects, the mobile terminal is updated faster, and the upper limit value and the lower limit value of the fixed one-time switch cannot meet the actual requirements of the user. For example, when the lower limit value is 500M, and the storage capacity of the mobile terminal is up to 512G, the available space is 400G, and the user does not mind that the photos exceed 500M. But due to the lower limit value of 500M for one cutting, the user can frequently receive the reminding to compress the photos, which causes unnecessary interference to the user.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a picture compression control method for a mobile terminal, so as to adapt to actual situations. The method comprises the following steps:
the server sets an upper picture compression limit value and a lower picture compression limit value; the lower limit value of the picture compression is a threshold value for reminding a user of carrying out the picture compression, and the upper limit value of the picture compression is a threshold value for automatically carrying out the picture compression;
the server collects a plurality of sample data and counts the condition that the sample data exceeds the upper limit value or the lower limit value of the picture compression;
the server calculates variance according to the plurality of sample data;
the server judges whether the variance exceeds a preset range, if so, the server adjusts the picture compression upper limit value and the picture compression lower limit value; the larger the variance is, the larger the difference between the picture compression upper limit value and the picture compression lower limit value is adjusted to be;
and the server counts the condition that the newly acquired sample data exceeds the adjusted upper limit value of the picture compression or the adjusted lower limit value of the picture compression.
Wherein the variance is calculated by:
wherein V (X) is variance; x (t) is the sample data value; n is the number of sample data;
is the sample mean.
The server judges whether the variance exceeds a preset range, and if so, the server adjusts the picture compression upper limit value and the picture compression lower limit value, including:
the preset range comprises a variance upper limit value and a variance lower limit value, and when the server judges that the variance is between the variance upper limit value and the variance lower limit value, the picture compression upper limit value and the picture compression lower limit value are kept unchanged.
And the variance upper limit value is the arithmetic average value of the current picture compression upper limit value and the current picture compression lower limit value.
Wherein the variance lower limit value is 0.5 times of the variance upper limit value.
In an embodiment of the present invention, when the variance is greater than the variance upper limit, the adjusted picture compression upper limit is: (1+ (a/variance upper limit))) adjusting a pre-picture compression upper limit; the adjusted picture compression lower limit value is as follows: adjusting a pre-picture compression lower limit value/(1 + (A/variance upper limit value)); wherein A is the difference value between the variance and the variance upper limit value.
In another embodiment of the present invention, when the variance is smaller than the variance lower limit, the adjusted picture compression upper limit is: the picture compression upper limit value/(1 + (B/variance lower limit value)) before adjustment; the adjusted picture compression lower limit value is as follows: (1+ (B/variance lower limit)). picture compression lower limit before adjustment; wherein B is the difference between the variance and the variance lower limit value.
When the variance is smaller than the variance lower limit value, if the adjusted picture compression upper limit value is smaller than the adjusted picture compression lower limit value, the following processing is performed:
keeping the adjusted picture compression upper limit value unchanged; the adjusted picture compression lower limit value is as follows: (1-C) an adjusted picture compression upper limit value; and C is the proportion of sample data which exceeds the upper limit value of picture compression before adjustment or the lower limit value of picture compression before adjustment in the sample data acquired by the server.
In the invention, when the variance of the sample data exceeds a preset range, the sample data is proved to have larger fluctuation, at the moment, the server can adjust the upper limit value and the lower limit value of the picture compression, and count the newly acquired sample data by using the adjusted upper limit value or the adjusted lower limit value of the picture compression.
Detailed Description
The present invention will be described in detail with reference to the accompanying drawings.
First, the application scenario is explained:
some internet enterprises launch a mobile phone APP (application), namely a mobile phone housekeeper, and one function of the mobile phone APP is picture compression. Therefore, an image compression upper limit value and a picture compression lower limit value are set in the mobile phone manager APP by default. When the fact that the size of the storage space occupied by the pictures in the mobile phone exceeds the picture compression lower limit value is detected, a mobile phone housekeeper sends out a notice to remind a user of picture compression. However, when the size of the storage space occupied by the pictures in the mobile phone is detected to exceed the picture compression upper limit value, the mobile phone housekeeper automatically performs picture compression processing.
Because the update iteration of mobile phone products is fast, for different mobile phones, the fixed upper and lower limit values of picture compression cannot meet the actual requirements due to factors such as hardware performance, user tolerance, numerous scenes and the like. For example, the following may occur: the performance of a mobile phone of a certain user is better, the memory space is as high as 10G, the storage space is as high as 512G, and since the lower limit value of the fixed picture compression is 150M (obviously lower), the user will continuously receive a notification to perform picture compression when the performance of the mobile phone is still good, but the actual situation is that the user does not need. This causes a large interference to the user.
Based on the above, the invention collects the size of the storage space occupied by the picture when each mobile phone terminal provided with the mobile phone housekeeper carries out picture compression from the server side, thereby dynamically changing the upper and lower limit values of the picture compression according to the collected data and pushing the upper and lower limit values to each mobile phone terminal for updating. The dynamic adjustment can be closer to the actual situation and meet the actual requirement.
Referring to fig. 1, a flowchart of an embodiment of a picture compression control method of a mobile terminal according to the present invention is illustrated. As shown in the figure, the method comprises the following steps:
step S11, the server sets up the picture compression upper limit value and the picture compression lower limit value; the lower picture compression limit value is a threshold value for reminding a user of carrying out picture compression cleaning, and the upper picture compression limit value is a threshold value for carrying out automatic cleaning.
In this step, the server sets the upper limit value and the lower limit value of the picture compression to be pushed to the corresponding mobile terminal, and the corresponding APP on the mobile terminal is updated and executed accordingly. The process of the invention can be understood as a continuous loop, and the setting of the step can be understood as the upper and lower limit values of the picture compression adjusted by the last loop.
Step S12, the server collects a plurality of sample data and counts the condition that the sample data exceeds the picture compression upper limit value or the picture compression lower limit value.
In this step, the sample data collected by the server is the data uploaded by each mobile terminal, that is, the size of the storage space occupied by the picture when the user on the mobile terminal manually performs picture compression cleaning. In general, after a mobile phone housekeeper reminds a user of how much picture space is occupied (assuming that a reminding value is P), the user clicks a notification to enter a picture compression page, and the size of the picture space occupied by the user is calculated through actual analysis is Q. Then, the sample data collected in this step may be P, Q, or both, depending on the strategy design.
In fact, the reminding value P may be closer to the index tolerance of the user, that is, the value given by the last (last) notification reminding before the user manually performs picture compression, that is, the last reminding value of picture compression; the size Q of the actual image space occupation is probably closer to the actual tolerance of the user, the user always actively compresses the image when the mobile phone is jammed, and the size Q of the analyzed image space occupation staff can represent the actual requirement of the user.
Step S13, the server calculates a variance according to the plurality of sample data.
For the specific calculation method of the variance, the following formula is adopted in one embodiment of the present invention:
wherein V (X) is variance; x (t) is a sample data value, that is, a P or Q value when a picture uploaded by each mobile terminal is compressed; n is the number of sample data;
is the sample mean.
In step S14, the server determines whether the variance exceeds a preset range, if so, performs step S15, otherwise performs step S17.
In this step, the preset range may be a numerical value or a range formed by numerical value intervals. In one embodiment of the present invention, the preset range is a range including an upper limit and a lower limit, that is, a range composed of an upper variance limit value X and a lower variance limit value Y. When the variance calculated in the previous step is not within the interval [ Y, X ], step S15 is executed, otherwise step S17 is executed.
Step S15, the server adjusts the picture compression upper limit value and the picture compression lower limit value.
In this step, the adjustment principle is that the larger the variance is, the larger the difference between the upper limit value of picture compression and the lower limit value of picture compression is, otherwise, the smaller the variance is, the smaller the difference between the upper limit value of picture compression and the lower limit value of picture compression is.
In one embodiment of the present invention, the variance upper limit value may be an arithmetic average of the current picture compression upper limit value and the picture compression lower limit value; the variance lower limit value can be 0.5 times the variance upper limit value correspondingly.
For the specific adjustment method, the following method may be adopted in the embodiment of the present invention:
when the variance is greater than the variance upper limit, the adjusted picture compression upper limit is as follows: (1+ (a/variance upper limit))) adjusting a pre-picture compression upper limit; the adjusted picture compression lower limit value is as follows: adjusting a pre-picture compression lower limit value/(1 + (A/variance upper limit value)); wherein A is the difference value between the variance and the variance upper limit value.
For example, when the upper limit of picture compression before adjustment is 860, the lower limit of picture compression before adjustment is 150, X is 505, and the variance is 650, a is 650-.
When the variance is smaller than the variance lower limit, the adjusted picture compression upper limit is as follows: the picture compression upper limit value/(1 + (B/variance lower limit value)) before adjustment; the adjusted picture compression lower limit value is as follows: (1+ (B/variance lower limit)). picture compression lower limit before adjustment; wherein B is the difference between the variance and the variance lower limit value.
For example, when the upper limit of picture compression before adjustment is 860, the lower limit of picture compression before adjustment is 150, Y is 252.5, and the variance is 144.3, B is 252.5 to 144.3 ═ 108.2, the upper limit after adjustment is 860/(1+ (108.2/252.5)) -602, and the lower limit after adjustment is (1+ (108.2/252.5)) -150 ═ 214.3.
In practical applications, the following may occur: when the variance is smaller than the variance lower limit, the adjusted picture compression upper limit may be smaller than the adjusted picture compression lower limit, which causes a contradiction. When such a situation is encountered, the following can be done:
keeping the adjusted upper limit value of the picture compression unchanged, namely taking the adjusted upper limit value of the picture compression as a priority principle; the adjusted picture compression lower limit value is as follows: (1-C) an adjusted picture compression upper limit value; and C is the proportion of sample data which exceeds the upper limit value of picture compression before adjustment or the lower limit value of picture compression before adjustment in the sample data acquired by the server.
For example, if the original upper limit value is 860, the original lower limit value is 300, Y is 252.5, and the variance is 36, B is 252.5-36-216.5, the adjusted upper limit value of picture compression is 860/(1+ (216.5/252.5)) -463, and the adjusted lower limit value of picture compression is (1+ (216.5/252.5)) -300-557.2, the upper limit value is lower than the lower limit value, which results in contradiction.
In this case, the upper limit value, i.e., the upper limit value is preferably adjusted to 463, but the lower limit value is adjusted to (1-C) × the adjusted upper limit value of picture compression; and C is the proportion of sample data which exceeds the upper limit value of picture compression before adjustment or the lower limit value of picture compression before adjustment in the sample data acquired by the server. In an extreme case, if all sample data exceed the upper limit value or the lower limit value of the picture compression before adjustment, C is 1, and the lower limit value is 0, and if all sample data do not exceed the upper limit value or the lower limit value, C is 0, and the lower limit value is equal to the upper limit value.
For example, if the upper limit of picture compression before adjustment is 860, the lower limit of picture compression before adjustment is 300, and 10 sample data are collected, which are (1032), (774), (731), (602), (430), (412.8), (378.4), (352.6), (258), and (86), the number of sample data exceeding the sample data is 3: 1032. 258, 86, then C is 0.3, and after the upper limit value of picture compression is adjusted to 463 according to the rule, the lower limit value of picture compression will be adjusted to (1-0.3) × 463 ═ 324.1.
After the step is finished, a new picture compression upper limit value and a new picture compression lower limit value are generated, and then the server pushes the new upper limit value and the new lower limit value to each mobile terminal. Meanwhile, the server also executes the process of the embodiment again in a loop manner to perform control dynamically. That is, in step S16, statistics with the new upper and lower limit values are started.
And step S16, the server counts the condition that the newly acquired sample data exceeds the adjusted picture compression upper limit value or the adjusted picture compression lower limit value.
Step S17, the picture compression upper limit value and the picture compression lower limit value are kept unchanged.
In this step, when the variance is within the preset range, it indicates that the sample data fluctuation is small, and the current picture compression upper limit value and the current picture compression lower limit value can also meet the requirements, so that the variance is kept unchanged.
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.