Public toilet environment management method and device based on internet of things, electronic device and medium

By automating the management of public toilets through IoT technology, the problems of untimely response and resource waste caused by traditional manual inspections have been solved, thereby improving management efficiency and user experience.

CN120547199BActive Publication Date: 2026-01-23ZHONGHUANJIE (BEIJING) ENVIRONMENTAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510661741.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2026-01-23
Estimated Expiration
2045-05-22

AI Technical Summary

Technical Problem

Traditional public toilet management relies on manual inspections, which leads to untimely responses, waste of resources, and difficulty in meeting the requirements of modern cities for efficient, environmentally friendly, and user-friendly management.

Method used

The public toilet environment management method based on the Internet of Things is adopted. Data is collected by sensors, classified and sorted by data buffering platform, and the ventilation equipment is dynamically adjusted. The environmental quality index is monitored in real time to achieve automated management.

Benefits of technology

It has improved the efficiency of public toilet management and service quality, provided a more comfortable and convenient user experience, and reduced resource waste and response time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120547199B_ABST
    Figure CN120547199B_ABST
Patent Text Reader

Abstract

The application provides a public toilet environment management method and device based on the Internet of Things, electronic equipment and medium. The method comprises the following steps: acquiring public toilet data collected by different sensors in a target public toilet according to a configured time interval; storing each public toilet data to a corresponding device buffer; performing classification processing on the public toilet data in each device buffer to obtain public toilet data of different protocol types, performing sorting processing on each public toilet data to obtain a first data sequence corresponding to the protocol buffer; if the public toilet data collected by different sensors does not exceed the corresponding data threshold, determining an environment quality index of the target public toilet based on the first data sequence in the global buffer, and adjusting the configured ventilation equipment of the target public toilet according to the environment quality index when the environment quality index exceeds the configured environment quality index threshold. The application can significantly improve the management level and efficiency of public toilets, and also provide users with more comfortable and convenient service experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of public toilet management, in particular, relates to a public toilet environment management method and device based on Internet of Things, electronic equipment and medium. BACKGROUND

[0002] With the acceleration of urbanization and the increasing demand for public facilities, as an important part of urban infrastructure, the management efficiency and service quality of public toilets are directly related to the quality of life of citizens and the image of the city. The traditional public toilet management method mainly relies on manual inspection and regular maintenance, which has the problems of untimely response and resource waste. SUMMARY

[0003] The purpose of the embodiments of the present application is to provide a public toilet environment management method and device based on Internet of Things, electronic equipment and medium, which solves the above problems existing in the prior art, significantly improves the management level and efficiency of public toilets, and also provides more comfortable and convenient service experience for users.

[0004] In a first aspect, a public toilet environment management method based on Internet of Things is provided, applied to a data monitoring system, the system comprising: a data buffering platform, the data buffering platform comprising a device buffer area corresponding to each sensor, a plurality of protocol buffer areas grouped according to protocol types, and a global buffer area, the method comprising:

[0005] According to the configured time interval, the public toilet data collected by different sensors in the target public toilet is obtained;

[0006] Each public toilet data is stored in the corresponding device buffer area;

[0007] The public toilet data in each device buffer area is classified and processed to obtain public toilet data of different protocol types, and the public toilet data of the same category is stored in the corresponding protocol buffer area;

[0008] For any protocol buffer area, the public toilet data in the protocol buffer area is sorted to obtain a first data sequence corresponding to the protocol buffer area, and the first data sequence is stored in the global buffer area;

[0009] If the public toilet data collected by different sensors does not exceed the corresponding data threshold, the environment quality index of the target public toilet is determined based on the first data sequence in the global buffer area, and when the environment quality index exceeds the configured environment quality index threshold, the configured ventilation equipment of the target public toilet is adjusted according to the environment quality index.

[0010] In a possible implementation, the sorting of the public toilet data in the protocol buffer area to obtain the first data sequence corresponding to the protocol buffer area comprises:

[0011] For any public toilet data, the time dimension factor, the space dimension factor and the environment dimension factor corresponding to the public toilet data are calculated to obtain the target weight of the public toilet data;

[0012] Based on the target weight of each public toilet data, the public toilet data is sorted to obtain a first data sequence composed of multiple public toilet data.

[0013] In a possible implementation, obtaining the target weight of the public toilet data includes:

[0014] The time dimension factor, the space dimension factor and the environment dimension factor corresponding to the public toilet data are calculated by using the configured weight algorithm to obtain the target weight of the public toilet data;

[0015] The weight algorithm is:

[0016]

[0017] Wherein, W total is the target weight, W time is the time dimension factor, W space is the space dimension factor, and W env is the environment dimension factor.

[0018] In a possible implementation, after the first data sequence is stored in the global buffer, the method further includes:

[0019] If any public toilet data exceeds the corresponding data threshold, the alarm start time is determined based on the collection time of the public toilet data, and the alarm prompt of the corresponding public toilet data is generated;

[0020] The target difference value between the public toilet data and the data threshold is calculated;

[0021] Based on the correspondence between different difference values and different adjustment parameters, the adjustment parameter corresponding to the target difference value is determined, and the ventilation equipment corresponding to the public toilet data is adjusted through the adjustment parameter;

[0022] When the public toilet data does not exceed the corresponding data threshold, the alarm end time is determined based on the collection time of the public toilet data, and the alarm prompt is ended.

[0023] In a possible implementation, after the alarm start time and the alarm end time are determined, the method further includes:

[0024] Based on the alarm start time and the alarm end time, the alarm period is determined;

[0025] statistically analyze all public toilet data corresponding to the alarm period to obtain a second data sequence of each public toilet data changing over time;

[0026] determine a new adjustment parameter based on the change trend of each public toilet data in the second data sequence.

[0027] In a possible implementation, the public toilet data includes gas data, temperature and humidity data, and people flow data.

[0028] In a possible implementation, the determination of the data threshold corresponding to the gas data includes:

[0029] calculating the configured basic numerical value and the people flow in the time interval based on the configured threshold algorithm to determine the data threshold corresponding to the gas data;

[0030] The threshold algorithm is:

[0031] w = β0 + β1 × (1 - e -λQ )

[0032] wherein, W is the data threshold, β0 is the basic threshold, Q is the people flow, β1 is the increment of the people flow to the data threshold, and λ is the rate of controlling the data threshold to grow with the people flow.

[0033] In a second aspect, a public toilet environment management device based on the Internet of Things is provided, which is applied to a data monitoring system, the system including a data buffering platform including device buffer areas corresponding to various sensors, a plurality of protocol buffer areas grouped according to protocol types, and a global buffer area, and the device can include:

[0034] an acquisition unit configured to acquire public toilet data collected by different sensors in a target public toilet at a configured time interval;

[0035] a processing unit configured to store each public toilet data to a corresponding device buffer area;

[0036] and sort and process the public toilet data in each device buffer area to obtain public toilet data of different protocol types, and store public toilet data of the same category in a corresponding protocol buffer area;

[0037] an ordering unit configured to sort and process each public toilet data in any protocol buffer area to obtain a first data sequence corresponding to the protocol buffer area, and store the first data sequence in the global buffer area;

[0038] The processing unit is configured to determine an environmental quality index of the target public toilet based on the first data sequence in the global buffer if the public toilet data collected by different sensors do not exceed the corresponding data threshold, and adjust a configured ventilation device of the target public toilet according to the environmental quality index if the environmental quality index exceeds a configured environmental quality index threshold.

[0039] In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus.

[0040] The memory is configured to store a computer program.

[0041] The processor is configured to execute the program stored in the memory to implement the method steps of any of the above first aspect.

[0042] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the method steps of any of the above first aspect.

[0043] The application provides a public toilet environmental management method based on Internet of Things, which includes: acquiring public toilet data collected by different sensors in a target public toilet according to a configured time interval; storing each public toilet data in a corresponding device buffer; classifying the public toilet data in each device buffer to obtain public toilet data of different protocol types, and storing public toilet data of the same category in a corresponding protocol buffer; for any protocol buffer, sorting the public toilet data in the protocol buffer to obtain a first data sequence corresponding to the protocol buffer, and storing the first data sequence in a global buffer; if the public toilet data collected by different sensors do not exceed the corresponding data threshold, determining an environmental quality index of the target public toilet based on the first data sequence in the global buffer, and adjusting a configured ventilation device of the target public toilet according to the environmental quality index if the environmental quality index exceeds a configured environmental quality index threshold. The storage mode of the public toilet data in the application adopts a big data database such as mongdb, which avoids the performance bottleneck caused by one-time traditional database query. The time window sliding mechanism dynamically adjusts the time window when the timer triggers, ensuring that the query range always covers the latest time interval. The alarm state management designs a device alarm state cache and fits it, reducing frequent read-write operations on the database. The public toilet data collected by each sensor maintains an independent state (including whether to alarm, alarm start time, etc.). The abnormal value is dynamically updated using a variable in the alarm state to reduce repeated calculation. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be regarded as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.

[0045] Figure 1 The system architecture diagram of the public toilet environment management method based on the Internet of Things provided by the embodiments of the present application is shown in the figure.

[0046] Figure 2 The flowchart of the public toilet environment management method based on the Internet of Things provided by the embodiments of the present application is shown in the figure.

[0047] Figure 3 The structural diagram of the public toilet environment management device based on the Internet of Things provided by the embodiments of the present application is shown in the figure.

[0048] Figure 4 The structural diagram of the electronic device provided by the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION

[0049] The technical solutions of the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, and not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0050] The public toilet environment management method based on the Internet of Things provided by the embodiments of the present application can be applied in the system architecture shown in the figure, such as Figure 1 Figure 1 ​As shown, the system can include a data monitoring system and a server. The server can be a physical server, a server cluster composed of multiple physical servers or a distributed system, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a user equipment (UE) such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device, or other processing devices connected to a wireless modem, a mobile station (MS), a mobile terminal (Mobile Terminal), etc. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.

[0051] The data monitoring system is configured to acquire public toilet data collected by different sensors in a target public toilet. The data monitoring system can specifically include a data buffering platform, which includes device buffer areas corresponding to the sensors, a plurality of protocol buffer areas grouped according to protocol types, and a global buffer area.

[0052] In order to make the data monitoring system more flexible and extensible, a five-layer plug-in architecture is adopted.

[0053] Core framework layer: provides basic services and plug-in management.

[0054] Protocol adaptation layer: supports dynamic loading of multiple protocols.

[0055] Data processing layer: responsible for message routing and business logic processing.

[0056] Storage access layer: unified management of data storage interface.

[0057] Management interface layer: provides visual plug-in management and monitoring interface.

[0058] Plug-in discovery:

[0059] File system scanning: regularly checks plug-in packages in a specified directory.

[0060] Service registry center: obtains available plug-in information from the registry center.

[0061] Remote plug-in repository: obtains plug-in list through network.

[0062] Plug-in loading:

[0063] Custom class loader: Implements isolated loading of plugin classes.

[0064] Dependency resolution: Automatically resolves and loads plugin dependencies.

[0065] Security verification: Verifies plugin signature and integrity.

[0066] Plugin initialization:

[0067] Configuration injection: Obtains plugin configuration from the configuration center.

[0068] Service registration: Registers plugin services to the core framework.

[0069] Resource allocation: Allocates necessary system resources for plugins.

[0070] Plugin uninstallation:

[0071] Service deregistration: Deregisters plugin services from the core framework.

[0072] Resource release: Releases system resources occupied by plugins.

[0073] Class loader destruction: Destroys the class loader of the plugin.

[0074] Inter-plugin communication mechanism:

[0075] Event bus: Event communication based on the publish-subscribe pattern.

[0076] Service discovery: Plugins can discover and call services provided by other plugins.

[0077] Data sharing: Inter-plugin data exchange through shared memory and cache.

[0078] Asynchronous messaging: Message queue for inter-plugin asynchronous communication.

[0079] Protocol-driven dynamic loading process can be:

[0080] 1. Plugin scanning phase: Real-time monitoring of plugin directory changes using WatchService (Java) or inotify (Linux), replacing timed scanning to reduce latency.

[0081] Parse plugin.json using Jackson / Gson, example of key fields.

[0082] Determine compatibility through semantic versioning (SemVer), for example, the major version number must be consistent.

[0083] 2. Class loading phase:

[0084] Create an independent URLClassLoader to load plugin classes.

[0085] Customize the handling of the dual parent delegation model.

[0086] Redirect the dependency package path with the Maven Shade plugin to avoid conflicts with the host environment.

[0087] 3. Instantiation phase:

[0088] Reflection instantiation enhancement, replace Class.newInstance() with Constructor.newInstance() to support parameterized construction.

[0089] Dependency injection implementation, use Guice lightweight DI container.

[0090] 4. Registration phase:

[0091] Use CopyOnWriteArrayList to implement thread-safe driver registration.

[0092] Register to Consul / Zookeeper to realize cluster awareness.

[0093] 5. Hot unloading mechanism:

[0094] Use dynamic proxy to realize runtime driver replacement.

[0095] Smooth switching of connection pool.

[0096] Implement non-interrupt service upgrade.

[0097] Observe the JVM unloading process through -XX:+TraceClassUnloading to ensure that there are no static reference residues and background tasks such as thread pools have been terminated.

[0098] In some embodiments, the performance of the system is optimized, and parallel loading acceleration can be achieved using CompletableFuture to implement plugin parallel initialization; cache optimization can be achieved using Caffeine cache to load the metadata of the loaded plugins, and TTL can be set to prevent memory leakage.

[0099] With the rapid development of urbanization and the increasing demand for public facilities, public toilets as a key part of urban infrastructure, their management efficiency and service level directly affect the quality of life of citizens and the overall image of the city. Traditionally, the management of public toilets mainly relies on manual patrol and scheduled maintenance, which not only responds slowly and cannot respond quickly when problems arise, but also often leads to improper use of resources and waste. This method is difficult to meet the requirements of modern cities for efficient, environmentally friendly and user-friendly public facility management.

[0100] Therefore, the purpose of the embodiments of the present application is to provide a public toilet environment management method based on Internet of Things, which solves the above problems existing in the prior art, significantly improves the management level and efficiency of public toilets, and also provides more comfortable and convenient service experience for users.

[0101] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0102] Figure 2 A flowchart of a public toilet environment management method based on Internet of Things provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the method can include the following steps. Figure 2

[0103] In step S210, public toilet data collected by different sensors in the target public toilet is obtained according to the configured time interval.

[0104] Specifically, gas sensors, temperature and humidity sensors, and people flow sensors are installed in each of the monitored public toilets.

[0105] According to the configured time interval, each sensor sends the public toilet data collected in the corresponding time interval to the data monitoring system.

[0106] Since the data buffering platform in the data monitoring system includes the device buffer area corresponding to each sensor, Redis Pipeline is used to batch write each public toilet data to the device-level buffer area, thereby reducing network overhead.

[0107] Device-level buffer area: each sensor has its own independent buffer area for storing public toilet data uploaded by the sensor. These public toilet data are usually unclassified raw data.

[0108] In some embodiments, the size of the corresponding device buffer area is adjusted according to the rate at which each sensor collects public toilet data, for example: using a memory management library (such as jemalloc) to monitor the buffer usage rate in real time, and automatically expanding when the threshold (such as 80%) is exceeded. The initial device buffer area is 1MB, and when the data surges, it is expanded to 5MB to avoid overflow.

[0109] ​In some embodiments, the device-level buffer employs an LRU (Least Recently Used) eviction policy to protect critical public toilet data. Specifically, the device buffer is divided into multiple sub-queues, and the eviction order is managed according to priority. The P0 area (fixed retention) stores alarm data with a fixed capacity (e.g., 10 records) and is manually cleared. The P1 area (weighted LRU) stores high-weight data, with an eviction probability equal to the standard LRU probability × 0.3. The P2 area (standard LRU) uses a basic eviction policy. The P3 area (aggressive LRU) has an eviction probability equal to the standard LRU probability × 1.5. When the device buffer space is insufficient, an eviction score is calculated based on priority and access time: Eviction score = priority weight - current time - last access time. The corresponding public toilet data is then evictioned based on the eviction score.

[0110] Step S220: Classify the public toilet data in each device buffer to obtain public toilet data of different protocol types, and store public toilet data of the same category in the corresponding protocol buffer.

[0111] Specifically, for public toilet data in any device's buffer, it is parsed according to the protocol format it uses:

[0112] Determine the transmission protocol for the public toilet data and categorize it according to its transmission protocol type (e.g., MQTT, HTTP, CoAP, etc.). For example, a category label can be created for each protocol, and public toilet data of the same type can be grouped together, thus storing public toilet data of the same category in the corresponding protocol buffer.

[0113] In some embodiments, for any protocol buffer, public toilet data is categorized into hot data (current time interval), warm data (historical time intervals relatively close to the current time interval), and cold data (historical time intervals relatively far from the current time interval) based on the collection time or importance of the data, and stored in sub-protocol buffers of different performance levels. This ensures efficient data processing while reducing storage costs.

[0114] Step S230: For any protocol buffer, sort the public toilet data in the protocol buffer to obtain the first data sequence corresponding to the protocol buffer, and store the first data sequence into the global buffer.

[0115] Specifically, for any public toilet data, a configured weighting algorithm is used to calculate the time dimension factor, spatial dimension factor, and environmental dimension factor corresponding to the public toilet data to obtain the target weight of the public toilet data;

[0116] The weighting algorithm can be expressed as:

[0117]

[0118] Among them, Wtotal For target weights, W time Time dimension factor, W space For spatial dimension factor, W env Environmental dimension factors.

[0119] Based on the target weights of each public toilet data in descending order, the public toilet data is sorted to obtain the first data sequence composed of multiple public toilet data.

[0120] Furthermore, the global buffer uses Redis Stream consumer groups for load balancing. In some embodiments, the MaxLen parameter of Redis Stream is used to control the maximum number of messages.

[0121] Step S240: Process the first data sequence in the global buffer to obtain adjustment parameters, and adjust the ventilation equipment corresponding to the public toilet data using the adjustment parameters.

[0122] After storing the first data sequence into the global buffer, the method further includes:

[0123] A. If any public toilet data exceeds the corresponding data threshold, the alarm start time is determined based on the data collection time, and an alarm prompt for the corresponding public toilet data is generated. In some embodiments, the public toilet data includes gas data, temperature and humidity data, and pedestrian flow data. When the public toilet data is gas data, the process of determining the data threshold includes: calculating the data threshold corresponding to the gas data based on the configured threshold algorithm, using the configured base value and the pedestrian flow over the time interval; the threshold algorithm is as follows:

[0124] w=β0+β1×(1-e -λQ )

[0125] Where W is the data threshold, β0 is the base threshold, Q is the flow rate, β1 is the increment of the flow rate over the data threshold, and λ is the rate at which the data threshold increases with the flow rate.

[0126] In another embodiment, such as when calculating the data threshold for temperature and humidity data, the base threshold corresponding to the temperature and humidity data in the threshold algorithm is different from the data threshold corresponding to the gas data mentioned above.

[0127] Calculate the target difference between the public toilet data and the data threshold;

[0128] Based on the correspondence between different configuration differences and different adjustment parameters, the adjustment parameter corresponding to the target difference is determined, and the ventilation equipment corresponding to the public toilet data is adjusted through the adjustment parameter; for example, the difference range in which the target difference is located is determined, and the ventilation equipment corresponding to the public toilet data is adjusted through the adjustment parameter corresponding to the difference range.

[0129] When the public toilet data changes over time, and at a certain point in time it does not exceed the corresponding data threshold, the alarm end time is determined based on the data collection time, and the alarm prompt ends.

[0130] After determining the alarm start time and alarm end time, the method also includes:

[0131] The alarm period is determined based on the alarm start and end times. Specifically, when the data threshold is exceeded for the first time, the alarm start time is automatically recorded; when the public toilet data returns to normal (below the data threshold), the alarm end time is recorded, and a complete alarm period is automatically generated. This can be understood as follows: If the device is not currently in an alarm state (first time exceeding the threshold): Set the public toilet data collection time to the alarm start time (StartTime). Initialize the alarm state to "Yes". Use the current indicator value as the maximum value (MaxValue) and record its unit (MaxUnit). If the device is already in an alarm state: Compare the current public toilet data with MaxValue, and update the maximum value and unit. If a public toilet data value is lower than or equal to the data threshold (Threshold): If the device is in an alarm state: Set the current public toilet data collection time to the alarm end time (EndTime). Record the alarm event, including sensor ID, alarm period, maximum value, and its unit. Reset the alarm state to "No".

[0132] The data of all public toilets within the alarm period are statistically analyzed to obtain a second data sequence of the data of each public toilet changing over time; in some embodiments, the maximum public toilet data in the second data sequence is statistically analyzed to determine the severity of the environmental anomaly.

[0133] Based on the changing trends of public toilet data in the second data sequence, new adjustment parameters are determined.

[0134] B. If multiple public toilet data points (which can be different gas data or gas data combined with temperature and humidity data) exceed the corresponding data threshold, then determine the final parameter Ptotal: Ptotal = w1P Δ1 +w2P Δ2 ;

[0135] Where w1 and w2 are the first gas weight and the second gas weight, or the gas weight and temperature and humidity weight, respectively, and P Δ1 and P Δ2 These are, respectively, the first gas data and the second gas data, or the gas data and temperature and humidity data.

[0136] Based on the correspondence between different parameters and different adjustment parameters, the adjustment parameter corresponding to the final parameter is determined, and the ventilation equipment corresponding to the public toilet data is adjusted based on the adjustment parameter.

[0137] C. If the data collected by different sensors for public toilets do not exceed the corresponding data thresholds, then the environmental quality index of the target public toilet is determined based on the first data sequence in the global buffer. When the environmental quality index exceeds the configured environmental quality index threshold, the ventilation equipment configured for the target public toilet is adjusted according to the environmental quality index EQI.

[0138] Specifically, EQI = (w1Data1 + w2Data2 + ... + wnDatam) / (w1 + w2 + ... + wn), where wi is the weight of the i-th sensor data and Datai is the i-th public toilet data in the first data sequence.

[0139] Then, based on the configured EQI thresholds at different levels, such as green zone (excellent), yellow zone (good), orange zone (caution), and red zone (dangerous).

[0140] When the EQI is in the green zone, the current operating status of the ventilation equipment remains unchanged.

[0141] When the EQI enters the yellow zone, increase the operating frequency of the ventilation equipment.

[0142] If the EQI reaches the orange zone, the ventilation efficiency should be significantly improved, which may require the simultaneous activation of multiple ventilation devices.

[0143] If the EQI enters the red zone, the system immediately takes the strongest ventilation measures and notifies maintenance personnel to inspect and handle the situation.

[0144] This application provides an IoT-based public toilet environment management method. The method includes: acquiring public toilet data collected by different sensors in a target public toilet according to configured time intervals; storing each public toilet data in a corresponding device buffer; classifying the public toilet data in each device buffer to obtain public toilet data of different protocol types, and storing public toilet data of the same category in a corresponding protocol buffer; sorting the public toilet data in any protocol buffer to obtain a first data sequence corresponding to that protocol buffer, and storing the first data sequence in a global buffer; if the public toilet data collected by different sensors does not exceed the corresponding data threshold, determining the environmental quality index of the target public toilet based on the first data sequence in the global buffer, and adjusting the ventilation equipment configured in the target public toilet according to the environmental quality index when the environmental quality index exceeds the configured environmental quality index threshold. This application uses a large data database such as MongoDB for public toilet data storage, avoiding the performance bottleneck caused by one-time traditional database queries. A time window sliding mechanism dynamically adjusts the time window when the timer is triggered, ensuring that the query range always covers the most recent time interval. Alarm status management is implemented by designing and fitting device alarm status caches, reducing frequent read and write operations to the database. Each sensor collects data on public restrooms and maintains an independent status (including whether an alarm has been triggered, the alarm start time, etc.). Outliers are dynamically updated; variables are used to dynamically update the maximum value in alarm states, reducing redundant calculations.

[0145] Corresponding to the above method, this application also provides an Internet of Things-based public toilet environment management device, such as... Figure 3 As shown, this is applied to a data monitoring system, which includes: a data buffer platform, comprising device buffers corresponding to each sensor, multiple protocol buffers grouped according to protocol type, and a global buffer. The device includes:

[0146] The acquisition unit 310 is used to acquire public toilet data collected by different sensors in the target public toilet according to the configured time interval;

[0147] Processing unit 320 is used to store the data of each public toilet into the corresponding device buffer;

[0148] In addition, the public toilet data in each device buffer is classified and processed to obtain public toilet data of different protocol types, and the public toilet data of the same category is stored in the corresponding protocol buffer;

[0149] The sorting unit 330 is used to sort the public toilet data in any protocol buffer to obtain a first data sequence corresponding to the protocol buffer, and store the first data sequence into the global buffer.

[0150] The processing unit 320 is configured to determine the environmental quality index of the target public toilet based on the first data sequence in the global buffer if the public toilet data collected by different sensors does not exceed the corresponding data threshold, and adjust the ventilation equipment configured in the target public toilet according to the environmental quality index when the environmental quality index exceeds the configured environmental quality index threshold.

[0151] The functions of each unit in the Internet of Things-based public toilet environment management device provided in the above embodiments of this application can be implemented through the above methods and steps. Therefore, the specific working process and beneficial effects of each unit in the Internet of Things-based public toilet environment management device provided in the embodiments of this application will not be repeated here.

[0152] This application also provides an electronic device, such as... Figure 4 As shown, it includes a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440.

[0153] Memory 430 is used to store computer programs;

[0154] When the processor 410 executes the program stored in the memory 430, it performs the following steps:

[0155] According to the configured time interval, acquire public toilet data collected by different sensors in the target public toilet;

[0156] Store the data from each public toilet in the corresponding device buffer;

[0157] The public toilet data in each device buffer is classified and processed to obtain public toilet data of different protocol types, and public toilet data of the same category is stored in the corresponding protocol buffer.

[0158] For any protocol buffer, sort the public toilet data in the protocol buffer to obtain the first data sequence corresponding to the protocol buffer, and store the first data sequence into the global buffer;

[0159] If the public toilet data collected by different sensors does not exceed the corresponding data threshold, the environmental quality index of the target public toilet is determined based on the first data sequence in the global buffer. When the environmental quality index exceeds the configured environmental quality index threshold, the ventilation equipment configured in the target public toilet is adjusted according to the environmental quality index.

[0160] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0161] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0162] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0163] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0164] The implementation methods and beneficial effects of the various components of the electronic device in the above embodiments for solving the problem can be found in [reference needed]. Figure 2 The steps in the illustrated embodiments are used to implement the electronic device. Therefore, the specific working process and beneficial effects of the electronic device provided in this application will not be repeated here.

[0165] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the above embodiments of a public toilet environment management method based on the Internet of Things.

[0166] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the above embodiments of a public toilet environment management method based on the Internet of Things.

[0167] Those skilled in the art will understand that the embodiments in this application can be provided as methods, systems, or computer program products. Therefore, the embodiments in this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments in this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0168] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0169] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0170] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0171] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected," "coupled," or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0172] Although preferred embodiments have been described in this application, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the embodiments in this application are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments in this application.

[0173] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the embodiments of this application and their equivalents, then these modifications and variations are also intended to be included in the embodiments of this application.

Claims

1. A public toilet environment management method based on the Internet of Things, characterized in that, Applied to a data monitoring system, the system includes: a data buffer platform, the data buffer platform including device buffers corresponding to each sensor, multiple protocol buffers grouped according to protocol type, and a global buffer, the method including: According to the configured time interval, acquire public toilet data collected by different sensors in the target public toilet; Store the data from each public toilet in the corresponding device buffer; The public toilet data in each device buffer is classified and processed to obtain public toilet data of different protocol types, and public toilet data of the same category is stored in the corresponding protocol buffer. For any protocol buffer, sort the public toilet data in the protocol buffer to obtain the first data sequence corresponding to the protocol buffer, and store the first data sequence into the global buffer; If the public toilet data collected by different sensors does not exceed the corresponding data threshold, the environmental quality index of the target public toilet is determined based on the first data sequence in the global buffer. When the environmental quality index exceeds the configured environmental quality index threshold, the ventilation equipment configured in the target public toilet is adjusted according to the environmental quality index. After storing the first data sequence into the global buffer, the method further includes: If any public toilet data exceeds the corresponding data threshold, the alarm start time is determined based on the data collection time of the public toilet data, and an alarm prompt for the corresponding public toilet data is generated. Calculate the target difference between the public toilet data and the data threshold; Based on the correspondence between different configuration differences and different adjustment parameters, the adjustment parameter corresponding to the target difference is determined, and the ventilation equipment corresponding to the public toilet data is adjusted through the adjustment parameter. When the public toilet data does not exceed the corresponding data threshold, the alarm end time is determined based on the data collection time, and the alarm prompt ends. After determining the alarm start time and the alarm end time, the method further includes: The alarm period is determined based on the alarm start time and the alarm end time; Statistical analysis is performed on all public toilet data corresponding to the alarm period to obtain a second data sequence of the time-varying public toilet data. Based on the changing trends of each public toilet data in the second data sequence, new adjustment parameters are determined.

2. The method as described in claim 1, characterized in that, The public toilet data in the protocol buffer are sorted to obtain the first data sequence corresponding to the protocol buffer, including: For any public toilet data, the time dimension factor, space dimension factor and environmental dimension factor corresponding to the public toilet data are calculated to obtain the target weight of the public toilet data; Based on the target weights of each public toilet data point, the data points are sorted to obtain a first data sequence composed of multiple public toilet data points.

3. The method as described in claim 2, characterized in that, The target weights for obtaining the public toilet data include: The configured weighting algorithm is used to calculate the time dimension factor, spatial dimension factor and environmental dimension factor corresponding to the public toilet data to obtain the target weight of the public toilet data; The weighting algorithm is as follows: Among them, W total For target weights, W time Time dimension factor, W space For spatial dimension factor, W env Environmental dimension factors.

4. The method as described in claim 1, characterized in that, The public toilet data includes gas data, temperature and humidity data, and pedestrian flow data.

5. The method as described in claim 4, characterized in that, The methods for determining the data threshold corresponding to the gas data include: Based on the configured threshold algorithm, the flow of people at the configured base value and the time interval is calculated to determine the data threshold corresponding to the gas data; The threshold algorithm is as follows: Where W is the data threshold, β 0 is the base threshold, Q is the number of people, β 1 represents the increment of the data threshold by the number of people, and λ represents the rate at which the data threshold increases with the number of people.

6. A public toilet environment management device based on the Internet of Things, characterized in that, This system is applied to a data monitoring system, which includes: a data buffer platform, comprising device buffers corresponding to each sensor, multiple protocol buffers grouped according to protocol type, and a global buffer; the device includes: The acquisition unit is used to acquire public toilet data collected by different sensors in the target public toilet according to the configured time interval; The processing unit is used to store the data of each public toilet into the corresponding device buffer. In addition, the public toilet data in each device buffer is classified and processed to obtain public toilet data of different protocol types, and the public toilet data of the same category is stored in the corresponding protocol buffer; The sorting unit is used to sort the public toilet data in any protocol buffer to obtain the first data sequence corresponding to the protocol buffer, and store the first data sequence into the global buffer. The processing unit is configured to determine the environmental quality index of the target public toilet based on the first data sequence in the global buffer if the public toilet data collected by different sensors does not exceed the corresponding data threshold, and adjust the ventilation equipment configured in the target public toilet according to the environmental quality index when the environmental quality index exceeds the configured environmental quality index threshold. After storing the first data sequence into the global buffer, the method further includes: If any public toilet data exceeds the corresponding data threshold, the alarm start time is determined based on the data collection time of the public toilet data, and an alarm prompt for the corresponding public toilet data is generated. Calculate the target difference between the public toilet data and the data threshold; Based on the correspondence between different configuration differences and different adjustment parameters, the adjustment parameter corresponding to the target difference is determined, and the ventilation equipment corresponding to the public toilet data is adjusted through the adjustment parameter. When the public toilet data does not exceed the corresponding data threshold, the alarm end time is determined based on the data collection time, and the alarm prompt ends. After determining the alarm start time and the alarm end time, the method further includes: The alarm period is determined based on the alarm start time and the alarm end time; Statistical analysis is performed on all public toilet data corresponding to the alarm period to obtain a second data sequence of the time-varying public toilet data. Based on the changing trends of each public toilet data in the second data sequence, new adjustment parameters are determined.

7. An electronic device, characterized in that, The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Intelligent system and method for environmental sanitation monitoring

    CN117522198A