Environment data processing method and device
Through the environmental data processing method that automatically determines the threshold range, the problem of frequent modification of early warning thresholds in the prior art is solved, the early warning accuracy and applicable scenarios of ecological environment monitoring are improved, and efficient real-time monitoring and analysis are achieved.
Patent Information
- Application Number
- CN202411315595.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, the method of monitoring ecological environment indicators by manually setting early warning thresholds requires frequent modification and maintenance, resulting in high labor costs and low warning accuracy, and limited applicable scenarios.
An environmental data processing method is proposed. By adding environmental monitoring data at multiple acquisition times to the data cache queue, obtaining an automatically determined threshold range based on the target update cycle, and analyzing whether the environmental monitoring data in the data cache queue is abnormal without manual multiple Modify the warning threshold again.
It saves a lot of labor costs, improves the accuracy of early warning, broadens applicable scenarios, and can update the indicator data in real time for analysis and warning, identify single points, context and collective abnormalities, reducing the probability of missing early warnings.
Smart Images

Figure CN119272186A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to an environmental data processing method and device. Background Art
[0002] In smart city analysis and research, it is necessary to monitor ecological and environmental indicators in real time, and to promptly discover and handle abnormal ecological and environmental indicators. In related technologies, there are methods that set warning thresholds manually or through industry experience, and monitor ecological and environmental indicators based on warning thresholds. However, this method requires manual modification and maintenance of warning thresholds many times, which consumes a lot of manpower costs, has low warning accuracy, and is limited in applicable scenarios. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes an environmental data processing method and device, which does not require manual modification and maintenance of warning thresholds multiple times, saves a lot of manpower costs, improves warning accuracy, and broadens applicable scenarios.
[0004] In a first aspect, the present application provides a method for processing environmental data, the method comprising:
[0005] Adding the environmental monitoring data corresponding to the multiple collection moments to the data cache queue corresponding to the environmental monitoring data;
[0006] Based on at least one of the multiple environmental monitoring data included in the data cache queue and the data type corresponding to the data cache queue, obtaining a target threshold range corresponding to the data cache queue in a target update period;
[0007] Based on the target threshold range and the multiple environmental monitoring data, an analysis result of the data cache queue corresponding to the target update period is obtained; the analysis result includes that all environmental monitoring data in the data cache queue are normal, or that at least one environmental monitoring data in the data cache queue is abnormal.
[0008] According to the environmental data processing method provided in the embodiment of the present application, the threshold range corresponding to the data cache queue in the current update cycle is determined by the latest collected environmental monitoring data and the data type corresponding to the environmental monitoring data. There is no need to manually modify and maintain the warning threshold multiple times, which saves a lot of manpower costs. In addition, the real-time updated indicator data is analyzed and warned based on the threshold range, which improves the warning accuracy and broadens the applicable scenarios.
[0009] The environmental data processing method of an embodiment of the present application, based on the target threshold range and the plurality of environmental monitoring data, obtaining the analysis result of the data cache queue corresponding to the target update period, includes:
[0010] Based on the size relationship between each of the environmental monitoring data and the target threshold range, an analysis result corresponding to the data cache queue is obtained.
[0011] The environmental data processing method of an embodiment of the present application, based on the size relationship between each of the environmental monitoring data and the target threshold range, obtains the analysis result corresponding to the data cache queue, including:
[0012] In a case where the environmental monitoring data is not within the target threshold range, determining that the analysis result corresponding to the environmental monitoring data is a single point anomaly;
[0013] When the target environmental monitoring data among the multiple environmental monitoring data is within the target threshold range, and the difference between the target environmental monitoring data and other environmental monitoring data among the multiple environmental monitoring data is not within the first threshold range, it is determined that the analysis result corresponding to the target environmental monitoring data is a contextual anomaly; the first threshold range is a first multiple of the target threshold range; the other environmental monitoring data is any environmental monitoring data among the multiple environmental monitoring data except the target environmental monitoring data.
[0014] The environmental data processing method of an embodiment of the present application, based on the size relationship between each of the environmental monitoring data and the target threshold range, obtains the analysis result corresponding to the data cache queue, including:
[0015] When the multiple environmental monitoring data are all within the target threshold range, the difference between the maximum value of the multiple environmental monitoring data and the upper limit of the target threshold range, and the difference between the minimum value of the multiple environmental monitoring data and the lower limit of the target threshold range are all within the second threshold range, it is determined that the analysis result corresponding to the data cache queue is a collective abnormality; the second threshold range is a second multiple of the target threshold range.
[0016] In an environmental data processing method according to an embodiment of the present application, obtaining a target threshold range corresponding to the data cache queue in a target update period based on at least one of the multiple environmental monitoring data included in the data cache queue and the data type corresponding to the data cache queue includes:
[0017] Obtaining an average value of a plurality of environmental monitoring data included in the data cache queue at each of the collection moments;
[0018] Based on the multiple average values and the data type corresponding to the data cache queue, a target threshold range corresponding to the data cache queue is determined.
[0019] In an environmental data processing method according to an embodiment of the present application, obtaining a target threshold range corresponding to the data cache queue in a target update period based on at least one of the multiple environmental monitoring data included in the data cache queue and the data type corresponding to the data cache queue includes:
[0020] Obtain the historical generation time of the historical threshold range corresponding to the data cache queue;
[0021] When it is determined that the target update period has begun based on the historical generation time and the latest collection time corresponding to the plurality of environmental monitoring data, a target threshold range corresponding to the target update period of the data cache queue is obtained.
[0022] The environmental data processing method of an embodiment of the present application, after acquiring the analysis result corresponding to the target update period of the data cache queue based on the target threshold range and the multiple environmental monitoring data, the method further includes:
[0023] When the analysis result includes that at least one environmental monitoring data in the data cache queue is abnormal, an early warning prompt message is output.
[0024] In a second aspect, the present application provides an environmental data processing device, comprising:
[0025] A first processing module, configured to add the environmental monitoring data corresponding to a plurality of collection moments to a data cache queue corresponding to the environmental monitoring data;
[0026] A second processing module, configured to obtain a target threshold range corresponding to the data cache queue in a target update period based on at least one of a plurality of environmental monitoring data included in the data cache queue and a data type corresponding to the data cache queue;
[0027] A third processing module is used to obtain the analysis result of the data cache queue corresponding to the target update period based on the target threshold range and the multiple environmental monitoring data; the analysis result includes that all environmental monitoring data in the data cache queue are normal, or that there is at least one environmental monitoring data abnormal in the data cache queue.
[0028] According to the environmental data processing device provided in the embodiment of the present application, the threshold range corresponding to the data cache queue in the current update cycle is determined by the latest collected environmental monitoring data and the data type corresponding to the environmental monitoring data. There is no need to manually modify and maintain the warning threshold multiple times, which saves a lot of manpower costs. In addition, the real-time updated indicator data is analyzed and warned based on the threshold range, which improves the warning accuracy and broadens the applicable scenarios.
[0029] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the environmental data processing method as described in the first aspect above is implemented.
[0030] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the environmental data processing method as described in the first aspect above is implemented.
[0031] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the environmental data processing method as described in the first aspect above.
[0032] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0033] The threshold range corresponding to the data cache queue in the current update cycle is determined by the latest collected environmental monitoring data and the data type corresponding to the environmental monitoring data. There is no need to manually modify and maintain the warning threshold multiple times, which saves a lot of manpower costs. The indicator data updated in real time is analyzed and warned based on the threshold range, which improves the accuracy of warning and broadens the applicable scenarios.
[0034] Furthermore, a first threshold range is obtained by calculating the target threshold range, and whether contextual anomalies occur in the environmental monitoring data is determined by the first threshold range. Moreover, whether single-point anomalies occur in the environmental monitoring data can be determined by the target threshold range. Under the same warning limit conditions, single-point anomalies and contextual anomalies can be identified simultaneously, thereby reducing the probability of missed warnings.
[0035] Furthermore, the newly acquired threshold range is used to determine whether collective anomalies occur in the data cache queue. In addition to being able to effectively identify single-point anomalies and context anomalies in indicator values, collective anomaly judgments can also be made through the judgment rules of the indicator anomaly warning mechanism, broadening the applicable scenarios.
[0036] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0038] Figure 1 This is one of the flow charts of the environmental data processing method provided in the embodiment of the present application;
[0039] Figure 2 It is a schematic diagram of the principle of the environmental data processing method provided in the embodiment of the present application;
[0040] Figure 3 This is the second flow chart of the environmental data processing method provided in the embodiment of the present application;
[0041] Figure 4 is a schematic diagram of the structure of an environmental data processing device provided in an embodiment of the present application;
[0042] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0044] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0045] The following, in conjunction with the accompanying drawings, describes in detail the environmental data processing method, environmental data processing device, electronic device and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.
[0046] The environmental data processing method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.
[0047] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0048] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.
[0049] The environmental data processing method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the environmental data processing method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The environmental data processing method provided in the embodiment of the present application is described below using an electronic device as an example of the execution subject.
[0050] like Figure 1 As shown, the environmental data processing method includes: step 110, step 120 and step 130.
[0051] Step 110: adding the environmental monitoring data corresponding to the multiple collection moments to the data cache queue corresponding to the environmental monitoring data;
[0052] In this step, environmental monitoring data may be collected through environmental monitoring equipment.
[0053] For example, environmental monitoring data can be collected through air quality monitoring stations or water quality monitoring stations.
[0054] Environmental monitoring data can include temperature, humidity, air quality index, and noise level, etc.
[0055] The data cache queue may be a first-in-first-out data structure used to temporarily store data to be processed.
[0056] The types of environmental monitoring data included in the data cache queue are consistent.
[0057] Different types of environmental monitoring data can be stored in different types of data cache queues.
[0058] For example, after the environmental monitoring data is collected, a unique identifier may be created for the environmental monitoring data, and then the environmental monitoring data may be stored in a data cache queue corresponding to the environmental monitoring data according to the unique identifier.
[0059] The data cache queue includes a plurality of environment monitoring data, and a maximum number of the plurality of environment monitoring data may be determined based on a size of the data cache queue.
[0060] When the data cache queue is not full, a push operation can be performed to store the newly collected environmental monitoring data into the data cache queue.
[0061] When the data cache queue is full, a pop operation is required first, and then a push operation is performed.
[0062] In the actual execution process, data can be read from the environmental monitoring device based on a certain period (such as every 5 minutes or every hour, etc.), and the data are added to the data cache queue in the order of their collection time.
[0063] Step 120: Based on at least one of the multiple environmental monitoring data included in the data cache queue and the data types corresponding to the data cache queue, obtain a target threshold range corresponding to the data cache queue in the target update period;
[0064] In this step, the data type is the type of environmental monitoring data included in the data cache queue. For example, the data type may be temperature, humidity, or air quality.
[0065] Environmental monitoring data of different data types may correspond to different threshold ranges.
[0066] The system can check and update the threshold range corresponding to the data cache queue according to a certain period. For example, the threshold range can be checked and updated every one or two hours, or the threshold range can be updated based on other time intervals. It can be customized based on user needs and is not limited in this application.
[0067] The target update period is the period within which the threshold range needs to be updated.
[0068] The target threshold range is the numerical range used to determine whether the environmental monitoring data is normal.
[0069] The target threshold range may include an upper limit value and a lower limit value, wherein the upper limit value may also be infinite.
[0070] For example, when the environmental monitoring data exceeds the target threshold range, the environmental monitoring data may be considered abnormal.
[0071] During actual execution, the system may determine a target threshold range corresponding to the data cache queue in the current cycle according to the type of data stored in the data cache queue and the current target update cycle.
[0072] Step 130: Based on the target threshold range and multiple environmental monitoring data, obtain the analysis result corresponding to the data cache queue in the target update period;
[0073] In this step, the analysis result may include that all environmental monitoring data in the data cache queue are normal, or that at least one environmental monitoring data in the data cache queue is abnormal.
[0074] For example, when multiple environmental monitoring data are all within the target threshold range, it can be considered that all environmental monitoring data in the data cache queue are normal.
[0075] When the environmental monitoring data is not within the target threshold range, the environmental monitoring data can be considered abnormal.
[0076] Alternatively, the analysis result corresponding to the data cache queue may be determined based on the statistical values corresponding to the plurality of environmental monitoring data and the target threshold range.
[0077] In the case of abnormal environmental monitoring data, the analysis result corresponding to the data cache queue can be considered as a single point abnormality.
[0078] When the environmental monitoring data is abnormal under certain circumstances but normal under other circumstances, the analysis result corresponding to the data cache queue can be considered as a contextual anomaly. For example, the contextual anomaly may include a sudden increase or decrease in one or more environmental monitoring data in the data cache queue.
[0079] In the case where the data cache queues collectively show a slow changing trend, it can be considered that the analysis results corresponding to the data cache queues are collectively abnormal.
[0080] According to the environmental data processing method provided in the embodiment of the present application, the threshold range corresponding to the data cache queue in the current update cycle is determined by the latest collected environmental monitoring data and the data type corresponding to the environmental monitoring data. There is no need to manually modify and maintain the warning threshold multiple times, which saves a lot of manpower costs. In addition, the real-time updated indicator data is analyzed and warned based on the threshold range, which improves the warning accuracy and broadens the applicable scenarios.
[0081] In some embodiments, step 130 may include:
[0082] Based on the size relationship between each environmental monitoring data and the target threshold range, the analysis result corresponding to the data cache queue is obtained.
[0083] In this embodiment, the magnitude relationship between the environmental monitoring data and the target threshold range may include that the environmental monitoring data is within the target threshold range, or that the environmental monitoring data is not within the target threshold range.
[0084] For example, when the target threshold range is (0, n), the environmental monitoring data not being within the target threshold range may mean that the environmental monitoring data is greater than n; when the target threshold range is (n, +∞), the environmental monitoring data not being within the target threshold range may mean that the environmental monitoring data is less than n.
[0085] Based on the size relationship between each environmental monitoring data and the target threshold range, the analysis result corresponding to the data cache queue can be determined.
[0086] In some embodiments, based on the size relationship between each environmental monitoring data and the target threshold range, obtaining the analysis result corresponding to the data cache queue may include:
[0087] When the environmental monitoring data is not within the target threshold range, the analysis result corresponding to the environmental monitoring data is determined to be a single point anomaly;
[0088] When target environmental monitoring data among multiple environmental monitoring data is within a target threshold range, and a difference between the target environmental monitoring data and other environmental monitoring data among the multiple environmental monitoring data is not within a first threshold range, it is determined that the analysis result corresponding to the target environmental monitoring data is a context anomaly.
[0089] In this embodiment, when the environmental monitoring data is not within the target threshold range, the environmental monitoring data can be considered to be a single point anomaly.
[0090] The target environmental monitoring data is any environmental monitoring data among multiple environmental monitoring data.
[0091] Other environmental monitoring data refers to any environmental monitoring data among multiple environmental monitoring data except the target environmental monitoring data.
[0092] Other environmental monitoring data may be a maximum value or a minimum value among multiple environmental monitoring data.
[0093] The target environmental monitoring data may be a minimum value or a maximum value among multiple environmental monitoring data.
[0094] When the difference between the target environmental monitoring data and the other environmental monitoring data is not within the first threshold range, it can be considered that a mutation has occurred in the target environmental monitoring data, and the target environmental monitoring data is a context anomaly.
[0095] The first threshold range is a first multiple of the target threshold range.
[0096] The first multiple may be determined based on the data type of the data cache queue.
[0097] In the actual implementation process, Figure 2 As described above, two member variables may be created in the sliding window to respectively record the maximum value and minimum value information in the window. For example, the values and queue positions of the maximum value and minimum value may be recorded.
[0098] When the sliding window queue is not full, the push operation can be performed to compare the real-time collected environmental monitoring data with the extreme values in the queue. When the newly added environmental monitoring data is greater than the maximum value or less than the minimum value, the extreme value information in the data cache queue can be updated.
[0099] When the sliding window queue is full, you can first perform a pop operation and then a push operation. If the popped data is the currently maintained extreme value information, after popping, you need to traverse the entire queue again and maintain the extreme value information again.
[0100] The data to be pushed into the stack can be compared with the extreme value information maintained by the current queue. If the data to be pushed into the stack exceeds the existing extreme value range, the variable information of the maximum and minimum values in the queue can be updated first, and then the stack operation can be performed.
[0101] The extreme values of multiple environmental monitoring data within the sliding window period can be displayed in real time:
[0102] X 极差值 =X max –X min
[0103] Among them, X 极差值 is the extreme value of the indicator in the current sliding window period, X max is the maximum value of the indicator in the current sliding window period (target environmental monitoring data or other environmental monitoring data), X min It is the minimum value of the indicator in the current sliding window period (other environmental monitoring data or target environmental monitoring data).
[0104] The warning limit of the extreme value can be calculated based on the target threshold range:
[0105] E=X 阈 *K
[0106] E is the warning limit (first threshold range), X 阈 is the target threshold range, and K is the statically configured percentage parameter (the first multiple).
[0107] In X 极差值 >E, it can be considered that the target environment monitoring data has context anomaly.
[0108] According to the environmental data processing method provided in the embodiment of the present application, the first threshold range is obtained by calculating the target threshold range, and the first threshold range is used to determine whether contextual anomalies occur in the environmental monitoring data. The target threshold range can be used to determine whether single-point anomalies occur in the environmental monitoring data. Under the same conditions of warning limits, single-point anomalies and contextual anomalies can be identified simultaneously, reducing the probability of missed warnings.
[0109] In some embodiments, based on the size relationship between each environmental monitoring data and the target threshold range, obtaining the analysis result corresponding to the data cache queue may include:
[0110] When multiple environmental monitoring data are all within the target threshold range, the difference between the maximum value of the multiple environmental monitoring data and the upper limit of the target threshold range, and the difference between the minimum value of the multiple environmental monitoring data and the lower limit of the target threshold range are all within the second threshold range, it is determined that the analysis result corresponding to the data cache queue is a collective abnormality.
[0111] In this embodiment, when a plurality of environmental monitoring data show slow trend changes, a collective abnormality may occur in the data cache queue.
[0112] The second threshold range is a second multiple of the target threshold range.
[0113] The second multiple can be user-defined.
[0114] For example, when multiple environmental monitoring data are normal, the deviations between the multiple environmental monitoring data may be extremely small, and the multiple environmental monitoring data can be considered to be stable.
[0115] When multiple environmental monitoring data change slowly, the difference between the maximum value of the multiple environmental monitoring data and the upper limit of the target threshold range, and the difference between the minimum value of the multiple environmental monitoring data and the lower limit of the target threshold range can be calculated.
[0116] When both calculated differences are within the second threshold range, it can be considered that the plurality of environmental monitoring data are changing slowly, and it can be determined that the data cache queue is collectively abnormal.
[0117] For example, when multiple environmental monitoring data {1, 2, 3, 4, 5, 6, 7, 8} are all within the target threshold range [0, 10], the difference between the maximum value among the multiple environmental monitoring data and the upper limit value of the target threshold range is 2, and the difference between the minimum value among the multiple environmental monitoring data and the lower limit value of the target threshold range is 1, and both differences are small and within the second threshold range, it can be determined that the data cache queue is collectively abnormal.
[0118] According to the environmental data processing method provided in the embodiment of the present application, whether a collective abnormality occurs in the data cache queue is determined by using the newly acquired threshold range. In addition to being able to effectively identify single-point abnormalities and contextual abnormalities of indicator values, collective abnormality situations can also be determined through the judgment rules of the indicator abnormality warning mechanism, thereby broadening the applicable scenarios.
[0119] In some embodiments, step 120 may include:
[0120] Obtaining the average value of multiple environmental monitoring data included in the data cache queue at each collection time;
[0121] Based on the multiple average values and the data type corresponding to the data cache queue, a target threshold range corresponding to the data cache queue is determined.
[0122] In this embodiment, the environmental monitoring data collected at each collection time is added to the data cache queue, and the multiple environmental monitoring data included in the data cache queue will be updated in real time with the collection time.
[0123] At different collection times, the multiple environmental monitoring data included in the data cache queue may be different.
[0124] For the data cache queue at each collection time, an average value of multiple environmental monitoring data included in the data cache queue is calculated.
[0125] When the data types corresponding to the data cache queues are different, the calculation methods of the target threshold ranges corresponding to the data cache queues are also different.
[0126] For example, the minimum average value and the maximum average value among multiple average values may be obtained, and the middle value of multiple average values may be obtained.
[0127] Based on the data type corresponding to the data cache queue, the target threshold range may be determined based on the maximum average value and the minimum average value; or the target threshold range may be determined based on the middle value of multiple average values.
[0128] For example, when the data type corresponding to the data cache queue is the air quality coefficient, the middle value of the multiple average values may be determined as the lower limit value of the target threshold range.
[0129] In the actual implementation process, when the system reaches the target update cycle, new threshold calculations are required while performing real-time indicator early warning analysis.
[0130] The indicator analysis thread can use the environmental monitoring data in the current data cache queue as a benchmark, and eliminate data in subsequent real-time data that deviates greatly from the benchmark value. When the proportion of qualified data within a certain period of time reaches the preset conditions, the average value of the qualified data can be calculated, and the latest target threshold range can be calculated based on the average value.
[0131] If the proportion of eligible data within a certain period of time does not meet the preset conditions, the calculation is unsuccessful and the analysis thread automatically selects a new benchmark value for calculation.
[0132] The average value of multiple environmental monitoring data can be calculated based on the following formula:
[0133] X 均 =(X1+X2+…+X n ) / n
[0134] X均 is the average value of multiple environmental monitoring data, X n Generate environmental monitoring data that meets the threshold conditions.
[0135] In some embodiments, if the target threshold range cannot be generated for a long time, that is, the single threshold generation time exceeds the expected time, the system will automatically issue a prompt message requiring manual filling of the threshold, so that system operation and maintenance personnel can promptly discover threshold abnormalities, etc.
[0136] In this application, by coordinating manual threshold settings when dynamic thresholds cannot be generated normally, invalid data can be remedied in a timely manner, greatly improving the early warning efficiency of ecological environmental indicators in smart city analysis and research.
[0137] In some embodiments, based on at least one of the multiple environmental monitoring data included in the data cache queue and the data type corresponding to the data cache queue, obtaining the target threshold range corresponding to the data cache queue in the target update period may include:
[0138] Get the historical generation time of the historical threshold range corresponding to the data cache queue;
[0139] When it is determined that a target update cycle has been entered based on the historical generation time and the latest collection time corresponding to the plurality of environmental monitoring data, a target threshold range corresponding to the target update cycle of the data cache queue is obtained.
[0140] In this embodiment, the historical threshold range is a threshold range corresponding to the data cache queue generated in a historical update period.
[0141] The historical generation time is the generation time corresponding to the historical threshold range.
[0142] Based on the time sequence of the collection, multiple environmental monitoring data are obtained. Based on the latest collection time and historical generation time corresponding to the multiple environmental monitoring data, it can be determined in real time whether the threshold needs to be recalculated according to the update cycle set by the system. When it is determined that the threshold needs to be recalculated, the target update cycle is entered.
[0143] During the actual execution process, when the program starts, it will read the locally stored threshold of the indicator that was successfully calculated the most recently as the analysis benchmark value, and generate a timestamp based on the threshold. It will determine in real time whether the threshold needs to be recalculated based on the update cycle set by the system. When a new threshold is generated, the system uses the new threshold for indicator early warning analysis and re-stores the maximum and minimum value information of the threshold for a certain number of times in history.
[0144] In some embodiments, after step 130, the method may further include:
[0145] When the analysis result includes that at least one environmental monitoring data in the data cache queue is abnormal, an early warning prompt message is output.
[0146] In this embodiment, the early warning prompt information is used to indicate that an abnormal situation has occurred in the data cache queue, and is used to remind the user to pay attention or take corresponding measures.
[0147] In the actual implementation process, Figure 3 As shown, 1 main thread and 3 core threads can be set.
[0148] When the program starts, the main thread can read the static configuration file (such as percentage parameters, etc.) of the ecological environment indicator early warning analysis and the latest dynamic threshold range of the indicator.
[0149] According to the configuration content and the latest thresholds of the ecological environment indicators, the analysis object entity can be created and initialized for each indicator, including basic indicator information, real-time indicator data cache circular queue, dynamic threshold generation rules, sliding window analysis circular queue and abnormal warning rules, etc., and a unique identifier can be created for each entity according to certain rules.
[0150] A first-in-first-out data cache queue of a specified length may be created for each analysis entity, and the data cache queue may be maintained in a moving sliding window manner in each acquisition cycle.
[0151] The indicator receiving thread is used to receive the real-time indicator analysis data delivered by the data server, and store the data into the corresponding analysis entity data cache circular queue according to the unique identifier.
[0152] Then, each analysis entity is traversed in a polling manner, so that each analysis entity reads real-time indicator data from the data cache queue, generates dynamic thresholds and maintains the sliding window analysis queue, and performs indicator abnormality warning analysis based on the latest thresholds and the latest data of the sliding window analysis queue after maintenance.
[0153] According to the specified period, the threshold value can be dynamically calculated by the moving average method, and the latest threshold value can be stored and managed.
[0154] The indicator abnormality warning results obtained by the indicator analysis thread are further processed by the indicator warning thread and sent to the warning server and other related processes.
[0155] The environmental data processing device provided in the present application is described below. The environmental data processing device described below and the environmental data processing method described above can be referenced to each other.
[0156] The environmental data processing method provided in the embodiment of the present application can be executed by an environmental data processing device. In the embodiment of the present application, the environmental data processing device provided in the embodiment of the present application is described by taking the environmental data processing device executing the environmental data processing method as an example.
[0157] An embodiment of the present application also provides an environmental data processing device.
[0158] like Figure 4 As shown, the environment data processing device includes: a first processing module 410, a second processing module 420 and a third processing module 430.
[0159] A first processing module 410 is used to add the environmental monitoring data corresponding to the multiple collection moments to a data cache queue corresponding to the environmental monitoring data;
[0160] A second processing module 420 is used to obtain a target threshold range corresponding to the data cache queue in the target update period based on at least one of the multiple environmental monitoring data included in the data cache queue and the data type corresponding to the data cache queue;
[0161] The third processing module 430 is used to obtain the analysis result of the data cache queue corresponding to the target update period based on the target threshold range and multiple environmental monitoring data; the analysis result includes that all environmental monitoring data in the data cache queue are normal, or there is at least one environmental monitoring data abnormal in the data cache queue.
[0162] According to the environmental data processing device provided in the embodiment of the present application, the threshold range corresponding to the data cache queue in the current update cycle is determined by the latest collected environmental monitoring data and the data type corresponding to the environmental monitoring data. There is no need to manually modify and maintain the warning threshold multiple times, which saves a lot of manpower costs. In addition, the real-time updated indicator data is analyzed and warned based on the threshold range, which improves the warning accuracy and broadens the applicable scenarios.
[0163] In some embodiments, the third processing module 430 may also be used to:
[0164] Based on the size relationship between each environmental monitoring data and the target threshold range, the analysis result corresponding to the data cache queue is obtained.
[0165] In some embodiments, the third processing module 430 may also be used to:
[0166] When the environmental monitoring data is not within the target threshold range, the analysis result corresponding to the environmental monitoring data is determined to be a single point anomaly;
[0167] When the target environmental monitoring data among multiple environmental monitoring data is within the target threshold range, and the difference between the target environmental monitoring data and other environmental monitoring data among the multiple environmental monitoring data is not within the first threshold range, it is determined that the analysis result corresponding to the target environmental monitoring data is a context anomaly; the first threshold range is a first multiple of the target threshold range; the other environmental monitoring data is any environmental monitoring data among the multiple environmental monitoring data except the target environmental monitoring data.
[0168] In some embodiments, the third processing module 430 may also be used to:
[0169] When multiple environmental monitoring data are all within the target threshold range, the difference between the maximum value of the multiple environmental monitoring data and the upper limit of the target threshold range, and the difference between the minimum value of the multiple environmental monitoring data and the lower limit of the target threshold range are all within the second threshold range, it is determined that the analysis result corresponding to the data cache queue is a collective abnormality; the second threshold range is the second multiple of the target threshold range.
[0170] In some embodiments, the second processing module 420 may also be used to:
[0171] Obtaining the average value of multiple environmental monitoring data included in the data cache queue at each collection time;
[0172] Based on the multiple average values and the data type corresponding to the data cache queue, a target threshold range corresponding to the data cache queue is determined.
[0173] In some embodiments, the second processing module 420 may also be used to:
[0174] Get the historical generation time of the historical threshold range corresponding to the data cache queue;
[0175] When it is determined that a target update cycle has been entered based on the historical generation time and the latest collection time corresponding to the plurality of environmental monitoring data, a target threshold range corresponding to the target update cycle of the data cache queue is obtained.
[0176] In some embodiments, the environmental data processing device may also include a fourth processing module for obtaining an analysis result of the data cache queue corresponding to the target update cycle based on a target threshold range and multiple environmental monitoring data, and outputting an early warning prompt message if the analysis result includes that there is at least one environmental monitoring data abnormality in the data cache queue.
[0177] The environmental data processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0178] The environmental data processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0179] The environmental data processing device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0180] In some embodiments, Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, each process of the above-mentioned environmental data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0181] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0182] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the various processes of the above-mentioned environmental data processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0183] On the other hand, the present application also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the various processes of the above-mentioned environmental data processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0184] On the other hand, an embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned environmental data processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0185] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0186] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0188] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing environmental data, characterized in that: include: Adding the environmental monitoring data corresponding to the multiple collection moments to the data cache queue corresponding to the environmental monitoring data; Based on at least one of the multiple environmental monitoring data included in the data cache queue and the data type corresponding to the data cache queue, obtaining a target threshold range corresponding to the data cache queue in a target update period; Based on the target threshold range and the multiple environmental monitoring data, an analysis result of the data cache queue corresponding to the target update period is obtained; the analysis result includes that all environmental monitoring data in the data cache queue are normal, or that at least one environmental monitoring data in the data cache queue is abnormal.
2. The environmental data processing method according to claim 1, characterized in that: The obtaining, based on the target threshold range and the plurality of environmental monitoring data, an analysis result corresponding to the target update period of the data cache queue includes: Based on the size relationship between each of the environmental monitoring data and the target threshold range, an analysis result corresponding to the data cache queue is obtained.
3. The environmental data processing method according to claim 2, characterized in that: The obtaining, based on the size relationship between each of the environmental monitoring data and the target threshold range, an analysis result corresponding to the data cache queue includes: When the environmental monitoring data is not within the target threshold range, determining that the analysis result corresponding to the environmental monitoring data is a single point anomaly; When the target environmental monitoring data among the multiple environmental monitoring data is within the target threshold range, and the difference between the target environmental monitoring data and other environmental monitoring data among the multiple environmental monitoring data is not within the first threshold range, it is determined that the analysis result corresponding to the target environmental monitoring data is a contextual anomaly; the first threshold range is a first multiple of the target threshold range; the other environmental monitoring data is any environmental monitoring data among the multiple environmental monitoring data except the target environmental monitoring data.
4. The environmental data processing method according to claim 2, characterized in that: The obtaining, based on the size relationship between each of the environmental monitoring data and the target threshold range, an analysis result corresponding to the data cache queue includes: When the multiple environmental monitoring data are all within the target threshold range, the difference between the maximum value of the multiple environmental monitoring data and the upper limit of the target threshold range, and the difference between the minimum value of the multiple environmental monitoring data and the lower limit of the target threshold range are all within the second threshold range, it is determined that the analysis result corresponding to the data cache queue is a collective abnormality; the second threshold range is a second multiple of the target threshold range.
5. The environmental data processing method according to any one of claims 1 to 4, characterized in that: The acquiring, based on at least one of the plurality of environmental monitoring data included in the data cache queue and the data types corresponding to the data cache queue, a target threshold range corresponding to the data cache queue in a target update period includes: Obtaining an average value of a plurality of environmental monitoring data included in the data cache queue at each of the collection moments; Based on the multiple average values and the data type corresponding to the data cache queue, a target threshold range corresponding to the data cache queue is determined.
6. The environmental data processing method according to any one of claims 1 to 4, characterized in that: The acquiring, based on at least one of the plurality of environmental monitoring data included in the data cache queue and the data types corresponding to the data cache queue, a target threshold range corresponding to the data cache queue in a target update period includes: Obtain the historical generation time of the historical threshold range corresponding to the data cache queue; When it is determined that the target update period has begun based on the historical generation time and the latest collection time corresponding to the plurality of environmental monitoring data, a target threshold range corresponding to the target update period of the data cache queue is obtained.
7. The environmental data processing method according to any one of claims 1 to 4, characterized in that: After acquiring the analysis result corresponding to the target update period of the data cache queue based on the target threshold range and the plurality of environmental monitoring data, the method further includes: When the analysis result includes that at least one environmental monitoring data in the data cache queue is abnormal, an early warning prompt message is output.
8. An environmental data processing device, characterized in that: include: A first processing module, configured to add the environmental monitoring data corresponding to a plurality of collection moments to a data cache queue corresponding to the environmental monitoring data; A second processing module, configured to obtain a target threshold range corresponding to the data cache queue in a target update period based on at least one of a plurality of environmental monitoring data included in the data cache queue and a data type corresponding to the data cache queue; A third processing module is used to obtain the analysis result of the data cache queue corresponding to the target update period based on the target threshold range and the multiple environmental monitoring data; the analysis result includes that all environmental monitoring data in the data cache queue are normal, or that there is at least one environmental monitoring data abnormal in the data cache queue.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the environmental data processing method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the environmental data processing method as described in any one of claims 1 to 7 is implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the environmental data processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Abnormity detection method, device, equipment, medium and product
CN120856588A