CN105717476B - The method of testing and system of a kind of digital electric energy meter - Google Patents
The method of testing and system of a kind of digital electric energy meter Download PDFInfo
- Publication number
- CN105717476B CN105717476B CN201610058952.8A CN201610058952A CN105717476B CN 105717476 B CN105717476 B CN 105717476B CN 201610058952 A CN201610058952 A CN 201610058952A CN 105717476 B CN105717476 B CN 105717476B
- Authority
- CN
- China
- Prior art keywords
- data message
- random
- frame
- continuous
- original data
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R35/00—Testing or calibrating of apparatus covered by the other groups of this subclass
- G01R35/04—Testing or calibrating of apparatus covered by the other groups of this subclass of instruments for measuring time integral of power or current
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例公开了一种数字式电能表的测试方法及系统,通过标准元测试数据生成原始数据报文及标准计量结果;预设总帧数和变化帧数;根据网络异常类型为连续异常或者随机异常,将原始数据报文转换为连续测试数据报文或随机测试数据报文,待测数字式电能表根据上述测试数据报文生成待测计量结果,通过与标准计量结果的比对,完成数字式电能表的测试。在上述测试过程中,能够对数字式电能表的网络环境进行模拟,通过定量精确控制报文的时间特性,改变延时、控制丢帧、控制堵塞、改变品质字,对数字式电能表的性能进行更加全面和准确地测试;而且通过分析不同网络异常情况对数字式电能表性能的影响,能够定量分析研究数字式电能表的处理机制。
The embodiment of the present invention discloses a testing method and system for a digital electric energy meter. Original data messages and standard measurement results are generated through standard element test data; the total number of frames and the number of changed frames are preset; and the network abnormality type is continuous abnormality Or random abnormality, convert the original data message into a continuous test data message or a random test data message, the digital energy meter to be tested generates the measurement result to be tested according to the above test data message, and compares it with the standard measurement result, Complete the test of the digital energy meter. In the above test process, the network environment of the digital energy meter can be simulated, and the performance of the digital energy meter can be greatly improved by quantitatively and accurately controlling the time characteristics of the message, changing the delay, controlling frame loss, controlling congestion, and changing the quality word. Conduct a more comprehensive and accurate test; and by analyzing the impact of different network abnormalities on the performance of the digital energy meter, it is possible to quantitatively analyze and study the processing mechanism of the digital energy meter.
Description
技术领域technical field
本发明涉及电力设备测试技术领域,特别是涉及一种数字式电能表的测试方法及系统。The invention relates to the technical field of electric equipment testing, in particular to a testing method and system for a digital electric energy meter.
背景技术Background technique
随着智能变电站大量投入运行,数字式电能表得到了广泛应用。虽然,理论上数字式电能表优点突出,能有效提高变电站测量系统的准确性,减少电能计量系统的综合误差。With a large number of smart substations put into operation, digital energy meters have been widely used. Although, in theory, the digital energy meter has outstanding advantages, which can effectively improve the accuracy of the substation measurement system and reduce the comprehensive error of the electric energy measurement system.
但多年的运行经验表明数字式电能表也存在诸多不足,例如数字式电能表的准确性依赖于网络传输状况的稳定,网络传输的抖动很容易造成数字式电能表的性能下降。因此,需要针对数字式电能表的异常情况下计量可信度开展全面深入的研究和检测,研究分析在异常情况下数字式电能表的处理机制、错误比率与计量误差的对应关系、评估数字式电能表的计量可靠度与可信度,而如何测试网络异常情况下数字电能表的稳定度以及可靠度是本领域技术人员亟需解决的技术问题。However, many years of operating experience have shown that digital energy meters also have many shortcomings. For example, the accuracy of digital energy meters depends on the stability of network transmission conditions, and the jitter of network transmission can easily cause performance degradation of digital energy meters. Therefore, it is necessary to carry out comprehensive and in-depth research and testing on the measurement reliability of digital electric energy meters under abnormal conditions, to study and analyze the processing mechanism of digital electric energy meters under abnormal conditions, the corresponding relationship between error ratio and measurement error, and to evaluate digital energy meters. The measurement reliability and credibility of the electric energy meter, and how to test the stability and reliability of the digital electric energy meter under abnormal network conditions are technical problems that need to be solved urgently by those skilled in the art.
发明内容Contents of the invention
本发明实施例中提供了一种数字式电能表的测试方法及系统,以解决现有技术中的数字式电能表难以进行稳定度和可靠度测试的问题。Embodiments of the present invention provide a testing method and system for a digital electric energy meter to solve the problem that it is difficult to test the stability and reliability of the digital electric energy meter in the prior art.
为了解决上述技术问题,本发明实施例公开了如下技术方案:In order to solve the above technical problems, the embodiment of the present invention discloses the following technical solutions:
本发明实施例公开了一种数字式电能表的测试方法,该测试方法包括以下步骤:The embodiment of the present invention discloses a test method for a digital electric energy meter, the test method includes the following steps:
根据标准源测试数据生成由原始数据报文帧组成的原始数据报文,以及标准计量结果;Generate raw data packets composed of raw data packet frames and standard measurement results based on standard source test data;
预设总帧数和变化帧数;Preset the total number of frames and the number of changed frames;
确定网络异常类型,所述网络异常类型包括连续异常和随机异常;Determining the network anomaly type, the network anomaly type including continuous anomaly and random anomaly;
如果所述网络异常类型为连续异常,根据所述总帧数和变化帧数,将原始数据报文转换为连续测试数据报文;如果所述网络异常为随机异常,根据所述总帧数和变化帧数,将原始数据报文转换为随机测试数据报文;If the network abnormality type is a continuous abnormality, convert the original data message into a continuous test data message according to the total number of frames and the number of changed frames; if the network abnormality is a random abnormality, according to the total number of frames and the number of changed frames Change the number of frames to convert the original data message into a random test data message;
将所述连续测试数据报文或所述随机测试数据报文发送至待测数字式电能表,生成待测计量结果;比对所述待测计量结果以及标准计量结果,完成测试。Sending the continuous test data message or the random test data message to the digital electric energy meter to be tested to generate a measurement result to be tested; comparing the measurement result to be tested with the standard measurement result to complete the test.
优选地,所述将原始数据报文转换为连续测试数据报文,包括:Preferably, said converting the original data message into a continuous test data message includes:
生成[0,总帧数-变化帧数-1]区间内的丢帧随机数;Generate a random number of dropped frames in the interval [0, total frame number - change frame number - 1];
判断当前原始数据报文帧的发送序号是否处于[丢帧随机数,丢帧随机数+变化帧数)的区间内;Judging whether the sending sequence number of the current original data message frame is in the interval of [random number of dropped frame, random number of dropped frame + number of changed frames);
如果是,舍弃当前原始数据报文帧,并生成丢帧连续测试数据报文作为所述连续测试数据报文。If so, discard the current original data message frame, and generate a frame-loss continuous test data message as the continuous test data message.
优选地,所述将原始数据报文转换为连续测试数据报文,包括:Preferably, said converting the original data message into a continuous test data message includes:
预设连续离散值;Preset continuous discrete values;
生成[0,总帧数-变化帧数-1]区间内的连续离散随机数;Generate continuous discrete random numbers in the interval [0, total frame number - change frame number - 1];
判断当前原始数据报文帧的发送序号是否处于[连续离散随机数,连续离散随机数+变化帧数)区间内;Judging whether the sending sequence number of the current original data message frame is in the range of [continuous discrete random number, continuous discrete random number+change frame number);
如果是,判断所述连续离散随机数是否为奇数;如果所述连续离散随机数为奇数,取所述连续离散值对应的连续负离散值;如果所述连续离散随机数为偶数,取所述连续离散值对应的连续正离散值;If yes, judge whether the continuous discrete random number is an odd number; if the continuous discrete random number is an odd number, take the continuous negative discrete value corresponding to the continuous discrete value; if the continuous discrete random number is an even number, take the Continuous positive discrete values corresponding to continuous discrete values;
根据所述连续负离散值或所述连续正离散值,计算获得当前原始数据报文帧对应的连续延时;Calculate and obtain the continuous delay corresponding to the current original data message frame according to the continuous negative discrete value or the continuous positive discrete value;
根据所述连续延时生成离散连续测试数据报文作为所述连续测试数据报文。generating discrete continuous test data packets as the continuous test data packets according to the continuous delay.
优选地,所述将原始数据报文转换为连续测试数据报文,包括:Preferably, said converting the original data message into a continuous test data message includes:
预设连续粘帧数;Preset the number of continuous sticky frames;
预设原始数据报文帧对应的连续间隔帧数;Preset the number of continuous interval frames corresponding to the original data message frame;
生成[0,总帧数-变化帧数*连续粘帧数-1]区间内的阻塞随机数;Generate blocking random numbers in the interval [0, total number of frames - number of changing frames * number of consecutive sticky frames - 1];
判断当前原始数据报文帧的发送序号是否处于[阻塞随机数-变化帧数*连续粘帧数,阻塞随机数]区间内;Judging whether the sending sequence number of the current original data message frame is in the interval of [blocking random number - changing frame number * continuous sticky frame number, blocking random number];
如果是,判断当前原始数据报文帧的发送序号和阻塞随机数差值对连续粘帧数的余数是否为0;如果所述余数为0,则设置当前原始数据报文帧对应的连续间隔帧数为连续粘帧数,否则,设置所述连续间隔帧数为0;If yes, judge whether the remainder of the sending sequence number of the current original data message frame and the blocking random number difference to the number of consecutive sticky frames is 0; if the remainder is 0, then set the corresponding continuous interval frames of the current original data message frame The number is the number of consecutive sticky frames, otherwise, set the number of consecutive interval frames to 0;
根据当前发送序号之前的连续间隔帧数之和,计算阻塞连续测试数据报文序号,并根据所述阻塞连续测试数据报文序号生成阻塞连续测试数据报文作为所述连续测试数据报文。Calculate the sequence number of the blocking continuous test data message according to the sum of the consecutive interval frames before the current sending sequence number, and generate a blocking continuous test data message as the continuous test data message according to the sequence number of the blocking continuous test data message.
优选地,所述将原始数据报文转换为连续测试数据报文,包括:Preferably, said converting the original data message into a continuous test data message includes:
生成[0,总帧数-变化帧数-1]区间内的连续品质随机数;Generate continuous quality random numbers in the interval [0, total number of frames - change number of frames - 1];
判断当前原始数据报文帧的发送序号是否处于[连续品质随机数,连续品质随机数+变化帧数]区间内;Judging whether the sending sequence number of the current original data message frame is in the interval of [continuous quality random number, continuous quality random number + change frame number];
如果是,将当前原始数据报文帧内的原始数据值替换为异常值,生成品质连续测试数据报文作为所述连续测试数据报文。If so, replace the original data value in the current original data message frame with an abnormal value, and generate a quality continuous test data message as the continuous test data message.
优选地,所述将原始数据报文转换为随机测试数据报文,包括:Preferably, said converting the original data message into a random test data message includes:
预设原始数据报文帧对应的发送舍弃标识;Preset the send abandonment flag corresponding to the original data message frame;
判断变化帧数是否小于总帧数/2;Determine whether the number of changed frames is less than the total number of frames/2;
如果是,将所有的所述发送舍弃标识设置为1;生成由变化帧数个随机数组成的第一丢帧随机数列,所述第一丢帧随机数列中的随机数为[0,总帧数-1]区间内的自然数;将所述第一丢帧随机数列对应的原始数据报文帧的发送舍弃标识设置为0;判断当前原始数据报文帧的发送舍弃标识是否为0,如果是,舍弃当前原始数据报文帧,如果否,保留当前原始数据报文帧,生成第一丢帧随机测试数据报文作为所述随机测试数据报文;If so, set all the sending discarding flags to 1; generate the first frame loss random number sequence composed of random numbers of changing frame numbers, the random number in the first frame loss random number sequence is [0, total frame Number-1] a natural number in the interval; the sending and discarding sign of the original data message frame corresponding to the first frame loss random number sequence is set to 0; judge whether the sending and discarding sign of the current original data message frame is 0, if it is , discarding the current original data message frame, if not, retaining the current original data message frame, and generating the first frame-losing random test data message as the random test data message;
如果否,将所有的所述发送舍弃标识设置为0;生成由总帧数-变化帧数个随机数组成的第二丢帧随机数列,所述第二丢帧随机数列中的随机数为[0,总帧数-1]区间内的自然数;将所述第二丢帧随机数列对应的原始数据报文帧的发送舍弃标识设置为1;判断当前原始数据报文帧的发送舍弃标识是否为1,如果是,保留当前原始数据报文帧,如果否,舍弃当前原始数据报文帧,生成第二丢帧随机测试数据报文作为所述随机测试数据报文。If not, set all the sending abandonment flags to 0; generate a second frame loss random number sequence consisting of the total frame number-change frame number random numbers, and the random number in the second frame loss random number sequence is [ 0, the natural number in the interval of the total number of frames-1]; the sending and discarding identification of the original data message frame corresponding to the second frame loss random number sequence is set to 1; whether the sending and discarding identification of the current original data message frame is judged to be 1. If yes, keep the current original data packet frame, if not, discard the current original data packet frame, and generate a second frame-losing random test data packet as the random test data packet.
优选地,所述将原始数据报文转换为随机测试数据报文,包括:Preferably, said converting the original data message into a random test data message includes:
预设随机离散值;Preset random discrete value;
判断当前原始数据报文帧对应的发送舍弃标识是否为1;Judging whether the sending abandonment flag corresponding to the current original data message frame is 1;
如果是,判断当前原始数据报文帧对应的发送序号是否为奇数;如果是,取所述随机离散值对应的随机负离散值;如果否,取所述随机离散值对应的随机正离散值;If yes, judge whether the sending sequence number corresponding to the current original data message frame is an odd number; if yes, get the random negative discrete value corresponding to the random discrete value; if not, get the random positive discrete value corresponding to the random discrete value;
根据所述随机负离散值或所述随机正离散值,计算获得当前原始数据报文帧对应的随机延时;Calculate and obtain a random delay corresponding to the current original data message frame according to the random negative discrete value or the random positive discrete value;
根据所述随机延时生成离散随机测试数据报文作为所述随机测试数据报文。Generate a discrete random test data packet as the random test data packet according to the random delay.
优选地,所述将原始数据报文转换为随机测试数据报文,包括:Preferably, said converting the original data message into a random test data message includes:
预设随机粘帧数;Preset the number of random sticky frames;
生成多个随机数组成的阻塞随机数列,所述阻塞随机数列中随机数个数在[1,变化帧数]区间内,所述阻塞随机数列中的随机数的取值范围为[0,总帧数-随机数个数*随机粘帧数-1]区间内;Generate a blocked random number sequence composed of a plurality of random numbers, the number of random numbers in the blocked random number sequence is in the interval [1, change frame number], and the value range of the random number in the blocked random number sequence is [0, total Frame number - number of random numbers * number of random sticky frames - 1] interval;
判断当前原始数据报文帧的发送序号是否处于[阻塞随机数列中随机数,阻塞随机数列中随机数+随机粘帧数]区间内;Judging whether the sending sequence number of the current original data message frame is in the range of [random number in the blocked random number sequence, random number in the blocked random number sequence + random sticky frame number];
如果是,判断当前原始数据报文帧的发送序号是否等于阻塞随机数列中的随机数;如果等于,则设置当前原始数据报文帧对应的随机间隔帧数为随机粘帧数,否则,设置所述随机间隔帧数为0;If so, judge whether the sending sequence number of the current original data message frame is equal to the random number in the blocking random number sequence; The random interval frame number is 0;
根据当前发送序号之前的随机间隔帧数之和,计算阻塞随机测试数据报文序号,并根据所述阻塞随机测试数据报文序号生成阻塞随机测试数据报文作为所述随机测试数据报文。Calculate the sequence number of the blocked random test data message according to the sum of the random interval frames before the current sending sequence number, and generate a blocked random test data message as the random test data message according to the sequence number of the blocked random test data message.
优选地,所述将原始数据报文转换为随机测试数据报文,包括:Preferably, said converting the original data message into a random test data message includes:
生成[0,总帧数-1]区间内的与变化帧数对应的随机数并组成品质随机数列;Generate random numbers corresponding to the number of changed frames in the interval [0, total number of frames - 1] and form a quality random number sequence;
判断当前原始数据报文的发送序号是否等于所述品质随机数列中的随机数;Judging whether the sending sequence number of the current original data message is equal to the random number in the quality random number sequence;
如果是,将当前原始数据报文的原始数据值替换为异常值,生成品质随机测试数据报文作为所述随机测试数据报文。If so, replace the original data value of the current original data message with an abnormal value, and generate a quality random test data message as the random test data message.
本发明实施例还提供了一种数字式电能表的测试系统,包括标准源输入装置、数字电能表校验仪、报文控制器、高精度模拟表、规约转换器和上位机,其中:The embodiment of the present invention also provides a test system for a digital electric energy meter, including a standard source input device, a digital electric energy meter calibrator, a message controller, a high-precision analog meter, a protocol converter and a host computer, wherein:
所述标准源输入装置包括标准源二次侧模拟量三相电压源和标准源二次侧模拟量三相电流源;所述标准源二次侧模拟量三相电压源的输出端与所述数字电能表校验仪的输入端和所述高精度模拟表的输入端均电连接;所述标准源二次侧模拟量三相电流源的输出端与所述数字电能表校验仪的输入端和所述高端精度模拟表的输入端均电连接;The standard source input device includes a standard source secondary side analog three-phase voltage source and a standard source secondary side analog three-phase current source; the output terminal of the standard source secondary side analog three-phase voltage source is connected to the The input end of the digital energy meter calibrator is electrically connected to the input end of the high-precision analog meter; the output end of the secondary side analog three-phase current source of the standard source is connected to the input of the digital energy meter calibrator terminal and the input terminal of the high-end precision analog meter are all electrically connected;
所述数字电能表校验仪的输出端与报文控制器的输入端相连接,所述报文控制器的输出端与待测数字电能表的输入端相连接,所述待测数字电能表的输出端与上位机相连接;所述数字电能表校验仪,用于根据标准源测试数据生成由原始数据报文帧组成的原始数据报文;所述报文控制器用于如果网络异常类型为连续异常,根据预设的总帧数和变化帧数,将原始数据报文转换为连续测试数据报文;如果网络异常为随机异常,根据所述总帧数和变化帧数,将原始数据报文转换为随机测试数据报文;将所述连续测试数据报文或所述随机测试数据报文发送至待测数字式电能表;所述待测数字电能表生成待测计量结果,并将所述待测计量结果发送至上位机;The output end of the digital watt-hour meter calibrator is connected to the input end of the message controller, and the output end of the message controller is connected to the input end of the digital watt-hour meter to be tested, and the digital watt-hour meter to be tested is The output terminal is connected with the upper computer; the digital energy meter calibrator is used to generate the original data message composed of the original data message frame according to the standard source test data; the message controller is used for if the network abnormal type If it is a continuous abnormality, convert the original data message into a continuous test data message according to the preset total number of frames and the number of changed frames; if the network abnormality is a random abnormality, convert the original data message into The message is converted into a random test data message; the continuous test data message or the random test data message is sent to the digital watt-hour meter to be tested; the digital watt-hour meter to be tested generates a measurement result to be tested, and The measurement result to be measured is sent to the host computer;
所述高精度模拟表的输出端与规约转换器的输入端相连接,所述规约转换器的输出端与上位机相连接;所述高精度模拟表根据标准源测试数据生成标准计量结果,并经过规约转换器格式转换后发送至上位机。The output end of the high-precision analog meter is connected to the input end of the protocol converter, and the output end of the protocol converter is connected to the upper computer; the high-precision analog meter generates a standard measurement result according to the standard source test data, and After format conversion by the protocol converter, it is sent to the host computer.
由以上技术方案可见,本发明实施例提供的数字式电能表的测试方法及系统,通过标准元测试数据生成原始数据报文及标准计量结果;预设总帧数和变化帧数;根据网络异常类型为连续异常或者随机异常,将原始数据报文转换为连续测试数据报文或随机测试数据报文,待测数字式电能表根据上述测试数据报文生成待测计量结果,通过与标准计量结果的比对,完成数字式电能表的测试。在上述测试过程中,能够对数字式电能表的网络环境进行模拟,通过定量精确控制报文的时间特性,改变延时大小、控制丢帧、控制堵塞、改变品质字等,对数字式电能表的性能进行更加全面和准确地测试;而且通过分析不同网络异常情况对数字式电能表性能的影响,能够定性和定量的分析数字式电能表的处理机制、错误比率与计量误差的对应关系、评估数字式电能表的计量可靠性与可信度。It can be seen from the above technical solutions that the testing method and system of the digital electric energy meter provided by the embodiment of the present invention generates original data messages and standard measurement results through standard element test data; presets the total number of frames and the number of changed frames; The type is continuous abnormality or random abnormality, and the original data message is converted into a continuous test data message or a random test data message. Comparing and completing the test of the digital electric energy meter. In the above test process, the network environment of the digital electric energy meter can be simulated, and the time characteristic of the message can be quantitatively and accurately controlled, the delay can be changed, the frame loss can be controlled, the blockage can be controlled, the quality word can be changed, etc., the digital electric energy meter The performance of the digital energy meter can be tested more comprehensively and accurately; and by analyzing the impact of different network anomalies on the performance of the digital energy meter, it is possible to qualitatively and quantitatively analyze the processing mechanism of the digital energy meter, the corresponding relationship between the error ratio and the measurement error, and the evaluation Measurement reliability and credibility of digital energy meters.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings on the premise of not paying creative work.
图1为本发明实施例提供的一种数字式电能表的测试方法的流程示意图;Fig. 1 is a schematic flow chart of a testing method for a digital electric energy meter provided by an embodiment of the present invention;
图2为本发明实施例提供的一种连续测试数据报文转换方法的流程示意图;Fig. 2 is a schematic flow chart of a method for converting continuous test data packets provided by an embodiment of the present invention;
图3为本发明实施例提供的另一种连续测试数据报文转换方法的流程示意图Fig. 3 is a schematic flow chart of another continuous test data packet conversion method provided by an embodiment of the present invention
图4为本发明实施例提供的又一种连续测试数据报文转换方法的流程示意图;FIG. 4 is a schematic flow diagram of another method for converting continuous test data packets provided by an embodiment of the present invention;
图5为本发明实施例提供的再一种连续测试数据报文转换方法的流程示意图;FIG. 5 is a schematic flow diagram of another method for converting continuous test data packets provided by an embodiment of the present invention;
图6为本发明实施例提供的一种随机测试数据报文转换方法的流程示意图;FIG. 6 is a schematic flowchart of a random test data message conversion method provided by an embodiment of the present invention;
图7为本发明实施例提供的另一种随机测试数据报文转换方法的流程示意图;FIG. 7 is a schematic flowchart of another random test data message conversion method provided by an embodiment of the present invention;
图8为本发明实施例提供的又一种随机测试数据报文转换方法的流程示意图;FIG. 8 is a schematic flow diagram of another random test data message conversion method provided by an embodiment of the present invention;
图9为本发明实施例提供的再一种随机测试数据报文转换方法的流程示意图;FIG. 9 is a schematic flowchart of another random test data message conversion method provided by an embodiment of the present invention;
图10为本发明实施例提供的一种数字式电能表的测试系统的结构示意图。FIG. 10 is a schematic structural diagram of a testing system for a digital electric energy meter provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described The embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
参见图1,为本发明实施例提供的一种数字式电能表的测试方法的流程示意图,所述测试方法包括以下步骤:Referring to Fig. 1, it is a schematic flow chart of a test method of a digital electric energy meter provided by an embodiment of the present invention, the test method includes the following steps:
步骤S101:根据标准源测试数据生成由原始数据报文帧组成的原始数据报文以及标准计量结果。Step S101: Generating an original data packet composed of original data packet frames and a standard measurement result according to the standard source test data.
在实际测试过程中,将标准源二次侧模拟电压和标准源二次侧模拟电流输入,作为所述标准源测试数据;将输入的标准源二次侧模拟电压和标准源二次侧模拟电流采样生成由原始数据报文帧组成的原始数据报文,供待测数字式电能表使用生成测试计量结果;标准源二次侧模拟电压和标准源二次侧模拟电流同样输入到高精度模拟表,并以所述高精度模拟表的计量结果作为标准计量结果。通过比较所述测试计量结果和所述标准计量结果,进而测试待测数字式电能表的准确性。In the actual test process, the standard source secondary side analog voltage and standard source secondary side analog current are input as the standard source test data; the input standard source secondary side analog voltage and standard source secondary side analog current Sampling generates original data messages composed of original data message frames, which are used by the digital energy meter to be tested to generate test measurement results; the standard source secondary side analog voltage and standard source secondary side analog current are also input to the high precision analog meter , and take the measurement result of the high-precision analog meter as the standard measurement result. By comparing the test measurement result with the standard measurement result, the accuracy of the digital electric energy meter to be tested is further tested.
步骤S102:预设总帧数和变化帧数。Step S102: preset the total number of frames and the number of changed frames.
当用户需要模拟1000帧原始数据报文帧丢失50帧的情况时,设置所述总帧数为1000,所述变化帧数为50;并依据总帧数进行计数,当处理的原始数据报文帧达到总帧数时,重新组织控制新的1组总帧数个原始数据报文帧生成测试数据报文帧。在具体实施时,还可以设置报文的发送序号,所述报文的发送序号在区间[0,总帧数-1]内,每当所述发送序号循环至0时,重新组织控制原始数据报文帧生成测试数据报文帧。When the user needs to simulate the situation that 1000 frames of original data message frames are lost by 50 frames, set the total number of frames to 1000 and the number of changed frames to 50; and count according to the total number of frames, when the processed original data message When the frame reaches the total frame number, reorganize and control a new group of total frame number original data message frames to generate test data message frames. In specific implementation, the sending sequence number of the message can also be set, the sending sequence number of the message is in the interval [0, total frame number-1], and whenever the sending sequence number is cycled to 0, the original data of the control is reorganized The message frame generates a test data message frame.
步骤S103:确定网络异常类型。Step S103: Determine the type of network abnormality.
所述网络异常类型包括连续异常和随机异常。在数字式电能表的实际工作环境中,由于信号源的软硬件特性及网络传输影响,数字量采样值报文的异常变化主要表现为报文丢帧、发送间隔离散度变化、报文阻塞导致年报以及数据品质有效位异常等。硬件故障或者软件逻辑原因容易导致连续异常;系统整体软硬件特性或外部干扰容易导致随机异常。因此,在本发明实施例提供的数字式电能表的测试方法提供上述两种网络异常情况的仿真模拟,在具体实施时可以通过上位机选择确定网络异常类型为连续异常或者随机异常,以对不同的网络异常情况进行模拟。The types of network anomalies include continuous anomalies and random anomalies. In the actual working environment of the digital electric energy meter, due to the software and hardware characteristics of the signal source and the influence of network transmission, the abnormal changes of the digital sampled value messages are mainly caused by message frame loss, changes in the isolation divergence between transmissions, and message blocking. Annual report and data quality effective digit abnormality, etc. Continuous abnormalities are likely to be caused by hardware failure or software logic reasons; random abnormalities are easily caused by the overall software and hardware characteristics of the system or external interference. Therefore, the test method of the digital electric energy meter provided in the embodiment of the present invention provides the simulation simulation of the above-mentioned two kinds of network anomalies. During the specific implementation, the host computer can select and determine the network anomaly type as continuous anomaly or random anomaly, so as to detect different Network anomalies are simulated.
步骤S104:根据网络异常类型为连续异常或者随机异常,以及所述总帧数和所述变化帧数,将原始数据报文转换为连续测试数据报文或者随机测试数据报文。Step S104: Convert the original data packet into a continuous test data packet or a random test data packet according to whether the network anomaly type is continuous anomaly or random anomaly, and the total number of frames and the number of changed frames.
如果所述网络异常类型为连续异常,根据总帧数和变化帧数,将原始数据报文转换为连续测试数据报文,参见图2,为本发明实施例提供的一种连续测试数据报文转换方法的流程示意图,所述转换方法包括以下步骤:If the network abnormality type is a continuous abnormality, convert the original data message into a continuous test data message according to the total number of frames and the number of changed frames, see Figure 2, which is a continuous test data message provided by an embodiment of the present invention Schematic flow chart of conversion method, described conversion method comprises the following steps:
步骤S201:生成[0,总帧数-变化帧数-1]区间内的丢帧随机数。Step S201: Generate random numbers for frame loss in the interval [0, total number of frames-number of changed frames-1].
通过等概率随机数抽取算法产生所述丢帧随机数,所述丢帧随机数在[0,总帧数-变化帧数-1]区间内,当然所述丢帧随机数的范围可以限制在更小范围内,例如区间[1,总帧数-变化帧数-2]内等;随机数产生的方法为目前常用的产生方法,在此不再赘述。The frame loss random number is generated by an equal-probability random number extraction algorithm, and the frame loss random number is in the interval [0, total frame number-change frame number-1]. Of course, the range of the frame loss random number can be limited to In a smaller range, such as the interval [1, total number of frames - number of changed frames - 2], etc.; the method of generating random numbers is a commonly used method at present, and will not be repeated here.
步骤S202:判断当前原始数据报文帧的发送序号是否处于[丢帧随机数,丢帧随机数+变化帧数)的区间内。Step S202: Judging whether the sending sequence number of the current original data message frame is within the range of [random number of dropped frames, random number of dropped frames + number of changed frames).
原始数据报文是由原始数据报文帧组成的,并以报文帧的形式进行发送;每帧原始数据报文帧对应相应的发送序号,例如首先到达的原始数据报文帧的发送序号定义为总帧数-1,第二个到达的原始数据报文帧的发送序号定义为总帧数-2,对于后续到达的原始数据报文帧依次编号,直至第总帧数个原始数据报文帧对应的发送序号为0,至此总共采集到了与总帧数对应的原始数据报文帧;对于后续到来的原始数据报文帧,重新按照上述方法,进行新一轮发送序号编号。The original data message is composed of original data message frames and sent in the form of message frames; each frame of original data message frame corresponds to the corresponding sending sequence number, for example, the definition of the sending sequence number of the original data message frame that arrives first is the total frame number -1, the sending sequence number of the second arriving original data message frame is defined as the total frame number -2, and the subsequent arriving original data message frames are numbered sequentially until the original data message frame of the total number of frames The sending sequence number corresponding to the frame is 0, and a total of raw data message frames corresponding to the total number of frames have been collected so far; for subsequent raw data message frames, follow the above method again to carry out a new round of sending sequence numbering.
比对当前原始数据报文帧的发送序号,判断当前原始数据报文帧的发送序号是否处于[丢帧随机数,丢帧随机数+变化帧数)的区间内。Comparing the sending sequence number of the current original data message frame, judging whether the sending sequence number of the current original data message frame is in the interval of [random number of frame loss, random number of frame loss+change frame number).
步骤S203:如果是,舍弃当前原始数据报文帧,并生成丢帧连续测试数据报文作为所述连续测试数据报文。Step S203: If yes, discard the current original data message frame, and generate a frame-loss continuous test data message as the continuous test data message.
通过步骤S202的判断结果,如果当前原始数据报文帧的发送序号处于[丢帧随机数,丢帧随机数+变化帧数)区间内,则舍弃当前原始数据报文帧;如果否,则保留当前原始数据报文帧。最后将经过舍弃处理后的原始数据报文帧组织成丢帧连续测试数据报文,以对数字式电能表工作过程中丢帧现象进行模拟仿真,测试数字式电能表的测量精度。By the judgment result of step S202, if the sending sequence number of the current original data message frame is in the interval of [frame loss random number, frame loss random number+change frame number), then discard the current original data message frame; if not, then keep Current raw data telegram frame. Finally, the discarded original data message frames are organized into frame loss continuous test data messages to simulate the frame loss phenomenon in the working process of the digital energy meter and test the measurement accuracy of the digital energy meter.
在进行丢帧模拟过程中,每帧所述丢帧连续测试数据报文的发送参数设置如下:During the frame loss simulation process, the sending parameters of the frame loss continuous test data message in each frame are set as follows:
seq=dtCounter/(count/1000)seq=dtCounter/(count/1000)
offset=dtCounter%(count/1000)offset=dtCounter%(count/1000)
其中,dtCounter为原始报文数据帧到达时相对秒内计数值,count为FPGA统计的单位时间内计数值,seq为报文毫秒序号,offset为每帧之间的毫秒内相对延时。Among them, dtCounter is the relative count value in seconds when the original message data frame arrives, count is the count value per unit time counted by FPGA, seq is the millisecond serial number of the message, and offset is the relative delay in milliseconds between each frame.
为了仿真来自信号源的原始数据报文间隔离散情况,参见图3,为本发明实施例提供的另一种连续测试数据报文转换方法的流程示意图,该转换方法包括以下步骤:In order to simulate the separation and separation of the original data packets from the signal source, referring to Fig. 3, it is a schematic flow chart of another method for converting continuous test data packets provided by an embodiment of the present invention. The conversion method includes the following steps:
步骤S301:预设连续离散值。Step S301: Preset continuous discrete values.
预设所述连续离散值,所述连续离散值的取值范围为[-10,10]。The continuous discrete value is preset, and the value range of the continuous discrete value is [-10,10].
步骤S302:生成[0,总帧数-变化帧数-1]区间内的连续离散随机数。Step S302: Generate continuous discrete random numbers in the interval [0, total number of frames-change frame number-1].
调用等概率随机数抽取算法产生[0,总帧数-变化帧数-1]区间内的1个随机数作为所述连续离散随机数。The equal-probability random number extraction algorithm is used to generate a random number in the interval [0, total number of frames-change frame number-1] as the continuous discrete random number.
步骤S303:判断当前原始数据报文的发送序号是否处于[连续离散随机数,连续离散随机数+变化帧数)区间内。Step S303: Judging whether the sending sequence number of the current original data message is in the range of [continuous discrete random number, continuous discrete random number+changing frame number).
比对当前原始数据报文帧的发送序号,判断当前原始数据报文的发送序号是否处于[连续离散随机数,连续离散随机数+变化帧数)区间内。Comparing the sending sequence number of the current original data message frame, judging whether the sending sequence number of the current original data message is in the range of [continuous discrete random number, continuous discrete random number+change frame number).
步骤S304:如果是,判断所述离散随机数是否为奇数;如果所述离散随机数为奇数,取所述连续离散值对应的连续负离散值;如果所述连续离散随机数为偶数,取所述连续离散值对应的连续正离散值。Step S304: If yes, judge whether the discrete random number is an odd number; if the discrete random number is odd, take the continuous negative discrete value corresponding to the continuous discrete value; if the continuous discrete random number is even, take the The continuous positive discrete value corresponding to the above continuous discrete value.
通过步骤S303的判断,如果当前原始数据报文帧的发送序号处于[连续离散随机数,连续离散随机数+变化帧数)区间内,根据步骤S302产生的连续离散随机数的奇偶性进行分别处理;具体地,当所述连续离散随机数为奇数时,视为负偏,即取所述连续离散值的负值作为所述连续负离散值,例如如果所述连续离散值为10,则所述连续负离散值为-10;当所述连续离散值随机数为偶数时,视为正偏,即取所述连续离散值对应的连续正离散值,例如如果所述连续离散值为-10,则所述连续正离散值为10。Through the judgment of step S303, if the sending sequence number of the current original data message frame is in the interval of [continuous discrete random number, continuous discrete random number+change frame number), the parity of the continuous discrete random number generated according to step S302 is processed separately ; Specifically, when the continuous discrete random number is an odd number, it is regarded as a negative bias, that is, the negative value of the continuous discrete value is taken as the continuous negative discrete value, for example, if the continuous discrete value is 10, then the The continuous negative discrete value is -10; when the random number of the continuous discrete value is an even number, it is regarded as a positive bias, that is, the continuous positive discrete value corresponding to the continuous discrete value is taken, for example, if the continuous discrete value is -10 , then the continuous positive discrete value is 10.
步骤S305:根据所述连续负离散值或所述连续正离散值,计算获得当前原始数据报文帧对应的连续延时。Step S305: According to the continuous negative discrete value or the continuous positive discrete value, calculate and obtain the continuous delay corresponding to the current original data packet frame.
在具体实施时,所述连续延时根据以下公式进行计算:During specific implementation, the continuous delay is calculated according to the following formula:
Δt=Δ*count/1000000Δt=Δ*count/1000000
t=count/ft=count/f
offset=n%(f/1000)*t+Δtoffset=n%(f/1000)*t+Δt
其中,n为当前原始数据报文帧对应的发送序号,f为上位机配置的原始数据报文发送频率,Δ为连续离散值即所述连续负离散值或所述连续正离散值,count为FPGA统计的单位时间内计数值,t为每帧报文平均发送间隔时间对应计数值,offset即为所述连续延时。Wherein, n is the sending sequence number corresponding to the current raw data message frame, f is the sending frequency of the original data message configured by the host computer, Δ is a continuous discrete value, that is, the continuous negative discrete value or the continuous positive discrete value, and count is The count value per unit time counted by the FPGA, t is the count value corresponding to the average sending interval of each frame of messages, and offset is the continuous delay.
步骤S306:根据所述延时生成离散连续测试数据报文作为所述连续测试数据报文。Step S306: Generate discrete continuous test data packets as the continuous test data packets according to the delay.
根据步骤S305计算获得的延时,设定报文帧发送规则,来模拟报文帧间隔离散度很高的例如到达1ms等恶劣情况,进而对数字式电能表在报文间隔离散度高的情况下的性能。在具体实施时,当原始数据报文帧的发送序号处于采样序列时,即原始数据报文帧的发送序号位于[连续离散随机数,连续离散随机数+变化帧数)区间内,除了依据上述延时设置离散连续测试数据报文的发送参数,还依据以下公式计算所述离散连续测试数据报文的报文毫秒序号:According to the time delay calculated in step S305, set the message frame sending rule to simulate the bad situation such as the high isolation divergence between message frames, such as reaching 1ms, and then to the situation where the digital electric energy meter has a high isolation divergence between messages lower performance. During specific implementation, when the sending serial number of the original data message frame is in the sampling sequence, that is, the sending serial number of the original data message frame is located in the [continuous discrete random number, continuous discrete random number+change frame number) interval, except according to the above Delay sets the sending parameters of the discrete continuous test data message, and also calculates the message millisecond sequence number of the discrete continuous test data message according to the following formula:
seq=n/(f/1000)seq=n/(f/1000)
当原始数据报文帧不处于采样序列时,即原始数据报文帧的发送序号小于所述连续离散随机数,或者原始数据报文帧的发送序号大于或等于连续离散随机数+变化帧数时,依据以下发送参数生成所述离散连续测试数据报文:When the original data message frame is not in the sampling sequence, that is, the sending sequence number of the original data message frame is less than the continuous discrete random number, or the sending sequence number of the original data message frame is greater than or equal to the continuous discrete random number+change frame number , generating the discrete and continuous test data packets according to the following sending parameters:
seq=n/(f/1000)seq=n/(f/1000)
offset=n%(f/1000)*toffset=n%(f/1000)*t
根据上述两种情况的所述连续延时和所述报文毫秒序号,生成离散连续测试数据报文作为所述连续测试数据报文。Generate discrete continuous test data packets as the continuous test data packets according to the continuous delay and the packet millisecond sequence numbers in the above two cases.
为了对报文阻塞进行仿真,参见图4,本发明实施例还提供了又一种连续测试数据报文转换方法的流程示意图,该方法包括以下步骤:In order to simulate message blocking, referring to Fig. 4, the embodiment of the present invention also provides a schematic flow chart of another method for converting continuous test data messages, the method comprising the following steps:
步骤S401:预设连续粘帧数。Step S401: Preset the number of consecutive sticky frames.
预设连续粘帧数,所述连续粘帧数的取值范围为[0,f/1000],其中f为原始数据报文发送频率。The number of consecutive sticky frames is preset, and the value range of the number of continuous sticky frames is [0, f/1000], where f is the sending frequency of the original data message.
步骤S402:预设原始数据报文帧对应的连续间隔帧数。Step S402: Preset the number of consecutive interval frames corresponding to the original data frame.
对每个到达的原始数据报文帧设置相应的连续间隔帧数,所述连续间隔帧数的数值为1。A corresponding number of consecutive interval frames is set for each arriving original data message frame, and the value of the number of consecutive interval frames is 1.
步骤S403:生成[0,总帧数-变化帧数*连续粘帧数-1]区间内的阻塞随机数。Step S403: Generate blocking random numbers in the interval [0, total number of frames - number of changing frames * number of consecutive sticky frames - 1].
调用等概率随机数值抽取算法产生1个随机数作为所述阻塞随机数,所述阻塞随机数的取值区间为[0,总帧数-变化帧数*连续粘帧数-1]。Call the equal-probability random value extraction algorithm to generate a random number as the blocking random number, and the value range of the blocking random number is [0, total number of frames - number of changing frames * number of consecutive sticky frames - 1].
步骤S404:判断当前原始数据报文帧的发送序号是否处于[阻塞随机数-变化帧数*连续粘帧数,阻塞随机数]区间内。Step S404: Judging whether the sending sequence number of the current original data message frame is in the range of [blocking random number - changing frame number * continuous sticking frame number, blocking random number] interval.
步骤S405:如果是,判断(当前原始数据报文发送序号-阻塞随机数)%连续粘帧数的余数是否为0;如果所述余数为0,则设置当前原始数据报文帧对应的连续间隔帧数为连续粘帧数,否则,设置所述连续间隔帧数为0。Step S405: If yes, judge whether the remainder of (current original data message sending sequence number-blocking random number)% continuous sticky frame number is 0; if the remainder is 0, then set the continuous interval corresponding to the current original data message frame The number of frames is the number of consecutive sticky frames, otherwise, set the number of consecutive interval frames to 0.
当前原始数据报文帧的发送序号减去阻塞随机数后对连续粘帧数求余,判断余数是否为0;如果所述余数为0,则将当前原始数据报文帧对应的连续间隔帧数设置为连续粘帧数;否则,如果所述余数不为0,则将当前原始数据报文帧对应的连续间隔帧数设置为0。After subtracting the blocking random number from the sending sequence number of the current original data message frame, calculate the remainder of the number of consecutive sticky frames, and judge whether the remainder is 0; Set to the number of consecutive sticky frames; otherwise, if the remainder is not 0, set the number of consecutive interval frames corresponding to the current original data packet frame to 0.
步骤S406:根据当前发送序号之前的连续间隔帧数之和,计算阻塞连续测试数据报文序号,并根据所述阻塞连续测试数据报文序号生成阻塞连续测试数据报文作为所述连续测试数据报文。Step S406: Calculate the sequence number of the blocking continuous test data message according to the sum of the consecutive interval frames before the current sending sequence number, and generate a blocking continuous test data message as the continuous test data message according to the sequence number of the blocking continuous test data message arts.
将当前原始数据报文帧对应的连续间隔数,以及所述当前原始数据报文帧发送序号之前的原始数据报文帧对应的连续间隔数相加,得到连续间隔帧数之和;根据所述连续间隔帧数之和,计算阻塞连续测试数据报文序号,计算公式如下所示:The number of consecutive intervals corresponding to the current original data message frame and the number of consecutive intervals corresponding to the original data message frame before the sending sequence number of the current original data message frame are added to obtain the sum of the number of consecutive interval frames; according to the The sum of the number of frames at consecutive intervals is used to calculate the serial number of the blocking continuous test data packet. The calculation formula is as follows:
seq=sum/(f/1000)seq=sum/(f/1000)
其中,sum为所述连续间隔帧数之和,smpinter[i]为第i个原始数据报文帧对应的连续间隔帧数,seq为阻塞连续测试数据报文序号。Wherein, sum is the sum of the number of continuous interval frames, smpinter[i] is the number of consecutive interval frames corresponding to the i-th original data message frame, and seq is the sequence number of the blocking continuous test data message.
同时根据以下公式计算阻塞连续测试数据报文帧的延时:At the same time, calculate the delay of blocking continuous test data message frames according to the following formula:
offset=n%(f/1000)*intervaloffset=n%(f/1000)*interval
interval=count/finterval=count/f
其中,n、count以及f的含义与以上步骤中的描述一致,在此不再赘述。Wherein, the meanings of n, count, and f are consistent with the descriptions in the above steps, and will not be repeated here.
为了进行品质异常仿真,参见图5,为本发明实施例提供的再一种连续测试数据报文转换方法的流程示意图,该方法包括以下步骤:In order to perform abnormal quality simulation, see FIG. 5, which is a schematic flow chart of another method for converting continuous test data messages provided by an embodiment of the present invention. The method includes the following steps:
步骤S501:生成[0,总帧数-变化帧数-1]区间内的连续品质随机数。Step S501: Generate continuous quality random numbers within the interval [0, total number of frames - number of changed frames - 1].
步骤S502:判断当前原始数据报文帧的发送序号是否处于[连续品质随机数,连续品质随机数+变化帧数]区间内。Step S502: Judging whether the sending sequence number of the current original data message frame is within the interval of [continuous quality random number, continuous quality random number+change frame number].
步骤S503:如果是,将当前原始数据报文帧内的原始数据值替换为异常值,生成品质连续测试数据报文作为所述连续测试数据报文。Step S503: If yes, replace the original data value in the current original data message frame with an abnormal value, and generate a quality continuous test data message as the continuous test data message.
根据步骤S502的判断,如果当前原始数据报文帧的发送序号处于[连续品质随机数,连续品质随机数+变化帧数]区间内,则将当前原始数据报文帧内原始数据值替换为异常值。在具体实施时,原始数据报文帧携带有电压或电流等原始数据,根据异常值相对报文首地址偏移值和数据长度,用异常值替代原始数据;将替换后的原始数据报文帧作为品质连续测试数据报文帧,并由所述品质连续测试数据报文帧生成品质连续测试数据报文作为所述连续测试数据报文,以测试数字式电能表在发生数据品质异常时的性能。According to the judgment of step S502, if the sending sequence number of the current original data message frame is in the interval of [continuous quality random number, continuous quality random number+changing frame number], then the original data value in the current original data message frame is replaced with abnormal value. In the specific implementation, the original data message frame carries original data such as voltage or current, and according to the offset value and data length of the first address of the abnormal value relative to the message, the original data is replaced with the abnormal value; the replaced original data message frame As the quality continuous test data message frame, and the quality continuous test data message frame is generated by the quality continuous test data message frame as the continuous test data message, to test the performance of the digital electric energy meter when the data quality is abnormal .
如果所述网络异常类型为随机异常,根据总帧数和变化帧数,将原始数据报文转换为随机测试数据报文,参见图6,为本发明实施例提供的一种随机测试数据报文转换方法的流程示意图,所述转换方法包括以下步骤:If the network anomaly type is a random anomaly, convert the original data message into a random test data message according to the total number of frames and the number of changed frames, see Figure 6, which is a random test data message provided by an embodiment of the present invention Schematic flow chart of conversion method, described conversion method comprises the following steps:
步骤S601:预设原始数据报文帧对应的发送舍弃标识。Step S601: Presetting the sending abandonment flag corresponding to the original data packet frame.
对每个原始数据报文帧设置相应的发送舍弃标识,所述发送舍弃标识的值为0或1,当然在具体实施时,所述发送舍弃标识也可以为布尔数TRUE或FALSE。For each original data message frame, a corresponding sending discard flag is set, and the value of the sending discarding flag is 0 or 1. Of course, in specific implementation, the sending discarding flag can also be a Boolean number TRUE or FALSE.
步骤S602:判断变化帧数是否小于总帧数/2。Step S602: Determine whether the number of changed frames is less than the total number of frames/2.
步骤S603:如果是,将所有的所述发送舍弃标识设置为1;生成由变化帧数个随机数组成的第一丢帧随机数列,所述第一丢帧随机数列中的随机数为[0,总帧数-1]区间内的自然数;将所述第一丢帧随机数列对应的原始数据报文帧的发送舍弃标识设置为0;判断当前原始数据报文帧的发送舍弃标识是否为0,如果是,舍弃当前原始数据报文帧,如果否,保留当前原始数据报文帧,生成第一丢帧随机测试数据报文作为所述随机测试数据报文。Step S603: If yes, set all the sending abandonment flags to 1; generate a first frame loss random number sequence composed of random numbers of changing frame numbers, and the random numbers in the first frame loss random number sequence are [0 , the natural number in the interval of the total number of frames-1]; the sending and discarding identifier of the original data message frame corresponding to the first frame loss random number sequence is set to 0; whether the sending and discarding identifier of the current original data message frame is judged to be 0 , if yes, discarding the current original data message frame, if not, retaining the current original data message frame, and generating a first frame-losing random test data message as the random test data message.
如果变化帧数小于总帧数的1/2,则将所有的原始数据报文帧对应的发送舍弃标识设置为1;调用等概率随机数产生算法从自然数[0,总帧数-1]区间内产生变化帧数个随机数,并将所述变化帧数个随机数称为丢帧随机数列;从原始数据报文帧中取出发送序号与所述丢帧随机数列中的随机数一致的原始数据报文帧,并将取出的原始数据报文帧对应的发送舍弃标识设置为0;如果当前原始数据报文帧的发送舍弃标识为0,舍弃当前原始数据报文帧,如果当前原始数据报文帧的发送舍弃标识为1,则保留当前原始数据报文帧;最后将经过上述处理的原始数据报文帧组成丢帧随机测试数据报文,以测试在随机异常情况下对帧对数字式电能表性能的影响。If the number of changed frames is less than 1/2 of the total number of frames, set the sending discard flags corresponding to all original data message frames to 1; call the equal-probability random number generation algorithm from the natural number [0, total number of frames-1] interval Generate random numbers of changing frame numbers, and the random numbers of changing frame numbers are called frame-lost random numbers; from the original data message frame, the sending sequence number is consistent with the random numbers in the frame-losing random numbers original data message frame, and set the send discard flag corresponding to the original data message frame taken out to 0; if the send discard mark of the current original data message frame is 0, discard the current original data message frame, if the current original data If the sending and discarding flag of the message frame is 1, the current original data message frame will be retained; finally, the original data message frame processed above will be composed of a random frame loss test data message, so as to test the frame pair number under random abnormal conditions. Influence of the type electric energy meter performance.
步骤S604:如果否,将所有的所述发送舍弃标识设置为0;生成由总帧数-变化帧数个随机数组成的第二丢帧随机数列,所述第二丢帧随机数列中的随机数为[0,总帧数-1]区间内的自然数;将所述第二丢帧随机数列对应的原始数据报文帧的发送舍弃标识设置为1;判断当前原始数据报文帧的发送舍弃标识是否为1,如果是,保留当前原始数据报文帧,如果否,舍弃当前原始数据报文帧,生成第二丢帧随机测试数据报文作为所述随机测试数据报文。Step S604: If not, set all the sending abandonment flags to 0; generate a second random number sequence of frame loss consisting of random numbers of the total number of frames - the number of changed frames, and the random number in the second random number sequence of frame loss The number is a natural number in the interval [0, total number of frames-1]; the sending and discarding sign of the original data message frame corresponding to the second frame loss random number sequence is set to 1; the sending and discarding of the current original data message frame is judged Whether the flag is 1, if yes, retain the current original data packet frame, if not, discard the current original data packet frame, and generate a second frame-losing random test data packet as the random test data packet.
根据步骤S602的判断,当变化帧数大于或等于总帧数/2时,将所有的发送舍弃标识设置为0;生成由总帧数-变化帧数个随机数组成的第二丢怎随机数列,所述第二丢帧随机数列中的随机数为[0,总帧数-1]区间内的自然数;采样发送序号与第二丢帧随机数列中的随机数一致的原始数据报文帧,并将采样出的原始数据报文帧对应的发送舍弃标识设置为1;判断当前原始数据报文帧的发送舍弃标识是否为1,如果是,保留当前原始数据报文帧,如果否,舍弃当前原始数据报文帧,将经过上述处理后的原始数据报文帧组织成第二丢帧随机测试数据报文,并作为随机测试数据报文发送至待测数字式电能表,以对数字电能表在随机异常情况下进行数据丢帧测试。According to the judgment of step S602, when the number of changed frames is greater than or equal to the total number of frames/2, all sending and discarding flags are set to 0; the second random number sequence composed of the total number of frames-number of changed frames random numbers is generated , the random number in the second frame-losing random number sequence is a natural number in the interval [0, total number of frames-1]; the original data message frame whose sequence number is consistent with the random number in the second frame-losing random number sequence is sampled and sent , and set the sending and discarding flag corresponding to the sampled original data message frame to 1; judge whether the sending and discarding flag of the current original data message frame is 1, if yes, keep the current original data message frame, if not, discard For the current original data message frame, the original data message frame after the above processing is organized into the second frame loss random test data message, and sent to the digital electric energy meter to be tested as a random test data message to measure the digital electric energy. The table performs a data frame loss test under random abnormal conditions.
为了检测数据数字式电能表在随机异常情况下间隔离散度对测试精度的影响,在图6所示随机测试数据报文的转换方法的基础上,参见图7,为本发明实施例提供的另一种随机测试数据报文转换方法的流程示意图,所述转换方法包括以下步骤:In order to detect the influence of the interval divergence of the data digital electric energy meter on the test accuracy under random abnormal conditions, on the basis of the conversion method of the random test data message shown in Figure 6, see Figure 7, another example provided for the embodiment of the present invention A schematic flow chart of a method for converting random test data packets, the method for converting comprises the following steps:
步骤S701:预设随机离散值。Step S701: Preset random discrete values.
所述随机离散值取值范围为[-10,10]。The value range of the random discrete value is [-10,10].
步骤S702:判断当前原始原始数据报文帧对应的发送舍弃标识是否为1。Step S702: Determine whether the sending abandonment flag corresponding to the current original original data message frame is 1.
步骤S703:如果是,判断当前原始数据报文帧对应的发送序号是否为奇数;如果是,取所述随机离散值对应的随机负离散值;如果否,取所述随机离散值对应的随机正离散值。Step S703: If yes, judge whether the sending sequence number corresponding to the current original data message frame is an odd number; if yes, take the random negative discrete value corresponding to the random discrete value; if not, take the random positive discrete value corresponding to the random discrete value discrete value.
根据步骤S702的判断结果,如果当前原始数据报文帧对应的发送舍弃标识为1,进一步判断当前原始数据报文帧对应的发送序号是否为奇数,如果是,视为负偏,即取所述随机离散值对应的随机负离散值,例如如果所述随机离散值取值为-2,则依然保持所述随机负离散值为-2;如果当前原始数据报文帧对应的发送序号为偶数,视为正偏,即取所述随机离散值对应的随机正离散值,例如如果所述随机离散值为-2,则所述随机正离散值取值为2。According to the judgment result of step S702, if the sending abandonment mark corresponding to the current original data message frame is 1, it is further judged whether the sending sequence number corresponding to the current original data message frame is an odd number, if so, it is regarded as a negative bias, that is, the described The random negative discrete value corresponding to the random discrete value, for example, if the random discrete value is -2, the random negative discrete value is still maintained at -2; if the sending sequence number corresponding to the current original data message frame is an even number, As a positive bias, that is, take the random positive discrete value corresponding to the random discrete value, for example, if the random discrete value is -2, then the random positive discrete value is 2.
步骤S704:根据所述随机负离散值或随机正离散值,计算获得当前原始数据报文帧对应的随机延时。Step S704: According to the random negative discrete value or the random positive discrete value, calculate and obtain the random delay corresponding to the current original data packet frame.
当前原始数据报文帧对应的随机延时,表征当前原始数据报文帧与按发送序号下一个原始报文帧之间的延时;在具体实施时,根据步骤S702的判断结果,如果当前原始数据报文帧对应的发送舍弃标识为1,则根据所述随机负离散值或随机整理值计算所述随机延时,所述随机延时的计算公式与步骤S305中的公式一致,在此不再赘述。The random delay corresponding to the current original data message frame represents the delay between the current original data message frame and the next original message frame by the sending sequence number; during specific implementation, according to the judgment result of step S702, if the current original If the sending abandonment flag corresponding to the data message frame is 1, then the random delay is calculated according to the random negative discrete value or the random arrangement value, and the calculation formula of the random delay is consistent with the formula in step S305, which is not mentioned here Let me repeat.
步骤S705:根据所述随机延时生成离散随机测试数据报文作为所述随机测试数据报文。Step S705: Generate a discrete random test data packet as the random test data packet according to the random delay.
根据所述随机延时的计算结果生成所述离散随机测试数据报文,当所述发送舍弃标识为1时,所述离散随机测试数据报文的发送参数通过步骤S305和步骤S306中原始数据报文帧的发送序号处于采样序列时的计算公式计算得出;当所述发送舍弃标识为0时,所述离散随机测试数据报文的发送参数通过步骤S306中原始数据报文帧不处于采样序列时的计算公式计算得出。由上述发送参数得出的离散随机测试数据报文作为所述随机测试数据报文。Generate the discrete random test data message according to the calculation result of the random delay, when the sending discard flag is 1, the sending parameters of the discrete random test data message pass through the original data message in step S305 and step S306 The calculation formula when the sending sequence number of the text frame is in the sampling sequence is calculated; when the sending and discarding flag is 0, the sending parameters of the discrete random test data message are not in the sampling sequence through the original data message frame in step S306 The calculation formula of time is calculated. The discrete random test data message obtained by the above sending parameters is used as the random test data message.
在模拟随机异常情况下的报文阻塞时,参见图8,为本发明实施例提供的再一种随机测试数据报文转换方法的流程示意图,该方法包括以下步骤:When simulating message blocking under random abnormal conditions, referring to FIG. 8 , it is a schematic flow chart of another random test data message conversion method provided by the embodiment of the present invention. The method includes the following steps:
步骤S801:预设随机粘帧数。Step S801: Preset the number of random sticky frames.
所述随机粘帧数的取值范围与步骤S401的取值范围一致,在此不再赘述。The value range of the number of random sticky frames is consistent with the value range of step S401, and will not be repeated here.
步骤S802:生成多个随机数组成的阻塞随机数列,所述阻塞随机数列的随机数个数在[1,变化帧数]区间内,所述阻塞随机数列中的随机数的取值范围为[0,总帧数-随机数个数*随机粘帧数-1]区间内。Step S802: Generate a blocked random number sequence composed of multiple random numbers, the number of random numbers in the blocked random number sequence is in the interval [1, number of changing frames], and the value range of the random numbers in the blocked random number sequence is [ 0, the total number of frames - the number of random numbers * the number of random sticky frames - 1] interval.
通过多次调用等概率随机数抽取算法的方式产生所述阻塞随机数列。The blocked random number sequence is generated by calling an equal-probability random number extraction algorithm multiple times.
步骤S803:判断当前原始数据报文帧的发送序号是否处于[阻塞随机数列中随机数,阻塞随机数列中随机数+随机粘帧数]区间内。Step S803: Judging whether the sending sequence number of the current original data message frame is within the range of [the random number in the blocked random number sequence, the random number in the blocked random number sequence+the number of random sticky frames].
对阻塞随机数列中的每个随机数元素进行范围判断,判断当前原始数据报文帧的发送序号是否处于上述区间。Perform range judgment on each random number element in the blocked random number sequence, and judge whether the sending sequence number of the current original data message frame is within the above range.
步骤S804:如果是,判断当前原始数据报文帧的发送序号是否等于阻塞随机数列中的随机数;如果等于,则设置当前原始数据报文帧对应的随机间隔帧数为随机粘帧数;否则,设置所述随机间隔帧数为0。Step S804: If yes, determine whether the sending sequence number of the current original data message frame is equal to the random number in the blocking random number sequence; if equal, then set the random interval frame number corresponding to the current original data message frame as the number of random sticky frames; otherwise , set the random interval frame number to 0.
步骤S805:根据当前发送序号之前的随机间隔帧数之和,计算随机测试数据报文序号,并根据所述随机测试数据报文序号生成随机阻塞测试数据报文作为所述随机测试数据报文。Step S805: Calculate a random test data message sequence number according to the sum of random interval frames before the current sending sequence number, and generate a random blocking test data message as the random test data message according to the random test data message sequence number.
所述随机阻塞测试数据报文的发送参数如步骤S406所述,在此不再赘述。The sending parameters of the random blocking test data packet are as described in step S406, and will not be repeated here.
为了进行随机异常情况下的品质异常仿真,参见图9,为本发明实施例提供的再一种随机测试数据报文转换方法的流程示意图,该方法包括以下步骤:In order to perform quality abnormal simulation under random abnormal conditions, see FIG. 9 , which is a schematic flowchart of another random test data message conversion method provided by an embodiment of the present invention. The method includes the following steps:
步骤S901:生成[0,总帧数-1]区间内的与变化帧数对应的随机数并组成品质随机数列。Step S901: Generate random numbers corresponding to the number of changed frames in the interval [0, total number of frames-1] and form a quality random number sequence.
步骤S902:判断当前原始数据报文的发送序号是否等于所述品质随机数列中的随机数。Step S902: Determine whether the sending sequence number of the current original data packet is equal to the random number in the quality random number sequence.
步骤S903:如果是,将当前原始数据报文的原始数据值替换为异常值,生成品质随机测试数据报文作为所述随机测试数据报文。Step S903: If yes, replace the original data value of the current original data message with an abnormal value, and generate a quality random test data message as the random test data message.
所述将原始数据值替换为异常值的具体过程可参看步骤S503在此不再赘述。For the specific process of replacing the original data value with an abnormal value, refer to step S503 and will not go into details here.
需要说明的是,在确定所述网络异常类型后,可以分别针对不同的网络状态生成相互独立的连续测试数据报文或随机测试数据报文。为了描述方便,在此针对网络状态为连续异常的情况,并生成所述连续测试数据报文进行详细描述。当用户仅对对网络丢帧情况进行模拟时,按照步骤S201至S203的描述生成丢帧连续测试数据报文,或者用户对网络离散、报文阻塞和报文品质异常等其他网络异常情况进行模拟时,分别生成相应的离散连续测试数据报文、阻塞连续测试数据报文以及品质连续测试数据报文。在本发明实施例中,为了网络异常情况往往更加复杂多变,网络丢帧、网络离散、报文阻塞以及报文品质异常往往相互关联,因此可以根据上述步骤生成更加复杂的连续测试数据报文,例如生成网络丢帧+网络离散的连续测试数据报文,在具体实施时可以先生成丢帧连续测试数据报文,并对所述丢帧连续测试数据报文帧的延时进行离散化从而生成所述离散连续测试数据报文;同样也可以模拟网络丢帧+报文品质异常的网络状况,例如先生成丢帧连续测试数据报文,并对丢帧连续测试数据报文再进行随机采样生成品质连续测试数据报文。It should be noted that after the network abnormality type is determined, independent continuous test data packets or random test data packets may be generated for different network states. For the convenience of description, a detailed description will be given here of generating the continuous test data packets when the network state is continuously abnormal. When the user only simulates the network frame loss situation, generate continuous frame loss test data packets according to the description of steps S201 to S203, or the user simulates other network abnormalities such as network dispersion, packet congestion, and abnormal packet quality , corresponding discrete continuous test data messages, blocking continuous test data messages and quality continuous test data messages are generated respectively. In the embodiment of the present invention, network abnormalities are often more complex and changeable, and network frame loss, network dispersion, packet congestion, and packet quality anomalies are often interrelated, so more complex continuous test data packets can be generated according to the above steps , such as generating network frame loss+network discrete continuous test data messages, during specific implementation, it is possible to first generate frame loss continuous test data messages, and discretize the delay of the frame loss continuous test data message frames so that Generate the discrete continuous test data message; it is also possible to simulate the network condition of network frame loss + abnormal message quality, for example, first generate the frame loss continuous test data message, and then randomly sample the frame loss continuous test data message Generate quality continuous test data packets.
步骤S105:将所述连续测试数据报文或所述随机测试数据报文发送至待测数字式电能表,生成待测计量结果;比对所述待测计量结果以及标准计量结果,完成测试。Step S105: Send the continuous test data message or the random test data message to the digital electric energy meter to be tested to generate a measurement result to be tested; compare the measurement result to be tested with the standard measurement result to complete the test.
将步骤S104中产生的连续测试数据报文或随机测试数据报文发送至待测数字式电能表,所述待测数字式电能表依据上述测试数据报文进行计量生成待测计量结果,作为测试数据;将所述待测计量结果与标准计量结果进行比对,从而可以确定在网络异常情况下的,对待测数字式电能表的准确性进行评估,而且通过长期监测以及计量结果的统计,分析在异常情况下数字式电能表的处理机制、错误比率与计量误差的对应关系、评估数字式电能表的计量可靠性与可信度。Send the continuous test data message or random test data message generated in step S104 to the digital electric energy meter to be tested, and the digital electric energy meter to be tested performs measurement according to the above test data message to generate a measurement result to be tested as a test Data; compare the measured measurement results with the standard measurement results, so that it can be determined that the accuracy of the digital electric energy meter to be tested is evaluated under abnormal conditions in the network, and through long-term monitoring and statistics of measurement results, analysis The processing mechanism of the digital energy meter under abnormal conditions, the corresponding relationship between the error ratio and the measurement error, and the evaluation of the measurement reliability and credibility of the digital energy meter.
需要说明的是,在实际测试过程中,用户控制将网络异常状态回复到网络正常状态,以满足进行对比测试,或者配合其他测试仪器进行测试的需求。在实际实施时,可以通过设置所述总帧数和变化帧数的方式进行设置,例如设置总帧数和变化帧数均为0,则测试时的网络状态正常;或者,使用目前常用方法在上位机设置一选择窗口,选择是否开启网络异常模拟或网络状态正常。It should be noted that, in the actual test process, the user controls to restore the abnormal network status to the normal network status, so as to meet the requirements of comparative testing or cooperating with other testing instruments for testing. In actual implementation, it can be set by setting the total number of frames and the number of changed frames. For example, if the total number of frames and the number of changed frames are both set to 0, then the network status during the test is normal; or, use the current common method in In the host computer setting-selection window, choose whether to open the network abnormal simulation or the network status is normal.
由上述实施例可见,本发明实施例提供的数字式电能表的测试方法,通过标准元测试数据生成原始数据报文及标准计量结果;预设总帧数和变化帧数;根据网络异常类型为连续异常或者随机异常,将原始数据报文转换为连续测试数据报文或随机测试数据报文,待测数字式电能表根据上述测试数据报文生成待测计量结果,通过与标准计量结果的比对,完成数字式电能表的测试。在上述测试过程中,能够对数字式电能表的网络环境进行模拟,通过定量精确控制报文的时间特性,改变延时大小、控制丢帧、控制堵塞、改变品质字等,对数字式电能表的性能进行更加全面和准确地测试;而且通过分析不同网络异常情况对数字式电能表性能的影响,能够定性和定量的分析数字式电能表的处理机制、错误比率与计量误差的对应关系、评估数字式电能表的计量可靠性与可信度。It can be seen from the above-mentioned embodiments that the testing method of the digital electric energy meter provided by the embodiment of the present invention generates the original data message and the standard measurement result through the standard element test data; presets the total number of frames and the number of changed frames; For continuous abnormality or random abnormality, the original data message is converted into continuous test data message or random test data message. Yes, complete the digital energy meter test. In the above test process, the network environment of the digital electric energy meter can be simulated, and the time characteristic of the message can be quantitatively and accurately controlled, the delay can be changed, the frame loss can be controlled, the blockage can be controlled, the quality word can be changed, etc., the digital electric energy meter The performance of the digital energy meter can be tested more comprehensively and accurately; and by analyzing the impact of different network anomalies on the performance of the digital energy meter, it is possible to qualitatively and quantitatively analyze the processing mechanism of the digital energy meter, the corresponding relationship between the error ratio and the measurement error, and the evaluation Measurement reliability and credibility of digital energy meters.
通过以上的方法实施例的描述,所属领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:只读存储器(ROM)、随机存取存储器(RAM)、磁碟或者光盘等各种可以存储程序代码的介质。Through the description of the above method embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to make a A computer device (which may be a personal computer, a server, or a network device, etc.) executes all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program codes such as read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk.
与本发明提供的一种数字式电能表的测试方法实施例相对应,本发明还提供了一种数字式电能表的测试系统。Corresponding to the embodiment of a testing method for a digital electric energy meter provided by the present invention, the present invention also provides a testing system for a digital electric energy meter.
参见图10,为本发明实施例提供的一种数字式电能表的测试系统的结构示意图,所述测试系统包括标准源输入装置1、数字电能表校验仪2、报文控制器3、高精度模拟表4、规约转换器5和上位机6。Referring to Fig. 10, it is a schematic structural diagram of a test system for a digital electric energy meter provided by an embodiment of the present invention. The test system includes a standard source input device 1, a digital electric energy meter calibrator 2, a message controller 3, a high Precision analog meter 4, protocol converter 5 and host computer 6.
其中,所述标准源输入装置1包括标准源二次侧模拟量三相电压源11和标准源二次侧模拟量三相电流源12;所述标准源二次侧模拟量三相电压源11的输出端与所述数字电能表校验仪2的输入端和所述高精度模拟表4的输入端均电连接;所述标准源二次侧模拟量三相电流源12的输出端与所述数字电能表校验仪2的输入端和所述高端精度模拟表4的输入端均电连接。所述标准源输入装置1用于提供测试用标准源二次侧模拟量三相电压和标准源二次侧模拟量三相电流。Wherein, the standard source input device 1 includes a standard source secondary side analog three-phase voltage source 11 and a standard source secondary side analog three-phase current source 12; the standard source secondary side analog three-phase voltage source 11 The output end of the digital energy meter calibrator 2 and the input end of the high-precision analog meter 4 are all electrically connected; the output end of the standard source secondary side analog three-phase current source 12 is connected to the The input end of the digital electric energy meter calibrator 2 and the input end of the high-end precision analog meter 4 are electrically connected. The standard source input device 1 is used to provide the secondary side analog three-phase voltage of the standard source for testing and the standard source secondary side analog three-phase current.
所述数字电能表校验仪2的输出端与报文控制器3的输入端相连接,所述报文控制器3的输出端与待测数字电能表7的输入端相连接,所述待测数字电能表7的输出端与上位机6相连接;所述数字电能表校验仪2,用于根据标准源测试数据生成由原始数据报文帧组成的原始数据报文;所述报文控制器3用于如果网络异常类型为连续异常,根据预设的总帧数和变化帧数,将原始数据报文转换为连续测试数据报文;如果网络异常为随机异常,根据所述总帧数和变化帧数,将原始数据报文转换为随机测试数据报文;将所述连续测试数据报文或所述随机测试数据报文发送至待测数字式电能表;所述待测数字电能表7根据所述连续测试数据报文或所述随机测试数据报文,生成待测计量结果,并将所述待测计量结果发送至上位机6。在具体实施时,所述报文控制器3向待测数字式电能表7发送符合IEC61850-9-2规约的连续测试数据报文或随机测试数据报文。The output end of the digital watt-hour meter calibrator 2 is connected with the input end of the message controller 3, and the output end of the message controller 3 is connected with the input end of the digital watt-hour meter 7 to be tested. The output end of measuring digital electric energy meter 7 is connected with upper computer 6; Described digital electric energy meter calibration instrument 2 is used for generating the original data message that is made up of original data message frame according to standard source test data; Said message The controller 3 is used to convert the original data message into a continuous test data message according to the preset total number of frames and the number of changed frames if the network abnormality type is a continuous abnormality; if the network abnormality is a random abnormality, according to the total frame number number and change the number of frames, and convert the original data message into a random test data message; send the continuous test data message or the random test data message to the digital electric energy meter to be tested; the digital electric energy to be tested Table 7 generates the measurement result to be tested according to the continuous test data message or the random test data message, and sends the measurement result to the host computer 6 . During specific implementation, the message controller 3 sends a continuous test data message or a random test data message conforming to the IEC61850-9-2 protocol to the digital electric energy meter 7 to be tested.
所述高精度模拟表4的输出端与规约转换器5的输入端相连接,所述规约转换器5的输出端与上位机相连接;所述高精度模拟表4根据标准源测试数据生成标准计量结果,并经过规约转换器5格式转换后发送至上位机6。所述高精度模拟表接收来自标准源输入装置的标准源二次侧模拟量三相电压和标准源二次侧模拟量三相电流,通过485通讯645规约将电能数据传输到规约转换器5,由规约转换器5转换为IEC61850规约经交换机上传到上位机6,以此作为电能计量的标准计量结果。The output end of described high-precision analog meter 4 is connected with the input end of protocol converter 5, and the output end of described protocol converter 5 is connected with upper computer; Described high-precision analog meter 4 generates standard according to standard source test data The measurement results are sent to the upper computer 6 after format conversion by the protocol converter 5 . The high-precision analog meter receives the standard source secondary side analog three-phase voltage and the standard source secondary side analog three-phase current from the standard source input device, and transmits the electric energy data to the protocol converter 5 through the 485 communication 645 protocol, The protocol converted by the protocol converter 5 into the IEC61850 protocol is uploaded to the host computer 6 via the switch, and used as the standard measurement result of electric energy measurement.
由上述实施例可见,本发明实施例提供的数字式电能表的测试系统,包括标准源输入装置1、数字电能表校验仪2、报文控制器3、高精度模拟表4、规约转换器5和上位机6;所述高精度模拟表4接收系统中标准源二次侧模拟量三相电压和三相电流,并通过485通讯645规约将电能数据传输到规约转换器5,由规约转换器5通过IEC61850规约上传到上位机6,以此作为电能计量的标准数据;待测数字式电能表接收来自数字电能表校验仪2通过报文控制器3发送的IEC61850-9-2数据,并将数据传送至上位机6;其中数字电能表校验仪2接收来自系统标准源二次侧模拟量三相电压和三相电流,通过报文控制器3对数字式电能表校验仪2送给待测数字式电表7的IEC61850-9-2报文进行报文丢包、离散度、阻塞以及品质异常的定量控制,以检测各种网络异常对数字式电能表性能的影响,分析在异常情况下数字式电能表的处理机制、错误比率与计量误差的对应关系、评估数字式电能表的计量可靠性与可信度。It can be seen from the above-mentioned embodiments that the test system for digital electric energy meters provided by the embodiments of the present invention includes a standard source input device 1, a digital electric energy meter calibrator 2, a message controller 3, a high-precision analog meter 4, and a protocol converter 5 and the upper computer 6; the high-precision analog meter 4 receives the standard source secondary side analog three-phase voltage and three-phase current in the system, and transmits the electric energy data to the protocol converter 5 through the 485 communication 645 protocol, and converts it by the protocol The device 5 is uploaded to the upper computer 6 through the IEC61850 protocol, as the standard data of electric energy measurement; the digital electric energy meter to be tested receives the IEC61850-9-2 data sent by the digital electric energy meter calibrator 2 through the message controller 3, And transmit the data to the upper computer 6; wherein the digital energy meter calibrator 2 receives the analog three-phase voltage and three-phase current from the secondary side of the system standard source, and communicates with the digital energy meter calibrator 2 through the message controller 3 The IEC61850-9-2 message sent to the digital energy meter 7 to be tested is quantitatively controlled for packet loss, dispersion, congestion, and abnormal quality to detect the impact of various network anomalies on the performance of the digital energy meter. The processing mechanism of the digital energy meter under abnormal conditions, the corresponding relationship between the error rate and the measurement error, and the evaluation of the measurement reliability and credibility of the digital energy meter.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本发明时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above devices, functions are divided into various units and described separately. Of course, when implementing the present invention, the functions of each unit can be implemented in one or more pieces of software and/or hardware.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiments. The device and system embodiments described above are only illustrative, and 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, It can be located in one place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relative terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these No such actual relationship or order exists between entities or operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
以上所述仅是本发明的具体实施方式,使本领域技术人员能够理解或实现本发明。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above descriptions are only specific embodiments of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not 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)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610058952.8A CN105717476B (en) | 2016-01-28 | 2016-01-28 | The method of testing and system of a kind of digital electric energy meter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610058952.8A CN105717476B (en) | 2016-01-28 | 2016-01-28 | The method of testing and system of a kind of digital electric energy meter |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105717476A CN105717476A (en) | 2016-06-29 |
CN105717476B true CN105717476B (en) | 2018-03-30 |
Family
ID=56154236
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610058952.8A Active CN105717476B (en) | 2016-01-28 | 2016-01-28 | The method of testing and system of a kind of digital electric energy meter |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105717476B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106788924B (en) * | 2017-03-13 | 2019-08-30 | 贵州电网有限责任公司电力科学研究院 | A kind of message generation system and its production method realized sampling value message and lose control output function |
CN112491610B (en) * | 2020-11-25 | 2023-06-20 | 云南电网有限责任公司电力科学研究院 | FT3 message anomaly simulation test method for direct current protection |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0645636A1 (en) * | 1989-09-25 | 1995-03-29 | General Electric Company | Electronic watthour meter |
CN102103199A (en) * | 2009-12-22 | 2011-06-22 | 华北电力科学研究院有限责任公司 | Digital signal generating device and method based on three-phase power system model |
CN102413004A (en) * | 2010-09-26 | 2012-04-11 | 北京旋极信息技术股份有限公司 | Method and device for fault injection |
CN104198980A (en) * | 2014-08-29 | 2014-12-10 | 国家电网公司 | Accuracy evaluation system for digital electric energy meter |
CN104198808A (en) * | 2014-09-03 | 2014-12-10 | 国家电网公司 | Frame-dropping error code delay error calculation method, device and system in electric energy measurement |
CN104297717A (en) * | 2014-11-03 | 2015-01-21 | 青岛世泽电子仪表有限公司 | Electric energy meter correction method and system and electric energy meter |
CN204331019U (en) * | 2015-01-06 | 2015-05-13 | 国家电网公司 | A kind of digital electricity meter IEC61850 compliance test system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6954706B2 (en) * | 2003-08-20 | 2005-10-11 | Hewlett-Packard Development Company, L.P. | Method for measuring integrated circuit processor power demand and associated system |
-
2016
- 2016-01-28 CN CN201610058952.8A patent/CN105717476B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0645636A1 (en) * | 1989-09-25 | 1995-03-29 | General Electric Company | Electronic watthour meter |
CN102103199A (en) * | 2009-12-22 | 2011-06-22 | 华北电力科学研究院有限责任公司 | Digital signal generating device and method based on three-phase power system model |
CN102413004A (en) * | 2010-09-26 | 2012-04-11 | 北京旋极信息技术股份有限公司 | Method and device for fault injection |
CN104198980A (en) * | 2014-08-29 | 2014-12-10 | 国家电网公司 | Accuracy evaluation system for digital electric energy meter |
CN104198808A (en) * | 2014-09-03 | 2014-12-10 | 国家电网公司 | Frame-dropping error code delay error calculation method, device and system in electric energy measurement |
CN104297717A (en) * | 2014-11-03 | 2015-01-21 | 青岛世泽电子仪表有限公司 | Electric energy meter correction method and system and electric energy meter |
CN204331019U (en) * | 2015-01-06 | 2015-05-13 | 国家电网公司 | A kind of digital electricity meter IEC61850 compliance test system |
Non-Patent Citations (1)
Title |
---|
一种用于智能变电站数字化电能表的高精度电能算法;宋晓林等;《电测与仪表》;20151110;第52卷(第21期);第60-67页 * |
Also Published As
Publication number | Publication date |
---|---|
CN105717476A (en) | 2016-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114430199B (en) | Cubical switchboard operation supervisory systems based on big data | |
CN103135087B (en) | Electronic mutual inductor whole detection and evaluating system | |
EP2288080B1 (en) | Analysing a communication performance of an IED | |
CN102654937B (en) | IEC61850 detection platform and detection method of power quality monitoring terminal | |
CN103296757A (en) | Multi-parameter identification based secondary system fault diagnosing method for intelligent substation | |
CN114065875B (en) | Power grid fault identification system based on big data | |
CN108599995A (en) | Network line failure judgment method and server | |
CN117277587B (en) | Power outage risk monitoring method based on multi-source data analysis | |
US20110196627A1 (en) | Method and device for evaluating an electrical installation of an electrical power system | |
CN111008454A (en) | Intelligent substation reliability assessment method based on information physical fusion model | |
CN116311814B (en) | High-voltage switch cabinet running state analysis and active early warning system and method | |
CN106921522A (en) | Intelligent substation network message record analysis device networked information model inspection device | |
CN105717476B (en) | The method of testing and system of a kind of digital electric energy meter | |
CN103326901A (en) | Method and system for testing broadband network performance of power system | |
CN204228901U (en) | Local discharge detection device | |
CN118740678A (en) | Fault detection method and device for network equipment and electronic equipment | |
CN107104857A (en) | A kind of intelligent substation network switch delay accumulation method of testing and system | |
CN118382024A (en) | Method and system for collecting energy consumption of textile equipment of 5G network in real time | |
CN105652227A (en) | Method and system for measuring sample value (SV) rated time delay of relay protection tester | |
CN104850581B (en) | A kind of electric power scheduling automatization system multi-source data check method | |
CN103823998A (en) | Weak cross section determination method taking influence of network topology changes on power transmission capacity into consideration | |
CN106603338A (en) | Method, device and system for testing response time of intelligent terminal | |
CN108696412A (en) | System and method for the network failure transfer in digital transformer substation | |
Li et al. | Real time evaluation algorithm for measurement performance of substation voltage transformer based on artificial neural network | |
CN201887543U (en) | Sampling value time calibration device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20241222 Address after: 650000 Kunming Economic and Technological Development Zone, Yunnan Province Patentee after: YUNNAN ELECTRIC POWER TEST & RESEARCH INSTITUTE (GROUP) Co.,Ltd. Country or region after: China Address before: 650217 No. 105 Yunda West Road, Kunming Economic and Technological Development Zone, Yunnan Province Patentee before: ELECTRIC POWER RESEARCH INSTITUTE, YUNNAN POWER GRID Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |