A data management method and system for intelligent Internet of Things platform
By improving the combination of simulated annealing algorithm and Otsu threshold algorithm, optimizing the segmentation and coding compression of temperature data sequence, the problem of low segmentation efficiency of temperature data sequence in the intelligent Internet of Things platform is solved, and the data management efficiency and compression effect are improved.
Patent Information
- Application Number
- CN202410902882.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-07-08
AI Technical Summary
In the process of segmenting the air-conditioning temperature data sequence in the existing technology in the intelligent Internet of Things platform, the traditional simulated annealing algorithm fails to effectively consider the segmentation requirements, resulting in poor Otsu threshold traversal effect and affecting the compression management efficiency.
Using an improved simulated annealing algorithm, by adjusting the new solution acceptance probability and disturbance amount, combined with the Otsu threshold algorithm, the traversal process of segmentation temperature is optimized. The stationarity and data difference of the temperature data segment are used to determine the optimal segmentation temperature, and the temperature data is Encode and compress.
It improves the segmentation efficiency and coding compression efficiency of temperature data sequences, achieves faster and more accurate temperature data management, reduces computing power usage, and improves the overall performance of the intelligent IoT platform.
Smart Images

Figure CN118445335B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data management method and system for an intelligent Internet of Things platform. Background Art
[0002] Smart home is an important application of the smart IoT platform. In the smart home scenario, in order to ensure the user's living experience, the indoor temperature needs to be frequently controlled and adjusted. Since temperature monitoring data is a long-term series of monitoring, the sensor acquisition frequency is high. Therefore, in the smart IoT platform, there is a lot of temperature monitoring data for the air-conditioning system. In order to realize the intelligent control and adjustment of the air-conditioning system, the smart IoT platform needs to compress and store the temperature monitoring data, so as to facilitate the platform to call and analyze the temperature data.
[0003] In the smart home scenario, the temperature data sequence monitored by the air conditioning system meets the characteristics of continuity and stable temperature data changes, that is, there should be multiple temperature data segments with the same or similar data values in a sequence. Therefore, the entire temperature data sequence can be divided into multiple data segments with the same temperature data range, and each data segment can be encoded and compressed, and the high redundancy and repeatability of the data can be used to improve the compression efficiency and compression effect. The prior art usually uses the Otsu threshold algorithm to sequence the temperature data when segmenting the data segments. The Otsu threshold algorithm can adaptively obtain the appropriate segmentation temperature as the threshold for segmentation, but the traditional Otsu threshold traverses more segmentation temperatures when searching for the optimal segmentation temperature, that is, the number of traversals is large, which easily causes the computing power of the smart Internet of Things platform to be occupied and affects other task processing. Therefore, the simulated annealing algorithm can be used to perturb the Otsu threshold algorithm, thereby reducing the number of traversals while obtaining the optimal result. However, traditional simulated annealing does not take into account the impact of the segmentation results on the simulated annealing algorithm during the application of the Otsu threshold, that is, it does not take into account the segmentation requirements of the temperature data sequence segmentation. As a result, the traversal optimization effect is poor, and the temperature data sequence cannot be segmented quickly and accurately, which in turn affects the compression management efficiency of the temperature data sequence on the smart Internet of Things platform. Summary of the invention
[0004] In order to solve the technical problem that the existing simulated annealing algorithm does not take into account the segmentation requirements of the temperature data sequence of the air conditioner in the intelligent Internet of Things platform, which leads to the poor traversal effect of the Otsu threshold, the temperature data sequence cannot be segmented quickly and accurately, and the compression management efficiency of the temperature data sequence of the intelligent Internet of Things platform is affected, the purpose of the present invention is to provide a data management method and system for the intelligent Internet of Things platform, and the technical scheme adopted is as follows:
[0005] The present invention proposes a data management method for an intelligent Internet of Things platform, the method comprising:
[0006] Obtaining a temperature data sequence during the operation of the air conditioner according to a preset sampling frequency;
[0007] The elements in the temperature data sequence are sorted according to the element values to obtain a sorted temperature sequence; the optimal segmentation temperature of the sorted temperature sequence is determined by using the Otsu threshold algorithm, and in the process of determining the optimal segmentation temperature, the segmentation temperature of the Otsu threshold is perturbed and traversed by using the improved simulated annealing algorithm; the improved simulated annealing algorithm comprises: for the segmentation result under each traversal process of the segmentation temperature, according to the data difference between two temperature data segments in the segmentation result and the temperature distribution within the neighborhood range of the segmentation position, a probability improvement coefficient is obtained and the acceptance probability of the new solution in the traditional simulated annealing algorithm is adjusted; in the perturbation traversal process, according to the difference in temperature volatility within the neighborhood range of the segmentation position between two adjacent traversal processes and the probability improvement coefficient of the previous traversal process, a perturbation improvement coefficient is obtained and the perturbation amount is improved;
[0008] The sorted temperature sequence is segmented according to the optimal segmentation temperature to obtain a sorted temperature subsequence; the optimal segmentation temperature of the sorted temperature subsequence is determined and segmented to obtain a new sorted temperature subsequence until a preset segmentation condition is met, and the result of the final sorted temperature subsequence is mapped to the temperature data sequence to obtain a plurality of temperature segmentation segments of the temperature sequence;
[0009] Data replacement and coding compression are performed on each of the temperature segments.
[0010] Furthermore, the objective function determination method in the Otsu threshold segmentation algorithm includes:
[0011] Obtaining a sum of variances of intra-class variances of the two temperature data segments in the segmentation result, and taking a ratio of an inter-class variance between the two temperature data segments to the sum of variances as a variance target value;
[0012] For each temperature data in the temperature sequence, find the time when the temperature changes the most within a preset time range before the time corresponding to the temperature data, and obtain the temperature change tolerance of the temperature data according to the temperature information and time information at the time when the temperature changes the most;
[0013] Obtaining the overall deviation between each temperature data in the segmentation result and the corresponding temperature data segment, weighting the temperature change tolerance as the weight of the overall deviation to obtain a weighted overall deviation; averaging the negative correlation mapping results of the weighted overall deviation of each temperature data to obtain a stable target value;
[0014] The function value of the objective function is determined according to the variance target value and the stability target value.
[0015] Furthermore, the method for obtaining the temperature change tolerance includes:
[0016] For each temperature data in the temperature sequence, within a preset time range before the corresponding moment of the temperature data, obtain the temperature difference between the temperature data and other temperature data, take the other temperature data with the largest temperature difference as the maximum change temperature, and the moment corresponding to the maximum change temperature is the moment of maximum temperature change;
[0017] The time interval between the maximum temperature change moment and the corresponding temperature data is obtained, and the ratio of the maximum temperature change to the time interval is used as the temperature change tolerance.
[0018] Furthermore, the method for obtaining the probability improvement coefficient includes:
[0019] taking the difference in average temperature between two temperature data segments in the segmentation result as the first data difference;
[0020] The temperature data of one temperature data segment within the segmentation position neighborhood is recorded as the first comparison temperature data, and the temperature data of another temperature data segment is recorded as the second comparison temperature data; the difference between the first comparison temperature data and the second comparison temperature data is taken as the second data difference;
[0021] The product of the first data difference and the second data difference is normalized to obtain a first initial improvement coefficient, and the first initial improvement coefficient is added to a preset first minimum improvement ratio to obtain the probability improvement coefficient.
[0022] Furthermore, the acceptance probability of a new solution in the traditional simulated annealing algorithm is adjusted by:
[0023] The product of the new solution acceptance probability and the probability improvement coefficient is taken as the adjusted new solution acceptance probability.
[0024] Furthermore, the method for obtaining the disturbance improvement coefficient includes:
[0025] For each traversal process, the variance of the temperature data within the neighborhood of the segmentation position is taken as the temperature volatility;
[0026] For each traversal process, the difference between the temperature volatility under this traversal process and the temperature volatility under the previous traversal process is taken as the temperature volatility difference; the product of the temperature volatility difference and the probability improvement coefficient of the previous traversal process is normalized to obtain a second initial improvement coefficient, and the second initial improvement coefficient is added to the preset second minimum improvement ratio to obtain the disturbance improvement coefficient.
[0027] Further, the method of improving the disturbance amount includes:
[0028] The product of the disturbance amount and the disturbance improvement coefficient is taken as the adjusted disturbance amount.
[0029] Furthermore, the preset segmentation condition includes:
[0030] If the inter-class variance of the sorted temperature subsequence is less than a preset variance threshold, it is determined that the sorted temperature subsequence meets a preset segmentation condition.
[0031] Furthermore, the data replacement and coding compression for each temperature segment includes:
[0032] The temperature data mean of each temperature segment replaces all the data in the corresponding temperature segment to obtain a temperature smoothing sequence, and the temperature smoothing sequence is encoded and compressed using run-length encoding.
[0033] The present invention also proposes a data management system for an intelligent Internet of Things platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the steps of a data management method for an intelligent Internet of Things platform when executing the computer program.
[0034] The present invention has the following beneficial effects:
[0035] In the embodiment of the present invention, in the process of processing the temperature data sequence during the operation of the air conditioner by the Otsu threshold algorithm, the simulated annealing algorithm is used to jump out of the local optimal solution and then determine the global optimal solution for the traversal process of the segmentation temperature in the Otsu threshold algorithm. Further considering the segmentation requirements of the temperature data sequence, in the simulated annealing algorithm, for each traversal of the segmentation temperature, the segmentation effect shown by the segmentation result reflects the stability of the two temperature data segments, and then determines the probability improvement coefficient to adjust the acceptance probability of the new solution; further considering that there is a large amount of data with stable connection in the temperature data sequence of the intelligent Internet of Things platform, the simulated annealing algorithm should not have a large amount of unnecessary disturbances, which are not conducive to fast segmentation. Therefore, the disturbance amount is further improved according to the segmentation result in the traversal process and the probability improvement coefficient of the previous traversal process, so as to achieve the improvement and optimization of the simulated annealing algorithm, so that the improved simulated annealing algorithm can combine the segmentation requirements and find the global optimal solution faster, that is, determine the optimal segmentation temperature, and then achieve effective segmentation of the temperature data sequence. The temperature segment segments generated by the segmentation are replaced and encoded and compressed to improve the information repeatability of the single segment data, thereby improving the efficiency of the encoding compression. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A flow chart of a data management method for an intelligent Internet of Things platform provided by one embodiment of the present invention;
[0038] Figure 2 A flow chart of a method for determining an objective function in an Otsu threshold segmentation algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the data management method and system for a smart Internet of Things platform proposed by the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0040] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0041] The two algorithms involved in the embodiment of the present invention are the Otsu threshold algorithm and the simulated annealing algorithm. The two algorithms are well-known technical means for those skilled in the art, and only a brief description of the two algorithms is given here:
[0042] (1) The Otsu threshold algorithm is also called the Otsu algorithm. It is widely used in the process of segmenting two types of data. In the Otsu algorithm, all the segmentation thresholds that can be cited can be traversed through the exhaustive method, and the optimal segmentation threshold is determined according to the size of the inter-class variance generated by each segmentation result. Then, the data set is divided into two categories using the optimal segmentation threshold.
[0043] (2) The simulated annealing algorithm is an optimization algorithm that is mainly used to find the optimal solution during the traversal process. Its idea is based on the principle of metal annealing. When the temperature of the metal is very high, the internal energy is large, and the particles inside the metal are in rapid disordered motion. When the temperature slowly decreases, the internal energy of the metal decreases, and the particles gradually approach order. Finally, when the metal is at room temperature, the internal energy reaches the minimum and the particles are most stable. Based on this principle, the simulated annealing algorithm starts from a relatively high initial temperature. As the temperature parameter continues to decrease, the solution of the algorithm tends to be stable, but the stable solution may be a local optimal solution. If the traversal process is stopped directly at this time, the final solution will fall into a local optimal situation. Therefore, the simulated annealing algorithm will jump out of the local optimal solution with a certain probability to find the global optimal solution. The two important parameters in this process are the acceptance probability of the new solution and the disturbance amount. In the specific process, a fixed disturbance is used to change the temperature, and the energy change of the system is calculated. If the energy change is less than or equal to 0, the changed system state can be used as the starting point of the next change. If the energy change is greater than 0, the acceptance probability of the new solution after the change is obtained by using the ratio of the energy change to the changed temperature. This ratio is positively correlated with the acceptance probability of the new solution. Then a number is randomly selected from 0 to 1. If the random number is less than the acceptance probability of the new solution, the changed temperature is used as the starting point of the next traversal, otherwise the temperature before the change continues to be used as the starting point until the equilibrium condition is reached. It should be noted that the temperature mentioned above is not the temperature data in the intelligent Internet of Things platform targeted by the embodiment of the present invention, but is only an example information for explaining the simulated annealing algorithm process.
[0044] The following is a detailed description of a data management method and system for an intelligent Internet of Things platform provided by the present invention in conjunction with the accompanying drawings.
[0045] Embodiment 1:
[0046] See also Figure 1 , which shows a flow chart of a data management method for an intelligent Internet of Things platform provided by an embodiment of the present invention, the method comprising:
[0047] Step S101: obtaining a temperature data sequence during the operation of the air conditioner according to a preset sampling frequency.
[0048] In a specific implementation of an embodiment of the present invention, a temperature sensor is installed near the air conditioner to collect temperature data. The collection frequency is set to once per second, and each collection lasts for 12 hours. The collected temperature data sequence is sent to the smart Internet of Things platform. The smart Internet of Things platform obtains the temperature data sequence and performs segmentation and encoding in the subsequent process.
[0049] Step S102: sort the elements in the temperature data sequence according to the element values to obtain a sorted temperature sequence; use the Otsu threshold algorithm to determine the optimal segmentation temperature of the sorted temperature sequence. During the determination of the optimal segmentation temperature, use the improved simulated annealing algorithm to perturb and traverse the segmentation temperature of the Otsu threshold.
[0050] In order to facilitate the segmentation of the temperature data sequence in the embodiment of the present invention, the elements in the sequence are re-sorted according to their sizes to obtain a sorted temperature sequence. It should be noted that the sorted temperature sequence can be a descending sorting result or an ascending sorting result, and each element in the sorted temperature sequence corresponds to an element in the temperature data sequence.
[0051] After determining the sorting temperature sequence, the Otsu threshold algorithm can be used to determine the optimal segmentation temperature of the sorting temperature sequence. In the process of determining the optimal segmentation temperature, the segmentation temperature of the Otsu threshold is perturbed and traversed by the improved simulated annealing algorithm. The perturbation traversal changes the waste of computing power caused by the exhaustive traversal, and achieves a faster and more accurate optimal segmentation temperature. That is, the simulated annealing algorithm changes the traversal process in the Otsu threshold. The segmentation temperature traversed by the Otsu threshold algorithm is the solution in the simulated annealing algorithm. Each segmentation temperature corresponds to an objective function in the Otsu threshold algorithm. By changing the traversal process, the target value of the objective function can be quickly determined, and then the optimal segmentation temperature can be determined.
[0052] Because the acceptance probability of the new solution in the traditional simulated annealing algorithm is determined only according to the data changes between different traversal processes, it does not take into account that the intelligent Internet of Things platform wants to segment two data segments with relatively stable temperature distribution, which will result in the inability to quickly and effectively determine the optimal segmentation temperature during the segmentation temperature traversal process of the traditional simulated annealing control Otsu threshold. Therefore, in the improved simulated annealing algorithm of the embodiment of the present invention, the acceptance probability of the new solution and the disturbance amount are improved and adjusted according to the segmentation result after each traversal. In the process of improving and adjusting the acceptance probability of the new solution, because the embodiment of the present invention aims to obtain data with relatively stable temperature distribution in two segments, the probability improvement coefficient is obtained according to the data difference between the two segments of temperature data in the segmentation result and the temperature distribution within the neighborhood of the segmentation position, wherein the greater the data difference, the better the segmentation result, the better the result of this traversal, the greater the probability of accepting the current solution, that is, the greater the probability improvement coefficient, and the current new solution acceptance probability needs to be increased; the more obvious the difference in temperature distribution within the neighborhood of the segmentation position, the more obvious the segmentation position is, which means that the segmentation position is an obvious segmentation point, and the result of this traversal is better, the greater the probability of accepting the current solution, that is, the greater the probability improvement coefficient, and the current new solution acceptance probability needs to be increased. Based on this principle, the improvement coefficient can be obtained and used to adjust the acceptance probability of new solutions in the traditional simulated annealing algorithm, and the adjusted acceptance probability of new solutions can be obtained for subsequent simulated annealing algorithm execution.
[0053] In a specific implementation of an embodiment of the present invention, the neighborhood range of the segmentation position is a range with a size of 4 centered on the segmentation position, that is, in the sorted temperature sequence, there are two temperature data on the left side of the segmentation position and two temperature data on the right side, constituting the neighborhood range of the segmentation position.
[0054] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the probability improvement coefficient includes:
[0055] The difference in average temperature between two temperature data segments in the segmentation result is taken as the first data difference.
[0056] The temperature data of one temperature data segment within the neighborhood of the segmentation position is recorded as the first comparison temperature data, and the temperature data of another temperature data segment is recorded as the second comparison temperature data; the difference between the first comparison temperature data and the second comparison temperature data is taken as the second data difference. That is, the second data difference is used to characterize the temperature distribution within the neighborhood of the segmentation position.
[0057] If the second difference is larger while the first data difference is larger, it means that the current segmentation result is a better segmentation result, and the acceptance probability of the new solution needs to be increased. Therefore, a larger improvement coefficient is needed to adjust the acceptance probability of the new solution. Therefore, the product of the first data difference and the second data difference is normalized to obtain the first initial improvement coefficient, and the first initial improvement coefficient is added to the preset first minimum improvement ratio to obtain the probability improvement coefficient. It should be noted that the preset minimum improvement ratio is a constant for each traversal process. In order to standardize the adjustment of the acceptance probability of all new solutions, that is, without considering the first initial improvement coefficient generated by the segmentation result, each traversal will be adjusted by the preset first minimum improvement ratio, which ensures the overall uniformity and thereby amplifies the improvement degree of the first initial improvement coefficient. In a specific implementation of an embodiment of the present invention, the preset first minimum improvement ratio is set to 0.5.
[0058] As an example, in a specific implementation of the embodiment of the present invention, the probability improvement coefficient is expressed by a formula:
[0059] ;in is the probability improvement coefficient under the j-th traversal process, norm() is the normalization function, is the average temperature of the first temperature data segment in the segmentation result of the j-th traversal process, is the average temperature of the second temperature data segment in the segmentation result of the j-th traversal process, is the serial number of the first comparison temperature data, is the second sequence of comparative temperature data, is the temperature data difference between the yth first comparison temperature data and the xth second comparison temperature data.
[0060] In the probability improvement coefficient formula, the difference between the first comparative temperature data and the second comparative temperature data is characterized by the average value of the difference between the single comparative temperature data, that is, is the second data difference, is the first data difference. In the embodiment of the present invention, the normalization function adopts the range normalization function.
[0061] Preferably, in some implementations of the embodiments of the present invention, because the larger the probability improvement coefficient is, the greater the adjustment required for the new solution acceptance probability is, that is, the two are positively correlated, the product of the new solution acceptance probability and the probability improvement coefficient is taken as the adjusted new solution acceptance probability.
[0062] Further considering that in the simulated annealing algorithm, the disturbance of the independent variable is also an important parameter affecting the algorithm, so the disturbance amount needs to be adjusted. The main purpose of the disturbance amount is to determine the next disturbance of this traversal. Combined with the principle of traditional simulated annealing, attention should be paid to the information change between the previous traversal process and this traversal. Therefore, in the perturbation traversal process, the embodiment of the present invention considers the difference in temperature fluctuation within the neighborhood range of the segmentation position between two adjacent traversal processes. If the temperature fluctuation difference reflects that the temperature fluctuation under this traversal process is greater, it means that the segmentation result of this time is more stable than the previous segmentation result. The more it belongs to the optimal solution, the larger the disturbance amount should be, so that it can jump out of the local optimal solution and find the global optimal solution; further considering that the segmentation temperature of this traversal is the improved result of the new solution acceptance probability under the probability improvement coefficient under the previous traversal process, if the new solution acceptance probability under the previous traversal is improved greatly, then a larger disturbance amount is also required to jump out of the local optimal solution. Based on this principle, the disturbance improvement coefficient can be obtained and the disturbance amount can be improved.
[0063] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the disturbance improvement coefficient includes:
[0064] For each traversal process, the variance of the temperature data within the neighborhood of the segmentation position is taken as the temperature volatility. That is, the greater the temperature volatility, the more stable the data distribution within the two temperature data segments, and the better the segmentation result of this traversal.
[0065] For each traversal process, the difference between the temperature volatility in this traversal process and the temperature volatility in the previous traversal process is taken as the temperature volatility difference. That is, the greater the temperature volatility difference, the greater the temperature volatility in the neighborhood of the segmentation position in this traversal process compared with the previous traversal process, and the better the segmentation effect of this traversal.
[0066] The product of the temperature volatility difference and the probability improvement coefficient of the previous traversal process is normalized to obtain a second initial improvement coefficient, and the second initial improvement coefficient is added to the preset second minimum improvement ratio to obtain a disturbance improvement coefficient. The principle of the preset second minimum improvement ratio is the same as that of the preset first minimum improvement ratio, which will not be described in detail here. In a specific implementation of an embodiment of the present invention, the preset second minimum improvement ratio is set to 0.5.
[0067] As an example, in a specific implementation of the embodiment of the present invention, the disturbance improvement coefficient is expressed by a formula:
[0068] ;in is the disturbance improvement coefficient under the j-th traversal process, is the probability improvement coefficient under the j-1th traversal process, is the temperature fluctuation under the j-th traversal process, is the temperature fluctuation under the j-1th traversal process, and norm( ) is the normalization function.
[0069] Preferably, in some implementations of the embodiments of the present invention, similar to improving the probability of acceptance of the new solution probability, the method of improving the disturbance amount includes: taking the product of the disturbance amount and the disturbance improvement coefficient as the adjusted disturbance amount.
[0070] Step S103: Segment the sorted temperature sequence according to the optimal segmentation temperature to obtain a sorted temperature subsequence; determine the optimal segmentation temperature of the sorted temperature subsequence and segment it to obtain a new sorted temperature subsequence until the preset segmentation condition is met, and map the final result of the sorted temperature subsequence to the temperature data sequence to obtain a number of temperature segmentation segments of the temperature sequence.
[0071] By processing according to the algorithm in step S2, the optimal segmentation temperature for the sorted temperature sequence can be obtained. The sorted temperature sequence can then be segmented using the optimal segmentation temperature to obtain two sorted temperature subsequences. Because the present invention aims to obtain temperature data segments with smooth temperature data ranges in multiple segments, it is necessary to continue segmenting the sorted temperature subsequences, that is, continue to determine the optimal segmentation temperature of the sorted temperature subsequences and segment them to obtain new sorted temperature subsequences, and iterate this process until the sorted temperature subsequences meet the preset segmentation conditions, which proves that the segmentation is complete. The results of the final sorted temperature subsequences are mapped to the temperature data sequence to obtain several temperature segmentation segments in the temperature sequence.
[0072] Preferably, in some implementations of the embodiments of the present invention, the preset segmentation conditions include:
[0073] If the inter-class variance of the sorted temperature subsequence is less than a preset variance threshold, it is determined that the sorted temperature subsequence meets the preset segmentation condition. In a specific implementation of the embodiment of the present invention, the variance threshold is set to 1.2.
[0074] Step S104: Replace the data of each temperature segment and perform coding compression.
[0075] Because each temperature segment is composed of a group of temperature data with the same or similar temperature data range, the temperature segment can be further smoothed by data replacement to enhance information repeatability and thus improve the coding efficiency of the smart IoT platform. The encoded and compressed temperature data can be stored in the platform for subsequent calls or analysis.
[0076] Preferably, in some implementations of the embodiments of the present invention, performing data replacement and encoding compression on each temperature segment includes:
[0077] The mean value of the temperature data of each temperature segment replaces all the data in the corresponding temperature segment to obtain a temperature smoothing sequence, which is then encoded and compressed using run-length coding.
[0078] In summary, in the embodiment of the present invention, when the temperature data sequence in the air-conditioning operation process is processed by the Otsu threshold algorithm, the segmentation temperature traversal process in the Otsu threshold algorithm is used. For each segmentation temperature traversal in the simulated annealing algorithm, the segmentation effect shown by the segmentation result reflects the stability of the two temperature data segments, and then the probability improvement coefficient is determined to adjust the acceptance probability of the new solution, and the disturbance amount is improved according to the segmentation result in the traversal process and the probability improvement coefficient of the previous traversal process, and the optimal segmentation temperature is determined. The temperature data sequence is effectively segmented, and the temperature segment segments generated by the segmentation are replaced and encoded and compressed. The improved simulated annealing algorithm proposed in the present invention can combine the segmentation requirements, find the optimal segmentation temperature more quickly, and improve the encoding and compression efficiency of the air-conditioning temperature data sequence on the smart Internet of Things platform.
[0079] Embodiment 2:
[0080] In order to further improve the segmentation effect of the intelligent Internet of Things platform on the temperature data sequence, the embodiment of the present invention further refers to Figure 2 , which shows a flow chart of a method for determining an objective function in an Otsu threshold segmentation algorithm provided by an embodiment of the present invention. That is, the embodiment of the present invention further improves the Otsu threshold algorithm, improves its objective function and thus realizes effective segmentation of the temperature data sequence. The specific method includes:
[0081] Step S201: Obtain the sum of the variances of the intra-class variances of the two temperature data segments in the segmentation results, and take the ratio of the inter-class variance to the sum of the variances between the two temperature data segments as the variance target value.
[0082] In the traditional Otsu threshold algorithm, the inter-class variance can be used as the objective function to control the start and stop of the traversal, that is, when the inter-class variance is the largest, the objective function is considered to have reached the target value and the traversal is stopped; similarly, the inter-class variance can also be used as the objective function to control the start and stop of the traversal, that is, when the intra-class variance is the smallest, the objective function is considered to have reached the target value and the traversal is stopped. The embodiment of the present invention considers both the inter-class variance and the intra-class variance at the same time, that is, the larger the inter-class variance and the smaller the intra-class variance, the closer the objective function has reached the target value. Therefore, the sum of the variances of the intra-class variances of the two temperature data segments in the segmentation result is obtained, and the ratio of the inter-class variance to the sum of the variances between the two temperature data segments is used as the variance target value. That is, the larger the variance target value, the larger the function value of the objective function should be.
[0083] Step S202: for each temperature data in the temperature sequence, find the maximum temperature change moment within a preset time range before the corresponding moment of the temperature data, and obtain the temperature change tolerance of the temperature data according to the temperature information and time information at the maximum temperature change moment.
[0084] The embodiment of the present invention further considers that after obtaining the temperature segment, it is necessary to perform a data replacement operation on it, that is, the data replacement operation is essentially a lossy compression, and for the temperature data sequence of the air conditioner in the smart Internet of Things platform, it is necessary to reduce the compression loss as much as possible. Therefore, in the process of segmenting the temperature segment, it is necessary to consider the temperature change tolerance of the temperature data, that is, the greater the temperature change tolerance, the more the temperature data should be classified into a certain category to participate in data replacement, so the temperature change tolerance can be used as a characteristic data to adjust the function value of the objective function.
[0085] For a temperature data, the closer it is to the location of the previous large temperature change, the more it belongs to the data after the temperature change, and the greater the temperature change tolerance; at the same time, considering that the greater the temperature change at the location of the large temperature change, the more easily the temperature data is affected by the temperature of the location of the large temperature change, and therefore the greater the temperature change tolerance of the temperature data. Therefore, the embodiment of the present invention searches for the maximum temperature change moment within a preset time range before the corresponding moment of the temperature data, and obtains the temperature change tolerance of the temperature data based on the temperature information and time information at the maximum temperature change moment.
[0086] In a specific implementation of the embodiment of the present invention, the preset time range is set to thirty minutes.
[0087] Step S203: Obtain the overall deviation between each temperature data in the segmentation result and the temperature data segment to which it belongs, weight the allowable degree of temperature change as the weight of the overall deviation to obtain the weighted overall deviation; accumulate the inverse of the weighted overall deviation of each temperature data to obtain a stable target value.
[0088] For the segmentation result of a segmentation temperature, the smaller the overall deviation of a temperature data relative to the temperature data segment to which it belongs, the more adapted the temperature data is in the temperature data segment to which it belongs, and the better the segmentation result is at this time; further considering the influence of the allowable degree of temperature change, the allowable degree of temperature change can be used as a weight to be weighted with the overall deviation to obtain a weighted overall deviation. The weighted overall deviation represents the allowable loss of temperature data under the current segmentation result. The smaller the weighted overall deviation, the better the current segmentation result is, and the smaller the allowable loss is during lossy encoding. Therefore, the negative correlation mapping results of the weighted overall deviation of each temperature data are averaged to obtain a stable target value. That is, the larger the stable target value, the better the current segmentation effect is, and the larger the function value of the objective function should be.
[0089] Step S204: Determine the function value of the objective function according to the variance target value and the stability target value.
[0090] Because the larger the variance target value and the larger the stability target value, the better the current segmentation effect is and the larger the function value of the objective function is, the function value of the objective function can be determined based on the variance target value and the stability target value.
[0091] As an example, in a specific implementation of the embodiment of the present invention, the objective function is expressed by a formula:
[0092] ;in is the function value of the objective function under the j-th traversal, is the inter-class variance of the segmentation result under the j-th traversal, is the intra-class variance of the segmentation result under the j-th traversal, is another intra-class variance of the segmentation result under the j-th traversal, N is the number of temperature data in the temperature data sequence, is the temperature change tolerance of the i-th temperature data, is the data value of the i-th temperature data, It is the average temperature data value of the temperature data segment of the i-th temperature data under the segmentation result of the j-th traversal.
[0093] In the objective function formula, the difference between the average temperature data values in the temperature data domain is used as the overall deviation, where the positive integer 1 is used to prevent the denominator from being 0. That is, the negative correlation mapping of the weighted overall deviation is achieved in the form of a reciprocal, and then the average is combined with the variance target value by multiplication.
[0094] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the temperature change tolerance includes:
[0095] For each temperature data in the temperature sequence, the temperature difference between the temperature data and other temperature data is obtained within a preset time range before the corresponding moment of the temperature data, and the other temperature data with the largest temperature difference is taken as the maximum change temperature, and the moment corresponding to the maximum change temperature is the moment of maximum temperature change.
[0096] The time interval between the maximum temperature change moment and the corresponding temperature data is obtained, and the ratio of the maximum temperature change to the time interval is used as the temperature change tolerance.
[0097] Embodiment 3:
[0098] The present invention also proposes a data management system for an intelligent Internet of Things platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any one of the steps of a data management method for an intelligent Internet of Things platform is implemented.
[0099] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0100] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A data management method for an intelligent Internet of Things platform, characterized in that: The method comprises: Obtaining a temperature data sequence during the operation of the air conditioner according to a preset sampling frequency; The elements in the temperature data sequence are sorted according to the element values to obtain a sorted temperature sequence; the optimal segmentation temperature of the sorted temperature sequence is determined by using the Otsu threshold algorithm, and in the process of determining the optimal segmentation temperature, the segmentation temperature of the Otsu threshold is perturbed and traversed by using the improved simulated annealing algorithm; the improved simulated annealing algorithm comprises: for the segmentation result under each traversal process of the segmentation temperature, according to the data difference between two temperature data segments in the segmentation result and the temperature distribution within the neighborhood range of the segmentation position, a probability improvement coefficient is obtained and the acceptance probability of the new solution in the traditional simulated annealing algorithm is adjusted; in the perturbation traversal process, according to the difference in temperature volatility within the neighborhood range of the segmentation position between two adjacent traversal processes and the probability improvement coefficient of the previous traversal process, a perturbation improvement coefficient is obtained and the perturbation amount is improved; The sorted temperature sequence is segmented according to the optimal segmentation temperature to obtain a sorted temperature subsequence; the optimal segmentation temperature of the sorted temperature subsequence is determined and segmented to obtain a new sorted temperature subsequence until a preset segmentation condition is met, and the result of the final sorted temperature subsequence is mapped to the temperature data sequence to obtain a plurality of temperature segmentation segments of the temperature sequence; Performing data replacement and coding compression on each of the temperature segments; The objective function determination method in the Otsu threshold segmentation algorithm includes: Obtaining a sum of variances of intra-class variances of the two temperature data segments in the segmentation result, and taking a ratio of an inter-class variance between the two temperature data segments to the sum of variances as a variance target value; For each temperature data in the temperature sequence, find the time when the temperature changes the most within a preset time range before the time corresponding to the temperature data, and obtain the temperature change tolerance of the temperature data according to the temperature information and time information at the time when the temperature changes the most; Obtaining the overall deviation between each temperature data in the segmentation result and the corresponding temperature data segment, weighting the temperature change tolerance as the weight of the overall deviation to obtain a weighted overall deviation; averaging the negative correlation mapping results of the weighted overall deviation of each temperature data to obtain a stable target value; Determining a function value of the objective function according to the variance target value and the stability target value; The method for obtaining the probability improvement coefficient includes: taking the difference in average temperature between two temperature data segments in the segmentation result as the first data difference; The temperature data of one temperature data segment within the segmentation position neighborhood is recorded as the first comparison temperature data, and the temperature data of another temperature data segment is recorded as the second comparison temperature data; the difference between the first comparison temperature data and the second comparison temperature data is taken as the second data difference; Normalizing the product of the first data difference and the second data difference to obtain a first initial improvement coefficient, and adding the first initial improvement coefficient to a preset first minimum improvement ratio to obtain the probability improvement coefficient; The method for obtaining the disturbance improvement coefficient includes: For each traversal process, the variance of the temperature data within the neighborhood of the segmentation position is taken as the temperature volatility; For each traversal process, the difference between the temperature volatility under this traversal process and the temperature volatility under the previous traversal process is taken as the temperature volatility difference; the product of the temperature volatility difference and the probability improvement coefficient of the previous traversal process is normalized to obtain a second initial improvement coefficient, and the second initial improvement coefficient is added to the preset second minimum improvement ratio to obtain the disturbance improvement coefficient.
2. The data management method for a smart Internet of Things platform according to claim 1, characterized in that: The method for obtaining the temperature change tolerance includes: For each temperature data in the temperature sequence, within a preset time range before the corresponding moment of the temperature data, obtain the temperature difference between the temperature data and other temperature data, take the other temperature data with the largest temperature difference as the maximum change temperature, and the moment corresponding to the maximum change temperature is the moment of maximum temperature change; The time interval between the maximum temperature change moment and the corresponding temperature data is obtained, and the ratio of the maximum temperature change to the time interval is used as the temperature change tolerance.
3. The data management method for a smart Internet of Things platform according to claim 1, characterized in that: Adjustments to the acceptance probability of new solutions in the traditional simulated annealing algorithm include: The product of the new solution acceptance probability and the probability improvement coefficient is taken as the adjusted new solution acceptance probability.
4. The data management method for a smart Internet of Things platform according to claim 1, characterized in that: Methods to improve the perturbation volume include: The product of the disturbance amount and the disturbance improvement coefficient is taken as the adjusted disturbance amount.
5. The data management method for a smart Internet of Things platform according to claim 1, characterized in that: The preset segmentation conditions include: If the inter-class variance of the sorted temperature subsequence is less than a preset variance threshold, it is determined that the sorted temperature subsequence meets a preset segmentation condition.
6. The data management method for a smart Internet of Things platform according to claim 1, characterized in that: The data replacement and coding compression for each temperature segment comprises: The temperature data mean of each temperature segment replaces all the data in the corresponding temperature segment to obtain a temperature smoothing sequence, and the temperature smoothing sequence is encoded and compressed using run-length encoding.
7. A data management system for an intelligent Internet of Things platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the data management method for an intelligent Internet of Things platform as described in any one of claims 1 to 6 are implemented.
