[New patent introduction] A data storage method and system for smart meters

Smart meters are one of the basic equipment for data collection in smart grids (especially smart distribution networks). They are responsible for the collection, measurement and transmission of raw electrical energy data, and are the basis for information integration, analysis and optimization, and information presentation. With the development of the market, people's demand for smart meters is also increasing. Among them, higher requirements are put forward for the type and frequency of collected data, and more and more data need efficient storage and query.

There are three main pieces of information that need to be saved for collecting data from smart meters: 1. Time; 2. Data type; 3. Data content. The initial storage scheme adopted by people is to store sequentially, that is, each time new data is collected, the above three information is stored in sequence after the last data in the storage flash. When reading, it starts from the first data and traverses until it is found. The required data.

This kind of scheme does not leave gaps when storing data, and the space utilization is relatively sufficient, but it needs to traverse all when searching for data, and the search speed is relatively slow. In order to improve the search speed, people later adopted the fixed-length interval storage scheme, that is, the storage interval is set according to the maximum data length, and the offset address of the data to be queried can be directly calculated according to the time difference between the start time and the search time. This solution is quick to query, but when the data is irregular, a lot of storage space is wasted, and less effective information is stored in the limited storage space.

It can be seen that the existing technology either emphasizes the maximization of space utilization and the query speed is very slow; or emphasizes the speed of querying data, which is very wasteful of storage space, and cannot achieve the best balance of query speed and space utilization.

The features and advantages of the present invention are partially stated in the following description, or can be obvious from the description, or can be learned by practicing the present invention.

In order to overcome the problems of the prior art, the present invention provides a data storage method and system for a smart meter, which divides the time according to the data collection period into a plurality of time periods, and stores the data in the storage according to the time period in which the data is collected. In the storage page of the area, it is saved as empty data during the time period when the data is not available. There is no need to record the time of each data, which saves storage space; at the same time, the time of the first data is recorded in the storage page of each page. Technical means accelerate the speed of data query and achieve a good balance between query speed and space utilization.

[New patent introduction] A data storage method and system for smart meters
Figure is a schematic flowchart of a data storage method for a smart meter according to an embodiment of the present invention

The technical solutions adopted by the present invention to solve the above technical problems are as follows: According to one aspect of the present invention, a data storage method for a smart meter is provided, which includes: determining that a storage area has a plurality of storage pages, and if the storage area does not have the storage page , The storage area is divided into a plurality of the storage pages according to the size of the storage area; the time is divided into a plurality of time periods, and each time period occupies a certain storage space on the storage page; the data is collected according to The time period in which the time is located is stored in the storage page. If the data is not available for a certain period of time, it is saved as empty data in the time period without the data; the first record is recorded in the storage page for each page Data time.

According to an embodiment of the present invention, when the data is stored in the storage page according to the time period of the collection time, the storage space required for storing the data is first calculated, and if the storage space in the storage page is insufficient, the new The storage page.

According to an embodiment of the present invention, when storing the data in the storage page according to the time period of the collection time, first read the information of the last saved data, if the last saved data is the empty data , And the data saved this time is also the empty data, the number of empty data is updated in the storage space of the empty data saved last time. In the storage page, it is also necessary to record the offset of the previous data storage, the type of data stored in the storage page, and the number of copies of the data stored in the storage page. According to another aspect of the present invention, there is provided a data query method of a smart meter, which is used to query data stored using any of the above-mentioned data storage methods of a smart meter, including:

S1, the time to read the first data recorded in the first page and the last page of the storage page;

S2, according to the time of the data to be queried, calculate the storage page where the data to be queried is located according to the proportional relationship;

S3. Read the storage time of the first data in the storage page calculated by S2, the type of data stored on the page, and the number of copies of the data stored on the page, and determine whether the data to be queried is in the storage page calculated by S2 Inside: if it is, then read the data in the storage page where the data to be queried is located in sequence, until the data to be queried is queried; if not, it is determined that the data to be queried is calculated as the data to be queried Before or after the storage page where the data is located, then recalculate the storage page where the data to be queried is located according to the result of the judgment; if it is calculated before the storage page where the data to be queried is calculated, it will be calculated The storage page where the data to be queried is obtained is taken as the last page, and the storage page where the data to be queried is recalculated according to the proportional relationship; if the storage page where the data to be queried is calculated, After that, the calculated storage page where the data to be queried is located is taken as the first page, and the storage page where the data to be queried is located is recalculated according to the proportional relationship; step S3 is repeated until the query is found data.

According to an embodiment of the present invention, in step S3, the time of the first data in the storage page adjacent to the storage page where the data to be queried is located is also read, and the time of the first data to be queried is determined accordingly. Whether the data of is in the storage page where the data to be queried is located, or whether the data to be queried is before or after the calculated storage page where the data to be queried is located.

According to another aspect of the present invention, a data query system for a smart meter is provided, which is used to query data stored using any of the above-mentioned smart meter data storage methods, including: a time reading module, which is used to read the data in the storage page The time of the first data recorded; the calculation module is used to calculate the storage page of the data to be queried according to the proportional relationship according to the time of the data to be queried; the judgment module is used to determine whether the data to be queried is in The data to be queried is located in the storage page, or to determine whether the data to be queried is before or after the calculated storage page where the data to be queried is located; the data query module is used to read the storage page To find the data that needs to be queried.

According to another aspect of the present invention, there is provided a data storage system for a smart meter, including: a storage page determination or division module for determining that a storage area has a plurality of storage pages, and if the storage area does not have the storage page, then The size of the storage area divides the storage area into a plurality of the storage pages; the time division module is used to divide the time according to the data collection period into a plurality of time periods, and each time period occupies a certain amount of time on the storage page Storage space; the data storage module is used to store the data in the storage page according to the time period of the collection time. If the data is not available in a certain period of time, it will be saved in the period of time when the data is not available Empty data; recording module, used to record the time of the first data in each page of the storage page.

According to an embodiment of the present invention, it further includes a null data count calculation module, which is used for when the last saved data is the null data, and the data saved this time is also the null data, in the last saved the null data The number of updated empty data in the data storage space. The recording module is also used to record the offset of the previous data storage, the type of data stored in the storage page, and the number of copies of the data stored in the storage page.

The present invention provides a data storage method and system for a smart meter, which divides the time period according to the data collection period into a plurality of time periods, stores the time period in which the data is based on the collection time in the storage page of the storage area, and In the time period without the data, it is saved as empty data, there is no need to record the time of each data, and when the empty data is continuously recorded, only the number of empty data needs to be updated, without the need to use new storage space in the storage page. Therefore, the storage space is greatly saved; the present invention also needs to record the time of the first data in each page of the storage page, the type of data in the storage page and other information, so when querying data, through the effective use of this information, speed up In order to improve the speed of data query, the balance between query speed and space utilization is well achieved.

Intelligent Power Distribution Box

Intelligent power distribution box is a new type of power distribution device, with modular structure, fashinable and attactive appearance, and high protection class. It can be used alone or combined with other devices. The products are widely used for the lighting, power and loop control in airport, hospital, school, industrial and civil buildings.

Intelligent Power Distribution Box,Power Distribution Box Waterproof,Small Power Distribution Box,Small Power Distribution Box Waterproof

Jiangsu Sfere Electric Co., Ltd , https://www.elecnova-global.com

Posted on