A method to solve the problem of the first few bytes being overwritten during the sampling process of load identification raw data

By configuring interrupts and timers in the power meter, we ensure that the first few bytes are not covered during the sampling data transmission process, which solves the problem of data coverage during the load identification and the accuracy of power load analysis is achieved.

CN114184858BActive Publication Date: 2025-02-28STATE GRID HUBEI MARKETING SERVICE CENT (MEASUREMENT CENT) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111375711.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-02-28
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

During the sampling process of load identification original data, the power meter may cause the first few bytes to be covered when sending data, and thus cannot form a circular wave curve, affecting the accuracy of power load analysis.

Method used

By opening up 256 points of global memory in the embedded software of the power meter, configuring interrupts and timers, judging the interrupt status of the sampled data, and starting the DMA to send voltage and current raw data when specific conditions are met, ensuring data integrity.

Benefits of technology

It effectively solves the problem that the first few bytes of the sampled data are covered, and complete sampling of the cycle wave curve is achieved, thereby ensuring the accuracy of power load analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114184858B_ABST
    Figure CN114184858B_ABST
Patent Text Reader

Abstract

The present invention provides a method for solving the problem that the first few bytes are covered during the sampling process of the load identification raw data, including the following specific steps: S1. Opening a 256-point global memory configuration interrupt and timer; S2. Judging whether the sampled data enters a half-full interrupt; S3. Judging whether the sampling point is 64 points; S4. Judging whether the sampling point is 128 points or 256 points; S5. Judging whether the sampled data enters a full interrupt, if it enters a full interrupt, executing step S6, otherwise ending the task; S6. Judging whether the sampling point is 64 points, if the sampling point is 64 points, executing step S7, if the sampling point is not 64 points, ending the task; S7. Copying the first 5 points in step S3 and the remaining 59 points to the backup area; S8. Starting DMA to send the voltage and current raw data to the load acquisition module to complete data transmission. The present invention solves the problem that the first few bytes of the sampled data are covered, realizes the complete sampling of the frequency curve, and thus realizes accurate power load analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent electricity consumption, and in particular is a method for solving the problem that the first several bytes are overwritten in the process of sampling raw data for load identification. Background Art

[0002] In recent years, non-embedded load identification technology has been widely used in various fields. In order to identify the power load of various household appliances, it is necessary to collect the original voltage and current data inside the electric energy meter through the load identification module, calculate and analyze the load curve based on the original data, and then identify the main electrical equipment and working status information inside the user environment.

[0003] Generally, the energy meter works at a frequency of 50Hz, so it will collect 1 cycle of voltage and current raw data every 20ms, and then send the sampled data to the load identification module. The number of sampling points can be selected from 64, 128, and 256. However, the energy meter will receive the collected voltage and current raw data while sending it. Therefore, if the data is received before it can be sent, the first few bytes will be overwritten, and the cycle curve cannot be formed, so the power load situation cannot be analyzed. Summary of the invention

[0004] The purpose of the present invention is to provide a method for solving the problem that the first few bytes are covered during the sampling process of the load identification raw data, solve the problem that the first few bytes are covered, ensure the formation of a frequency curve, and facilitate the power load analysis.

[0005] The technical solution of the present invention:

[0006] A method for solving the problem that the first several bytes are overwritten during the sampling process of the load identification raw data includes the following specific steps:

[0007] S1. Open 256 points of global memory configuration interrupt and timer;

[0008] S2. Determine whether the sampled data enters a half-full interrupt. If it does, execute step S3; otherwise, execute step S5;

[0009] S3. Determine whether the sampling point is 64 points. If the sampling point is 64 points, save the first 5 points to the backup area. If the sampling point is not 64 points, execute step S4;

[0010] S4. Determine whether the sampling point is 128 points or 256 points. If the sampling point is 128 points or 256 points, start the timer for delayed transmission. If the sampling point is not 128 points or 256 points, end the task;

[0011] S5. Determine whether the sampled data enters a full interrupt. If it enters a full interrupt, execute step S6, otherwise end the task;

[0012] S6 determines whether the sampling point is 64 points. If the sampling point is 64 points, execute step S7. If the sampling point is not 64 points, the task ends;

[0013] S7. Copy the first 5 points and the remaining 59 points in step S3 to the backup area;

[0014] S8. Start DMA to send the original voltage and current data to the load acquisition module to complete data transmission.

[0015] The execution process of the timer in step S4 is:

[0016] Start the timer to determine whether the timing time has been reached;

[0017] If the timing time has not arrived, no operation will be performed. If the timing time has arrived, DMA will be started to send the original voltage and current data to the load acquisition module to complete the data transmission.

[0018] The timing time is: at most 10ms-the sending time of 5 points, to ensure that the data of the first 5 points have been sent when receiving again; at least 10ms-the total sending time + the sending time of 5 points, to ensure that there are still 5 points that have not been sent when receiving is completed.

[0019] Compared with the prior art, the beneficial effects of the present invention are: solving the problem of the first few bytes of the sampled data being overwritten, achieving complete sampling of the frequency curve, and thus achieving accurate power load analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a schematic diagram of an application scenario of the present invention.

[0021] Figure 2 It is a schematic flow chart of the method of the present invention.

[0022] Figure 3 This is the execution flow of the timer of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] See also Figure 1-Figure 3 , the present invention provides a technical solution:

[0025] An application scenario of the present invention is as follows Figure 1 As shown, the electric energy meter collects the original data of voltage and current, and sends them to the load identification module through the SPI interface, and solves the problem of the first few bytes of the original data being overwritten in the embedded software of the electric energy meter.

[0026] like Figure 2 As shown, a method for solving the problem that the first several bytes are overwritten during the sampling process of the load identification raw data includes the following specific steps:

[0027] S1. Open 256 points of global memory configuration interrupt and timer;

[0028] S2. Determine whether the sampled data enters a half-full interrupt. If it does, execute step S3; otherwise, execute step S5;

[0029] S3. Determine whether the sampling point is 64 points. If the sampling point is 64 points, save the first 5 points to the backup area. If the sampling point is not 64 points, execute step S4;

[0030] S4. Determine whether the sampling point is 128 points or 256 points. If the sampling point is 128 points or 256 points, start the timer for delayed transmission. If the sampling point is not 128 points or 256 points, end the task;

[0031] S5. Determine whether the sampled data enters a full interrupt. If it enters a full interrupt, execute step S6, otherwise end the task;

[0032] S6 determines whether the sampling point is 64 points. If the sampling point is 64 points, execute step S7. If the sampling point is not 64 points, the task ends;

[0033] S7. Copy the first 5 points and the remaining 59 points in step S3 to the backup area;

[0034] S8. Start DMA to send the original voltage and current data to the load acquisition module to complete data transmission.

[0035] like Figure 3 As shown, the execution process of the timer in step S4 is:

[0036] Start the timer to determine whether the timing time has been reached;

[0037] If the timing time has not arrived, no operation will be performed. If the timing time has arrived, DMA will be started to send the original voltage and current data to the load acquisition module to complete the data transmission.

[0038] The timing time is: at most 10ms-the sending time of 5 points, to ensure that the data of the first 5 points have been sent when receiving again; at least 10ms-the total sending time + the sending time of 5 points, to ensure that there are still 5 points that have not been sent when receiving is completed.

[0039] 1) For the original sampling data with 64 sampling points, when the received sampling original data enters the full or half full interrupt, the first 5 bytes are saved in the first 5 bytes of the backup area. After the full interrupt, the remaining original data are saved in the backup area after 5 bytes. The backup area starts from the 128th storage position of the 256-point memory opened, and the original data is sent from the backup area when sending.

[0040] 2) For the original sampling data with 128 sampling points, since there are frame headers and frame tails in the transmitted frame, the remaining space of the 256-point memory is not enough as a backup area. Therefore, the same processing is performed on the 128-point and 256-point original sampling data.

[0041] 3) The original sampling data with 256 sampling points is processed as follows: Since the DMA transmission speed is 2M, it takes about 6ms to send 128 points of original sampling data (128*6), and it takes about 6ms to send the entire 256 points of original sampling data (256*6). If it is sent during a full interrupt, it will cause an overwrite phenomenon. If it is sent during a half-full interrupt, the transmission will end before the reception is completed. Therefore, the method of delaying a certain time after the half-full interrupt and then sending is adopted to solve this problem. Delay rule: at most 10ms-5 points of transmission time, to ensure that the data of the first 5 points have been sent when receiving again; at least 10ms-total transmission time + 5 points of transmission time, to ensure that there are still 5 points that have not been sent when the reception is completed. This delay adopts a timer operation, and when the timer is reached, DMA is started to send the sampled voltage and current raw data to the load identification module.

[0042] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for solving the problem that the first few bytes are overwritten during the original data sampling process, characterized in that: The specific steps include: S1. Open 256 points of global memory configuration interrupt and timer; S2. Determine whether the sampled data enters a half-full interrupt. If it does, execute step S3; otherwise, execute step S5; S3. Determine whether the sampling point is 64 points. If the sampling point is 64 points, save the first 5 points to the backup area. If the sampling point is not 64 points, execute step S4; S4. Determine whether the sampling point is 128 points or 256 points. If the sampling point is 128 points or 256 points, start the timer for delayed transmission. If the sampling point is not 128 points or 256 points, end the task; S5. Determine whether the sampled data enters a full interrupt. If it enters a full interrupt, execute step S6, otherwise end the task; S6 determines whether the sampling point is 64 points. If the sampling point is 64 points, execute step S7. If the sampling point is not 64 points, the task ends; S7. Copy the first 5 points and the remaining 59 points in step S3 to the backup area; S8. Start DMA to send the voltage and current raw data to the load acquisition module to complete data transmission; The execution process of the timer in step S4 is: Start the timer to determine whether the timing time has been reached; If the timing time has not arrived, no operation will be performed. If the timing time has arrived, DMA will be started to send the original voltage and current data to the load acquisition module to complete the data transmission; The timing time is: at most 10ms-the sending time of 5 points, to ensure that the data of the first 5 points have been sent when receiving again; at least 10ms-the total sending time + the sending time of 5 points, to ensure that there are still 5 points that have not been sent when receiving is completed.

Citation Information

Patent Citations

  • Method for improving sampling effective value precision in alternating current signal

    CN101614764A

  • Non-invasive load recognition method and non-invasive load recognition system capable of resisting background load interference

    CN110991263A