Air quality prediction method and system
By combining candlestick chart pattern recognition with pre-trained models, the problem of lack of in-depth analysis in air quality data visualization is solved, enabling accurate prediction and intelligent early warning of air quality trends, and supporting multi-dimensional analysis and decision support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN YUNYI INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-04-30
- Publication Date
- 2026-06-30
AI Technical Summary
Existing methods for visualizing air quality data lack in-depth analysis of the inherent patterns in the data, making it difficult to effectively identify key turning points, assess the strength of pollution trends, and predict future changes.
By employing candlestick chart pattern recognition technology, we acquire current monitoring time-series data of atmospheric pollutant factors, calculate statistical values, and draw candlestick charts for pattern recognition. Combined with meteorological data and pre-trained models, we predict future air quality trends.
It improves the accuracy of air quality trend judgment and prediction, supports multi-dimensional analysis and multi-timescale prediction, and provides a scientific basis for environmental protection decision-making.
Smart Images

Figure CN122307041A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of air quality monitoring technology, and in particular to an air quality prediction method and system. Background Technology
[0002] With the acceleration of industrialization and the improvement of urbanization, air pollution control and public health awareness are increasing, and air quality monitoring and forecasting have become an important part of environmental protection and governance.
[0003] In related technologies, the visualization of air quality data mainly adopts traditional chart formats such as line charts, bar charts, and scatter plots. While these charts can intuitively display data changes, they lack in-depth analysis of the inherent patterns in the data. In particular, traditional methods are not ideal in identifying key turning points in air quality changes, judging the strength of pollution trends, and predicting future directions of change. Summary of the Invention
[0004] In view of this, this application provides an air quality prediction method and system for accurate prediction of air quality.
[0005] The objective of this application can be achieved through the following technical solutions: The first aspect of this application is to provide an air quality prediction method, including: Obtain current time-series monitoring data of air pollutant factors; The current statistical values of air pollutant factors are calculated based on the current monitoring time series data; Draw a candlestick chart based on the current statistical values; Perform pattern recognition on the candlestick chart to obtain the current pattern recognition result; Based on the current morphology recognition results, the air quality trend prediction results are obtained.
[0006] In one optional embodiment, the statistical values include at least the following statistical values: opening value, closing value, highest value, and lowest value of the air pollutant factor, wherein the opening value refers to the pollutant concentration at the beginning of the time interval, the closing value refers to the pollutant concentration at the end of the time interval, the highest value refers to the maximum pollutant concentration within the time interval, and the lowest value refers to the minimum pollutant concentration within the time interval.
[0007] In one optional embodiment, pattern recognition is performed on the candlestick chart to obtain the current pattern recognition result, including: The length of the body, the daily fluctuation range, the upper shadow length, and the lower shadow length are calculated based on the closing value, opening value, highest value, and lowest value. The length of the body, the daily fluctuation range, the upper shadow length, and the lower shadow length are determined as the current pattern recognition result. Among them, the body length is the absolute value of the difference between the closing value and the opening value, the daily fluctuation range is the difference between the highest value and the lowest value, the upper shadow length is the difference between the highest value and the upper end of the body, the lower shadow length is the difference between the lower end of the body and the lowest value, the upper end of the body is the larger value between the closing value and the opening value, and the lower end of the body is the smaller value between the closing value and the opening value.
[0008] In one optional embodiment, an air quality trend prediction result is obtained by predicting future air quality trends based on the current morphology recognition result, including: Obtain current weather data; By inputting current meteorological data and current morphological recognition results into a pre-trained air quality prediction model, the air quality trend prediction results for a preset future time period are obtained.
[0009] In one optional embodiment, performing pattern recognition on the candlestick chart to obtain the current pattern recognition result further includes: The range to which an entity belongs is determined based on the ratio of its length to its daily fluctuation range; The range of shadow length is determined by the ratio of shadow length to body length. Shadow length includes the upper shadow length and the lower shadow length. The current shape recognition result is determined based on the range to which the entity belongs and the range to which the shadow line length belongs.
[0010] In one optional embodiment, the current pattern recognition result further includes: large bullish candlestick, small bullish candlestick, large bearish candlestick, small bearish candlestick, bullish candlestick with upper shadow, bullish candlestick with lower shadow, bearish candlestick with upper shadow, bearish candlestick with lower shadow, large doji, and small doji.
[0011] In one optional embodiment, an air quality trend prediction result is obtained by predicting future air quality trends based on the current morphology recognition result, including: Based on preset rules, each candlestick in the current pattern recognition result is analyzed to obtain the trend direction result; A sliding window is used to analyze the combination state of multiple K-lines in the current pattern recognition result to obtain the expected results of persistence. Based on candlestick charts, a trend strength indicator is calculated. The trend direction result, the expected persistence result, and the trend strength index are used to determine the current air quality status result; Based on the current and historical air quality status results, the air quality trend is predicted for the future time period, resulting in an air quality trend prediction.
[0012] A second aspect of this application is to provide an air quality prediction system, comprising: The acquisition module is used to acquire the current monitoring time series data of air pollutant factors; The calculation module is used to calculate the current statistical values of air pollutant factors based on the current monitoring time series data; The drawing module is used to draw candlestick charts based on current statistical values. The recognition module is used to perform pattern recognition on candlestick charts and obtain the current pattern recognition result. The prediction module is used to predict future air quality trends based on the current morphology recognition results, and obtain the air quality trend prediction results.
[0013] A third aspect of this application is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the method as described in the first aspect.
[0014] A fourth aspect of this application is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method as described in the first aspect.
[0015] Compared with existing technologies, the air quality prediction method provided in this application obtains current monitoring time-series data of atmospheric pollutant factors; calculates current statistical values of atmospheric pollutant factors based on the current monitoring time-series data; draws a candlestick chart based on the current statistical values; performs morphological recognition on the candlestick chart to obtain the current morphological recognition result; and predicts future air quality trends based on the current morphological recognition result to obtain air quality trend prediction results, thereby accurately predicting air quality. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A schematic flowchart of an air quality prediction method provided in an embodiment of this application; Figure 2 A structural block diagram of an air quality prediction system provided in an embodiment of this application; Figure 3 This is a structural block diagram of an electronic device for implementing an air quality prediction method, provided in an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.
[0019] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] It should be understood that in the embodiments of this application, "at least one" means one or more, and "more than one" means two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the related objects before and after it are in an "or" relationship. "Contains A, B and / or C" means containing any one, two, or three of A, B, and C.
[0021] It should be understood that in the embodiments of this application, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0022] To address the technical problems existing in related technologies, this application provides an air quality prediction method and system.
[0023] The air quality prediction method provided in this application can be executed by an electronic device, such as a terminal or a server. The terminal can be a smartphone, tablet, laptop, or other similar device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. It is understood that this application does not limit the specific entity executing the air quality prediction method.
[0024] The technical solution of this application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments described below are used to explain the technical solution of this application and are not intended to limit actual use.
[0025] To address the technical problems existing in related technologies, embodiments of this application provide an air quality prediction method, such as... Figure 1 As shown, Figure 1 This is a flowchart of an air quality prediction method provided in an embodiment of this application. It should be noted that the steps shown may be executed in a different logical order than that shown in the flowchart. The method may include the following steps S101 to S105.
[0026] Step S101: Obtain the current monitoring time series data of air pollutant factors.
[0027] In one optional embodiment, the atmospheric pollutant factors include PM2.5 and PM2.5. 10 SO2, NO2, CO and O3, etc.
[0028] In one specific implementation, monitoring data can be periodically captured via a RESTful API (Representational State Transfer Application Programming Interface), which supports data exchange in multiple formats such as XML (eXtensible Markup Language). Alternatively, monitoring data can be acquired in real time via file import. It can also be acquired in real time from a third-party platform. Alternatively, it can be directly connected to IoT sensor devices to acquire monitoring data in real time.
[0029] In a more specific embodiment, a multi-layered data access architecture is employed, enabling unified data acquisition and management through standardized interface protocols. OAuth (Open Authorization) 2.0 or API key authentication methods are used to ensure data transmission security. External API interfaces are periodically polled via HTTP (Hypertext Transfer Protocol) / HTTPS (Hypertext Transfer Protocol Secure) to obtain the latest monitoring data. For historical data import, batch parsing of various file formats is supported, and data format validation and error handling mechanisms are provided.
[0030] In one specific embodiment, the monitoring time-series data refers to the concentration monitoring time-series data of air pollutants within a specified time period. Time-series data refers to a data sequence arranged in chronological order, exhibiting temporal correlation and dependencies between consecutive data points.
[0031] In another optional embodiment, before calculating the current statistical value of the air pollutant factor based on the current monitoring time-series data, the method further includes: Perform at least one of the following preprocessing operations on the current monitoring time series data to obtain preprocessed data. The preprocessing operations include: data standardization, outlier detection, data cleaning, data transformation, and data organization.
[0032] It's important to note that data standardization refers to the process of processing data according to certain standards to eliminate the influence of different units and numerical ranges on the analysis results. For example, pollutant data is standardized according to national environmental standards. Outlier detection refers to the process of identifying values in data that significantly deviate from the normal range. For example, outliers can be deleted, replaced, or marked using methods such as box plots and isolated forests to identify and process outliers in air quality monitoring data. Furthermore, data quality can be further improved through steps such as data cleaning, data integration, data transformation, and data reduction, providing a reliable data foundation for subsequent analysis.
[0033] In another specific embodiment, data validity verification can also be performed, for example, there must be at least 45 minutes of valid data per hour and at least 20 hours of valid data per day.
[0034] Step S102: Calculate the current statistical values of air pollutant factors based on the current monitoring time series data.
[0035] In one optional embodiment, the statistical values include at least the following statistical values: opening value, closing value, highest value, and lowest value of the air pollutant factor, wherein the opening value refers to the pollutant concentration at the beginning of the time interval, the closing value refers to the pollutant concentration at the end of the time interval, the highest value refers to the maximum pollutant concentration within the time interval, and the lowest value refers to the minimum pollutant concentration within the time interval.
[0036] In one specific embodiment, the time interval can be set to 1 hour, 6 hours, 12 hours or 24 hours, etc., and custom time intervals are supported.
[0037] In one specific embodiment, Open (opening price) = x1, Close (closing price) = x n High (maximum value) = max{x1, x2, ..., x} n Low (minimum value) = min{x1, x2, ..., x} n}
[0038] Step S103: Draw a candlestick chart based on the current statistical values.
[0039] In one alternative embodiment, an open-source charting library such as ECharts is used to draw candlestick charts. Specifically, basic chart properties can be set, including title, axes, tooltip styles, and legends. Current statistical values are mapped to the data format required by ECharts. The X-axis uses a time-based axis, supporting zooming and panning operations; the Y-axis uses a numerical axis, automatically adjusting the scale according to the pollutant concentration range. Different colors and styles are set for different types of candlesticks: bullish, bearish, and crosshairs.
[0040] It should be noted that candlestick charts include bullish candlesticks, bearish candlesticks, doji candlesticks, long upper shadows, and long lower shadows.
[0041] Step S104: Perform pattern recognition on the candlestick chart to obtain the current pattern recognition result.
[0042] In one optional embodiment, pattern recognition is performed on the candlestick chart to obtain the current pattern recognition result, including: The length of the body, the daily fluctuation range, the upper shadow length, and the lower shadow length are calculated based on the closing value, opening value, highest value, and lowest value. The length of the body, the daily fluctuation range, the upper shadow length, and the lower shadow length are determined as the current pattern recognition result. Among them, the body length is the absolute value of the difference between the closing value and the opening value, the daily fluctuation range is the difference between the highest value and the lowest value, the upper shadow length is the difference between the highest value and the upper end of the body, the lower shadow length is the difference between the lower end of the body and the lowest value, the upper end of the body is the larger value between the closing value and the opening value, and the lower end of the body is the smaller value between the closing value and the opening value.
[0043] In another optional embodiment, performing pattern recognition on the candlestick chart to obtain the current pattern recognition result further includes: The range to which an entity belongs is determined based on the ratio of its length to its daily fluctuation range; The range of shadow length is determined by the ratio of shadow length to body length. Shadow length includes the upper shadow length and the lower shadow length. The current shape recognition result is determined based on the range to which the entity belongs and the range to which the shadow line length belongs.
[0044] In one specific embodiment, the current pattern recognition result also includes: large bullish candlestick, small bullish candlestick, large bearish candlestick, small bearish candlestick, bullish candlestick with upper shadow, bullish candlestick with lower shadow, bearish candlestick with upper shadow, bearish candlestick with lower shadow, large doji, and small doji.
[0045] It should be noted that a large entity refers to an entity whose length is greater than the first preset entity length threshold; a medium entity refers to an entity whose length is not less than the second preset entity length threshold and not greater than the first preset entity length threshold; a small entity refers to an entity whose length is less than the second preset entity length threshold; a long shadow refers to a shadow whose length is greater than a preset multiple of the entity length; a medium shadow refers to a shadow whose length is not less than the entity length but not greater than a preset multiple of the entity length; and a short shadow refers to a shadow whose length is less than the entity length.
[0046] In one specific embodiment, the first preset entity length threshold can be 60%, 65%, and 72%, etc., the second preset entity length threshold can be 25%, 32%, and 35%, etc., and the preset multiple can be 1.2 times, 2 times, and 2.5 times, etc., which are not limited in this application.
[0047] A large bullish candlestick (or a large bullish candlestick) indicates a rapidly increasing concentration of air pollutants, while a small bullish candlestick (or a small bullish candlestick) indicates a slowly increasing concentration of air pollutants. A large bearish candlestick (or a large bearish candlestick) indicates a rapidly decreasing concentration of air pollutants, while a small bearish candlestick (or a small bearish candlestick) indicates a slowly decreasing concentration of air pollutants.
[0048] A bullish candlestick with an upper shadow (or upper shadow) indicates a rising trend in air pollutant concentration, followed by a decline after encountering resistance. A bullish candlestick with a lower shadow (or lower shadow) indicates a falling trend in air pollutant concentration, followed by a rise after finding support. A bearish candlestick with an upper shadow (or upper shadow) indicates a falling trend in air pollutant concentration, followed by a decline after a period of weakness. A bearish candlestick with a lower shadow (or lower shadow) indicates a falling trend in air pollutant concentration, followed by a support level. A large doji candlestick (opening price equal to closing price, with both upper and lower shadows being long or medium) indicates a highly volatile trend in air pollutant concentration. A small doji candlestick (opening price equal to closing price, with both upper and lower shadows being short) indicates a slightly volatile trend in air pollutant concentration.
[0049] It should be noted that resistance is used to characterize factors that prevent the concentration of air pollutants from rising further, such as improvements in the external environment. Support is used to characterize factors that prevent the concentration of air pollutants from falling further, such as deterioration in the external environment. For example, on cloudy days or at night, O3 decreases while NO2 increases; on hot, sunny days, NO2 decreases while O3 increases.
[0050] In one specific embodiment, a large bullish candlestick has a body ratio ≥ 0.5 and an upper shadow ratio ≤ 0.1; a large bearish candlestick has a body ratio ≥ 0.5 and a lower shadow ratio ≤ 0.1; and a doji candlestick has a body ratio ≤ 0.2, an upper shadow ratio ≤ 0.2, and a lower shadow ratio ≤ 0.2.
[0051] It should be noted that the body ratio is the ratio of the body length to the total daily fluctuation range, the upper shadow ratio is the ratio of the upper shadow length to the total daily fluctuation range, and the lower shadow ratio is the ratio of the lower shadow length to the total daily fluctuation range.
[0052] Step S105: Based on the current morphology recognition results, predict the future air quality trend to obtain the air quality trend prediction results.
[0053] In one optional embodiment, an air quality trend prediction result is obtained by predicting future air quality trends based on the current morphology recognition result, including: Obtain current meteorological data; input the current meteorological data and current morphological recognition results into a pre-trained air quality prediction model to obtain air quality trend prediction results for a future preset time period.
[0054] In one alternative embodiment, the air quality prediction model employs a sequential model structure, comprising a bidirectional LSTM (Long Short-Term Memory) layer, a fully connected layer, and an output layer.
[0055] In one specific embodiment, the first layer is a bidirectional LSTM layer with 128 neurons, used to capture the forward and backward dependencies of the time series; the second layer is a bidirectional LSTM layer with 64 neurons, which further extracts high-level features; the fully connected layer contains 64 neurons and uses the ReLU (Rectified Linear Unit) activation function for nonlinear transformation; the output layer is designed according to the dimension of the prediction target and uses a linear activation function to output continuous values.
[0056] In another specific embodiment, a 20% Dropout layer is added after each LSTM layer and fully connected layer to prevent overfitting and improve generalization ability.
[0057] In another alternative embodiment, the training process of the air quality prediction model includes: Acquire historical meteorological state data and the corresponding morphological recognition results as sample input features; Obtain the historical air quality results corresponding to the sample input features as sample labels; Input the sample input features into the air quality prediction model to obtain the sample air quality prediction results corresponding to the sample input features; Target loss is calculated based on sample air quality prediction results and sample labels; The model parameters of the air quality prediction model are updated based on the target loss.
[0058] In one specific embodiment, a sliding window method is used to construct training samples with an input sequence length of 24 time steps. Each sample contains feature data from 24 consecutive time points as input to predict the air quality result at the next time point.
[0059] In another specific embodiment, the Adam (Adaptive Moment Estimation) optimizer is used, with a learning rate set to 0.001, a loss function of mean squared error, and an evaluation metric of mean absolute error.
[0060] In another specific embodiment, batch training is employed, for example, with a batch size of 32 and 100 training epochs. A validation set is used to monitor model performance and implement an early stopping mechanism to prevent overfitting.
[0061] In one specific embodiment, the air quality trend prediction result is the predicted concentration of air pollutant factors within a preset future time period.
[0062] It should be noted that this air quality prediction model supports both single-step and multi-step prediction.
[0063] In another optional embodiment, predicting future air quality trends based on current pattern recognition results to obtain air quality trend prediction results includes: analyzing each K-line in the current pattern recognition results based on preset rules to obtain trend direction results; analyzing the combination state of multiple K-lines in the current pattern recognition results using a sliding window to obtain persistence expectation results; calculating trend strength indicators based on K-lines; determining the trend direction results, persistence expectation results, and trend strength indicators as the current air quality status results; and predicting air quality trends in the future time period based on the current air quality status results and historical air quality status results to obtain air quality trend prediction results.
[0064] In one specific embodiment, the preset rules can be: a large bullish candlestick indicates a strong trend of worsening pollution, with the bulls (pollution sources) having an absolute advantage; a large bearish candlestick indicates a strong trend of improving pollution, with the bears (purification forces) having an absolute advantage; a long upper shadow indicates that rising pollution is encountering resistance and a possible pullback; a long lower shadow indicates that declining pollution is finding support and a possible rebound; and a doji indicates that the forces of the bulls and bears are in balance, and the pollution situation is at a turning point.
[0065] In another specific embodiment, consecutive large bullish candlesticks indicate a strong trend of worsening pollution; consecutive large bearish candlesticks indicate a strong trend of improving pollution; a long upper shadow after a bullish candlestick indicates that the rise in pollution is under control; a long lower shadow after a bearish candlestick indicates that pollution has dropped to a baseline level; and a dense appearance of doji candlesticks indicates that the pollution situation is at a turning point.
[0066] In another specific embodiment, a trend strength indicator is calculated based on candlestick charts, including: TSI = (Number of consecutive candlesticks moving in the same direction × Average body size) / Time window length; TSI stands for Trend Strength Index.
[0067] It should be noted that the number of consecutive candlesticks in the same direction is the number of consecutive candlesticks of the same type (positive or negative), the average body size is the average size of the bodies of these candlesticks, and the time window length is the length of the analysis time window.
[0068] In another specific embodiment, the prediction of air quality trends in the future time period based on the current air quality status results and historical air quality status results means determining the historical air quality status results similar to the current air quality status results, and obtaining the air quality results a period of time after the time of the historical air quality status results similar to the current air quality status results, and using them as the air quality trend prediction results corresponding to the current air quality status results.
[0069] In another alternative embodiment, the short-term (e.g., 1-3 time periods) direction of change can be predicted based on the trend direction results. The medium-term (3-7 time periods) trend can be predicted based on the trend strength index and persistence expectation of the current trend. The long-term (more than 7 time periods) trend can be predicted using an LSTM neural network model, combined with candlestick features and meteorological parameters.
[0070] In another optional embodiment, an early warning is triggered when the concentration of air pollutant factors exceeds a preset threshold; when an unfavorable trend change is detected; when a specific candlestick pattern appears; or when a prediction result indicates that severe pollution may occur in the future.
[0071] In one specific embodiment, when a pattern of consecutive large bullish candlesticks is identified and the predicted trend continues to rise, a pollution warning is automatically triggered; when a pattern of long upper shadows is identified and the predicted trend begins to decline, a pollution mitigation prompt is automatically triggered. This outputs the prediction results and corresponding risk warnings, which can serve as decision support.
[0072] In another alternative embodiment, a candlestick chart is displayed in a graphical user interface, showing long-term trend changes, supporting comparative analysis of multiple time periods or regions, and automatically generating analysis reports and charts.
[0073] In this embodiment, air quality data is displayed in the form of candlestick charts, which more intuitively reflects the changing patterns and trends of pollutant concentrations, improving the effectiveness of data visualization; it achieves a morphological description of pollutant concentration fluctuations, improving the accuracy of air quality trend judgment and prediction; it supports access to multiple data sources and multiple time interval settings, exhibiting good adaptability and scalability; combined with machine learning technology, it realizes automated prediction and intelligent early warning of air quality; it supports multi-dimensional analysis and multi-timescale prediction, providing a scientific basis for environmental protection decisions; it allows for customizable thresholds, supporting various business scenarios; and it supports secondary development and platform integration, adapting to multiple monitoring data sources.
[0074] Improving the accuracy and predictive capabilities of air quality analysis can better support environmental protection decision-making, promote environmental quality improvement and sustainable development, and has broad industrial applicability. It can be widely applied in environmental protection departments, meteorological departments, urban management, and corporate environmental management, possessing significant theoretical and practical value. For example, it can be applied to the following areas: Environmental monitoring departments: Provide advanced air quality analysis tools to environmental protection departments to improve the efficiency of monitoring data utilization and the accuracy of analysis.
[0075] Meteorological departments: combine meteorological data to predict air quality, providing support for weather forecasts and environmental early warnings.
[0076] Urban management departments: provide scientific basis for urban planning and environmental governance, and support the construction of smart cities.
[0077] Corporate Environmental Management: Providing industrial enterprises with pollution emission monitoring and early warning services to help them achieve green production.
[0078] Research institutions: Provide new analytical methods and tools for environmental science research and promote technological progress in related fields.
[0079] Public services: Providing the public with intuitive and easy-to-understand information on air quality trends to raise environmental awareness.
[0080] Corresponding to the air quality prediction method provided in the embodiments of this application, the embodiments of this application also provide an air quality prediction system, such as... Figure 2 As shown, the air quality prediction system includes: The acquisition module 201 is used to acquire the current monitoring time series data of air pollutant factors; The calculation module 202 is used to calculate the current statistical values of air pollutant factors based on the current monitoring time series data; Drawing module 203 is used to draw candlestick charts based on current statistical values; The recognition module 204 is used to perform pattern recognition on the candlestick chart and obtain the current pattern recognition result; The prediction module 205 is used to predict future air quality trends based on the current morphology recognition results, and obtain air quality trend prediction results.
[0081] Corresponding to the air quality prediction method provided in the embodiments of this application, the embodiments of this application also provide an electronic device for performing the air quality prediction method, such as... Figure 3 As shown, the electronic device includes: a processor 301; and a memory 302 for storing a program for an air quality prediction method. After the device is powered on and the program for the air quality prediction method is run by the processor, the following steps are performed: Obtain current time-series monitoring data of air pollutant factors; The current statistical values of air pollutant factors are calculated based on the current monitoring time series data; Draw a candlestick chart based on the current statistical values; Perform pattern recognition on the candlestick chart to obtain the current pattern recognition result; Based on the current morphology recognition results, the air quality trend prediction results are obtained.
[0082] Corresponding to the air quality prediction method provided in the embodiments of this application, the embodiments of this application also provide a computer-readable storage medium storing a program for the air quality prediction method, which is executed by a processor to perform the following steps: Obtain current time-series monitoring data of air pollutant factors; The current statistical values of air pollutant factors are calculated based on the current monitoring time series data; Draw a candlestick chart based on the current statistical values; Perform pattern recognition on the candlestick chart to obtain the current pattern recognition result; Based on the current morphology recognition results, the air quality trend prediction results are obtained.
[0083] Corresponding to the air quality prediction method provided in the embodiments of this application, the embodiments of this application also provide a computer program containing instructions, which, when executed by a computer, cause the computer to perform the following steps: Obtain current time-series monitoring data of air pollutant factors; The current statistical values of air pollutant factors are calculated based on the current monitoring time series data; Draw a candlestick chart based on the current statistical values; Perform pattern recognition on the candlestick chart to obtain the current pattern recognition result; Based on the current morphology recognition results, the air quality trend prediction results are obtained.
[0084] It should be noted that for a detailed description of the air quality prediction system, electronic device, computer-readable storage medium and computer program product provided in the embodiments of this application, please refer to the relevant description of the air quality prediction method embodiments provided in the embodiments of this application, which will not be repeated here.
[0085] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
[0086] In a typical configuration, an electronic device includes one or more processors (Central Processing Units), input / output interfaces, network interfaces, and memory.
[0087] Memory may include non-persistent storage in computer-readable media, such as random access memory and / or non-volatile memory, like read-only memory or flash memory. Memory is an example of computer-readable media.
[0088] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable operations, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, compact disc read-only memory, digital video disc or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0089] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, compact disc read-only memory, optical storage, etc.) containing computer-usable program code.
[0090] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
Claims
1. An air quality prediction method, characterized in that, include: Obtain current time-series monitoring data of air pollutant factors; The current statistical values of the air pollutant factors are calculated based on the current monitoring time series data; Draw a candlestick chart based on the current statistical values; Perform pattern recognition on the candlestick chart to obtain the current pattern recognition result; Based on the current morphology recognition results, the future air quality trend is predicted, and the air quality trend prediction result is obtained.
2. The air quality prediction method according to claim 1, characterized in that, The statistical values include at least the following: opening value, closing value, highest value, and lowest value of air pollutant factors, wherein the opening value refers to the pollutant concentration at the beginning of the time interval, the closing value refers to the pollutant concentration at the end of the time interval, the highest value refers to the maximum pollutant concentration within the time interval, and the lowest value refers to the minimum pollutant concentration within the time interval.
3. The air quality prediction method according to claim 2, characterized in that, The step of performing pattern recognition on the candlestick chart to obtain the current pattern recognition result includes: Based on the closing value, opening value, highest value, and lowest value, calculate the body length, daily fluctuation range, upper shadow length, and lower shadow length. Determine the body length, daily fluctuation range, upper shadow length, and lower shadow length as the current pattern recognition result. Specifically, the body length is the absolute value of the difference between the closing value and the opening value; the daily fluctuation range is the difference between the highest value and the lowest value; the upper shadow length is the difference between the highest value and the upper end of the body; the lower shadow length is the difference between the lower end of the body and the lowest value; the upper end of the body is the larger of the closing value and the opening value; and the lower end of the body is the smaller of the closing value and the opening value.
4. The air quality prediction method according to claim 3, characterized in that, The prediction of future air quality trends based on the current morphology recognition results, resulting in air quality trend prediction results, includes: Obtain current weather data; The current meteorological data and current morphological recognition results are input into a pre-trained air quality prediction model to obtain air quality trend prediction results for a future preset time period.
5. The air quality prediction method according to claim 2, characterized in that, The step of performing pattern recognition on the candlestick chart to obtain the current pattern recognition result also includes: The range to which the entity belongs is determined based on the ratio of the entity length to the daily fluctuation range; The range to which the shadow length belongs is determined based on the ratio of the shadow length to the length of the entity, and the shadow length includes the upper shadow length and the lower shadow length; The current shape recognition result is determined based on the range to which the entity belongs and the range to which the shadow line length belongs.
6. The air quality prediction method according to claim 5, characterized in that, The current pattern recognition results also include: large bullish candlestick, small bullish candlestick, large bearish candlestick, small bearish candlestick, upper shadow bullish candlestick, lower shadow bullish candlestick, upper shadow bearish candlestick, lower shadow bearish candlestick, large doji candlestick, and small doji candlestick.
7. The air quality prediction method according to claim 6, characterized in that, The prediction of future air quality trends based on the current morphology recognition results, resulting in air quality trend prediction results, includes: Based on preset rules, each candlestick in the current pattern recognition result is analyzed to obtain the trend direction result; A sliding window is used to analyze the combination state of multiple K-lines in the current pattern recognition result to obtain the expected continuous result; Based on the aforementioned candlestick chart, a trend strength index is calculated. The trend direction result, the expected persistence result, and the trend intensity index are determined as the current air quality status result; Based on the current air quality status and historical air quality status, an air quality trend prediction result is obtained for the future time period.
8. An air quality prediction system, characterized in that, include: The acquisition module is used to acquire the current monitoring time series data of air pollutant factors; The calculation module is used to calculate the current statistical value of the air pollutant factor based on the current monitoring time series data; The drawing module is used to draw a candlestick chart based on the current statistical values; The identification module is used to perform pattern recognition on the candlestick chart and obtain the current pattern recognition result; The prediction module is used to predict future air quality trends based on the current morphology recognition results, and obtain air quality trend prediction results.
9. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the air quality prediction method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the air quality prediction method according to any one of claims 1-7.