CN113760957A - Retrieval method and system for historical data of electric energy meter - Google Patents

Retrieval method and system for historical data of electric energy meter Download PDF

Info

Publication number
CN113760957A
CN113760957A CN202111068127.3A CN202111068127A CN113760957A CN 113760957 A CN113760957 A CN 113760957A CN 202111068127 A CN202111068127 A CN 202111068127A CN 113760957 A CN113760957 A CN 113760957A
Authority
CN
China
Prior art keywords
time
searched
point
search
electric energy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111068127.3A
Other languages
Chinese (zh)
Inventor
景程
潘玉刚
顾小峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Holley Technology Co Ltd
Original Assignee
Holley Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Holley Technology Co Ltd filed Critical Holley Technology Co Ltd
Priority to CN202111068127.3A priority Critical patent/CN113760957A/en
Publication of CN113760957A publication Critical patent/CN113760957A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E40/00Technologies for an efficient electrical power generation, transmission or distribution
    • Y02E40/70Smart grids as climate change mitigation technology in the energy generation sector
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Fuzzy Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method and a system for retrieving historical data of an electric energy meter, wherein the method comprises the following steps: optimizing the time to be searched according to the search condition and obtaining the optimized time to be searched; obtaining the values of the earliest time difference value K1 and the latest time difference value K2; calculating a difference value Q between a point to be searched and a search boundary according to the search range and the search direction, calculating a difference value E between a median value of a dichotomy algorithm and the search boundary, and comparing the magnitudes of the two values; searching based on a dichotomy to obtain a middle point, if the middle point is a time point to be searched, finishing the searching, and if the middle point is not the time point to be searched, acquiring a next searching range; comparing the time points to be searched, the occurrence time of the initial number and the end number, and returning the points which are more than or equal to the time points to be searched; and finding out a point which accords with the time point to be searched, and finishing the search. The invention can quickly find the data record corresponding to the time to be searched under the condition of more historical data of the electric energy meter, and shortens the searching time.

Description

Retrieval method and system for historical data of electric energy meter
Technical Field
The invention relates to the technical field of historical electric energy search of electric energy meters, in particular to a method and a system for retrieving historical data of an electric energy meter.
Background
The electric energy meter is used as a power grid terminal and can store the electricity consumption data of a user every minute. In the electricity utilization management process, the load characteristics of customers can be known by reading the load records recorded by the electricity meters, the trend of load change can be known in time, the prediction work of a power grid dispatching department is facilitated, the electric power operation system can be mastered greatly, and the electricity utilization historical data of users need to be retrieved through the electric energy meters in the process.
In the existing technical scheme, a dichotomy is generally adopted as a method for searching the historical electric energy of the electric energy meter. Namely, according to the freezing time to be searched, binary search is carried out in the storage space. When the number of the stored historical electric energy is large, the traditional dichotomy search is time-consuming, and therefore the processing speed of the system is slowed down. However, the currently used intelligent electric energy meter needs to store 1 time of electric energy per minute, and at the same time, the electric energy meter should store at least 1 year of data volume, and the total number of the electric energy meters reaches 525600.
Disclosure of Invention
The invention aims to provide a method and a system for retrieving historical data of an electric energy meter, which are used for solving the problem that the existing electric energy meter historical electric quantity data is long in searching time.
On one hand, the embodiment of the invention provides a method for retrieving historical data of an electric energy meter, which comprises the following steps:
step 1: judging whether the time to be searched needs to be optimized according to the searching conditions, if so, optimizing the time to be searched and obtaining the optimized time to be searched;
step 2: obtaining the values of the earliest time difference value K1 and the latest time difference value K2, determining a searching direction and a predicted point by comparing K1 with K2, determining a searching range and a searching direction if the predicted point is not the time point to be searched, continuing to execute the step 3, ending the searching if the predicted point is the time point to be searched, and jumping to the step 6;
and step 3: calculating a difference Q value between a point to be searched and a search boundary according to the search range and the search direction, calculating a difference E between a median value of a dichotomy algorithm and the search boundary, comparing the magnitude of the difference E and the magnitude of the difference E, jumping to a step 4 if Q is larger than E, finding a predicted point according to the search direction and the Q value if Q is smaller than E, acquiring the next search range and the search direction if the predicted point is not the time point to be searched, jumping to a step 5 if the difference between the number of searched ending bars and the number of starting bars is 1, repeating the step 3 if the predicted point is not the time point to be searched, and jumping to a step 6 if the predicted point is the point to be searched;
and 4, step 4: searching based on a dichotomy to obtain a middle point, if the middle point is a time point to be searched, ending the search, jumping to step 6, if the middle point is not the time point to be searched, acquiring a next search range, judging whether the difference between the ending number and the starting number in the range is 1, if so, jumping to step 5, otherwise, jumping to step 3;
and 5: comparing the time points to be searched, the occurrence time of the initial number and the end number, and returning the points which are more than or equal to the time points to be searched;
step 6: and finding out a point which accords with the time point to be searched, and finishing the search.
Further, the search condition includes a freezing occurrence time designated to read the frozen power data of the power meter, and a freezing start time, a freezing end time designated to read the power data of the power meter at a designated interval.
Further, the determining whether the time to be searched needs to be optimized includes,
and when the searching conditions are that the freezing starting time is appointed, the freezing ending time is appointed, and the electric quantity data of the electric energy meter is read at an appointed interval, judging that the time to be searched needs to be optimized.
Further, optimizing the time to be searched may further include,
and taking the maximum common multiple of the interval time and the freezing period as a search interval, and combining the freezing starting time and the freezing ending time to obtain a new search range.
Further, the earliest time difference value K1 is the time difference between the time to be searched and the earliest 1 record in the records, and the latest time difference value K2 is the time difference between the time to be searched and the latest 1 record in the records.
Further, when the search condition is a designated freeze start time, a freeze end time, and a designated interval, the step 5 further includes the step of,
step 5-1: comparing the time to be searched, the occurrence time of the initial number and the end number, and returning a point equal to the time to be searched;
step 5-2: if the time point is correct, finding a point which accords with the time to be searched, adding 1 to the number of the searched records, otherwise, indicating that the point is not found, continuing to search the next point, judging whether the next point reaches the end of the optimized searching range, if so, finishing the searching, not finding the time point to be searched, jumping to the step 6, and if not, continuing to search;
and 5-3, calculating the occurrence time and the search range of the next point, wherein the time to be searched is the occurrence time of the next point, and jumping to the step 2.
Further, the occurrence time of the next point is the sum of the occurrence time of the previous point, the interval time and the greatest common multiple of the freezing period.
Further, the search range is from the next to the last 1 point to the nearest 1 point.
On the other hand, the embodiment of the invention also provides a retrieval system of historical data of an electric energy meter, which comprises the following steps:
the input module is used for inputting search conditions and time to be searched;
the processing module can optimize the time to be searched and retrieve the historical data of the electric energy meter according to the time to be searched;
the data storage module is used for storing historical data of the electric energy meter.
The invention has the beneficial effects that: the retrieval method of the historical data of the electric energy meter provided by the invention optimizes the traditional search method, can quickly find the data record of the time to be searched under the condition that the historical data of the electric energy meter of a user is more, and shortens the search time of the historical electric energy record.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic overall flow chart of a method for retrieving historical data of an electric energy meter according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an overall structure of a system for retrieving historical data of an electric energy meter according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
In the description of the present specification, the terms "comprising," "including," "having," "containing," and the like are used in an open-ended fashion, i.e., to mean including, but not limited to. Reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The sequence of steps involved in the embodiments is for illustrative purposes to illustrate the implementation of the present application, and the sequence of steps is not limited and can be adjusted as needed.
The embodiment of the invention provides a retrieval method of historical data of an electric energy meter, which is suitable for continuous event record addresses of a storage space of the electric energy meter, no illegal record exists, and the search mode is the occurrence time of the record. Fig. 1 is a schematic overall flow chart of a method for retrieving historical data of an electric energy meter, as shown in fig. 1, the method includes the following steps:
step 1: judging whether the time to be searched needs to be optimized according to the searching conditions, if so, optimizing the time to be searched and obtaining the optimized time to be searched;
the searching condition comprises that freezing electric quantity data of the electric energy meter is read by appointing freezing occurrence time, and electric quantity data of the electric energy meter is read by appointing freezing start time, freezing end time and appointed intervals.
Judging whether the time to be searched needs to be optimized comprises the step of judging that the time to be searched needs to be optimized when the searching conditions are specified freezing start time, freezing end time and reading electric quantity data of the electric energy meter at specified intervals.
When the search condition is the specified freezing occurrence time, the time to be searched is the specified freezing occurrence time; and when the searching conditions are that the freezing starting time is appointed, the freezing ending time is appointed, and the electric quantity data of the electric energy meter is read at an appointed interval, judging that the time to be searched needs to be optimized.
And optimizing the time to be searched further comprises the steps of taking the maximum common multiple of the interval time and the freezing period as the searching interval, and combining the freezing starting time and the freezing ending time to obtain a new searching range.
Specifically, the maximum common multiple of the interval time and the freezing period is taken as a search interval, units of the interval time and the freezing period need to be unified during calculation, and usually minutes are taken as units;
in order to further reduce the total number of points to be searched, a search range which accords with a search interval is calculated by combining freezing starting time and freezing ending time, and since the recording time periods of the electric energy meter all use an integral point as the starting time, the optimized search starting time can be obtained by adding the search interval time to the starting time, and the time point which is closest to the freezing ending time is searched as the optimized search ending time by adding integral multiple of the search interval time to the optimized search starting time.
Step 2: obtaining the values of the earliest time difference value K1 and the latest time difference value K2, determining a searching direction and a predicted point by comparing K1 with K2, determining a searching range and a searching direction if the predicted point is not the time point to be searched, continuing to execute the step 3, ending the searching if the predicted point is the time point to be searched, and jumping to the step 6;
the earliest time difference K1 is the time difference between the time to be searched and the earliest 1 record in the records, the latest time difference K2 is the time difference between the time to be searched and the latest 1 record in the records, and the records refer to the historical electric energy records of the user electric energy meter.
And step 3: calculating a difference Q value between a point to be searched and a search boundary according to the search range and the search direction, calculating a difference E between a median value of a dichotomy algorithm and the search boundary, comparing the magnitude of the difference E and the magnitude of the difference E, jumping to a step 4 if Q is larger than E, finding a predicted point according to the search direction and the Q value if Q is smaller than E, acquiring the next search range and the search direction if the predicted point is not the time point to be searched, jumping to a step 5 if the difference between the number of searched ending bars and the number of starting bars is 1, repeating the step 3 if the predicted point is not the time point to be searched, and jumping to a step 6 if the predicted point is the point to be searched;
and 4, step 4: searching based on a dichotomy to obtain a middle point, if the middle point is a time point to be searched, ending the search, jumping to step 6, if the middle point is not the time point to be searched, acquiring a next search range, judging whether the difference between the ending number and the starting number in the range is 1, if so, jumping to step 5, otherwise, jumping to step 3;
and 5: comparing time points to be searched, comparing the time points to be searched, the occurrence time of the initial number of the pieces and the occurrence time of the ending number of the pieces, returning a point which is more than or equal to the time to be searched when the search condition is that the specified freezing occurrence time is used for reading the frozen electric quantity data of the electric energy meter, and returning a point which is equal to the time to be searched when the search condition is that the specified freezing start time, the freezing end time and the specified interval are used for reading the electric quantity data of the electric energy meter;
when the search condition is a designated freeze start time, a freeze end time, and a designated interval, the step 5 further includes the step of,
step 5-1: comparing the time to be searched, the occurrence time of the initial number and the end number, and returning a point equal to the time to be searched;
step 5-2: if the search is correct, finding a point which accords with the time to be searched, adding 1 to the number of the searched records, otherwise, indicating that the point is not found, continuing to search the next point, judging whether the next point reaches the end of the optimized search range, if so, finishing the search, jumping to the step 6, and if not, continuing to search;
wherein the occurrence time of the next point is the sum of the maximum common multiple of the occurrence time, the interval time and the freezing period of the previous point. The search range is from the number of the last 1 point to the nearest 1 point, and the number of the last 1 point is not included.
And 5-3, calculating the occurrence time and the search range of the next point, wherein the time to be searched is the occurrence time of the next point, and jumping to the step 2.
Step 6: and finding out a point which accords with the time point to be searched, and finishing the search.
Referring to the schematic of fig. 2, the present invention further provides a system for retrieving historical data of an electric energy meter, where the method for retrieving historical data of an electric energy meter can be operated based on the system, and the system includes:
the search time input module is used for inputting the time to be searched; wherein, the time to be searched can be input by the staff according to the actual demand of retrieval.
The processing module is respectively connected with the data storage module and the search time input module, receives the time to be searched, can search the historical data of the electric energy meter according to the time to be searched, and feeds the search result back to the staff for reference;
the data storage module is used for storing historical electric quantity data of the electric energy meter based on the freezing interval of the intelligent electric meter parameter operation, and the data storage module is connected with the electric energy meter and records and stores the use data information of users.
In order to further verify the beneficial effects of the search method proposed by the present invention, the following experiments were performed:
experiment 1:
the search background is that the electric energy meter performs normal historical electric energy recording, and the recorded occurrence time data is shown in the following table 1. Freeze 1 time per minute and record 8 pieces of data in total. The freezing electricity quantity data of the electricity meter is read by using the specified freezing occurrence time, for example, the freezing electricity quantity data which occurs at 11 o 'clock and 4 o' clock in 6 and 4 of 2021 is specified.
Table 1: experiment 1 electric energy meter data recording
0 11 o' clock 0 min 0 s at 6 month and 4 days in 2021
1 11 o' clock 1 min 0 s at 6 month and 4 days in 2021
2 11 o' clock, 2 min and 0 s at 6 month and 4 days in 2021
3 6/month/4/11/3/0/s in 2021
4 11 o 'clock, 4 o' clock, 0 s at 6/4/2021
5 11 o' clock, 5 min and 0 s at 6 month and 4 days in 2021
6 6 minutes and 0 seconds at 11 o' clock of 6 months and 4 days in 2021
7 11 o' clock, 7 min and 0 s at 6 month and 4 days in 2021
Searching is carried out based on the traditional bisection method, which specifically comprises the following steps: the middle point is positioned to item 3, the time which is not to be searched is found, and the search is continued; and determining the search range as (3, 7), positioning the middle point to the 5 th item, not the time to be searched, continuing the search, determining the search range as (3,5), positioning the middle point to the 4 th item, being the time to be searched, and ending the search.
The searching is carried out based on the searching method provided by the invention, and the searching method specifically comprises the following steps: and calculating values of K1 and K2 according to the recorded starting time and ending time to obtain that K1 is 4 and K2 is 3, and finding 3 items from the 7 th item upwards, namely the 4 th item is an expected point which is the time to be searched, and ending the search.
In experiment 1, the electric meter is the most common working condition in a normal working period, and the current power system rarely has power failure, so that the electric meter is normally frozen according to a freezing period, and the historical records are continuous. It can be seen that the searching method of the present invention can greatly reduce the searching time, and especially when the number of records is increased, the method of the present invention can save more searching time compared with the traditional method.
Experiment 2:
the background of the search is that the electric energy meter is frozen 1 time per minute, but power failure occurs in the middle, and the occurrence time of the record is discontinuous. The recorded time of occurrence data are shown in table 2 below. And reading the frozen electric quantity data of the electric meter by using the appointed freezing occurrence time.
Table 2: experiment 2 electric energy meter data record
0 11 o' clock 0 min 0 s at 6 month and 4 days in 2021
1 11 o' clock 1 min 0 s at 6 month and 4 days in 2021
2 11 o' clock, 2 min and 0 s at 6 month and 4 days in 2021
3 6/month/4/11/3/0/s in 2021
4 12 o' clock 0 min 0 s at 6 month and 4 days in 2021
5 12 o' clock 1 min 0 s at 6 month and 4 days in 2021
6 12 o' clock, 2 min and 0 s at 6 month and 4 days in 2021
7 12 o' clock, 3 min and 0 s at 6 month and 4 days in 2021
(1) When the freezing electric quantity data occurred at 12 o 'clock and 2 o' clock at 6 o 'clock and 4 o' clock of 2021 is specified:
searching is carried out based on the traditional bisection method, which specifically comprises the following steps: the middle point is positioned to item 3, which is not the time to be searched, and the search is continued; and determining the search range to be (3, 7), the middle point is positioned to the 5 th item and is not the time to be searched, continuing the search, determining the search range to be (5, 7), the middle point is positioned to the 6 th item and is the time to be searched, and ending the search.
The searching is carried out based on the searching method provided by the invention, and the searching method specifically comprises the following steps: from the start time and end time of the recording, the values of K1, K2 are calculated. K1 is 62, K2 is 1, and then 1 is found from the 7 th item, i.e. the 6 th item is the predicted point. The exactly predicted point is the time to be searched, and the search is finished.
(2) Freezing electric quantity data occurred when the specified point is 2021, 6, 4, 11, point and 3 points:
searching is carried out based on the traditional bisection method, which specifically comprises the following steps: the middle point is positioned to item 3, which is the time to be searched, and the search is ended.
The searching is carried out based on the searching method provided by the invention, and the searching method specifically comprises the following steps: from the recorded start time and end time, the values of K1 and K2 are calculated to obtain K1 being 3 and K2 being 60, and then 3 items are found from the 0 th item, that is, the 3 rd item is the predicted point. The predicted point is just the time to be searched, and the search is finished.
Experiment 2 is the working condition that the electricity meter is accidentally subjected to power failure in a normal working period. It can be seen that if the occurrence time of the point to be searched is exactly the middle point of the dichotomy, the search times of the method and the dichotomy are consistent, and the time is almost the same. However, if the point to be searched is not the middle point, the invention can reduce the searching time, and the more the number of records is, the more the searching time is reduced.
Experiment 3:
the background of the search is that the electric energy meter is frozen 1 time per minute, but frequent power-off occurs in the middle, and the occurrence time of the record is discontinuous. The recorded time of occurrence data is shown in table 3 below. And reading the frozen electric quantity data of the electric meter by using the appointed freezing occurrence time.
Table 3: experiment 3 electric energy meter data record
0 11 o' clock 0 min 0 s at 6 month and 5 days in 2021
1 6 months in 20215 days, 11 points, 1 minute, 0 second
2 11 o' clock, 2 min and 0 s at 6/5/2021
3 12 o' clock 13 min 0 s at 6/5/2021
4 12 o' clock, 14 min and 0 s at 6/5/2021
5 12 o' clock, 15 min and 0 s at 6/5/2021
6 12 o' clock, 16 min and 0 s at 6/5/2021
7 6/month/5/15/13/0/s at 15/2021
8 15 o' clock, 14 min and 0 s at 6/5/15/2021
9 15 o 15 min 0 s at 6/5/15/2021
10 6/month/5/15/16/0 second in 2021
When the freezing capacity data occurred at the point of 11 points and 4 points at 6 months and 5 days of 2021 is specified,
searching is carried out based on the traditional bisection method, which specifically comprises the following steps: the middle point is positioned to the 5 th point, and the searching is continued when the middle point is not the time to be searched; determining the search range to be [0,5), positioning the middle point to the 2 nd item, not the time to be searched, and continuing searching; determining that the search range is (2,5), the middle point is positioned to item 3, and the search is continued when the middle point is not the time to be searched; and (5) determining that the search range is (2,3), and ending the dichotomy search. And comparing the relation among the time to be searched, the 2 nd occurrence time and the 3 rd occurrence time. And if the 3 rd occurrence time > to-be-searched time > the 2 nd occurrence time, returning the 3 rd information.
The searching is carried out based on the searching method provided by the invention, and the searching method specifically comprises the following steps: calculating the difference between the time to be searched at 11 points 6/5/2021 and the time to be searched at 11 points 6/5/2021 at the 0 th record, namely 0/0 second, wherein the difference is 4 minutes, and K1 is 4 in combination with the current freezing period T (T is 1 minute). And calculating the difference between the time to be searched and the distance of 0 second at 15 points 13 at 6/5/10 of the 10 th 2021, wherein the difference is 249 minutes, and K2 is 249 combined with the current freezing period T (T is 1 minute). K2 is greater than K1, so the search is performed based on the 0 th item, and the 0 th item is 4 items backward, which is the predicted point. The data of the predicted points are 12 points at 6 months, 5 days and 14 points at 0 point in 2021, the search is continued when the time is not the time to be searched; record the search range [0,4) entries, the search direction is from the 4 th entry to the 0 th entry. Q1 is calculated, the difference between the point to be searched and the search boundary (boundary 4) is 70 minutes, Q1 is 70. The difference E1 between the median 2 of the bisection algorithm and the difference 4 of the search boundary is 2. Q1> E, so a binary search is performed, searching for the range [0,4 ]. The bisection method locates the 2 nd point of the middle point, finds out the 11 points of 6 months, 5 days and 11 points of 2021 year, 2 minutes and 0 second, but not the time to be searched, and continues searching; record the search range (2,4) entries, the search direction is from 2 nd entry to 4 th entry. The difference Q2 between the point to be searched and the search boundary (boundary 2), Q2 2, the difference E2 between the median 3 of the bisection algorithm and the difference 2 between the search boundary 1, Q2> E2, so the bisection search is performed to locate the 3 rd midpoint, 13 minutes and 0 seconds at 6 months, 5 days, 12 points, 13 minutes and 0 seconds, not the time to be searched. And comparing the relation among the time to be searched, the 2 nd occurrence time and the 3 rd occurrence time. And if the 3 rd occurrence time > to-be-searched time > the 2 nd occurrence time, returning the 3 rd information.
Experiment 3 is the working condition that the electricity meter frequently suffers from power failure in a normal working period. The search method optimizes the dichotomy search, performs prejudgment before each search, reduces the search range as much as possible and reduces the search times.
Experiment 4:
the search background is that the current intelligent electric energy meter is frozen for 1 time every 15 minutes according to the freezing parameters, the power failure condition occurs in the middle, at the moment, 11 records of electric quantity coexist in the meter, and the recorded occurrence time data is shown in the following table 4. The master station reads the charge data at specified intervals, with specified freeze start times, freeze end times, according to the protocol of DTL 698.645. The freezing time is 11 o ' clock, 4 o ' clock and 0 s at 5 o ' clock, 6 o ' clock, 5 o ' clock, 15 o ' clock, 35 o ' clock and 0 s at 2021, 6 o ' clock, 5 o ' clock and 0 s at 2 min intervals
Table 4: experiment 4 electric energy meter data record
0 11 o' clock 0 min 0 s at 6 month and 5 days in 2021
1 11 o' clock, 15 min and 0 s at 6/5/2021
2 6/month/5/11/30/0 second in 2021
3 12 o' clock, 15 min and 0 s at 6/5/2021
4 12 o' clock 30 min 0 s at 6/5/2021
5 12 o' clock 45 min 0 s at 6/5/2021
6 13 o' clock 45 min 0 s at 6/5/2021
7 0 minute and 0 second at 15 o' clock of 6 months and 5 days in 2021
8 15 o 15 min 0 s at 6/5/15/2021
9 30 minutes and 0 seconds at 15 o' clock of 6 months and 5 days in 2021
10 6/month/5/15/45/0/s at 15/2021
Searching is carried out based on the traditional bisection method, which specifically comprises the following steps: searching according to 11 points of 6, 5 and 5 months of 2021 year, 4 minutes and 0 seconds, searching a range [0,10], finding the 1 st point, and the 2 nd 11 points of 6, 5 months of 2021 year, 11 minutes and 0 seconds; the next point generation time is 1 point generation time + interval time, namely 11 points 6 minutes 0 seconds at 6 months 5 days 2021, the range (2, 10) cannot be found, the next point generation time is 1 point generation time + interval time, namely 11 points 8 minutes 0 seconds at 6 months 5 days 11 days 2021, the range (2, 10) cannot be found, and the process is repeated until all the points meeting the requirements are found.
The searching is carried out based on the searching method provided by the invention, and the searching method specifically comprises the following steps: and optimizing the points to be searched, and taking the maximum common multiple of the interval time and the freezing period as the search interval to reduce the total number of the points to be searched. From the start time, the interval time and the freeze period, the 1 st point is calculated. And taking the maximum common multiple of the interval time and the freezing period as 30, and calculating the starting time of the search range to be 30 min 0 s at 11 points at 6 and 5 days in 2021 and the ending time to be 30 min 0 s at 15 points at 6 and 5 days in 2021 according to the starting time. The first point is searched, and the first point is searched for 30 minutes and 0 seconds at 6 months, 5 days and 11 days in 2021. The search range is [0,10 ]. The searching method is consistent with the method of reading the frozen electric quantity data of the electric meter by using the appointed freezing occurrence time, and points which are more than or equal to the time to be searched are returned. And judging whether the point is in the searching range, and if so, finding the 1 st point. If not, no record can be found. The first point is the 2 nd 2021 st point, 6 months, 5 days, 11 points, 30 minutes and 0 seconds; and searching the next point, wherein the occurrence time is the occurrence time of the last 1 point plus the maximum common multiple 30 of the interval time and the freezing period, namely, 12 points, 0 minute and 0 second at 6, 5 and 12 days in 2021. The search range is [3,10 ]. The searching method is consistent with the method of reading the frozen electric quantity data of the electric meter by using the appointed freezing occurrence time, but returns a point equal to the time to be searched, and if the point is consistent, a point is found. If not, no record can be found; the starting time of the 3 rd record is larger than the time to be searched, so that the record is not found, and the next point is searched continuously. The occurrence time is the maximum common multiple 30 of the interval time and the freezing period added to the occurrence time of the last 1 point, namely 30 minutes and 0 seconds at 12 points of 6 months and 5 days in 2021. The search range is [4,10 ]. The search method is consistent with reading the frozen power data of the electricity meter with the specified freeze occurrence time, but returns a point equal to the time to be searched. If the point is matched, a point is found. If not, no record can be found. The second point was found to be 12 points at 6/5/4 2021 for 30 min 0 s. And searching the next point, wherein the occurrence time is the occurrence time of the last 1 point plus the maximum common multiple 30 of the interval time and the freezing period, namely, the point is 6, 5 and 13 points in 2021, 0 minute and 0 second. The search range is [5,10 ]. The search method is consistent with reading the frozen power data of the electricity meter with the specified freeze occurrence time, but returns a point equal to the time to be searched. If yes, a point is found. If not, no record can be found; by analogy, the third point is 0 min 0 s at 6/5/15 of the 7 th 2021 year, and the fourth point is 30 min 0 s at 6/5/15 of the 7 th 2021 year.
Experiment 4 is the working condition that the electricity meter frequently encounters power failure in a normal working period. It can be seen that by adopting the steps of appointing the freezing start time, the freezing end time and appointing the interval to read the historical electric energy data, the invention not only takes the interval time, but also takes the maximum common multiple of the interval time and the freezing period as the search interval, thereby greatly reducing the search times. Meanwhile, the method carries out prejudgment before each search, and adopts an algorithm with the largest narrowing range to search, so that the search time is reduced.
Further, in order to more intuitively embody the beneficial effects of the method of the present invention, the time required for completing the search based on the conventional method and the search method proposed by the present invention is also counted in the experiment, as shown in the following table 5:
table 5: required search time comparison table under different methods
Figure BDA0003259349880000111
As can be seen from table 5, when the search is performed based on the method provided by the present invention, the required time is shorter than that of the conventional search method, and when the amount of the historical data is larger, the search time can be saved, and the processing speed can be increased.
Referring to the schematic diagram of fig. 2, the present invention further provides a system for retrieving historical data of an electric energy meter, where the method for retrieving historical data of an electric energy meter can be implemented based on the system, and the system includes: an input module, a processing module and a data storage module,
specifically, the input module is used for inputting the search condition and the time to be searched, and the input module is connected with the processing module and transmits the input search condition and the time to be searched to the processing module;
the processing module can optimize the time to be searched and retrieve the historical data of the electric energy meter according to the time to be searched, the processing module is connected with the data storage module, and the processing module obtains and outputs a retrieval result according to the historical data of the electric energy meter stored by the data storage module;
the data storage module is used for storing historical data of the electric energy meter, and the data storage module is connected with the electric energy meter and records related use data of the electric energy meter.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (9)

1. A retrieval method of historical data of an electric energy meter is characterized by comprising the following steps:
step 1: judging whether the time to be searched needs to be optimized according to the searching conditions, if so, optimizing the time to be searched and obtaining the optimized time to be searched;
step 2: obtaining the values of the earliest time difference value K1 and the latest time difference value K2, determining a searching direction and a predicted point by comparing K1 with K2, determining a searching range and a searching direction if the predicted point is not the time point to be searched, continuing to execute the step 3, ending the searching if the predicted point is the time point to be searched, and jumping to the step 6;
and step 3: calculating a difference Q value between a point to be searched and a search boundary according to the search range and the search direction, calculating a difference E between a median value of a dichotomy algorithm and the search boundary, comparing the magnitude of the difference E and the magnitude of the difference E, jumping to a step 4 if Q is larger than E, finding a predicted point according to the search direction and the Q value if Q is smaller than E, acquiring the next search range and the search direction if the predicted point is not the time point to be searched, jumping to a step 5 if the difference between the number of searched ending bars and the number of starting bars is 1, repeating the step 3 if the predicted point is not the time point to be searched, and jumping to a step 6 if the predicted point is the point to be searched;
and 4, step 4: searching based on a dichotomy to obtain a middle point, if the middle point is a time point to be searched, ending the search, jumping to step 6, if the middle point is not the time point to be searched, acquiring a next search range, judging whether the difference between the ending number and the starting number in the range is 1, if so, jumping to step 5, otherwise, jumping to step 3;
and 5: comparing the time points to be searched, the occurrence time of the initial number and the end number, returning the point which is more than or equal to the time to be searched when the search condition is that the specified freezing occurrence time is used for reading the freezing electric quantity data of the electric energy meter, and returning the point which is equal to the time to be searched when the search condition is that the specified freezing start time, the freezing end time and the specified interval are used for reading the electric quantity data of the electric energy meter;
step 6: and finding out a point which accords with the time point to be searched, and finishing the search.
2. The method for retrieving history data of an electric energy meter according to claim 1, wherein the search condition includes a freezing occurrence time designated to read the frozen electric energy data of the electric energy meter, and an electric energy data designated to read the electric energy meter at a freezing start time, a freezing end time, and a designated interval.
3. The method for retrieving historical data of an electric energy meter according to claim 2, wherein the judging whether the time to be searched needs to be optimized comprises,
and when the searching conditions are that the freezing starting time is appointed, the freezing ending time is appointed, and the electric quantity data of the electric energy meter is read at an appointed interval, judging that the time to be searched needs to be optimized.
4. The method for retrieving historical data of an electric energy meter according to claim 1 or 3, wherein optimizing the time to be searched further comprises,
and taking the maximum common multiple of the interval time and the freezing period as a search interval, and combining the freezing starting time and the freezing ending time to obtain a new search range.
5. The method for retrieving historical data of an electric energy meter according to claim 4, wherein the optimizing the time point to be searched when the freeze start time, the freeze end time and the designated interval are designated comprises the steps of: the earliest time difference value K1 is the time difference value between the time to be searched and the earliest 1 record in the records, and the latest time difference value K2 is the time difference value between the time to be searched and the latest 1 record in the records.
6. The method for retrieving history data of electric energy meter according to claim 5, wherein when the search condition is a designated freezing start time, a freezing end time and a designated interval, said step 5 further comprises the steps of,
step 5-1: comparing the time to be searched, the occurrence time of the initial number and the end number, and returning a point equal to the time to be searched;
step 5-2: if the time point is correct, finding a point which accords with the time to be searched, adding 1 to the number of the searched records, otherwise, indicating that the point is not found, continuing to search the next point, judging whether the next point reaches the end of the optimized searching range, if so, finishing the searching, not finding the time point to be searched, jumping to the step 6, and if not, continuing to search;
and 5-3, calculating the occurrence time and the search range of the next point, wherein the time to be searched is the occurrence time of the next point, and jumping to the step 2.
7. The method for retrieving historical data of an electric energy meter according to claim 6, wherein the occurrence time of the next point is the sum of the maximum common multiple of the occurrence time, the interval time and the freezing period of the previous point.
8. The method for retrieving the historical data of the electric energy meter according to claim 6 or 7, wherein the search range is from the next to the most recent 1 of the number of the last 1 point.
9. A system for retrieving historical data of an electric energy meter, comprising:
the input module is used for inputting search conditions and time to be searched;
the processing module can optimize the time to be searched and retrieve the historical data of the electric energy meter according to the time to be searched;
the data storage module is used for storing historical data of the electric energy meter.
CN202111068127.3A 2021-09-13 2021-09-13 Retrieval method and system for historical data of electric energy meter Pending CN113760957A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111068127.3A CN113760957A (en) 2021-09-13 2021-09-13 Retrieval method and system for historical data of electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111068127.3A CN113760957A (en) 2021-09-13 2021-09-13 Retrieval method and system for historical data of electric energy meter

Publications (1)

Publication Number Publication Date
CN113760957A true CN113760957A (en) 2021-12-07

Family

ID=78795236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111068127.3A Pending CN113760957A (en) 2021-09-13 2021-09-13 Retrieval method and system for historical data of electric energy meter

Country Status (1)

Country Link
CN (1) CN113760957A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114280910A (en) * 2021-12-27 2022-04-05 浙江涵普电力科技有限公司 Test method and system capable of reading time of power meter with high precision
CN116303124A (en) * 2023-03-29 2023-06-23 浙江正泰仪器仪表有限责任公司 Data searching method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114280910A (en) * 2021-12-27 2022-04-05 浙江涵普电力科技有限公司 Test method and system capable of reading time of power meter with high precision
CN116303124A (en) * 2023-03-29 2023-06-23 浙江正泰仪器仪表有限责任公司 Data searching method and device, electronic equipment and storage medium
CN116303124B (en) * 2023-03-29 2024-01-30 浙江正泰仪器仪表有限责任公司 Data searching method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113760957A (en) Retrieval method and system for historical data of electric energy meter
CN108255981B (en) Method for storing and searching index minute freezing of timestamp sequence numbers of continuous time periods
CN108197181B (en) Compression storage method of time sequence data, electronic equipment and storage medium
CN103914506A (en) Data retrieval apparatus, data storage method and data retrieval method
CN103336849A (en) Method and device for increasing retrieval speed in database retrieval system
CN110929226B (en) Power distribution network power failure prediction method, device and system
CN104182435A (en) System and method for searching information based on data missing mark
CN109656887B (en) Distributed time series mode retrieval method for mass high-speed rail shaft temperature data
CN101556660A (en) Production order arranging system and method
CN110688065A (en) Storage space management method, system, electronic equipment and storage medium
CN102262675B (en) Method for querying database and smart card
CN111913913A (en) Access request processing method and device
CN113886503A (en) Distributed storage method and system for electric power acquisition data
CN114385415A (en) Method and device for virtual machine to backup across backup storage pools
CN103309890A (en) Technology for merging Linux file system and real-time database index
CN116775667B (en) Associated data processing method and device
Chaudhari et al. Dynamic materialized view selection algorithm: a clustering approach
CN112749304A (en) Method for limiting calculation force of mining machine, mining machine and storage medium
CN112578995A (en) Data set processing method, device and system
CN113220234B (en) Terminal data storage management method and manager
CN111475502A (en) Data management method and system for distributed renewable energy
CN116185940B (en) Atomic counter operation method, device, equipment and storage medium
CN113486021B (en) Method and device for determining daily average balance of account in distributed banking system
CN113220668B (en) Load curve data access method based on grouping
CN115578080B (en) Cost reference library workload verification method based on informatization system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination