Electricity utilization detection method based on Internet of Things and Internet of Things system
By selectively deploying power consumption detection terminals and cloud platforms to process power consumption data, the Internet of Things power monitoring system has solved the problem of insufficient support and data security in three-phase power application scenarios, and flexible monitoring and data security protection of three-phase power is realized, abnormal power consumption behavior is discovered in a timely manner, and energy waste and safety hazards are reduced.
Patent Information
- Application Number
- CN202510538110.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-07-18
AI Technical Summary
The existing IoT power monitoring system lacks support in three-phase power application scenarios, and there are safety hazards during data transmission.
The power detection terminal is adopted to selectively deploy, and the power consumption data is collected in real time using the power monitoring chip and the main control chip, upload it to the cloud platform through the narrowband Internet of Things wireless communication module, and data processing and abnormal power consumption behavior monitoring are carried out on the cloud platform. Data security is protected using an asymmetric encryption algorithm, and abnormal power consumption behavior is identified in combination with the XGBoost model, and monitoring results are displayed through the web.
It realizes flexible monitoring of the three-phase electrical environment, ensures data security, can promptly detect and deal with abnormal electricity use behaviors, and reduces energy waste and safety hazards.
Smart Images

Figure CN120343052A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of the Internet of Things, and particularly to an electricity consumption detection method based on the Internet of Things and an Internet of Things system. Background Art
[0002] In traditional electricity consumption monitoring systems, limited by technical conditions and design concepts, there are often problems such as untimely data collection and inaccurate detection of abnormal electricity consumption behaviors. These systems usually rely on manual meter reading or regular inspections to collect electricity consumption data. This method is not only time-consuming and laborious, but also has a low data update frequency and is difficult to reflect the changes in electricity consumption status in a timely manner. At the same time, due to the lack of an intelligent abnormal detection mechanism, traditional systems often cannot accurately identify and handle abnormal situations during electricity consumption, such as overload and leakage. This not only may lead to energy waste, but also may pose potential safety hazards and threaten people's lives and property safety.
[0003] With the rapid development of the Internet of Things technology, more and more electricity consumption monitoring solutions begin to use the Internet of Things technology to achieve remote and real-time monitoring of electricity consumption data. The Internet of Things technology can realize real-time monitoring and intelligent management of electricity consumption data by integrating sensors, wireless communication, cloud computing, and big data analysis technologies. This technology not only improves the timeliness and accuracy of data collection, but also makes electricity consumption monitoring more intelligent and automated. Through the Internet of Things technology, users can view electricity consumption data, understand the electricity consumption status, and promptly discover and handle abnormal electricity consumption behaviors at any time and place through mobile phones or computers, thereby effectively reducing energy waste and potential safety hazards.
[0004] Although the Internet of Things technology has made remarkable progress in the field of electricity consumption monitoring, there are still some deficiencies in existing Internet of Things electricity consumption monitoring systems. Among them, the most prominent one is the insufficient support for three-phase electricity application scenarios. Three-phase electricity is a common power supply method in industrial and commercial electricity consumption, and its electrical parameters are complex and variable, requiring more precise monitoring and management. However, most existing Internet of Things electricity consumption monitoring systems can only monitor single-phase electricity and have insufficient support for three-phase electricity application scenarios, unable to meet the diverse needs of users for three-phase electricity monitoring. In addition, data may also face the risk of being stolen or tampered with during transmission, threatening user privacy and data security.
[0005] Therefore, the present invention proposes an electricity consumption detection method based on the Internet of Things and an Internet of Things system, which integrates advanced sensor technology, wireless communication, cloud computing, big data analysis, and artificial intelligence algorithms, aiming to achieve remote, real-time, and precise monitoring and management of electricity consumption data. Summary of the Invention
[0006] The object of the present invention is to propose an electricity consumption detection method and an Internet of Things system based on the Internet of Things to solve the problems of insufficient support for three-phase electricity application scenarios and easy theft of data during the data transmission process in the prior art.
[0007] To achieve the above object, the present invention adopts the following technical solutions: An electricity consumption detection method based on the Internet of Things, comprising the following steps: Step S1, selectively deploy electricity consumption detection terminals according to different electricity consumption scenarios; Step S2, use the electricity consumption detection terminals to collect electricity consumption data in real time, and use the wireless sensing module to transmit the collected data to the cloud platform at regular intervals; Step S3, on the cloud platform, use data processing algorithms to process and analyze the received electricity consumption data, and monitor abnormal electricity consumption behaviors in real time; Step S4, manage, visualize and display the monitoring results through the Web side, so that users can intuitively view the electricity consumption data and abnormal electricity consumption behaviors.
[0008] Further, in step S1, the following sub-steps are further included: S1-1, determine whether it is necessary to collect electrical parameters of single-phase electricity or three-phase electricity according to the electricity consumption type and equipment configuration of the area to be monitored; S1-2, select a suitable acquisition terminal device according to the determined electricity consumption scenario, and the acquisition terminal device includes a power monitoring chip ATT7022E and a main control chip STM32F103C8T6 adapted to the single-phase electricity or three-phase electricity environment; S1-3, install the selected acquisition terminal device into the distribution box of the area or device to be monitored, ensure that the total incoming line of the air switch is connected to the incoming line of the acquisition terminal, and the outgoing line of the air switch is connected to the outgoing line of the acquisition terminal; S1-4, configure the parameters of the narrowband Internet of Things NB-IoT wireless communication module for the acquisition terminal device to ensure that the terminal device can upload the collected electricity consumption data to the cloud platform through the MQTT protocol at regular intervals.
[0009] Further, in step S2, the following sub-steps are further included: S2-1, the main control chip initializes the system clock, interrupt, timer and serial port, and initializes the peripheral devices NB-IoT wireless communication module and power monitoring chip; S2-2, the electricity consumption detection terminal searches for the NB-IoT network, and after the network connection is successful, sends the collected electricity consumption data to the wireless communication module through the serial port at a set time interval, and the electricity consumption data includes current, voltage and power data; S2-3. The wireless communication module connects to the cloud platform via AT commands and uses the MQTT protocol to send electricity consumption data to the cloud platform for storage and processing; S2-4. During the data upload process, an asymmetric encryption algorithm is used to encrypt the collected electricity consumption information. After the cloud platform receives the data, the corresponding decryption algorithm is used for decryption. The specific formula is:
[0010] Among them, C represents the ciphertext; Epub represents the public key encryption function; P represents the plaintext, and Dpri represents the private key decryption function.
[0011] Furthermore, in step S3, the following sub-steps are also included: S3-1. Clean the received electricity consumption data to remove invalid or abnormal data. The invalid or abnormal data includes missing values, duplicate values, and data that significantly deviates from the normal range; S3-2. Extract basic features and time series-based derived features from the cleaned electricity consumption data. The basic features include current, voltage, and power. The time series-based derived features include maximum value, minimum value, average value, and volatility; S3-3. Use historical electricity consumption data and known abnormal electricity consumption behavior labels to train the eXtreme GradientBoosting (XGBoost) model so that the model can identify and predict abnormal electricity consumption behavior. The specific formula is:
[0012] Among them, represents the objective function at the t-th iteration, m is the total number of samples, l(·) is the error function, represents the predicted value of the t-th tree for the i-th sample, represents the true value of the i-th sample, is the predicted value given by the model for sample i at step t - 1, is the regularization term, which controls the complexity of the tree; S3-4. Input the real-time received electricity consumption data into the trained XGBoost model for real-time monitoring of abnormal electricity consumption behavior and output the prediction result; S3-5. According to the prediction result of the XGBoost model, determine whether there is abnormal electricity consumption behavior. If so, trigger the alarm mechanism and send the abnormal information to relevant personnel or systems for timely processing.
[0013] Furthermore, in step S4, the following sub-steps are also included: S4-1. The Web end receives the electricity consumption data and the monitoring results of abnormal electricity consumption behaviors sent by the cloud platform, sorts out the received electricity consumption data, classifies it according to different time dimensions and electricity consumption scenarios, and stores it in the database; S4-2. Provide a historical data query function, allowing users to query historical electricity consumption data and abnormal electricity consumption behavior records through conditions for electricity consumption behavior analysis and energy conservation management; S4-3. According to the characteristics of electricity consumption data and abnormal electricity consumption behaviors, design visual charts and interfaces to intuitively display the trends and characteristics of electricity consumption data and abnormal electricity consumption behaviors. The visual charts and interfaces include line charts, bar charts, pie charts, and scatter plots; S4-4. Provide a user interaction interface on the Web end, allowing users to perform operations such as zooming in, zooming out, and dragging on the displayed data and charts, and providing feedback and handling suggestions for abnormal electricity consumption behaviors.
[0014] The present invention provides an electricity consumption detection system based on the Internet of Things, including: An electricity consumption detection terminal, a cloud platform, and a Web end; The electricity consumption detection terminal is used to collect electricity consumption data in real time and transmit the data to the cloud platform through a wireless sensing module; The cloud platform is used to receive, store, and process the data transmitted by the electricity consumption detection terminal, and use data processing algorithms to monitor abnormal electricity consumption behaviors in real time; The Web end is used to display the electricity consumption data and the monitoring results of abnormal electricity consumption behaviors processed by the cloud platform, and provide data management, visualization, and user interaction functions.
[0015] The beneficial effects brought by the technical solution provided by the present invention at least include: The method of the present invention selectively deploys electricity consumption detection terminals according to different electricity consumption scenarios; collects electricity consumption data in real time through the electricity consumption detection terminal, and uses a wireless sensing module to transmit the collected data to the cloud platform at regular intervals; on the cloud platform, uses data processing algorithms to process and analyze the received electricity consumption data, and monitors abnormal electricity consumption behaviors in real time; and manages, visualizes, and displays the monitoring results through the Web end, enabling users to intuitively view the electricity consumption data and abnormal electricity consumption behaviors.
[0016] The electricity consumption detection system based on the Internet of Things of the present invention includes an electricity consumption detection terminal, a cloud platform, and a Web end; the electricity consumption detection terminal is used to collect electricity consumption data in real time and transmit the data to the cloud platform through a wireless sensing module; the cloud platform is used to receive, store, and process the data transmitted by the electricity consumption detection terminal, and use data processing algorithms to monitor abnormal electricity consumption behaviors in real time; the Web end is used to display the electricity consumption data and the monitoring results of abnormal electricity consumption behaviors processed by the cloud platform, and provide data management, visualization, and user interaction functions.
[0017] The method of the present invention can be flexibly deployed according to different electricity usage scenarios. It can collect electrical parameters of single-phase electricity and is also applicable to three-phase electricity environments, ensuring wide applicability and monitoring accuracy. This flexibility enables the system to adapt to different scales and types of electricity networks, providing users with customized electricity usage monitoring solutions.
[0018] By combining Internet of Things technology with advanced sensor devices, the present invention realizes real-time monitoring and data analysis of electricity usage, can accurately capture the energy consumption details of each electrical device, and thus provides users with detailed electricity usage reports.
[0019] The method of the present invention can significantly improve energy management efficiency. Through a large amount of electricity usage data collected by the Internet of Things system, users and managers can promptly discover energy waste phenomena, and then take targeted measures for optimization, effectively reducing unnecessary energy consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for description in the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 It is a flowchart of the method provided in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] To further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following, in combination with the drawings and preferred embodiments, details the specific implementation manners, structures, features, and effects of the Internet of Things-based electricity usage detection method and Internet of Things system proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0024] The following embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention.
[0025] The following specifically describes the specific solutions of the Internet of Things-based electricity usage detection method and Internet of Things system provided by the present invention in combination with the drawings.
[0026] Embodiment Please refer to Figure 1 , which shows the method flow chart of the power consumption detection method based on the Internet of Things provided by an embodiment of the present invention. The method includes the following steps: Step S1: Selectively deploy power consumption detection terminals according to different power consumption scenarios; Among them, in step S1, the following sub-steps are further included: S1-1: Determine whether it is necessary to collect electrical parameters of single-phase electricity or three-phase electricity according to the power consumption type and equipment configuration of the area to be monitored; S1-2: Select a suitable acquisition terminal device according to the determined power consumption scenario. The acquisition terminal device includes selecting a power monitoring chip ATT7022E adapted to the single-phase or three-phase electricity environment and a main control chip STM32F103C8T6; S1-3: Install the selected acquisition terminal device into the distribution box of the area or equipment to be monitored, ensure that the total incoming line of the air switch is connected to the incoming line of the acquisition terminal, and the outgoing line of the air switch is connected to the outgoing line of the acquisition terminal; S1-4: Configure the parameters of the narrowband Internet of Things NB-IoT wireless communication module for the acquisition terminal device to ensure that the terminal device can regularly upload the collected power consumption data to the cloud platform through the MQTT protocol.
[0027] It should be noted that single-phase electricity is usually used in households and small commercial places, and its voltage is usually 220V or 110V. Three-phase electricity is mainly used in large industrial and commercial equipment, and its voltage is usually 380V or higher, with higher power transmission capacity.
[0028] The power monitoring chip ATT7022E is a high-precision power metering chip suitable for collecting electrical parameters of single-phase or three-phase electricity; the main control chip STM32F103C8T6 is a powerful main control chip responsible for data processing and communication.
[0029] The acquisition terminal device should be installed in the distribution box of the area or equipment to be monitored to ensure that electrical parameters can be accurately collected. During the installation process, it is necessary to ensure that the total incoming line of the air switch is connected to the incoming line of the acquisition terminal, and the outgoing line of the air switch is connected to the outgoing line of the acquisition terminal, so as to ensure that the collected data is accurate and will not affect the original circuit.
[0030] NB-IoT is a narrowband Internet of Things technology with the advantages of low power consumption, wide coverage, and low cost, and is suitable for Internet of Things applications that transmit low-frequency and small data volumes.
[0031] After the parameters of the NB-IoT wireless communication module are configured, the acquisition terminal device can periodically upload the acquired current, voltage, and power data to the cloud platform through the MQTT protocol. MQTT is a lightweight message transmission protocol suitable for remote communication and data transmission of Internet of Things devices.
[0032] Step S2: Real-time collect power consumption data through the power consumption detection terminal, and use the wireless sensing module to periodically transmit the collected data to the cloud platform; Among them, in step S2, the following sub-steps are also included: S2-1, the main control chip initializes the system clock, interrupt, timer, and serial port, and initializes the peripheral devices, namely the NB-IoT wireless communication module and the power monitoring chip; S2-2, the power consumption detection terminal searches for the NB-IoT network, and after the network connection is successful, it sends the collected power consumption data to the wireless communication module through the serial port at the set time interval. The power consumption data includes current, voltage, and power data; S2-3, the wireless communication module connects to the cloud platform through AT commands, and uses the MQTT protocol to send the power consumption data to the cloud platform for storage and processing; S2-4, during the data upload process, the asymmetric encryption algorithm is used to encrypt the collected power consumption information. After the cloud platform receives the data, the corresponding decryption algorithm is used for decryption. The specific formula is:
[0033] Among them, C represents the ciphertext; Epub represents the public key encryption function; P represents the plaintext, and Dpri represents the private key decryption function.
[0034] It should be noted that the main control chip initialization includes setting the system clock frequency, configuring the interrupt priority, starting the timer, and initializing the serial port communication parameters (baud rate, data bits, stop bits); the initialization of peripheral devices means that the NB-IoT wireless communication module and the power monitoring chip are correctly configured and initialized to ensure normal operation, including setting the working mode, baud rate, and network parameters of the module.
[0035] Searching for the NB-IoT network is a process in which the power consumption detection terminal scans and connects to an available NB-IoT network, which is a communication and authentication process with the base station. Once the network connection is successful, the power consumption detection terminal will send the collected current, voltage, and power data to the NB-IoT wireless communication module through the serial port at the set time interval (per minute).
[0036] The NB-IoT wireless communication module establishes a connection with the cloud platform through the AT command set. The AT command is a command set used to control the modem.
[0037] The MQTT protocol is a lightweight message transmission protocol based on the publish-subscribe model, suitable for communication between Internet of Things (IoT) devices. The NB-IoT wireless communication module uses the MQTT protocol to send electricity consumption data to the cloud platform.
[0038] The asymmetric encryption algorithm selects RSA and uses a pair of keys (public key and private key) for encryption and decryption operations. The public key is used to encrypt data, while the private key is used to decrypt data.
[0039] Step S3: On the cloud platform, use data processing algorithms to process and analyze the received electricity consumption data, and monitor abnormal electricity consumption behaviors in real time; Among them, in step S3, the following sub-steps are also included: S3-1: Clean the received electricity consumption data to remove invalid or abnormal data. Invalid or abnormal data includes missing values, duplicate values, and data that significantly deviates from the normal range; S3-2: Extract basic features and time-series-based derived features from the cleaned electricity consumption data. Basic features include current, voltage, and power, and time-series-based derived features include maximum value, minimum value, average value, and volatility; S3-3: Use historical electricity consumption data and known abnormal electricity consumption behavior labels to train the eXtreme Gradient Boosting (XGBoost) model so that the model can identify and predict abnormal electricity consumption behaviors. The specific formula is:
[0040] Among them, represents the objective function at the t-th iteration, m is the total number of samples, l(·) is the error function, represents the predicted value of the t-th tree for the i-th sample, represents the true value of the i-th sample, is the predicted value given by the model for sample i at step t - 1, is the regularization term that controls the complexity of the tree; S3-4: Input the real-time received electricity consumption data into the trained XGBoost model for real-time monitoring of abnormal electricity consumption behaviors and output the prediction results; S3-5: Determine whether there is an abnormal electricity consumption behavior according to the prediction results of the XGBoost model. If so, trigger the alarm mechanism and send the abnormal information to relevant personnel or systems for timely processing.
[0041] It should be noted that missing values are empty values caused by equipment failure or data transmission problems; duplicate values are data recorded repeatedly due to system errors; and data that deviates significantly from the normal range are extreme values caused by equipment abnormalities or human interference.
[0042] The basic features reflect the basic physical quantities of electricity consumption, and the derived features based on time series can reflect the changing trend and stability of electricity consumption data over time.
[0043] The eXtreme Gradient Boosting (XGBoost) model is an efficient gradient boosting algorithm that can handle large-scale data and has good generalization ability and predictive performance.
[0044] Step S4: Manage, visualize and display the monitoring results through the Web end, so that users can intuitively view the power consumption data and abnormal power consumption behavior; Wherein step S4 also includes the following sub-steps: S4-1, the Web terminal receives the power consumption data and abnormal power consumption behavior monitoring results sent by the cloud platform, organizes the received power consumption data, classifies them according to different time dimensions and power consumption scenarios, and stores them in the database; S4-2, provides historical data query function, allowing users to query historical power consumption data and abnormal power consumption behavior records by conditions, and conduct power consumption behavior analysis and energy-saving management; S4-3, based on the characteristics of electricity consumption data and abnormal electricity consumption behavior, design visualization charts and interfaces to intuitively display the trends and characteristics of electricity consumption data and abnormal electricity consumption behavior. The visualization charts and interfaces include line charts, bar charts, pie charts, and scatter plots; S4-4 provides a user interaction interface on the Web, allowing users to zoom in, zoom out, and drag displayed data and charts, as well as provide feedback and processing suggestions for abnormal power consumption behavior.
[0045] It should be noted that the received data is classified according to different time dimensions including hours, days, weeks, months, and years; and the received data is classified according to different electricity consumption scenarios including household electricity consumption, industrial electricity consumption, and commercial electricity consumption.
[0046] The web terminal provides a historical data query function. Users can analyze the trends and characteristics of electricity usage behavior by querying historical data, discover problems and deficiencies in the electricity usage process, and thus formulate effective energy-saving measures and electricity usage behavior optimization strategies. The query conditions include time range, electricity usage scenario, and abnormal behavior type.
[0047] Line charts are used to show the changing trends of electricity consumption data over time; bar charts are used to compare electricity consumption data at different times or in different scenarios; pie charts are used to show the distribution ratios of electricity consumption data; scatter plots are used to show the correlation between electricity consumption data and abnormal behaviors.
[0048] The Web end provides a user interaction interface. The interface design focuses on user experience and interactivity, enabling users to easily understand and use these visualization charts and interfaces; users can provide feedback on abnormal electricity consumption behaviors through the interaction interface, including confirming abnormalities and providing handling suggestions; the system will provide targeted handling suggestions based on users' feedback and the characteristics of electricity consumption data, including adjusting electricity consumption plans and replacing energy-saving devices.
[0049] This embodiment provides an electricity consumption detection system based on the Internet of Things, which is characterized by including: An electricity consumption detection terminal, a cloud platform, and a Web end; The electricity consumption detection terminal is used to collect electricity consumption data in real time and transmit the data to the cloud platform through a wireless sensing module; The cloud platform is used to receive, store, and process the data transmitted by the electricity consumption detection terminal, and use data processing algorithms to monitor abnormal electricity consumption behaviors in real time; The Web end is used to display the electricity consumption data processed by the cloud platform and the monitoring results of abnormal electricity consumption behaviors, and provide data management, visualization, and user interaction functions.
[0050] I. Electricity consumption detection terminal: The electricity consumption detection terminal adopts a modular design and includes a power supply circuit, a main control module, a wireless communication module, and an electric energy detection module; The power supply circuit is responsible for providing a stable power supply for the entire electricity consumption detection terminal; The main control module, as the core processor, is responsible for controlling the working processes of each module, as well as data collection and processing; The wireless communication module adopts the low-power and long-distance communication technology NB-IoT to ensure that electricity consumption data can be stably transmitted to the cloud platform; The electric energy detection module is responsible for collecting key parameters of electrical equipment in real time, providing basic data for subsequent data processing and monitoring of abnormal electricity consumption behaviors.
[0051] It should be noted that the power supply circuit is the energy supply center of the electricity consumption detection terminal, responsible for converting external power (alternating current or direct current) into a stable direct current voltage to provide the required power for each module inside the terminal. The main control module is the core processor of the electricity consumption detection terminal, responsible for controlling the working processes of each module, including data collection, processing, storage, and transmission. The performance of the main control module directly affects the response speed, data processing ability, and stability of the electricity consumption detection terminal.
[0052] NB-IoT is a low-power, long-distance wireless communication technology designed specifically for Internet of Things applications. It features wide coverage, stable connections, and low power consumption, making it very suitable for remote communication of electricity consumption detection terminals. The wireless communication module sends electricity consumption data to the cloud platform through NB-IoT technology, and the cloud platform then processes and analyzes the data.
[0053] The electricity energy detection module is responsible for real-time collection of key parameters of electrical equipment, including voltage, current, and power factor. These are the basic data for subsequent data processing and monitoring of abnormal electricity consumption behaviors. By monitoring these parameters, abnormal situations of electrical equipment can be detected in a timely manner.
[0054] II. Cloud Platform: The cloud platform is deployed in Docker containers and includes an EMQX server, a Node-RED server, a MySQL database, an Nginx server, and Python software; The EMQX server, as an MQTT protocol proxy server, is responsible for receiving electricity consumption data sent by the perception layer; The Node-RED server transfers the received electricity consumption data to the MySQL database; The MySQL database is a relational database used to store electricity consumption data; The Nginx server is used to run web applications, enabling access to the web end anytime, anywhere; The Python software is used to implement electricity consumption behavior learning algorithms, analyze and process electricity consumption data to detect abnormal electricity consumption behaviors.
[0055] It should be noted that the cloud platform is an environment integrating multiple services and software. These services and software work together to process, store, and analyze data. The cloud platform is deployed in Docker containers, which means that all services run in a lightweight and portable manner, facilitating management and expansion.
[0056] Docker containers are a lightweight and portable software packaging technology that allows developers to package an application and its dependencies into an executable container. The container can run in any environment that supports Docker, ensuring environmental consistency and portability.
[0057] EMQX is an open-source distributed Internet of Things message middleware developed based on the Erlang / OTP language, featuring high availability, high performance, and scalability, and capable of handling a large number of concurrent connections and data transmissions.
[0058] Node-RED is a browser-based visual programming tool for connecting hardware devices, APIs, and services. It provides a rich node library that makes data flow processing and conversion simple and intuitive, and supports the rapid construction of complex data processing flows by dragging and dropping nodes.
[0059] MySQL is an open source relational database management system used to store and manage data. It has high performance, high reliability, and is easy to use, and can meet the needs of large-scale data storage and query.
[0060] Nginx is a high-performance HTTP and reverse proxy web server, also used as an email proxy server (IMAP / POP3). It is lightweight, has high concurrent processing capabilities, and has good stability. It is the preferred server for building high-performance Web applications.
[0061] Python is a widely used high-level programming language that is easy to learn and has highly readable code. Python has a rich data processing and machine learning library, making the implementation of data analysis and machine learning tasks simple and efficient.
[0062] 3. Web: The web client adopts responsive design to ensure a good user experience on different devices and browsers. Users can register and log in through the web client. After registration, users can view and manage their own electricity consumption data, including historical electricity consumption information and real-time electricity consumption data; The web terminal provides intuitive charts and graphical interfaces to display users' electricity consumption data in real time, helping users to intuitively understand the current electricity consumption situation and trends. The charts and graphical interfaces include power consumption curves and peak and valley analysis. The web side provides user interaction functions, including online customer service support and user feedback channels, so that users can get help or make suggestions for improvements during use.
[0063] It should be noted that responsive design means that the web side can automatically adjust its layout, font size, and pictures to adapt to the screen size and resolution of different devices, including mobile phones, tablets, laptops, and desktop computers; the web side can display and interact normally on mainstream browsers without layout errors or functional failures.
[0064] The ability for users to register and log in through the Web is a prerequisite for using the Web to manage electricity consumption data. The registration process should be simple and clear, and sufficient verification measures should be provided to ensure the authenticity of user information.
[0065] Registered users can view their electricity consumption data, including historical electricity consumption information and real-time electricity consumption data; users can also manage the electricity consumption data, including exporting data and setting data reminders, which can help users better understand their electricity consumption situation and formulate reasonable electricity consumption plans.
[0066] The electricity consumption curve is a way to intuitively display the user's electricity consumption situation. Through the curve graph, users can clearly see the daily electricity consumption situation and the changes in electricity consumption in different time periods, which helps users understand the electricity consumption pattern and formulate reasonable electricity consumption plans.
[0067] Peak-valley analysis of electricity consumption refers to the statistical analysis of the peaks and valleys of the user's electricity consumption data. Through this analysis, users can understand which time periods have higher electricity consumption and which time periods have lower electricity consumption, which helps users optimize their electricity consumption plans and reduce electricity bills.
[0068] The Web side provides an online customer service support function. When users encounter problems during use, they can contact the customer service staff for help at any time. The customer service staff should have professional knowledge and be able to answer users' questions quickly and accurately.
[0069] The Web side provides user feedback channels. Users can put forward their opinions, suggestions or questions through these channels. The platform can listen to the user feedback and make improvements and optimizations according to the actual situation.
[0070] In this way, the electricity consumption detection method and the Internet of Things system based on the Internet of Things can realize real-time monitoring of abnormal electricity consumption behaviors, quickly process and accurately judge the collected electricity consumption data, which helps prevent electrical fires, reduce energy waste, and improve electricity consumption safety.
[0071] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An electricity consumption detection method based on the Internet of Things, characterized in that, The method includes: Step S1, selectively deploying power consumption detection terminals according to different power usage scenarios; Step S2, collecting power consumption data in real time through the power consumption detection terminals, and using a wireless sensing module to transmit the collected data to the cloud platform at regular intervals; Step S3, on the cloud platform, using data processing algorithms to process and analyze the received power consumption data, and monitoring abnormal power usage behaviors in real time; Step S4, performing data management, visualization, and display of the monitoring results through the Web end, enabling users to intuitively view power consumption data and abnormal power usage behaviors; Among them, in Step S3, the following sub-steps are also included: S3-1, cleaning the received power consumption data to remove invalid or abnormal data, where the invalid or abnormal data includes missing values, duplicate values, and data significantly deviating from the normal range; S3-2, extracting basic features and time series-based derivative features from the cleaned power consumption data, where the basic features include current, voltage, and power, and the time series-based derivative features include maximum value, minimum value, average value, and volatility; S3-3, using historical power consumption data and known abnormal power usage behavior labels to train an eXtreme Gradient Boosting (XGBoost) model so that the model can identify and predict abnormal power usage behaviors. The specific formula is: Among them, represents the objective function at the t-th iteration, m is the total number of samples, and l(·) is the error function. represents the predicted value of the t-th tree for the i-th sample. represents the true value of the i-th sample. is the predicted value given by the model for sample i at step t - 1. is the regularization term that controls the complexity of the tree. S3-4, inputting the real-time received power consumption data into the trained XGBoost model for real-time monitoring of abnormal power usage behaviors and outputting prediction results; S3-5, determining whether there are abnormal power usage behaviors according to the prediction results of the XGBoost model. If so, trigger an alarm mechanism and send the abnormal information to relevant personnel or systems for timely processing.
2. The IoT-based power consumption detection method according to claim 1, characterized in that: Among them, in Step S1, the following sub-steps are also included: S1-1, determining whether it is necessary to collect electrical parameters of single-phase electricity or three-phase electricity according to the power usage type and equipment configuration in the area to be monitored; S1-2, selecting a suitable collection terminal device according to the determined power usage scenario. The collection terminal device includes selecting a power monitoring chip ATT7022E and a main control chip STM32F103C8T6 adapted to the single-phase electricity or three-phase electricity environment; S1-3, installing the selected collection terminal device into the distribution box of the area or equipment to be monitored, ensuring that the total incoming line of the air switch is connected to the incoming line of the collection terminal, and the outgoing line of the air switch is connected to the outgoing line of the collection terminal; S1-4, configuring the parameters of the narrowband Internet of Things (NB-IoT) wireless communication module for the collection terminal device to ensure that the terminal device can upload the collected power consumption data to the cloud platform through the MQTT protocol at regular intervals.
3. The IoT-based power consumption detection method according to claim 1, characterized in that: Among them, in Step S2, the following sub-steps are also included: S2-1, the main control chip initializes the system clock, interrupt, timer, and serial port, and initializes the peripheral devices NB-IoT wireless communication module and power monitoring chip; S2-2. The power consumption detection terminal searches for the NB-IoT network, and after successful network connection, it sends the collected power consumption data, including current, voltage, and power data, to the wireless communication module at a set time interval through the serial port. S2-3. The wireless communication module connects to the cloud platform via AT commands and uses the MQTT protocol to send the power consumption data to the cloud platform for storage and processing. S2-4. During the data upload process, the asymmetric encryption algorithm is used to encrypt the collected power consumption information. After receiving the data, the cloud platform decrypts it using the corresponding decryption algorithm. The specific formula is: Among them, C represents the ciphertext; Epub represents the public-key encryption function; P represents the plaintext, and Dpri represents the private-key decryption function.
4. The power consumption detection method based on the Internet of Things according to claim 1, wherein: In step S4, the following sub-steps are further included: S4-1. The Web end receives the power consumption data and the monitoring results of abnormal power consumption behaviors sent by the cloud platform, sorts out the received power consumption data, classifies it according to different time dimensions and power consumption scenarios, and stores it in the database. S4-2. Provide a historical data query function, allowing users to query historical power consumption data and abnormal power consumption behavior records through conditions for power consumption behavior analysis and energy-saving management. S4-3. According to the characteristics of the power consumption data and abnormal power consumption behaviors, design visual charts and interfaces to intuitively display the trends and characteristics of the power consumption data and abnormal power consumption behaviors. The visual charts and interfaces include line charts, bar charts, pie charts, and scatter plots. S4-4. Provide a user interaction interface on the Web end, allowing users to perform operations such as zooming in, zooming out, and dragging on the displayed data and charts, and providing feedback and processing suggestions for abnormal power consumption behaviors.
5. An electricity consumption detection system based on the Internet of Things, characterized in that, It includes: The power consumption detection terminal, the cloud platform, and the Web end; The power consumption detection terminal is used to collect power consumption data in real time and transmit the data to the cloud platform through the wireless sensing module; The cloud platform is used to receive, store, and process the data transmitted by the power consumption detection terminal, and use data processing algorithms to monitor abnormal power consumption behaviors in real time; The Web end is used to display the power consumption data and the monitoring results of abnormal power consumption behaviors processed by the cloud platform, and provide data management, visualization, and user interaction functions; The power consumption detection terminal adopts a modular design, including a power supply circuit, a main control module, a wireless communication module, and an electric energy detection module; The power supply circuit is responsible for providing stable power supply for the entire power consumption detection terminal; The main control module, as the core processor, is responsible for controlling the working processes of each module and the collection and processing of data; The wireless communication module adopts the low-power, long-distance communication technology NB-IoT to ensure that the power consumption data can be stably transmitted to the cloud platform; The electric energy detection module is responsible for collecting the key parameters of the power consumption equipment in real time, providing basic data for subsequent data processing and abnormal power consumption behavior monitoring; The cloud platform is deployed in a Docker container, including an EMQX server, a Node-RED server, a MySQL database, an Nginx server, and Python software; The EMQX server, as the proxy server of the MQTT protocol, is responsible for receiving the power consumption data sent by the perception layer; The Node-RED server transfers the received electricity consumption data flow to the MySQL database; The MySQL database is a relational database used to store electricity consumption data; The Nginx server is used to run the Web application to enable access to the Web at any time and anywhere; The Python software is used to implement the electricity consumption behavior learning algorithm to analyze and process the electricity consumption data to detect abnormal electricity consumption behaviors; The Web side adopts a responsive design to ensure a good user experience on different devices and browsers. Users can register and log in through the Web side. After registration, users can view and manage their own electricity consumption data, and the electricity consumption data includes historical electricity consumption information and real-time electricity consumption data; The Web side provides an intuitive chart and graphical interface for real-time visual display of users' electricity consumption data to help users intuitively understand the current electricity consumption situation and trends. The chart and graphical interface include the electricity consumption curve and the analysis of peak and valley electricity consumption; The Web side provides user interaction functions, including online customer service support and user feedback channels, to facilitate users to obtain help or put forward improvement suggestions during use.