Coffee machine state monitoring, regulating and controlling system based on Internet of Things
By clustering and fitting the historical data of the coffee machine and adjusting the process noise parameters of the Kalman filtering algorithm, the problem of low accuracy of the working parameters of the coffee machine is solved, and high-precision coffee machine status monitoring and regulation are achieved.
Patent Information
- Application Number
- CN202510534340.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the working parameter adjustment accuracy of the coffee machine is low, mainly because the Kalman filtering algorithm fails to effectively remove noise data during filtering, resulting in poor extraction quality and effect of the coffee machine.
By obtaining the historical working data points of the coffee machine, using the clustering algorithm to cluster and fit straight lines, calculating the trustworthiness representation value of the historical data, adjusting the process noise parameters of the Kalman filtering algorithm, and improving the filtering effect and quality.
It improves the accuracy of adjusting the working parameters of the coffee machine, reduces the impact of the vibration of the coffee machine grinding on data collection, and ensures high-precision adjustment of the working parameters of the coffee machine.
Smart Images

Figure CN120408566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of equipment regulation and control, and particularly relates to an Internet of Things-based coffee machine status monitoring and regulation system. Background Art
[0002] A coffee machine is a device for automatically extracting coffee, which is widely used in scenarios such as homes, offices, and coffee shops. The coffee machine can pass high-temperature and high-pressure water through compacted coffee powder to extract concentrated coffee liquid or other types of coffee beverages.
[0003] Currently, in order to ensure the extraction effect and quality of coffee, the working parameters of the coffee machine during operation are usually adjusted based on preset extraction requirements and the extraction water temperature, inlet water flow rate, and extraction pressure monitored and collected in real time by monitoring equipment. The working parameters of the coffee machine include the extraction water temperature, inlet water flow rate, and extraction pressure of the coffee machine. Also, since the monitoring equipment is interfered by the external environment during data monitoring, there will be noise data in the monitored and collected data. For example, the monitored extraction water temperature is affected by the external environment temperature, and the monitored extraction pressure is affected by the external environment air pressure. That is, when the external environment temperature suddenly rises during the monitoring of the extraction water temperature, the probability that the collected extraction water temperature is too high will increase. The existence of noise data will result in a lower adjustment accuracy when adjusting the working parameters of the coffee machine subsequently. Therefore, currently, in order to ensure the adjustment accuracy, the Kalman filtering algorithm is usually used to filter the monitored and collected data, and then the working parameters of the coffee machine are adjusted based on the filtered data. However, when the Kalman filtering algorithm performs filtering, the process noise parameter is generally set as an empirical value. But this way of determining the process noise parameter will cause the Kalman filtering algorithm to have the situation that the noise is not completely filtered out, the filtering effect is poor, and the filtering quality is poor when filtering the real-time working parameters of the coffee machine collected. As a result, there is still a phenomenon of lower adjustment accuracy when adjusting the working parameters of the coffee machine based on the filtered data subsequently. When there is a phenomenon of lower adjustment accuracy when adjusting the working parameters of the coffee machine, it will cause a large deviation between the working parameters during the operation of the coffee machine and the required working parameters, resulting in poor extraction quality or extraction effect of the coffee. Therefore, how to improve the filtering effect and filtering quality to improve the adjustment accuracy of the working parameters of the coffee machine has become an urgent problem to be solved. Summary of the Invention
[0004] In order to solve the above problems, the present invention provides an Internet of Things-based coffee machine status monitoring and regulation system, and the specific technical solution adopted is as follows: An embodiment of the present invention provides an Internet of Things-based coffee machine status monitoring and control system, including a processor and a memory. The processor executes the computer program stored in the memory to implement the following steps: Obtain all historical working data points of the coffee machine at the current working moment, where the historical working data points are mapped from historical filtering working parameters; Use a clustering algorithm to cluster the historical working data points to obtain clustering clusters, and fit all the historical working data points in the clustering clusters to obtain the fitting lines of the clustering clusters. According to the distances between the historical working data points in the clustering clusters and the clustering center points of the corresponding clustering clusters, the nearest neighbor data points within the clusters of the historical working data points in the clustering clusters, and the distances from the historical working data points in the clustering clusters to the fitting lines of the corresponding clustering clusters, obtain the historical data credibility characterization value at the current working moment; According to the historical data credibility characterization value, adjust the preset process noise parameter of the Kalman filtering algorithm to obtain the target process noise parameter at the current working moment. Use the Kalman filtering algorithm with the process noise parameter as the target process noise parameter to filter the current working parameter at the current working moment to obtain the target filtered data, and control the coffee machine according to the target filtered data.
[0005] Beneficial effects: The present invention first obtains all historical working data points of the coffee machine at the current working moment; then uses a clustering algorithm to cluster the historical working data points to obtain clustering clusters, and fits all the historical working data points in the clustering clusters to obtain the fitting lines of the clustering clusters. According to the distances between the historical working data points in the clustering clusters and the clustering center points of the corresponding clustering clusters, the nearest neighbor data points within the clusters of the historical working data points in the clustering clusters, and the distances from the historical working data points in the clustering clusters to the fitting lines of the corresponding clustering clusters, obtain the historical data credibility characterization value at the current working moment; then, according to the historical data credibility characterization value, adjust the preset process noise parameter of the Kalman filtering algorithm to obtain the target process noise parameter at the current working moment. Use the Kalman filtering algorithm with the process noise parameter as the target process noise parameter to filter the current working parameter at the current working moment to obtain the target filtered data, and finally control the coffee machine according to the target filtered data. Moreover, the present invention adjusts the preset process noise parameter of the Kalman filtering algorithm through the historical data credibility characterization value, which can improve the filtering effect and filtering quality of filtering the current working parameter, thereby improving the accuracy of adjusting the working parameter of the coffee machine. Description of the Drawings
[0006] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0007] Figure 1 It is a flowchart of a method for monitoring and regulating the state of a coffee machine based on the Internet of Things according to the present invention. Detailed implementation manners
[0008] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art belong to the scope protected by the embodiments of the present invention.
[0009] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0010] This embodiment provides a coffee machine state monitoring and regulation system based on the Internet of Things, including a processor and a memory. The processor executes the computer program stored in the memory to implement a method for monitoring and regulating the state of a coffee machine based on the Internet of Things, as Figure 1 shown. The method for monitoring and regulating the state of a coffee machine based on the Internet of Things includes the following steps: Step S001, obtaining all historical working data points of the coffee machine at the current working moment.
[0011] The main purpose of this embodiment is to improve the filtering effect and quality of filtering the current working parameters of the coffee machine at the current working moment by adjusting the process noise parameters of the Kalman filtering algorithm, thereby improving the accuracy of subsequent adjustment of the working parameters of the coffee machine. In addition, for the convenience of understanding, in the following, the process of adjusting the working parameters of any coffee machine will be used as an example for description, that is, the coffee machine mentioned later is the same coffee machine, and the working parameters monitored and collected later are all the working parameters of the same coffee machine during the working process. And the coffee machine in this embodiment is in a working state at the current moment, so the current moment is the current working moment of the coffee machine.
[0012] In this embodiment, all working moments that are temporally before the current working moment of the coffee machine are first obtained and recorded as the historical working moments of the coffee machine. Then, the extraction water temperature, the inlet water flow rate, and the extraction pressure of the coffee machine at the historical working moments are obtained. The working moment is the moment during the operation of the coffee machine. The parameters collected at any working moment are all three types, that is, the parameters collected at any working moment are the extraction water temperature, the inlet water flow rate, and the extraction pressure. And the extraction water temperature, the inlet water flow rate, and the extraction pressure at any historical working moment are recorded as the historical extraction water temperature, the historical inlet water flow rate, and the historical extraction pressure at that historical working moment. The historical extraction water temperature, the historical inlet water flow rate, and the historical extraction pressure at that historical working moment all belong to the historical working parameters at that historical working moment. In this embodiment, the extraction water temperature is collected by a temperature sensor installed on the inner wall of the coffee machine's brew head, that is, the extraction water temperature is the outlet water temperature of the coffee machine's brew head or the temperature of the extraction water flow. The inlet water flow rate is collected by a flow sensor installed at the inlet of the coffee machine's brew head, that is, the inlet water flow rate is the water flow rate at the inlet of the brew head. The extraction pressure is collected by a pressure sensor installed at the front end of the coffee machine's brew head, that is, the extraction pressure is the real-time pressure generated when the water flow passes through the coffee puck. And the extraction water temperature, the inlet water flow rate, and the extraction pressure are closely related to the extraction quality and effect of the coffee, so real-time monitoring and adjustment are required. In addition, in specific applications, the implementer needs to set the time interval between adjacent working moments in the working period according to the actual situation. For example, the time interval between adjacent working moments in the working period can be set to 0.1 second.
[0013] Then, a Kalman filter algorithm with the process noise parameter being the preset process noise parameter is obtained and recorded as the initial Kalman filter algorithm. After that, the initial Kalman filter algorithm is used to filter the historical working parameters at each historical working moment, that is, the initial Kalman filter algorithm is used to filter the historical extraction water temperature, the historical inlet water flow rate, and the historical extraction pressure at each historical working moment. And the data obtained by filtering are respectively recorded as the historical filtered extraction water temperature, the historical filtered inlet water flow rate, and the historical filtered extraction pressure at the corresponding historical working moment. The historical filtered extraction water temperature, the historical filtered inlet water flow rate, and the historical filtered extraction pressure at the historical working moment belong to the historical filtered working parameters at the corresponding historical moment. And in the case of knowing the parameters of the Kalman filter algorithm, the process of data filtering is well-known, so this embodiment does not describe the filtering process in detail.
[0014] Subsequently, a three-dimensional mapping space is constructed. The first coordinate axis of the three-dimensional mapping space represents the extraction water temperature, the second coordinate axis represents the inlet flow rate, and the third coordinate axis represents the extraction pressure. Then, the historical filtered extraction water temperature, historical filtered inlet flow rate, and historical filtered extraction pressure at the historical working moments are mapped into the three-dimensional mapping space to obtain historical working data points corresponding to each historical working moment. The coordinate value of the historical working data point corresponding to any historical working moment at the first dimension is the historical filtered extraction water temperature at the corresponding historical working moment, the coordinate value at the second dimension is the historical filtered inlet flow rate at the corresponding historical working moment, and the coordinate value at the second dimension is the historical filtered extraction pressure at the corresponding historical working moment. All the historical working data points corresponding to the obtained historical working moments are recorded as the historical working data points of the coffee machine at the current working moment.
[0015] Therefore, through the above process, the historical working data points of the coffee machine at the current working moment are obtained in this embodiment. In addition, the Kalman filtering algorithm fits the predicted value of historical data and the real-time observation value as the filtered value. The smaller the process noise parameter of the Kalman filtering algorithm, the easier it is for the system to converge, and the higher the confidence in the predicted value. When the process noise parameter is smaller, it is more inclined to rely on state prediction rather than measurement values for correction. However, if the process noise parameter is too small, it will lead to divergence. When the process noise parameter is larger, the algorithm believes that the uncertainty of the system model is higher, and instead relies more on sensor measurement values for state correction.
[0016] Step S002: Use a clustering algorithm to cluster the historical working data points to obtain clustering clusters, fit all the historical working data points in the clustering clusters to obtain the fitting line of the clustering clusters, and obtain the historical data credibility characterization value at the current working moment according to the distance between the historical working data points in the clustering clusters and the clustering center points of the corresponding clustering clusters, the nearest neighbor data points within the clusters of the historical working data points in the clustering clusters, and the distance from the historical working data points in the clustering clusters to the fitting line of the corresponding clustering clusters.
[0017] During the actual use of the coffee machine, the coffee machine will grind the coffee beans. However, during the process of grinding the coffee beans, the equipment will vibrate, that is, the coffee machine grinding the beans will cause the equipment to vibrate, and the equipment vibration caused by the coffee machine grinding the beans will affect the monitoring equipment's collection of the coffee machine's working parameters, that is, the equipment vibration caused by the coffee machine grinding the beans will also cause the monitoring equipment to monitor and collect the coffee machine's extraction water temperature, water inlet flow and extraction pressure. There is vibration noise in the equipment. For example, the equipment vibration caused by grinding the beans will affect the contact points inside the sensor to generate contact resistance, thereby causing the sensor's monitoring value to deviate from the actual value; however, due to the Kalman filter model's sensitivity to non-Gaussian mutations The equipment vibration caused by grinding coffee beans is not sensitive to non-Gaussian mutation vibration noise, while the equipment vibration caused by grinding coffee beans is caused by mechanical collision, resonance, periodic jump, etc., that is, the equipment vibration caused by grinding coffee beans is caused by a nonlinear source, and the vibration noise caused by the equipment vibration caused by grinding coffee beans often presents the characteristics of intermittent jump or frequency concentration or chaotic superposition. Based on the characteristics of the vibration noise caused by the equipment vibration caused by grinding coffee beans, it can be seen that the noise caused by the equipment vibration caused by grinding coffee beans belongs to non-Gaussian mutation vibration noise. Since the Kalman filter model is not sensitive to non-Gaussian mutation vibration noise, the Kalman filter model When encountering this type of noise, it will be considered as part of the signal rather than noise, so this type of noise will be retained during filtering, which will lead to the presence of noise caused by the vibration of ground coffee beans in the filtered data, that is, the possibility of noise still existing in the filtered historical data. The subsequent Kalman filter model needs to fit the predicted value in combination with the historical data when filtering, and determine the filter value based on the predicted value obtained by fitting and the monitoring value monitored by the monitoring equipment in real time. If the filtered historical data still has vibration noise, if you are more inclined to rely on the predicted value when obtaining the filter value later, then the filtering effect and filtering quality will be poor. The above-mentioned vibration noise refers to the noise generated by the vibration of the equipment caused by grinding coffee beans. In addition, because the smaller the process noise parameter, the more the algorithm tends to rely on state prediction rather than measurement value for correction. When the process noise parameter is larger, the algorithm believes that the uncertainty of the system model is higher and relies more on sensor monitoring values for state correction. Therefore, in order to ensure the filtering effect and filtering quality, this embodiment will subsequently analyze the degree to which the filtered historical data is still disturbed by the vibration of the ground coffee beans or the degree to which the vibration noise affects the filtered historical data. In other words, the credibility of the historical data will be analyzed to adaptively adjust the process noise parameter, thereby improving the filtering effect and filtering quality.
[0018] Therefore, based on the above analysis, in the following embodiment, the degree of interference of the filtered historical data by the vibration of the ground coffee beans or the impact of the vibration noise on the filtered historical data will be analyzed, that is, the process noise parameter will be adaptively adjusted by analyzing the credibility of the historical data. The higher the credibility of the historical data, the smaller the interference by the vibration of the ground coffee beans. At this time, the process noise parameter should be made smaller. The lower the credibility of the historical data, the greater the interference by the vibration of the ground coffee beans. At this time, the process noise parameter should be made larger. Therefore, in the following embodiment, a characterization value of the historical data credibility is obtained. However, before obtaining the characterization value of the historical data credibility, the k-means clustering algorithm needs to be used to cluster all the historical working data points of the coffee machine at the current working moment to obtain each cluster obtained by the clustering. The reason for clustering is that the coffee machine has different modes, and the working parameter characteristics are different in different modes. Therefore, through clustering, the data points in different brewing modes will correspond to a cluster, that is, a cluster represents the data points in a brewing mode. Subsequently, the distribution of the data points within the cluster will be analyzed to determine the credibility of the historical data. In addition, the number of cluster centers when clustering using the k-means clustering algorithm is obtained by the elbow method, and the process of obtaining the number of cluster centers by the elbow method is a well-known technology. Therefore, it will not be described in detail in this example.
[0019] After obtaining the clustering clusters, the discrete distribution characteristic index values of each clustering cluster are obtained based on the distances between the historical working data points in each clustering cluster and the clustering center points of the corresponding clustering clusters, as well as the intra-cluster nearest neighbor data points of the historical working data points in each clustering cluster. The discrete distribution characteristic index values can reflect the possibility that the corresponding clustering cluster is a noise clustering cluster, and the number of noise clustering clusters is the basis for determining the historical data credibility characterization value subsequently. Then, in this embodiment, the specific process of obtaining the discrete distribution characteristic index values of each clustering cluster is as follows: In this embodiment, the specific process of obtaining the discrete distribution characteristic index values of each clustering cluster is as follows: For any clustering cluster: First, in this clustering cluster, obtain the nearest neighbor historical working data points of each historical working data point in this clustering cluster, and denote them as the intra-cluster nearest neighbor data points of the corresponding historical working data points, that is, the intra-cluster nearest neighbor data points of each historical working data point in this clustering cluster belong to this clustering cluster; then obtain the Euclidean distance between each historical working data point in this clustering cluster and the intra-cluster nearest neighbor data point of the corresponding historical working data point, and denote it as the first distance corresponding to the corresponding historical working data point. After that, obtain the mean value of the first distances corresponding to all historical working data points in this clustering cluster, and denote it as the first mean value of this clustering cluster; then obtain the clustering center point of this clustering cluster, and then calculate the Euclidean distance between each historical working data point in this clustering cluster and the clustering center point of this clustering cluster, and denote it as the second distance corresponding to the corresponding historical working data point. After that, obtain the mean value of the second distances corresponding to all historical working data points in this clustering cluster, and denote it as the second mean value of this clustering cluster; finally, obtain the normalized value of the result obtained by adding the first mean value of this clustering cluster and the second mean value of this clustering cluster, and denote it as the discrete distribution characteristic index value of this clustering cluster. That is, the specific calculation expression of the discrete distribution characteristic index value of this clustering cluster is: where R is the discrete distribution characteristic index value of this clustering cluster, N is the total number of historical working data points in this clustering cluster, is the first distance corresponding to the nth historical working data point in this clustering cluster, is the second distance corresponding to the nth historical working data point in this clustering cluster, and Norm() is the normalization function; and when is larger, it indicates that the distribution of the historical working data points in this clustering cluster is more dispersed or that the distances between the historical working data points in this clustering cluster are farther from each other. Then, the characteristics of the vibration noise of this clustering cluster are more obvious, that is, the degree of interference of the vibration of the ground coffee beans on the historical working data points in this clustering cluster or the influence of the vibration noise on the historical working data points in this clustering cluster is more obvious; when The larger it is, the farther the historical working data points in the cluster are from the cluster center point, which also indicates that the data points in the cluster fluctuate relatively greatly around the fixed boundary. Then the characteristics of the vibration noise of the cluster are more obvious. Since when and are larger, R is larger. Therefore, when R is larger, the degree of interference of the historical working data points in the cluster by the vibration of the ground coffee beans or the influence of the vibration noise on the historical working data points in the cluster is more obvious. Then the probability that the cluster belongs to the noise cluster is greater.
[0020] In addition, the reason for calculating the discrete distribution characteristic index value of the cluster is as follows: Under normal circumstances, each brewing mode usually ensures that the temperature, pressure, and flow rate are maintained near a fixed boundary, and the monitoring fluctuation degree between different working times is relatively low. Therefore, in the cluster with unobvious noise characteristics or non-noise, the data points are relatively concentrated, the distance between the data points is close, and the data points in the cluster are relatively more concentrated near the cluster center point. However, if the brewing process is affected by the vibration of the coffee grinder, the vibration will cause the sensor monitoring data to fluctuate and change. Therefore, it will make the distribution of the data points in the cluster relatively discrete, the distance between them is far, and the fluctuation degree around the fixed boundary is relatively large. So in this embodiment, by calculating the discrete distribution characteristic index value of the cluster, the degree of interference of the historical working data points in the cluster by the vibration of the ground coffee beans or the influence degree of the vibration noise on the historical working data points in the cluster is characterized.
[0021] Since the extraction water temperature, the inlet water flow rate, and the extraction pressure in each mode of the coffee machine are fixed, there are also fixed change rules in the process of switching between different modes. Then, during the above clustering, data points belonging to the same mode switching process may also be clustered into one cluster. For example, all the above clustering can cluster the data points in the process of switching the brewing mode from 90-degree high pressure to 30-degree low pressure into one cluster. When this situation occurs, there will be a problem of inaccurate determination of noise clustering clusters only through the discrete distribution characteristic index value, that is, the discrete distribution characteristic index value of a certain clustering cluster is large, but at this time, the historical working data points in this clustering cluster are less affected by the vibration of the ground coffee beans or the influence of vibration noise on the historical working data points in this clustering cluster is less obvious. However, when the data points belonging to the same mode switching process are mainly concentrated near the fitting line, that is, the farther the data points in the clustering cluster with more obvious noise characteristics are from the fitting line of the corresponding clustering cluster. Therefore, in this embodiment, the least squares method is used to perform linear fitting on all the historical working data points in each clustering cluster respectively, and the obtained line is recorded as the fitting line of the corresponding clustering cluster. And performing line fitting is also to determine the characteristics of the clustering cluster in the future. The process of performing linear fitting using the least squares method is a well-known technology, so it will not be described in detail in this embodiment.
[0022] After obtaining the fitting line of the clustering cluster, the non-linear distribution index value of each clustering cluster is obtained according to the distance from the historical working data points in each clustering cluster to the fitting line of the corresponding clustering cluster. The non-linear distribution index value can reflect the possibility that the corresponding clustering cluster is a noise clustering cluster, and the number of noise clustering clusters is the basis for determining the historical data credibility characterization value in the future. Then, in this embodiment, the specific process of obtaining the non-linear distribution index value of each clustering cluster is as follows: For any clustering cluster: Obtain the distance from each historical working data point in this clustering cluster to the fitting line of this clustering cluster, and record it as the fitting distance corresponding to the corresponding historical working data point. Obtain the normalized value of the mean of the fitting distances corresponding to all the historical working data points in this clustering cluster, and record it as the non-linear distribution index value of this clustering cluster. Here, the normalization function Norm() is used to normalize the mean of the fitting distances corresponding to all the historical working data points in this clustering cluster. Moreover, when the non-linear distribution index value of this clustering cluster is larger, it indicates that the possibility that the historical working data points in this clustering cluster are data points for the same mode switching is smaller, and it also indicates that the historical working data points in this clustering cluster are more affected by the vibration of the ground coffee beans or the influence of vibration noise on the historical working data points in this clustering cluster is more obvious. Then the probability that this clustering cluster belongs to a noise clustering cluster is greater.
[0023] Since both the discrete distribution characteristic index value and the non-linear distribution index value of the clustering cluster can characterize the probability that the clustering cluster belongs to the noise clustering cluster, and the number of noise clustering clusters is the basis for determining the credibility characterization value of historical data subsequently, in this embodiment, the credibility characterization value of historical data at the current working moment will be obtained according to the discrete distribution characteristic index value of each clustering cluster and the non-linear distribution index value of each clustering cluster. Then, the specific acquisition process of the credibility characterization value of historical data at the current working moment is as follows: First, obtain the product of the discrete distribution characteristic index value of each clustering cluster and the non-linear distribution index value of the corresponding clustering cluster, and denote it as the target distribution characteristic value corresponding to the corresponding clustering cluster;Moreover, when the target distribution eigenvalues corresponding to all clustering clusters are similar, it indicates that the equipment vibration caused by coffee bean grinding in the coffee machine does not affect the acquisition of the working parameters of the coffee machine by the monitoring equipment, that is, the collected historical working parameters are not disturbed by the equipment vibration caused by coffee bean grinding in the coffee machine. In this case, directly using the required minimum process noise parameter, which is the limit parameter, for filtering can ensure better subsequent filtering effect and quality. However, when the target distribution eigenvalues corresponding to all clustering clusters are not similar, it indicates that the equipment vibration caused by coffee bean grinding in the coffee machine affects the acquisition of the working parameters of the coffee machine by the monitoring equipment, that is, the collected historical working parameters are disturbed by the equipment vibration caused by coffee bean grinding in the coffee machine. In this case, it is necessary to reduce the preset process noise parameter for filtering to ensure better subsequent filtering effect and quality. Therefore, after obtaining the target distribution eigenvalues corresponding to the clustering clusters, the standard deviation of the target distribution eigenvalues corresponding to all clustering clusters is calculated and used as the target judgment adjustment threshold at the current working moment. Then, it is judged whether the target judgment adjustment threshold at the current working moment is less than the preset judgment adjustment threshold. If so, it indicates that the collected historical working parameters are not disturbed by the equipment vibration caused by coffee bean grinding in the coffee machine or the interference is negligible. In this case, the preset first constant is used as the historical data credibility characterization value at the current working moment. Otherwise, it indicates that the collected historical working parameters are disturbed by the equipment vibration caused by coffee bean grinding in the coffee machine, and the received interference will affect the subsequent adjustment of the working parameters of the coffee machine. In this case, all clustering clusters with target distribution eigenvalues greater than the preset noise cluster judgment threshold are obtained and recorded as noise clustering clusters. Then, the reciprocal of the sum of the target distribution eigenvalues corresponding to all noise clustering clusters is used as the historical data credibility characterization value at the current working moment. The more noise clustering clusters there are, the more obvious the degree of interference of the historical data by the vibration of the ground coffee beans or the influence of the vibration noise on the historical data. Then, a larger process noise parameter should be used in the future. On the contrary, the fewer noise clustering clusters there are, the smaller the degree of interference of the historical data by the vibration of the ground coffee beans or the influence of the vibration noise on the historical data. Then, a smaller process noise parameter should be used in the future. That is, the more noise clustering clusters there are, the smaller the historical data credibility characterization value, indicating lower historical data credibility. In the future, more reliance should be placed on sensor measurement values to obtain the filtered value. The fewer noise clustering clusters there are, the larger the historical data credibility characterization value, indicating higher historical data credibility. In the future, more reliance should be placed on predicted values to obtain the filtered value.
[0024] In addition, in specific applications, the implementer needs to set the preset judgment adjustment threshold and the preset noise cluster judgment threshold according to the actual situation and experimental statistics. Since the standard deviation is usually less than 1, it indicates that the data is relatively similar. Therefore, in this embodiment, the preset judgment adjustment threshold is set to 1. Since the value range of the target distribution characteristic value is from 0 to 1, and usually when the target distribution characteristic value is greater than 0.5, it can represent that the interference degree of the historical data in the corresponding clustering cluster by the vibration of the ground coffee beans is relatively obvious. Therefore, in this embodiment, the preset noise cluster judgment threshold is set to 0.5; and in this embodiment, since the maximum integer value of the historical data credibility characterization value is 1, the preset first constant is set to 1 in this embodiment. When the historical data credibility characterization value is 1, it indicates that the collected historical working parameters are not interfered by the equipment vibration caused by the coffee grinder or the interference is small and negligible. Subsequently, the minimum process noise parameter, that is, the limit parameter, is used for filtering.
[0025] Therefore, through the above process, this embodiment obtains the historical data credibility characterization value at the current working moment.
[0026] Step S003: Adjust the preset process noise parameter of the Kalman filtering algorithm according to the historical data credibility characterization value to obtain the target process noise parameter at the current working moment. Use the Kalman filtering algorithm with the process noise parameter being the target process noise parameter to filter the current working parameter at the current working moment to obtain the target filtered data, and control the coffee machine according to the target filtered data.
[0027] After obtaining the historical data credibility characterization value at the current working moment, the preset process noise parameter of the Kalman filtering algorithm is adjusted according to the historical data credibility characterization value to obtain the target process noise parameter at the current working moment; and the specific obtaining process of the target process noise parameter at the current working moment is as follows: First, obtain the result of subtracting the historical data credibility characterization value at the current working moment from the preset first constant, which is recorded as the adjustment factor at the current working moment; then obtain the product of the adjustment factor at the current working moment and the preset process noise parameter, and use it as the parameter to be judged at the current working moment, that is, the parameter to be judged is , where E is the characterization value of the historical data credibility at the current working moment, Q is the preset process noise parameter, and the preset process noise parameter in this embodiment is an empirical value, generally set to 0.1; then it is judged whether the parameter to be judged at the current working moment is less than the preset limit parameter. If so, the preset limit parameter is used as the target process noise parameter at the current working moment. If the parameter to be judged is not less than the preset limit parameter, the parameter to be judged at the current working moment is used as the target process noise parameter at the current working moment; and the preset limit parameter is the minimum process noise parameter required when using the Kalman filter algorithm for filtering, generally set to 0.01, aiming to prevent the occurrence of divergence phenomena caused by too small process noise parameters.
[0028] After obtaining the target process noise parameter at the current working moment, the Kalman filter algorithm with the process noise parameter as the target process noise parameter is used to filter the current working parameter at the current working moment, and the result obtained by the filtering is recorded as the target filtering data corresponding to the current working parameter; and the current working parameter includes the current extraction water temperature, the current inlet flow rate, and the current extraction pressure, and the current extraction water temperature, the current inlet flow rate, and the current extraction pressure are respectively the extraction water temperature, the inlet flow rate, and the extraction pressure of the coffee machine collected by the monitoring device at the current working moment.
[0029] After obtaining the target filtering data corresponding to the current working parameters, the coffee machine is regulated according to the target filtering data corresponding to the current working parameters. Specifically: the target filtering data corresponding to the current working parameters is transmitted to the PID control system of the coffee machine, and according to the preset working parameters at the current working moment and the target filtering data received by the PID control system, the adjustment amount of the current working parameters at the current working moment is calculated. The value of the preset working parameters at the current working moment is the value to be achieved by the adjustment, that is, the preset working parameters at the current working moment are the adjustment objectives. If the extraction temperature required by the selected brewing mode at the current working moment is 30 degrees, then the preset extraction temperature at the current working moment is 30 degrees; then the current working parameters at the current working moment are adjusted according to the adjustment amount of the current working parameters at the current working moment. On the premise of knowing the preset working parameters at the current working moment and the target filtering data corresponding to the current working parameters, the process of obtaining the adjustment amount is a well-known technology, so it will not be described in this embodiment; on the premise of knowing the adjustment amount, the process of the PID control system adjusting the data to be adjusted is also a well-known technology, so it will not be described in this embodiment either. Since the current working parameters include the current extraction water temperature, the current inlet water flow rate, and the current extraction pressure, the adjustment amount of the current working parameters at the current working moment calculated according to the preset working parameters at the current working moment and the target filtering data received by the PID control system includes the extraction water temperature adjustment amount, the inlet water flow rate adjustment amount, and the extraction pressure adjustment amount, and subsequently, the current extraction water temperature, the current inlet water flow rate, and the current extraction pressure at the current working moment are adjusted respectively according to the extraction water temperature adjustment amount, the inlet water flow rate adjustment amount, and the extraction pressure adjustment amount at the current working moment.
[0030] So far, this embodiment has completed the adjustment process of the working parameters of the coffee machine. Moreover, this adjustment method in this embodiment can minimize the impact of grinding vibration on filtering and improve the accuracy of adjusting the working parameters of the coffee machine. Additionally, the subsequent methods for adjusting the working parameters of the coffee machine are the same as the method for adjusting the current working parameters at the current working moment described above. Furthermore, when adjusting the working parameters at a certain working moment, the method for obtaining the filtered data of the working parameters at the working moment preceding this moment is the same as the method for obtaining the filtered data of the current working parameters at the current working moment, that is, the method for obtaining the process noise parameter used for filtering the working parameters at the working moment preceding this moment is the same as the method for obtaining the target process noise parameter at the current working moment. And the process noise parameter used for filtering the working parameters at the working moment preceding this moment is denoted as the target process noise parameter at the working moment preceding this moment. Then, when subsequently obtaining the process noise parameter used for filtering the working parameters at this working moment, the filtered data of the working parameters at the working moment preceding this moment is obtained by filtering the working parameters at the working moment preceding this moment with the target process noise parameter at the working moment preceding this moment.
[0031] In summary, this embodiment first obtains all historical working data points of the coffee machine at the current working moment; then uses a clustering algorithm to cluster the historical working data points to obtain clustering clusters, and fits all the historical working data points in the clustering clusters to obtain the fitting line of the clustering cluster. Based on the distance between the historical working data points in the clustering cluster and the clustering center point of the corresponding clustering cluster, the nearest neighbor data points within the cluster of the historical working data points in the clustering cluster, and the distance from the historical working data points in the clustering cluster to the fitting line of the corresponding clustering cluster, a historical data credibility characterization value at the current working moment is obtained; then, according to the historical data credibility characterization value, the preset process noise parameter of the Kalman filtering algorithm is adjusted to obtain the target process noise parameter at the current working moment. The Kalman filtering algorithm with the process noise parameter being the target process noise parameter is used to filter the current working parameters at the current working moment to obtain the target filtered data, and finally, the coffee machine is regulated according to the target filtered data. And this embodiment adjusts the preset process noise parameter of the Kalman filtering algorithm through the historical data credibility characterization value, which can improve the filtering effect and filtering quality when filtering the current working parameters, thereby improving the accuracy of adjusting the working parameters of the coffee machine.
[0032] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included within the protection scope of the present application.
Claims
1. An Internet of Things-based coffee machine status monitoring and control system, comprising a processor and a memory, characterized in that, The processor executes the computer program stored in the memory to implement the following steps: Obtain all historical working data points of the coffee machine at the current working moment, where the historical working data points are mapped from historical filtered working parameters; Use a clustering algorithm to cluster the historical working data points to obtain clustering clusters, and fit all the historical working data points in the clustering clusters to obtain the fitting line of the clustering clusters. According to the distance between the historical working data points in the clustering clusters and the clustering center points of the corresponding clustering clusters, the nearest neighbor data points within the clusters of the historical working data points in the clustering clusters, and the distance from the historical working data points in the clustering clusters to the fitting line of the corresponding clustering clusters, obtain the historical data credibility characterization value at the current working moment; According to the historical data credibility characterization value, adjust the preset process noise parameter of the Kalman filter algorithm to obtain the target process noise parameter at the current working moment. Use the Kalman filter algorithm with the process noise parameter being the target process noise parameter to filter the current working parameter at the current working moment to obtain the target filtered data, and regulate the coffee machine according to the target filtered data.
2. The IoT-based coffee machine status monitoring and regulation system according to claim 1, wherein The method for obtaining the historical working data points includes: Obtain all working moments that are earlier than the current working moment of the coffee machine in terms of time, and record them as the historical working moments of the coffee machine; obtain the working parameters of the coffee machine at each historical working moment, and record them as the historical working parameters at the corresponding historical working moment. Use the Kalman filter algorithm with the process noise parameter being the preset process noise parameter to filter the historical working parameters at the historical working moment to obtain the historical filtered working parameters at the corresponding historical working moment, and map the historical filtered working parameters at the historical working moment to obtain the historical working data points corresponding to the corresponding historical working moment, and record all the historical working data points corresponding to the historical working moments as the historical working data points of the coffee machine at the current working moment.
3. The coffee machine status monitoring and control system based on the Internet of Things according to claim 2, characterized in that, The historical filtered working parameters at any historical working moment include the historical filtered extraction water temperature, the historical filtered inlet water flow rate, and the historical filtered extraction pressure.
4. The IoT-based coffee machine status monitoring and control system according to claim 1, wherein, The method for obtaining the historical data credibility characterization value includes: According to the distance between the historical working data points in the clustering clusters and the clustering center points of the corresponding clustering clusters and the nearest neighbor data points within the clusters of the historical working data points in the clustering clusters, obtain the discrete distribution characteristic index value of the clustering clusters; according to the distance from the historical working data points in the clustering clusters to the fitting line of the corresponding clustering clusters, obtain the non-linear distribution index value of the clustering clusters; according to the discrete distribution characteristic index value and the non-linear distribution index value, obtain the historical data credibility characterization value at the current working moment.
5. The IoT-based coffee machine status monitoring and control system according to claim 4, characterized in that, The method for obtaining the discrete distribution characteristic index value of the clustering clusters includes: For any cluster: In the cluster, obtain the nearest neighbor historical working data points of each historical working data point in the cluster, and denote them as the in-cluster nearest neighbor data points corresponding to the corresponding historical working data points; Denote the distance between each historical working data point in the cluster and the in-cluster nearest neighbor data point corresponding to the corresponding historical working data point as the first distance corresponding to the corresponding historical working data point, and denote the mean value of the first distances corresponding to all historical working data points in the cluster as the first mean value of the cluster; Denote the distance between each historical working data point in the cluster and the cluster center point of the cluster as the second distance corresponding to the corresponding historical working data point, and denote the mean value of the second distances corresponding to all historical working data points in the cluster as the second mean value of the cluster; Denote the normalized value of the result obtained by adding the first mean value and the second mean value of the cluster as the discrete distribution characteristic index value of the cluster.
6. The IoT-based coffee machine status monitoring and control system according to claim 4, wherein, The method for obtaining the non-linear distribution index value of the cluster includes: For any cluster: Denote the distance from each historical working data point in the cluster to the fitted line of the cluster as the fitted distance corresponding to the corresponding historical working data point, and denote the normalized value of the mean value of the fitted distances corresponding to all historical working data points in the cluster as the non-linear distribution index value of the cluster.
7. The state monitoring and control system of the coffee machine based on the Internet of Things according to claim 4, wherein The method for obtaining the historical data credibility characterization value at the current working moment according to the discrete distribution characteristic index value and the non-linear distribution index value includes: Denote the product of the discrete distribution characteristic index value of the cluster and the non-linear distribution index value of the corresponding cluster as the target distribution characteristic value corresponding to the corresponding cluster; Use the standard deviation of the target distribution characteristic values corresponding to all clusters as the target judgment adjustment threshold, and judge whether the target judgment adjustment threshold is less than the preset judgment adjustment threshold. If so, use the preset first constant as the historical data credibility characterization value at the current working moment. Otherwise, denote the clusters with target distribution characteristic values greater than the preset noise cluster judgment threshold as noise clusters, and use the reciprocal of the sum of the target distribution characteristic values corresponding to all noise clusters as the historical data credibility characterization value at the current working moment.
8. The coffee machine status monitoring and control system based on the Internet of Things according to claim 1, characterized in that, The method for obtaining the target process noise parameter at the current working moment includes: Denote the result of subtracting the historical data credibility characterization value from the preset first constant as the adjustment factor at the current working moment, and use the product of the adjustment factor and the preset process noise parameter as the parameter to be judged at the current working moment. If the parameter to be judged is less than the preset limit parameter, use the preset limit parameter as the target process noise parameter at the current working moment. If the parameter to be judged is not less than the preset limit parameter, use the parameter to be judged as the target process noise parameter at the current working moment.
9. The Internet of Things-based coffee machine status monitoring and control system according to claim 1, characterized in that The current working parameters include the extraction water temperature, the inlet water flow rate, and the extraction pressure of the coffee machine collected at the current working moment.
10. The state monitoring and regulation system of the coffee machine based on the Internet of Things according to claim 9, characterized in that, The method for regulating the coffee machine according to the target filtered data includes: Transmit the target filtered data to the PID control system of the coffee machine, and calculate the current working parameter adjustment amount of the coffee machine at the current working moment according to the preset working parameters of the coffee machine at the current working moment and the target filtered data received by the PID control system. Adjust the current working parameters at the current working moment according to the current working parameter adjustment amount at the current working moment.