Data clearing method, system and medium for electric energy meter
Through the step-by-step data clearing method, the electric energy meter gradually completes the data clearing when receiving the general clearing command, which solves the problems of communication delay and long system time caused by large data volume, and improves the response speed and Data update efficiency.
Patent Information
- Application Number
- CN202410584838.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-13
AI Technical Summary
When the existing electric energy meter receives the total clear command, the large amount of data will affect the response frame return, causing communication delays, affecting the update and display of electric energy data, and taking up too long system time, affecting subsequent data communication.
Using a step-by-step data clearing method, only part of the data is cleared each time the preset process is executed. Data clearing is completed through several execution processes, shortening the execution cycle of each process and ensuring the normal operation of other tasks in the system.
It realizes the rapid completion of data clearing without affecting other process tasks, shortens the system time, and improves the response speed and data update efficiency of the electric energy meter.
Smart Images

Figure CN118170434B
Abstract
Description
Technical Field
[0001] The present application relates to the field of instrument technology, and in particular to a data clearing method, system and medium for an electric energy meter. Background Art
[0002] Before the electric energy meter leaves the factory, the electric energy meter data will be cleared to clear the electric energy, maximum demand and occurrence time, frozen quantity, event record, load record and other data in the electric energy meter. In the related technology, the following two processing methods are commonly used: 1. When the electric energy meter receives the electric energy meter total clearing command sent by the master station or the host computer, it directly performs the total clearing in the communication processing unit, and returns the response frame to the master station or the host computer after the total clearing is completed. At this time, if the amount of data is large, it will affect the return of the response frame, thereby affecting the communication with the master station. It will also take too long, affecting the update and display of the electric energy data, and even affecting the next frame of data communication. 2. When the electric energy meter receives the electric energy meter total clearing command sent by the master station or the host computer, the total clearing flag is set first, and the response frame is replied to the master station or the host computer. Then the program judges the total clearing flag in the main process, and if it is set, the total clearing operation is performed. At this time, although it does not affect the normal communication with the master station or host computer, if the data volume is large, it will take too long, affecting the update and display of the power data, and even affecting the next frame of data communication.
[0003] In view of the above problems, effective technical solutions are urgently needed. Summary of the invention
[0004] The purpose of the present application is to provide a data clearing method, system and medium for an electric energy meter, which realizes the step-by-step data clearing method of the electric energy meter. Each time a preset process is executed, only part of the data is cleared, which takes up less system time and does not affect other process tasks of the execution process. After several execution processes, data clearing can be completed, shortening the execution cycle of each preset process, which is conducive to the electric energy meter to respond to other task functions more quickly.
[0005] In a first aspect, the present application provides a method for clearing data of an electric energy meter, the method comprising:
[0006] When receiving the meter total clear command sent by the master station, the meter total clear status bit is set to the flag bit of the clear flag bit corresponding to the first clear operation in the meter clear processing task, and the clear flag bit includes the flag bits corresponding to the multiple clear operations sequentially executed in the meter clear processing task;
[0007] In the case where the preset process executed cyclically points to the meter clearing processing task, checking the meter total clearing status bit;
[0008] When it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, performing a clearing operation corresponding to the first flag bit;
[0009] When the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing status bit of the electric meter is set to the second flag bit of the clearing flag bit corresponding to the clearing operation after the clearing operation corresponding to the first flag bit;
[0010] When the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit;
[0011] Exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process.
[0012] Optionally, after performing the first clearing operation corresponding to the first flag bit, the method further includes:
[0013] Accumulate a preset value for the check value corresponding to the meter clearing processing task;
[0014] Accordingly, before executing the first clearing operation corresponding to the first flag bit, the method further includes:
[0015] Performing a check on the reset flag bit corresponding to the check value corresponding to the recorded meter reset processing task, wherein each flag bit in the reset flag bit is correspondingly provided with a preset check value;
[0016] The performing of a first clearing operation corresponding to the first flag bit includes:
[0017] When it is determined that the check value meets the preset check value corresponding to the first flag bit, a first clearing operation corresponding to the first flag bit is performed.
[0018] Optionally, also include:
[0019] When it is determined that the check value does not meet the preset check value corresponding to the first flag bit, the check value is cleared, and the total clear status bit of the meter is set to the idle flag bit, the meter clearing processing task is exited, and the next process task of the preset process is continued to be executed until the process task of the preset process is completed, and the preset process is restarted.
[0020] Optionally, when exiting the meter clearing processing task, the method further includes:
[0021] Output an abnormal warning message, wherein the abnormal warning message includes a preset check value corresponding to the first flag bit.
[0022] Optionally, before setting the total clearing status bit of the electric meter to the flag bit of the clearing flag bit corresponding to the first clearing operation in the electric meter clearing processing task, the method further includes:
[0023] Detecting the check value corresponding to the electric meter clearing processing task;
[0024] Correspondingly, the method of setting the total clearing status bit of the electric meter to the flag bit of the clearing flag bit corresponding to the first clearing operation in the electric meter clearing processing task includes:
[0025] When it is determined that the check value corresponding to the meter clearing processing task is a first value, the meter total clearing status bit is set to the flag bit of the clearing flag bit corresponding to the first clearing operation in the meter clearing processing task, wherein the first value is used to indicate that the electric energy meter has not performed data clearing.
[0026] Optionally, also include:
[0027] When it is determined that the check value corresponding to the meter clearing processing task is a second value, clearing repetition information is output, wherein the second value is used to indicate that the electric energy meter is performing data clearing or has completed data clearing.
[0028] Optionally, also include:
[0029] When it is determined that the meter total clearing status bit is an idle flag bit, the meter clearing processing task is exited, and the next process task of the preset process is continued to be executed until the process task of the preset process is completed, and the preset process is restarted.
[0030] Optionally, the multiple clearing operations performed sequentially include: clearing electric energy, clearing demand, clearing frozen energy, clearing event records, and clearing load records.
[0031] In a second aspect, the present application provides a data clearing system for an electric energy meter, the data clearing system for the electric energy meter comprising: a memory and a processor, the memory comprising a program of a data clearing method for the electric energy meter, and the program of the data clearing method for the electric energy meter, when executed by the processor, implements the following steps:
[0032] When receiving the meter total clear command sent by the master station, the meter total clear status bit is set to the flag bit of the clear flag bit corresponding to the first clear operation in the meter clear processing task, and the clear flag bit includes the flag bits corresponding to the multiple clear operations sequentially executed in the meter clear processing task;
[0033] In the case where the preset process executed cyclically points to the meter clearing processing task, checking the meter total clearing status bit;
[0034] When it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, performing a clearing operation corresponding to the first flag bit;
[0035] When the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing status bit of the electric meter is set to the second flag bit of the clearing flag bit corresponding to the clearing operation after the clearing operation corresponding to the first flag bit;
[0036] When the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit;
[0037] Exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process.
[0038] In a third aspect, the present application also provides a computer-readable storage medium, which includes a data clearing method program for an electric energy meter. When the data clearing method program for the electric energy meter is executed by a processor, the steps of the data clearing method for the electric energy meter as described in any embodiment of the present application are implemented.
[0039] As can be seen from the above, when the meter total clear command sent by the master station is received, the meter total clear status bit is set to the flag bit in the zero flag bit corresponding to the first zeroing operation in the meter zeroing processing task, and the zeroing flag bit includes the flag bit corresponding to the multi-step zeroing operations sequentially executed in the meter zeroing processing task; when the preset process executed in a loop points to the meter zeroing processing task, the meter total clear status bit is checked; when it is determined that the meter total clear status bit is the first flag bit in the zero flag bit, the zeroing operation corresponding to the first flag bit is executed; when the first flag bit is not the flag bit corresponding to the last step operation in the multi-step zeroing operation, the meter total clear status bit is set to the second flag bit after the zeroing operation corresponding to the first flag bit in the zero flag bit; when the first flag bit is the flag bit corresponding to the last step operation in the multi-step zeroing operation, the meter total clear status bit is set to the idle flag bit; exit the meter zeroing processing task, and continue to execute the next process task of the preset process until the process task of the preset process is completed and the preset process is restarted. The electric energy meter adopts the step-by-step data clearing method. Each time the preset process is executed, only part of the data is cleared, which takes up less system time and does not affect other process tasks of the execution process. After several execution processes, data clearing can be completed, shortening the execution cycle of each preset process, which is conducive to the electric energy meter to respond to other task functions more quickly.
[0040] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A flow chart of a method for clearing data of an electric energy meter provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a preset process of an electric energy meter provided in an embodiment of the present application;
[0044] Figure 3 A flowchart of a method for clearing data of an electric energy meter including a verification process provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of a process of performing data clearing step by step by executing multiple preset processes provided in an embodiment of the present application;
[0046] Figure 5 A flowchart of a method for clearing data of an electric energy meter including a process of abnormally exiting an electric energy meter clearing task provided by an embodiment of the present application;
[0047] Figure 6 A flowchart of a method for clearing data of an electric energy meter including determining whether to perform a data clearing process by a check value provided in an embodiment of the present application;
[0048] Figure 7 A schematic diagram of the structure of a data clearing system for an electric energy meter provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0050] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0051] Please refer to Figure 1 , is a flow chart of a method for clearing data of an electric energy meter provided in an embodiment of the present application. The method for clearing data of an electric energy meter comprises the following steps:
[0052] Step S101, upon receiving the meter total clear command sent by the master station, setting the meter total clear status bit to the flag bit of the clear flag bit corresponding to the first clear operation in the meter clear processing task, wherein the clear flag bit includes flag bits corresponding to multiple clear operations sequentially executed in the meter clear processing task;
[0053] Step S102: when the preset process executed in a loop points to the meter clearing processing task, checking the meter total clearing status bit;
[0054] Step S103: when it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, executing a clearing operation corresponding to the first flag bit;
[0055] Step S104: if the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing state bit of the electric meter is set to the second flag bit after the clearing operation corresponding to the first flag bit in the clearing flag bit;
[0056] Step S105: when the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit;
[0057] Step S106, exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process.
[0058] It should be noted that the master station may be a central control device for managing the electric energy meter, the electric energy meter total clear command may be an instruction from the master station to instruct the electric energy meter to clear data, and the electric energy meter total clear status bit may be used to indicate whether the electric energy meter is in a data clearing state or an idle state, and if in a data clearing state, which stage of data clearing it belongs to. The electric energy meter cyclically executes the same preset process, wherein, Figure 2 A schematic diagram of a preset process of an electric energy meter provided in an embodiment of the present application, such as Figure 2As shown, the preset process includes multiple process tasks that are executed in sequence, including parameter initialization tasks, tasks to determine whether to power on, LCD button processing tasks, communication processing tasks, electric energy metering processing tasks, meter clearing processing tasks, tasks to determine whether to perform meter time stamp processing tasks, meter time stamp processing tasks, and low power consumption processing tasks. Among them, the LCD button processing task is mainly responsible for LCD wheel display, press display, button setting parameters, etc.; the communication processing task is mainly responsible for RS485, NB-IoT communication transceiver processing, etc.; the electric energy metering processing task is mainly responsible for communicating with the metering chip, reading instantaneous quantity, electric energy, and electric energy accumulation, etc.; the meter clearing processing task is mainly responsible for clearing data such as electric energy, maximum demand and occurrence time, frozen quantity, event record, load record, etc. The meter time stamp processing task is mainly responsible for timing every second, every minute, every hour, and every day; the low power consumption processing task is mainly responsible for entering the low power consumption state, waking up and exiting the low power consumption at a scheduled time, etc. Optionally, the meter clearing processing task includes multiple steps of clearing operations executed sequentially, and each step of the clearing operation corresponds to setting one of the clearing flags. For example, the multiple steps of the clearing operation include electric energy clearing, demand clearing, frozen clearing, event record clearing, and load record clearing. Correspondingly, the clearing flag may include multiple flags, for example, it may include flag 1, flag 2, flag 3, flag 4, and flag 5, wherein flag 1 is used to indicate electric energy clearing, flag 2 is used to indicate demand clearing, flag 3 is used to indicate frozen clearing, flag 4 is used to indicate event record clearing, and flag 5 is used to indicate load record clearing. Any flag of the clearing flag can be used to indicate that the electric energy meter is in a clearing state, and a clearing operation matching the flag needs to be performed. For example, when the electric energy meter total clearing command sent by the master station is received, the electric energy meter total clearing state bit can be set to flag 1, and when the preset process executed in a loop points to the electric energy meter clearing processing task, the first step of data clearing is entered. Before executing the meter clearing processing task, the meter total clearing status bit can be checked. The first flag bit can be one of multiple clearing flag bits. Each time the preset process is executed to reach the meter clearing processing task, the meter total clearing status bit needs to be used to determine whether to clear and the clearing operation to be performed if clearing is performed. For example, when the meter total clearing status bit is flag bit 1 in the clearing flag bit, the electric energy clearing operation corresponding to flag bit 1 is performed. When the meter total clearing status bit is flag bit 3 in the clearing flag bit, the frozen amount clearing operation corresponding to flag bit 3 is performed.After completing the cleaning operation corresponding to the first flag, the first flag can be judged. If the first flag is not the flag corresponding to the last step of the multi-step clearing operation, for example, the first flag is not flag 5, it means that all clearing operations corresponding to the meter clearing processing task have not been completed. When the preset process needs to be executed next time, the next clearing operation of the clearing operation corresponding to the first flag is continued to be completed. Therefore, the meter total clearing status bit can be set to the second flag after the clearing operation corresponding to the first flag in the clearing flag. For example, the first flag is flag 2, and after completing the clearing operation corresponding to flag 2, the second flag is set to flag 3. If the first flag is the flag corresponding to the last step of the multi-step clearing operation, for example, the first flag is flag 5, it means that all clearing operations corresponding to the meter clearing processing task have been completed, and there is no need to clear the data. Therefore, the meter total clearing status can be set to the idle flag, indicating that the meter clearing processing task does not need to clear the data. After completing the setting of the meter total clear status bit, exit the meter clear processing task and continue to execute the next process task of the preset process, for example, determine whether to perform the meter time stamp processing task, until the process task of the preset process is completed and restart the preset process.
[0059] Optionally, when the preset process executed in a loop points to the meter clearing processing task, the meter total clearing status bit is checked. When it is determined that the meter total clearing status bit is an idle flag bit, the meter clearing processing task is exited and the next process task of the preset process is continued to be executed until the process task of the preset process is completed and the preset process is restarted.
[0060] It should be noted that the meter total clear status bit is an idle flag bit, which means that there is no need to clear the data, and the meter clear processing task can be skipped to continue executing the next process task.
[0061] In the above, when receiving the meter total clear command sent by the master station, the meter total clear status bit is set to the flag bit in the zero flag bit corresponding to the first zeroing operation in the meter zeroing processing task, the zeroing flag bit includes the flag bits corresponding to the multi-step zeroing operations sequentially executed in the meter zeroing processing task; when the preset process executed in a loop points to the meter zeroing processing task, the meter total clear status bit is checked; when it is determined that the meter total clear status bit is the first flag bit in the zero flag bit, the zeroing operation corresponding to the first flag bit is executed; when the first flag bit is not the flag bit corresponding to the last step in the multi-step zeroing operation, the meter total clear status bit is set to the second flag bit after the zeroing operation corresponding to the first flag bit in the zero flag bit; when the first flag bit is the flag bit corresponding to the last step in the multi-step zeroing operation, the meter total clear status bit is set to the idle flag bit; the meter zeroing processing task is exited, and the next process task of the preset process is continued to be executed until the process task of the preset process is completed, and the preset process is restarted. The electric energy meter adopts the step-by-step data clearing method. Each time the preset process is executed, only part of the data is cleared, which takes up less system time and does not affect other process tasks of the execution process. After several execution processes, data clearing can be completed, shortening the execution cycle of each preset process, which is conducive to the electric energy meter to respond to other task functions more quickly.
[0062] Please refer to Figure 3 , is a flow chart of a method for clearing data of an electric energy meter including a verification process provided by an embodiment of the present application. The method for clearing data of an electric energy meter includes the following steps:
[0063] Step S201, when receiving the meter total clear command sent by the master station, the meter total clear status bit is set to the flag bit of the clear flag bit corresponding to the first clear operation in the meter clear processing task, and the clear flag bit includes the flag bits corresponding to the multiple clear operations sequentially executed in the meter clear processing task;
[0064] Step S202: when the preset process executed in a loop points to the meter clearing processing task, check the meter total clearing status bit;
[0065] Step S203: when it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, the check value corresponding to the recorded electric meter clearing processing task is checked for the corresponding clearing flag bit, and each flag bit in the clearing flag bits is correspondingly set with a preset check value;
[0066] Step S204: when it is determined that the check value meets the preset check value corresponding to the first flag bit, a first clearing operation corresponding to the first flag bit is performed, and the check value corresponding to the meter clearing processing task is added with a preset value;
[0067] Step S205: If the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing status bit of the electric meter is set to the second flag bit after the clearing operation corresponding to the first flag bit in the clearing flag bit;
[0068] Step S206: when the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit;
[0069] Step S207, exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process.
[0070] It should be noted that the check value can be used to check whether the flag bit of the total clearing status bit of the meter corresponds to the current clearing stage. For example, the clearing status bit is flag bit 1 corresponding to check value 1. After completing the clearing operation corresponding to flag bit 1, the total clearing status bit of the meter is set to flag bit 2. At this time, the check value can be accumulated with a preset value, for example, 0xA5A5 is accumulated to obtain check value 2. Then, when the preset process is executed next time and the meter clearing processing task is reached, it is determined that the total clearing status bit of the meter is flag bit 2. It is necessary to simultaneously determine that the check value is check value 2 to be considered as passed. Otherwise, the data corresponding to flag bit 2 cannot be cleared. By adding the verification process, the accuracy of the data is guaranteed each time the step-by-step and item-by-item clearing is performed. Figure 4 A schematic diagram of a process of performing data clearing step by step by executing multiple preset processes is provided in an embodiment of the present application, such as Figure 4As shown, the initial state of the meter clearing processing task of the energy meter is the idle state. The electric energy can be cleared by setting the total clearing state bit of the meter to the flag bit 1. If the verification is wrong, the total clearing state bit of the meter is set to the idle flag bit, so that the initial state of the meter clearing processing task is restored to the idle state; the next time the preset process is executed, the demand can be cleared by setting the total clearing state bit of the meter to the flag bit 2. If the verification is wrong, the total clearing state bit of the meter is set to the idle flag bit, so that the initial state of the meter clearing processing task is restored to the idle state; the next time the preset process is executed, the demand can be cleared by setting the total clearing state bit of the meter to the flag bit 3. Clearing, if the verification is wrong, the total clearing status bit of the meter is set to the idle flag bit to restore the initial state of the meter clearing processing task to the idle state; the next time the preset process is executed, the event record can be cleared by setting the total clearing status bit of the meter to the flag bit 4. If the verification is wrong, the total clearing status bit of the meter is set to the idle flag bit to restore the initial state of the meter clearing processing task to the idle state; the next time the preset process is executed, the load record can be cleared by setting the total clearing status bit of the meter to the flag bit 5. After completion, the total clearing status bit of the meter can be set to the idle flag bit to restore the initial state of the meter clearing processing task to the idle state.
[0071] Please refer to Figure 5 , is a flow chart of a method for clearing data of an electric energy meter including an abnormal exit from a meter clearing task process provided by an embodiment of the present application. The method for clearing data of an electric energy meter includes the following steps:
[0072] Step S301, upon receiving the meter total clear command sent by the master station, setting the meter total clear status bit to the flag bit of the clear flag bit corresponding to the first clear operation in the meter clear processing task, the clear flag bit including the flag bits corresponding to the multiple clear operations sequentially executed in the meter clear processing task;
[0073] Step S302: when the preset process executed in a loop points to the meter clearing processing task, check the meter total clearing status bit;
[0074] Step S303: when it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, the check value corresponding to the recorded electric meter clearing processing task is checked for the corresponding clearing flag bit, and each flag bit in the clearing flag bits is correspondingly set with a preset check value;
[0075] Step S304: when it is determined that the check value meets the preset check value corresponding to the first flag bit, a first clearing operation corresponding to the first flag bit is performed, and the check value corresponding to the meter clearing processing task is added with a preset value;
[0076] Step S305: If the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing status bit of the electric meter is set to the second flag bit after the clearing operation corresponding to the first flag bit in the clearing flag bit;
[0077] Step S306: when the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit;
[0078] Step S307, exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process.
[0079] Step S308: When it is determined that the check value does not meet the preset check value corresponding to the first flag bit, the check value is cleared, and the total clear status bit of the meter is set to the idle flag bit, the meter clearing processing task is exited, and the next process task of the preset process is continued to be executed until the process task of the preset process is completed, and the preset process is restarted.
[0080] It should be noted that when the check value does not match the preset check value corresponding to the first flag bit, it means that the data clearing is abnormal and needs to be cleared again, so the check value is cleared and the meter total clearing status bit is set to the idle flag bit, so that the data can be cleared again when the preset process is executed next time. At the same time, the meter clearing processing task is terminated and the next process task is continued, without affecting other tasks of the preset process.
[0081] Optionally, in the aforementioned embodiment, while abnormally exiting the meter clearing processing task, the method further includes:
[0082] Output an abnormal warning message, where the abnormal warning message includes a check value corresponding to the first flag bit.
[0083] It should be noted that the abnormal warning message and the check value it contains can notify the master station of the abnormality in data clearing and the zeroing stage where the abnormality occurred, which is beneficial for the master station to conduct abnormality troubleshooting, or issue instructions to continue to execute the remaining zeroing operations based on the zeroing stage, to ensure the smooth progress of data clearing.
[0084] Please refer to Figure 6 , is a flow chart of a method for clearing data of an electric energy meter provided in an embodiment of the present application, which includes determining whether to perform a data clearing process by a check value. The method for clearing data of an electric energy meter includes the following steps:
[0085] Step S401: upon receiving the meter total clear command sent by the master station, detecting the check value corresponding to the meter clear processing task, and in the case of determining that the check value corresponding to the meter clear processing task is a first value, setting the meter total clear status bit to a flag bit in the clear flag bit corresponding to the first clear operation in the meter clear processing task, wherein the first value is used to indicate that the electric energy meter has not cleared data, and the clear flag bit includes flag bits corresponding to multiple clear operations sequentially executed in the meter clear processing task;
[0086] Step S402: when the preset process executed in a loop points to the meter clearing processing task, check the meter total clearing status bit;
[0087] Step S403: when it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, the check value corresponding to the recorded electric meter clearing processing task is checked for the corresponding clearing flag bit, and each flag bit in the clearing flag bits is correspondingly set with a preset check value;
[0088] Step S404: when it is determined that the check value meets the preset check value corresponding to the first flag bit, a first clearing operation corresponding to the first flag bit is performed, and the check value corresponding to the meter clearing processing task is added with a preset value;
[0089] Step S405: if the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing status bit of the electric meter is set to the second flag bit after the clearing operation corresponding to the first flag bit in the clearing flag bit;
[0090] Step S406: when the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit;
[0091] Step S407, exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process.
[0092] It should be noted that the possible values of the check value may be a first value and a second value. The first value may indicate that the electric energy meter has not performed data clearing, for example, the first value is 0, and the second value may indicate that the electric energy meter is performing data clearing or has completed data clearing, for example, including multiple preset check values in the process of checking value accumulation. After receiving the electric energy meter total clearing command from the master station, the electric energy meter continuously loops through the process until the accumulation reaches the check value corresponding to the last clearing flag. Therefore, when receiving the electric energy meter total clearing command sent by the master station, the check value may be judged to determine whether the electric energy meter has started data clearing or completed data clearing. If the electric energy meter has started data clearing or completed data clearing, there is no need to continue to execute the electric energy meter total clearing command, and the clearing completion information may be output accordingly. If the electric energy meter has not started data clearing, the electric energy meter total clearing status bit may be set to the flag bit of the clearing flag bit corresponding to the first clearing operation in the electric energy meter clearing processing task, and data clearing may begin. This can avoid the master station repeatedly sending the meter clearing command, repeatedly executing the data clearing operation, or affecting the ongoing data clearing operation, thereby ensuring the normal progress of data clearing.
[0093] Optionally, when it is determined that the check value corresponding to the meter clearing processing task is a second value, clearing repetition information is output, wherein the second value is used to indicate that the electric energy meter is performing data clearing or has completed data clearing.
[0094] Please refer to Figure 7 , also discloses a data clearing system for an electric energy meter, including a memory 21 and a processor 22, the processor 22 including a system background processor and a processor of the electric energy meter, the memory 21 includes a program of a data clearing method for the electric energy meter, and when the program of the data clearing method for the electric energy meter is executed by the processor 22, the following steps are implemented:
[0095] When receiving the meter total clear command sent by the master station, the meter total clear status bit is set to the flag bit of the first clear operation in the meter clear processing task in the clear flag bit, and the clear flag bit includes the flag bits corresponding to the multiple clear operations sequentially executed in the meter clear processing task;
[0096] In the case where the preset process of cyclic execution points to the meter clearing processing task, checking the meter total clearing status bit;
[0097] When it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, executing the clearing operation corresponding to the first flag bit;
[0098] When the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing state bit of the electric meter is set to the second flag bit after the clearing operation corresponding to the first flag bit in the clearing flag bit;
[0099] When the first flag bit is the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing state bit of the electric meter is set to the idle flag bit;
[0100] Exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process.
[0101] As described above, when the meter total clear command sent by the master station is received, the meter total clear status bit is set to the flag bit in the zero flag bit corresponding to the first zeroing operation in the meter zeroing processing task, and the zeroing flag bit includes the flag bit corresponding to the multi-step zeroing operations sequentially executed in the meter zeroing processing task; when the preset process executed in a loop points to the meter zeroing processing task, the meter total clear status bit is checked; when it is determined that the meter total clear status bit is the first flag bit in the zero flag bit, the zeroing operation corresponding to the first flag bit is executed; when the first flag bit is not the flag bit corresponding to the last step in the multi-step zeroing operation, the meter total clear status bit is set to the second flag bit after the zeroing operation corresponding to the first flag bit in the zero flag bit; when the first flag bit is the flag bit corresponding to the last step in the multi-step zeroing operation, the meter total clear status bit is set to the idle flag bit; exit the meter zeroing processing task, and continue to execute the next process task of the preset process until the process task of the preset process is completed and the preset process is restarted. The electric energy meter adopts a step-by-step data clearing method, and each time the preset process is executed, only part of the data is cleared, which takes up less system time and does not affect other process tasks of the execution process. After several execution processes, data clearing can be completed, shortening the execution cycle of each preset process, which is conducive to the electric energy meter to respond to other task functions more quickly. It is worth noting that the data clearing system of the electric energy meter can be the execution body of the data clearing method of the electric energy meter in any embodiment of the present application, and has the same beneficial effects.
[0102] The present invention also provides a computer-readable storage medium, which includes a data clearing method program for an electric energy meter. When the data clearing method program for an electric energy meter is executed by a processor, the steps of the data clearing method for an electric energy meter as described above are implemented.
[0103] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0104] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0105] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0106] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, the aforementioned program can be stored in a readable storage medium, and when the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0107] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
Claims
1. A method for clearing data of an electric energy meter, characterized in that: The data clearing method comprises: When receiving the meter total clear command sent by the master station, the meter total clear status bit is set to the flag bit of the clear flag bit corresponding to the first clear operation in the meter clear processing task, and the clear flag bit includes the flag bits corresponding to the multiple clear operations sequentially executed in the meter clear processing task; In the case where the preset process executed cyclically points to the meter clearing processing task, checking the meter total clearing status bit; When it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, performing a clearing operation corresponding to the first flag bit; When the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing status bit of the electric meter is set to the second flag bit of the clearing flag bit corresponding to the clearing operation after the clearing operation corresponding to the first flag bit; When the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit; Exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process; After executing the first clearing operation corresponding to the first flag bit, the method further includes: Accumulate a preset value for the check value corresponding to the meter clearing processing task; Accordingly, before executing the first clearing operation corresponding to the first flag bit, the method further includes: Performing a check on the reset flag bit corresponding to the check value corresponding to the recorded meter reset processing task, wherein each flag bit in the reset flag bit is correspondingly provided with a preset check value; The performing of a first clearing operation corresponding to the first flag bit includes: When it is determined that the check value meets the preset check value corresponding to the first flag bit, performing a first clearing operation corresponding to the first flag bit; Before the meter total clearing status bit is set to the flag bit of the clearing flag bit corresponding to the first clearing operation in the meter clearing processing task, the method further includes: Detecting the check value corresponding to the electric meter clearing processing task; Correspondingly, the method of setting the total clearing status bit of the electric meter to the flag bit of the clearing flag bit corresponding to the first clearing operation in the electric meter clearing processing task includes: When it is determined that the check value corresponding to the meter clearing processing task is a first value, the meter total clearing status bit is set to the flag bit of the clearing flag bit corresponding to the first clearing operation in the meter clearing processing task, wherein the first value is used to indicate that the electric energy meter has not performed data clearing.
2. The data clearing method according to claim 1, characterized in that: Also includes: When it is determined that the check value does not meet the preset check value corresponding to the first flag bit, the check value is cleared, and the total clear status bit of the meter is set to the idle flag bit, the meter clearing processing task is exited, and the next process task of the preset process is continued to be executed until the process task of the preset process is completed, and the preset process is restarted.
3. The data clearing method according to claim 2, characterized in that: When the electric meter clearing processing task is exited, the process also includes: Output an abnormal warning message, wherein the abnormal warning message includes a preset check value corresponding to the first flag bit.
4. The data clearing method according to claim 1, characterized in that: Also includes: When it is determined that the check value corresponding to the meter clearing processing task is a second value, clearing repetition information is output, wherein the second value is used to indicate that the electric energy meter is performing data clearing or has completed data clearing.
5. The data clearing method according to claim 1, characterized in that: Also includes: When it is determined that the meter total clearing status bit is an idle flag bit, the meter clearing processing task is exited, and the next process task of the preset process is continued to be executed until the process task of the preset process is completed, and the preset process is restarted.
6. The data clearing method according to claim 1, characterized in that: The multiple clearing operations performed sequentially include: clearing electric energy, clearing demand, clearing frozen energy, clearing event records, and clearing load records.
7. A data clearing system for an electric energy meter, characterized in that: The data clearing system of the electric energy meter comprises: a memory and a processor, wherein the memory comprises a program of the data clearing method of the electric energy meter, and when the program of the data clearing method of the electric energy meter is executed by the processor, the following steps are implemented: When receiving the meter total clear command sent by the master station, the meter total clear status bit is set to the flag bit of the clear flag bit corresponding to the first clear operation in the meter clear processing task, and the clear flag bit includes the flag bits corresponding to the multiple clear operations sequentially executed in the meter clear processing task; In the case where the preset process executed cyclically points to the meter clearing processing task, checking the meter total clearing status bit; When it is determined that the total clearing status bit of the electric meter is the first flag bit in the clearing flag bits, performing a clearing operation corresponding to the first flag bit; When the first flag bit is not the flag bit corresponding to the last step operation in the multi-step clearing operation, the total clearing status bit of the electric meter is set to the second flag bit of the clearing flag bit corresponding to the clearing operation after the clearing operation corresponding to the first flag bit; When the first flag bit is the flag bit corresponding to the last step of the multi-step clearing operation, the meter total clearing state bit is set to an idle flag bit; Exit the meter clearing processing task, continue to execute the next process task of the preset process, until the process task of the preset process is completed, and restart the preset process; After executing the first clearing operation corresponding to the first flag bit, the method further includes: Accumulate a preset value for the check value corresponding to the meter clearing processing task; Accordingly, before executing the first clearing operation corresponding to the first flag bit, the method further includes: Performing a check on the reset flag bit corresponding to the check value corresponding to the recorded meter reset processing task, wherein each flag bit in the reset flag bit is correspondingly provided with a preset check value; The performing of a first clearing operation corresponding to the first flag bit includes: When it is determined that the check value meets the preset check value corresponding to the first flag bit, performing a first clearing operation corresponding to the first flag bit; Before the meter total clearing status bit is set to the flag bit of the clearing flag bit corresponding to the first clearing operation in the meter clearing processing task, the method further includes: Detecting the check value corresponding to the electric meter clearing processing task; Correspondingly, the method of setting the total clearing status bit of the electric meter to the flag bit of the clearing flag bit corresponding to the first clearing operation in the electric meter clearing processing task includes: When it is determined that the check value corresponding to the meter clearing processing task is a first value, the meter total clearing status bit is set to the flag bit of the clearing flag bit corresponding to the first clearing operation in the meter clearing processing task, wherein the first value is used to indicate that the electric energy meter has not performed data clearing.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a data clearing method program for an electric energy meter. When the data clearing method program for an electric energy meter is executed by a processor, the steps of the data clearing method for an electric energy meter according to any one of claims 1 to 6 are implemented.
