Air quality warning method and system
By obtaining and processing air pollutant concentration data in real time, and using clustering and Euclidean distance comparison technology, timely alarms for abnormal air quality are achieved, and problems of low manual verification efficiency and insufficient sensitivity in the existing technology are solved.
Patent Information
- Application Number
- CN202211362346.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2042-11-02
AI Technical Summary
In the prior art, the method of manually checking the pollutant concentration data has limited sensitivity to abnormal data and cannot promptly make alarm prompts based on data changes.
By obtaining the contaminant concentration values collected by the sensor in real time, forming a data set, and standard range judgments and concentration change calculations are carried out. If the concentration change does not reach the threshold, clustering process is performed to determine the center of mass of the target cluster, calculate the comparison between the target Euclidean distance and the standard Euclidean distance. If the target distance is greater than the standard distance, an alarm is issued.
It improves the sensitivity to abnormal data, and can promptly make alarm prompts based on subtle changes in the data to ensure that abnormal air quality is handled in a timely manner.
Smart Images

Figure CN115798154B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of air quality alarms, and in particular relates to an air quality alarm method and system. Background Art
[0002] The quality of air reflects the degree of air pollution and can be judged based on the concentration of pollutants in the air. At a specific time and place, the concentration of air pollutants is affected by many factors, such as exhaust from vehicles, ships, and aircraft, industrial pollution, and waste incineration.
[0003] In order to monitor air quality, air quality collection devices are usually installed in designated areas to collect pollutants in the air in real time and output pollutant concentration data. Relevant staff can understand the current air quality situation by checking the pollutant concentration data, and issue alarms based on the current air quality situation, so as to carry out environmental remediation and rectification in a timely manner.
[0004] The traditional method of manually checking pollutant concentration data has limited sensitivity to abnormal data, cannot issue warnings in time based on data changes, and manual review is inefficient. Summary of the invention
[0005] Based on this, an embodiment of the present invention provides an air quality alarm method and system, which aims to solve the problem in the prior art that the sensitivity to abnormal data is limited and alarm prompts cannot be issued in time according to data changes through manual verification of pollutant concentration data.
[0006] A first aspect of an embodiment of the present invention provides an air quality alarm method, the method comprising:
[0007] Acquire the concentration values of various pollutants collected by sensors in real time, form a pollutant concentration data set, and determine whether each concentration value is within the standard range;
[0008] If yes, then respectively obtain the first concentration value and the second concentration value of each pollutant at adjacent moments, and calculate the corresponding concentration change according to the first concentration value and the second concentration value;
[0009] Determine whether the concentration change is greater than a corresponding change threshold;
[0010] If not, clustering the concentration values of each pollutant in the pollutant concentration data set to determine the corresponding target cluster centroid;
[0011] Obtaining the third concentration value of each pollutant at the current moment, calculating the target Euclidean distance according to the third concentration value and the target cluster centroid, and determining whether the target Euclidean distance is greater than the standard Euclidean distance;
[0012] If so, an alarm is issued to indicate that the air quality is abnormal.
[0013] Furthermore, the step of clustering the concentration values of each pollutant in the pollutant concentration data set to determine the corresponding target cluster centroid includes:
[0014] Step 1: Determine the corresponding coordinate point according to the concentration value of each pollutant in the pollutant concentration data set;
[0015] Step 2: randomly select k coordinate points from all coordinate points as the centroid of the first cluster, where k is the number of pollutants;
[0016] Step 3, calculating the first Euclidean distance between the coordinate points other than the first cluster centroid and the first cluster centroid;
[0017] Step 4: according to the first Euclidean distance, the pollutant concentration data set is divided into k clusters with the first cluster centroid as a reference point;
[0018] Step 5, obtaining the corresponding coordinate points in each cluster, and calculating the average value of all the coordinate points in the cluster to obtain the target coordinate point, and updating the centroid of the first cluster according to the target coordinate point;
[0019] Step 6: Repeat steps 3 to 5 until the first cluster centroid does not change any more, and then define the first cluster centroid as the target cluster centroid.
[0020] Furthermore, in the step of calculating the first Euclidean distances of the coordinate points other than the first cluster centroid from the first cluster centroid, the calculation formula of the first Euclidean distance is:
[0021]
[0022] Wherein, d(x, y) represents the Euclidean distance between coordinate point x and coordinate point y, and n represents the dimension.
[0023] Furthermore, the standard Euclidean distance changes dynamically over time.
[0024] Furthermore, the steps of obtaining the third concentration value of each pollutant at the current moment, calculating the target Euclidean distance according to the third concentration value and the target cluster centroid, and determining whether the target Euclidean distance is less than the standard Euclidean distance include:
[0025] Obtain a first time period at the current moment, a first standard Euclidean distance corresponding to the first time period, a second time period adjacent to the first time period, and a second standard Euclidean distance corresponding to the second time period;
[0026] Determining whether the first standard Euclidean distance and the second standard Euclidean distance are equal;
[0027] If not, a critical time point of the first time period and the second time period is obtained, and when the time reaches the critical time point, the second standard Euclidean distance is replaced by the first standard Euclidean distance.
[0028] Further, the step of obtaining the third concentration value of each pollutant at the current moment, calculating the target Euclidean distance according to the third concentration value and the target cluster centroid, and determining whether the target Euclidean distance is less than the standard Euclidean distance includes:
[0029] When it is determined that the target Euclidean distance is less than the standard Euclidean distance, the corresponding target Euclidean distance calculated according to the concentration values of each pollutant in the preset time period is obtained, and the average value of all target Euclidean distances in the concentration value of a certain pollutant is calculated;
[0030] Determine whether the difference between the average value and the corresponding standard Euclidean distance is greater than a threshold;
[0031] If so, the standard Euclidean distance is adjusted according to the average value.
[0032] A second aspect of an embodiment of the present invention provides an air quality alarm system, the system comprising:
[0033] The first judgment module is used to obtain the concentration values of various pollutants collected by the sensor in real time, form a pollutant concentration data set, and judge whether each concentration value is within the standard range;
[0034] A concentration change calculation module, for respectively obtaining a first concentration value and a second concentration value of each pollutant at adjacent moments when it is determined that each of the concentration values is within the standard range, and calculating a corresponding concentration change according to the first concentration value and the second concentration value;
[0035] A second judgment module is used to judge whether the concentration change is greater than a corresponding change threshold;
[0036] A target cluster centroid determination module is used to cluster the concentration values of each pollutant in the pollutant concentration data set to determine the corresponding target cluster centroid when it is determined that the concentration change is not greater than the corresponding change threshold;
[0037] A third judgment module is used to obtain a third concentration value of each pollutant at a current moment, calculate a target Euclidean distance according to the third concentration value and the target cluster centroid, and judge whether the target Euclidean distance is greater than a standard Euclidean distance;
[0038] The alarm module is used to issue an alarm when it is determined that the target Euclidean distance is greater than the standard Euclidean distance to indicate that the air quality is abnormal.
[0039] A third aspect of an embodiment of the present invention provides a computer-readable storage medium, including:
[0040] The readable storage medium stores one or more programs, which, when executed by the processor, implement the air quality alarm method of the first aspect.
[0041] A fourth aspect of an embodiment of the present invention provides an electronic device, the electronic device comprising a memory and a processor, wherein:
[0042] The memory is used to store computer programs;
[0043] When the processor is used to execute the computer program stored in the memory, the air quality alarm method of the first aspect is implemented.
[0044] The present invention proposes an air quality alarm method and system, which obtains the concentration values of various pollutants collected by sensors in real time, and judges the standard range and concentration change amount of the concentration values of various pollutants in turn, so as to preliminarily screen the health status of equipment and data, and then clusters the concentration values of various pollutants in the pollutant concentration data set to determine the corresponding target cluster centroid, and then calculates the concentration values collected subsequently with the target cluster centroid, and compares the obtained target Euclidean distance with the standard Euclidean distance to analyze the data more accurately. If the target Euclidean distance is greater than the standard Euclidean distance, it means that the data is abnormal, and an alarm is issued to indicate that the air quality is abnormal. This method effectively improves the sensitivity to abnormal data and can make alarm prompts in time according to subtle changes in the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flow chart of an implementation of an air quality alarm method provided by the first embodiment of the present invention;
[0046] Figure 2 is a structural schematic diagram of an air quality alarm system provided by a second embodiment of the present invention;
[0047] Figure 3 It is a structural block diagram of an electronic device provided by the third embodiment of the present invention.
[0048] The following specific implementation manner will be further described in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0049] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0050] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0052] Embodiment 1
[0053] See also Figure 1 , Figure 1 The air quality alarm method provided by the first embodiment of the present invention is shown, and the method specifically includes steps S01 to S06.
[0054] Step S01, acquiring the concentration values of various pollutants collected by the sensor in real time, forming a pollutant concentration data set, and determining whether each of the concentration values is within the standard range, if so, executing step S02.
[0055] Among them, in some special application scenarios, sensors will be installed to collect the concentration values of various pollutants. For example, environmental dust collection instruments will be installed on the construction site to collect various data such as PM2.5, PM10, SO2, NO2, CO, O3, etc. Since various data can be collected at the same time, the collected data, that is, each concentration value, can be compared with its corresponding standard range to determine whether it is within the respective standard range. If so, it means that the equipment and data are in normal state. It is understandable that when the concentration value is less than the lower limit of the standard range, it means that the equipment is abnormal and the equipment may be interrupted. When the concentration value is greater than the upper limit of the standard range, it means that the data is abnormal and an alarm is directly issued.
[0056] In step S02, the first concentration value and the second concentration value of each pollutant at adjacent moments are respectively obtained, and the corresponding concentration change is calculated according to the first concentration value and the second concentration value.
[0057] Specifically, since the sensor obtains the concentration value of each pollutant in real time, that is, the concentration value of each pollutant is constantly updated, the amplitude of data change is also one of the manifestations of data abnormality. Therefore, the first concentration value and the second concentration value of each pollutant at adjacent moments are obtained, and the difference between the first concentration value and the second concentration value is calculated to obtain the concentration change.
[0058] Step S03, determining whether the concentration change is greater than a corresponding change threshold, if not, executing step S04.
[0059] It is understandable that the change amounts of different pollutants corresponding to different scenarios are different. For this reason, the corresponding change amount threshold can be set according to the actual production process, so that after the concentration change amount is calculated, it can be compared with the corresponding change amount threshold. When the concentration change amount is greater than the change amount threshold, it means that the data change range is large and the air quality is abnormal, then an alarm is issued.
[0060] In step S04, the concentration values of each pollutant in the pollutant concentration data set are clustered to determine the corresponding target cluster centroid.
[0061] It should be noted that the determination of the target cluster centroid can be carried out in the trial operation stage. Through a certain amount of data, the target cluster centroid is optimized. The following steps can be used to determine the target cluster centroid. Specifically:
[0062] Step 1: Determine the corresponding coordinate points according to the concentration values of each pollutant in the pollutant concentration data set, wherein the concentration values of each pollutant can be plotted in a graph, and the graph is a scatter plot. It can be understood that when the concentration values of each pollutant are all reflected in the scatter plot, they can be divided into several scatter groups, and one scatter group can contain all the concentration values of a pollutant;
[0063] Step 2: randomly select k coordinate points from all coordinate points as the first cluster centroid, where k is the number of pollutant items. Assuming that the collected pollutants are PM2.5, PM10, and SO2, the number of pollutant items is three. Then, three coordinate points will be randomly determined as the first cluster centroid;
[0064] Step 3: Calculate the first Euclidean distance of other coordinate points except the first cluster centroid from the first cluster centroid. Specifically, the calculation formula of the first Euclidean distance is:
[0065]
[0066] Among them, d(x, y) represents the Euclidean distance between coordinate point x and coordinate point y, and n represents the dimension. It can be understood that all subsequent calculations on the Euclidean distance can use the above formula;
[0067] Step 4: According to the first Euclidean distance, the pollutant concentration data set is divided into k clusters with the first cluster centroid as the reference point;
[0068] Step 5: Obtain the corresponding coordinate points in each cluster, calculate the average value of all coordinate points in the cluster, obtain the target coordinate point, and update the centroid of the first cluster according to the target coordinate point;
[0069] Step 6: Repeat steps 3 to 5 until the centroid of the first cluster no longer changes. The centroid of the first cluster is defined as the centroid of the target cluster. That is, the final result is to determine a scattered point in each scattered point group and use the scattered point as the target cluster centroid of the scattered point group.
[0070] Step S05, obtaining the third concentration value of each pollutant at the current moment, calculating the target Euclidean distance according to the third concentration value and the target cluster centroid, and determining whether the target Euclidean distance is greater than the standard Euclidean distance, if so, executing step S06.
[0071] In this embodiment, the standard Euclidean distance changes dynamically with time. Taking the chemical plant scenario as an example, the emission of pollutants at night is much less than that during the daytime working hours, that is, the emission of pollutants at night is lower and more stable. Then, the standard Euclidean distance set for a certain period of time at night may be smaller than the standard Euclidean distance for other periods of time, so as to more accurately control the pollutant data. Among them, the first period of time at the current moment, the first standard Euclidean distance corresponding to the first period of time, the second period of time adjacent to the first period of time, and the second standard Euclidean distance corresponding to the second period of time can be obtained; it is determined whether the first standard Euclidean distance and the second standard Euclidean distance are equal; if not, the critical time points of the first period of time and the second period of time are obtained, and when the time reaches the critical time point, the second standard Euclidean distance is replaced by the first standard Euclidean distance to realize the intelligent adjustment of the standard Euclidean distance.
[0072] In addition, since the standard Euclidean distance can be preset manually, when the sensor is initially running, the pollutant data obtained is limited, and the standard Euclidean distance may not be very accurate. As the amount of collected data increases, the standard Euclidean distance can be adjusted through big data to make the evaluation criteria more appropriate. This operation is only performed when all the data are normal values. Specifically, the corresponding target Euclidean distance is obtained in a preset time period, that is, during working hours and non-working hours, according to the concentration values of various pollutants, and the average value of all target Euclidean distances calculated from all coordinate points and the centroid of the target cluster corresponding to the concentration value of a certain pollutant is calculated; it is determined whether the difference between the average value and the corresponding standard Euclidean distance is greater than a threshold value; if so, it means that the setting of the standard Euclidean distance is not accurate enough and may not reflect the abnormal situation of the data. The standard Euclidean distance is adjusted based on the average value, wherein the current standard Euclidean distance is subtracted from the threshold value, and the value obtained is determined as the new quasi-Euclidean distance.
[0073] In step S06, an alarm is issued to indicate that the air quality is abnormal.
[0074] In summary, the air quality alarm method provided in Example 1 of the present invention obtains the concentration values of various pollutants collected by sensors in real time, and judges the standard range and concentration change amount of the concentration values of various pollutants in turn to preliminarily screen the health status of the equipment and data, and then clusters the concentration values of various pollutants in the pollutant concentration data set to determine the corresponding target cluster centroid, and the subsequently collected concentration values are calculated with the target cluster centroid, and the obtained target Euclidean distance is compared with the standard Euclidean distance to more accurately analyze the data. If the target Euclidean distance is greater than the standard Euclidean distance, it means that the data is abnormal, and an alarm is issued to indicate that the air quality is abnormal. This method effectively improves the sensitivity to abnormal data and can promptly issue alarm prompts based on subtle changes in the data.
[0075] Embodiment 2
[0076] See also Figure 2 , Figure 2 2 is a block diagram of the air quality warning system provided by an embodiment of the present invention. The air quality warning system 200 comprises: a first judgment module 21, a concentration change calculation module 22, a second judgment module 23, a target cluster centroid determination module 24, a third judgment module 25 and an alarm module 26, wherein:
[0077] The first judgment module 21 is used to obtain the concentration values of various pollutants collected by the sensor in real time, form a pollutant concentration data set, and judge whether each concentration value is within the standard range;
[0078] The concentration variation calculation module 22 is used to obtain the first concentration value and the second concentration value of each pollutant at adjacent moments when it is determined that each concentration value is within the standard range, and calculate the corresponding concentration variation according to the first concentration value and the second concentration value;
[0079] A second judgment module 23 is used to judge whether the concentration change is greater than a corresponding change threshold;
[0080] The target cluster centroid determination module 24 is used to cluster the concentration values of each pollutant in the pollutant concentration data set to determine the corresponding target cluster centroid when it is determined that the concentration change is not greater than the corresponding change threshold;
[0081] The third judgment module 25 is used to obtain the third concentration value of each pollutant at the current moment, calculate the target Euclidean distance according to the third concentration value and the target cluster centroid, and judge whether the target Euclidean distance is greater than the standard Euclidean distance, wherein the standard Euclidean distance changes dynamically with time;
[0082] The alarm module 26 is used to issue an alarm to indicate that the air quality is abnormal when it is determined that the target Euclidean distance is greater than the standard Euclidean distance.
[0083] Further, in some optional embodiments of the present invention, the target cluster centroid determination module 24 includes:
[0084] A coordinate point determination unit, used to determine corresponding coordinate points according to the concentration values of various pollutants in the pollutant concentration data set;
[0085] A first cluster centroid determination unit, used for randomly selecting k coordinate points from all coordinate points as the first cluster centroid, where k is the number of pollutants;
[0086] The first calculation unit is used to calculate the first Euclidean distance of other coordinate points except the first cluster centroid from the first cluster centroid, wherein the calculation formula of the first Euclidean distance is:
[0087]
[0088] Where d(x, y) represents the Euclidean distance between coordinate point x and coordinate point y, and n represents the dimension;
[0089] A clustering unit, configured to divide the pollutant concentration data set into k clusters based on the first Euclidean distance and taking the first cluster centroid as a reference point;
[0090] An updating unit, used for obtaining each corresponding coordinate point in each cluster, calculating an average value of all coordinate points in the cluster, obtaining a target coordinate point, and updating the centroid of the first cluster according to the target coordinate point;
[0091] The cyclic unit is used to repeat the first calculation unit, the clustering unit and the updating unit until the first cluster centroid does not change any more, and then define the first cluster centroid as the target cluster centroid.
[0092] Further, in some optional embodiments of the present invention, the third judgment module 25 includes:
[0093] A first acquisition unit, configured to acquire a first time period at a current moment, a first standard Euclidean distance corresponding to the first time period, a second time period adjacent to the first time period, and a second standard Euclidean distance corresponding to the second time period;
[0094] A first judging unit, configured to judge whether the first standard Euclidean distance is equal to the second standard Euclidean distance;
[0095] A replacement unit is used to obtain a critical time point of the first time period and the second time period when it is determined that the first standard Euclidean distance and the second standard Euclidean distance are not equal, and when the time reaches the critical time point, replace the second standard Euclidean distance with the first standard Euclidean distance.
[0096] Furthermore, in some optional embodiments of the present invention, the air quality warning system 200 further includes:
[0097] An average value calculation module, for obtaining the corresponding target Euclidean distance calculated according to the concentration values of each pollutant in a preset time period when it is determined that the target Euclidean distance is less than the standard Euclidean distance, and calculating the average value of all target Euclidean distances in the concentration value of a certain pollutant;
[0098] A fourth judgment module, used to judge whether the difference between the average value and the corresponding standard Euclidean distance is greater than a threshold;
[0099] The adjustment module is used to adjust the standard Euclidean distance according to the average value when it is determined that the difference between the average value and the corresponding standard Euclidean distance is greater than a threshold.
[0100] Embodiment 3
[0101] Another aspect of the present invention provides an electronic device, see Figure 3 , shown is a structural block diagram of an electronic device in the third embodiment of the present invention, including a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor. When the processor 10 executes the computer program 30, the air quality alarm method as described above is implemented.
[0102] In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 20, such as executing access restriction programs.
[0103] The memory 20 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 20 may be an internal storage unit of an electronic device, such as a hard disk of the electronic device. In other embodiments, the memory 20 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 20 may also include both an internal storage unit of the electronic device and an external storage device. The memory 20 may be used not only to store application software and various types of data of the electronic device, but also to temporarily store data that has been output or is to be output.
[0104] It should be pointed out that Figure 3 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than those shown in the figure, or combine certain components, or arrange the components differently.
[0105] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the air quality alarm method as described above is implemented.
[0106] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0107] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0108] It should be understood that the various parts of the present invention can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data state, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0109] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0110] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.
Claims
1. An air quality alarm method, characterized in that: The method comprises: Acquire the concentration values of various pollutants collected by sensors in real time, form a pollutant concentration data set, and determine whether each concentration value is within the standard range; If yes, then respectively obtain the first concentration value and the second concentration value of each pollutant at adjacent moments, and calculate the corresponding concentration change according to the first concentration value and the second concentration value; Determine whether the concentration change is greater than a corresponding change threshold; If not, clustering the concentration values of each pollutant in the pollutant concentration data set to determine the corresponding target cluster centroid; Obtaining the third concentration value of each pollutant at the current moment, calculating the target Euclidean distance according to the third concentration value and the target cluster centroid, and determining whether the target Euclidean distance is greater than the standard Euclidean distance; If so, an alarm is issued to indicate that the air quality is abnormal.
2. The air quality alarm method according to claim 1, characterized in that: The step of clustering the concentration values of each pollutant in the pollutant concentration data set to determine the corresponding target cluster centroid includes: Step 1: Determine the corresponding coordinate point according to the concentration value of each pollutant in the pollutant concentration data set; Step 2: randomly select k coordinate points from all coordinate points as the centroid of the first cluster, where k is the number of pollutants; Step 3, calculating the first Euclidean distance between the coordinate points other than the first cluster centroid and the first cluster centroid; Step 4: according to the first Euclidean distance, the pollutant concentration data set is divided into k clusters with the first cluster centroid as a reference point; Step 5, obtaining the corresponding coordinate points in each cluster, and calculating the average value of all the coordinate points in the cluster to obtain the target coordinate point, and updating the centroid of the first cluster according to the target coordinate point; Step 6: Repeat steps 3 to 5 until the first cluster centroid does not change any more, and then define the first cluster centroid as the target cluster centroid.
3. The air quality warning method according to claim 2, characterized in that: In the step of calculating the first Euclidean distances of other coordinate points except the first cluster centroid from the first cluster centroid, the calculation formula of the first Euclidean distance is: Wherein, d(x, y) represents the Euclidean distance between coordinate point x and coordinate point y, and n represents the dimension.
4. The air quality alarm method according to claim 3, characterized in that: The standard Euclidean distance changes dynamically over time.
5. The air quality warning method according to claim 4, characterized in that: The steps of obtaining the third concentration value of each pollutant at the current moment, calculating the target Euclidean distance according to the third concentration value and the target cluster centroid, and determining whether the target Euclidean distance is greater than the standard Euclidean distance include: Obtain a first time period at the current moment, a first standard Euclidean distance corresponding to the first time period, a second time period adjacent to the first time period, and a second standard Euclidean distance corresponding to the second time period; Determining whether the first standard Euclidean distance and the second standard Euclidean distance are equal; If not, a critical time point of the first time period and the second time period is obtained, and when the time reaches the critical time point, the second standard Euclidean distance is replaced by the first standard Euclidean distance.
6. The air quality alarm method according to claim 5, characterized in that: The step of obtaining the third concentration value of each pollutant at the current moment, calculating the target Euclidean distance according to the third concentration value and the target cluster centroid, and determining whether the target Euclidean distance is greater than the standard Euclidean distance comprises: When it is determined that the target Euclidean distance is less than the standard Euclidean distance, the corresponding target Euclidean distance calculated according to the concentration values of each pollutant in the preset time period is obtained, and the average value of all target Euclidean distances in the concentration value of a certain pollutant is calculated; Determine whether the difference between the average value and the corresponding standard Euclidean distance is greater than a threshold; If so, the standard Euclidean distance is adjusted according to the average value.
7. An air quality warning system, characterized in that: The system comprises: The first judgment module is used to obtain the concentration values of various pollutants collected by the sensor in real time, form a pollutant concentration data set, and judge whether each concentration value is within the standard range; A concentration change calculation module, for respectively obtaining a first concentration value and a second concentration value of each pollutant at adjacent moments when it is determined that each of the concentration values is within a standard range, and calculating a corresponding concentration change according to the first concentration value and the second concentration value; A second judgment module is used to judge whether the concentration change is greater than a corresponding change threshold; A target cluster centroid determination module is used to cluster the concentration values of each pollutant in the pollutant concentration data set to determine the corresponding target cluster centroid when it is determined that the concentration change is not greater than the corresponding change threshold; A third judgment module is used to obtain a third concentration value of each pollutant at a current moment, calculate a target Euclidean distance according to the third concentration value and the target cluster centroid, and judge whether the target Euclidean distance is greater than a standard Euclidean distance; The alarm module is used to issue an alarm when it is determined that the target Euclidean distance is greater than the standard Euclidean distance to indicate that the air quality is abnormal.
8. A computer-readable storage medium, characterized in that: include: The readable storage medium stores one or more programs, which, when executed by a processor, implement the air quality alarm method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, the claim The air quality alarm method described in any one of 1-6.
Citation Information
Patent Citations
Cluster algorithm-based air quality prediction method
CN108564110A
Outdoor environment monitoring and analysis system and method
CN110057982A