A method and system for automatic data replenishment from public transformers in metering automation

By automating the acquisition and processing of low-voltage meter reading data from public transformers, the problems of equipment malfunction and untimely data transmission have been solved, enabling efficient supplementary collection of customer data and improving data accuracy and meter reading efficiency.

CN117255267BActive Publication Date: 2026-11-17GUIZHOU POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310911615.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2026-11-17
Estimated Expiration
2043-07-24

AI Technical Summary

Technical Problem

The existing low-voltage centralized metering system for public transformers suffers from problems such as equipment malfunctions, untimely data transmission, and incomplete meter readings. This leads to discrepancies in the calculation of line loss during the same period in the transformer area, resulting in low efficiency and repetitive work for manual troubleshooting.

Method used

By acquiring and preprocessing operational data, and combining preset data collection logic algorithms with simulated manual operations, the system automates the data collection of customers, including folder creation, login monitoring, device restart, data cleaning and matching, and uses the VLOOKUP function for data verification to achieve automated data collection.

Benefits of technology

It reduced repetitive work, improved the accuracy of data judgment, reduced data discrepancies between departments, and improved meter reading efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117255267B_ABST
    Figure CN117255267B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for automatic data supplementation in automated metering of public transformers, comprising: acquiring operational data from manual operations during low-voltage centralized metering of public transformers, and preprocessing the operational data; obtaining a first supplementation result based on the preprocessing result and a preset supplementation logic algorithm; and matching the first supplementation result with statistical table data to complete the automatic supplementation of customer data under the working state of low-voltage centralized metering of public transformers. The automatic data supplementation method of this invention eliminates the need for repetitive daily tasks; the judgment result is obtained immediately after the program finishes running, improving the accuracy of data judgment and reducing technical discrepancies in data judgment between departments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of automatic data replenishment, and in particular to a method and system for automatic replenishment of metering automation data for public transformers. Background Technology

[0002] In the current low-voltage centralized metering system for public transformers, equipment frequently experiences intermittent and irregular "frozen" states, resulting in data transmission failures to the metering system or untimely transmission. This leads to deviations in the calculation of a series of indicators, such as synchronous line loss, automatic meter reading rate, and automatic calculation rate. Taking a certain power supply station as an example, one person needs to be assigned to screen and process data from 28,000 households daily, spending four hours to meet the basic data support requirements for synchronous line loss, meter reading verification, and electricity usage inspections. This is inefficient, and manual screening is inefficient in dealing with the huge amount of data, and the handling of missing or incomplete meter readings is also inefficient, while causing unnecessary repetitive work. Summary of the Invention

[0003] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a method and system for automatic data supplementation of public transformers in metering automation to solve the problems of traditional manual investigation and processing of public transformer customer data, which involves large amounts of data, easily causing unnecessary repetitive work, and low efficiency in handling missing data, incomplete or non-reading meters.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, embodiments of the present invention provide a method for automatic supplementary data collection of public transformer data in metering automation, comprising: acquiring the operating condition data of manual operation during the low-voltage centralized metering process of the public transformer, and preprocessing the operating condition data;

[0008] The first supplementary sampling result is obtained by combining the preprocessing result with the preset supplementary sampling logic algorithm;

[0009] Based on the first supplementary data collection result and the statistical table data, the automatic supplementary data collection of customer data under the working state of low-voltage centralized metering of public transformers is completed.

[0010] As a preferred embodiment of the automatic data replenishment method for metering automation of public transformers described in this invention, the preprocessing of the operating data includes:

[0011] Get the current time data and path variables, and determine whether the target folder exists under the corresponding path;

[0012] If it does not exist, the missing folder will be created automatically, and the created folder will be saved with the path based on the data details and time variables;

[0013] If it exists, wait for manual login and monitor the elements after login to determine whether the login was successful; if the login is successful, obtain the department information corresponding to the login account and select the corresponding department within the metering automation system.

[0014] Based on the department information, simulate manual operation, determine the number of data pages, and if the number of pages is greater than 1, loop through the pages and obtain the missing data of small customers within the target time period, store the missing data of small customers in a temporary file, clean the missing data of small customers to obtain the address information set, and establish an address information backup.

[0015] As a preferred embodiment of the automatic data replenishment method for metering automation of public transformers described in this invention, it further includes:

[0016] Based on the address information set, each device with missing data is located in a loop, and a simulated manual restart is performed; if the device address is displayed as 0, it means that there is no missing data, and the program ends.

[0017] If an anomaly occurs during the device restart process, the sequential restart will be restarted again based on the device's fault tolerance mechanism. When the device restarts, the forced waiting time is determined based on the number of extracted address information.

[0018] As a preferred embodiment of the automatic data replenishment method for automated metering of public transformers described in this invention, the method includes: a preset replenishment logic algorithm comprising:

[0019] Read the backed-up address information data and determine the forced waiting time based on the number of extracted address information.

[0020] The device address length is determined by the len function. If the device address length does not meet the user's requirements, the device address is marked and an error is reported to remind the staff to verify and process it. The current supplementary collection cycle is skipped and the next cycle is started. If the current supplementary collection cycle is the last cycle, the current cycle is skipped and the data marked as failed in the database is extracted. The supplementary collection cycle is repeated but the data marked as failed in the double-entry bidding is not extracted again.

[0021] Based on the address information of the extracted data, all data containing the same device address information are obtained from the backup data created, and the number information representing each row is extracted; if the address information does not have corresponding data in the backup data, the system will report an error indicating that there is a problem with the address information, and will use the VLOOKUP function to match the statistical table data and issue an error reminder;

[0022] Based on the number information, select the corresponding supplementary data page to perform data loop selection and start supplementary data collection; if the corresponding number is not obtained during data loop selection, it is judged as an anomaly and an error message is issued, and the loop is skipped and the next loop begins.

[0023] As a preferred embodiment of the automatic data replenishment method for metering automation of public transformers described in this invention, it further includes: conditionally waiting for returned data;

[0024] If no data is found when the conditional waiting time ends, the device is determined to be faulty, and an error message is sent to remind staff to check the device status. The current loop is skipped, and the next loop begins.

[0025] If data exists within the conditional waiting time, but the number of data items does not match the number of items in the retrieved list, continue waiting until the number of data items returned matches the number of items in the list before proceeding to the next step; if the waiting time ends and the number of data items still does not match, mark the missing data and issue an error message.

[0026] If data exists within the conditional waiting time, and the number of data items is the same as the number of items in the retrieved number list, then retrieve the returned data, save the returned data as a nested list, and make a judgment on the returned data.

[0027] If the saved returned data list is 8 using the len command, it means that the device has data, and the corresponding row in the database is deleted; if the returned data is not equal to 8 using the len command, it means that the device saves this part of the data in a new nested list for processing the data returned from the second acquisition.

[0028] If the returned data does not contain any data not equal to 8 using the len command, then close the data return page, skip this loop, and start the next loop. If this loop is the last set of data, then after skipping this loop, extract the data from the database that does not include the data marked as failed in the dual recruitment process, repeat the conditional waiting for the returned data processing loop, and no longer extract the data marked as failed in the dual recruitment process.

[0029] As a preferred embodiment of the automatic data replenishment method for automated metering of public transformers according to the present invention, the data processing returned from the second replenishment includes:

[0030] The returned data is tested through a direct connection to the user via a data list where the len command is not equal to 8. A conditional wait time is set. If no data is returned within the wait time, the data is judged as failed and there is no data. The judgment is marked in the corresponding row of the database, the data return page is closed, and the loop is skipped before the next loop. If the current loop is the last loop, the current loop is skipped and the conditional wait for the returned data processing command is continued.

[0031] If data exists within the conditional waiting time, but the number of data items does not match the number of items in the retrieved number list, continue waiting until the number of returned data items is equal to the number of items in the number list before proceeding to the next step. If the number of data items is still not equal after the waiting time ends, mark the returned data as abnormal in the database and issue an alarm.

[0032] If data exists within the conditional waiting time, and the number of data items is the same as the number of items in the retrieved list, then retrieve the returned data, save the returned data as a nested list, and make a judgment on the returned data.

[0033] If the returned data list is 8 using the len command, it means that there is data in the device, so the corresponding area in the database is deleted; if the returned data list is not equal to 8 using the len command, the corresponding row in the database is marked as a failure of dual-scanning and the next loop is entered. If this loop is the last loop data, the data in the database that does not include the marked failure of dual-scanning is directly extracted, and the data processing loop returned by the second supplementary sampling is repeated without extracting the data marked as a failure of dual-scanning.

[0034] Based on the above processing method, data in the database that are not marked as failed dual-encoding are extracted, and unique values ​​are extracted. Data is judged again until all data loops are completed, and the first supplementary sampling result is obtained.

[0035] As a preferred embodiment of the automatic data replenishment method for automated metering of public transformers according to the present invention, the first replenishment result is matched with statistical table data, including:

[0036] Based on the device address information in the database, the VLOOKUP function is used to match the target data in the corresponding statistical table.

[0037] If the judgment result is still a blank area, an error message will be displayed and marked, and the data will be saved to the corresponding absolute path; once the data matching is completed, the database format will be set and the data will be stored.

[0038] Secondly, this invention provides an automated metering system for automatic data replenishment of public transformers, comprising:

[0039] The data acquisition module is used to acquire the operating condition data of manual operation during the low-voltage centralized metering process of the public transformer, and to preprocess the operating condition data.

[0040] The calculation module is used to obtain the first supplementary sampling result based on the preprocessing result and a preset supplementary sampling logic algorithm;

[0041] The data supplementation module is used to match the first supplementation result with the statistical table data to complete the automatic supplementation of customer data under the working state of low-voltage centralized metering of public transformers.

[0042] Thirdly, the present invention provides a computing device, comprising:

[0043] Memory and processor;

[0044] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the automatic supplementary data collection method for metering automation of public transformers are implemented.

[0045] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the automatic supplementary data collection method for metering automated public transformers.

[0046] Compared with the prior art, the beneficial effects of the present invention are: the automatic data supplementation method of the present invention does not require repetitive work to be performed every day, and the judgment result can be obtained after the program runs, which improves the accuracy of data judgment and reduces the technical deviation of data judgment between departments. Attached Figure Description

[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0048] Figure 1 This is a flowchart illustrating an automatic data acquisition method and system for automated metering of public transformers, as described in one embodiment of the present invention. Detailed Implementation

[0049] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0050] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0051] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0052] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.

[0053] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0054] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0055] Example 1

[0056] Reference Figure 1As one embodiment of the present invention, this embodiment provides a method for automatic supplementary collection of metering automation public transformer data, comprising:

[0057] S1: Acquire the operating condition data of manual operation during the low-voltage centralized metering process of public transformers, and preprocess the operating condition data;

[0058] Furthermore, the preprocessing of the operating data includes:

[0059] Get the current time data and path variables, and determine whether the target folder exists under the corresponding path;

[0060] If it does not exist, the missing folder will be created automatically, and the created folder will be saved with the path based on the data details and time variables;

[0061] If it exists, wait for manual login and monitor the elements after login to determine whether the login was successful; if the login is successful, obtain the department information corresponding to the login account and select the corresponding department within the metering automation system.

[0062] Based on departmental information, simulate manual operation to determine the number of data pages. If there is more than one page, loop through the pages and obtain the missing data of small customers within the target time period. Store the missing data of small customers in a temporary file, clean the missing data of small customers to obtain the address information set, and create a backup of the address information.

[0063] Furthermore, this also includes:

[0064] Based on the address information set, the program cyclically locates each device with missing data and simulates a manual restart. If the device address is displayed as 0, it means there is no missing data, and the program ends.

[0065] If an anomaly occurs during the device restart process, the sequential restart will be restarted again based on the device's fault tolerance mechanism. When the device restarts, the forced waiting time is determined based on the number of extracted address information.

[0066] It should be noted that restarting the device can resolve the issue of the device seemingly freezing. After restarting, the device will be in better condition than if it were restarted and then used for supplementary sampling.

[0067] It should also be noted that the equipment includes the option to perform supplementary sampling without restarting the equipment, allowing for a second sampling to be performed after the equipment has been restarted or on the same day.

[0068] S2: Obtain the first supplementary sampling result based on the preprocessing result and the preset supplementary sampling logic algorithm;

[0069] Furthermore, the preset supplementary sampling logic algorithm includes:

[0070] Read the backed-up address information data and determine the forced waiting time based on the number of extracted address information.

[0071] It should be noted that determining the forced waiting time based on the number of devices requiring supplementary data collection can prevent misjudgments of supplementary data collection results caused by temporary communication interruptions during the restart process of the concentrator or when the system is processing a large amount of data.

[0072] The device address length is determined by the len function. If the device address length does not meet the user's requirements, the device address is marked and an error is reported to remind the staff to verify and process it. The current supplementary collection cycle is skipped and the next cycle is started. If the current supplementary collection cycle is the last cycle, the current cycle is skipped and the data marked as failed in the database is extracted. The supplementary collection cycle is repeated but the data marked as failed in the double-entry bidding is not extracted again.

[0073] Based on the address information extracted from the data, the system retrieves all data containing the same device address information from the created backup data and extracts the number information representing each row. If the address information does not have corresponding data in the backup data, the system will report an error indicating that there is a problem with the address information. The system will use the VLOOKUP function to match the statistical table data and issue an error reminder.

[0074] Based on the number information, select the corresponding supplementary data page to perform data loop selection and start supplementary data collection; if the corresponding number is not obtained during data loop selection, it is judged as an anomaly and an error message is issued, and the loop is skipped and the next loop begins.

[0075] Furthermore, this also includes: conditional waiting for returned data;

[0076] If no data is found when the conditional waiting time ends, the device is determined to be faulty, and an error message is sent to remind staff to check the device status. The current loop is skipped, and the next loop begins.

[0077] If data exists within the conditional waiting time, but the number of data items does not match the number of items in the retrieved list, continue waiting until the number of data items returned matches the number of items in the list before proceeding to the next step; if the waiting time ends and the number of data items still does not match, mark the missing data and issue an error message.

[0078] If data exists within the conditional waiting time, and the number of data items is the same as the number of items in the retrieved list, then retrieve the returned data, save the returned data as a nested list, and make a judgment on the returned data.

[0079] If the saved returned data list is 8 using the len command, it means that the device has data, and the corresponding row in the database is deleted; if the returned data is not equal to 8 using the len command, it means that the device saves this part of the data in a new nested list for processing the data returned from the second acquisition.

[0080] If the returned data does not contain any data not equal to 8 using the len command, then close the data return page, skip this loop, and start the next loop. If this loop is the last set of data, then after skipping this loop, extract the data from the database that does not include the data marked as failed in the dual recruitment process, repeat the conditional waiting for the returned data processing loop, and no longer extract the data marked as failed in the dual recruitment process.

[0081] Furthermore, the data processing returned from the second data collection includes:

[0082] The returned data is tested through a direct connection to the user's communication system using the data in the list where the len command is not equal to 8. A conditional wait time is set. If no data is returned within the wait time, the data is considered to have failed and there is no data. The judgment is marked in the corresponding row of the database, and the data return page is closed. The current loop is skipped and the next loop begins. If this loop is the last loop, the current loop is skipped and the conditional wait data return processing command is continued.

[0083] If data exists within the conditional waiting time, but the number of data items does not match the number of items in the retrieved number list, continue waiting until the number of returned data items is equal to the number of items in the number list before proceeding to the next step. If the number of data items is still not equal after the waiting time ends, mark the returned data as abnormal in the database and issue an alarm.

[0084] If data exists within the conditional waiting time, and the number of data items is the same as the number of items in the retrieved list, then retrieve the returned data, save the returned data as a nested list, and make a judgment on the returned data.

[0085] If the returned data list is 8 using the len command, it means that there is data in the device, so the corresponding area in the database is deleted; if the returned data list is not equal to 8 using the len command, the corresponding row in the database is marked as a failure of dual-scanning and the next loop is entered. If this loop is the last loop data, the data in the database that does not include the marked failure of dual-scanning is directly extracted, and the data processing loop returned by the second supplementary sampling is repeated without extracting the data marked as a failure of dual-scanning.

[0086] Based on the above processing method, data in the database that are not marked as failed dual-encoding are extracted, and unique values ​​are extracted. Data is judged again until all data loops are completed, and the first supplementary sampling result is obtained.

[0087] S3: Based on the first supplementary data collection result and the statistical table data, automatically supplement the customer data collection under the working state of the public transformer low-voltage centralized metering.

[0088] Furthermore, the first supplementary sampling results are matched with statistical table data, including:

[0089] Based on the device address information in the database, the VLOOKUP function is used to match the target data in the corresponding statistical table.

[0090] If the judgment result is still a blank area, an error message will be displayed and marked, and the data will be saved to the corresponding absolute path; once the data matching is completed, the database format will be set and the data will be stored.

[0091] It should be noted that for customers whose power transformers have not been read, the equipment will not be restarted for supplementary data collection. During the operation of the equipment, a fault tolerance mechanism is set up so that it will continue to execute until the end when an error occurs.

[0092] The above is an illustrative scheme of an automatic data replenishment method for automated metering of public transformers according to this embodiment. It should be noted that the technical solution of this automatic data replenishment system for automated metering of public transformers belongs to the same concept as the technical solution of the aforementioned automatic data replenishment method. Details not described in detail in the technical solution of the automatic data replenishment system for automated metering of public transformers in this embodiment can be found in the description of the technical solution of the aforementioned automatic data replenishment method.

[0093] This embodiment describes an automated metering system for automatic supplementary data collection from public transformers, comprising:

[0094] The data acquisition module is used to acquire the operating condition data of manual operation during the low-voltage centralized metering process of public transformers, and to preprocess the operating condition data.

[0095] The calculation module is used to obtain the first supplementary sampling result based on the preprocessing result and the preset supplementary sampling logic algorithm;

[0096] The data supplementation module is used to match the first supplementation result with the statistical table data to complete the automatic supplementation of customer data under the working state of low-voltage centralized metering of public transformers.

[0097] This embodiment also provides a computing device applicable to the automatic data replenishment method for metering automation of public transformers, including:

[0098] The system includes a memory and a processor. The memory stores computer-executable instructions, and the processor executes these instructions to implement the automatic data replenishment method for automated metering of public transformers as proposed in the above embodiments.

[0099] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the automatic data replenishment method for metering automation of public transformers as proposed in the above embodiments.

[0100] The storage medium proposed in this embodiment and the automatic data replenishment method for metering automation of public transformers proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0101] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0102] Example 2

[0103] Reference Figure 1 In one embodiment of the present invention, a Python program is used to simulate manual operation of the automated measurement system, judge the test return data, and generate an Excel spreadsheet for feedback, replacing manual operation and judgment. The detailed steps are as follows:

[0104] The required libraries and runtime environment are as follows:

[0105] 1. sys

[0106] 2. OS

[0107] 3. openpyxl and its functions colors, Alignment, Border, Side.

[0108] 4. webdriver, WebDriverWait, ec, By, ActionChains, ChromeOptions in selenium

[0109] 5. time, datetime

[0110] 6. win32com and its components gencache and wc

[0111] 7. pandas

[0112] 8. BeautifulSoup in bs4

[0113] 9. System Requirements: Windows 7 or above, Google Chrome

[0114] 10. Hardware: CPU: Intel(R) Core(TM) i3-3240 3.4GHz; Hard drive: 120G or more solid-state drive or mechanical hard drive (the actual memory usage of this software is 367.2M); Memory: 6GB or more (including the memory required for Windows to run, the actual memory usage of this software is 600M).

[0115] The following simulates manual operation of the automated metering system:

[0116] Step 1: Double-click "Metering Automation Auxiliary Tool.exe" to run it. A dialog box will appear offering two options: perform supplementary metering for unmetered public transformers without restarting the equipment, or perform supplementary metering after restarting the unmetered public transformer. Each option corresponds to a specific .exe application.

[0117] Step Two: Since the path where the .exe file is stored may vary on different computers, and the daily time is also a variable, after selecting the corresponding data collection method, the system first automatically retrieves the current time data and path variable, and checks if the required folder exists under that path. If it doesn't exist, it creates it automatically. The created folder paths are: First path: Local absolute path\Data\"Variable (this year, e.g., 2023)"Year\xxDetails\"Variable (current month, e.g., 06)"Month; Second path: Local absolute path\Data\Temporary Data. Next, Python automatically opens Google Chrome and enters the URL, waiting for staff to manually log in to the system. During this process, Python continuously monitors the elements after login using the Selenium module until login is successful.

[0118] Step 3: Simulate human intervention by automatically selecting the corresponding department within the metrology automation system by obtaining the department information associated with the login account.

[0119] Step Four: Based on the department's simulated manual operation, upon reaching the data page, first determine the number of pages. If there are more than one page, loop through the pages. For each page, use Selenium and BSS4 to retrieve missing data from "Today" small customers. Create a list of this data and save an Excel copy of this data in a temporary folder. Then, use pandas to clean the data, deleting redundant data and extracting the unique value of "xxxxx address," which will be used as a basis for locating data later. This list will be backed up in Excel format in the first path of Step Two, named with the time.

[0120] Step 5: Restart the "xxx device": Based on the "xxxxx address" extracted in Step 4, a while loop locates each "xxx device" with missing data and simulates a manual restart. If the "xxxxx address" is 0 during this process, it indicates no missing data, and the program terminates. During the restart process, if an error occurs, a fault-tolerant mechanism is in place to restart sequentially. During restart, the number of extracted "xxxxx addresses" will determine the forced waiting time to prevent impacting webpage response speed. The page will be refreshed after all devices have completed restarting.

[0121] Step 6: Use openpyxl to read the created backup data, and use a while loop to create a large loop that includes all the re-collection processes;

[0122] The forced waiting time is determined based on the number of extracted "xxxxx addresses" to prevent the webpage response speed from being affected;

[0123] The `len` function is used to check the length of the "xxxxx address" in the list. If the length does not meet the specifications, the message "xxxxxx address is abnormal, please verify and handle" is entered in Excel, and a `print` statement is used to indicate this. Simultaneously, this loop is skipped, and the next iteration begins. If this is the last iteration, this iteration is skipped, and the subsequent code is executed.

[0124] Create a for loop that uses the extracted "xxxxx address" as a reference to find all data containing the same "xxxxx address" in the created backup data, and extracts the row number representing each row. This step also includes a try-catch block to check if the "xxxxx address" can be read correctly and if there is corresponding data in the backup data, and also to prevent loop exceptions. If an error occurs, it means that there is a problem with the "xxxxx address". The system will use the VLOOKUP function to match the data in the statistical table, find the corresponding row in the Excel backup table, write "Data not found, please check the xxx device status, test manually later" and save.

[0125] Upon entering the supplementary data collection page, select the corresponding conditions. Based on the list of numbers extracted in step four, select the data in a loop on the supplementary data collection page and begin "supplementary collection." If an error occurs here due to the failure to find the corresponding number, it will be judged as an exception, a print statement will be displayed, and the corresponding row in Excel will be written as: "This xx serial number is abnormal." At the same time, the current loop will be skipped, and the next loop will begin. This exception usually occurs in synchronization exceptions.

[0126] Processing of returned data 1: Conditionally wait for returned data. If no data is found after the conditional wait time, it is determined that the "xxx device" is abnormal. Write "Data abnormal, please manually check the xxx device status" in all corresponding "xxxxx address" rows in Excel, save, and skip this loop to proceed to the next loop. Conditionally wait for returned data. If data is available within the conditional wait time, but the number of data points does not match the number of items in the retrieved number list, continue waiting until the number of returned data points equals the number of items in the number list, then proceed to the next step. If the number of returned data points still does not match after the wait time, write "Data abnormal, please manually check the xxx device status" in the rows in Excel where the returned data is missing. If data is available within the conditional wait time, and the number of data points matches the number of items in the retrieved number list, retrieve the returned data, save it as a nested list, and perform the following judgment on the returned data: If the retrieved data list equals 8 using the len command, it proves that there is data in the xxx device, so delete the corresponding row in Excel. If the returned data does not equal 8 using the len command, it proves that the xxx device saves this part of the data in a new nested list for later use. At the same time, if the returned data does not contain any data that is not equal to 8 when passed through the len command, the data return page is closed, the current loop is skipped, and the next loop begins. If this is the last set of data, the subsequent command is executed after skipping the current loop.

[0127] Processing of Supplementary Returned Data 2: For the data returned in step six, the list of data whose len value is not equal to 8 is tested through a direct connection to the user's communication system. A conditional wait time is set. If no data is returned within the time limit, it is judged as "Data Failure, No Data," and this judgment is written in the corresponding row of Excel. At the same time, the data return page is closed, and the current loop is skipped before proceeding to the next loop. If the next loop is the last loop, it is skipped before continuing to execute the subsequent commands. If there is data within the conditional wait time, but the number of data does not match the number of items in the retrieved number list, the wait continues until the number of returned data is equal to the number of items in the number list before proceeding to the next step. If the number is still not equal after the wait time ends, the row with missing data in Excel is written as "Data Abnormal, Please Manually Check the Status of the xxx Device." If there is data within the conditional wait time, and the number of data is the same as the number of items in the retrieved number list, the returned data is obtained and saved as a nested list. A judgment is made on the returned data: if the obtained data list has a len value of 8, it proves that there is data in the xxx device, and the corresponding row in Excel is deleted. If the returned data is not equal to 8 using the len command, then write "Dual recruitment failed" in the corresponding row of the Excel file, and proceed to the next loop. If it is the data from the last loop, then directly run the next program segment. After completing the above processing, the data in the Excel file that is not equal to the value marked "Dual recruitment failed" will be extracted, and the unique value will be extracted. The above two methods of processing and judging the returned data will be repeated until all data loops are completed.

[0128] The matching data and format settings are as follows:

[0129] After data collection and analysis are completed, the Excel data will be matched. The matching will be based on the "xxxxx address" field in the Excel file, using the VLOOKUP function to match data such as "xxxx responsible person" in the corresponding statistical table. The statistical table contains manually matched data regarding "xxxxx address" and "xxxx responsible person". If any row in the matching result is still empty, the message "No data, please check the device status and test manually later" will be entered, and the data will be saved again with the date as the name and to the corresponding absolute path.

[0130] After matching the data, use openpyxl to format the cells in the Excel file. This formatting should include at least the following: automatic line wrapping, setting the cell size, and setting the borders.

[0131] If a customer who hasn't had their data taken from the public transformer doesn't restart the equipment for supplementary data collection, the "Restart xxx device" function will not run. Throughout the entire process, a fault-tolerance mechanism is in place, allowing execution to continue even in the event of an error until completion.

[0132] The method of this invention does not require repetitive work to be performed every day. The judgment result can be obtained after the program finishes running, which improves the accuracy of data judgment and reduces the technical deviation of data judgment between different departments.

[0133] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for automatic data reacquisition of metering automation public variables, characterized in that, include: Acquire the operating condition data of manual operation during the low-voltage centralized metering process of public transformers, and preprocess the operating condition data; The preprocessing of the operating data includes: Get the current time data and path variables, and determine whether the target folder exists under the corresponding path; If it does not exist, the missing folder will be created automatically, and the path of the created folder will be saved according to the data details and time variables; If it exists, wait for manual login and monitor the elements after login to determine whether the login was successful; if the login is successful, obtain the department information corresponding to the login account and select the corresponding department within the metering automation system. Based on the department information, simulate manual operation, determine the number of data pages, if the number of pages is greater than 1, then loop through the pages and obtain the missing data of small customers within the target time period, store the missing data of small customers in a temporary file, clean the missing data of small customers to obtain the address information set and establish an address information backup. It also includes: based on the address information set, cyclically locating each device with missing data and simulating manual click to restart; if the device address is displayed as 0, it indicates that there is no missing data, and the program ends; If an anomaly occurs during the device restart process, the sequential restart will be restarted again based on the device's fault tolerance mechanism. When the device restarts, the forced waiting time is determined based on the number of address information extracted. The first supplementary sampling result is obtained by combining the preprocessing result with the preset supplementary sampling logic algorithm; Based on the first supplementary data collection result and the statistical table data, the automatic supplementary data collection of customer data under the working state of low-voltage centralized metering of public transformers is completed.

2. The method of claim 1, wherein the method further comprises: The preset supplementary sampling logic algorithm includes: Read the backed-up address information data and determine the forced waiting time based on the number of extracted address information. The device address length is determined by the len function. If the device address length does not meet the user's requirements, the device address is marked and an error is reported to remind the staff to verify and process it. The current supplementary collection cycle is skipped and the next cycle is started. If the current supplementary collection cycle is the last cycle, the current cycle is skipped and the data marked as failed in the database is extracted. The supplementary collection cycle is repeated but the data marked as failed in the double-entry bidding is not extracted again. Based on the address information of the extracted data, all data containing the same device address information are obtained from the backup data created, and the number information representing each row is extracted; if the address information does not have corresponding data in the backup data, the system will report an error indicating that there is a problem with the address information, and will use the VLOOKUP function to match the statistical table data and issue an error reminder; Based on the number information, select the corresponding supplementary data page to perform data loop selection and start supplementary data collection; if the corresponding number is not obtained during data loop selection, it is judged as an anomaly and an error message is issued, and the loop is skipped and the next loop begins.

3. The method of claim 2, wherein, Also includes: The condition awaits the return of data; If no data is found when the conditional waiting time ends, the device is determined to be faulty, and an error message is sent to remind staff to check the device status. The current loop is skipped, and the next loop begins. If data exists within the conditional waiting time, but the number of data items does not match the number of items in the retrieved list, continue waiting until the number of data items returned matches the number of items in the list before proceeding to the next step; if the waiting time ends and the number of data items still does not match, mark the missing data and issue an error message. If data exists within the conditional waiting time, and the number of data items is the same as the number of items in the retrieved number list, then retrieve the returned data, save the returned data as a nested list, and make a judgment on the returned data. If the saved returned data list is 8 using the len command, it means that the device has data, and the corresponding row in the database is deleted; if the returned data is not equal to 8 using the len command, it means that the device saves this part of the data in a new nested list for processing the data returned from the second acquisition. If the returned data does not contain any data not equal to 8 using the len command, then close the data return page, skip this loop, and start the next loop. If this loop is the last set of data, then after skipping this loop, extract the data from the database that does not include the data marked as failed in the dual recruitment process, repeat the conditional waiting for the returned data processing loop, and no longer extract the data marked as failed in the dual recruitment process.

4. The method of claim 3, wherein the method further comprises: The data processing returned from the second supplementary sampling includes: The returned data is tested through a direct connection to the user via a data list where the len command is not equal to 8. A conditional wait time is set. If no data is returned within the wait time, the data is judged as failed and there is no data. The judgment is marked in the corresponding row of the database, the data return page is closed, and the loop is skipped before the next loop. If the current loop is the last loop, the current loop is skipped and the conditional wait for the returned data processing command is continued. If data exists within the conditional waiting time, but the number of data items does not match the number of items in the retrieved number list, continue waiting until the number of returned data items is equal to the number of items in the number list before proceeding to the next step. If the number of data items is still not equal after the waiting time ends, mark the returned data as abnormal in the database and issue an alarm. If data exists within the conditional waiting time, and the number of data items is the same as the number of items in the retrieved list, then retrieve the returned data, save the returned data as a nested list, and make a judgment on the returned data. If the returned data list is 8 using the len command, it means that there is data in the device, so the corresponding area in the database is deleted; if the returned data list is not equal to 8 using the len command, the corresponding row in the database is marked as a failure of dual-scanning and the next loop is entered. If this loop is the last loop data, the data in the database that does not include the marked failure of dual-scanning is directly extracted, and the data processing loop returned by the second supplementary sampling is repeated without extracting the data marked as a failure of dual-scanning. Based on the above processing method, data in the database that are not marked as failed dual-encoding are extracted, and unique values ​​are extracted. Data is judged again until all data loops are completed, and the first supplementary sampling result is obtained.

5. The method of claim 4, wherein the method further comprises: The first supplementary sampling results are matched with statistical table data, including: Based on the device address information in the database, the VLOOKUP function is used to match the target data in the corresponding statistical table. If the judgment result is still a blank area, an error message will be displayed and marked, and the data will be saved to the corresponding absolute path; once the data matching is completed, the database format will be set and the data will be stored.

6. An automated metering system for automatic supplementary data collection from public transformers, applied to the method described in any one of claims 1-5, characterized in that, include: The data acquisition module is used to acquire the operating condition data of manual operation during the low-voltage centralized metering process of the public transformer, and to preprocess the operating condition data. The calculation module is used to obtain the first supplementary sampling result based on the preprocessing result and a preset supplementary sampling logic algorithm; The data supplementation module is used to match the first supplementation result with the statistical table data to complete the automatic supplementation of customer data under the working state of low-voltage centralized metering of public transformers.

7. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the automatic supplementary data collection method for metering automation of public transformers as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the automatic data replenishment method for metering automation of public transformers as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data complementary collection method and system

    CN103678726A

  • Data supplementary calling automation method based on RPA robot

    CN112008766A