Method and system for reducing response delay of cloud data acquisition, and medium

By adding cache server and data repetition judgment logic in the energy management system, the database resource consumption and storage resource waste caused by the fast data collection frequency are solved, and the effect of reducing response delay and storage costs is achieved.

CN119544709AInactive Publication Date: 2025-02-28SHENZHEN ANSHI NEW ENERGY TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510076294.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing energy management system, the rapid data acquisition frequency leads to serious consumption of database resources, increased response delay, and lack of deduplication processing leads to wasted storage resources, and user access experience is poor.

Method used

By adding a cache server, the database access pressure is reduced, and data duplication judgment logic is added to the cloud, data duplication is removed, and data is stored in the cache server and real-time database.

Benefits of technology

It effectively reduces the response delay of data collected in the cloud, reduces data storage costs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544709A_ABST
    Figure CN119544709A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and system for reducing response delay of cloud collection data and a medium, and the method comprises the steps: obtaining the equipment composition of an energy storage station, and obtaining the real-time state information of each equipment based on the equipment composition; based on the real-time state information, extracting a collector SN, all device names and device field information, and generating a binding relationship between the device and the collector; obtaining configuration classification numbers of all devices, extracting cloud protocol configuration information of the devices, analyzing real-time state information of the devices, and processing the real-time state information into structured data; analyzing the structured data to obtain analyzed data, and storing the analyzed data to a cache server and a real-time database; the data in the cache server is displayed to the PC terminal and the mobile terminal in real time; by adding the cache server, the access pressure of the database is greatly reduced, meanwhile, the data repetition judgment logic is added to the cloud, the data storage cost can be reduced, and the use experience of a user is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud-based data collection and analysis, and more specifically, to a method, system, and medium for reducing the response delay of cloud-based data collection. Background Art

[0002] The current energy management system data collection and processing has the following problems: the frequency of real-time data collection is too fast, resulting in frequent database operations, which greatly consumes database resources and affects the user experience of accessing the system; the data is not deduplicated, and some collected information does not change frequently, resulting in a large amount of data duplication, which greatly occupies storage resources; PC and mobile users need to read the latest status information of the equipment from the database server in real time to access the real-time monitoring information of the power station. Due to the performance bottleneck of the database itself, when a large number of users access it, the database will respond slowly. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method, system and medium for reducing the response delay of cloud-based data collection. By adding a cache server, the access pressure of the database is greatly reduced. At the same time, adding data duplication judgment logic in the cloud can reduce data storage costs and greatly improve the user experience.

[0004] The embodiment of the present application also provides a method for reducing the response delay of cloud data collection, including: obtaining the equipment composition of the energy storage station, and obtaining the real-time status information of each device based on the equipment composition; Extract the collector SN, all device names and device field information based on real-time status information, and generate the binding relationship between the device and the collector; Obtain the configuration classification number of all devices, extract the cloud protocol configuration information of the device, parse the real-time status information of the device, and process it into structured data; Parse the structured data to obtain parsed data, and store the parsed data in the cache server and the real-time database; The data in the cache server is displayed in real time to the PC and mobile terminals.

[0005] Optionally, in the method for reducing the response delay of cloud data collection described in the embodiment of the present application, obtaining the device composition of the energy storage station, and obtaining the real-time status information of each device based on the device composition specifically includes: Obtain the equipment composition of the energy storage station, which includes inverters, battery packs, heat pumps, charging piles and electricity meters; Obtain real-time data from inverters, battery packs, heat pumps, charging piles and electric meters; Analyze whether the format of the collected data conforms to the set format, which includes standard JSON format, XML format or custom hex data format; If it meets the set format, real-time status information is generated; If it does not conform to the set format, the collected data will be converted into a different format.

[0006] Optionally, in the method for reducing the response delay of cloud data collection described in the embodiment of the present application, extracting the collector SN, all device names and device field information based on the real-time status information, and generating a binding relationship between the device and the collector specifically includes: Get the collector SN, all device names and device field information, and analyze whether there are devices with the same name in the collector SN binding relationship; If it does not exist, the device configuration information is obtained, and a sub-device is created based on the device name and the device configuration information, wherein the sub-device includes the device id, the device SN, and the configuration classification number; If the same device name exists in the SN binding relationship of the collector, there is no need to re-establish the binding relationship.

[0007] Optionally, in the method for reducing the response delay of cloud data collection described in the embodiment of the present application, obtaining the configuration classification number of all devices, extracting the cloud protocol configuration information of the devices, parsing the real-time status information of the devices, and processing them into structured data specifically includes: Obtain underlying data based on the device's cloud protocol configuration information; Analyze the data format of the underlying data. If the underlying data format is standard json or xml format, define the data entity model on the data processing end and use Newtonsoft.Json component to deserialize it into the standard entity model. If the underlying data format is a non-standard hex format, the protocol data format is automatically matched according to the preset device protocol definition in the cloud, and structured data is generated.

[0008] Optionally, in the method for reducing the response delay of cloud data collection described in the embodiment of the present application, the structured data is parsed to obtain parsed data, and the parsed data is stored in the cache server and the real-time database, specifically including: Obtain the most recent collector data status information in the cache server, compare the collector data status information with the collector structured data one by one, and analyze whether the data values ​​of the collection points are the same; If the data values ​​of the collection points are the same, remove this data; If the data at the collection point is different, the data is retained, and the historical data cache queue is obtained, and the structured data is added to the historical data cache queue; Determine whether the collector SN has real-time cache information in the cache server; If it exists, the cache data is updated directly, the key value is the collector SN, and the data is the structured data of all devices; If it does not exist, apply for a space from the cache server to store the structured data corresponding to the collector SN; According to the collector's SN unique number, update the real-time database data collection table and store it in the cache server and real-time database.

[0009] Optionally, in the method for reducing the response delay of cloud data collection described in the embodiment of the present application, the data in the cache server is displayed to the PC and mobile terminals in real time, specifically including: The PC and mobile terminals monitor the device status information in real time, obtain cache data from the cache server according to the collector SN, and analyze whether the cache data exists; If there is no cached data, the latest status information of the device is queried from the real-time database, and a key-value pair is established between the information and the collector SN; If there is cached data, the cached data will be stored in the cache server and displayed in real time on the PC and mobile terminals.

[0010] In a second aspect, an embodiment of the present application provides a system for reducing the response delay of cloud data collection, the system comprising: a memory and a processor, the memory comprising a program of a method for reducing the response delay of cloud data collection, and the program of the method for reducing the response delay of cloud data collection is executed by the processor to implement the following steps: Obtain the equipment composition of the energy storage station, and obtain the real-time status information of each device based on the equipment composition; Extract the collector SN, all device names and device field information based on real-time status information, and generate the binding relationship between the device and the collector; Obtain the configuration classification number of all devices, extract the cloud protocol configuration information of the device, parse the real-time status information of the device, and process it into structured data; Parse the structured data to obtain parsed data, and store the parsed data in the cache server and the real-time database; The data in the cache server is displayed in real time to the PC and mobile terminals.

[0011] Optionally, in the system for reducing the response delay of cloud data collection described in the embodiment of the present application, obtaining the equipment composition of the energy storage station, and obtaining the real-time status information of each device based on the equipment composition specifically includes: Obtain the equipment composition of the energy storage station, which includes inverters, battery packs, heat pumps, charging piles and electricity meters; Obtain real-time data from inverters, battery packs, heat pumps, charging piles and electric meters; Analyze whether the format of the collected data conforms to the set format, which includes standard JSON format, XML format or custom hex data format; If it meets the set format, real-time status information is generated; If it does not conform to the set format, the collected data will be converted into a different format.

[0012] Optionally, in the system for reducing the response delay of cloud data collection described in the embodiment of the present application, based on the real-time status information, the collector SN, all device names and device field information are extracted to generate a binding relationship between the device and the collector, specifically including: Get the collector SN, all device names and device field information, and analyze whether there are devices with the same name in the collector SN binding relationship; If it does not exist, the device configuration information is obtained, and a sub-device is created based on the device name and the device configuration information, wherein the sub-device includes the device id, the device SN, and the configuration classification number; If the same device name exists in the SN binding relationship of the collector, there is no need to re-establish the binding relationship.

[0013] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a method program for reducing the response delay of cloud-collected data. When the method program for reducing the response delay of cloud-collected data is executed by a processor, the steps of the method for reducing the response delay of cloud-collected data as described in any one of the above items are implemented.

[0014] As can be seen from the above, the embodiment of the present application provides a method, system and medium for reducing the response delay of cloud data collection, by obtaining the equipment composition of the energy storage station, and obtaining the real-time status information of each device based on the equipment composition; extracting the collector SN, all device names and device field information based on the real-time status information, and generating a binding relationship between the device and the collector; obtaining the configuration classification number of all devices, extracting the cloud protocol configuration information of the device, parsing the real-time status information of the device, and processing it into structured data; parsing the structured data to obtain parsed data, and storing the parsed data in a cache server and a real-time database; based on the data in the cache server, displaying it in real time to the PC and mobile terminals; by adding a cache server, the access pressure of the database is greatly reduced, and at the same time, adding data duplication judgment logic in the cloud can reduce the data storage cost and greatly improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 A flowchart of a method for reducing the response delay of cloud data collection provided in an embodiment of the present application; Figure 2 A flow chart of a method for obtaining real-time status information of a device according to an embodiment of the present application, which is a method for reducing the response delay of cloud data collection; Figure 3 A flow chart of the device and collector binding relationship analysis for the method of reducing cloud data collection response delay provided in an embodiment of the present application. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0018] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0019] Please refer to Figure 1 , Figure 1 This is a flow chart of a method for reducing the response delay of cloud data collection in some embodiments of the present application. The method for reducing the response delay of cloud data collection is used in a terminal device, and the method for reducing the response delay of cloud data collection includes the following steps: S101, obtaining the equipment composition of the energy storage station, and obtaining the real-time status information of each device based on the equipment composition; S102, extracting the collector SN, all device names and device field information based on the real-time status information, and generating a binding relationship between the device and the collector; S103, obtaining configuration classification numbers of all devices, extracting cloud protocol configuration information of the devices, parsing real-time status information of the devices, and processing the information into structured data; S104, parsing the structured data to obtain parsed data, and storing the parsed data in a cache server and a real-time database; S105, displaying the data in the cache server to the PC and mobile terminals in real time.

[0020] It should be noted that by real-time monitoring of the equipment status information reported from the energy storage power station, the collected data is structured according to the preset configuration information, and then saved to the real-time database and cache service. The data in the cache is a mirror image of the data in the real-time database. The two are associated through the collector SN to ensure that the user terminal can quickly access the real-time monitoring information of the equipment while ensuring that the collected data will not be lost; and automatically generate a historical database and a historical collection table based on the time information of the collected data, deduplicate the collected data, and write the collected information into the historical database to ensure that the historical data is traceable.

[0021] Please refer to Figure 2 , Figure 2 This is a flow chart of a method for obtaining real-time status information of a device in some embodiments of the present application, a method for reducing the response delay of cloud data collection. According to an embodiment of the present invention, obtaining the device composition of the energy storage station, and obtaining the real-time status information of each device based on the device composition specifically include: S201, obtaining the equipment composition of the energy storage station, which includes an inverter, a battery pack, a heat pump, a charging pile and an electric meter; S202, obtaining real-time data collected from the inverter, battery pack, heat pump, charging pile and electric meter; S203, analyzing whether the format of the collected data conforms to the set format, where the set format includes a standard json format, an xml format, or a custom hex data format; S204, if it meets the set format, generate real-time status information; S205: If the data does not conform to the set format, the collected data is converted into a new format.

[0022] Please refer to Figure 3 , Figure 3 This is a flow chart of analyzing the binding relationship between a device and a collector in a method for reducing the response delay of cloud data collection in some embodiments of the present application. According to an embodiment of the present invention, based on the real-time status information, the collector SN, all device names and device field information are extracted to generate the binding relationship between the device and the collector, specifically including: S301, obtain the collector SN, all device names and device field information, and analyze whether there is a device name with the same name in the binding relationship of the collector SN; S302, if it does not exist, then obtain the device configuration information, and create a sub-device based on the device name and the device configuration information, the sub-device includes the device id, the device SN, and the configuration classification number; S303: If there is a device with the same name in the SN binding relationship of the collector, there is no need to re-establish the binding relationship.

[0023] According to an embodiment of the present invention, the configuration classification numbers of all devices are obtained, the cloud protocol configuration information of the devices is extracted, the real-time status information of the devices is parsed, and processed into structured data, specifically including: Obtain underlying data based on the device's cloud protocol configuration information; Analyze the data format of the underlying data. If the underlying data format is standard json or xml format, define the data entity model on the data processing end and use Newtonsoft.Json component to deserialize it into the standard entity model. If the underlying data format is a non-standard hex format, the protocol data format is automatically matched according to the preset device protocol definition in the cloud, and structured data is generated.

[0024] It should be noted that the specific processing steps for the standard entity model are as follows: The standard model definition includes model name, device name, field name, field value, collection time, and collector SN; The cloud needs to configure the device protocol in advance, and use the configuration classification number to distinguish the configuration protocol. The same model of devices corresponds to the same protocol. The configuration definition mainly includes the attribute unique number, configuration classification number, protocol field name, corresponding unit, Chinese description, coefficient, module subclassification, whether it is analog quantity, and expression; Traverse the configuration information of the specified device name, match the field name with the field name of the corresponding device in the deserialized standard entity model one by one, and detect whether the field needs additional calculation. If it is marked as no, no additional calculation is required and continue to process the next field. Otherwise, it needs to be calculated according to the expression. The expression supports common operators such as and, -, *, / , >>, <<, (), &, etc. For example, when the calculation rule matched by the working status field is ({0}>>8)&127, the calculation engine first replaces the original value of the field with a string. Assuming that the original value of the working status is a, the expression after replacement becomes (a>>8)&127. The calculation engine initializes a character type stack with a length equal to the total length of the expression to store the original expression data, pushes the expression into the initial stack character by character, and declares an intermediate state stack to record the intermediate calculation process, declaring operand 1, operator 1, operand 2, operator 2, and calculation result 3. Extract characters from the stack one by one. If the characters obtained are numeric type characters, store them in temporary result 1. Continue to extract the next character. If the character is still a numeric value, append the character to the end of result 1. If the operator is obtained, the result 1 is converted into a numerical value, stored in operand 1, and the operator symbol is recorded in the variable operator 1; When the first symbol after operator 1 is a numeric value, the second operand is extracted step by step until a non-numeric symbol is encountered. The operand is converted to a numeric type and recorded as operand 2. Extract the next symbol, and determine whether there is an operator after operand 2. If there is an operator, record it as operator 2, and then determine whether the priority of operator 2 is higher than that of operator 1. If operator 1 has a higher priority, directly perform numerical operations based on operand 1, operator 1, and operand 2, record the calculation result as operand 1, modify operator 1 to the value of operator 2, and clear the values ​​of operand 2 and operator 2 at the same time; if operator 2 has a higher priority, then push operand 1 and operator 1 into the intermediate state stack in sequence, perform transposition operations on variable operand 1 and operator 1, and variable operand 2 and operator 2, and clear the values ​​of operand 2 and operator 2, and continue to extract the next operand; When a bracket is extracted after operator 1, operand 1, operand 2, operator 1, and operator 2 that are not pushed into the intermediate state stack must be pushed into the stack first, and the opening bracket must be pushed into the intermediate state stack. Then, starting from the first character in the bracket, operand 1, operand 2, operator 1, and operator 2 are extracted again until two operands are encountered that satisfy the priority calculation logic. After the initial stack traversal is completed, all elements of the intermediate state stack are popped out in sequence and added to the initial stack one by one until the elements in the initial stack and the intermediate state stack are empty. Generate device ID, field ID, field value, data unit, collection time, and update time data records based on the final expression calculation result, and add them to the result set for cache; Continue to process the match of the next field until all fields of the device are processed.

[0025] Furthermore, the specific processing steps of the automatic matching protocol data format are as follows: From the hex data, extract the hex data corresponding to the device name; According to the device name, obtain the cloud configuration protocol and arrange the device cloud configuration protocols in ascending order according to the serial number; Extract the first field protocol configuration and obtain the field name, byte length, and field type; Extract data of specified byte length from hex data and convert data according to field type; When the field type is nvarcahr, convert the intercepted hex data to ascll type; when the field type is int, convert the intercepted hex data to integer type; when the field type is floating point number, convert the hex data to decimal; Generate device ID, field ID, field value, data unit, collection time, and update time data records based on the conversion results, and add them to the result set for cache; Continue to process the data of the next field protocol until all fields are processed.

[0026] According to an embodiment of the present invention, the structured data is parsed to obtain parsed data, and the parsed data is stored in a cache server and a real-time database, specifically including: Obtain the most recent collector data status information in the cache server, compare the collector data status information with the collector structured data one by one, and analyze whether the data values ​​of the collection points are the same; If the data values ​​of the collection points are the same, remove this data; If the data at the collection point is different, the data is retained, and the historical data cache queue is obtained, and the structured data is added to the historical data cache queue; Determine whether the collector SN has real-time cache information in the cache server; If it exists, the cache data is updated directly, the key value is the collector SN, and the data is the structured data of all devices; If it does not exist, apply for a space from the cache server to store the structured data corresponding to the collector SN; According to the collector's SN unique number, update the real-time database data collection table and store it in the cache server and real-time database.

[0027] It should be noted that the EMS energy management system periodically scans the length of the historical data cache queue. When the length reaches the specified threshold, it is saved in batches to the historical database. The existence of the historical database is determined according to the current time. It is named in the db_year format, such as db_2024. If the database does not exist, create the database db_2024. If it exists, it does not need to be created. Then, it is determined whether the historical data table exists. It is named in the rundata_yyyyMMdd format, such as rundata_20240929. If the table exists, it is directly inserted into the database. Otherwise, create the table rundata_20240929, and then insert the data into the database in batches. In order to further reduce the frequency of database operations, define data interfaces and submit data batch operations to the database for processing; On the database side, define the input parameter model and the collection detail data model, including the collection information id, device id, attribute id, data value, and collection time; define the data processing interface, with the parameter being the collection detail data model, corresponding to the DataTable type.

[0028] According to an embodiment of the present invention, the data in the cache server is displayed to the PC and mobile terminals in real time, specifically including: The PC and mobile terminals monitor the device status information in real time, obtain cache data from the cache server according to the collector SN, and analyze whether the cache data exists; If there is no cache data, the latest status information of the device is queried from the real-time database, and a key-value pair is established between the information and the collector SN, which is saved in the cache server to ensure that the data is queried from the cache server next time, thereby quickly improving the response speed of the real-time data of the EMS energy management system; If there is cached data, the cached data will be stored in the cache server and displayed in real time on the PC and mobile terminals.

[0029] According to an embodiment of the present invention, the method further includes: obtaining the latest collected data corresponding to all collectors SN in the detailed data, grouping them according to the device id and the attribute id, and arranging them in descending order according to the reporting time, and obtaining the first record in all groups; Update the real-time data table information in the real-time database according to the device ID and attribute ID; Insert all historical data directly into the corresponding historical data table; Process equipment information according to historical data tables, such as daily power generation, daily power consumption, monthly power generation, monthly power consumption, annual power generation, annual power consumption, and real-time power, and update the equipment information table to ensure the associated update of specific status; When a fault condition is detected in the protection information of the device, the device is updated to a fault state.

[0030] In a second aspect, an embodiment of the present application provides a system for reducing the response delay of cloud data collection, the system comprising: a memory and a processor, the memory comprising a program of a method for reducing the response delay of cloud data collection, and when the program of the method for reducing the response delay of cloud data collection is executed by the processor, the following steps are implemented: Obtain the equipment composition of the energy storage station, and obtain the real-time status information of each device based on the equipment composition; Extract the collector SN, all device names and device field information based on real-time status information, and generate the binding relationship between the device and the collector; Obtain the configuration classification number of all devices, extract the cloud protocol configuration information of the device, parse the real-time status information of the device, and process it into structured data; Parse the structured data to obtain parsed data, and store the parsed data in the cache server and the real-time database; The data in the cache server is displayed in real time to the PC and mobile terminals.

[0031] It should be noted that by real-time monitoring of the equipment status information reported from the energy storage power station, the collected data is structured according to the preset configuration information, and then saved to the real-time database and cache service. The data in the cache is a mirror image of the data in the real-time database. The two are associated through the collector SN to ensure that the user terminal can quickly access the real-time monitoring information of the equipment while ensuring that the collected data will not be lost; and automatically generate a historical database and a historical collection table based on the time information of the collected data, deduplicate the collected data, and write the collected information into the historical database to ensure that the historical data is traceable.

[0032] According to an embodiment of the present invention, obtaining the equipment composition of the energy storage station and obtaining the real-time status information of each device based on the equipment composition specifically includes: Obtain the equipment composition of the energy storage station, which includes inverters, battery packs, heat pumps, charging piles and electricity meters; Obtain real-time data from inverters, battery packs, heat pumps, charging piles and electric meters; Analyze whether the format of the collected data conforms to the set format, which includes standard JSON format, XML format or custom hex data format; If it meets the set format, real-time status information is generated; If it does not conform to the set format, the collected data will be converted into a different format.

[0033] According to an embodiment of the present invention, based on the real-time status information, the collector SN, all device names and device field information are extracted to generate a binding relationship between the device and the collector, specifically including: Get the collector SN, all device names and device field information, and analyze whether there are devices with the same name in the collector SN binding relationship; If it does not exist, get the device configuration information, and create a sub-device based on the device name and device configuration information. The sub-device contains the device id, device SN, and configuration category number; If the same device name exists in the SN binding relationship of the collector, there is no need to re-establish the binding relationship.

[0034] According to an embodiment of the present invention, the configuration classification numbers of all devices are obtained, the cloud protocol configuration information of the devices is extracted, the real-time status information of the devices is parsed, and processed into structured data, specifically including: Obtain underlying data based on the device's cloud protocol configuration information; Analyze the data format of the underlying data. If the underlying data format is standard json or xml format, define the data entity model on the data processing end and use Newtonsoft.Json component to deserialize it into the standard entity model. If the underlying data format is a non-standard hex format, the protocol data format is automatically matched according to the preset device protocol definition in the cloud, and structured data is generated.

[0035] It should be noted that the specific processing steps for the standard entity model are as follows: The standard model definition includes model name, device name, field name, field value, collection time, and collector SN; The cloud needs to configure the device protocol in advance, and use the configuration classification number to distinguish the configuration protocol. The same model of devices corresponds to the same protocol. The configuration definition mainly includes the attribute unique number, configuration classification number, protocol field name, corresponding unit, Chinese description, coefficient, module subclassification, whether it is analog quantity, and expression; Traverse the configuration information of the specified device name, match the field name with the field name of the corresponding device in the deserialized standard entity model one by one, and detect whether the field needs additional calculation. If it is marked as no, no additional calculation is required and continue to process the next field. Otherwise, it needs to be calculated according to the expression. The expression supports common operators such as and, -, *, / , >>, <<, (), &, etc. For example, when the calculation rule matched by the working status field is ({0}>>8)&127, the calculation engine first replaces the original value of the field with a string. Assuming that the original value of the working status is a, the expression after replacement becomes (a>>8)&127. The calculation engine initializes a character type stack with a length equal to the total length of the expression to store the original expression data, pushes the expression into the initial stack character by character, and declares an intermediate state stack to record the intermediate calculation process, declaring operand 1, operator 1, operand 2, operator 2, and calculation result 3. Extract characters from the stack one by one. If the characters obtained are numeric type characters, store them in temporary result 1. Continue to extract the next character. If the character is still a numeric value, append the character to the end of result 1. If the operator is obtained, the result 1 is converted into a numerical value, stored in operand 1, and the operator symbol is recorded in the variable operator 1; When the first symbol after operator 1 is a numeric value, the second operand is extracted step by step until a non-numeric symbol is encountered. The operand is converted to a numeric type and recorded as operand 2. Extract the next symbol, and determine whether there is an operator after operand 2. If there is an operator, record it as operator 2, and then determine whether the priority of operator 2 is higher than that of operator 1. If operator 1 has a higher priority, directly perform numerical operations based on operand 1, operator 1, and operand 2, record the calculation result as operand 1, modify operator 1 to the value of operator 2, and clear the values ​​of operand 2 and operator 2 at the same time; if operator 2 has a higher priority, then push operand 1 and operator 1 into the intermediate state stack in sequence, perform transposition operations on variable operand 1 and operator 1, and variable operand 2 and operator 2, and clear the values ​​of operand 2 and operator 2, and continue to extract the next operand; When a bracket is extracted after operator 1, operand 1, operand 2, operator 1, and operator 2 that are not pushed into the intermediate state stack must be pushed into the stack first, and the opening bracket must be pushed into the intermediate state stack. Then, starting from the first character in the bracket, operand 1, operand 2, operator 1, and operator 2 are extracted again until two operands are encountered that satisfy the priority calculation logic. After the initial stack traversal is completed, all elements of the intermediate state stack are popped out in sequence and added to the initial stack one by one until the elements in the initial stack and the intermediate state stack are empty. Generate device ID, field ID, field value, data unit, collection time, and update time data records based on the final expression calculation result, and add them to the result set for cache; Continue to process the match of the next field until all fields of the device are processed.

[0036] Furthermore, the specific processing steps of the automatic matching protocol data format are as follows: From the hex data, extract the hex data corresponding to the device name; According to the device name, obtain the cloud configuration protocol and arrange the device cloud configuration protocols in ascending order according to the serial number; Extract the first field protocol configuration and obtain the field name, byte length, and field type; Extract data of specified byte length from hex data and convert data according to field type; When the field type is nvarcahr, convert the intercepted hex data to ascll type; when the field type is int, convert the intercepted hex data to integer type; when the field type is floating point number, convert the hex data to decimal; Generate device ID, field ID, field value, data unit, collection time, and update time data records based on the conversion results, and add them to the result set for cache; Continue to process the data of the next field protocol until all fields are processed.

[0037] According to an embodiment of the present invention, the structured data is parsed to obtain parsed data, and the parsed data is stored in a cache server and a real-time database, specifically including: Obtain the most recent collector data status information in the cache server, compare the collector data status information with the collector structured data one by one, and analyze whether the data values ​​of the collection points are the same; If the data values ​​of the collection points are the same, remove this data; If the data at the collection point is different, the data is retained, and the historical data cache queue is obtained, and the structured data is added to the historical data cache queue; Determine whether the collector SN has real-time cache information in the cache server; If it exists, the cache data is updated directly, the key value is the collector SN, and the data is the structured data of all devices; If it does not exist, apply for a space from the cache server to store the structured data corresponding to the collector SN; According to the collector's SN unique number, update the real-time database data collection table and store it in the cache server and real-time database.

[0038] It should be noted that the EMS energy management system periodically scans the length of the historical data cache queue. When the length reaches the specified threshold, it is saved in batches to the historical database. The existence of the historical database is determined according to the current time. It is named in the db_year format, such as db_2024. If the database does not exist, create the database db_2024. If it exists, it does not need to be created. Then, it is determined whether the historical data table exists. It is named in the rundata_yyyyMMdd format, such as rundata_20240929. If the table exists, it is directly inserted into the database. Otherwise, create the table rundata_20240929, and then insert the data into the database in batches. In order to further reduce the frequency of database operations, define data interfaces and uniformly submit data batch operations to the database for processing; On the database side, define the input parameter model and the collection detail data model, including the collection information id, device id, attribute id, data value, and collection time; define the data processing interface, with the parameter being the collection detail data model, corresponding to the DataTable type.

[0039] According to an embodiment of the present invention, the data in the cache server is displayed to the PC and mobile terminals in real time, specifically including: The PC and mobile terminals monitor the device status information in real time, obtain cache data from the cache server according to the collector SN, and analyze whether the cache data exists; If there is no cached data, the latest status information of the device is queried from the real-time database, and a key-value pair is established between the information and the collector SN; If there is cached data, the cached data will be stored in the cache server and displayed in real time on the PC and mobile terminals.

[0040] According to an embodiment of the present invention, the method further includes: obtaining the latest collected data corresponding to all collectors SN in the detailed data, grouping them according to the device id and the attribute id, and arranging them in descending order according to the reporting time, and obtaining the first record in all groups; Update the real-time data table information in the real-time database according to the device ID and attribute ID; Insert all historical data directly into the corresponding historical data table; Process equipment information according to historical data tables, such as daily power generation, daily power consumption, monthly power generation, monthly power consumption, annual power generation, annual power consumption, and real-time power, and update the equipment information table to ensure the associated update of specific status; When a fault condition is detected in the protection information of the device, the device is updated to a fault state.

[0041] A third aspect of the present invention provides a computer-readable storage medium, which includes a method program for reducing the response delay of cloud-based data collection. When the method program for reducing the response delay of cloud-based data collection is executed by a processor, the steps of the method for reducing the response delay of cloud-based data collection as described above are implemented.

[0042] The present invention discloses a method, system and medium for reducing the response delay of cloud data collection. The method comprises the following steps: obtaining the equipment composition of an energy storage station, and obtaining the real-time status information of each device based on the equipment composition; extracting the collector SN, all device names and device field information based on the real-time status information, and generating a binding relationship between the device and the collector; obtaining the configuration classification number of all devices, extracting the cloud protocol configuration information of the devices, parsing the real-time status information of the devices, and processing the information into structured data; parsing the structured data to obtain parsed data, and storing the parsed data in a cache server and a real-time database; and displaying the data in the cache server to a PC and a mobile terminal in real time; and greatly reducing the access pressure of the database by adding a cache server. At the same time, adding data duplication judgment logic in the cloud can reduce the data storage cost and greatly improve the user experience.

[0043] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0044] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0045] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0046] A person skilled in the art can understand that all or part of the steps of the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. Various media that can store program codes.

[0047] Or, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A method for reducing the response delay of cloud data collection, characterized in that: include: Obtain the equipment composition of the energy storage station, and obtain the real-time status information of each device based on the equipment composition; Extract the collector SN, all device names and device field information based on real-time status information, and generate the binding relationship between the device and the collector; Obtain the configuration classification number of all devices, extract the cloud protocol configuration information of the device, parse the real-time status information of the device, and process it into structured data; Parse the structured data to obtain parsed data, and store the parsed data in the cache server and the real-time database; The data in the cache server is displayed in real time to the PC and mobile terminals.

2. The method for reducing the response delay of cloud data collection according to claim 1 is characterized in that: Obtain the equipment composition of the energy storage station and obtain the real-time status information of each device based on the equipment composition, including: Obtain the equipment composition of the energy storage station, which includes inverters, battery packs, heat pumps, charging piles and electricity meters; Obtain real-time data from inverters, battery packs, heat pumps, charging piles and electric meters; Analyze whether the format of the collected data conforms to the set format, which includes standard JSON format, XML format or custom hex data format; If it meets the set format, real-time status information is generated; If it does not conform to the set format, the collected data will be converted into a different format.

3. The method for reducing the response delay of cloud data collection according to claim 2 is characterized in that: Based on the real-time status information, the collector SN, all device names and device field information are extracted to generate the binding relationship between the device and the collector, including: Get the collector SN, all device names and device field information, and analyze whether there are devices with the same name in the collector SN binding relationship; If it does not exist, the device configuration information is obtained, and a sub-device is created based on the device name and the device configuration information, wherein the sub-device includes the device id, the device SN, and the configuration classification number; If the same device name exists in the SN binding relationship of the collector, there is no need to re-establish the binding relationship.

4. The method for reducing the response delay of cloud data collection according to claim 3 is characterized in that: Obtain the configuration classification number of all devices, extract the cloud protocol configuration information of the device, parse the real-time status information of the device, and process it into structured data, including: Obtain underlying data based on the device's cloud protocol configuration information; Analyze the data format of the underlying data. If the underlying data format is standard json or xml format, define the data entity model on the data processing end and use Newtonsoft.Json component to deserialize it into the standard entity model. If the underlying data format is a non-standard hex format, the protocol data format is automatically matched according to the preset device protocol definition in the cloud, and structured data is generated.

5. The method for reducing the response delay of cloud data collection according to claim 4 is characterized in that: Parse the structured data to obtain parsed data, and store the parsed data in the cache server and the real-time database, including: Obtain the most recent collector data status information in the cache server, compare the collector data status information with the collector structured data one by one, and analyze whether the data values ​​of the collection points are the same; If the data values ​​of the collection points are the same, remove this data; If the data at the collection point is different, the data is retained, and the historical data cache queue is obtained, and the structured data is added to the historical data cache queue; Determine whether the collector SN has real-time cache information in the cache server; If it exists, the cache data is updated directly, the key value is the collector SN, and the data is the structured data of all devices; If it does not exist, apply for a space from the cache server to store the structured data corresponding to the collector SN; According to the collector's SN unique number, update the real-time database data collection table and store it in the cache server and real-time database.

6. The method for reducing the response delay of cloud data collection according to claim 5 is characterized in that: Based on the data in the cache server, it is displayed in real time on the PC and mobile terminals, including: The PC and mobile terminals monitor the device status information in real time, obtain cache data from the cache server according to the collector SN, and analyze whether the cache data exists; If there is no cached data, the latest status information of the device is queried from the real-time database, and a key-value pair is established between the information and the collector SN; If there is cached data, the cached data will be stored in the cache server and displayed in real time on the PC and mobile terminals.

7. A system for reducing the response delay of cloud data collection, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program of a method for reducing the response delay of cloud data collection, and when the program of the method for reducing the response delay of cloud data collection is executed by the processor, the following steps are implemented: Obtain the equipment composition of the energy storage station, and obtain the real-time status information of each device based on the equipment composition; Extract the collector SN, all device names and device field information based on real-time status information, and generate the binding relationship between the device and the collector; Obtain the configuration classification number of all devices, extract the cloud protocol configuration information of the device, parse the real-time status information of the device, and process it into structured data; Parse the structured data to obtain parsed data, and store the parsed data in the cache server and the real-time database; The data in the cache server is displayed in real time to the PC and mobile terminals.

8. The system for reducing the response delay of cloud data collection according to claim 7 is characterized in that: Obtain the equipment composition of the energy storage station and obtain the real-time status information of each device based on the equipment composition, including: Obtain the equipment composition of the energy storage station, which includes inverters, battery packs, heat pumps, charging piles and electricity meters; Obtain real-time data from inverters, battery packs, heat pumps, charging piles and electric meters; Analyze whether the format of the collected data conforms to the set format, which includes standard JSON format, XML format or custom hex data format; If it meets the set format, real-time status information is generated; If it does not conform to the set format, the collected data will be converted into a different format.

9. The system for reducing the response delay of cloud data collection according to claim 8, characterized in that: Based on the real-time status information, the collector SN, all device names and device field information are extracted to generate the binding relationship between the device and the collector, including: Get the collector SN, all device names and device field information, and analyze whether there are devices with the same name in the collector SN binding relationship; If it does not exist, the device configuration information is obtained, and a sub-device is created based on the device name and the device configuration information, wherein the sub-device includes the device id, the device SN, and the configuration classification number; If the same device name exists in the SN binding relationship of the collector, there is no need to re-establish the binding relationship.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a method program for reducing the response delay of cloud-based data collection. When the method program for reducing the response delay of cloud-based data collection is executed by a processor, the steps of the method for reducing the response delay of cloud-based data collection as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Energy management system

    CN102789219A

  • Data exchange system and exchange method of battery energy storage monitoring system

    CN106599126A

  • Energy storage data acquisition and storage method, system and device and storage medium

    CN114201537A

  • Energy storage system, cloud server and energy storage data management system

    CN116028259A

  • Energy storage EMS intelligent monitoring system

    CN116846077A