A smart agricultural information management system
By analyzing and adjusting the arrangement order of characters in the compression dictionary in the smart agricultural information management system, the problem of reduced character retrieval efficiency during agricultural data compression is solved and the data compression efficiency is improved.
Patent Information
- Application Number
- CN202411074024.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-07
AI Technical Summary
In the process of agricultural data compression in the existing technology, as the number of characters in the compression dictionary increases, the retrieval efficiency gradually decreases, affecting the data compression effect.
Through the pre-read data acquisition module, potential contribution rate acquisition module, character mode related value acquisition module and arrangement order adjustment module, the arrangement order of characters in the compressed dictionary is analyzed and adjusted, and the characters are determined based on the potential contribution rate and character mode related values. The arrangement priority value optimizes the character retrieval order.
It improves the character retrieval efficiency in the data compression process and improves the data compression efficiency, making data compression in the smart agricultural information management system more efficient.
Smart Images

Figure CN118590072B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information retrieval, and in particular to a smart agriculture information management system. Background Art
[0002] Benefiting from the rapid development of information technology, smart agricultural information management systems can realize relevant intelligent decision-making and management by better collecting and utilizing agricultural-related data, and have been widely used in the agricultural field. During operation, smart agricultural information management systems usually use various sensors to monitor various agricultural data such as environmental conditions, soil moisture, and meteorological data. Due to the huge amount of agricultural data, these agricultural data need to be compressed before they are stored.
[0003] Since agricultural data is usually different types of time-series data, and has a certain periodicity, high data repetition rate, and high redundancy, the existing Lempel Ziv Welch (LZW) compression algorithm is often used to compress agricultural data. However, when the existing LZW algorithm is used to compress agricultural data, as the compression process proceeds, the number of characters in the compression dictionary will gradually increase, which will cause the retrieval efficiency of the characters in the compression dictionary to gradually decrease, which is not conducive to the data compression process. Summary of the invention
[0004] The object of the present invention is to provide a smart agricultural information management system for solving the problem that the retrieval efficiency of characters in a compression dictionary gradually decreases during the existing data compression process.
[0005] In order to solve the above technical problems, the present invention provides a smart agricultural information management system, comprising:
[0006] The pre-read data acquisition module is used to: during the compression process of the target data, determine the data amount of the current backward pre-read data according to the data amount of the current compressed data and the data amount of the original data corresponding to the current compressed data, and acquire the current backward pre-read data according to the data amount of the current backward pre-read data;
[0007] A potential contribution rate acquisition module is used to: determine the occurrence frequency of each character in the current compression dictionary in the current pre-read backward data and the current compressed data, and the distance value of each character in the current compression dictionary from the time point when it was last used for compression to the current time point, and determine the potential contribution rate of each character in the current compression dictionary according to the distance value and occurrence frequency corresponding to each character in the current compression dictionary and the data volume of the current pre-read backward data and the data volume of the current compressed data;
[0008] A character mode related value acquisition module, used to: determine the amount of data between each adjacent occurrence of each character in the current compression dictionary in the data currently pre-read backward, and determine the character mode related value of each character in the current compression dictionary according to the character length of each character and the amount of data between each adjacent occurrence of each character in the data currently pre-read backward;
[0009] The arrangement order adjustment module is used to determine the arrangement priority value of each character in the current compression dictionary according to the potential contribution rate of each character and the character mode related value, and adjust the arrangement order of all characters in the current compression dictionary according to the arrangement priority value.
[0010] Further, the potential contribution rate of each character in the current compression dictionary is determined, including:
[0011] Perform negative correlation mapping on the distance value corresponding to each character in the current compression dictionary to obtain the negative correlation mapping value corresponding to each character in the current compression dictionary;
[0012] Determine the ratio of the frequency of occurrence of each character in the current compression dictionary in the current compressed data to the data volume of the current compressed data as the frequency of occurrence of each character in the current compression dictionary in the current compressed data;
[0013] Determine the ratio of the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data to the data volume of the current backward pre-read data as the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data;
[0014] Calculate the product value of the negative correlation mapping value corresponding to each character in the current compression dictionary and the occurrence frequency of the corresponding character in the current compressed data, and determine the product value as the occurrence frequency correction value of each character in the current compression dictionary in the current compressed data;
[0015] The potential contribution rate of each character in the current compression dictionary is determined based on the frequency of occurrence of each character in the current pre-read backward data and the correction value of the frequency of occurrence of each character in the current compressed data. The frequency of occurrence of each character in the current pre-read backward data and the correction value of the frequency of occurrence of each character in the current compressed data are both positively correlated with the potential contribution rate.
[0016] Furthermore, the negative correlation mapping value corresponding to each character in the current compression dictionary is obtained, and the corresponding calculation formula is:
[0017]
[0018] in, Indicates the characters in the current compression dictionary The corresponding negative correlation mapping value; represents the correction factor; Indicates the characters in the current compression dictionary The corresponding distance value; Represents an exponential function with the natural constant e as base.
[0019] Further, the potential contribution rate of each character in the current compression dictionary is determined, including:
[0020] The addition of the occurrence frequency of each character in the current compression dictionary in the currently pre-read backward data and the occurrence frequency correction value of each character in the currently compressed data is calculated, and the addition is determined as the potential contribution rate of each character in the current compression dictionary.
[0021] Further, determining the character mode related value of each character in the current compression dictionary includes:
[0022] Calculate the average value of the amount of data between each adjacent occurrence of each character in the current compression dictionary in the currently pre-read backward data, and determine the average value as the mean value of the amount of data interval corresponding to each character in the current compression dictionary;
[0023] According to the character length of each character in the current compression dictionary and the corresponding mean value of the interval data amount, the character pattern related value of each character in the current compression dictionary is determined, the character length is positively correlated with the character pattern related value, and the mean value of the interval data amount is negatively correlated with the character pattern related value.
[0024] Further, determining the character mode related value of each character in the current compression dictionary includes:
[0025] The ratio of the character length of each character in the current compression dictionary to the corresponding average value of the interval data amount is determined as the character mode related value of each character in the current compression dictionary.
[0026] Further, determining the amount of data currently read in advance backward includes:
[0027] The ratio of the amount of currently compressed data to the amount of original data corresponding to the currently compressed data is determined as the current data compression efficiency;
[0028] The amount of data currently pre-read backward is determined based on the amount of currently compressed data and the current data compression efficiency. The amount of currently compressed data is positively correlated with the amount of data currently pre-read backward, and the current data compression efficiency is negatively correlated with the amount of data currently pre-read backward.
[0029] Furthermore, the amount of data currently read backward in advance is determined, and the corresponding calculation formula is:
[0030]
[0031] in, Indicates the amount of data currently read in advance; Indicates the amount of data currently compressed; Indicates the amount of original data corresponding to the currently compressed data; Indicates the current data compression efficiency; Represents an exponential function with the natural constant e as base.
[0032] Further, determining the arrangement priority value of each character in the current compression dictionary includes:
[0033] The sum of the potential contribution rate of each character in the current compression dictionary and the character mode related value is determined as the arrangement priority value of each character in the current compression dictionary.
[0034] Furthermore, according to the arrangement priority value, the arrangement order of all characters in the current compression dictionary is adjusted, including:
[0035] All characters in the current compression dictionary are arranged in descending order of the arrangement priority values.
[0036] The present invention has the following beneficial effects: the management system of the present invention adjusts the arrangement order of all characters in the current compression dictionary during the compression of target data, thereby effectively improving the character retrieval efficiency during the data compression process. Specifically, by analyzing the data compression situation of the currently compressed data, the data volume of the current backward pre-read data is reasonably determined, and the data of the data volume is pre-read backward. Then, by analyzing the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data and the current compressed data, and the length of the interval from the time point when each character is used for compression for the latest time to the current time point, the potential contribution of each character to the subsequent data compression is analyzed, thereby determining the potential contribution rate of each character. At the same time, considering that the higher the degree to which a character is continuously used for compression, the more beneficial it is to the subsequent compression process, and the length of the character itself also reflects the amount of data that can be compressed, therefore, combined with the length of each character in the current compression dictionary and the amount of data between each adjacent occurrence in the current backward pre-read data, the degree of benefit of each type of character to data compression is evaluated, thereby determining the character mode related value of each character. Finally, the potential contribution rate of each character and the character mode related value are comprehensively considered to determine the arrangement priority value, and the arrangement order of all characters in the current compression dictionary is adjusted. Since the present invention can adaptively and reasonably determine the arrangement order of all characters in the current compression dictionary during the data compression process, the characters that are more conducive to data compression are prioritized in the compression dictionary, thereby effectively improving the character retrieval efficiency during the data compression process, thereby improving the data compression efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] 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.
[0038] Figure 1 A schematic diagram of the structure of a smart agricultural information management system according to an embodiment of the present invention;
[0039] Figure 2 The present invention is a flowchart of a method for implementing a smart agricultural information management system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction 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.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. In addition, all parameters or indicators in the formulas involved in this article are normalized values that eliminate the influence of dimensions.
[0042] This embodiment provides a smart agricultural information management system, which is essentially a software system. The software system is composed of modules that implement corresponding functions. The corresponding structural diagram is shown in FIG. Figure 1 The core of the system is to realize a smart agricultural information management method. Each module in the system corresponds to each step in the method. The corresponding flowchart of the method is as follows Figure 2 As shown. The following is a detailed introduction to each module of the system in combination with the specific steps in the method.
[0043] The pre-read data acquisition module is used to: during the compression process of the target data, determine the data amount of the current backward pre-read data according to the data amount of the current compressed data and the data amount of the original data corresponding to the current compressed data, and acquire the current backward pre-read data according to the data amount of the current backward pre-read data.
[0044] In the working process of the smart agricultural information management system, when a certain type of agricultural data needs to be compressed, the certain type of agricultural data can be various types of agricultural data such as temperature data, humidity data, soil data, etc. Here, the certain type of agricultural data is called target data. First, determine the single character with the highest frequency in the target data, and then determine the 2-bit and 3-bit characters composed of 1-bit and 2-bit characters following the single character, and count the frequency of occurrence of these characters, and encode the characters with the highest frequency before the set percentage into the compression dictionary, thereby completing the initialization of the compression dictionary in the LZW algorithm. The specific value of the set percentage can be set as needed. In this embodiment, the value of the set percentage is set to 10%.
[0045] It should be understood that the above is only a specific implementation process of initializing the compression dictionary in the LZW algorithm. As other implementations, other existing methods in the prior art can also be used to initialize the compression dictionary in the LZW algorithm, which is not limited here. Moreover, as other implementations, the LZW algorithm in this embodiment can also replace various improved algorithms of the LZW algorithm.
[0046] Based on the above initialized compression dictionary, the target data is compressed using the LZW algorithm. In the process of data compression using the LZW algorithm, as the compression process proceeds, the number of characters in the compression dictionary will gradually increase, and each time a compression encoding operation is performed, the characters in the compression dictionary need to be searched, which will lead to lower and lower efficiency of character retrieval. In order to improve the efficiency of character retrieval, some common characters can be considered to be placed at the front of the compression dictionary, so as to speed up the retrieval when they may be used for compression.
[0047] Based on the above analysis, in order to improve the retrieval speed of characters in the compression dictionary, in the process of compressing the target data using the LZW algorithm, especially in the later stage of the compression process, after a certain compression encoding operation is completed, a certain amount of data to be compressed can be pre-read backwards, and the degree of correlation between the characters in these data and the characters that have been encoded in the compression dictionary can be judged in advance. Characters with a high degree of correlation in the compression dictionary are considered to have a high contribution to the subsequent data compression, and thus serve as the basis for judging the character sorting priority in the compression dictionary. Ultimately, characters with low contribution are placed at the back of the compression dictionary, and characters with higher contribution are placed at the front of the compression dictionary.
[0048] In order to facilitate the subsequent judgment of the contribution of the characters in the compression dictionary to the subsequent data compression, the data volume of the currently compressed data and the data volume of the original data corresponding to the currently compressed data are obtained, and the two data volumes are analyzed to determine the data volume of the current backward pre-read data. The implementation steps include:
[0049] The ratio of the amount of currently compressed data to the amount of original data corresponding to the currently compressed data is determined as the current data compression efficiency;
[0050] The amount of data currently pre-read backward is determined based on the amount of currently compressed data and the current data compression efficiency. The amount of currently compressed data is positively correlated with the amount of data currently pre-read backward, and the current data compression efficiency is negatively correlated with the amount of data currently pre-read backward.
[0051] Optionally, the calculation formula for determining the amount of data currently read backward in advance is:
[0052]
[0053] in, Indicates the amount of data currently read in advance; Indicates the amount of data currently compressed; Indicates the amount of original data corresponding to the currently compressed data; Indicates the current data compression efficiency; Represents an exponential function with the natural constant e as base.
[0054] For the above calculation formula of the amount of data currently read backward in advance, the amount of data currently read backward in advance is related to the compression efficiency of the currently compressed data. If the amount of currently compressed data is compared with the amount of its corresponding original data, the lower the compression efficiency is, that is, The larger the value of is, the more data is needed to determine the contribution of the characters in the compression dictionary to the subsequent data compression, so the amount of data to be pre-read backward is more. At the same time, the larger the amount of currently compressed data is, the more types of characters in the compression dictionary are. At this time, in order to more accurately determine the contribution of different types of characters in the compression dictionary to the subsequent data compression, the amount of data to be pre-read backward is also more.
[0055] After determining the amount of data currently pre-read backward in the above manner, obtain the data currently pre-read backward, that is, after the current compression encoding operation is completed, read a portion of uncompressed data backward in advance, the amount of which is equal to the amount of data currently pre-read backward in advance determined above.
[0056] A potential contribution rate acquisition module is used to: determine the frequency of occurrence of each character in the current compression dictionary in the current pre-read backward data and the currently compressed data, and the distance value of each character in the current compression dictionary from the time point when it was last used for compression to the current time point, and determine the potential contribution rate of each character in the current compression dictionary based on the distance value and frequency of occurrence corresponding to each character in the current compression dictionary and the data volume of the current pre-read backward data and the data volume of the currently compressed data.
[0057] After obtaining the current backward pre-read data, for each character in the current compression dictionary, when it appears multiple times in the current backward pre-read data and the compressed data, it means that this character has a greater contribution in the subsequent data compression process. Therefore, it is necessary to determine the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data. Since each character in the current compression dictionary refers to the character before encoding, that is, the original character, the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data can be directly obtained by statistics, and when determining the frequency of occurrence of each character in the current compression dictionary in the compressed data, it can be achieved by counting the frequency of occurrence of each character in the original data of the current compressed data.
[0058] At the same time, for each character in the current compression dictionary, when the time point when the character was last used for compression is closer to the current compression time point, it also means that the character is likely to have a greater contribution in the subsequent data compression process. This is because various types of agricultural data such as temperature data, humidity data, soil data, etc. change slowly and usually do not change to a large extent. Therefore, it is also necessary to determine the distance value from the time point when each character in the current compression dictionary was used for compression to the current time point. It should be understood that the distance value here can be the real distance value between two time points, or it can be used to characterize the difference between the mark value used by each character in the most recent compression coding operation and the mark value of the current next compression coding operation. When the time from the last compression coding operation of each character to the next compression coding operation is longer, the difference between the two mark values should be greater. For example, the mark value of the current next compression coding operation can be set to 0, the mark value of the last compression coding operation corresponding to the currently compressed data can be set to 1, and the mark value of the previous compression coding operation of the last compression coding operation can be set to 2, and so on.
[0059] On this basis, the potential contribution rate of each character in the current compression dictionary is determined by combining the two occurrence frequencies and the distance values corresponding to each character in the current compression dictionary. The implementation steps include:
[0060] Perform negative correlation mapping on the distance value corresponding to each character in the current compression dictionary to obtain the negative correlation mapping value corresponding to each character in the current compression dictionary;
[0061] Determine the ratio of the frequency of occurrence of each character in the current compression dictionary in the current compressed data to the data volume of the current compressed data as the frequency of occurrence of each character in the current compression dictionary in the current compressed data;
[0062] Determine the ratio of the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data to the data volume of the current backward pre-read data as the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data;
[0063] Calculate the product value of the negative correlation mapping value corresponding to each character in the current compression dictionary and the occurrence frequency of the corresponding character in the current compressed data, and determine the product value as the occurrence frequency correction value of each character in the current compression dictionary in the current compressed data;
[0064] The potential contribution rate of each character in the current compression dictionary is determined based on the frequency of occurrence of each character in the current pre-read backward data and the correction value of the frequency of occurrence of each character in the current compressed data. The frequency of occurrence of each character in the current pre-read backward data and the correction value of the frequency of occurrence of each character in the current compressed data are both positively correlated with the potential contribution rate.
[0065] Optionally, determining the potential contribution rate of each character in the current compression dictionary includes: calculating the addition of the frequency of occurrence of each character in the current compression dictionary in the currently pre-read backward data and the frequency correction value of each character in the currently compressed data, and determining the addition as the potential contribution rate of each character in the current compression dictionary.
[0066] At this time, determine the potential contribution rate of each character in the current compression dictionary, and the corresponding calculation formula is:
[0067]
[0068]
[0069] in, Indicates the characters in the current compression dictionary potential contribution rate; Indicates the characters in the current compression dictionary The frequency of occurrence in the current lookahead data; Indicates the amount of data currently read in advance; Indicates the characters in the current compression dictionary The frequency of occurrence in the current compressed data; Indicates the amount of data currently compressed; Indicates the characters in the current compression dictionary The corresponding negative correlation mapping value; Indicates the correction coefficient. In this embodiment, ; Indicates the characters in the current compression dictionary The corresponding distance value; Represents an exponential function with the natural constant e as base.
[0070] For the characters in the current compression dictionary above The potential contribution rate of and Can be regarded as characters The frequency of occurrence in the current backward pre-read data and the frequency of occurrence in the current compressed data. The higher the frequency, the more likely the character is to be The higher the potential contribution to subsequent data compression, the greater the corresponding potential contribution rate. The closer the last compression time point is to the current compression time point, the closer the character is to the current compression time point. The character is highly correlated with the data to be compressed. The higher the potential contribution to subsequent data compression. The weight of the frequency of occurrence in the current backward pre-read data for the potential contribution to the subsequent data compression is greater than the weight of the frequency of occurrence in the currently compressed data for the potential contribution to the subsequent data compression, because the pre-read data is the data to be compressed recently, and its priority should be higher than the data that has already been compressed. The farther away the time point of the last compression is from the current compression time point, the influence of the frequency of occurrence in the current compressed data on the calculation of the potential contribution of subsequent data compression will be weakened to a certain extent. The corresponding distance value The larger the value of The corresponding negative correlation mapping value As The smaller the weight, the smaller its value will be.
[0071] The character pattern related value acquisition module is used to: determine the amount of data between each adjacent occurrence of each character in the current compression dictionary in the data currently pre-read backward, and determine the character pattern related value of each character in the current compression dictionary based on the character length of each character and the amount of data between each adjacent occurrence in the data currently pre-read backward.
[0072] In the above steps, the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data is determined. Then, in the middle position of each occurrence of this character, that is, between two intervals of occurrence in the current backward pre-read data, there is also data, but the amount of data each time may be different. In addition to the number of occurrences, the interval between two adjacent occurrences can be regarded as the continuity of this character. If a certain character appears many times in the current backward pre-read data, and can always be used for compression after a very short interval, then this character must be more beneficial to the subsequent compression process. At the same time, the meaning of the self-length of each character in the current compression dictionary is the amount of data that the character itself can compress during the compression process. The longer the length of the character itself, the more beneficial it is to the compression process.
[0073] Based on the above analysis, combined with the character length of each character in the current compression dictionary and the amount of data between each two adjacent occurrences in the current backward pre-read data, the character mode related value of each character in the current compression dictionary is determined to represent the influence of the character length of each character in the current compression dictionary itself and the degree of continuity reflected by the character itself on the priority arrangement of the character in the compression dictionary. The implementation steps include:
[0074] Calculate the average value of the amount of data between each adjacent occurrence of each character in the current compression dictionary in the currently pre-read backward data, and determine the average value as the mean value of the amount of data interval corresponding to each character in the current compression dictionary;
[0075] According to the character length of each character in the current compression dictionary and the corresponding mean value of the interval data amount, the character pattern related value of each character in the current compression dictionary is determined, the character length is positively correlated with the character pattern related value, and the mean value of the interval data amount is negatively correlated with the character pattern related value.
[0076] Optionally, determining the character mode related value of each character in the current compression dictionary includes: determining the character mode related value of each character in the current compression dictionary as the ratio of the character length of each character in the current compression dictionary to the corresponding average value of the interval data amount.
[0077] At this time, the character mode related value of each character in the current compression dictionary is determined, and the corresponding calculation formula is:
[0078]
[0079] in, Indicates the characters in the current compression dictionary Character mode related values of ; Indicates the characters in the current compression dictionary The character length of Indicates the characters in the current compression dictionary The frequency of occurrence in the current lookahead data, ; Indicates the characters in the current compression dictionary The amount of data between the i-th and (i+1)-th occurrences in the current backward-previewed data.
[0080] For the characters in the current compression dictionary above The calculation formula for the character mode related value is Character length The larger the character The average value of the amount of data between each two adjacent occurrences in the current forward-read data The smaller the value, the more characters The more conducive it is to the compression of subsequent data, the greater the impact on its priority arrangement in the compression dictionary. The more should be prioritized in the compression dictionary.
[0081] It should be understood that, since the characters in the current compression dictionary are determined by the above formula When the character mode-related value is must appear at least twice in the current lookahead data. When a character does not appear or appears only once in the current pre-read data, it means that this type of character is not conducive to the compression of subsequent data. In this case, the value of the denominator in the above calculation formula is directly set to the amount of data currently pre-read, thereby obtaining the character pattern related value corresponding to this type of character.
[0082] The arrangement order adjustment module is used to determine the arrangement priority value of each character in the current compression dictionary according to the potential contribution rate of each character and the character mode related value, and adjust the arrangement order of all characters in the current compression dictionary according to the arrangement priority value.
[0083] After determining the potential contribution rate and the character pattern related value of each character in the current compression dictionary in the above manner, the sum of the potential contribution rate and the character pattern related value of each character in the current compression dictionary is determined as the arrangement priority value of each character in the current compression dictionary. The larger the value of the arrangement priority value, the more the corresponding character should be prioritized in the compression dictionary; conversely, the smaller the value of the arrangement priority value, the more the corresponding character should be sorted later in the compression dictionary. Therefore, after determining the arrangement priority value of each character in the current compression dictionary, the position of the arrangement order of various characters in the compression dictionary is adjusted according to the arrangement priority value, that is: all the characters in the current compression dictionary are arranged in order from large to small according to the arrangement priority value, so that the characters with larger arrangement priority values are sorted higher in the compression dictionary, thereby adjusting the arrangement order of all characters in the current compression dictionary.
[0084] Based on the current compression dictionary after the above-mentioned character arrangement order adjustment, the LZW algorithm is continued to be used for subsequent data compression of uncompressed data. In the process of continuing data compression, after a certain compression encoding operation is completed, the character arrangement order in the compression dictionary can be adjusted again in the above-mentioned manner to finally achieve the data compression process. Among them, the frequency of adjusting the character arrangement order in the compression dictionary can be selected as needed, and is not limited here. Since the arrangement order of all characters in the current compression dictionary is adjusted, the characters with higher contribution rates and more conducive to subsequent data compression can be arranged at the front in the compression dictionary. In the process of continuing to use the LZW algorithm for subsequent data compression of uncompressed data, the efficiency of data retrieval is effectively improved, thereby improving the data compression efficiency.
[0085] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A smart agricultural information management system, characterized in that: include: The pre-read data acquisition module is used to: during the compression process of the target data, determine the data amount of the current backward pre-read data according to the data amount of the current compressed data and the data amount of the original data corresponding to the current compressed data, and acquire the current backward pre-read data according to the data amount of the current backward pre-read data; the target data refers to agricultural data, and the agricultural data is temperature data, humidity data or soil data; A potential contribution rate acquisition module is used to: determine the occurrence frequency of each character in the current compression dictionary in the current pre-read backward data and the current compressed data, and the distance value of each character in the current compression dictionary from the time point when it was last used for compression to the current time point, and determine the potential contribution rate of each character in the current compression dictionary according to the distance value and occurrence frequency corresponding to each character in the current compression dictionary and the data volume of the current pre-read backward data and the data volume of the current compressed data; A character mode related value acquisition module, used to: determine the amount of data between each adjacent occurrence of each character in the current compression dictionary in the data currently pre-read backward, and determine the character mode related value of each character in the current compression dictionary according to the character length of each character and the amount of data between each adjacent occurrence of each character in the data currently pre-read backward; The arrangement order adjustment module is used to determine the arrangement priority value of each character in the current compression dictionary according to the potential contribution rate and character mode related value of each character, and adjust the arrangement order of all characters in the current compression dictionary according to the arrangement priority value.
2. A smart agricultural information management system according to claim 1, characterized in that: Determines the potential contribution of each character in the current compression dictionary, including: Perform negative correlation mapping on the distance value corresponding to each character in the current compression dictionary to obtain the negative correlation mapping value corresponding to each character in the current compression dictionary; Determine the ratio of the frequency of occurrence of each character in the current compression dictionary in the current compressed data to the data volume of the current compressed data as the frequency of occurrence of each character in the current compression dictionary in the current compressed data; Determine the ratio of the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data to the data volume of the current backward pre-read data as the frequency of occurrence of each character in the current compression dictionary in the current backward pre-read data; Calculate the product value of the negative correlation mapping value corresponding to each character in the current compression dictionary and the occurrence frequency of the corresponding character in the current compressed data, and determine the product value as the occurrence frequency correction value of each character in the current compression dictionary in the current compressed data; The potential contribution rate of each character in the current compression dictionary is determined based on the frequency of occurrence of each character in the current pre-read backward data and the correction value of the frequency of occurrence of each character in the current compressed data. The frequency of occurrence of each character in the current pre-read backward data and the correction value of the frequency of occurrence of each character in the current compressed data are both positively correlated with the potential contribution rate.
3. A smart agricultural information management system according to claim 2, characterized in that: Get the negative correlation mapping value corresponding to each character in the current compression dictionary. The corresponding calculation formula is: in, Indicates the characters in the current compression dictionary The corresponding negative correlation mapping value; represents the correction factor; Indicates the characters in the current compression dictionary The corresponding distance value; Represents an exponential function with the natural constant e as base.
4. A smart agricultural information management system according to claim 2, characterized in that: Determines the potential contribution of each character in the current compression dictionary, including: The addition of the occurrence frequency of each character in the current compression dictionary in the currently pre-read backward data and the occurrence frequency correction value of each character in the currently compressed data is calculated, and the addition is determined as the potential contribution rate of each character in the current compression dictionary.
5. A smart agricultural information management system according to claim 1, characterized in that: Determines the character mode-related values for each character in the current compression dictionary, including: Calculate the average value of the amount of data between each adjacent occurrence of each character in the current compression dictionary in the currently pre-read backward data, and determine the average value as the mean value of the amount of data interval corresponding to each character in the current compression dictionary; According to the character length of each character in the current compression dictionary and the corresponding mean value of the interval data amount, the character pattern related value of each character in the current compression dictionary is determined, the character length is positively correlated with the character pattern related value, and the mean value of the interval data amount is negatively correlated with the character pattern related value.
6. A smart agricultural information management system according to claim 5, characterized in that: Determines the character mode-related values for each character in the current compression dictionary, including: The ratio of the character length of each character in the current compression dictionary to the corresponding average value of the interval data amount is determined as the character mode related value of each character in the current compression dictionary.
7. A smart agricultural information management system according to claim 1, characterized in that: Determine the current amount of data to read ahead backwards, including: The ratio of the amount of currently compressed data to the amount of original data corresponding to the currently compressed data is determined as the current data compression efficiency; The amount of data currently pre-read backward is determined based on the amount of currently compressed data and the current data compression efficiency. The amount of currently compressed data is positively correlated with the amount of data currently pre-read backward, and the current data compression efficiency is negatively correlated with the amount of data currently pre-read backward.
8. A smart agricultural information management system according to claim 7, characterized in that: Determine the amount of data currently read backward in advance. The corresponding calculation formula is: in, Indicates the amount of data currently read in advance; Indicates the amount of data currently compressed; Indicates the amount of original data corresponding to the currently compressed data; Indicates the current data compression efficiency; Represents an exponential function with the natural constant e as base.
9. A smart agricultural information management system according to claim 1, characterized in that: Determines the arrangement priority value of each character in the current compression dictionary, including: The sum of the potential contribution rate of each character in the current compression dictionary and the character mode related value is determined as the arrangement priority value of each character in the current compression dictionary.
10. A smart agricultural information management system according to claim 1, characterized in that: And according to the arrangement priority value, the arrangement order of all characters in the current compression dictionary is adjusted, including: All characters in the current compression dictionary are arranged in descending order of the arrangement priority values.
Citation Information
Patent Citations
Intelligent analysis method for network traffic big data
CN117082156A
