Indoor air quality detection method, device and storage medium

CN122594907APending Publication Date: 2026-08-18E SURFING VISION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610434789.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-02
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]在本实施例中提供了一种室内空气质量检测方法、装置、电子装置和存储介质,以解决相关技术中室内空气质量监测准确度低的问题

Benefits of technology

[0046]Compared with related technologies, the indoor air quality detection method, device, and storage medium provided in this embodiment offer several advantages. First, the indoor air quality detection method collects indoor environmental concentration data and generates an environmental concentration sequence sorted by timestamps. The environmental concentration data includes timestamps and gas data. Second, it acquires indoor scene images with timestamps, identifies indoor activity types at different timestamps based on the indoor scene images, and generates an indoor activity type sequence sorted by timestamps. Next, it aligns the environmental concentration sequence and the indoor activity type sequence based on the timestamps, and calculates the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence. Finally, it compares each correlation coefficient with a preset association threshold, identifies correlation coefficients exceeding the association threshold as target correlation coefficients, determines the indoor activity corresponding to the target correlation coefficient as the target indoor activity, identifies the source of air pollution as the target indoor activity, and marks the scene image corresponding to the target indoor activity as a pollution source scene image. By collecting environmental data and indoor scene images, associating indoor activity types with environmental concentrations, calculating correlation coefficients, and comparing them with preset thresholds, it can determine the source of pollution and confirm the pollution situation, thereby improving the accuracy of air quality detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594907A_ABST
    Figure CN122594907A_ABST
Patent Text Reader

Abstract

The application relates to an indoor air quality detection method, device and storage medium, the indoor air quality detection method comprising: collecting indoor environment concentration data with a timestamp and a scene image, generating an environment concentration sequence and an indoor activity type sequence sorted according to the timestamp; aligning the environment concentration sequence and the indoor activity type sequence according to the timestamp, and calculating the correlation coefficient between the aligned environment concentration sequence and the indoor activity type sequence; comparing each correlation coefficient with a preset correlation threshold, identifying the correlation coefficient exceeding the correlation threshold as a target correlation coefficient, determining the indoor activity corresponding to the target correlation coefficient as a target indoor activity, determining the air pollution source as the target indoor activity, and marking the scene image corresponding to the target indoor activity as a pollution source scene image. The correlation coefficient between the indoor activity type and the environment concentration is calculated, the pollution source is determined, the pollution condition is confirmed, and the accuracy of air quality detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of indoor air quality monitoring, and in particular to indoor air quality detection methods, devices, and storage media. Background Technology

[0002] Indoor air quality monitoring is a crucial research area for ensuring a healthy living environment, directly impacting people's quality of life and physical health. With rapid urbanization, indoor pollution is becoming increasingly prominent, making air quality monitoring technology a key area at the intersection of environmental science and smart home technology.

[0003] Current indoor air quality monitoring methods primarily rely on sensors to collect pollutant concentration data. However, sensors are susceptible to interference from environmental factors; for example, alcohol and perfume can trigger false alarms, making it difficult to accurately determine the pollution level. Furthermore, sensors only provide numerical results and cannot determine the actual pollution situation based on the source of the pollution. Therefore, indoor air quality monitoring suffers from low accuracy.

[0004] There is currently no effective solution to the problem of low accuracy in indoor air quality monitoring in related technologies. Summary of the Invention

[0005] This embodiment provides an indoor air quality detection method, apparatus, electronic device, and storage medium to address the problem of low accuracy in indoor air quality monitoring in related technologies.

[0006] Firstly, this embodiment provides an indoor air quality detection method, including:

[0007] Indoor environmental concentration data is collected, and an environmental concentration sequence sorted by timestamp is generated; the environmental concentration data includes the timestamp and gas data.

[0008] Acquire indoor scene images with timestamps, identify indoor activity types with different timestamps based on the indoor scene images, and generate a sequence of indoor activity types sorted by the timestamps;

[0009] Align the environmental concentration sequence and the indoor activity type sequence based on the timestamps, and calculate the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence.

[0010] Each correlation coefficient is compared with a preset association threshold. Correlation coefficients exceeding the association threshold are identified as target correlation coefficients. Indoor activities corresponding to the target correlation coefficients are identified as target indoor activities. The source of air pollution is determined to be the target indoor activity. The scene image corresponding to the target indoor activity is marked as a pollution source scene image.

[0011] In some embodiments, the process of collecting indoor environmental concentration data and generating an environmental concentration sequence sorted by timestamp includes:

[0012] Gas data with the timestamp is obtained from the environmental concentration data, and the gas data is arranged in ascending order according to the timestamp to obtain the environmental concentration sequence.

[0013] In some embodiments, acquiring timestamped indoor scene images, identifying indoor activity types with different timestamps based on the indoor scene images, and generating a sequence of indoor activity types ordered by the timestamps includes:

[0014] Acquire an indoor scene image with the timestamp mentioned above;

[0015] The scene image is input into a pre-trained network model to identify the type of indoor activity.

[0016] The indoor activity types are sorted in ascending order according to the timestamps to obtain the indoor activity type sequence.

[0017] In some embodiments, aligning the environmental concentration sequence and the indoor activity type sequence based on timestamps, and calculating the correlation coefficient between the environmental concentration sequence and the indoor activity type sequence, includes:

[0018] Align the environmental concentration sequence and the indoor activity type sequence according to the timestamp;

[0019] Standardize the environmental concentration sequence and the indoor activity type sequence;

[0020] The linear relationship between the environmental concentration sequence and the indoor activity type sequence is quantified to obtain the correlation coefficient between the environmental concentration sequence and the indoor activity type sequence.

[0021] In some embodiments, the indoor air quality detection method further includes:

[0022] The marked pollution source scene images are sorted by timestamp, and environmental visual elements in the pollution source scene images are separated and quantified through image processing to obtain environmental visual feature values.

[0023] A time-series data sequence is constructed based on the environmental visual feature values, and the trend of environmental quality change is predicted based on the time-series data sequence.

[0024] The environmental quality change trend and the environmental concentration sequence are integrated into a comprehensive environmental index sequence. The comprehensive environmental index sequence is predicted and compared with a preset safety threshold. Based on the comparison result, it is determined whether to generate an early warning response signal.

[0025] The warning response signal is associated with the type of indoor activity to generate intervention measures for that type of indoor activity.

[0026] In some embodiments, the step of sorting the marked pollution source scene images by timestamp, separating and quantifying environmental visual elements in the pollution source scene images through image processing to obtain environmental visual feature values, constructing a time-series data sequence based on the environmental visual feature values, and predicting the environmental quality change trend based on the time-series data sequence includes:

[0027] The images labeled as pollution source scenes are sorted according to their corresponding timestamps to generate a pollution scene image sequence;

[0028] Image processing is performed on each frame of the pollution scene image sequence to separate environmental visual elements related to environmental quality;

[0029] The environmental visual elements of each frame image are quantified to obtain the environmental visual features of the timestamp corresponding to the pollution scene image sequence;

[0030] The time-series data sequence is constructed using the environmental visual features;

[0031] The time series data sequence is subjected to time series analysis to capture the fluctuations of the time series data sequence and predict the trend of environmental quality change.

[0032] In some embodiments, the step of fusing the environmental quality change trend and the environmental concentration sequence into a comprehensive environmental index sequence, comparing the predicted comprehensive environmental index sequence with a preset safety threshold, and determining whether to generate an early warning response signal based on the comparison result includes:

[0033] The environmental quality change trend and the environmental concentration sequence are fused according to the corresponding timestamps to generate a comprehensive environmental index sequence;

[0034] The comprehensive environmental index sequence is predicted using a deep learning model to obtain predicted environmental quality values.

[0035] The predicted environmental quality value is compared with a preset safety standard threshold.

[0036] If the predicted value exceeds the safety standard threshold, an early warning response signal is generated.

[0037] In some embodiments, associating the warning response signal with indoor activity types to generate intervention measures for those indoor activity types includes:

[0038] Obtain the warning response signal;

[0039] The warning response signal is associated and matched with the type of indoor activity;

[0040] Based on the association matching results, personalized intervention measures are generated for the indoor activity type.

[0041] Secondly, this embodiment provides an indoor air quality detection device, including: a data acquisition module, a coefficient calculation module, and a pollution judgment module; wherein:

[0042] The data acquisition module is used to collect indoor environmental concentration data and generate an environmental concentration sequence sorted by timestamp; the environmental concentration data includes the timestamp and gas data; acquire indoor scene images with timestamps, identify indoor activity types with different timestamps based on the indoor scene images, and generate an indoor activity type sequence sorted by timestamp.

[0043] The coefficient calculation module is used to align the environmental concentration sequence and the indoor activity type sequence according to the timestamp, and calculate the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence.

[0044] The pollution judgment module is used to compare each correlation coefficient with a preset association threshold, identify correlation coefficients exceeding the association threshold as target correlation coefficients, determine the indoor activity corresponding to the target correlation coefficient as the target indoor activity, determine the source of air pollution as the target indoor activity, and mark the scene image corresponding to the target indoor activity as the pollution source scene image.

[0045] Thirdly, this embodiment provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the indoor air quality detection method described in the first aspect.

[0046] Compared with related technologies, the indoor air quality detection method, device, and storage medium provided in this embodiment offer several advantages. First, the indoor air quality detection method collects indoor environmental concentration data and generates an environmental concentration sequence sorted by timestamps. The environmental concentration data includes timestamps and gas data. Second, it acquires indoor scene images with timestamps, identifies indoor activity types at different timestamps based on the indoor scene images, and generates an indoor activity type sequence sorted by timestamps. Next, it aligns the environmental concentration sequence and the indoor activity type sequence based on the timestamps, and calculates the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence. Finally, it compares each correlation coefficient with a preset association threshold, identifies correlation coefficients exceeding the association threshold as target correlation coefficients, determines the indoor activity corresponding to the target correlation coefficient as the target indoor activity, identifies the source of air pollution as the target indoor activity, and marks the scene image corresponding to the target indoor activity as a pollution source scene image. By collecting environmental data and indoor scene images, associating indoor activity types with environmental concentrations, calculating correlation coefficients, and comparing them with preset thresholds, it can determine the source of pollution and confirm the pollution situation, thereby improving the accuracy of air quality detection.

[0047] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0048] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0049] Figure 1 This is a hardware structure block diagram of a terminal for an indoor air quality detection method according to an embodiment of this application;

[0050] Figure 2 This is a flowchart of an indoor air quality detection method according to an embodiment of this application;

[0051] Figure 3 This is a preferred flowchart of an embodiment of the indoor air quality detection method of this application;

[0052] Figure 4 This is a structural block diagram of an indoor air quality detection device according to an embodiment of this application. Detailed Implementation

[0053] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0054] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this application do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. Words such as “connected,” “linked,” and “coupled” used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in this application are merely to distinguish similar objects and do not represent a specific order of objects.

[0055] The method embodiments provided in this example can be executed on a terminal, computer, or similar electronic device with a certain computing power. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of a terminal for an indoor air quality detection method according to an embodiment of this application. (See diagram below.) Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0056] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the indoor air quality detection method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0057] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0058] This embodiment provides a method for indoor air quality detection. Figure 2 This is a flowchart of an indoor air quality detection method according to an embodiment of this application, as follows: Figure 2 As shown, the process includes the following steps:

[0059] Step S210: Collect indoor environmental concentration data and generate an environmental concentration sequence sorted by timestamp; the environmental concentration data includes timestamps and gas data.

[0060] It collects environmental concentration data in real time to quantify indoor air quality. Specific collection locations can be flexibly deployed according to testing needs, such as setting up collection points in the center of the living room, near the bedside in the bedroom, and near the kitchen stove to obtain air quality conditions in different areas. The collected gases include various indicators, capable of obtaining concentrations of particulate matter with a diameter of 2.5 micrometers or less, particulate matter with a diameter of 10 micrometers or less, formaldehyde concentration, total volatile organic compound concentration, and carbon dioxide concentration.

[0061] The data acquisition process operates continuously at a preset sampling frequency. The sampling frequency can be dynamically adjusted according to the actual scenario. For example, in standard monitoring mode, it can be set to collect data once every 10 seconds; when abnormal fluctuations in air quality are detected, a high-frequency mode can be triggered, dynamically adjusting to collect data once every 1 second to improve the ability to capture rapidly changing processes. After each sampling cycle, a data unit is generated, which contains at least two core pieces of information: first, the current timestamp, used to mark the time of data collection; and second, the concentration values ​​of various gases, reflecting the air pollution situation at the current timestamp.

[0062] After extracting timestamps from the environmental concentration data, a data analysis library is used to sort the data in ascending order by timestamp to form an environmental concentration sequence. The extracted timestamps and concentration values ​​are then sorted based on the timestamp column using a sorting function, resulting in an ordered environmental concentration sequence that clearly shows the trend of gas concentration changes over time.

[0063] Step S220: Obtain indoor scene images with timestamps, identify indoor activity types with different timestamps based on the indoor scene images, and generate a sequence of indoor activity types sorted by timestamps.

[0064] Acquire indoor scene images with timestamps. The acquisition of indoor scene images is synchronized with the acquisition of environmental concentration data in step S210. Specifically, scene image acquisition devices are installed at the same or adjacent locations as the air quality collection points. When capturing indoor scene images at each timestamp, the scene image acquisition devices embed accurate timestamps into the indoor scene image files based on a unified clock source.

[0065] Subsequently, a pre-trained activity recognition model identifies indoor activity types at different timestamps based on indoor scene images. The acquired indoor scene images are input into the activity recognition model, which outputs the indoor activity type associated with each timestamp. Recognizable activity types are predefined in an activity category library, such as smoking, cooking, cleaning, using an air purifier, opening windows for ventilation, and unattended activity. By performing recognition operations on all indoor scene images within the acquisition time period, activity type recognition results with timestamps are obtained. Specifically, the activity recognition model is built on a deep learning architecture and can be implemented using convolutional neural networks (CNNs) or 3D convolutional neural networks (3D CNNs). CNNs automatically extract spatial features from images through multiple convolutional and pooling layers, making them suitable for single-frame image classification tasks. 3D CNNs introduce a temporal dimension on top of spatial convolution, enabling the simultaneous capture of motion information from multiple consecutive frames, making them suitable for action recognition in video sequences. The activity recognition model is pre-trained on a large-scale image dataset and then fine-tuned and optimized on an indoor activity image dataset using transfer learning. The indoor activity image dataset is constructed by collecting indoor activity samples under different scenes and lighting conditions, covering various activity types such as smoking, cooking, and cleaning, and labeling the images with corresponding activity category tags. During training, preprocessed images are input into the activity recognition model, and the model parameters are optimized through the backpropagation algorithm, enabling the activity recognition model to learn the mapping relationship from indoor scene images to indoor activity categories. By performing recognition operations on all indoor scene images within the collection time period, activity type recognition results with timestamps are obtained. Then, the activity type recognition results are sorted in ascending order based on the timestamps to generate a strictly chronological sequence of indoor activity types.

[0066] Step S230: Align the environmental concentration sequence and the indoor activity type sequence according to the timestamp, and calculate the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence.

[0067] Since both environmental concentration data and indoor activity type data are timestamped and originate from the same synchronized acquisition device with the same clock source, they have a natural correspondence on the timeline. Using the timestamp as the unique association key, the environmental concentration sequence and the indoor activity type sequence are merged to obtain a time-aligned dataset. Furthermore, to quantitatively measure the correlation between indoor activities and air quality changes, a correlation analysis is required on the aligned environmental concentration sequence and the indoor activity type sequence. Because the indoor activity type sequence is categorical data while the environmental concentration sequence is numerical data, the indoor activity type sequence needs to be numerically encoded before calculating the correlation coefficient. After encoding, statistical methods are used to calculate the correlation coefficient between the encoded sequence and the environmental concentration sequence.

[0068] Step S240: Compare each correlation coefficient with a preset correlation threshold, identify correlation coefficients that exceed the correlation threshold as target correlation coefficients, determine the indoor activities corresponding to the target correlation coefficients as target indoor activities, identify the source of air pollution as the target indoor activities, and mark the scene images corresponding to the target indoor activities as pollution source scene images.

[0069] After completing the correlation analysis of the aligned sequences, a set of correlation coefficients was obtained. Since correlation coefficients can be obtained through different coding methods during the coding process—for example, the one-heat coding method yields correlation coefficients between multiple activity types and the concentration sequence, while the sequential coding method yields a composite correlation coefficient between the coded sequence and the concentration sequence—strongly correlated results with statistical significance can be identified from the correlation coefficients based on a preset association threshold, and the source of pollution can be determined accordingly.

[0070] Specifically, the first step is to preset a correlation threshold. This threshold is a pre-defined numerical limit used to determine whether the correlation coefficient is strong enough to establish a causal relationship. The correlation threshold can be flexibly configured according to the sensitivity requirements of the application scenario. For example, the preset threshold can be set to 0.7. In scenarios requiring high-sensitivity identification of pollution sources (such as sensitive locations like hospitals and kindergartens), the threshold can be appropriately lowered to 0.5 to capture more potential pollution events; in scenarios where false alarms need to be avoided (such as ordinary residences), the threshold can be appropriately increased to 0.8 to ensure accuracy.

[0071] Secondly, each correlation coefficient is compared with a preset association threshold. The absolute value of the correlation coefficient between each type of indoor activity (such as smoking, cooking, cleaning, etc.) and the environmental concentration sequence is compared with the preset association threshold one by one. For example, if a single correlation coefficient is obtained using sequential encoding, the absolute value of the correlation coefficient is directly compared with the threshold; if multiple correlation coefficients for each activity type are obtained using one-hot encoding, each correlation coefficient needs to be compared with the preset association threshold separately.

[0072] When the absolute value of the correlation coefficient corresponding to an indoor activity type exceeds a preset association threshold, the correlation coefficient corresponding to that indoor activity type is identified as the target correlation coefficient. For example, assuming the association threshold is set to 0.7, the calculated correlation coefficients between smoking and PM2.5 concentration are 0.85, cooking and PM2.5 concentration are 0.72, and cleaning and PM2.5 concentration are 0.35. By comparison, the 0.85 for smoking and the 0.72 for cooking both exceed 0.7, therefore these two coefficients are identified as target correlation coefficients. The indoor activity types corresponding to the target correlation coefficients are then determined as target indoor activities. Continuing with the above example, smoking and cooking are identified as target indoor activities, indicating a strong correlation between these two activities and an increase in PM2.5 concentration.

[0073] Based on the above identification results, the source of air pollution in the current time period is determined to be the target indoor activity. The determination result can be one or more activity types, depending on the number of correlation coefficients exceeding the threshold. When multiple activity types exceed the threshold simultaneously, they can be further sorted according to the magnitude of their correlation coefficients; the higher the correlation coefficient, the greater the contribution of the activity to the pollution. For example, the correlation coefficient of smoking (0.85) is higher than that of cooking (0.72), therefore smoking is determined to be the primary source of pollution, and cooking is the secondary source of pollution.

[0074] Finally, the indoor scene images corresponding to the timestamps of the target indoor activities are extracted, and pollution source identifiers are added to form pollution source scene images. Specific labeling methods include: writing pollution source tags into the image file's metadata, such as "pollution_source=smoking"; renaming the indoor scene image file to a format containing activity type and time information, such as "smoking_20231015_143022.jpg"; or storing the labeling information in a separate database table and associating it with the path of the indoor scene image. The labeled pollution source scene image includes the following information: the time period of the pollution event, the type of activity identified as a pollution source, and environmental concentration data aligned with the image sequence time.

[0075] For example, if smoking activity is detected within a certain time period (e.g., 14:30:00 to 14:35:00), and the correlation coefficient between smoking activity and PM2.5 concentration during this time period reaches 0.85, exceeding the preset correlation threshold of 0.7, then all indoor scene images collected during this time period are extracted, and a data tag of "pollution_source=smoking" is added to each indoor scene image. The indoor scene images of this time period are then bound and stored with the corresponding PM2.5 concentration data, resulting in labeled pollution source scene images and forming a complete pollution source tracing evidence chain. These labeled pollution source scene images can be used to extract environmental quality change characteristics, predict pollution trends, and generate targeted intervention measures.

[0076] Compared to other related technologies, indoor air quality monitoring methods primarily rely on sensors to collect pollutant concentration data. Various gas sensors deployed indoors acquire real-time ambient gas concentration values, triggering alarms or activating air purification equipment when a pollutant concentration exceeds a preset threshold. However, sensors are susceptible to interference from environmental factors. For example, alcohol, perfume, cooking fumes, and cleaning agent volatiles can all cause abnormally high sensor response values, leading to false alarms or false alerts, making it difficult to accurately determine the true pollution situation. Furthermore, sensors only provide abstract numerical results and cannot perceive the specific context of indoor human activities. When abnormal fluctuations in ambient concentration data occur, it is impossible to distinguish whether the abnormal fluctuations are caused by actual pollution events (such as smoking) or by interference sources (such as spraying perfume), let alone trace the specific source of pollution. This results in low accuracy in existing indoor air quality monitoring methods.

[0077] Steps S210 to S240 above involve the following steps: First, the indoor air quality detection method collects indoor environmental concentration data and generates an environmental concentration sequence sorted by timestamps. The environmental concentration data includes timestamps and gas data. Second, it acquires indoor scene images with timestamps, identifies indoor activity types at different timestamps based on the indoor scene images, and generates an indoor activity type sequence sorted by timestamps. Further, it aligns the environmental concentration sequence and the indoor activity type sequence based on the timestamps, and calculates the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence. Finally, it compares each correlation coefficient with a preset correlation threshold, identifies correlation coefficients exceeding the correlation threshold as target correlation coefficients, determines the indoor activity corresponding to the target correlation coefficient as the target indoor activity, identifies the source of air pollution as the target indoor activity, and marks the scene image corresponding to the target indoor activity as a pollution source scene image. By collecting environmental data and indoor scene images, correlating indoor activity types with environmental concentrations, calculating correlation coefficients, and comparing them with preset thresholds, it can determine the source of pollution and confirm the pollution situation, thereby improving the accuracy of air quality detection.

[0078] Optionally, in one embodiment, collecting indoor environmental concentration data and generating an environmental concentration sequence sorted by timestamps includes: obtaining gas data with timestamps from the environmental concentration data, arranging the gas data in ascending order according to the timestamps, and obtaining the environmental concentration sequence.

[0079] Specifically, environmental concentration data is collected in real time through air quality monitoring equipment deployed in key indoor locations. The air quality monitoring equipment operates continuously, and at the end of each sampling cycle, it obtains environmental concentration data including a timestamp generated in real time by the equipment's built-in clock and response values ​​from various gas sensors or calibrated concentration values.

[0080] Subsequently, all valid data records are extracted from the environmental concentration data. Each environmental concentration data record contains a timestamp field and a gas concentration value field. All data records are sorted in ascending order based on the timestamp. Ascending order means sorting according to the time from earliest to latest, i.e., records with smaller timestamps are listed first, and records with larger timestamps are listed last. The sorting algorithm can use quicksort or mergesort, or it can be implemented directly using the built-in sorting functions of the data analysis tool.

[0081] Next, the sorted data records are organized sequentially to form an environmental concentration sequence. Each element in the environmental concentration sequence corresponds to a sampling time, including a timestamp and the concentration values ​​of various gases collected at that timestamp. The environmental concentration sequence can be represented in tabular form, where each row represents a time point and each column represents a gas index; or it can be represented in time series form, where each gas index corresponds to an independent concentration change curve.

[0082] For example, in one embodiment, the collected environmental concentration data is imported into Python's pandas library to construct a DataFrame object containing a timestamp column and several gas concentration columns. Then, the DataFrame's sort_values() method is called to rearrange the data in ascending order of timestamps. After sorting, the resulting DataFrame is a standardized environmental concentration sequence, which can be directly used for subsequent processing such as time alignment, correlation analysis, and trend prediction.

[0083] The environmental concentration sequence obtained through the above sorting process provides an accurate and orderly data foundation for subsequent time-synchronized correlation analysis with indoor activity type sequences.

[0084] In addition, in one embodiment, acquiring indoor scene images with timestamps, identifying indoor activity types with different timestamps based on the indoor scene images, and generating a sequence of indoor activity types sorted by timestamps includes: acquiring indoor scene images with timestamps; inputting the scene images into a pre-trained network model to identify indoor activity types; and sorting the indoor activity types in ascending order according to timestamps to obtain a sequence of indoor activity types.

[0085] The process involves acquiring timestamped indoor scene images, ensuring synchronization between image acquisition and environmental concentration data collection. Specifically, scene acquisition devices (such as smart cameras) are installed at the same or adjacent locations as air quality monitoring points. Each captured image frame is embedded with an accurate timestamp in the image file using a unified clock source synchronized via a network time protocol. A pre-trained activity recognition model identifies indoor activity types at different timestamps based on the indoor scene images. This activity recognition model is built on a deep learning architecture, exemplarily employing a convolutional neural network structure. First, the acquired indoor scene images at each timestamp are preprocessed, including adjusting the image size to meet the activity recognition model's input requirements (e.g., 224×224 pixels) and normalizing pixel values ​​to conform to the model's input specifications. Then, the preprocessed images are input into the activity recognition model. The model automatically extracts visual features from the images through a multi-layered network structure, including human posture, object positions, scene textures, and smoke conditions, ultimately outputting the probability distribution of the indoor activity type associated with that timestamp.

[0086] During feature extraction, the fully connected layer of the activity recognition model outputs a fixed-dimensional feature vector, which is the image's behavior pattern vector. This behavior pattern vector numerically condenses key visual information from the image and can be represented as a high-dimensional array like [0.23, 0.87, 0.15, ...], serving as the quantification basis for subsequent activity type matching. Recognizable activity types are predefined in an activity category library. The categories in this library can be flexibly configured according to actual application scenarios, and may include activities such as smoking, cooking, cleaning, using an air purifier, opening windows for ventilation, and unattended activities. The pre-stored activity category library contains standard reference vectors for various indoor activities. The reference vector for each category is obtained by collecting a large number of sample images of that type of activity, extracting its behavior pattern vector, and calculating its mean value, representing the typical feature patterns of that type of activity.

[0087] To compare the similarity between the behavior pattern vectors of timestamped indoor scene images and reference vectors in a pre-defined activity category library, Euclidean distance is used for calculation. For the behavior pattern vector of the indoor scene image at the current timestamp... and the reference vector of the category in the category library The Euclidean distance between the two is calculated as follows:

[0088] ;

[0089] The calculated distance value d is a non-negative number. A smaller d indicates a more similar behavior pattern vector to the category reference vector, meaning the activity in the indoor scene image at the current timestamp matches the indoor activity category more closely; a larger d indicates a lower similarity. Following this method, the Euclidean distance between the current behavior pattern vector and all activity categories in the preset activity category library is calculated sequentially, resulting in a set of distance values. For example, dsmoking = 0.35, dcooking = 0.82, dcleaning = 1.23, dunattended = 2.56, etc. The category with the smallest distance is selected as the indoor activity type recognition result for the indoor scene image at the current timestamp. In the example, the smallest distance is for smoking, so the indoor scene image at the current timestamp is identified as "smoking". The activity recognition model binds the recognition result to the timestamp carried by the indoor scene image itself, forming an indoor activity type recognition result with a timestamp.

[0090] By performing the above recognition operation on all scene images within the acquisition time period, a series of activity type recognition results with timestamps are obtained. Then, based on the timestamps, the activity type recognition results are sorted in ascending order to generate a strictly chronological sequence of indoor activity types. The indoor activity type sequence, in the form of semantic tags, clearly presents the evolution of indoor activities over time, such as from "getting up" in the morning to "cleaning" in the morning and then to "cooking" at noon. This provides structured input data for subsequent time-aligned correlation analysis with environmental concentration sequences, pollution source determination, and the generation of targeted intervention measures.

[0091] In one embodiment, aligning the environmental concentration sequence and the indoor activity type sequence according to timestamps and calculating the correlation coefficient between the environmental concentration sequence and the indoor activity type sequence includes: aligning the environmental concentration sequence and the indoor activity type sequence according to timestamps; standardizing the environmental concentration sequence and the indoor activity type sequence; quantifying the linear relationship between the environmental concentration sequence and the indoor activity type sequence to obtain the correlation coefficient between the environmental concentration sequence and the indoor activity type sequence.

[0092] Since both environmental concentration data and indoor activity type data have timestamps and originate from the same clock-synchronized acquisition device, they have a natural correspondence on the timeline. Using the timestamp as the unique association key, the environmental concentration sequence and the indoor activity type sequence are merged. Because the acquisition frequencies of the two types of data may differ (e.g., environmental concentration data every 10 seconds, activity type data every 1 second), a unified time series benchmark needs to be determined during alignment. For example, the environmental concentration sequence and the indoor activity type sequence can be aligned using downsampling. Using the timestamp of the environmental concentration sequence as the benchmark, the activity type result in the indoor activity type sequence that is closest to the timestamp of each environmental concentration sequence is searched and matched. If the time difference exceeds a preset threshold, it is considered that there is no valid activity data under that timestamp. Furthermore, alignment can also be achieved by interpolation or resampling, resampling both sequences to a unified fixed frequency (e.g., every 10 seconds). For the environmental concentration sequence, the average value within this time window can be used; for the activity type sequence, the activity type with the highest frequency within this time window can be used as the representative activity at that moment. After alignment, a data table with a completely consistent timeline is obtained, with each row corresponding to a timestamp, containing the environmental concentration value and indoor activity type label at that timestamp.

[0093] To quantitatively measure the correlation between indoor activities and changes in air quality, correlation analysis is needed on the aligned environmental concentration series and the indoor activity type series. Since the indoor activity type series is categorical data while the environmental concentration series is numerical data, a numerical encoding conversion of the indoor activity type series is required before calculating the correlation coefficient. For example, indoor activity types can be mapped to dummy variables (also known as one-heat encoding), such as encoding smoking, cooking, cleaning, and unattended activities as [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], and [0, 0, 0, 1], respectively. Then, the correlation coefficient between the dummy variable and the concentration series for each activity type can be calculated. Furthermore, indoor activity types can be sequentially encoded based on their pollution contribution. For example, based on prior knowledge, indoor activity types can be sorted according to their possible pollution intensity and assigned numerical values, such as unattended activities = 0, cleaning = 1, cooking = 2, smoking = 3. Then, the correlation coefficient between the encoded indoor activity type series and the environmental concentration series can be calculated.

[0094] After coding is completed, statistical methods are used to calculate the correlation coefficient between the numerically coded indoor activity type sequence and the environmental concentration sequence. For example, the Pearson correlation coefficient is used, which measures the linear correlation between the numerically coded indoor activity type sequence and the environmental concentration sequence by comparing their respective standard deviations. The calculated correlation coefficient ranges from -1 to 1. A correlation coefficient greater than 0 indicates a positive correlation, meaning that the concentration tends to increase when the activity occurs; a correlation coefficient less than 0 indicates a negative correlation, meaning that the concentration tends to decrease when the activity occurs; the closer the absolute value of the correlation coefficient is to 1, the stronger the linear association between the numerically coded indoor activity type sequence and the environmental concentration sequence. In actual calculations, correlation functions in statistical software or data analysis libraries can be used. For example, in a Python environment, the `DataFrame.corr()` method from the pandas library or the `corrcoef()` function from the numpy library can be used to directly input the numerically coded indoor activity type sequence and the environmental concentration sequence of equal length to obtain the correlation coefficient. The calculated correlation coefficient will be used as a basis for subsequent determination of the pollution source.

[0095] By performing time alignment, numerical coding transformation, and correlation calculation on environmental concentration sequences and indoor activity type sequences, the degree of correlation between indoor activities and air quality changes can be quantitatively measured, establishing a quantitative link between abstract concentration data and specific activity semantics.

[0096] In one embodiment, the above-mentioned indoor air quality detection method further includes: sorting the marked pollution source scene images by timestamp, separating and quantifying the environmental visual elements in the pollution source scene images through image processing to obtain environmental visual feature values; constructing a time-series data sequence based on the environmental visual feature values, and predicting the environmental quality change trend based on the time-series data sequence; integrating the environmental quality change trend with the environmental concentration sequence into a comprehensive environmental index sequence, comparing the predicted comprehensive environmental index sequence with a preset safety threshold, and determining whether to generate an early warning response signal based on the comparison result; associating the early warning response signal with indoor activity types to generate intervention measures for indoor activity types.

[0097] After identifying and marking pollution sources, the marked pollution source scene images are further analyzed in depth to predict future trends in environmental quality and generate corresponding intervention measures, forming a complete processing flow.

[0098] First, the marked pollution source scene images are arranged in ascending order according to their timestamps, resulting in an image sequence that reflects the development process of the pollution event. Image processing is then performed on this sequence to extract environmental visual elements that characterize changes in environmental quality, such as smoke, water vapor, and dust. These environmental visual elements are then quantified to obtain their feature values. These environmental visual feature values ​​can be the pixel area ratio of smoke regions in the image, the optical density value of smoke concentration, or the visual distribution density of particulate matter, used to numerically describe the visual evolution of the pollution event.

[0099] Secondly, based on the extracted environmental visual feature values, a time-series data sequence is constructed in chronological order, reflecting the changing patterns of environmental visual features over time. A time-series analysis model is then used to predict the environmental quality change trend over a future period. This trend is numerically described as the possible evolution of environmental visual features in the future, such as the extent to which smoke diffusion will expand and the level to which dust concentration will rise.

[0100] Then, the predicted environmental quality change trend is fused with the environmental concentration sequence to obtain a comprehensive environmental index sequence. This sequence integrates information from two dimensions: first, the pollution evolution trend extracted and predicted from visual images; and second, the actual concentration data collected from gas sensors. This comprehensive environmental index sequence is input into the prediction model to obtain the predicted comprehensive environmental quality. The predicted environmental quality result is then compared with a preset safety threshold, which is determined based on the type of indoor activity and the corresponding standard-type mapping table, with different safety standards corresponding to different activity types. If the predicted result exceeds the preset safety threshold, an early warning response signal is generated.

[0101] Finally, the generated early warning response signals are correlated with the currently identified indoor activity types, and targeted intervention measures are generated based on the specific context of each indoor activity type. These intervention measures can be differentiated according to the type of indoor activity. For example, when the pollution source is smoking, a prompt such as "It is recommended to turn on the air purifier" or "Please do not smoke indoors" can be generated; when the pollution source is cooking, a reminder such as "It is recommended to turn on the range hood" or "It is recommended to open the windows for ventilation" can be generated; and when the pollution source is cleaning, a suggestion such as "It is recommended to use a vacuum cleaner instead of a broom" can be generated.

[0102] By associating warning signals with activity types, an intelligent closed loop from problem detection to problem resolution is achieved, improving the accuracy of indoor air quality management and user experience.

[0103] In one embodiment, the marked pollution source scene images are sorted by timestamp, and environmental visual elements in the pollution source scene images are separated and quantified through image processing to obtain environmental visual feature values. A time-series data sequence is constructed based on the environmental visual feature values, and the environmental quality change trend is predicted from the time-series data sequence. This includes: sorting the marked pollution source scene images according to their corresponding timestamps to generate a pollution scene image sequence; performing image processing on each frame of the pollution scene image sequence to separate environmental visual elements related to environmental quality; quantifying the environmental visual elements of each frame to obtain the environmental visual features corresponding to the timestamps of the pollution scene image sequence; constructing a time-series data sequence through the environmental visual features; performing time-series analysis on the time-series data sequence to capture fluctuations in the time-series data sequence, and predicting the environmental quality change trend.

[0104] Specifically, after identifying and labeling the pollution sources, all pollution source scene images are processed. First, the pollution source scene images are arranged in ascending order according to their corresponding timestamps, generating a pollution scene image sequence that can completely record the entire process of a pollution event from its occurrence to its dissipation. Each timestamp in the pollution scene image sequence corresponds to a specific moment in the pollution development process, such as the gradual diffusion of smoke after smoking, the generation and spread of cooking fumes, and the rising and settling of dust from cleaning.

[0105] Subsequently, image processing and analysis were performed on the pollution source scene images at each time point in the pollution scene image sequence. Various image processing techniques were employed to separate environmental visual elements related to environmental quality from the complex indoor scenes. These environmental visual elements include smoke, water vapor, dust, particulate matter, and other visible airborne particles. Different types of pollution sources correspond to different environmental visual elements; for example, smoking mainly produces smoke, cooking may produce both oil fumes and water vapor, and cleaning mainly produces dust. For semi-transparent environmental visual elements such as smoke and water vapor with distinct color characteristics, a threshold segmentation method based on color space can be used to transform the pollution source scene image and extract the target region based on typical hues and saturation ranges. For particulate visual elements such as dust and particulate matter, a background subtraction method can be used to extract the changed regions by performing a difference operation between the pollution source scene image at the current time point and the background image under unpolluted conditions. For complex scenes, a semantic segmentation model based on deep learning can also be used to perform pixel-level classification of the pollution source scene image to segment the regions of environmental visual elements such as smoke and dust.

[0106] After successfully separating the environmental visual elements, the environmental visual elements in the pollution source scene image at each time point are quantified and transformed into numerical indicators that reflect the degree of pollution, serving as the environmental visual feature value at that time point. The quantization method can select various indicators according to actual needs. For example, calculating the pixel area ratio of the environmental visual element region in the entire pollution source scene image reflects the coverage range of pollutants in the image; calculating the optical density value of the environmental visual element region, and quantifying the smoke concentration or thickness by analyzing pixel grayscale values ​​or transmittance; extracting the texture features of the environmental visual element region, and calculating parameters such as energy, entropy, and contrast through the grayscale co-occurrence matrix to reflect the uniformity and density of particulate matter distribution; or calculating the edge gradient intensity of the environmental visual element region to determine the diffusion state of pollutants.

[0107] By performing the above quantization operation on all pollution source scene images in the pollution scene image sequence, environmental visual feature values ​​arranged in chronological order are obtained. These environmental visual feature values ​​are then constructed according to timestamps to form a time-series data sequence that reflects the evolution of visual pollution. The time-series data sequence can be a one-dimensional sequence containing only a single indicator, or a multi-dimensional sequence containing multiple dimensions such as area proportion, optical density, and texture features, thus fully depicting the trajectory of pollution events changing over time at the visual level.

[0108] Finally, the constructed time-series data sequence is input into the time-series analysis model. By modeling and analyzing historical data, the inherent evolutionary patterns are captured, and future environmental quality change trends are predicted. A differential autoregressive moving average model can be used to test the stationarity of the time-series data sequence and perform differencing. The model order is identified by analyzing the autocorrelation function and partial autocorrelation function. After model construction, the environmental visual characteristic values ​​at future times are predicted. Alternatively, deep learning models such as recurrent neural networks or long short-term memory networks can be used to learn nonlinear evolution patterns from historical sequences, thereby predicting the future change paths of pollution visual characteristics. The predicted environmental quality change trends describe the possible evolution of pollution visual characteristics at future times in numerical form, such as the extent to which the smoke diffusion range will expand and the level to which dust concentration will rise.

[0109] By extracting and quantifying environmental visual elements from pollution source scene images, constructing time-series data sequences and making predictions, we can capture the dynamic evolution patterns of pollution events from a visual perspective, achieve forward-looking predictions of environmental quality change trends, and provide advance notice for subsequent early warning and intervention.

[0110] Furthermore, in one embodiment, the environmental quality change trend and environmental concentration sequence are fused into a comprehensive environmental indicator sequence. The comprehensive environmental indicator sequence is predicted and compared with a preset safety threshold. Based on the comparison result, it is determined whether to generate an early warning response signal. This includes: fusing the environmental quality change trend and environmental concentration sequence according to corresponding timestamps to generate a comprehensive environmental indicator sequence; predicting the comprehensive environmental indicator sequence using a deep learning model to obtain a predicted environmental quality value; comparing the predicted environmental quality value with a preset safety standard threshold; and generating an early warning response signal if the predicted value exceeds the safety standard threshold.

[0111] The environmental quality change trend and environmental concentration sequence are fused according to their corresponding timestamps to generate a comprehensive environmental index sequence. The environmental quality change trend is visual feature evolution data extracted and predicted from pollution source scene images, such as the predicted smoke area ratio at future times; the environmental concentration sequence is pollutant concentration data collected and sorted from gas sensors. Since both have timestamps and the source clocks are synchronized, they can be aligned and fused based on the timestamps. A weighted fusion method can be used, assigning different weights to visual features and sensor data based on their reliability in different scenarios. For example, the weight of visual features can be appropriately increased under sufficient lighting and clear image conditions, while the weight of visual features can be decreased when the light is dim or the camera is obstructed. The fused comprehensive environmental index sequence corresponds to a comprehensive index value that integrates pollution evolution information from the visual dimension and concentration quantification information from the sensor dimension, comprehensively reflecting the actual indoor air quality.

[0112] Environmental quality predictions are obtained by using a deep learning model to predict a series of comprehensive environmental indicators. The fused comprehensive environmental indicator series is input into a pre-trained deep learning model. This model can employ network structures suitable for time-series prediction, such as Long Short-Term Memory networks or gated recurrent units, and can learn complex nonlinear evolution patterns from historical sequences. The pre-trained deep learning model outputs predicted environmental quality values ​​for one or more future time points, such as predicting the level of comprehensive environmental indicators in the next 5, 10, or 30 minutes. The predicted environmental quality values ​​integrate information from both visual features and sensor data, resulting in higher accuracy and robustness.

[0113] Then, the predicted environmental quality value is compared with the preset safety standard threshold. The safety standard threshold is obtained by looking up a standard-type mapping table based on the currently identified indoor activity type. Different indoor activities correspond to different safety standards. This dynamic threshold setting fully considers the pollution characteristics and acceptability of different activities, avoiding false alarms or missed alarms caused by a "one-size-fits-all" threshold.

[0114] Finally, if the predicted value exceeds the safety standard threshold, an early warning response signal is generated. The generation of this signal does not passively wait for pollution to occur, but rather triggers it in advance when a future exceedance is predicted, allowing users sufficient reaction time. The early warning signal can contain various information, such as the predicted time of exceedance, the expected degree of exceedance, and the pollution source activity causing the exceedance, providing a basis for decision-making in generating subsequent intervention measures.

[0115] By fusing predicted trends from the visual dimension with measured data from the sensor dimension, and using a deep learning model to predict comprehensive indicators, the comprehensiveness and accuracy of environmental quality assessment are improved, realizing the transformation from passive monitoring to proactive early warning, and effectively reducing false alarm and missed alarm rates.

[0116] In one embodiment, associating an early warning response signal with indoor activity types to generate intervention measures for those indoor activity types includes: acquiring an early warning response signal; associating and matching the early warning response signal with indoor activity types; and generating personalized intervention measures for indoor activity types based on the association and matching results.

[0117] Specifically, the early warning response signal is generated when the predicted value of the comprehensive environmental indicator sequence exceeds a preset safety standard threshold. This signal includes the time point of the early warning trigger, the predicted degree of exceedance, and the corresponding pollutant types and concentration predictions. The early warning response signal is correlated with the type of indoor activity at the current timestamp to determine the category of indoor activity under which the impending exceedance event will occur. For example, if the currently identified indoor activity type is "smoking," and the early warning response signal predicts that the PM2.5 concentration will soon exceed the standard, the two are correlated to confirm that the impending exceedance is caused by smoking; if the currently identified activity type is "cooking," and the early warning signal predicts that the total volatile organic compound (TVOC) concentration will soon exceed the standard, the two are correlated to confirm that the exceedance is related to cooking. Through this correlation and matching, abstract concentration warnings can be combined with specific activity contexts to clearly identify the activity source causing the impending exceedance.

[0118] Finally, based on the correlation matching results, personalized intervention measures are generated for different types of indoor activities. These intervention measures are action suggestions or control instructions that are pre-configured or dynamically generated according to different activity types and the severity of the warning. Different solutions are provided based on the activity type and the degree of exceedance. For example, when the warning signal is associated with smoking, prompts such as "Smoking has been detected, causing PM2.5 levels to exceed the standard; it is recommended to turn on the air purifier" or "For the health of your family, please consider moving to an outdoor smoking area" can be generated. When the warning signal is associated with cooking, reminders such as "Heavy cooking fumes; it is recommended to turn on the range hood" or "The range hood has been automatically turned on; please confirm" can be generated. The presentation of intervention measures can be diverse, including push notifications via mobile phones, voice reminders via smart speakers, text suggestions displayed on indoor screens, or direct linkage with smart devices for automatic execution, such as automatically turning on the air purifier, automatically starting the range hood, and automatically sending ventilation reminders.

[0119] By associating and matching early warning response signals with specific indoor activity types and generating differentiated intervention measures for different activity types, concentration early warnings can be transformed into suggestions directly related to users' current behavior, realizing intelligent closed-loop management of the entire process from pollution identification, trend prediction, early warning triggering to intervention execution.

[0120] Figure 3 This is a preferred flowchart of an embodiment of the indoor air quality detection method of this application. Figure 3 As shown, the indoor air quality testing method includes the following steps:

[0121] Step S310: Collect indoor environmental concentration data and simultaneously collect indoor scene images, generating time-stamped environmental concentration sequences and scene image sequences respectively.

[0122] Step S320: Perform activity recognition on the scene image sequence to generate an indoor activity type sequence with timestamps.

[0123] Step S330: Align the environmental concentration sequence and the indoor activity type sequence by timestamp and calculate their correlation coefficient.

[0124] Step S340: Compare the correlation coefficient with a preset association threshold, determine the indoor activities corresponding to the correlation coefficient exceeding the threshold as pollution sources, and mark the corresponding scene images as pollution source scene images.

[0125] Step S350: Perform image processing on the marked pollution source scene image, extract environmental visual elements and quantify them to obtain environmental visual feature values, construct a time series data sequence based on the environmental visual feature values ​​according to the timestamp, and predict the environmental quality change trend based on the time series data sequence.

[0126] Step S360: The environmental quality change trend and the environmental concentration sequence are integrated into a comprehensive environmental index sequence. The comprehensive environmental index sequence is used to predict the environmental quality prediction value. The prediction value is compared with a preset safety threshold. If the threshold is exceeded, an early warning response signal is generated.

[0127] Step S370: Associate and match the early warning response signal with the current indoor activity type, and generate personalized intervention measures for the activity type based on the matching results.

[0128] Steps S310 to S370 above achieve intelligent management of the entire process from pollution identification, source tracing, trend prediction to early warning and intervention by combining multimodal data fusion and time series prediction.

[0129] Figure 4 This is a structural block diagram of an indoor air quality detection device 40 according to an embodiment of this application, as shown below. Figure 4 As shown, the indoor air quality detection device 40 includes: a data acquisition module 42, a coefficient calculation module 44, and a pollution judgment module 46; wherein: the data acquisition module 42 is used to collect indoor environmental concentration data and generate an environmental concentration sequence sorted according to timestamps; the environmental concentration data includes timestamps and gas data; acquire indoor scene images with timestamps, identify indoor activity types with different timestamps based on the indoor scene images, and generate an indoor activity type sequence sorted according to timestamps; the coefficient calculation module 44 is used to align the environmental concentration sequence and the indoor activity type sequence according to timestamps, and calculate the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence; the pollution judgment module 46 is used to compare each correlation coefficient with a preset correlation threshold, identify correlation coefficients exceeding the correlation threshold as target correlation coefficients, determine the indoor activity corresponding to the target correlation coefficient as the target indoor activity, determine the source of air pollution as the target indoor activity, and mark the scene image corresponding to the target indoor activity as the pollution source scene image.

[0130] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0131] Furthermore, in conjunction with the indoor air quality detection methods provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the indoor air quality detection methods described in the above embodiments.

[0132] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0134] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0135] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0136] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A method for detecting indoor air quality, characterized in that, include: Indoor environmental concentration data is collected, and an environmental concentration sequence sorted by timestamp is generated; the environmental concentration data includes the timestamp and gas data. Acquire indoor scene images with timestamps, identify indoor activity types with different timestamps based on the indoor scene images, and generate a sequence of indoor activity types sorted by the timestamps; Align the environmental concentration sequence and the indoor activity type sequence based on the timestamps, and calculate the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence. Each correlation coefficient is compared with a preset association threshold. Correlation coefficients exceeding the association threshold are identified as target correlation coefficients. Indoor activities corresponding to the target correlation coefficients are identified as target indoor activities. The source of air pollution is determined to be the target indoor activity. The scene image corresponding to the target indoor activity is marked as a pollution source scene image.

2. The indoor air quality detection method according to claim 1, characterized in that, The collected indoor environmental concentration data is used to generate an environmental concentration sequence sorted by timestamp, including: Gas data with the timestamp is obtained from the environmental concentration data, and the gas data is arranged in ascending order according to the timestamp to obtain the environmental concentration sequence.

3. The indoor air quality detection method according to claim 1, characterized in that, The step of acquiring indoor scene images with timestamps, identifying indoor activity types with different timestamps based on the indoor scene images, and generating a sequence of indoor activity types sorted by the timestamps includes: Acquire an indoor scene image with the timestamp mentioned above; The scene image is input into a pre-trained network model to identify the type of indoor activity. The indoor activity types are sorted in ascending order according to the timestamps to obtain the indoor activity type sequence.

4. The indoor air quality detection method according to claim 1, characterized in that, The step of aligning the environmental concentration sequence and the indoor activity type sequence according to the timestamp, and calculating the correlation coefficient between the environmental concentration sequence and the indoor activity type sequence, includes: Align the environmental concentration sequence and the indoor activity type sequence according to the timestamp; Standardize the environmental concentration sequence and the indoor activity type sequence; The linear relationship between the environmental concentration sequence and the indoor activity type sequence is quantified to obtain the correlation coefficient between the environmental concentration sequence and the indoor activity type sequence.

5. The indoor air quality detection method according to claim 1, characterized in that, The indoor air quality testing method also includes: The marked pollution source scene images are sorted by timestamp, and environmental visual elements in the pollution source scene images are separated and quantified through image processing to obtain environmental visual feature values. A time-series data sequence is constructed based on the environmental visual feature values, and the trend of environmental quality change is predicted based on the time-series data sequence. The environmental quality change trend and the environmental concentration sequence are integrated into a comprehensive environmental index sequence. The comprehensive environmental index sequence is predicted and compared with a preset safety threshold. Based on the comparison result, it is determined whether to generate an early warning response signal. The warning response signal is associated with the type of indoor activity to generate intervention measures for that type of indoor activity.

6. The indoor air quality detection method according to claim 5, characterized in that, The process of sorting the marked pollution source scene images by timestamp, separating and quantifying environmental visual elements in the pollution source scene images through image processing to obtain environmental visual feature values, constructing a time-series data sequence based on the environmental visual feature values, and predicting the environmental quality change trend based on the time-series data sequence includes: The images labeled as pollution source scenes are sorted according to their corresponding timestamps to generate a pollution scene image sequence; Image processing is performed on each frame of the pollution scene image sequence to separate environmental visual elements related to environmental quality; The environmental visual elements of each frame image are quantified to obtain the environmental visual features of the timestamp corresponding to the pollution scene image sequence; The time-series data sequence is constructed using the environmental visual features; The time series data sequence is subjected to time series analysis to capture the fluctuations of the time series data sequence and predict the trend of environmental quality change.

7. The indoor air quality detection method according to claim 5, characterized in that, The process of fusing the environmental quality change trend and the environmental concentration sequence into a comprehensive environmental indicator sequence, comparing the predicted comprehensive environmental indicator sequence with a preset safety threshold, and determining whether to generate an early warning response signal based on the comparison result includes: The environmental quality change trend and the environmental concentration sequence are fused according to the corresponding timestamps to generate a comprehensive environmental index sequence; The comprehensive environmental index sequence is predicted using a deep learning model to obtain predicted environmental quality values. The predicted environmental quality value is compared with a preset safety standard threshold. If the predicted value exceeds the safety standard threshold, an early warning response signal is generated.

8. The indoor air quality detection method according to claim 5, characterized in that, The step of associating the early warning response signal with indoor activity types to generate intervention measures for those indoor activity types includes: Obtain the warning response signal; The warning response signal is associated and matched with the type of indoor activity; Based on the association matching results, personalized intervention measures are generated for the indoor activity type.

9. An indoor air quality detection device, characterized in that, include: The module includes a data acquisition module, a coefficient calculation module, and a pollution judgment module; among which: The data acquisition module is used to collect indoor environmental concentration data and generate an environmental concentration sequence sorted by timestamp; the environmental concentration data includes the timestamp and gas data; acquire indoor scene images with timestamps, identify indoor activity types with different timestamps based on the indoor scene images, and generate an indoor activity type sequence sorted by timestamp. The coefficient calculation module is used to align the environmental concentration sequence and the indoor activity type sequence according to the timestamp, and calculate the correlation coefficient between the aligned environmental concentration sequence and the indoor activity type sequence. The pollution judgment module is used to compare each correlation coefficient with a preset association threshold, identify correlation coefficients exceeding the association threshold as target correlation coefficients, determine the indoor activity corresponding to the target correlation coefficient as the target indoor activity, determine the source of air pollution as the target indoor activity, and mark the scene image corresponding to the target indoor activity as the pollution source scene image.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the indoor air quality detection method according to any one of claims 1 to 8.