Virtual device and variable data processing method for power monitoring
By employing regular expression intelligent parsing and multi-source collaborative storage technology, combined with zero-code rapid binding and secure transmission methods, the problem of efficient management of virtual devices and variables in power monitoring has been solved. This enables rapid querying and secure transmission of power data, reduces development costs, and improves the system's flexibility and scalability.
Patent Information
- Application Number
- CN202511015318.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-28
AI Technical Summary
Traditional low-code visualization platforms struggle to define virtual devices and virtual variables across gateways in power monitoring, resulting in low computational efficiency, high development costs, and difficulty in meeting the high-frequency real-time data query and secure transmission requirements of power monitoring.
It employs regular expression intelligent parsing, multi-source collaborative storage, and zero-code rapid binding technology. It collects data through the MQTT protocol, uses regular expressions to parse virtual variable expressions, and combines in-memory databases, time-series databases, and relational databases for calculation and storage. It also enables fast querying and visualization through a unified API interface and uses the TSN protocol and national cryptographic algorithms to ensure data transmission security.
It enables efficient calculation, secure storage, and rapid querying of power data, reduces development costs, enhances system flexibility and scalability, and meets diverse business needs in power monitoring scenarios.
Smart Images

Figure CN120849495A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power monitoring, specifically to a virtual device and variable data processing method for power monitoring. Background Technology
[0002] In the field of power monitoring, with the advancement of smart grid construction, a large number of power devices such as smart meters, RTUs (Remote Terminal Units), and PLCs (Programmable Logic Controllers) are connected to the system, generating massive amounts of real-time and historical data. Traditional low-code visualization platforms have significant shortcomings in processing power data: First, their virtual variable definition and calculation functions are weak, making it difficult to construct virtual devices and virtual variables across multiple gateways, and thus failing to meet the complex calculation and query needs in power monitoring. Second, calling newly defined virtual variables is difficult, relying on reopening Web API interfaces. For the calculation results of each virtual variable, a corresponding interface needs to be developed to achieve data binding, resulting in high development costs and low efficiency. Third, the real-time data and historical query, binding, and storage methods of defined virtual devices and virtual variables are inefficient, failing to quickly respond to the high-frequency, real-time data query, calculation, alarm, and visualization needs in power monitoring scenarios.
[0003] Furthermore, power monitoring systems have extremely high requirements for data security, real-time performance, and accuracy. Existing technologies struggle to ensure the temporal consistency of data transmission in a distributed environment and lack efficient encryption mechanisms to protect sensitive power data. Therefore, an innovative data processing technology is urgently needed to achieve efficient management, intelligent computation, and secure transmission of virtual power monitoring devices and variables. Summary of the Invention
[0004] This invention proposes a method for processing virtual devices and variable data in power monitoring. Through regular expression intelligent parsing, multi-source collaborative storage, and zero-code rapid binding technology, it addresses the pain points of existing power monitoring systems in areas such as virtual devices and variables, data processing, storage, command issuance, querying, and visualization. It achieves efficient computation, secure storage, and rapid querying of power data, reduces development costs, improves system flexibility and scalability, and meets the diverse business needs of power monitoring scenarios. The technical solution provided by this invention is as follows: Firstly, a method for processing virtual devices and variable data for power monitoring specifically includes the following steps: Step 1: Create the tables elec_circuit_info and elec_circuit_var in the system to maintain virtual devices and virtual variables. Use the IsCollect field to distinguish whether a device is a virtual entity and store the calculated expression of the virtual variable in the Expression field. Step 2: Collect power equipment data using the MQTT protocol and obtain real-time data by listening to the MQTT server using code in other languages; Step 3: Use regular expressions to parse the virtual variable expression. Through predefined regular expression templates, capture the variable type, device code, and time parameters, and automatically map them to the keys in the memory database or the table names in the time series database. After parsing, combine the real-time values, historical data, and metadata of power equipment obtained from the memory database, time series database, and relational database, and perform calculations according to the expression. Step 4: Store the calculated real-time results into the in-memory database using stationid+deviceid+measurementid as the key; store historical calculation results into the time series database, which stores data in sub-tables with a fixed table structure. The sub-tables contain a time field (ts) and a measurement field (value), and the sub-table name consists of stationid+deviceid+measurementid; the relational database is used to store system configuration information, metadata, and post-calculation statistical results. Step 5: Introduce a data-driven framework to the front end. After the system stores the calculation results of the virtual variables into the in-memory database, it automatically identifies and updates the data. Through the reactive principle of the data-driven framework, the virtual variables are bound to the front end display components. Step 6: Develop a unified API interface to retrieve real-time data from the in-memory database or historical data from the corresponding sub-table of the time series database based on the stationid+deviceid+measurementid in the request parameters and the time range parameter. Step 7: Establish an instruction management module and a visual operation interface to enable remote control of virtual devices and processing of virtual variables.
[0005] Preferably, the calculation expression of the virtual variable includes the current displayed value, device attributes, cumulative value difference, rate-related attributes and electricity bill calculation and site key variables.
[0006] Preferably, regular expression parsing is implemented through the following method: When the system starts, a predefined regular expression template library is loaded into memory. When a virtual variable expression is received, a preliminary match is first performed using regular expressions to determine the variable type. If it is a complex expression, the ANTLR parser is started for in-depth parsing. At the same time, the AI big data model analyzes historical expression data in real time. If the current expression is found to be similar to the pattern of historical complex expressions, the regular expression is automatically optimized to improve parsing efficiency and accuracy.
[0007] Preferably, applications in edge computing scenarios are also included, specifically: The system employs the TSN protocol for edge node synchronization; a dynamic path planning algorithm for real-time network status monitoring; encryption using national cryptographic algorithms and transmission via an IPSec VPN tunnel; and device tree resolution technology to automatically adapt to different hardware platforms and databases, ensuring normal data interaction between edge computing nodes and the cloud system.
[0008] Preferably, it also includes dynamically adjusting the pre-computation strategy through a cost-benefit model. The cost-benefit model dynamically selects the pre-computation or real-time calculation strategy based on factors such as the amount of power data, computational complexity, update frequency, data change amount, query mode, and cache hit rate, thereby optimizing the allocation of power data processing resources.
[0009] Secondly, a virtual device and variable data processing system for power monitoring includes: The data acquisition module is used to collect data from power equipment and other relevant IoT data using the MQTT protocol. The real-time data processing module triggers virtual variable calculations through scheduled tasks, integrates multi-source power data, stores the real-time results in the memory database, and inserts time-series data into the time-series database as historical data. The historical data query module calculates and retrieves historical cumulative or aggregated values of electricity from a time-series database through a unified API interface. The formula editor module supports user-defined expressions containing basic operations and aggregate functions, and achieves standardized parsing through regular expression algorithm analysis; The edge computing module uses the TSN protocol for synchronization, combines national cryptographic algorithms and IPSec VPN to ensure the security of power data transmission, and is compatible with different databases and hardware platforms. The instruction management module enables the issuance, reception, execution, and result feedback of virtual device instructions, thereby achieving scene linkage. The data binding module, based on the front-end data-driven framework, enables automatic binding of virtual variables to the front-end display components of power monitoring, without the need to develop additional API interfaces; The adaptive optimization module dynamically adjusts the pre-calculation strategy based on the historical query patterns and update frequency of power data through a cost-benefit model. The unified API interface module receives query requests containing parameters such as stationid, deviceid, measurementid, and time range. Based on these parameters, it retrieves real-time or historical power data from an in-memory database or a time-series database and returns the results.
[0010] Preferably, the unified API interface module specifically includes: The request parsing unit is used to parse the stationid+deviceid+measurementid and time range parameters in the query request; The data source determination unit determines whether to obtain power data from an in-memory database or a time-series database based on the time range parameter. The in-memory database query unit retrieves real-time power data from the in-memory database using stationid+deviceid+measurementid as the key. The time-series database query unit determines the name of the sub-table in the time-series database based on stationid+deviceid+measurementid, and queries historical power data from the corresponding sub-table; The results integration unit integrates the power data obtained from the in-memory database or time-series database according to a unified format and returns it.
[0011] Compared with the prior art, the beneficial effects achieved by the present invention are: By employing regular expression-based intelligent parsing and multi-source collaborative computing, the system enables rapid parsing and complex calculations of power data, meeting the real-time requirements of power monitoring. Zero-code rapid binding and a visual development interface reduce API development workload, lower development costs and time, and improve development efficiency. Support for various virtual variable expression types and multi-source data fusion facilitates the expansion of new functions and the integration of new devices, adapting to changes in power monitoring business. Edge computing, in conjunction with the TSN protocol and national cryptographic encryption technology, ensures secure and timely data transmission, enhancing system reliability. A unified API interface combined with the features of Redis and TDengine databases enables efficient power data querying and rapid response to business needs. Attached Figure Description
[0012] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is the overall architecture diagram of the system of the present invention; Figure 2 This is a power data flow diagram in the system of this invention; Figure 3 This is a diagram of the multi-source data storage architecture of the present invention; Figure 4 This is a flowchart illustrating the zero-code rapid binding implementation of the present invention. Detailed Implementation
[0013] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0014] To make the above-mentioned objectives, features and effects of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0015] Example 1: A virtual device and variable data processing method for power monitoring, such as Figure 1 and Figure 2 As shown, by integrating MQTT, in-memory databases (such as Redis), relational databases (such as MySQL or DM Database), and time-series databases (such as TDengine), and combining a regular expression analyzer with a collaborative parsing mechanism, intelligent definition, calculation, alarm, and visualization data binding technology for virtual devices and variables in power monitoring scenarios is achieved. Specifically, the following steps are included: Step 1: Maintain virtual devices and virtual variables in the database table. Use the IsCollect field to distinguish whether a device is a virtual entity. Store the calculation expression of the virtual variable in the Expression field. The calculation expression includes various types such as the current displayed value, device attributes, cumulative value difference, rate-related attributes and electricity bill calculation, and site key variables.
[0016] Specifically, the system is first initialized by creating the tables elec_circuit_info and elec_circuit_var as database tables, setting IsCollect=0 when configuring virtual devices, and doing the same for virtual variables; initializing the connections to Redis, TDengine database, and MySQL / DM database to ensure normal data storage and retrieval; and deploying the MQTT server, Node-red service, and front-end display platform to complete the system environment setup.
[0017] Through the visual operation interface, a virtual device is created in the device management module. Basic information such as device name, number, and group are configured, and IsCollect=0 is set to identify it as a virtual device. In the variable editing module, the virtual variable name, code, and unit are entered, and calculation expressions are written using the formula editor. The formula editor provides a variable list pop-up window, allowing users to generate expressions by searching, dragging and dropping device attributes, and real-time variables. For example, the load rate calculation expression {c:pf} / {s:RatedCapacity}*100 can be written and saved to the elec_circuit_var.Expression field, automatically generating a Redis key and a TDengine sub-table name. The following examples illustrate this in detail: Virtual devices are maintained in the elec_circuit_info table. IsCollect checks if a device is virtual: 1 for no and 0 for yes. Virtual variables are maintained in the elec_circuit_var table. IsCollect checks if a variable is virtual: 1 for no and 0 for yes.
[0018] The evaluation expression for the dummy variable is maintained in the Expression field of elec_circuit_var: Current displayed value: such as real-time power, voltage, current, format: {c:TaosVarCode}, for example: real-time power multiplied by a fixed factor {c:iti003_d001_p}*0.001; Equipment attributes: such as installed capacity and rated power, format: {s:CirciutCode:Field}, for example: get the rated capacity {s:iti003_d001:RatedCapacity}; Cumulative difference: such as daily electricity consumption, monthly electricity consumption, format: {d:TaosVarCode:time}, where the time format is shown in the table below:
[0019] Example: Get the daily electricity consumption {d:iti003_d001_epf:td}; Rate-related attributes: Format: {fs:CirciutCode:Field:[Condition1:Condition2...]}, for example: get the rate unit price {fs:iti003_d001:Price:Jan:Jian}; Electricity fee: Format: {f:CirciutCode:time}, e.g., to get the fee: {f:iti003_d001:td}; Site key variables: Format: {ss:Field}, e.g., to get the photovoltaic installed capacity {ss:PvCapacity}.
[0020] The formula editor includes basic addition, subtraction, multiplication, and division, as well as simple aggregation calculations, as shown in the example below: Example 1, the total power of several loops: {c:iti003_d001_p}+{c:iti003_d002_p}+{c:iti003_d003_p}; Example 2, Other electricity consumption: {d:iti003_d001_epf:tm}-{d:iti003_d002_epf:tm}-{d:iti003_d003_epf:tm}; Example 3: Electricity consumption is the actual amount multiplied by a multiplier: Monthly electricity consumption {d:iti003_d001_epf:tm}*{fs:iti003_d001:Magnification}, {c:iti003_d001_p}*0.001; Example 4, load factor: {c:iti003_d001_p} / {s:iti003_d001:RatedCapacity}*100; Example 5: Find the average, maximum, and minimum values. avg({c:iti003_d001_p},{c:iti003_d002_p},{c:iti003_d003_p}); max({c:iti003_d001_p},{c:iti003_d002_p},{c:iti003_d003_p}); min({c:iti003_d001_p},{c:iti003_d002_p},{c:iti003_d003_p}).
[0021] Step 2: Collect power equipment data using the MQTT protocol and obtain real-time data by listening to the MQTT server through other language code (such as Node-red); Power equipment reports data to the MQTT server via the MQTT protocol at preset intervals (e.g., once per minute); Node-red triggers the API periodically (e.g., every 5 seconds) to retrieve real-time data from the MQTT server.
[0022] Step 3: The virtual variable expression is parsed using a regular expression parsing engine. Predefined regular expression templates, including various patterns such as real-time values and device attributes, are used. Fields such as variable type, device code, and time parameters are captured through regular expression grouping and automatically mapped to Redis keys or TDengine table names. Historical expressions are analyzed, and regular expressions are dynamically optimized to improve the parsing accuracy of complex expressions (such as nested functions and multi-condition judgments). After parsing, real-time values, historical data, and metadata of power equipment obtained from Redis, TDengine databases, and MySQL / DM databases are combined to perform calculations according to the expression. Node-red triggers an API every 5 seconds to calculate all variables that need to be calculated. Real-time values are stored in Redis, and historical values are stored in TDengine.
[0023] Intelligent regular expression parsing is implemented as follows: At system startup, a predefined regular expression template library is loaded into memory. When a dummy variable expression is received, a preliminary matching using regular expressions is first performed to determine the variable type. If it is a complex expression, the ANTLR parser is activated for deep parsing. Simultaneously, the AI model analyzes historical expression data in real time. If it finds that the current expression is similar to a historical complex expression pattern, it automatically optimizes the regular expression to improve parsing efficiency and accuracy. For example, for nested function expressions, the AI model can predict the function call order in advance and optimize the parsing path.
[0024] For example, the expression {c:iti003_d001_p}+{c:iti003_d002_p} is identified as a real-time value type variable through regular expression matching. The real-time values of iti003_d001_p and iti003_d002_p are then retrieved from Redis and added together.
[0025] Step 4, as follows Figure 3 As shown, the calculated real-time results are stored in Redis using stationid+deviceid+measurementid as keys to meet the data binding requirements of the real-time power monitoring dashboard and enable fast reading and display. Historical calculation results are stored in the TDengine time-series database. The TDengine database stores data in sub-tables with a fixed table structure. The sub-tables contain a time field (ts) and a measurement field (value). The sub-table name consists of stationid+deviceid+measurementid, which facilitates the storage and querying of historical data by time series. The MySQL / DM database is used to store system configuration information, metadata, etc., to facilitate data management and querying.
[0026] Step 5: Establish a unified data binding mechanism. Based on the front-end data-driven framework, no additional API interfaces need to be developed to automatically bind virtual variables to the power monitoring front-end display components (large screen, configuration interface, reports, etc.). By monitoring data changes in real time, once the virtual variable data is updated, the front-end display is immediately updated synchronously, ensuring the real-time performance and accuracy of the data display. Figure 4 A flowchart for rapid binding with zero code is provided, showing the process of automatic binding of virtual variables to front-end display components.
[0027] When developing a front-end display platform, introducing a data-driven framework (such as Vue.js) allows the system to automatically recognize and update data after storing the calculation results of virtual variables in Redis. Leveraging the reactive principles of this framework, the virtual variables are bound to the front-end display components. For example, in a large-screen display, the total power virtual variable is bound to the large-screen power display component. When the total power data is updated, the front-end component automatically refreshes and displays the latest data, eliminating the need for developers to write additional data binding code.
[0028] Step 6: Develop a unified API interface. Based on the stationid+deviceid+measurementid in the request parameters, combined with the time range parameter, determine whether to obtain real-time data from Redis or query historical data from the corresponding sub-table in the TDengine database. This interface supports efficient querying and meets the timeliness requirements of different businesses for data querying in power monitoring scenarios.
[0029] Users send data query requests through the front-end interface or external systems. The request parameters include stationid, deviceid, measurementid, and a time range. Upon receiving the request, the unified API interface module first parses the parameters and determines whether to retrieve data from Redis (real-time data) or the TDengine database (historical data) based on the time range. If it's a real-time data query, it retrieves the data directly from Redis as key-value pairs. If it's a historical data query, it determines the TDengine database sub-table name based on stationid, deviceid, and measurementid, executes an SQL query to retrieve the data, and finally integrates the retrieved data in a unified format and returns it to the requester.
[0030] Step 7: Establish an instruction management module. Users input instructions for virtual devices through the front-end interface. The instructions are encrypted and sent to the virtual devices via the MQTT protocol. The virtual devices parse the instructions, execute them across gateways, and then return the results to the system, enabling remote control of the virtual devices. A visual operation interface is provided, allowing business personnel to build virtual devices and virtual variable-related applications through a graphical interface and drag-and-drop components. Pre-built modules and functions are provided in the formula editor to achieve zero-code and low-code development, meeting the customized needs of different complexities in power monitoring scenarios.
[0031] In terms of zero-code and low-code development, users can quickly build virtual devices and variable-related applications by dragging and dropping components and selecting pre-built modules. For example, by dragging and dropping the "Power Calculation" module and selecting input variables and output display components, the power calculation function can be developed without writing any code.
[0032] Example 2: Based on Example 1, it also includes applications in edge computing scenarios, specifically: Edge computing modules are deployed on edge computing nodes, and TSN protocol parameters are configured to achieve synchronization between edge nodes. In this system, the TSN protocol addresses the core issues of insufficient data synchronization accuracy and unreliable real-time data transmission in power monitoring scenarios through synchronization and dynamic path optimization, providing underlying communication guarantees for functions such as virtual variable calculation and edge collaborative control. A dynamic path planning algorithm is employed to monitor network status in real time and optimize power data transmission paths. Data transmitted between edge nodes is encrypted using national cryptographic algorithms (SM2, SM3, SM4) and transmitted through an IPSec VPN tunnel. Simultaneously, device tree resolution technology automatically adapts to different hardware platforms and databases, ensuring normal data interaction between edge computing nodes and the cloud system.
[0033] Example 3: Based on Example 1, the pre-calculation strategy is dynamically adjusted using a cost-benefit model, specifically as follows:
[0034]
[0035]
[0036]
[0037] The cost-benefit model dynamically selects pre-computation or real-time computation strategies based on factors such as the amount of power data, computational complexity, update frequency, data change rate, query patterns, and cache hit rate, thereby optimizing the allocation of power data processing resources.
[0038] Example 4: A virtual device and variable data processing system for power monitoring, comprising: The data acquisition module is used to collect data from power equipment and other relevant IoT data using the MQTT protocol. The real-time data processing module triggers virtual variable calculations through scheduled tasks, integrates multi-source power data, stores the real-time results in Redis, and simultaneously inserts a time-series data into TDengine as historical data. The historical data query module calculates and retrieves historical cumulative or aggregated values of electricity from the TDengine database through a unified API interface. The formula editor module supports user-defined expressions containing basic operations and aggregate functions, and achieves standardized parsing through regular expression algorithm analysis; The edge computing module uses the TSN protocol for synchronization, combines national cryptographic algorithms and IPSec VPN to ensure the security of power data transmission, and is compatible with different databases and hardware platforms. The instruction management module enables the issuance, reception, execution, and result feedback of virtual device instructions, thereby achieving scene linkage. The data binding module, based on the front-end data-driven framework, enables automatic binding of virtual variables to the front-end display components of power monitoring, without the need to develop additional API interfaces; The adaptive optimization module dynamically adjusts the pre-calculation strategy based on the historical query patterns and update frequency of power data through a cost-benefit model. The unified API interface module receives query requests containing parameters such as stationid, deviceid, measurementid, and time range. Based on these parameters, it retrieves real-time or historical power data from Redis or TDengine databases and returns the results. Specifically, it includes: The request parsing unit is used to parse the stationid+deviceid+measurementid and time range parameters in the query request; The data source determination unit determines whether to obtain power data from Redis or the TDengine database based on the time range parameter. The Redis query unit retrieves real-time power data from Redis using stationid+deviceid+measurementid as the key. The TDengine query unit determines the name of the sub-table in the TDengine database based on stationid+deviceid+measurementid, and then queries historical power data from the corresponding sub-table. The results integration unit integrates the power data obtained from the Redis or TDengine database according to a unified format and returns it.
[0039] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A virtual device and variable data processing method for power monitoring, characterized in that, Specifically, the following steps are included: Step 1: Create the tables elec_circuit_info and elec_circuit_var in the system to maintain virtual devices and virtual variables. Use the IsCollect field to distinguish whether a device is a virtual entity and store the calculated expression of the virtual variable in the Expression field. Step 2: Collect power equipment data using the MQTT protocol and obtain real-time data by listening to the MQTT server using code in other languages; Step 3: Use regular expressions to parse the virtual variable expression. Through predefined regular expression templates, capture the variable type, device code, and time parameters, and automatically map them to the keys in the memory database or the table names in the time series database. After parsing, combine the real-time data, historical data, and metadata of the power equipment obtained from the memory database, time series database, and relational database, and perform calculations according to the expression. Step 4: Store the calculated real-time data into the in-memory database using stationid+deviceid+measurementid as the key; store historical data into the time series database, which stores data in sub-tables with a fixed table structure. The sub-tables contain a time (ts) field and a measurement value (value) field, and the sub-table name consists of stationid+deviceid+measurementid; the relational database is used to store system configuration information, metadata, and calculated statistical results. Step 5: Introduce a data-driven framework to the front end. After the system stores the calculation results of the virtual variables into the in-memory database, it automatically identifies and updates the data. Through the reactive principle of the data-driven framework, the virtual variables are bound to the front end display components. Step 6: Develop a unified API interface to retrieve real-time data from the in-memory database or historical data from the corresponding sub-table of the time series database based on the stationid+deviceid+measurementid in the request parameters and the time range parameter. Step 7: Establish an instruction management module and a visual operation interface to enable remote control of virtual devices and processing of virtual variables.
2. The virtual device and variable data processing method for power monitoring according to claim 1, characterized in that, The calculation expressions for dummy variables include the current displayed value, device attributes, cumulative value difference, rate-related attributes and electricity bill calculation and site key variables.
3. The virtual device and variable data processing method for power monitoring according to claim 2, characterized in that, Regular expression parsing is implemented in the following way: when the system starts, a predefined regular expression template library is loaded into memory. When a virtual variable expression is received, a preliminary match is first performed using regular expressions to determine the variable type. For complex expressions, the ANTLR parser is activated for deep parsing; at the same time, the AI model analyzes historical expression data in real time. If the current expression is found to be similar to a historical complex expression pattern, the regular expression is automatically optimized to improve parsing efficiency and accuracy.
4. The virtual device and variable data processing method for power monitoring according to claim 2, characterized in that, It also includes applications in edge computing scenarios, specifically: The system employs the TSN protocol for edge node synchronization; a dynamic path planning algorithm for real-time network status monitoring; encryption using national cryptographic algorithms and transmission via an IPSec VPN tunnel; and device tree resolution technology to automatically adapt to different hardware platforms and databases, ensuring normal data interaction between edge computing nodes and the cloud system.
5. A virtual device and variable data processing method for power monitoring according to claim 2, characterized in that, It also includes dynamically adjusting the pre-computation strategy through a cost-benefit model. The cost-benefit model dynamically selects the pre-computation or real-time calculation strategy based on factors such as the amount of power data, computational complexity, update frequency, data change, query pattern, and cache hit rate, thereby optimizing the allocation of power data processing resources.
6. A virtual device and variable data processing system for power monitoring, used to implement the virtual device and variable data processing method for power monitoring as described in any one of claims 1-5, characterized in that, include: The data acquisition module is used to collect data from power equipment and other relevant IoT data using the MQTT protocol. The real-time data processing module triggers virtual variable calculations through scheduled tasks, integrates multi-source power data, stores the real-time results in the memory database, and inserts time-series data into the time-series database as historical data. The historical data query module calculates and retrieves historical cumulative or aggregated values of electricity from a time-series database through a unified API interface. The formula editor module supports user-defined expressions containing basic operations and aggregate functions, and achieves standardized parsing through regular expression algorithm analysis; The edge computing module uses the TSN protocol for synchronization, combines national cryptographic algorithms and IPSec VPN to ensure the security of power data transmission, and is compatible with different databases and hardware platforms. The instruction management module enables the issuance, reception, execution, and result feedback of virtual device instructions, thereby achieving scene linkage. The data binding module, based on the front-end data-driven framework, enables automatic binding of virtual variables to the front-end display components of power monitoring, without the need to develop additional API interfaces; The adaptive optimization module dynamically adjusts the pre-calculation strategy based on the historical query patterns and update frequency of power data through a cost-benefit model. The unified API interface module receives query requests containing parameters such as stationid, deviceid, measurementid, and time range. Based on these parameters, it retrieves real-time or historical power data from an in-memory database or a time-series database and returns the results.
7. The virtual device and variable data processing method for power monitoring according to claim 6, characterized in that, The unified API interface module specifically includes: The request parsing unit is used to parse the stationid+deviceid+measurementid and time range parameters in the query request; The data source determination unit determines whether to obtain power data from an in-memory database or a time-series database based on the time range parameter. The in-memory database query unit retrieves real-time power data from the in-memory database using stationid+deviceid+measurementid as the key. The time-series database query unit determines the name of the sub-table in the time-series database based on stationid+deviceid+measurementid, and queries historical power data from the corresponding sub-table; The results integration unit integrates the power data obtained from the in-memory database or time-series database according to a unified format and returns it.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the steps of the virtual device and variable data processing method for power monitoring as described in any one of claims 1-5.
9. A computer device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the virtual device and variable data processing method for power monitoring as described in any one of claims 1-5.
Citation Information
Cited By
Method and system for improving query efficiency of latest monitoring data of electrical equipment
CN122064688A