A data collection method and system for placing garbage in compartments
By constructing the feature vector of the target data and replacing the target data with the median, the problem of data feature loss caused by median filtering is solved, and the accuracy of data collection and the reliability of analysis are improved.
Patent Information
- Application Number
- CN202411170318.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-08-26
AI Technical Summary
In the prior art, median filtering while processing filtered data will lead to smoothing of data characteristics, resulting in loss of some key information, and reducing the accuracy of the filtered data.
By obtaining the readings of multiple sensors, the feature vector of the target data is constructed, and the target data is replaced by the median of the feature values of the data points within the filtering window, thereby performing filtering while retaining the data characteristics.
The accuracy of the final collected data is improved, the original characteristics of the data are retained, and the odor in the garbage compartment can be analyzed more accurately.
Smart Images

Figure CN118673261B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and more specifically, to a data collection method and system for garbage placement in a compartment. Background Art
[0002] Although traditional garbage compartments provide convenience for people, they also have many problems. For example, the spread of garbage odor may affect the quality of life and health of residents. By collecting odor gas concentration data in the garbage compartment, odor problems that may exist in garbage disposal can be discovered and solved in a timely manner. However, the collected data may be affected by many factors. Therefore, the data needs to be filtered. Median filtering is a traditional and efficient filtering method. It can filter a data point by corresponding to the median of the data in the filter window.
[0003] In the related art, a recursive median filter calculation method and device are disclosed in the patent application document with publication number CN106021185A. The method includes: obtaining the first The filtered data sampling value of the sampling period and the Sampling periods ago The output value of the filtered data in each sampling period; is the filter width, , ;judge and size; when When The filtered data are arranged in order of size, and the median is calculated, which is used as the output value of the filter.
[0004] However, the filtering method used in the above scheme will smooth the data characteristics of the filtered data while filtering the filtered data. The obtained filtered data may not reflect the data characteristics of the data before filtering, resulting in the loss of some key information, which may reduce the accuracy of the filtered data to a certain extent. Summary of the invention
[0005] In order to solve the problem that the accuracy of the filtered data obtained by median filtering is low, the present invention proposes a data collection method and system for garbage disposal in compartments.
[0006] According to a first aspect of an embodiment of the present invention, a method for collecting data on garbage placed in a compartment is provided, comprising:
[0007] Obtain readings from multiple sensors installed on the top of the garbage compartment, each of which is used to collect odor gas concentration data in the garbage compartment;
[0008] The reading of any sensor at the current moment is taken as the target data, a filter window of the target data is preset, and the significance of the target data within the filter window is determined;
[0009] The readings of the remaining sensors at the current moment are used as comparison data, the difference and correlation between the target data and any comparison data are determined, and the degree of association between the target data and any comparison data is calculated. The degree of association is positively correlated with the correlation and negatively correlated with the ratio of the difference to the target data.
[0010] Get the mean of the correlation between the target data and all the comparison data, take the modulus of the eigenvector composed of significance and the mean as the eigenvalue of the target data, use the median of the eigenvalue of the data point in the filter window to replace the target data, and use the replaced target data as the final collected data.
[0011] The present invention constructs a feature vector of the target data by combining the mean of the degree of association between the target data and all the comparison data, and the significance of the target data in a filtering window, and uses the modulus of the feature vector of the target data as the feature value of the target data, so that the obtained feature value can accurately reflect the data characteristics of the target data; and when filtering the target data, the median of the feature value of each data point in the filtering window of the target data is used to replace the target data. In this way, the target data is filtered, and the data characteristics of the target data are retained while filtering the target data, so that the target data can be accurately filtered, and the accuracy of the final collected data is improved.
[0012] In an exemplary embodiment of the present invention, the degree of association between the target data and any comparison data satisfies the following relationship:
[0013] ;
[0014] In the formula, The target data and The degree of correlation between the comparison data; is the target data; For the Comparative data; The target data and The correlation between the comparison data; is the absolute value symbol; The natural constant An exponential function with base .
[0015] The present invention integrates multiple data to determine the degree of association between target data and any comparison data, which can ensure the accuracy of the determined degree of association. The present invention provides a calculation formula for the degree of association, which includes a normalization processing formula, which can reduce the difficulty of calculating the degree of association, thereby further ensuring the accuracy of the determined degree of association.
[0016] In an exemplary embodiment of the present invention, a method for obtaining correlation includes:
[0017] The square root of the difference between the target data and any comparison data is calculated, and the square root is used to measure the correlation between the target data and any comparison data. The correlation is the inverse of the square root.
[0018] In an exemplary embodiment of the present invention, determining the significance of target data within a filtering window includes:
[0019] Calculate the degree of fluctuation within the filter window , is the first A maximum value, is the first A minimum value, is the number of maxima in the filter window, is the number of minima within the filter window, is the maximum value within the filter window, is the minimum value within the filter window, is the absolute value symbol, for the summation symbol;
[0020] The mean of the difference between the target data and the remaining data points in the filter window is taken as the prominence of the target data, and the significance of the target data in the filter window is calculated. The significance is positively correlated with the prominence and negatively correlated with the fluctuation.
[0021] The present invention can determine the amplitude of the data points in the filtering window by calculating the difference between the average value of the maximum value in the filtering window and the average value of the minimum value, and determine the degree of fluctuation in the filtering window by comprehensively considering the difference between the maximum value and the minimum value in the filtering window, thereby ensuring the accuracy of the determined degree of fluctuation.
[0022] In an exemplary embodiment of the present invention, the significance satisfies the following relationship:
[0023] ;
[0024] In the formula, is the significance of the target data within the filtering window; is the prominence of the target data; is the degree of fluctuation within the filter window.
[0025] In an exemplary embodiment of the present invention, a method for acquiring a characteristic value of target data includes:
[0026] The mean of the correlation between the target data and all the comparison data is taken as the data correlation of the target data;
[0027] The characteristic value of the target data satisfies the following relationship:
[0028] ;
[0029] In the formula, is the characteristic value of the target data; is the significance of the target data within the filtering window; The data relevance of the target data; is the modulus of the feature vector composed of the feature value of the target data and the data correlation of the target data; A representation of a vector.
[0030] The present invention utilizes the data relevance of target data and the significance of target data in a filtering window to construct a feature vector of target data, which can accurately reflect the data characteristics of the target data.
[0031] In an exemplary embodiment of the present invention, the method further comprises:
[0032] When there are missing values in the filter window of the target data, the interpolation method is used to determine the fitting value of the missing value, and the fitting value is used as the missing value to fill the missing value in the filter window.
[0033] The present invention can accurately fill the missing values in the filter window, so that the characteristic value of each data point in the filter window can be accurately calculated, and then the target data can be accurately replaced.
[0034] According to a second aspect of an embodiment of the present invention, a data collection system for garbage placement in a compartment is provided. The data collection system for garbage placement in a compartment comprises a memory and a processor. A computer program is stored in the memory. The processor executes the computer program to implement the steps of the first aspect of the embodiment of the present invention.
[0035] The present invention has the following effects:
[0036] The present invention can determine whether the target data has a sudden enhanced data feature by determining the significance of the target data in the filtering window, and can determine whether the target data has a data feature different from that of the comparative data by determining the degree of correlation between the target data and the comparative data, thereby combining the significance of the target data in the filtering window and the overall degree of correlation between the target data and all comparative data to construct a feature vector of the target data, which can accurately reflect the data feature of the target data, and replace the target data with the median of the feature value of each data point in the filtering window, thereby improving the traditional median filter, so that the replaced target data can retain the original data feature, thereby improving the accuracy of the final collected data, and further accurately analyzing the odor situation in the garbage compartment. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0038] Figure 1 It is a schematic flow chart of the steps of a method for collecting data on garbage placed in a compartment according to an embodiment of the present invention;
[0039] Figure 2 It is a flow chart of the steps of determining the significance of target data within a filtering window in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0041] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0042] Reference Figure 1 , a data collection method for placing garbage in a compartment, comprising steps S1 to S4, which are specifically as follows:
[0043] S1: Obtain readings from multiple sensors installed on the top of the garbage compartment, each sensor is used to collect odor gas concentration data in the garbage compartment.
[0044] In an exemplary embodiment of the present invention, the garbage compartment may be a compartment in which a plurality of garbage bins are placed, and the sensors on the top of the garbage compartment may be installed one-to-one corresponding to the garbage bins, or may be evenly installed on the top of the garbage compartment, and the sensors installed on the top of the garbage compartment may be gas sensors, or olfactory sensors, and of course, may be other sensors that can collect odorous gas concentration data in the garbage compartment. This embodiment does not specifically limit the type of sensors and installation locations.
[0045] The odor gas concentration data refers to the concentration data of any gas emitted from the trash can collected by any sensor, which can be the concentration data of hydrogen sulfide gas, the concentration data of methane gas, or the concentration data of volatile organic compound gas. This embodiment does not specifically limit the type of gas collected by the sensor. It should be noted that the gas type of the odor gas concentration data collected by each sensor is the same.
[0046] Optionally, the collection frequency can be set to 1HZ to continuously collect the readings of each sensor installed on the top of the garbage compartment, so as to obtain the odor gas concentration data in the garbage compartment collected by each sensor during the sampling period. This embodiment does not specifically limit the setting of the collection frequency.
[0047] S2: Taking the reading of any sensor at the current moment as the target data, presetting the filter window of the target data, and determining the significance of the target data within the filter window.
[0048] In an exemplary embodiment of the present invention, the filter window refers to a window of a certain size, such as 1×10, which is constructed with the target data as the last data point, and is used as a window for filtering the target data. It should be noted that the sensor installed on the top of the garbage compartment generates an electrical signal based on the physical and chemical reaction of the gas being measured on the surface, is susceptible to environmental interference, and continues to age with the increase in usage time, causing the response characteristics of the sensor to gradually change and drift, which may affect the accuracy of the collected odor gas concentration data. Therefore, it is necessary to filter the odor gas concentration data collected by each sensor to improve the accuracy of the collected odor gas concentration data.
[0049] Optionally, when the reading of any sensor at the current moment is used as the target data, the process of building the filtering window of the target data is: select the readings of the sensor at 9 consecutive sampling moments before the current moment, obtain 9 data points before the target data collected by the sensor at the current moment, and use the window that can surround the target data point and the 9 data points before the target data as the filtering window of the target data.
[0050] Among them, significance refers to the data that evaluates the prominence of the target data compared to other data points in the filter window, and is used to determine the strength of the odor gas concentration collected by the corresponding sensor at the current moment, so as to determine whether the abnormal gas concentration collected by the sensor at the current moment has a data feature of sudden enhancement. For example, when the significance of the target data in the filter window is large, it means that the target data is more prominent in the filter window, that is, the odor gas concentration collected by the sensor at the current moment is large, then the odor gas concentration collected by the sensor at the current moment may have a data feature of sudden enhancement, and the reason for this may be that the garbage in the corresponding trash can is fermenting at the current moment, or the trash can is suddenly filled with garbage with a strong odor at the current moment, so that the odor gas concentration collected by the sensor at the current moment suddenly increases.
[0051] In an exemplary embodiment of the present invention, reference Figure 2 As shown, the determination of the significance of the target data within the filtering window can be achieved by the following steps:
[0052] S101: Calculate the fluctuation degree within the filter window;
[0053] Specifically, the degree of fluctuation within the filter window satisfies the following relationship:
[0054] ;
[0055] In the formula, is the degree of fluctuation within the filter window of the target data; is the first A maximum value; is the first Minimum value; is the number of maximum values in the filter window; is the number of minimum values in the filter window; is the maximum value within the filter window; is the minimum value within the filter window; is the absolute value symbol; is the summation symbol.
[0056] in, It reflects the amplitude of all data points in the filter window. The larger the value, the greater the fluctuation in the filter window. The smaller the value, the smaller the fluctuation in the filter window.
[0057] S102: Taking the mean of the difference between the target data and the remaining data points in the filter window as the prominence of the target data, the significance of the target data in the filter window is calculated. The significance is positively correlated with the prominence and negatively correlated with the fluctuation.
[0058] Specifically, the prominence of the target data , is the number of data points within the filter window, For the target data, is the first data points, is the absolute value symbol, is the summation symbol.
[0059] Furthermore, after determining the prominence of the target data and the degree of fluctuation within the filter window, the significance of the target data within the filter window can be calculated. Specifically, the significance of the target data within the filter window satisfies the following relationship:
[0060] ;
[0061] In the formula, is the significance of the target data within the filtering window; is the prominence of the target data; is the degree of fluctuation within the filter window.
[0062] Among them, when the prominence of the target data is greater, it means that the target data is more prominent in the filter window, and the smaller the fluctuation degree in the filter window, the more prominent the target data will be, and the corresponding target data has greater significance in the filter window.
[0063] In another embodiment, the significance of the target data in the filtering window may also be calculated by other formulas, such as by a calculation formula of a difference relationship between the prominence degree and the filtering degree instead of a calculation formula of a proportional relationship between the prominence degree and the fluctuation degree.
[0064] S3: Taking the readings of the remaining sensors at the current moment as comparison data, determining the difference and correlation between the target data and any comparison data, and calculating the degree of association between the target data and any comparison data, the degree of association is positively correlated with the correlation, and negatively correlated with the ratio of the difference to the target data.
[0065] In an exemplary embodiment of the present invention, the comparison data may be the readings of the remaining sensors at the current moment, that is, the odorous gas concentration data collected at the current moment by the sensors other than the sensor collecting the target data; the degree of association may be data used to measure the correlation between the target data and the corresponding comparison data, so as to infer whether the target data has different data characteristics. For example, when the degree of association between the target data and any comparison data is low, it means that the correlation between the target data and the comparison data is low, which means that the target data may have data characteristics different from other comparison data. For example, the trash can corresponding to the collected target data may suddenly be filled with trash with a strong odor, so that the target data has different data characteristics.
[0066] In an exemplary embodiment of the present invention, the correlation between the target data and any comparison data can be determined by the following steps:
[0067] The square root of the difference between the target data and any comparison data is calculated, and the square root is used to measure the correlation between the target data and any comparison data. The correlation is the inverse of the square root.
[0068] The square root of the difference between the target data and any comparison data is , then the correlation between the target data and the comparison data , where For the target data, For the A comparison data.
[0069] Furthermore, the absolute value of the difference between the target data and any comparison data can be calculated to obtain the difference between the target data and the comparison data. After the difference and correlation between the target data and the comparison data are determined, the degree of association between the target data and the comparison data can be calculated. Specifically, the degree of association between the target data and any comparison data satisfies the following relationship:
[0070] ;
[0071] In the formula, The target data and The degree of correlation between the comparison data; is the target data; For the Comparative data; The target data and The correlation between the comparison data; is the absolute value symbol; The natural constant An exponential function with base .
[0072] in, It reflects the degree of difference between the target data and the comparison data. The larger the value, the greater the difference between the target data and the comparison data, and the lower the correlation between the target data and the comparison data.
[0073] In another embodiment, the correlation degree between the target data and any comparison data may also be calculated by other formulas, such as by a summation formula instead of a product formula.
[0074] S4: Obtain the mean of the degree of correlation between the target data and all the comparison data, use the modulus of the eigenvector composed of significance and the mean as the eigenvalue of the target data, use the median of the eigenvalue of the data point in the filter window to replace the target data, and use the replaced target data as the final collected data.
[0075] It should be noted that median filtering is a traditional and efficient filtering algorithm, which can use the median of the data in the filtering window of any data point to replace the data point to filter the data point; however, since the odor gas concentration data in the garbage compartment may be affected by sudden garbage delivery, weather changes or equipment failures, the data at any moment may have data characteristics different from other data. Although the traditional median filtering algorithm can smooth out abnormal values, it may filter out some key environmental change information. Therefore, the present invention improves the traditional median filtering and can filter the data while retaining the data characteristics.
[0076] Among them, the data correlation of the target data can accurately determine the correlation between the target data and the odor gas concentration data of other locations in the garbage compartment collected at the same time, so as to determine whether the target data has data characteristics different from the comparison data; the significance of the target data in the filter window can characterize the prominence of the target data in the filter window, so as to judge whether the target data has sudden enhanced data characteristics relative to other data points in the filter window.
[0077] The modulus of the characteristic vector composed of the data correlation of the target data and the significance of the target data in the filter window can be used as the characteristic value of the target data, so that the data characteristics of the target data can be accurately characterized, and the characteristic value of each data point in the filter window can be determined in the same way to accurately characterize the data characteristics of each data point in the filter window, and then the traditional median filter can be improved, and the specific improvement is: the target data is replaced by the median of the characteristic value of each data point in the filter window. When the target data is filtered by the improved median filter, the data characteristics of the target data can be retained.
[0078] In an exemplary embodiment of the present invention, the characteristic value of the target data can be determined by the following steps:
[0079] The mean value of the correlation between the target data and all the comparison data is taken as the data correlation of the target data; the characteristic value of the target data satisfies the following relationship:
[0080] ;
[0081] In the formula, is the characteristic value of the target data; is the significance of the target data within the filtering window; The data relevance of the target data; is the modulus of the feature vector composed of the feature value of the target data and the data correlation of the target data; A representation of a vector.
[0082] Among them, the mean value of the correlation between the target data and all the comparison data , The target data and The correlation between the comparison data, is the number of comparison data, is the summation function.
[0083] In an exemplary embodiment of the present invention, when there are missing values in the filtering window, the missing values in the filtering window can be filled by the following steps:
[0084] When there are missing values in the filter window of the target data, the interpolation method is used to determine the fitting value of the missing value, and the fitting value is used as the missing value to fill the missing value in the filter window.
[0085] Optionally, quadratic spline interpolation can be used to interpolate data points within the filter window, or cubic spline interpolation can be used to interpolate data points within the filter window. Of course, a suitable method can be selected according to the specific situation to interpolate data points within the filter window. This embodiment does not specifically limit the selected interpolation method.
[0086] Optionally, after determining the characteristic value of the target data and completing the replacement of missing values in the filter window, the characteristic value of each data point in the filter window can be calculated, wherein the method for determining the characteristic value of each data point in the filter window is exactly the same as the method for determining the characteristic value of the target data, and this embodiment will not be elaborated here.
[0087] Furthermore, after determining the characteristic value of each data point in the filtering window, the characteristic value of each data point can be arranged in ascending order, and then the median of the characteristic value of each data point is selected, so as to use the median to replace the target data, so that the data characteristics of the target data can be retained while filtering the target data, and then the replaced target data can be used as the final collected data and transmitted to the storage system or display interface for subsequent analysis and use, so as to timely discover and solve the odor problem that may exist in garbage disposal.
[0088] The present invention also provides a data collection system for garbage placed in a compartment. The system includes a memory and a processor, and a computer program is stored in the memory. The computer program integrates the function of a data collection method for garbage placed in a compartment. When the computer program is executed, the data can be filtered while retaining the data characteristics through a data collection method for garbage placed in a compartment, thereby improving the accuracy of the collected data.
[0089] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0090] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for collecting data on garbage placed in a compartment, characterized in that: include: Obtaining readings of a plurality of sensors installed on the top of the garbage compartment, each of the sensors being used to collect odor gas concentration data in the garbage compartment; Taking the reading of any sensor at the current moment as the target data, presetting the filter window of the target data, and determining the significance of the target data within the filter window includes: calculating the fluctuation degree within the filter window , is the first A maximum value, is the first A minimum value, is the number of maxima in the filter window, is the number of minima within the filter window, is the maximum value within the filter window, is the minimum value within the filter window, is the absolute value symbol, is a summation symbol; taking the mean of the differences between the target data and the remaining data points in the filtering window as the prominence of the target data, calculating the significance of the target data in the filtering window, wherein the significance is positively correlated with the prominence and negatively correlated with the fluctuation degree; The readings of the remaining sensors at the current moment are used as comparison data to determine the difference and correlation between the target data and any comparison data. The method for obtaining the correlation includes: calculating the square root of the difference between the target data and any comparison data, using the square root to measure the correlation between the target data and any comparison data, the correlation is the inverse of the square root, and calculating the degree of association between the target data and any comparison data to satisfy the following relationship: ; In the formula, The target data and The degree of correlation between the comparison data; is the target data; For the Comparative data; The target data and The correlation between the comparison data; is the absolute value symbol; The natural constant An exponential function with as the base, the degree of association is positively correlated with the correlation, and negatively correlated with the ratio of the difference to the target data; The mean of the correlation between the target data and all the comparison data is obtained, and the mean of the correlation between the target data and all the comparison data is used as the data correlation of the target data. The modulus of the feature vector composed of the significance and the mean is used as the feature value of the target data to satisfy the following relationship: ; In the formula, is the characteristic value of the target data; is the significance of the target data within the filtering window; The data relevance of the target data; is the modulus of the feature vector composed of the feature value of the target data and the data correlation of the target data; is a representation of a vector, and the target data is replaced by the median of the eigenvalues of the data points in the filtering window, and the replaced target data is used as the final collected data.
2. A method for collecting data on garbage placed in a compartment according to claim 1, characterized in that: The significance satisfies the following relationship: ; In the formula, is the significance of the target data within the filtering window; is the prominence of the target data; is the degree of fluctuation within the filter window.
3. The method for collecting data on garbage placed in a compartment according to claim 1 is characterized in that: The method further comprises: When there are missing values in the filtering window of the target data, an interpolation method is used to determine a fitting value of the missing value, and the fitting value is used as the missing value to fill the missing value in the filtering window.
4. A data collection system for placing garbage in compartments, characterized in that: The data collection system for placing garbage in a compartment comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the computer program to implement the steps of the method as described in any one of claims 1-3.
Citation Information
Patent Citations
A recursive median filtering calculation method and device
CN106021185A
Intelligent equipment control method under low-power-consumption wide-area Internet of Things
CN117970859A
Systems and methods for processing sensor data
US20090192380A1