Electric meter direct current even harmonic compensation method and device and electronic equipment
By setting a compensation function in the meter and compensating according to the second harmonic content of the current data, the problem of reducing the meter meter meter meter under the influence of DC even harmonics is solved, and the compensation accuracy and accuracy are improved.
Patent Information
- Application Number
- CN202510290107.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-05-13
AI Technical Summary
Under the influence of DC even harmonics, the transformer output signal will produce a phase offset, affecting the measurement accuracy, and the existing compensation scheme suddenly changes the error value near the boundary of the current interval, resulting in a decrease in compensation accuracy.
By obtaining current data for frequency domain analysis, the second harmonic content is calculated. If the preset threshold value is exceeded, the second harmonic content is input into the set compensation function, the compensation value is obtained and the harmonic compensation operation is performed.
The compensation accuracy is improved, the deviation of the compensation value is reduced, the accuracy of the compensation effect is enhanced, and the high accuracy of the meter meter is ensured.
Smart Images

Figure CN119986521A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric meter harmonic compensation, and in particular to an electric meter direct current even harmonic compensation method, device, electronic equipment and storage medium. Background Art
[0002] DC even harmonics are usually caused by nonlinear loads in the power system. These loads cause the current waveform to be distorted, generating DC components and even harmonic components. In the electric energy meter, the transformer is a key component for current sampling. When the current waveform contains DC even harmonics, the characteristics of the transformer will change, resulting in phase deviation. Because the transformer of the meter cannot pass DC, under the influence of DC even harmonics, the output signal of the transformer will produce phase deviation, which will affect the measurement accuracy of the electric energy meter, so the electric energy meter needs to be compensated for errors.
[0003] The existing compensation scheme adopts the segmented customization method for compensation. First, the current value is divided into several intervals according to the current range of the electric energy meter. For example, the current value can be divided into intervals such as 0-1A, 1-30A, and above 30A. For each current interval, the error value in the interval is determined through experiments or calibration. In actual measurement, the corresponding error value is selected for compensation according to the interval to which the current current value belongs. For example, if the current current value is 15A, then the error value in the 1-30A interval is selected for compensation. However, near the boundary of the current interval, the error value suddenly changes, resulting in a decrease in the compensation accuracy, which in turn causes deviations in the actual compensation value, affecting the accuracy of the compensation effect. Summary of the invention
[0004] To solve the problems existing in the prior art, one or more embodiments of this specification describe a method, device, electronic device and storage medium for compensating DC even-order harmonics of an electric meter.
[0005] According to a first aspect, a method for compensating even-order harmonics of a direct current (DC) electric meter is provided, the method comprising: Acquire current data obtained through sampling operation, perform frequency domain analysis based on the current data to obtain second harmonic content, and compare the second harmonic content with a preset compensation threshold to obtain harmonic compensation judgment, wherein the harmonic compensation judgment includes performing harmonic compensation and not performing harmonic compensation; A compensation function is set, and when the second harmonic content exceeds the preset compensation threshold, the second harmonic content is input into the compensation function to obtain a compensation value, and a harmonic compensation operation is performed based on the compensation value.
[0006] Preferably, the acquiring of current data obtained through sampling operation includes: The sampling times and the sampling interval are set, and the current data is obtained by performing current sampling at equal intervals based on the sampling times and the sampling interval.
[0007] Preferably, the frequency domain analysis based on the current data to obtain the second harmonic content includes: performing Fourier transform based on the current data to obtain a frequency domain representation, traversing the frequency domain representation to obtain the amplitude corresponding to the second harmonic and the amplitude corresponding to the fundamental wave, and obtaining the second harmonic content based on the amplitude corresponding to the second harmonic and the amplitude corresponding to the fundamental wave.
[0008] Preferably, the setting of the compensation function comprises: obtaining a change value of the second harmonic content before and after the harmonic compensation operation, and fitting the compensation function based on the change value of the second harmonic content and the compensation value.
[0009] Preferably, the setting of the compensation function further includes: setting a parameter iteration condition and a compensation accuracy condition, and when the compensation function satisfies the parameter iteration condition and the compensation accuracy condition, writing the compensation function into an external storage module of the electric meter.
[0010] Preferably, the method also includes: establishing a compensation function table, wherein the compensation function table represents the mapping relationship between each type of meter in the power supply system and each compensation function, and when a new meter is connected to the power supply system, the compensation function table is traversed to obtain the compensation function of the new meter.
[0011] Preferably, the compensation accuracy condition includes: fixing the parameters of the compensation function, performing multiple meter harmonic compensation operations, and if the second harmonic content of the meter after the harmonic compensation operation is less than the compensation threshold, the compensation accuracy condition is met.
[0012] According to a second aspect, a DC even harmonic compensation device for an electric meter is provided, the device comprising: A harmonic content judgment module, used for obtaining current data obtained through sampling operation, performing frequency domain analysis based on the current data to obtain second harmonic content, and obtaining harmonic compensation judgment based on comparison between the second harmonic content and a preset compensation threshold, wherein the harmonic compensation judgment includes performing harmonic compensation and not performing harmonic compensation; The harmonic compensation module is used to set a compensation function. When the second harmonic content exceeds the preset compensation threshold, the second harmonic content is input into the compensation function to obtain a compensation value, and a harmonic compensation operation is performed based on the compensation value.
[0013] According to a third aspect, there is provided an electronic device, comprising a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the method provided in the first aspect or any possible implementation manner of the first aspect.
[0014] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the computer-readable storage medium stores instructions, which, when the instructions are executed on a computer or a processor, cause the computer or the processor to execute the method provided in the first aspect or any possible implementation of the first aspect.
[0015] The beneficial effects of the present invention are: 1. The method and device provided in the embodiments of this specification set a compensation function so that each second harmonic content exceeding the compensation threshold corresponds to a compensation value, and the second harmonic content is calculated from the collected current data. Therefore, different current values correspond to different compensation values, thereby improving the compensation accuracy, reducing the deviation of the compensation value, and improving the accuracy of the compensation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a flowchart of a method for compensating even harmonics of a DC power meter in the specific implementation of this specification; Figure 2 It is a structural diagram of a DC even harmonic compensation device for an electric meter in the specific implementation of this specification; Figure 3 It is a structural schematic diagram of an electronic device in the specific implementation of this specification; DETAILED DESCRIPTION
[0018] 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.
[0019] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, although the embodiment may not be clearly recorded in the following text.
[0020] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.
[0021] See also Figure 1 , Figure 1 1 is a flow chart of a method for compensating even harmonics of a DC power meter provided in an embodiment of the present application. In an embodiment of the present application, the method includes: S101. Acquire current data obtained through sampling operation, perform frequency domain analysis based on the current data to obtain second harmonic content, and obtain harmonic compensation judgment based on comparing the second harmonic content with a preset compensation threshold, wherein the harmonic compensation judgment includes performing harmonic compensation and not performing harmonic compensation.
[0022] The execution subject of this application may be a control chip of an electric meter. Specifically, the control chip model may be G80F924.
[0023] In the embodiment of this specification, the control chip first performs the sampling task and samples the current data of the electric meter. After the sampling is completed, the sampling completion flag is immediately set. After the sampling completion flag is set, the algorithm is called to perform frequency domain analysis on the current data to obtain the second harmonic content. The control chip will first obtain the preset compensation threshold, and compare the second harmonic content with the compensation threshold to obtain a harmonic compensation judgment. The harmonic compensation judgment includes two results: harmonic compensation and no harmonic compensation. When the second harmonic content exceeds the preset compensation threshold, the harmonic compensation flag is immediately set to perform harmonic compensation; when the second harmonic content does not exceed the preset compensation threshold, the sampling completion flag is closed and subsequent sampling tasks are performed.
[0024] In one possible implementation manner, acquiring the current data obtained through the sampling operation includes: The sampling times and the sampling interval are set, and the current data is obtained by performing current sampling at equal intervals based on the sampling times and the sampling interval.
[0025] In the embodiment of this specification, before executing the sampling task, the sampling number and sampling interval are set first, and then the control chip samples according to the sampling number and sampling interval, and then obtains multiple sets of current data for harmonic compensation judgment. By obtaining multiple sets of current data for harmonic compensation judgment, errors in harmonic compensation judgment can be avoided and the accuracy of harmonic compensation can be improved. As an example, the sampling number is set to 16 and the sampling interval is 312US, and the control chip samples and obtains 16 sets of different current data.
[0026] In one possible implementation, the performing frequency domain analysis based on the current data to obtain the second harmonic content includes: performing Fourier transform based on the current data to obtain a frequency domain representation, traversing the frequency domain representation to obtain the amplitude corresponding to the second harmonic and the amplitude corresponding to the fundamental wave, and obtaining the second harmonic content based on the amplitude corresponding to the second harmonic and the amplitude corresponding to the fundamental wave.
[0027] In the embodiment of the present specification, 16 sets of current data are stored in an array, and fast Fourier transform is performed on the 16 sets of current data to obtain a frequency domain representation represented by a complex array, and the amplitude of each frequency point in the complex array (i.e., the modulus of each complex number) is calculated, and all amplitudes are traversed to find the position of the maximum amplitude corresponding to the fundamental frequency (i.e., the index number in the complex array), and the index number corresponding to the fundamental frequency is multiplied by 2 to obtain the index number corresponding to the second harmonic, and the amplitude of the Fourier transform result at the index number corresponding to the second harmonic divided by the amplitude of the Fourier transform result at the index number corresponding to the fundamental is the second harmonic content.
[0028] S102, setting a compensation function, when the second harmonic content exceeds the preset compensation threshold, inputting the second harmonic content into the compensation function to obtain a compensation value, and performing a harmonic compensation operation based on the compensation value.
[0029] In the embodiment of the present specification, when the second harmonic content exceeds the preset compensation threshold, the harmonic compensation flag is immediately set, the control chip outputs the second harmonic content to the compensation function stored in the control chip to calculate the compensation value, and the control chip converts the compensation value into an electrical signal and sends it to the metering module, thereby completing the harmonic compensation operation. After the harmonic compensation operation is completed, the sampling completion flag and the harmonic compensation flag are turned off, and subsequent sampling tasks are performed. In the present application, by setting the compensation function, each second harmonic content exceeding the compensation threshold corresponds to a compensation value, and the second harmonic content is calculated from the collected current data, so different current values correspond to different compensation values, which improves the compensation accuracy, reduces the deviation of the compensation value, and improves the accuracy of the compensation effect.
[0030] In one possible implementation, the setting of the compensation function includes: obtaining a change value of the second harmonic content before and after the harmonic compensation operation, and fitting the compensation function based on the change value of the second harmonic content and the compensation value.
[0031] In the embodiments of the present specification, after each harmonic compensation operation, the control chip will immediately perform a sampling to calculate the second harmonic content after the compensation operation, and perform a difference operation with the second harmonic content before compensation to obtain the change value of the second harmonic content, and then associate the change value of the second harmonic content with the compensation value, and then use the least squares method to fit to obtain the compensation function.
[0032] In one possible implementation, the setting of the compensation function further includes: setting a parameter iteration condition and a compensation accuracy condition, and when the compensation function satisfies the parameter iteration condition and the compensation accuracy condition, writing the compensation function into an external storage module of the electric meter.
[0033] In the embodiment of the present specification, the parameter iteration condition and the compensation accuracy condition are set. When the compensation function satisfies the parameter iteration condition and the compensation accuracy condition, the compensation function is written into the external storage module of the electric meter, so as to facilitate the internal program call of the electric meter. At the same time, the parameter iteration condition and the compensation accuracy condition are set to avoid overfitting of the compensation function. Among them, the parameter iteration condition is: after each parameter update of the compensation function, the variation range of each parameter of the compensation function is calculated, and the parameter update threshold is set. If the variation range of each parameter in the compensation function is less than the parameter update threshold, it means that the compensation function satisfies the parameter iteration condition. The compensation accuracy condition is: keep the parameters of the compensation function unchanged, perform multiple electric meter harmonic compensation operations, and if the measured second harmonic content of the electric meter after the harmonic compensation operation is less than the compensation threshold, it means that the compensation function meets the compensation accuracy condition.
[0034] In one possible implementation, the method further includes: establishing a compensation function table, wherein the compensation function table represents a mapping relationship between various types of electric meters in the power supply system and various compensation functions; when a new electric meter is connected to the power supply system, the compensation function table is traversed to obtain the compensation function of the new electric meter.
[0035] In the embodiment of the present specification, when the compensation function of the electric meter is determined, a mapping relationship between the electric meter model and the compensation function is established, and a compensation function table is established. The compensation function table represents the mapping relationship between each type of electric meter in the power supply system and each compensation function. When a new electric meter is connected to the power supply system, the compensation function table is traversed to obtain the compensation function. By setting the compensation function table, a compensation function suitable for the new electric meter can be quickly found when the new electric meter is connected, thereby shortening the time required for fitting the compensation function of the new electric meter and improving the harmonic compensation efficiency of the entire power supply system.
[0036] The following will be combined with the attached Figure 2 , the DC even harmonic compensation device for an electric meter provided in the embodiment of the present application is introduced in detail. It should be noted that the attached Figure 2 The DC even harmonic compensation device of the electric meter shown is used to implement the present application Figure 1 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 The embodiment shown.
[0037] See also Figure 2 , Figure 2 Schematic diagram of the structure of the DC even harmonic compensation device for an electric meter provided in an embodiment of the present application. Figure 2 As shown, the device comprises: A harmonic content judgment module 201 is used to obtain current data obtained through sampling operation, perform frequency domain analysis based on the current data to obtain second harmonic content, and compare the second harmonic content with a preset compensation threshold to obtain harmonic compensation judgment, wherein the harmonic compensation judgment includes performing harmonic compensation and not performing harmonic compensation; The harmonic compensation module 202 is used to set a compensation function. When the second harmonic content exceeds the preset compensation threshold, the second harmonic content is input into the compensation function to obtain a compensation value, and a harmonic compensation operation is performed based on the compensation value.
[0038] In one possible implementation, the harmonic content determination module 201 is specifically used for: The sampling times and the sampling interval are set, and the current data is obtained by performing current sampling at equal intervals based on the sampling times and the sampling interval.
[0039] In one possible implementation, the harmonic content determination module 201 is specifically used for: A frequency domain representation is obtained by performing Fourier transform on the current data, an amplitude corresponding to the second harmonic and an amplitude corresponding to the fundamental wave are obtained by traversing the frequency domain representation, and the second harmonic content is obtained based on the amplitude corresponding to the second harmonic and the amplitude corresponding to the fundamental wave.
[0040] In one possible implementation, the harmonic compensation module 202 is specifically used for: The change value of the second harmonic content before and after the harmonic compensation operation is obtained, and the compensation function is fitted based on the change value of the second harmonic content and the compensation value.
[0041] In one possible implementation, the harmonic compensation module 202 is specifically used for: A parameter iteration condition and a compensation accuracy condition are set, and when the compensation function satisfies the parameter iteration condition and the compensation accuracy condition, the compensation function is written into an external storage module of the electric meter.
[0042] In one possible implementation, the harmonic compensation module 202 is specifically used for: A compensation function table is established, wherein the compensation function table represents the mapping relationship between each type of meter in the power supply system and each compensation function. When a new meter is connected to the power supply system, the compensation function table is traversed to obtain the compensation function of the new meter.
[0043] In one possible implementation, the harmonic compensation module 202 is specifically used for: The parameters of the compensation function are fixed, and the harmonic compensation operation of the electric meter is performed multiple times. If the second harmonic content of the electric meter after the harmonic compensation operation is less than the compensation threshold, the compensation accuracy condition is met.
[0044] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0045] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
[0046] See also Figure 3 , which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement Figure 1 The method in the embodiment shown. Figure 3As shown, the electronic device 300 may include: at least one central processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0047] The communication bus 302 is used to realize the connection and communication between these components.
[0048] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0049] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0050] Among them, the central processing unit 301 may include one or more processing cores. The central processing unit 301 uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the terminal 300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the central processing unit 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The central processing unit 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics central processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the central processing unit 301, but implemented separately through a chip.
[0051] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally be at least one storage device located away from the aforementioned central processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.
[0052] exist Figure 3 In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the central processor 301 can be used to call the application stored in the memory 305 and specifically perform the following operations: S101, acquiring current data obtained through sampling operation, performing frequency domain analysis based on the current data to obtain second harmonic content, and obtaining harmonic compensation judgment based on comparing the second harmonic content with a preset compensation threshold, wherein the harmonic compensation judgment includes performing harmonic compensation and not performing harmonic compensation; S102, setting a compensation function, when the second harmonic content exceeds the preset compensation threshold, inputting the second harmonic content into the compensation function to obtain a compensation value, and performing a harmonic compensation operation based on the compensation value.
[0053] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0054] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0055] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0056] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which 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 integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0057] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, 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 solution of this embodiment.
[0058] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0059] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0060] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct related hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0061] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for compensating even harmonics of direct current in an electric meter, characterized in that: The method comprises: Acquire current data obtained through sampling operation, perform frequency domain analysis based on the current data to obtain second harmonic content, and compare the second harmonic content with a preset compensation threshold to obtain harmonic compensation judgment, wherein the harmonic compensation judgment includes performing harmonic compensation and not performing harmonic compensation; A compensation function is set, and when the second harmonic content exceeds the preset compensation threshold, the second harmonic content is input into the compensation function to obtain a compensation value, and a harmonic compensation operation is performed based on the compensation value.
2. A method for compensating even harmonics of direct current in an electric meter according to claim 1, characterized in that: The acquiring of current data obtained through sampling operation comprises: The sampling times and the sampling interval are set, and the current data is obtained by performing current sampling at equal intervals based on the sampling times and the sampling interval.
3. A method for compensating even harmonics of direct current in an electric meter according to claim 1, characterized in that: The performing frequency domain analysis based on the current data to obtain the second harmonic content includes: performing Fourier transform based on the current data to obtain a frequency domain representation, traversing the frequency domain representation to obtain the amplitude corresponding to the second harmonic and the amplitude corresponding to the fundamental wave, and obtaining the second harmonic content based on the amplitude corresponding to the second harmonic and the amplitude corresponding to the fundamental wave.
4. A method for compensating even harmonics of direct current in an electric meter according to claim 1, characterized in that: The setting of the compensation function includes: obtaining a change value of the second harmonic content before and after the harmonic compensation operation, and fitting the compensation function based on the change value of the second harmonic content and the compensation value.
5. A method for compensating even harmonics of direct current in an electric meter according to claim 4, characterized in that: The setting of the compensation function further includes: setting a parameter iteration condition and a compensation accuracy condition, and when the compensation function satisfies the parameter iteration condition and the compensation accuracy condition, writing the compensation function into an external storage module of the electric meter.
6. A method for compensating even harmonics of direct current in an electric meter according to claim 4, characterized in that: The method also includes: establishing a compensation function table, which represents the mapping relationship between various types of meters in the power supply system and various compensation functions. When a new meter is connected to the power supply system, the compensation function table is traversed to obtain the compensation function of the new meter.
7. A method for compensating even harmonics of direct current in an electric meter according to claim 5, characterized in that: The compensation accuracy condition includes: fixing the parameters of the compensation function, performing multiple meter harmonic compensation operations, and if the second harmonic content of the meter after the harmonic compensation operation is less than the compensation threshold, the compensation accuracy condition is met.
8. A DC even harmonic compensation device for an electric meter, characterized in that: The device comprises: A harmonic content judgment module, used for obtaining current data obtained through sampling operation, performing frequency domain analysis based on the current data to obtain second harmonic content, and obtaining harmonic compensation judgment based on comparison between the second harmonic content and a preset compensation threshold, wherein the harmonic compensation judgment includes performing harmonic compensation and not performing harmonic compensation; The harmonic compensation module is used to set a compensation function. When the second harmonic content exceeds the preset compensation threshold, the second harmonic content is input into the compensation function to obtain a compensation value, and a harmonic compensation operation is performed based on the compensation value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer-readable storage medium has instructions stored therein, and when the instructions are executed on a computer or a processor, the computer or the processor executes the steps of the method according to any one of claims 1 to 7.