CN116718832A - High-precision electric energy metering method and system for fully domestic devices - Google Patents

High-precision electric energy metering method and system for fully domestic devices Download PDF

Info

Publication number
CN116718832A
CN116718832A CN202310994458.2A CN202310994458A CN116718832A CN 116718832 A CN116718832 A CN 116718832A CN 202310994458 A CN202310994458 A CN 202310994458A CN 116718832 A CN116718832 A CN 116718832A
Authority
CN
China
Prior art keywords
current
voltage
electric energy
phase
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310994458.2A
Other languages
Chinese (zh)
Other versions
CN116718832B (en
Inventor
王永贵
李温静
刘迪
詹超
黄吕超
李云鹏
谭阿峰
邓思阳
韩学禹
高远
陈楷铭
张帅
林华宝
陈清雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Wangneng Technology Development Co ltd
State Grid Information and Telecommunication Co Ltd
Original Assignee
Fujian Wangneng Technology Development Co ltd
State Grid Information and Telecommunication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Wangneng Technology Development Co ltd, State Grid Information and Telecommunication Co Ltd filed Critical Fujian Wangneng Technology Development Co ltd
Priority to CN202310994458.2A priority Critical patent/CN116718832B/en
Publication of CN116718832A publication Critical patent/CN116718832A/en
Application granted granted Critical
Publication of CN116718832B publication Critical patent/CN116718832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R22/00Arrangements for measuring time integral of electric power or current, e.g. electricity meters
    • G01R22/06Arrangements for measuring time integral of electric power or current, e.g. electricity meters by electronic methods
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H17/00Networks using digital techniques
    • H03H17/02Frequency selective networks
    • H03H17/06Non-recursive filters
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/12Analogue/digital converters
    • H03M1/124Sampling or signal conditioning arrangements specially adapted for A/D converters
    • H03M1/1245Details of sampling arrangements or methods
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H17/00Networks using digital techniques
    • H03H2017/0072Theoretical filter design
    • H03H2017/0081Theoretical filter design of FIR filters

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Remote Monitoring And Control Of Power-Distribution Networks (AREA)
  • Supply And Distribution Of Alternating Current (AREA)

Abstract

The application provides a high-precision electric energy metering method and a system for a fully domestic device, which belong to the technical field of electric energy metering, collect current signals and voltage signals, and align phases of the current signals and the voltage signals through a phase shifting algorithm; and (5) respectively calculating A, B, C three-phase active power based on the metering device, then calculating the total active power of the combined phases, and finally calculating the electric energy through time integration. The application realizes the phase self-adaptive compensation of a wide current-voltage range based on the segmented self-adaptive current-voltage phase compensation model of the FIR filter. The application supports the development of the full-domestic high-precision electric energy meter and improves the electric energy metering precision.

Description

一种面向全国产化器件的高精度电能计量方法及系统A high-precision electric energy measurement method and system for nationally produced devices

技术领域Technical field

本发明属于电能计量技术领域,尤其涉及一种面向全国产化器件的高精度电能计量方法及系统。The invention belongs to the technical field of electric energy measurement, and in particular relates to a high-precision electric energy measurement method and system for nationally produced devices.

背景技术Background technique

现有技术中,电能量计量是通过电流电压传感器,得到电压电流波形数据,产生的瞬时电流、电压波形可用于计量参数计算。比如,电压电流有效值计算过程为,电流或电压模拟信号通过AD芯片,由采集控制器进行同步定时采样分析,通过对电流采样值进行平方、开方以及数字滤波等一系列运算可得到信号的平均值。同理,电压有效值测量也是相同流程。In the existing technology, electrical energy measurement is performed by obtaining voltage and current waveform data through current and voltage sensors, and the generated instantaneous current and voltage waveforms can be used for calculation of measurement parameters. For example, the calculation process of the effective value of voltage and current is that the current or voltage analog signal passes through the AD chip, and the acquisition controller performs synchronous timing sampling and analysis. The signal can be obtained by performing a series of operations such as square, square root and digital filtering on the current sampling value. average value. In the same way, the voltage effective value measurement is also the same process.

有功、无功功率的计算是基于各相的有功功率是通过对去直流分量后的电流、电压信号进行乘法、加法、数字滤波等一系列数字信号处理后得到。总有功功率通常用于计费目的,它包括基波和谐波的功率。无功功率计量算法与有功类似,只是电压信号采用移相90度之后的,移相方式采用Hilbert滤波器。The calculation of active and reactive power is based on the fact that the active power of each phase is obtained by performing a series of digital signal processing such as multiplication, addition, and digital filtering on the current and voltage signals after removing the DC component. Total active power is usually used for billing purposes and includes the power of the fundamental and harmonics. The reactive power measurement algorithm is similar to the active power, except that the voltage signal is phase-shifted by 90 degrees, and the phase-shifting method uses a Hilbert filter.

现有技术中对于电能量计算是通过实时累加器实现,通过对有功功率或无功功率进行实时累加获得。在电能表的计量设计中,通常采用以上基础方法进行分析计量。In the prior art, the calculation of electrical energy is implemented through a real-time accumulator, which is obtained by real-time accumulation of active power or reactive power. In the measurement design of electric energy meters, the above basic methods are usually used for analysis and measurement.

对于现有技术中,如申请号为202211088000.2公开了一种用于中低压交直流配电网的电能计量补偿算法及系统,该文件包括采样模块,用于获取线路直流电流以及直流电压,进行采样测量;处理模块,用于运用防脉冲干扰移动平均值法对采样数据进行优化,使采样误差减小;补偿模块,用于对处理模块传输的数据进行插值算法补偿和延时算法补偿;电能计量模块,用于通过补偿后的瞬时功率获得任意时刻的累积电能。可以看出该文件针对直流电能表电流范围宽且动态变化的特点,对电流电压通道进行相位补偿,实现电流电压同步采样,从而提高电能计量精度。但是该文件未考虑了相位的影响,还未涉及电流电压变化对国产化器件造成的幅值、相位等多因素的影响,导致电能计量精度低,无法满足计量要求。Regarding the existing technology, for example, application number 202211088000.2 discloses an electric energy measurement compensation algorithm and system for medium and low-voltage AC and DC distribution networks. This document includes a sampling module for obtaining line DC current and DC voltage for sampling. Measurement; the processing module is used to optimize the sampling data using the anti-pulse interference moving average method to reduce the sampling error; the compensation module is used to perform interpolation algorithm compensation and delay algorithm compensation on the data transmitted by the processing module; electric energy measurement Module used to obtain accumulated electric energy at any time through compensated instantaneous power. It can be seen that this document aims at the wide and dynamically changing current range of DC energy meters, and performs phase compensation on the current and voltage channels to achieve synchronous sampling of current and voltage, thereby improving the accuracy of energy measurement. However, this document does not consider the influence of phase, and does not cover the impact of current and voltage changes on localized devices such as amplitude and phase, resulting in low accuracy of electric energy measurement and failure to meet measurement requirements.

发明内容Contents of the invention

本发明提供的面向全国产化器件的高精度电能计量方法,方法不仅考虑了相位的影响,还考虑了电流电压变化对国产化器件造成的幅值、相位等多因素的影响,通过设计多维补偿模型,提升电能计量精度。The present invention provides a high-precision electric energy measurement method for nationally produced devices. The method not only considers the influence of phase, but also takes into account the influence of multiple factors such as amplitude and phase caused by changes in current and voltage on localized devices. By designing multi-dimensional compensation model to improve the accuracy of electric energy measurement.

方法包括:Methods include:

S1:采集电流信号和电压信号,通过移相算法对电流信号和电压信号的相位进行对齐;S1: Collect current signals and voltage signals, and align the phases of the current signals and voltage signals through a phase-shifting algorithm;

S2:基于计量装置分别计算A、B、C三相有功功率,再计算合相的总有功功率,最后通过对时间积分计算电能量。S2: Calculate the three-phase active power of A, B, and C respectively based on the metering device, then calculate the total active power of the combined phases, and finally calculate the electrical energy by integrating over time.

进一步需要说明的是,方法中,设分别表示电压和电流的瞬时值,则在分段式模拟信号采集中表示为/>,n和m表示将电压和电流模拟信号分段的数量;It should be further explained that in the method, it is assumed that represent the instantaneous values of voltage and current respectively, and are expressed as/> in segmented analog signal acquisition , n and m represent the number of segments for voltage and current analog signals;

有功功率通过单个周期内电流和电压的瞬时值乘积进行计算,其中,计算A相有功功率计算为:The active power is calculated by the product of the instantaneous values of current and voltage in a single cycle, where the active power of phase A is calculated as:

.

进一步需要说明的是,合相瞬时有功功率计算方式为:It should be further explained that the calculation method of the combined instantaneous active power is:

无功功率计算引入希尔伯特变换,使电流相位偏转90度,然后在与电压进行瞬时值乘积进行计算;The Hilbert transform is introduced into the reactive power calculation, which deflects the current phase by 90 degrees, and then multiplies the instantaneous value with the voltage for calculation;

A相有功电能量表示为:The active electric energy of phase A is expressed as:

.

进一步需要说明的是,步骤S2中还包括电流电压相位补偿方式,具体包括如下步骤:It should be further noted that step S2 also includes a current and voltage phase compensation method, which specifically includes the following steps:

通过FIR滤波器实现相位的移相,计算不同电流电压下对相位的影响,得到不同电压电流数值下相位差值,根据电流电压值实现自适应相位值的选择。The phase is shifted through the FIR filter, the impact on the phase under different current and voltage is calculated, the phase difference value under different voltage and current values is obtained, and the adaptive phase value selection is realized based on the current and voltage values.

进一步需要说明的是,FIR滤波器的形式如下:It should be further explained that the form of the FIR filter is as follows:

选择获取信号中电压从负数变为正数的点,设该点为,该点后一个采集点为/>,利用线性差值计算出电压信号精准的过零点,位置为,得到电压信号的过零点;Select the point where the voltage in the acquisition signal changes from negative to positive, and let this point be , the next collection point after this point is/> , use the linear difference to calculate the precise zero-crossing point of the voltage signal, the position is , get the zero-crossing point of the voltage signal;

同理,得到对应位置电流的过零点为,再获得电流和电压信号的差值,该差值为电压和电流信号补偿的目标时,利用FIR滤波器得到设计参数。In the same way, the zero-crossing point of the corresponding position current is obtained as , and then obtain the difference between the current and voltage signals. When the difference is the target of voltage and current signal compensation, the FIR filter is used to obtain the design parameters.

进一步需要说明的是,步骤S2中还包括电能计量补偿模型,电能计量补偿模型是基于电能计量算法,补偿芯片在不同电流、电压、功率因数、温度、湿度、频率因素变化下由于器件本身引起的电能计量误差;It should be further noted that step S2 also includes an electric energy metering compensation model. The electric energy metering compensation model is based on an electric energy metering algorithm. It compensates the chip itself for changes in current, voltage, power factor, temperature, humidity, and frequency factors caused by the device itself. Electric energy measurement error;

电能计量补偿模型对影响有功、无功功率计算的电流、电压、功率因数、频率、温度、湿度的变化范围进行界定,确定上下限值,并按照上下限选取n个点,按照电流的范围,选取电流输入点值为/>,覆盖电流上下限范围,选择预设数量的点个数。The electric energy measurement compensation model defines the range of changes in current, voltage, power factor, frequency, temperature, and humidity that affect the calculation of active and reactive power, determines the upper and lower limits, and selects n points according to the upper and lower limits, according to the range of the current , select the current input point value as/> , covering the upper and lower limits of the current, and selecting a preset number of points.

进一步需要说明的是,按照电流选择方式,将电能计量补偿模型输入值为电压和功率因数/>It should be further explained that according to the current selection method, the input value of the electric energy measurement compensation model is the voltage and power factor/> ;

基于电流变化,则得有功功率计算值为,Based on the current change, the calculated active power value is,

读取功率源对应的有功功率输出为,The active power output corresponding to the read power source is,

选择不同电流值下的A相有功功率值,组成数值对表示为,再利用三次样条多项式法,构建不同电流值影响下,A相功率的误差补偿模型。Select the active power value of phase A under different current values, and the value pair is expressed as , and then use the cubic spline polynomial method to construct the error compensation model of phase A power under the influence of different current values.

进一步需要说明的是,将电流变化下,A相有功功率值的计算值和理想值表示为,在每个区间构建三次样条多项式模型,如下:It should be further explained that the calculated value and ideal value of the A-phase active power value under the current change are expressed as , construct a cubic spline polynomial model in each interval, as follows:

n个区间对应的三次函数的数学表达式如下:Cubic function corresponding to n intervals The mathematical expression of is as follows:

其中/> Among them/> ;

求解各式中,构建多样条插值模型,得到如下方式:Solving various equations , construct a multi-spline interpolation model and obtain the following method:

(1)所有点满足插值条件,即,除了两个端点,其他点都满足,前后两个分段,则有2(n-1)个方程,在加上两个端点方程,则共有2n个方程;(1) All points satisfy the interpolation conditions, that is, , except for the two endpoints, all other points satisfy , there are 2(n-1) equations for the two segments before and after, and after adding the two endpoint equations, there are 2n equations in total;

(2)区间内的点均为一阶导数连续,则当前区间末端点和下一区间起点的一阶导数相等,即,则有n-1个方程;(2) The first-order derivatives of all points in the interval are continuous, then the first-order derivatives of the end point of the current interval and the starting point of the next interval are equal, that is , then there are n-1 equations;

(3)区间内点的二阶导数为连续,即,则有n-1个方程;(3) The second derivative of the points in the interval is continuous, that is , then there are n-1 equations;

以上共构建了4n-2个方程,求解的4n个参数:A total of 4n-2 equations have been constructed above. Solve 4n parameters:

假定第i个点的二阶导数为,即/>,且令/>,得到,,构建以m为未知量的方程组,由m得到,/>的求解表示为:Assume that the second derivative of the i-th point is , that is/> , and let/> ,get, , construct a system of equations with m as the unknown quantity, obtained from m,/> The solution of is expressed as:

最后添加两个边界条件,构建2个方程,从而求解出Finally, add two boundary conditions and construct two equations to solve .

进一步需要说明的是,方法还包括:It should be further noted that the methods also include:

(11)配置自由边界:边界端点二阶导数为0,,得到/>,则构建线性方程组为:(11) Configure the free boundary: the second derivative of the boundary endpoint is 0, , get/> , then the system of linear equations is constructed as:

(12)构建固定边界:指定端点一阶导数,分别定义为A和B,即,得到/>,/>,则构建线性方程组为:(12) Construct a fixed boundary: specify the first-order derivatives of the endpoints, defined as A and B respectively, that is , , get/> ,/> , then the system of linear equations is constructed as:

(13)构建非节点边界:第一个插值点的三阶导数值等于第二个点的三阶导数值,最后第一个点的三阶导数值等于倒数第二个点的三阶导数值,即,得,/>,则构建线性方程组为:(13) Construct a non-node boundary: the third-order derivative value of the first interpolation point is equal to the third-order derivative value of the second point, and finally the third-order derivative value of the first point is equal to the third-order derivative value of the penultimate point. ,Right now , , got,/> , then the system of linear equations is constructed as:

针对线性方程组求解出的值,通过高斯消元计算出/>,进而得到在区间的三次样条插值多项式:Solve for a system of linear equations The value of is calculated by Gaussian elimination/> , and then we get the range The cubic spline interpolation polynomial of :

.

本发明还提供一种面向全国产化器件的高精度电能计量系统,系统包括:电流采集处理模块、电压采集处理模块、电流电压相位补偿模块以及计量装置;The invention also provides a high-precision electric energy metering system for nationally produced devices. The system includes: a current acquisition and processing module, a voltage acquisition and processing module, a current and voltage phase compensation module and a metering device;

电流电压相位补偿模块通过与电流采集处理模块连接,实时采集电流信号,还通过与电压采集处理模块连接,实时采集电压信号,并通过FIR滤波器实现相位的移相,计算不同电流电压下对相位的影响,得到不同电压电流数值下相位差值,基于电压电流数值下相位差值进行分段补偿,根据区间内的某一点相位差值作为该区间内的补偿值,每次根据电流或电压大小确定分段区间,然后在选择对应区间的补偿值进行自适应选择补偿,进而实现对电压电流相位补偿;The current and voltage phase compensation module collects current signals in real time by connecting to the current acquisition and processing module. It also collects voltage signals in real time by connecting to the voltage acquisition and processing module, and realizes phase shifting through the FIR filter to calculate the phase pairs under different currents and voltages. The influence of the phase difference value under different voltage and current values is obtained. Based on the phase difference value under the voltage and current value, segmented compensation is performed. The phase difference value at a certain point in the interval is used as the compensation value in the interval. Each time is based on the current or voltage. Determine the segmented interval, and then select the compensation value in the corresponding interval to perform adaptive selection compensation, thereby achieving voltage and current phase compensation;

计量装置与电流电压相位补偿模块连接,获取电流电压相位补偿模块输出补偿后的电压电流数值,并分别计算A、B、C三相有功功率,再计算合相的总有功功率,最后通过对时间积分计算电能量。The metering device is connected to the current and voltage phase compensation module, obtains the compensated voltage and current values output by the current and voltage phase compensation module, and calculates the active power of the three phases A, B, and C respectively, then calculates the total active power of the combined phase, and finally calculates the time The integral calculates the electrical energy.

从以上技术方案可以看出,本发明具有以下优点:It can be seen from the above technical solutions that the present invention has the following advantages:

本发明提供的面向全国产化器件的高精度电能计量方法基于FIR滤波器的分段自适应电流电压相位补偿模型,实现宽电流电压范围的相位自适应补偿。还构建了基于多维三次样条插值的电能计量误差补偿模型,并引入LSTM模型对误差进行优化,提升电能计量精度,实现面向全国产化器件的高精度电能计量,提升了计量精度。The high-precision electric energy measurement method for nationally produced devices provided by the present invention is based on the segmented adaptive current and voltage phase compensation model of the FIR filter to achieve phase adaptive compensation in a wide current and voltage range. An electric energy measurement error compensation model based on multi-dimensional cubic spline interpolation was also constructed, and the LSTM model was introduced to optimize the error, improve the accuracy of electric energy measurement, realize high-precision electric energy measurement for nationally produced devices, and improve the measurement accuracy.

而且本发明提供的面向全国产化器件的高精度电能计量方法不仅考虑了相位的影响,还考虑了电流电压变化对国产化器件造成的幅值、相位等多因素的影响,通过设计多维补偿模型,提升电能计量精度。本发明还采用了轻量级人工智能技术,基于全国产化硬件分析电流、电压、功率因数等因素变化对电能计量精度的补偿,从而提升了计量精度。Moreover, the high-precision electric energy measurement method for nationally produced devices provided by the present invention not only considers the influence of phase, but also considers the impact of multiple factors such as amplitude and phase caused by changes in current and voltage on localized devices. By designing a multi-dimensional compensation model , improve the accuracy of electric energy measurement. The present invention also uses lightweight artificial intelligence technology to compensate for the changes in current, voltage, power factor and other factors based on nationally produced hardware, thus improving the measurement accuracy.

附图说明Description of the drawings

为了更清楚地说明本发明的技术方案,下面将对描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solution of the present invention more clearly, the drawings required for the description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, As far as workers are concerned, other drawings can also be obtained based on these drawings without exerting creative work.

图1为面向全国产化器件的高精度电能计量方法流程图;Figure 1 is a flow chart of a high-precision electric energy measurement method for nationally produced devices;

图2为有功、无功功率补偿模型示意图;Figure 2 is a schematic diagram of the active and reactive power compensation model;

图3为LSTM结构示意图;Figure 3 is a schematic diagram of the LSTM structure;

图4为电能计量误差模型计量示意图。Figure 4 is a measurement schematic diagram of the electric energy measurement error model.

具体实施方式Detailed ways

本发明提供的面向全国产化器件的高精度电能计量方法是针对国产核心元器件存在的性能不足、受环境量变化易发生漂移甚至性能大幅下降的问题,同时面向高比例新能源和电力电子设备接入电网引起的基频波动、电流范围变宽等特点,本发明构建了基于多维三次样条插值的电能计量误差补偿模型,并引入LSTM模型对误差进行优化,提升电能计量精度。The high-precision electric energy measurement method provided by the present invention for nationally produced devices is aimed at the problems of insufficient performance of domestic core components and prone to drift or even significant performance degradation due to changes in environmental quantities. It is also oriented towards high-proportion new energy and power electronic equipment. Due to the characteristics of fundamental frequency fluctuation and widening of current range caused by access to the power grid, the present invention constructs an electric energy measurement error compensation model based on multi-dimensional cubic spline interpolation, and introduces the LSTM model to optimize the error and improve the accuracy of electric energy measurement.

本发明的高精度电能计量方法可以基于人工智能技术对关联的数据进行获取和处理。其中,面向全国产化器件的高精度电能计量方法利用数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用装置。The high-precision electric energy measurement method of the present invention can acquire and process associated data based on artificial intelligence technology. Among them, the high-precision electric energy measurement method for nationally produced devices uses digital computer-controlled machines to simulate, extend and expand human intelligence, theories, methods, technologies and application devices to perceive the environment, acquire knowledge and use knowledge to obtain the best results.

本发明的面向全国产化器件的高精度电能计量方法中既有硬件层面的技术也有软件层面的技术。本发明可以包括如互感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。对于软件技术可以包括自然语言处理技术、机器学习/深度学习、人工神经网络、置信网络、强化学习、迁移学习、归纳学习、程序设计语言等技术。程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。The high-precision electric energy measurement method for nationally produced devices of the present invention includes both hardware-level technology and software-level technology. The present invention may include technologies such as transformers, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, mechatronics and other technologies. Software technologies can include natural language processing technology, machine learning/deep learning, artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, programming languages and other technologies. Programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages.

本发明提供的面向全国产化器件的高精度电能计量方法引入LSTM模型对误差进行优化技术,基于多段式模拟信号采集电路硬件设计,将宽电流、电压模拟信号范围划分为多段,并作为不同国产化AD芯片的输入信号,从而实现对宽电流、电压模拟信号的高精度采集,并基于多维因素耦合影响的多层LSTM功率补偿模型,从而提高有功、无功功率计算精度,进而提升电能计量准确度。The high-precision electric energy measurement method for nationally produced devices provided by the present invention introduces the LSTM model to optimize the error. Based on the multi-segment analog signal acquisition circuit hardware design, the wide current and voltage analog signal range is divided into multiple segments and used as different domestically produced The input signal of the AD chip is optimized to achieve high-precision collection of wide current and voltage analog signals, and a multi-layer LSTM power compensation model based on the coupling influence of multi-dimensional factors improves the accuracy of active and reactive power calculations, thereby improving the accuracy of electric energy measurement. Spend.

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.

请参阅图1至图4所示是一具体实施例中面向全国产化器件的高精度电能计量方法的流程图及模型示意图,方法包括:Please refer to Figures 1 to 4, which are flow charts and model diagrams of a high-precision electric energy measurement method for nationally produced devices in a specific embodiment. The method includes:

S1:采集电流信号和电压信号,通过移相算法对电流信号和电压信号的相位进行对齐;S1: Collect current signals and voltage signals, and align the phases of the current signals and voltage signals through a phase-shifting algorithm;

在一个示例性实施例中,基于多段式模拟信号采集电路硬件设计,将宽电流、电压模拟信号范围划分为多段,并作为不同国产化AD芯片的输入信号,从而实现对宽电流、电压模拟信号的高精度采集。在数据处理方面,通过处理器向不同国产化AD芯片同时输出采样信号,实现对不同AD芯片的同步采样,在采样接收后并将数据发送至处理器,再进行统一的数据处理。In an exemplary embodiment, based on the multi-segment analog signal acquisition circuit hardware design, the wide current and voltage analog signal range is divided into multiple segments and used as input signals of different domestic AD chips, thereby realizing the wide current and voltage analog signal range. high-precision collection. In terms of data processing, the processor outputs sampling signals to different domestic AD chips at the same time to achieve synchronous sampling of different AD chips. After receiving the samples, the data is sent to the processor for unified data processing.

本实施例中,定义分别表示电压和电流的瞬时值,则在分段式模拟信号采集中可以表示为/>,n和m表示将电压和电流模拟信号分段的数量。由于电路硬件感容性器件因素的影响,采样后电压信号与电流信号直接存在相位偏差,先通过移相算法实现电流和电压相位的对齐。In this example, define represent the instantaneous values of voltage and current respectively, which can be expressed as/> in segmented analog signal acquisition , n and m represent the number of segments for voltage and current analog signals. Due to the influence of circuit hardware inductive and capacitive device factors, there is a direct phase deviation between the voltage signal and the current signal after sampling. The phase alignment of the current and voltage is first achieved through a phase-shifting algorithm.

S2:基于计量装置分别计算A、B、C三相有功功率,再计算合相的总有功功率,最后通过对时间积分计算电能量。S2: Calculate the three-phase active power of A, B, and C respectively based on the metering device, then calculate the total active power of the combined phases, and finally calculate the electrical energy by integrating over time.

具体来讲,有功功率通过单个周期内电流和电压的瞬时值乘积进行计算,以A相有功功率计算为例,计算B相和C相与计算A相相同,下面以A相有功功率计算进行举例说明,其中A相有功功率可表示为:Specifically, the active power is calculated by the product of the instantaneous values of current and voltage in a single cycle. Taking the calculation of phase A active power as an example, calculating phase B and phase C is the same as calculating phase A. The following takes the calculation of phase A active power as an example. Explain that the active power of phase A can be expressed as:

合相瞬时有功功率可表示为:The combined instantaneous active power can be expressed as:

无功功率计算引入希尔伯特变换,首先使电流相位偏转90度,然后在与电压进行瞬时值乘积进行计算。The Hilbert transform is introduced into the reactive power calculation, which first deflects the current phase by 90 degrees, and then multiplies the instantaneous value with the voltage for calculation.

A相有功电能量表示为:The active electric energy of phase A is expressed as:

电能计量的精度与电能量的值直接相关,电能量由功率对时间的积分确定,因此A、B、C三相的有功功率精度直接有功电能量精度。The accuracy of electric energy measurement is directly related to the value of electric energy. The electric energy is determined by the integration of power over time. Therefore, the active power accuracy of the three phases A, B, and C is directly related to the active electric energy accuracy.

本实施例针对全国产化器件的电能计量装置,设计适用于全国产化器件的高精度电能补偿方法,通过在算法上的创新实现对硬件器件性能不足的补偿,从而实现高精度电能计量,使全国产化高精度电能计量装置达到国外产品或使用国外核心器件的高精度电能计量装置水平。In this embodiment, a high-precision electric energy compensation method is designed for the electric energy measurement device of the nationally produced devices. Through the innovation of the algorithm, the compensation for the insufficient performance of the hardware device is realized, thereby achieving high-precision electric energy measurement. Nationally produced high-precision electric energy metering devices have reached the level of foreign products or high-precision electric energy metering devices using foreign core devices.

针对电流、电压、功率因数、温度等因素对电能计量精度的影响,首先获取这些因素变化对有功、无功功率的影响情况,借助高精度功率源,得到理想的有功、无功功率,同时通过计算得到实际的有功、无功功率。利用实际有功、无功功率值和理想值,构建电能计量误差模型,其整个执行流程和关系如下图4所示。Aiming at the impact of current, voltage, power factor, temperature and other factors on the accuracy of electric energy measurement, first obtain the impact of changes in these factors on active and reactive power. With the help of high-precision power sources, the ideal active and reactive power can be obtained. At the same time, through Calculate the actual active and reactive power. The actual active and reactive power values and ideal values are used to construct an electric energy measurement error model. The entire execution process and relationship are shown in Figure 4 below.

根据本申请的实施例,本发明的计量过程分为两个阶段,一是电流电压相位补偿阶段,二是电能计量补偿模型构建阶段。According to the embodiment of the present application, the measurement process of the present invention is divided into two stages, one is the current and voltage phase compensation stage, and the other is the electric energy measurement compensation model construction stage.

(1)电流电压相位补偿阶段;(1) Current and voltage phase compensation stage;

通过FIR滤波器实现相位的移相,计算不同电流电压下对相位的影响,得到不同电压电流数值下相位差值,根据电流电压值实现自适应相位值的选择。The phase is shifted through the FIR filter, the impact on the phase under different current and voltage is calculated, the phase difference value under different voltage and current values is obtained, and the adaptive phase value selection is realized based on the current and voltage values.

FIR滤波器具有较快的时域响应,且具有较高的精度,长度为N的FIR滤波器输出对应于输入时间序列的关系由一种有限卷积和的形式给出,具体形式如下:The FIR filter has a faster time domain response and has higher accuracy. The FIR filter output of length N corresponds to the input time series. The relationship is given by a finite convolution sum, the specific form is as follows:

在N值的选择方面,以某一项电压电流信号为例,利用高精度功率源输入正弦且相位相同的电压和电流模拟信号,以高频采集电压电流转化信号,通常适用于高精度电能计量算法的采用频率在12kHz左右,在电压电流信号相位补偿过程中,采用15kHz采用频率,并将同步采集到的信号进行处理。选择获取信号中电压从负数变为正数的点,可以认为该点位电压信号的某一过零点,假设该点为,该点后一个采集点为/>,在可利用线性差值计算出电压信号精准的过零点,位置为/>,得到电压信号的精确过零点。In terms of the selection of the N value, taking a certain voltage and current signal as an example, a high-precision power source is used to input sinusoidal voltage and current analog signals with the same phase, and the voltage and current conversion signals are collected at high frequency. This is usually suitable for high-precision electric energy measurement. The algorithm's adoption frequency is around 12kHz. In the voltage and current signal phase compensation process, the 15kHz adoption frequency is used, and the synchronously collected signals are processed. Select the point where the voltage in the acquisition signal changes from negative to positive. This point can be considered to be a zero-crossing point of the voltage signal. Assume that this point is , the next collection point after this point is/> , when the linear difference can be used to calculate the precise zero-crossing point of the voltage signal, the position is/> , obtain the precise zero-crossing point of the voltage signal.

同理,得到对应位置电流的过零点为,因此,可获得电流和电压信号的差值。该差值为电压和电流信号需要补偿的目标时,利用FIR滤波器设计模块,得到FIR滤波器的设计参数。In the same way, the zero-crossing point of the corresponding position current is obtained as , therefore, the difference between the current and voltage signals can be obtained. When the difference is the target that needs to be compensated for the voltage and current signals, use the FIR filter design module to obtain the design parameters of the FIR filter.

本实施例中,由于不同电流和电压幅值,将对应不同的相位差值,且相位差值为非线性,不同值之间的差值较小,若针对每个电压和电流数值进行相位补偿,则相位补偿模型过于复杂,且对处理器提出了高要求,因此按照电流和电压分段的数值对相位差值进行分段补偿,根据区间内的某一点相位差值作为该区间内的补偿值,每次根据电流或电压大小确定分段区间,然后在选择对应区间的补偿值进行自适应选择补偿,进而实现对电压电流相位补偿。In this embodiment, since different current and voltage amplitudes will correspond to different phase difference values, and the phase difference value is nonlinear, the difference between different values is small. If phase compensation is performed for each voltage and current value , the phase compensation model is too complex and places high demands on the processor. Therefore, the phase difference is compensated segmentally according to the segmented values of the current and voltage, and the phase difference value at a certain point in the interval is used as the compensation within the interval. value, each time the segmented interval is determined according to the current or voltage, and then the compensation value of the corresponding interval is selected for adaptive selection compensation, thereby achieving voltage and current phase compensation.

(2)电能计量补偿模型;(2) Electric energy measurement compensation model;

本实施例自适应选择的FIR滤波器能够补偿电压电流相位差值,对电能计量补偿模型的精度提升起到一定作用,但同时也引入了幅值误差。电能计量补偿模型是基于电能计量算法,补偿国产化芯片在不同电流、电压、功率因数、温度、湿度、频率等因素变化下由于器件本身引起的电能计量误差。The adaptively selected FIR filter in this embodiment can compensate for the voltage and current phase difference, which plays a certain role in improving the accuracy of the electric energy measurement compensation model, but it also introduces amplitude errors. The electric energy measurement compensation model is based on the electric energy measurement algorithm and compensates the electric energy measurement error caused by the device itself when the domestic chip changes in different current, voltage, power factor, temperature, humidity, frequency and other factors.

首先对影响有功、无功功率计算的电流、电压、功率因数、频率、温度、湿度等多因素的变化范围进行界定,确定上下限值,并按照上下限选取n个点。First, the range of changes in current, voltage, power factor, frequency, temperature, humidity and other factors that affect the calculation of active and reactive power is defined, the upper and lower limits are determined, and n points are selected according to the upper and lower limits.

示例性的讲,按照电流的范围,选取电流输入点值为/>,覆盖电流上下限范围,为保证模型的精度可选择尽可能多的点个数。按照电流选择方式,分别选取其他因素输入点值为电压/>、功率因数/>等。For example, according to the range of current , select the current input point value as/> , covering the upper and lower limits of the current, and as many points as possible can be selected to ensure the accuracy of the model. According to the current selection method, select other factor input point values as voltage/> , power factor/> wait.

当模型样本获取时,由高精度功率源按照多维因数的选取点分别输入选定指,每次仅改变其中某一个值,并记录此时有功、无功功率在A、B、C每一项的计算值和功率源输出的实际值。When the model sample is obtained, the high-precision power source inputs the selected index according to the selection point of the multi-dimensional factor, and only changes one of the values each time, and records the active and reactive power in each of A, B, and C at this time. The calculated value and the actual value of the power source output.

以电流变化为例,则可得有功功率计算值为:Taking the current change as an example, the calculated value of the active power can be:

读取高精度功率源对应的有功功率输出为:Reading the active power output corresponding to the high-precision power source is:

选择不同电流值下的A相有功功率值,组成数值对可以表示为,接下来利用三次样条多项式法,构建不同电流值影响下,A相功率的误差补偿模型。Select the active power value of phase A under different current values, and the value pair can be expressed as , and then use the cubic spline polynomial method to construct the error compensation model of phase A power under the influence of different current values.

为方便计算,将电流变化下,A相有功功率值的计算值和理想值可表示为,在每个区间构建三次样条多项式模型,如下:In order to facilitate the calculation, the calculated value and ideal value of the A-phase active power value under the current change can be expressed as , construct a cubic spline polynomial model in each interval, as follows:

n个区间对应的三次函数的数学表达式如下:Cubic function corresponding to n intervals The mathematical expression of is as follows:

其中/> Among them/> .

求解各式中,构建多样条插值模型,可知:Solving various equations , to construct a multi-spline interpolation model, it can be seen that:

1)所有点必须满足插值条件,即,除了两个端点,其他点都满足,前后两个分段,则有2(n-1)个方程,在加上两个端点方程,则共有2n个方程。1) All points must satisfy the interpolation conditions, that is , except for the two endpoints, all other points satisfy , the two segments before and after, then there are 2(n-1) equations, and after adding the two endpoint equations, there are a total of 2n equations.

2)区间内的点均为一阶导数连续,则当前区间末端点和下一区间起点的一阶导数应该相等,即,则有n-1个方程。2) The points in the interval all have continuous first-order derivatives, then the first-order derivatives of the end point of the current interval and the starting point of the next interval should be equal, that is , then there are n-1 equations.

3)区间内点的二阶导数为连续,即,则有n-1个方程。3) The second derivative of the points in the interval is continuous, that is , then there are n-1 equations.

以上共构建了4n-2个方程,求解的4n个参数,还需两个方程。A total of 4n-2 equations have been constructed above. Solve With 4n parameters, two more equations are needed.

假定第i个点的二阶导数为,即/>,且令/>,通过推导可得,,构建了以m为未知量的方程组,由m可知,/>的求解可表示为:Assume that the second derivative of the i-th point is , that is/> , and let/> , it can be obtained through derivation, , a system of equations with m as the unknown quantity is constructed. It can be known from m, /> The solution of can be expressed as:

最后添加两个边界条件,构建2个方程,从而求解出Finally, add two boundary conditions and construct two equations to solve .

本发明的实施例还涉及自由边界的解析,其中,边界端点二阶导数为0,,可得/>,则构建线性方程组为:Embodiments of the present invention also relate to the analysis of free boundaries, where the second derivative of the boundary endpoint is 0, , available/> , then the system of linear equations is constructed as:

对于固定边界来讲:指定端点一阶导数,分别定义为A和B,即,/>,可得/>,/>,则构建线性方程组为:For fixed boundaries: specify the first-order derivatives of the endpoints, defined as A and B respectively, that is ,/> , available/> ,/> , then the system of linear equations is constructed as:

对于非节点边界来讲,第一个插值点的三阶导数值等于第二个点的三阶导数值,最后第一个点的三阶导数值等于倒数第二个点的三阶导数值,即,可得,/>,则构建线性方程组为:For non-node boundaries, the third-order derivative value of the first interpolation point is equal to the third-order derivative value of the second point, and finally the third-order derivative value of the first point is equal to the third-order derivative value of the penultimate point. Right now , , available,/> , then the system of linear equations is constructed as:

针对以上矩阵可以求解出的值,通过高斯消元等方法计算出对应的/>,进而得到在区间/>的三次样条插值多项式:For the above matrix, we can solve The value of is calculated by methods such as Gaussian elimination/> , and then get the interval/> The cubic spline interpolation polynomial of :

.

由上可知,构建了由电流变化的A相有功功率三次样条多项式模型。It can be seen from the above that a cubic spline polynomial model of phase A active power changed by current is constructed.

同理,分别构建电压、功率因数、频率、温度、湿度等因素变化对A、B、C三相有功、无功功率的三次样条多项式补偿模型,从而建立了多维因素影响的多维三次样条多项式有功、无功功率补偿模型。在实际应用过程中,通过判断电流、电压、功率因数、频率、温度等多维因素分别在哪个工作区间,从而选择对应的值,进而实现对有功、无功功率补偿,提升有功、无功功率计算精度。In the same way, a cubic spline polynomial compensation model for changes in voltage, power factor, frequency, temperature, humidity and other factors on the three-phase active and reactive power of A, B, and C was established, thereby establishing a multi-dimensional cubic spline affected by multi-dimensional factors. Polynomial active and reactive power compensation model. In the actual application process, by judging the working range of multi-dimensional factors such as current, voltage, power factor, frequency, temperature, etc., the corresponding value, thereby realizing the compensation of active and reactive power and improving the calculation accuracy of active and reactive power.

以上多维三次样条多项式补偿方法能够弥补多维因素变化对有功、无功功率计算精度的影响,但是有些因素之间会有耦合影响,在多维三次样条补偿模型中没有能体现出这部分偏差的补偿,且该部分用模型分析难度大,因此引入了多层长短期记忆(LSTM)模型,以经过多维三次样条插值模型的有功、无功功率以及电流、电压、功率因数、频率等因素为输入值,输出为有功、无功功率值。The above multidimensional cubic spline polynomial compensation method can compensate for the impact of changes in multidimensional factors on the calculation accuracy of active and reactive power. However, some factors will have coupling effects. This part of the deviation cannot be reflected in the multidimensional cubic spline compensation model. Compensation, and it is difficult to analyze this part with a model, so a multi-layer long short-term memory (LSTM) model is introduced, based on the active and reactive power, current, voltage, power factor, frequency and other factors that have been passed through the multi-dimensional cubic spline interpolation model. Input value, output is active and reactive power value.

本发明的实施例中,采用多维三次样条补偿模型+多层LSTM的方式,在多层LSTM模型构建过程中,将电流、电压、功率因数、频率、温度等多维因素以及经过多维三次样条补偿模型输出的有功、无功功率作为LSTM的输入向量,输出值为有功、无功功率,同时读取高精度功率源数据作为对比值,从而计算输出值和比对值之间的差值,以差值最小,计算多层LSTM模型参数,进而构建多层LSTM补偿模型。In the embodiment of the present invention, a multi-dimensional cubic spline compensation model + multi-layer LSTM is adopted. During the construction process of the multi-layer LSTM model, multi-dimensional factors such as current, voltage, power factor, frequency and temperature are combined with multi-dimensional cubic splines. The active and reactive power output by the compensation model are used as the input vector of LSTM. , the output value is active and reactive power, and the high-precision power source data is read at the same time as the comparison value, so as to calculate the difference between the output value and the comparison value, and use the smallest difference to calculate the multi-layer LSTM model parameters, and then construct Multi-layer LSTM compensation model.

LSTM是种特殊循环神经网络(Recurrent Neural Network, RNN),在RNN的基础上引入了“门控”的选择性机制,分别是遗忘门、输入门和输出门,如图3所示,从而有选择性地保留或删除信息,以能够较好地学习长期依赖关系。LSTM is a special recurrent neural network (Recurrent Neural Network, RNN). On the basis of RNN, a selective mechanism of "gating" is introduced, namely forgetting gate, input gate and output gate, as shown in Figure 3, thus having Selectively retain or delete information to better learn long-term dependencies.

对于多层LSTM补偿模型来讲,如下公式所述,For the multi-layer LSTM compensation model, as described in the following formula,

其中,为遗忘门输出信息,/>、/>为遗忘门的权重和偏置参数,/>为输入门的输出信息,/>、/>为输入门的权重和偏置参数,/>、/>为tanh层的权重和偏置函数,/>为细胞状态,/>是激活函数,输出范围是0-1,/>为输出门的输出信息,/>、/>为输出门的权重和偏置参数,/>表示前一个单元的输出,/>为本单元的输出,/>表示当前输入。in, Output information for the forget gate,/> ,/> are the weight and bias parameters of the forget gate,/> is the output information of the input gate,/> ,/> are the weight and bias parameters of the input gate,/> ,/> are the weight and bias functions of the tanh layer,/> is the cell state,/> is the activation function, the output range is 0-1,/> is the output information of the output gate,/> ,/> are the weight and bias parameters of the output gate,/> Represents the output of the previous unit, /> is the output of this unit,/> Indicates the current input.

以A相有功功率的多层LSTM模型为例,输入向量表示为:Taking the multi-layer LSTM model of phase A active power as an example, the input vector is expressed as:

,输出为/>,输出值与高精度功率源数据组成数字对,利用自适应矩估计优化(Adam)工具,通过逐一改变多维因素变化,记录输出值与功率源数值对,从而计算出多层LSTM模型的参数。 , the output is/> , the output value and the high-precision power source data form a digital pair , using the adaptive moment estimation optimization (Adam) tool to calculate the parameters of the multi-layer LSTM model by changing the multi-dimensional factor changes one by one and recording the pairs of output values and power source values.

可以看出,本发明以基于全国产化器件的高精度电能计量装置为基础,构建了基于多维三次样条插值的电能计量误差补偿模型,并引入LSTM模型对误差进行优化,提升电能计量精度,实现面向全国产化器件的高精度电能计量,提升了计量精度。It can be seen that the present invention is based on a high-precision electric energy metering device based on nationally produced devices, constructs an electric energy measurement error compensation model based on multi-dimensional cubic spline interpolation, and introduces the LSTM model to optimize the error and improve the accuracy of electric energy measurement. Realize high-precision electric energy measurement for nationally produced devices and improve measurement accuracy.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that the sequence number of each step in the above embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

以下是本公开实施例提供的面向全国产化器件的高精度电能计量系统的实施例,该系统与上述各实施例的面向全国产化器件的高精度电能计量方法属于同一个发明构思,在面向全国产化器件的高精度电能计量系统的实施例中未详尽描述的细节内容,可以参考上述面向全国产化器件的高精度电能计量方法的实施例。The following is an example of a high-precision electric energy measurement system for nationally produced devices provided by the embodiments of the present disclosure. This system and the high-precision electric energy measurement method for nationally produced devices in the above embodiments belong to the same inventive concept. For details that are not described in detail in the embodiments of the high-precision electric energy measurement system for nationally produced devices, please refer to the above embodiments of the high-precision electric energy measurement method for nationally produced devices.

系统包括:电流采集处理模块、电压采集处理模块、电流电压相位补偿模块以及计量装置;The system includes: current acquisition and processing module, voltage acquisition and processing module, current and voltage phase compensation module and metering device;

电流电压相位补偿模块通过与电流采集处理模块连接,实时采集电流信号,还通过与电压采集处理模块连接,实时采集电压信号,并通过FIR滤波器实现相位的移相,计算不同电流电压下对相位的影响,得到不同电压电流数值下相位差值,基于电压电流数值下相位差值进行分段补偿,根据区间内的某一点相位差值作为该区间内的补偿值,每次根据电流或电压大小确定分段区间,然后在选择对应区间的补偿值进行自适应选择补偿,进而实现对电压电流相位补偿;The current and voltage phase compensation module collects current signals in real time by connecting to the current acquisition and processing module. It also collects voltage signals in real time by connecting to the voltage acquisition and processing module, and realizes phase shifting through the FIR filter to calculate the phase pairs under different currents and voltages. The influence of the phase difference value under different voltage and current values is obtained. Based on the phase difference value under the voltage and current value, segmented compensation is performed. The phase difference value at a certain point in the interval is used as the compensation value in the interval. Each time is based on the current or voltage. Determine the segmented interval, and then select the compensation value in the corresponding interval to perform adaptive selection compensation, thereby achieving voltage and current phase compensation;

计量装置与电流电压相位补偿模块连接,获取电流电压相位补偿模块输出补偿后的电压电流数值,并分别计算A、B、C三相有功功率,再计算合相的总有功功率,最后通过对时间积分计算电能量。The metering device is connected to the current and voltage phase compensation module, obtains the compensated voltage and current values output by the current and voltage phase compensation module, and calculates the active power of the three phases A, B, and C respectively, then calculates the total active power of the combined phase, and finally calculates the time The integral calculates the electrical energy.

本公开实施例提供的面向全国产化器件的高精度电能计量系统针对全国产化器件精度不够、一致性不足等问题,设计了一种多维因素影响的高精度电能计量模型,模型结构简单,能够应用于普通MCU等硬件,提升电能计量精度。The high-precision electric energy measurement system for nationally produced devices provided by the embodiment of the present disclosure is designed to solve the problems of insufficient accuracy and lack of consistency of nationally produced devices. A high-precision electric energy measurement model affected by multi-dimensional factors is designed. The model structure is simple and can Applied to ordinary MCU and other hardware to improve the accuracy of energy measurement.

本发明提供的面向全国产化器件的高精度电能计量方法中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。The units and algorithm steps of each example described in the disclosed embodiments of the high-precision electric energy measurement method for nationally produced devices provided by the present invention can be implemented by electronic hardware, computer software, or a combination of both. In order to clearly explain The interchangeability of hardware and software. In the above description, the composition and steps of each example have been generally described according to functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of the present invention.

本发明提供的面向全国产化器件的高精度电能计量系统是结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。The high-precision electric energy metering system for nationally produced devices provided by the present invention is based on the units and algorithm steps of each example described in the embodiments disclosed in this article, and can be implemented with electronic hardware, computer software, or a combination of both. In order to To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of the present invention.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be practiced in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.一种面向全国产化器件的高精度电能计量方法,其特征在于,方法包括:1. A high-precision electric energy measurement method for nationally produced devices, characterized in that the method includes: S1:采集电流信号和电压信号,通过移相算法对电流信号和电压信号的相位进行对齐;S1: Collect current signals and voltage signals, and align the phases of the current signals and voltage signals through a phase-shifting algorithm; S2:基于计量装置分别计算A、B、C三相有功功率,再计算合相的总有功功率,最后通过对时间积分计算电能量。S2: Calculate the three-phase active power of A, B, and C respectively based on the metering device, then calculate the total active power of the combined phases, and finally calculate the electrical energy by integrating over time. 2.根据权利要求1所述的面向全国产化器件的高精度电能计量方法,其特征在于,2. The high-precision electric energy measurement method for nationally produced devices according to claim 1, characterized in that, 方法中,设分别表示电压和电流的瞬时值,则在分段式模拟信号采集中表示为,n和m表示将电压和电流模拟信号分段的数量;In the method, let represent the instantaneous values of voltage and current respectively, and are expressed as , n and m represent the number of segments for voltage and current analog signals; 有功功率通过单个周期内电流和电压的瞬时值乘积进行计算,其中,计算A相有功功率计算为:The active power is calculated by the product of the instantaneous values of current and voltage in a single cycle, where the active power of phase A is calculated as: . 3.根据权利要求1或2所述的面向全国产化器件的高精度电能计量方法,其特征在于,3. The high-precision electric energy measurement method for nationally produced devices according to claim 1 or 2, characterized in that, 合相瞬时有功功率计算方式为:The calculation method of the combined instantaneous active power is: 无功功率计算引入希尔伯特变换,使电流相位偏转90度,然后在与电压进行瞬时值乘积进行计算;The Hilbert transform is introduced into the reactive power calculation, which deflects the current phase by 90 degrees, and then multiplies the instantaneous value with the voltage for calculation; A相有功电能量表示为The active electric energy of phase A is expressed as . 4.根据权利要求1或2所述的面向全国产化器件的高精度电能计量方法,其特征在于,步骤S2中还包括电流电压相位补偿方式,具体包括如下步骤:4. The high-precision electric energy measurement method for nationally produced devices according to claim 1 or 2, characterized in that step S2 also includes a current and voltage phase compensation method, specifically including the following steps: 通过FIR滤波器实现相位的移相,计算不同电流电压下对相位的影响,得到不同电压电流数值下相位差值,根据电流电压值实现自适应相位值的选择。The phase is shifted through the FIR filter, the impact on the phase under different current and voltage is calculated, the phase difference value under different voltage and current values is obtained, and the adaptive phase value selection is realized based on the current and voltage values. 5.根据权利要求4所述的面向全国产化器件的高精度电能计量方法,其特征在于,5. The high-precision electric energy measurement method for nationally produced devices according to claim 4, characterized in that, FIR滤波器的形式如下:The form of the FIR filter is as follows: 选择获取信号中电压从负数变为正数的点,设该点为,该点后一个采集点为/>,利用线性差值计算出电压信号精准的过零点,位置为/>,得到电压信号的过零点;Select the point where the voltage in the acquisition signal changes from negative to positive, and let this point be , the next collection point after this point is/> , use the linear difference to calculate the precise zero-crossing point of the voltage signal, the position is/> , get the zero-crossing point of the voltage signal; 同理,得到对应位置电流的过零点为,再获得电流和电压信号的差值,该差值为电压和电流信号补偿的目标时,利用FIR滤波器得到设计参数。In the same way, the zero-crossing point of the corresponding position current is obtained as , and then obtain the difference between the current and voltage signals. When the difference is the target of voltage and current signal compensation, the FIR filter is used to obtain the design parameters. 6.根据权利要求1或2所述的面向全国产化器件的高精度电能计量方法,其特征在于,步骤S2中还包括电能计量补偿模型,电能计量补偿模型是基于电能计量算法,补偿芯片在不同电流、电压、功率因数、温度、湿度、频率因素变化下由于器件本身引起的电能计量误差;6. The high-precision electric energy measurement method for nationally produced devices according to claim 1 or 2, characterized in that step S2 also includes an electric energy measurement compensation model, the electric energy measurement compensation model is based on an electric energy measurement algorithm, and the compensation chip is in Electric energy measurement errors caused by the device itself under different current, voltage, power factor, temperature, humidity, and frequency factors; 电能计量补偿模型对影响有功、无功功率计算的电流、电压、功率因数、频率、温度、湿度的变化范围进行界定,确定上下限值,并按照上下限选取n个点,按照电流的范围,选取电流输入点值为/>,覆盖电流上下限范围,选择预设数量的点个数。The electric energy measurement compensation model defines the range of changes in current, voltage, power factor, frequency, temperature, and humidity that affect the calculation of active and reactive power, determines the upper and lower limits, and selects n points according to the upper and lower limits, according to the range of the current , select the current input point value as/> , covering the upper and lower limits of the current, and selecting a preset number of points. 7.根据权利要求6所述的面向全国产化器件的高精度电能计量方法,其特征在于,7. The high-precision electric energy measurement method for nationally produced devices according to claim 6, characterized in that, 按照电流选择方式,将电能计量补偿模型输入值为电压和功率因数According to the current selection method, the input value of the electric energy measurement compensation model is the voltage. and power factor ; 基于电流变化,则得有功功率计算值为,Based on the current change, the calculated active power value is, 读取功率源对应的有功功率输出为,The active power output corresponding to the read power source is, 选择不同电流值下的A相有功功率值,组成数值对表示为,再利用三次样条多项式法,构建不同电流值影响下,A相功率的误差补偿模型。Select the active power value of phase A under different current values, and the value pair is expressed as , and then use the cubic spline polynomial method to construct the error compensation model of phase A power under the influence of different current values. 8.根据权利要求7所述的面向全国产化器件的高精度电能计量方法,其特征在于,8. The high-precision electric energy measurement method for nationally produced devices according to claim 7, characterized in that, 将电流变化下,A相有功功率值的计算值和理想值表示为,在每个区间构建三次样条多项式模型,如下:Express the calculated value and ideal value of phase A active power value under the change of current as , construct a cubic spline polynomial model in each interval, as follows: n个区间对应的三次函数的数学表达式如下:Cubic function corresponding to n intervals The mathematical expression of is as follows: 其中in ; 求解各式中,构建多样条插值模型,得到如下方式:Solving various equations , construct a multi-spline interpolation model and obtain the following method: (1)所有点满足插值条件,即,除了两个端点,其他点都满足,前后两个分段,则有2(n-1)个方程,在加上两个端点方程,则共有2n个方程;(1) All points satisfy the interpolation conditions, that is, , except for the two endpoints, all other points satisfy , there are 2(n-1) equations for the two segments before and after, and after adding the two endpoint equations, there are 2n equations in total; (2)区间内的点均为一阶导数连续,则当前区间末端点和下一区间起点的一阶导数相等,即,则有n-1个方程;(2) The first-order derivatives of all points in the interval are continuous, then the first-order derivatives of the end point of the current interval and the starting point of the next interval are equal, that is , then there are n-1 equations; (3)区间内点的二阶导数为连续,即,则有n-1个方程;(3) The second derivative of the points in the interval is continuous, that is , then there are n-1 equations; 以上共构建了4n-2个方程,求解的4n个参数:A total of 4n-2 equations have been constructed above. Solve 4n parameters: 假定第i个点的二阶导数为,即/>,且令/>,得到,,构建以m为未知量的方程组,由m得到,/>的求解表示为:Assume that the second derivative of the i-th point is , that is/> , and let/> ,get, , construct a system of equations with m as the unknown quantity, obtained from m,/> The solution of is expressed as: 最后添加两个边界条件,构建2个方程,从而求解出Finally, add two boundary conditions and construct two equations to solve . 9.根据权利要求8所述的面向全国产化器件的高精度电能计量方法,其特征在于,9. The high-precision electric energy measurement method for nationally produced devices according to claim 8, characterized in that, 方法还包括:Methods also include: (11)配置自由边界:边界端点二阶导数为0,,得到/>,则构建线性方程组为:(11) Configure the free boundary: the second derivative of the boundary endpoint is 0, , get/> , then the system of linear equations is constructed as: (12)构建固定边界:指定端点一阶导数,分别定义为A和B,即,/>,得到/>,/>,则构建线性方程组为:(12) Construct a fixed boundary: specify the first-order derivatives of the endpoints, defined as A and B respectively, that is ,/> , get/> ,/> , then the system of linear equations is constructed as: (13)构建非节点边界:第一个插值点的三阶导数值等于第二个点的三阶导数值,最后第一个点的三阶导数值等于倒数第二个点的三阶导数值,即,得,/>,则构建线性方程组为:(13) Construct a non-node boundary: the third-order derivative value of the first interpolation point is equal to the third-order derivative value of the second point, and finally the third-order derivative value of the first point is equal to the third-order derivative value of the penultimate point. ,Right now , , got,/> , then the system of linear equations is constructed as: 针对线性方程组求解出的值,通过高斯消元计算出/>,进而得到在区间的三次样条插值多项式:Solve for a system of linear equations The value of is calculated by Gaussian elimination/> , and then we get the range The cubic spline interpolation polynomial of : . 10.一种面向全国产化器件的高精度电能计量系统,其特征在于,系统采用如权利要求1至9任意一项所述的面向全国产化器件的高精度电能计量方法;10. A high-precision electric energy measurement system for nationally produced devices, characterized in that the system adopts the high-precision electric energy measurement method for nationally produced devices as described in any one of claims 1 to 9; 系统包括:电流采集处理模块、电压采集处理模块、电流电压相位补偿模块以及计量装置;The system includes: current acquisition and processing module, voltage acquisition and processing module, current and voltage phase compensation module and metering device; 电流电压相位补偿模块通过与电流采集处理模块连接,实时采集电流信号,还通过与电压采集处理模块连接,实时采集电压信号,并通过FIR滤波器实现相位的移相,计算不同电流电压下对相位的影响,得到不同电压电流数值下相位差值,基于电压电流数值下相位差值进行分段补偿,根据区间内的某一点相位差值作为该区间内的补偿值,每次根据电流或电压大小确定分段区间,然后在选择对应区间的补偿值进行自适应选择补偿,进而实现对电压电流相位补偿;The current and voltage phase compensation module collects current signals in real time by connecting to the current acquisition and processing module. It also collects voltage signals in real time by connecting to the voltage acquisition and processing module, and realizes phase shifting through the FIR filter to calculate the phase pairs under different currents and voltages. The influence of the phase difference value under different voltage and current values is obtained. Based on the phase difference value under the voltage and current value, segmented compensation is performed. The phase difference value at a certain point in the interval is used as the compensation value in the interval. Each time is based on the current or voltage. Determine the segmented interval, and then select the compensation value in the corresponding interval to perform adaptive selection compensation, thereby achieving voltage and current phase compensation; 计量装置与电流电压相位补偿模块连接,获取电流电压相位补偿模块输出补偿后的电压电流数值,并分别计算A、B、C三相有功功率,再计算合相的总有功功率,最后通过对时间积分计算电能量。The metering device is connected to the current and voltage phase compensation module, obtains the compensated voltage and current values output by the current and voltage phase compensation module, and calculates the active power of the three phases A, B, and C respectively, then calculates the total active power of the combined phase, and finally calculates the time The integral calculates the electrical energy.
CN202310994458.2A 2023-08-09 2023-08-09 A high-precision electric energy measurement method and system Active CN116718832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310994458.2A CN116718832B (en) 2023-08-09 2023-08-09 A high-precision electric energy measurement method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310994458.2A CN116718832B (en) 2023-08-09 2023-08-09 A high-precision electric energy measurement method and system

Publications (2)

Publication Number Publication Date
CN116718832A true CN116718832A (en) 2023-09-08
CN116718832B CN116718832B (en) 2023-11-07

Family

ID=87870072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310994458.2A Active CN116718832B (en) 2023-08-09 2023-08-09 A high-precision electric energy measurement method and system

Country Status (1)

Country Link
CN (1) CN116718832B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118393216A (en) * 2024-05-06 2024-07-26 国网宁夏电力有限公司电力科学研究院 Transformer core and clamp piece ground current monitoring device with reversed phase full compensation

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS636611A (en) * 1986-06-27 1988-01-12 Fuji Electric Co Ltd Control device for reactive power compensation
US20110241655A1 (en) * 2010-04-02 2011-10-06 Korea Electric Power Corporation Bidirectional 3 phase power meter for compensating reverse load flow and method for metering thereby
CN104914304A (en) * 2015-06-25 2015-09-16 烟台东方威思顿电气股份有限公司 Electric energy accurate measurement method and electric energy accurate measurement device under fluctuating load
CN113484603A (en) * 2021-07-26 2021-10-08 国网信息通信产业集团有限公司 Electric energy metering system and method
CN114966194A (en) * 2022-04-11 2022-08-30 国网浙江省电力有限公司营销服务中心 ADC-based low-frequency metering three-phase electric energy meter
CN115436700A (en) * 2022-09-07 2022-12-06 太原市优特奥科电子科技有限公司 An electric energy metering compensation algorithm and system for medium and low voltage AC and DC distribution networks
CN115639400A (en) * 2022-07-27 2023-01-24 电子科技大学 High-precision alternating current electric energy metering method
CN116466134A (en) * 2022-12-14 2023-07-21 国网湖南省电力有限公司 A harmonic measurement method, medium, system and harmonic electric energy meter

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS636611A (en) * 1986-06-27 1988-01-12 Fuji Electric Co Ltd Control device for reactive power compensation
US20110241655A1 (en) * 2010-04-02 2011-10-06 Korea Electric Power Corporation Bidirectional 3 phase power meter for compensating reverse load flow and method for metering thereby
CN104914304A (en) * 2015-06-25 2015-09-16 烟台东方威思顿电气股份有限公司 Electric energy accurate measurement method and electric energy accurate measurement device under fluctuating load
CN113484603A (en) * 2021-07-26 2021-10-08 国网信息通信产业集团有限公司 Electric energy metering system and method
CN114966194A (en) * 2022-04-11 2022-08-30 国网浙江省电力有限公司营销服务中心 ADC-based low-frequency metering three-phase electric energy meter
CN115639400A (en) * 2022-07-27 2023-01-24 电子科技大学 High-precision alternating current electric energy metering method
CN115436700A (en) * 2022-09-07 2022-12-06 太原市优特奥科电子科技有限公司 An electric energy metering compensation algorithm and system for medium and low voltage AC and DC distribution networks
CN116466134A (en) * 2022-12-14 2023-07-21 国网湖南省电力有限公司 A harmonic measurement method, medium, system and harmonic electric energy meter

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118393216A (en) * 2024-05-06 2024-07-26 国网宁夏电力有限公司电力科学研究院 Transformer core and clamp piece ground current monitoring device with reversed phase full compensation
CN118393216B (en) * 2024-05-06 2025-07-01 国网宁夏电力有限公司电力科学研究院 Transformer core and clamp piece ground current monitoring device with reversed phase full compensation

Also Published As

Publication number Publication date
CN116718832B (en) 2023-11-07

Similar Documents

Publication Publication Date Title
CN103257271B (en) A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method
CN101915874B (en) Harmonic wave detection method based on Fourier transformation
CN105071677B (en) Current predictive control method for two-level three-phase grid-connected inverter
CN203287435U (en) A micro electrical network harmonic wave and inter-harmonic wave test apparatus based on an STM32F107VCT6
CN101149425A (en) An automatic system for debugging and calibrating electronic energy meters
CN105224811B (en) PMU dynamic data processing method based on feedback iterative frequency tracking
CN103941088A (en) Method for quickly measuring frequency of electric power system based on three-phase signals
CN107478896A (en) A kind of frequency adaptive harmonic current detection method based on cascade Generalized Integrator
CN106226723A (en) A kind of electric energy metrical sunykatuib analysis system and method towards complex nonlinear load environment
CN106610450A (en) Single-phase electric energy metering chip
CN111130123A (en) Self-adaptive control method of parallel active power filter
CN116718832B (en) A high-precision electric energy measurement method and system
CN102495250A (en) Quasi-synchronous wideband reactive energy meter based on Hilbert algorithm and sampling method thereof
CN104426548A (en) A/D (Analog/Digital) conversion sampling circuit and metering chip
CN105048508B (en) A kind of control method and system of T-shaped tri-level single phase combining inverter
CN115236392A (en) Electric energy metering method, device, terminal and storage medium with multiple characteristic quantities
CN102928660A (en) Reactive power measurement method based on finite impulse response (FIR) digital filter
CN105259409A (en) Power signal frequency calculating method based on zero-crossing time-domain characteristic
CN108132399B (en) A Simplified Interpolation Method for Improving the Accuracy of Power Quality Analysis in Digital Substation
CN205157646U (en) Electric energy metering circuit based on voltage controlled oscillator
CN106777695A (en) A kind of current loop digitizing solution based on DSP
CN105322818A (en) Control method of three-phase PWM (pulse width modulation) rectification based on novel model prediction control
CN110069984A (en) One-variable linear regression frequency measuring method, electronic equipment and storage medium
CN117147962A (en) Multi-ADC self-adaptive high-accuracy electric energy metering method and system
CN105137183A (en) Analysis method and analysis system of harmonious waves in power systems

Legal Events

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