Load record data storage method, load record data reading method and electric energy meter
By obtaining the current time point and the preset storage time point set in real time to determine the data storage instructions of the same category, the load record data of the same category is stored in the same data storage address of the same category, which solves the problem of low efficiency in traditional load record data processing methods and realizes fast query and efficient storage.
Patent Information
- Application Number
- CN202510839421.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-10-03
AI Technical Summary
The traditional load record data processing method cannot achieve fast query and retrieval due to the fixed order of processing, resulting in low processing efficiency.
By obtaining the current time point and the preset storage time point set in real time, the same category data storage instruction is determined, and the load record data of the same category is stored in the same same category data storage address to achieve centralized storage.
It improves the query and retrieval efficiency of load record data, reduces redundant data, and supports fast storage and search of load record blocks and phase data.
Smart Images

Figure CN120743979A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method for storing and reading load record data and an electric energy meter. Background Art
[0002] With the rapid development of load record data processing technology, users have put forward higher requirements for load record data processing methods.
[0003] The traditional load record data processing method is to process the load record data using the DL / T645-2007 protocol. The DL / T645-2007 protocol processes the load record data in a fixed order, with the recording period as the interval. For example, the load record data of different categories are stored in a fixed order. This load record data processing method has certain defects. The fixed order of processing different categories of load record data in sequence makes it impossible to quickly query and retrieve the load record data (that is, when querying and retrieving a certain type of load record data, it is necessary to first determine the recording period, and then determine the load record data to be queried and retrieved in a fixed order within the recording period). In other words, this load record data processing method cannot quickly query and retrieve the data due to the fixed order of processing the load record data, resulting in low load record data processing efficiency. Summary of the Invention
[0004] The main purpose of this application is to propose a storage method, a reading method and an electric energy meter for load record data, aiming to solve the technical problem of low efficiency in load record data processing.
[0005] To achieve the above objectives, the present application provides a method for storing load record data, the method comprising the following steps:
[0006] Acquire a current time point in real time, and determine a data storage instruction of the same category according to the current time point and a preset storage time point set, wherein the preset storage time point set includes storage time points of the load record data of different categories;
[0007] The load record data of the same category are stored in the same data storage address of the same category according to the data storage instruction of the same category, so as to realize the centralized storage of the load record data of the same category.
[0008] In one embodiment, the step of determining the same type of data storage instructions based on the current time point and the preset storage time point set includes:
[0009] Determining a first storage time point in a set of preset storage time points, wherein the first storage time point is a storage time point of the load record data of different categories;
[0010] In a case where the current time point is the first storage time point, a load record data category corresponding to the first storage time point is determined, and a data storage instruction of the same category is determined according to the load record data category and the current time point.
[0011] In one embodiment, after the step of determining the load record data category corresponding to the first storage time point, the method further includes:
[0012] generating a data refreezing index corresponding to the load record data category when the category time interval of the load record data category changes, and determining a data storage instruction for the same category according to the data refreezing index;
[0013] When the category time interval of the load record data category does not change, the target storage location and target load record data corresponding to the load record data category are determined, and the instruction to store the target load record data in the target storage location is used as a data storage instruction of the same category.
[0014] In one embodiment, the step of determining a data storage instruction of the same category based on the load record data category and the current time point includes:
[0015] Determine the last storage time point and the category time interval of the load record data category, and determine the time interval between the current time point and the last storage time point;
[0016] When the time interval difference is greater than or equal to a preset multiple of the category time interval, generating a data refreezing index corresponding to the load record data category, and determining a data storage instruction for the same category according to the data refreezing index;
[0017] When the time interval difference is less than the category time interval of a preset multiple, the target storage location corresponding to the load record data category and the target load record data are determined, and the instruction to store the target load record data in the target storage location is used as a data storage instruction of the same category.
[0018] In one embodiment, the step of determining the same type of data storage instructions according to the data patching index includes:
[0019] When the number of the data patching indexes is greater than a maximum number threshold, deleting the earliest data patching index, and performing the step of determining a target storage location corresponding to the load record data category and target load record data;
[0020] When the number of the data patching indexes is less than or equal to a maximum number threshold, a step of determining a target storage location corresponding to the load record data category and target load record data is performed.
[0021] To achieve the above-mentioned object, the present application provides a method for reading load record data. The method for reading load record data applies the above-mentioned method for storing load record data. The method for reading load record data includes the following steps:
[0022] Obtaining a data reading instruction for the load record data, wherein the data reading instruction includes a data reading protocol and a data reading requirement;
[0023] Read load record data is determined according to the data reading protocol, the data reading requirement and storage addresses of data of the same category.
[0024] In one embodiment, the data reading protocol includes a first data reading protocol, and the step of determining the read load record data according to the data reading protocol, the data reading requirement, and a storage address of data of the same category includes:
[0025] When the first reading mode in the data reading requirement is a specified time reading mode, determining a first specified time point in the data reading requirement, and using the load record data corresponding to the first specified time point in the data storage address of the same category as the read load record data, wherein the read load record data is output in a preset first data frame;
[0026] In a case where the first reading mode in the data reading requirement is the initial record reading mode, the load record data stored at the initial storage time point in the data storage address of the same category is used as the read load record data;
[0027] In a case where the first reading mode in the data reading requirement is the end record reading mode, the load record data stored at the end storage time point in the data storage address of the same category is used as the read load record data.
[0028] In one embodiment, after the step of determining the read load record data according to the data read protocol, the data read requirement, and the storage address of data of the same category, the method further includes:
[0029] When the first reading mode in the data reading requirement is the designated time reading mode and the second reading mode in the data reading requirement is the next record reading mode, determining a storage time point next to the first designated time point in the data reading requirement as the second storage time point, and using the load record data stored at the second storage time point in the data storage address of the same category as the read load record data;
[0030] When the first reading mode in the data reading requirement is the initial record reading mode and the second reading mode in the data reading requirement is the next record reading mode, the next storage time point of the initial storage time point is determined as the third storage time point, and the load record data stored at the third storage time point in the same category data storage address is used as the read load record data.
[0031] In one embodiment, the data read protocol includes a second data read protocol, the data category of the second data read protocol includes and is greater than the data category of the first data read protocol, and the data category of the second data read protocol corresponds one-to-one to the data category at the data storage address of the same category. The step of determining the target category load record data based on the data read protocol, the data read requirement, and the data storage address of the same category includes:
[0032] When the first reading mode in the data reading requirement is a specified time reading mode, determining a second specified time point in the data reading requirement, and using the load record data stored at the second specified time point in the data storage address of the same category as the read load record data, wherein the read load record data is output in a manner of a preset second data frame;
[0033] When the second reading mode in the data reading requirement is the next record reading mode, the next storage time point of the second specified time point in the data reading requirement is determined as the fourth storage time point, and the load record data stored at the fourth storage time point in the same category data storage address is used as the read load record data.
[0034] The present application also provides an electric energy meter, comprising:
[0035] An electric power variable collector, the electric power variable collector being connected to the power grid;
[0036] A load record data processor connected to the power variable collector;
[0037] The load record data processor is further configured to execute the steps of the load record data storage method described above, and execute the steps of the load record data reading method described above.
[0038] The present application provides a method for storing load record data, which obtains the current time point in real time and determines a same-category data storage instruction based on the current time point and a preset storage time point set, wherein the preset storage time point set includes storage time points of load record data of different categories; and stores load record data of the same category at the same same-category data storage address according to the same-category data storage instruction, so as to realize centralized storage of load record data of the same category.
[0039] By determining a data storage instruction of the same category based on the current time point and a preset storage time point set, and storing the load record data of the same category at the same data storage address of the same category based on the data storage instruction of the same category, the load record data of the same category will now have the same data storage address of the same category, so as to facilitate subsequent search. This avoids the phenomenon in the prior art where different categories of load record data are processed sequentially in a fixed order and cannot be quickly queried and retrieved (i.e., when querying and retrieving a certain type of load record data, it is necessary to first determine the recording period in which it is located, and then determine the load record data to be queried and retrieved in a fixed order within the recording period). By storing the load record data of the same category at the same data storage address of the same category, so as to facilitate subsequent rapid search and retrieval, the efficiency of load record data processing can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0041] Figure 1 Schematic diagram of the load recording data processor structure of the hardware operating environment involved in the embodiment of the present application;
[0042] Figure 2 A flowchart of a method for storing load record data according to an embodiment of the present application is shown;
[0043] Figure 3 A control flow diagram of a method for storing load record data according to an embodiment of the present application;
[0044] Figure 4 1 is a flow chart of a method for reading load record data according to an embodiment of the present application;
[0045] Figure 5A control flow diagram of a method for reading load record data according to an embodiment of the present application;
[0046] Figure 6 1 is another control flow diagram of a method for reading load record data according to an embodiment of the present application;
[0047] Figure 7 A schematic diagram of a module of an electric energy meter according to an embodiment of the present application;
[0048] Figure 8 Schematic diagram of a load record data processor module according to an embodiment of the present application.
[0049] Description of Figure Numbers:
[0050] 0001, communication bus; 0002, acquisition interface; 0003, processor; 0004, processing interface; 0005, memory; 100, electric energy meter; 10, electric power variable collector; 20, load record data processor; 200, power grid.
[0051] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0053] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.
[0054] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0055] Reference Figure 1 , Figure 1 This is a schematic diagram of the load recording data processor structure of the hardware operating environment involved in the embodiment of the present application.
[0056] like Figure 1 As shown, the load record data processor may include: a processor 0003, such as a central processing unit (CPU), a communication bus 0001, an acquisition interface 0002, a processing interface 0004, and a memory 0005. Among them, the communication bus 0001 is used to realize the connection and communication between these components. The acquisition interface 0002 may include an information acquisition device and an acquisition unit such as a computer. Optionally, the acquisition interface 0002 may also include a standard wired interface and a wireless interface. The processing interface 0004 may optionally include a standard wired interface and a wireless interface. The memory 0005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk storage. The memory 0005 may also be a storage device independent of the aforementioned processor 0003.
[0057] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the load record data processor, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0058] like Figure 1 As shown, the memory 0005 as a computer storage medium may include an acquisition interface module, a processing interface module, and a storage program for load recording data.
[0059] exist Figure 1 In the load record data processor shown, the communication bus 0001 is mainly used to realize the connection communication between components; the acquisition interface 0002 is mainly used to connect to the background server and communicate data with the background server; the processing interface 0004 is mainly used to connect to the deployment end (user end) and communicate data with the deployment end; the processor 0003 and the memory 0005 in the load record data processor of this application can be set in the load record data processor, and the load record data processor calls the storage program of the load record data stored in the memory 0005 through the processor 0003, and executes the load record data storage method provided in the embodiment of this application.
[0060] Based on the above hardware structure, an embodiment of a method for storing load record data of the present application is proposed.
[0061] In one embodiment of the present application, Figure 2 As shown, Figure 2 FIG. 1 is a flow chart of a method for storing load record data according to an embodiment of the present application. The method for storing load record data includes:
[0062] Step S10: obtaining the current time point in real time, and determining a data storage instruction of the same category based on the current time point and a preset storage time point set, wherein the preset storage time point set includes storage time points of load record data of different categories;
[0063] For example, with the continuous development of the power system, the protocol part on the electricity meter is constantly increasing in response to demand, and the current load record still uses the data structure design based on the DL / T645-2007 protocol. The processing method of the DL / T645-2007 protocol is to use the recording period as the interval, and to centrally process different categories of load record data in a fixed order, which will result in long retrieval time and large program calculation amount.
[0064] In this embodiment, when storing load record data, the current time point is obtained in real time, and then a data storage instruction for the same category is determined based on the current time point and a preset storage time point set. The preset storage time point set includes storage time points for different categories of load record data. The current time point refers to a real-time time point, not a time point during a timer interval or interruption. The data storage instruction for the same category refers to storage instructions for load record data of the same category. The load record data refers to power variables such as voltage, current, active power, reactive power, power factor, active energy, reactive energy, etc. Because the preset storage time point set includes storage time points for different categories of load record data, namely, recording time points at which parameters such as voltage, current, active power, reactive power, power factor, active energy, and reactive energy are recorded, load record data of the same category can be stored for that recording time point, facilitating subsequent rapid reading of a particular category of data, thereby improving the efficiency of load record data processing.
[0065] Step S20 , storing the load record data of the same category at the same data storage address according to the data storage instruction of the same category, so as to realize centralized storage of the load record data of the same category.
[0066] In this embodiment, after determining the same-category data storage instruction, load record data of the same category is stored at the same same-category data storage address based on the same-category data storage instruction, thereby achieving centralized storage of load record data of the same category. That is, the same load record data is stored at the same address based on the same-category data storage instruction. This same-category data storage method not only supports reading load record blocks, but also supports reading data for each phase, reducing redundant data. It is worth noting that the same-category data storage address can be a large address block to store multiple load record data of the same category. In this case, the corresponding data can be quickly stored and retrieved, thereby improving the efficiency of load record data processing. Taking the 2014 protocol specification as an example, the 2014 protocol specification is divided into 11 categories of data. Then, 11 same-category data storage addresses can be used to store load record data of the same category, respectively, so that space for 35,040 (365*24*4, with a default interval of 15 minutes) records of 11 categories of data can be cyclically scrolled in the flash space.
[0067] This embodiment provides a method for storing load record data. The method obtains a current time point in real time and determines a same-category data storage instruction based on the current time point and a preset storage time point set, wherein the preset storage time point set includes storage time points for load record data of different categories. Load record data of the same category is stored at the same same-category data storage address based on the same-category data storage instruction, thereby achieving centralized storage of load record data of the same category. By determining the same-category data storage instruction based on the current time point and the preset storage time point set, and storing the load record data of the same category at the same same-category data storage address based on the same-category data storage instruction, the load record data of the same category now has a common same-category data storage address, facilitating subsequent search. This avoids the problem in the prior art of sequentially processing different categories of load record data in a fixed order, which prevents rapid query and retrieval of the load record data (i.e., when querying and retrieving a certain type of load record data, it is necessary to first determine the recording period in which it exists, and then determine the load record data to be queried and retrieved in a fixed order within the recording period). By storing the load record data of the same category at the same same-category data storage address, rapid query and retrieval can be facilitated, thereby improving the efficiency of load record data processing.
[0068] In one embodiment, based on the first embodiment of the method for storing load record data, a second embodiment of the present application is proposed. The step of determining the same type of data storage instructions based on the current time point and the preset storage time point set includes:
[0069] Step S11, determining a first storage time point in a preset storage time point set, wherein the first storage time point is a storage time point of load record data of different categories;
[0070] Step S12: when the current time point is the first storage time point, determine the load record data category corresponding to the first storage time point, and determine a data storage instruction of the same category according to the load record data category and the current time point.
[0071] In this embodiment, taking 11 types of load record data as an example, since the preset storage time point set records the first storage time point of each of the 11 types of load record data, that is, there may be 11 first storage time points for each of the 11 types of load record data, or there may be a situation where multiple types of load record data share a first storage time point. At each current time point, a determination is made as to whether the current time point is the first storage time point in the preset storage time point set. If the current time point is not the first storage time point in the preset storage time point set, it can be determined that no load record data needs to be stored at this time. Conversely, if the current time point is the first storage time point, that is, the load record data category corresponding to the first storage time point needs to be recorded at the current time point, then a storage instruction for data of the same category is determined based on the load record data category and the current time point. For example, if there are 11 types of load record data including current and voltage, the first storage time point of current is 1min, 11min, 21min..., and the first storage time point of voltage is 2min, 12min, 22min..., and when the current time point is 1min, current will be determined as the load record data category, and then the storage instruction for the same category of current data can be set to realize the same category storage of current, so as to improve the storage efficiency of current. Figure 3 , Figure 3 This is a control flow diagram of a method for storing load record data according to an embodiment of the present application. Taking 11 types of load record data as an example, the current time point is used to determine whether the time point for that type of data requires recording. If it has not yet reached the time point for recording, the next type of load record data is processed. Once the determination of all 11 types of load record data is completed, the next current time point is determined. Only when the current time point is determined to be the recording time point for at least one type of data is a subsequent instruction for storing data of the same type executed, thereby consolidating the load record data of the same type into the same location. This improves data storage efficiency. Specifically, data that needs to be stored within the same cycle is stored individually in the same category's location, rather than storing all different types of data within the same cycle simultaneously. This improves data storage efficiency.
[0072] In one embodiment, based on the first and second embodiments of the method for storing load record data, a third embodiment of the present application is proposed. After the step of determining the load record data category corresponding to the first storage time point, the method further includes:
[0073] Step S121: When the time interval of the load record data category changes, a data refreezing index corresponding to the load record data category is generated, and a data storage instruction for the same category is determined based on the data refreezing index;
[0074] Step S122, when the category time interval of the load record data category does not change, determine the target storage location corresponding to the load record data category and the target load record data, and use the instruction to store the target load record data in the target storage location as a data storage instruction of the same category.
[0075] In this embodiment, to ensure data continuity across recording cycles, a data patching index is created when the class time interval of the load record data category changes. For example, if the current class time interval changes from 10 minutes to 11 minutes, a data patching index is created to ensure data continuity before the class time interval change, thereby ensuring the accuracy of the entire data storage. The data patching index is an index for patching data of that category when the class time interval changes. Data continuity is ensured based on the data patching index, and the same-category data storage instruction is determined based on the data patching index. If the class time interval of the load record data category remains unchanged, no data patching index is required. Instead, the target storage location and target load record data corresponding to the load record data category are directly determined. The instruction to store the target load record data at the target storage location is used as the same-category data storage instruction. For example, if the target storage location is location A and the target load record data is data B, data B is stored at location A. That is, all data B in each recording cycle during the entire load record data storage process is stored at location A, thereby improving the storage efficiency of data B and facilitating subsequent rapid search of data B.
[0076] In one embodiment, the step of determining a data storage instruction of the same category according to the load record data category and the current time point includes:
[0077] Step S123, determining the last storage time point and the category time interval of the load record data category, and determining the time interval between the current time point and the last storage time point;
[0078] Step S124: if the time interval difference is greater than or equal to a preset multiple of the class time interval, generating a data refreezing index corresponding to the load record data class, and determining a data storage instruction for the same class according to the data refreezing index;
[0079] Step S125, when the time interval difference is less than the preset multiple of the category time interval, determine the target storage location corresponding to the load record data category and the target load record data, and use the instruction to store the target load record data in the target storage location as the same category data storage instruction.
[0080] In this embodiment, data storage requires refreezing of each data type after a power outage or time calibration. If the existing method of simultaneously storing data of different categories throughout a cycle is used, multiple refreezing indexes for different data categories will need to be created, resulting in the load record not being able to meet the requirement of recording data for 365 days. However, the present application determines the last stored time point and category time interval of the load record data category, and then determines the time interval between the current time point and the last stored time point. For example, if the load record data category is current, assuming the last stored time point of current was 19 minutes, the category time interval of current is 10 minutes, and the current time point is 38 minutes, the time interval difference is determined to be 19 minutes. Since the current at 19 minutes has an index, and the current at 39 minutes also has an index, the current is still continuous in time, and no data refreezing is required. In short, data of the same category are stored in the same location and have indexes. Therefore, there is no need to refreeze the data within at least twice the category time interval, so as to reduce the number of data refreezing indexes used. That is, the preset multiple is at least twice, so that a new data refreezing index needs to be created at more than twice the category time interval. Conversely, the instruction to store the target load record data in the target storage location can be directly used as the same category data storage instruction, so as to reduce the number of refreezing indexes used based on the centralized storage of data of the same category, thereby ensuring the capacity and effect of data storage.
[0081] In one embodiment, based on the first, second, and third embodiments of the method for storing load record data, a fourth embodiment of the present application is proposed. The step of determining data storage instructions of the same category based on the data patching index includes:
[0082] Step a: if the number of data patching indexes is greater than a maximum number threshold, deleting the earliest data patching index and performing the step of determining a target storage location corresponding to the load record data category and the target load record data;
[0083] Step b: when the number of data patching indexes is less than or equal to a maximum number threshold, executing the step of determining a target storage location corresponding to the load record data category and target load record data.
[0084] In this embodiment, when it is determined that the data patching index needs to be used, the number of data patching indexes will be detected. Only when the number of data patching indexes is not greater than the maximum number threshold, the step of determining the target storage location corresponding to the load record data category and the target load record data will be executed. Otherwise, the earliest data patching index will be deleted first, and then the step of determining the target storage location corresponding to the load record data category and the target load record data will be executed again. At this time, the load record data storage method of the present application can be used to reduce the use of data patching indexes, thereby avoiding the problem of deleting the earliest data patching index, so as to ensure the data integrity and continuity throughout the entire process of storing data. Further, please refer to Figure 3 After determining the same-category data storage instructions, it will determine whether a new data refreezing index is needed. That is, if the time point at which recording is required has arrived, the latest index record of the data required to be stored by the same-category data storage instruction will be determined based on the current time point and the latest index record. The latest recording time point of the latest index record (the previous storage time point of the load record data category) is subtracted from the current time point to obtain the interval time (the difference time interval). This interval time is compared with the time interval of the current category (the category time interval). If the interval exceeds two time interval points (i.e., it is more than twice the category time interval) or the time interval is modified (i.e., the category time interval has changed), a new data refreezing index is required to ensure data continuity. After determining that a new data refreezing index is needed, if it is found that the data refreezing index has reached the maximum number of index entries (the maximum number threshold), a data rollback is required. This means that the oldest data refreezing index and its related data are deleted, thereby creating an additional free data refreezing index for this use. After the data refreeze index is created and refreezes the data, the storage index for the target load record data to be stored is updated. The storage index also records the address and current time point, allowing for quick interpolation based on the address and current time point. Because each type of data has a corresponding index, a new data refreeze index is only created when refreezing spans two or more record points, which to some extent solves the problem of insufficient indexes after multiple refreezes.
[0085] Reference Figure 1 , Figure 1 This is a schematic diagram of the load recording data processor structure of the hardware operating environment involved in the embodiment of the present application.
[0086] like Figure 1As shown, the load record data processor may include: a processor 0003, such as a central processing unit (CPU), a communication bus 0001, an acquisition interface 0002, a processing interface 0004, and a memory 0005. Among them, the communication bus 0001 is used to realize the connection and communication between these components. The acquisition interface 0002 may include an information acquisition device and an acquisition unit such as a computer. Optionally, the acquisition interface 0002 may also include a standard wired interface and a wireless interface. The processing interface 0004 may optionally include a standard wired interface and a wireless interface. The memory 0005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk storage. The memory 0005 may also be a storage device independent of the aforementioned processor 0003.
[0087] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the load record data processor, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0088] like Figure 1 As shown, the memory 0005 as a computer storage medium may include an acquisition interface module, a processing interface module, and a storage program for load recording data.
[0089] exist Figure 1 In the load record data processor shown, the communication bus 0001 is mainly used to realize the connection communication between components; the acquisition interface 0002 is mainly used to connect to the background server and communicate data with the background server; the processing interface 0004 is mainly used to connect to the deployment end (user end) and communicate data with the deployment end; the processor 0003 and the memory 0005 in the load record data processor of this application can be set in the load record data processor, and the load record data processor calls the storage program of the load record data stored in the memory 0005 through the processor 0003, and executes the load record data reading method provided in the embodiment of this application.
[0090] Based on the above hardware structure and the embodiment of the method for storing load record data, an embodiment of the method for reading load record data of the present application is proposed.
[0091] In one embodiment of the present application, Figure 4 As shown, Figure 4FIG. 1 is a flow chart of a method for reading load record data according to an embodiment of the present application. The method for reading load record data applies the method for storing load record data according to the above embodiment. The method for reading load record data includes:
[0092] Step S30, obtaining a data reading instruction of the load record data, wherein the data reading instruction includes a data reading protocol and a data reading requirement;
[0093] In this embodiment, load record data of the same category are centrally stored in the same data storage address of the same category in the manner of the above embodiment, so that when a data reading instruction of the load record data is obtained, it will be quickly read based on the data storage address of the same category to ensure the efficiency of reading the load record data.
[0094] Step S40 , determining the read load record data according to the data read protocol, the data read requirement and the storage address of the same type of data.
[0095] In this embodiment, when load record data is read, data under the same category data storage address is read in a targeted manner through the data reading protocol and data reading requirements. Since the data is stored in the same category data storage address in the same category, the required data can be read quickly. Among them, the data reading protocol refers to a user-defined data reading protocol, such as DL / T645-2007 protocol or DL / T645-2014, etc., and the data reading requirement refers to what kind of data or when the data needs to be read, so that specific categories of data are read in a targeted manner under the same category data storage address based on the data reading protocol and data reading requirements. Since the same category data storage addresses store the same category of data, data reading can be achieved quickly.
[0096] This embodiment provides a method for reading load record data. The method comprises obtaining a data read instruction for load record data, wherein the data read instruction includes a data read protocol and a data read requirement; and determining the load record data to be read based on the data read protocol, the data read requirement, and the storage address of data of the same category. The method determines the load record data to be read based on the data read protocol, the data read requirement, and the storage address of data of the same category because, when reading the data, load record data of the same category is already stored at the same data storage address of the same category, facilitating rapid reading. This avoids the problem in the prior art of sequentially processing load record data of different categories in a fixed order, preventing rapid query and retrieval of the load record data (i.e., when querying and retrieving a certain type of load record data, it is necessary to first determine the recording period in which it is located, and then determine the load record data to be queried and retrieved in a fixed order within the recording period). By storing load record data of the same category at the same data storage address of the same category, rapid query and retrieval can be facilitated, thereby improving the efficiency of load record data processing.
[0097] In one embodiment, based on the first embodiment of the method for reading load record data, a second embodiment of the present application is proposed. The data reading protocol includes a first data reading protocol. The steps of determining the load record data reading according to the data reading protocol, the data reading requirement, and the storage address of the same type of data include:
[0098] Step S41, when the first reading mode in the data reading requirement is a specified time reading mode, determining a first specified time point in the data reading requirement, and using the load record data corresponding to the first specified time point in the data storage address of the same category as the read load record data, wherein the read load record data is output in a preset first data frame;
[0099] Step S42: when the first reading mode in the data reading requirement is the initial record reading mode, the load record data stored at the initial storage time point in the data storage address of the same category is used as the read load record data;
[0100] Step S43 , when the first reading mode in the data reading requirement is the end record reading mode, the load record data stored at the end storage time point in the same type of data storage address is used as the read load record data.
[0101] In this embodiment, the data reading protocol includes a first data reading protocol, wherein the first data reading protocol is a DL / T645-2007 protocol with fewer data categories, such as only 6 categories. Because the same category data storage address is used to store the same category data. In the case that the first reading mode in the data reading requirement is a specified time reading mode, by determining the first specified time point in the data reading requirement, and using the load record data corresponding to the first specified time point in the same category data storage address as the read load record data, the read load record data is output in the form of a preset first data frame (i.e., the output mode after the DL / T645-2007 protocol reads the data), wherein the first specified time point refers to the time specified for reading data under the DL / T645-2007 protocol, such as 201min, it will be searched in the same category data storage address based on the first specified time point, and the main search method is to search based on 6 categories of load record data, such as 6 categories of load record data are voltage, current, active power and so on. For power, reactive power, power factor, and active energy, the corresponding initial storage times are 1 minute, 2 minutes, 3 minutes, 4 minutes, 5 minutes, and 6 minutes, respectively, and the recording cycle is 10 minutes long. This means that voltage is determined to be the data to be found, and the 201 / 10+1=21st voltage will be found as the load record data to be read (i.e., after determining it is voltage, it will be directly read from the same category data storage address where the voltage is stored). Of course, the load record data to be read depends on the actual field, and the return time or data or other display methods are not limited here. When the first specified time point is 200.5 minutes, 21 voltages will also be found as the load record data to be read, that is, the closest data can be found. In the case where the first reading mode in the data reading requirement is the initial record reading mode, the load record data stored at the initial storage time point in the same category data storage address is used as the load record data to be read. The initial storage time point refers to the time point when the first data is stored. In the above example, the first voltage can be determined as the load record data to be read. In the case where the first reading mode in the data reading requirement is the end record reading mode, the load record data stored at the end storage time point in the same category data storage address is used as the read load record data. The end storage time point refers to the time point when the last data is stored, that is, the current time point in the above example is 7 minutes, then it can be determined that the active electric energy is the load record data to be read. Then, data reading can be quickly realized based on the reading mode and the same category storage method to ensure the reading efficiency of the load record data. Further, you can refer to Figure 5 , Figure 5This is a control flow diagram of a method for reading load record data involved in an embodiment of the present application. The protocol in this embodiment takes the DL / T645-2007 protocol as an example. When a load record data reading request of the 2007 protocol is received, the stored load record data will be read. Assuming that a specified time reading request is received (i.e., specified time reading mode), if there are record nodes with the same time in the 6 categories, the record node time will be recorded as T, that is, the category of the 6 categories will be determined. If there are no records with the same time node, the record time point closest to the specified time will be searched backward and recorded as T. Assuming that a request to read the earliest record is received (i.e., initial record reading mode), the earliest time point obtained by comparing the 6 categories of data is recorded as T. Assuming that a request to read the most recent record is received (end record reading mode), the latest time point obtained by comparing the 6 categories of data is recorded as T. After determining the time point, T is first recorded in the last read time LT for use when reading the next record. Then, based on the order of the six categories, it is determined whether each type of data is recorded at time T. The recorded data is combined with 0xAA (data separator) to form the load record content, and the frame header and frame footer are added to form the reply frame (that is, the output method is the preset first data frame, that is, the output method after reading data according to the DL / T645-2007 protocol, which is not explained in detail here). That is, 0xAA, 0xAA, AA, AA, AA, AA, AA, then the first and second categories are determined to be the data to be read, thus completing the data reading.
[0102] Furthermore, after the step of determining the load record data to be read according to the data reading protocol, the data reading requirement and the storage address of the same type of data, the method includes:
[0103] Step S45: If the first reading mode in the data reading request is the specified time reading mode and the second reading mode in the data reading request is the next record reading mode, determining a storage time point next to the first specified time point in the data reading request as the second storage time point, and using the load record data stored at the second storage time point in the same type of data storage address as the read load record data;
[0104] Step S46, when the first reading mode in the data reading requirement is the initial record reading mode and the second reading mode in the data reading requirement is the next record reading mode, determine the next storage time point of the initial storage time point as the third storage time point, and use the load record data stored at the third storage time point in the same category data storage address as the read load record data.
[0105] In this embodiment, after determining to read the load record data, the next reading can also be performed based on the previous reading mode, but at this time it only involves the specified time reading mode and the initial record reading mode. In the case that the first reading mode in the data reading requirement is the specified time reading mode, and the second reading mode in the data reading requirement is the next record reading mode, the next storage time point of the first specified time point in the data reading requirement will be determined as the second storage time point, and the load record data stored at the second storage time point in the same category data storage address will be used as the read load record data, that is, the reading of the next data can be completed, such as 202min in the above embodiment as the second storage time point, and then 21 currents will be determined as the read load record data. Of course, in the case of the next record reading mode after the initial record reading mode, 2min in the above embodiment can be determined as the third storage time point, and 1 current will be determined as the read load record data to complete the data reading. The second reading mode refers to the reading mode executed after the first reading mode, and there is a sequence of execution of the two. Please refer to Figure 5 When a request to continue reading the next frame (next record reading mode) is received and the number of records to be read is not 0, the time point of searching for the next record closest to LT is recorded as T to complete the reading of the next load record data. Therefore, the efficiency of data reading can be guaranteed based on different modes and centralized storage of the same category of data.
[0106] In one embodiment, based on the first and / or second embodiments of the method for reading load record data, a third embodiment of the present application is provided, wherein the data reading protocol includes a second data reading protocol, the data category of the second data reading protocol includes and is greater than the data category of the first data reading protocol, and the data category of the second data reading protocol corresponds one-to-one to the data category at the data storage address of the same category. The step of determining the target category load record data according to the data reading protocol, the data reading requirement, and the data storage address of the same category includes:
[0107] Step S47: If the first reading mode in the data reading requirement is a designated time reading mode, determining a second designated time point in the data reading requirement, and using the load record data stored at the second designated time point in the same type of data storage address as the read load record data, wherein the read load record data is output in a preset second data frame;
[0108] Step S48, when the second reading mode in the data reading requirement is the next record reading mode, determine the next storage time point of the second specified time point in the data reading requirement as the fourth storage time point, and use the load record data stored at the fourth storage time point in the same category data storage address as the read load record data.
[0109] In this embodiment, the data read protocol includes a second data read protocol. The data category of the second data read protocol includes and is greater than the data category of the first data read protocol. The data category of the second data read protocol corresponds one-to-one with the data category at the data storage address of the same category. That is, the entire solution is stored using the storage protocol corresponding to the second data read protocol, and can be read using the second data read protocol and / or the first data read protocol. The second data read protocol and the corresponding storage protocol can be DL / T645-2014. In this case, if the first read mode in the data read requirement is a specified time read mode, a second specified time point in the data read requirement is determined, and the load record data stored at the data storage address of the same category at the second specified time point is used as the read load record data. The read load record data is output in a preset second data frame (the output method after reading data according to the DL / T645-2014 protocol is not further described herein). That is, the data stored at or near the second specified time point is read as the read load record data. Of course, it can also be the next record reading mode, and then the next storage time point of the second specified time point in the data reading requirement is used as the fourth storage time point, and the load record data stored at the fourth storage time point in the same category data storage address is used as the read load record data, that is, the next time point of the specified time point is read as the fourth storage time point, and the data read at the fourth storage time point is used as the read load record data. Further, you can refer to Figure 6 , Figure 6 This is another control flow diagram of the method for reading load record data involved in an embodiment of the present application. Taking DL / T645-2014 as an example, when a specified time read request is received (specified time read mode), the time point that is closest to the issuance time is found and recorded as T. When a read request to read the next record is received (next record read mode), the next time point closest to LT is found and recorded as T. Time T is recorded to the last read time LT. Then the corresponding data framing reply is found according to time T. It is worth noting that when retrieving and reading data with 2DL / T645-2014, various types of data can be searched and read faster than DL / T645-2007, and code maintenance and reading difficulty are reduced.
[0110] Corresponding to the above embodiment, the present application also proposes an electric energy meter.
[0111] like Figure 7 As shown, the electric energy meter of the embodiment of the present application may include:
[0112] The power variable collector 10 is connected to the power grid 200;
[0113] The load record data processor 20 is connected to the power variable collector 10;
[0114] The load record data processor 20 is further configured to execute the steps of any of the above embodiments of the method for storing load record data, and execute the steps of any of the above embodiments of the method for reading load record data.
[0115] In this embodiment, the load record data processor 20 determines a data storage instruction for the same category based on the current time point and a preset storage time point set, and stores the load record data of the same category at the same data storage address based on the data storage instruction for the same category. At this time, the load record data of the same category will have the same data storage address for the same category, which is convenient for subsequent search. This avoids the problem that the existing technology processes different categories of load record data in a fixed order and cannot quickly query and retrieve the load record data (i.e., when querying and retrieving a certain type of load record data, it is necessary to first determine the recording period in which it is located, and then determine the load record data to be queried and retrieved in a fixed order within the recording period). By storing the load record data of the same category at the same data storage address for subsequent rapid search and retrieval, the efficiency of load record data processing can be improved. It is worth noting that the power variable collector 10 can be a sensor for collecting parameters such as current and voltage, or it can be other collection instruments, which are not limited here. Of course, the electric energy meter can also include more instruments, which are not described one by one.
[0116] This application also provides a load record data processor, referring to Figure 8 , Figure 8 This is a schematic diagram of a load record data processor module according to an embodiment of the present application. The load record data processor includes:
[0117] The data storage module A01 is configured to obtain the current time point in real time and determine a same-category data storage instruction based on the current time point and a preset storage time point set, wherein the preset storage time point set includes storage time points for load record data of different categories; and store the load record data of the same category at the same same-category data storage address according to the same-category data storage instruction, thereby realizing centralized storage of the load record data of the same category;
[0118] The data reading module A02 is used to obtain a data reading instruction for load record data, wherein the data reading instruction includes a data reading protocol and a data reading requirement; and determines to read the load record data according to the data reading protocol, the data reading requirement and the storage address of the same type of data.
[0119] The present application also provides a storage medium, which is a computer storage medium.
[0120] The storage medium of the present application stores a program for storing load record data, and when the program for storing load record data is executed by a processor, the steps of the above method for storing load record data are implemented.
[0121] Among them, the method implemented when the load record data storage program running on the processor is executed can refer to the various embodiments of the load record data storage method of this application, and will not be repeated here.
[0122] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0123] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0124] The above are merely optional embodiments of the present application and do not limit the patent scope of the present application. All equivalent structural transformations made using the contents of the present application specification and drawings under the inventive concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for storing load record data, characterized in that: The method for storing load record data comprises the following steps: Acquire a current time point in real time, and determine a data storage instruction of the same category according to the current time point and a preset storage time point set, wherein the preset storage time point set includes storage time points of the load record data of different categories; The load record data of the same category are stored in the same data storage address of the same category according to the data storage instruction of the same category, so as to realize the centralized storage of the load record data of the same category.
2. The method for storing load record data according to claim 1, wherein: The step of determining the same type of data storage instructions according to the current time point and the preset storage time point set includes: Determining a first storage time point in a set of preset storage time points, wherein the first storage time point is a storage time point of the load record data of different categories; In a case where the current time point is the first storage time point, a load record data category corresponding to the first storage time point is determined, and a data storage instruction of the same category is determined according to the load record data category and the current time point.
3. The method for storing load record data according to claim 2, wherein: After the step of determining the load record data category corresponding to the first storage time point, the method further includes: generating a data refreezing index corresponding to the load record data category when the category time interval of the load record data category changes, and determining a data storage instruction for the same category according to the data refreezing index; When the category time interval of the load record data category does not change, the target storage location and target load record data corresponding to the load record data category are determined, and the instruction to store the target load record data in the target storage location is used as a data storage instruction of the same category.
4. The method for storing load record data according to claim 2, wherein: The step of determining a data storage instruction of the same category according to the load record data category and the current time point includes: Determine the last storage time point and the category time interval of the load record data category, and determine the time interval between the current time point and the last storage time point; When the time interval difference is greater than or equal to a preset multiple of the category time interval, generating a data refreezing index corresponding to the load record data category, and determining a data storage instruction for the same category according to the data refreezing index; When the time interval difference is less than the category time interval of a preset multiple, the target storage location corresponding to the load record data category and the target load record data are determined, and the instruction to store the target load record data in the target storage location is used as a data storage instruction of the same category.
5. The method for storing load record data according to any one of claims 3 or 4, characterized in that: The step of determining the data storage instructions of the same category according to the data refreezing index comprises: When the number of the data patching indexes is greater than a maximum number threshold, deleting the earliest data patching index, and performing the step of determining a target storage location corresponding to the load record data category and target load record data; When the number of the data patching indexes is less than or equal to a maximum number threshold, a step of determining a target storage location corresponding to the load record data category and target load record data is performed.
6. A method for reading load record data, characterized in that: The method for reading load record data applies the method for storing load record data according to any one of claims 1 to 5, and the method for reading load record data comprises the following steps: Obtaining a data reading instruction for the load record data, wherein the data reading instruction includes a data reading protocol and a data reading requirement; Read load record data is determined according to the data reading protocol, the data reading requirement and storage addresses of data of the same category.
7. The method for reading load record data according to claim 6, wherein: The data reading protocol includes a first data reading protocol, and the step of determining the read load record data according to the data reading protocol, the data reading requirement, and the storage address of data of the same category includes: When the first reading mode in the data reading requirement is a specified time reading mode, determining a first specified time point in the data reading requirement, and using the load record data corresponding to the first specified time point in the data storage address of the same category as the read load record data, wherein the read load record data is output in a preset first data frame; In a case where the first reading mode in the data reading requirement is the initial record reading mode, the load record data stored at the initial storage time point in the data storage address of the same category is used as the read load record data; In a case where the first reading mode in the data reading requirement is the end record reading mode, the load record data stored at the end storage time point in the data storage address of the same category is used as the read load record data.
8. The method for reading load record data according to claim 7, wherein: After the step of determining the read load record data according to the data reading protocol, the data reading requirement and the storage address of data of the same category, the following steps are included: When the first reading mode in the data reading requirement is the designated time reading mode and the second reading mode in the data reading requirement is the next record reading mode, determining a storage time point next to the first designated time point in the data reading requirement as the second storage time point, and using the load record data stored at the second storage time point in the data storage address of the same category as the read load record data; When the first reading mode in the data reading requirement is the initial record reading mode and the second reading mode in the data reading requirement is the next record reading mode, the next storage time point of the initial storage time point is determined as the third storage time point, and the load record data stored at the third storage time point in the same category data storage address is used as the read load record data.
9. The method for reading load record data according to claim 6, wherein: The data reading protocol includes a second data reading protocol, the data category of the second data reading protocol includes and is greater than the data category of the first data reading protocol, the data category of the second data reading protocol corresponds one-to-one to the data category at the data storage address of the same category, and the step of determining the target category load record data according to the data reading protocol, the data reading requirement, and the data storage address of the same category includes: When the first reading mode in the data reading requirement is a specified time reading mode, determining a second specified time point in the data reading requirement, and using the load record data stored at the second specified time point in the data storage address of the same category as the read load record data, wherein the read load record data is output in a manner of a preset second data frame; When the second reading mode in the data reading requirement is the next record reading mode, the next storage time point of the second specified time point in the data reading requirement is determined as the fourth storage time point, and the load record data stored at the fourth storage time point in the same category data storage address is used as the read load record data.
10. An electric energy meter, characterized in that: The electric energy meter comprises: An electric power variable collector, the electric power variable collector being connected to the power grid; A load record data processor connected to the power variable collector; The load record data processor is further configured to execute the steps of the load record data storage method according to any one of claims 1 to 5 , and execute the steps of the load record data reading method according to any one of claims 6 to 9 .
Citation Information
Patent Citations
Method for dynamically storing data of electric energy meters
CN104572486A
Load record blocked index storage and inquiry method in cost controlled intelligent electric energy meter
CN104778203A
Data storage method for electric energy meters
CN107239232A
Supplemental recording method for electric energy meter load curve
CN109490618A
Load record data acquisition method and device, load record data storage method and device, equipment and medium
CN118612575A