Method and device for detecting communication baud rate deviation tolerance of intelligent electric energy meter

By providing a detection method and device for tolerance to the baud rate deviation of smart energy meter communication, the problem of lack of effective detection methods in the prior art is solved, and effective detection of tolerance to the baud rate deviation of smart energy meter communication is realized, and communication reliability and debugging efficiency are improved.

CN119544548APending Publication Date: 2025-02-28ANHUI ZENITH ELECTRICITY & ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411631379.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The lack of effective detection method for the tolerance to tolerance of communication baud rate of smart energy meter communications is caused by excessive deviation between the actual communication baud rate and the standard communication baud rate, resulting in decoding errors or communication failures.

Method used

A method and device for detecting the tolerance of the communication baud rate deviation of the smart energy meter is provided. By global initialization, determining whether the communication baud rate to be measured is non-empty, taking out the communication baud rate to be measured and allowable deviation, initializing the boundary parameters and step width based on the current round of communication baud rate to be measured and the detection requirements, combining the allowable deviation to explore the boundary parameters and step width, and finally characterizing the communication baud rate to be measured according to the results.

Benefits of technology

It realizes effective detection of the tolerance for the baud rate deviation of smart energy meter communication, improves the reliability of smart energy meter communication, shortens debugging and detection time, and is suitable for different types of smart energy meters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544548A_ABST
    Figure CN119544548A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent electric energy meter communication, in particular to a method and a device for detecting communication baud rate deviation tolerance of an intelligent electric energy meter. According to detection requirements, the communication baud rate deviation tolerance of the intelligent electric energy meter is detected in a circulating sampling, testing and updating mode: for each communication baud rate to be detected, sampling is carried out between communication baud rate boundaries according to the stepping width, the boundaries and the stepping width are updated according to a communication response test result, and the communication baud rate deviation tolerance of the intelligent electric energy meter is detected. And the communication Baud rate deviation tolerance result meeting the precision is obtained so as to evaluate the communication reliability of the intelligent electric energy meter. The current research on the Baud rate deviation tolerance of the intelligent electric energy meter is supplemented to a certain extent, a reference can be provided for the communication reliability research of the intelligent electric energy meter, and the debugging and detection progress of the intelligent electric energy meter can be accelerated. The method solves the problem that an effective method for detecting the communication baud rate deviation tolerance of the intelligent electric energy meter does not exist in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart energy meter communication technology, and more specifically to: 1. a method for detecting a baud rate deviation tolerance of a smart energy meter communication; 2. a device for detecting a baud rate deviation tolerance of a smart energy meter communication. Background Art

[0002] RS-485 (Recommended Standard 485, or RS485, EIA / TIA-485) is a common bus standard with advantages such as high transmission rate, long link distance, and strong anti-noise ability. It is widely used in digital communication networks. RS-485 communication has been included as a basic communication function requirement in the functional specifications of smart electric energy meters. It is an important way for power information to be transmitted and flow in the power system. Different communication baud rates can be selected according to actual needs. Many manufacturers have provided corresponding software and hardware support, many of which involve the adaptation of communication baud rate, that is, the determination of standard communication baud rate.

[0003] Existing research on the communication baud rate of smart energy meters mainly focuses on the adaptation of the communication baud rate. After the standard communication baud rate is determined, the deviation between the standard communication baud rate and the actual communication baud rate is generally ignored, especially the research on the baud rate deviation tolerance of smart energy meters is relatively rare. When the deviation between the actual communication baud rate and the standard communication baud rate is too large, decoding errors or even complete decoding failures will occur, resulting in communication failure with the smart energy meter. At present, the evaluation indicators and countermeasures for the tolerance of the communication baud rate deviation of smart energy meters are not yet sound, and there is a lack of corresponding detection methods for the tolerance of the communication baud rate deviation of smart energy meters. Summary of the invention

[0004] Based on this, it is necessary to provide a method and device for detecting the baud rate deviation tolerance of smart electric energy meter communication in order to address the problem that there is a lack of an effective method for detecting the baud rate deviation tolerance of smart electric energy meter communication.

[0005] The present invention is implemented by the following technical solutions:

[0006] In a first aspect, the present invention discloses a method for detecting a communication baud rate deviation tolerance of a smart electric energy meter, comprising the following steps:

[0007] S1, perform global initialization;

[0008] Among them, S1 includes:

[0009] Add the communication baud rate to be tested to list Q;

[0010] Initialize the deviation tolerance measurement result R to an empty set;

[0011] Initialize the allowable deviation list D according to the detection requirements;

[0012] Among them, the testing requirements include: requirement one, requirement two, requirement three, and requirement four;

[0013] Requirement 1 is: only the communication baud rate deviation tolerance of the smart energy meter in the downward direction needs to be detected;

[0014] Requirement 2 is: only the communication baud rate deviation tolerance of the smart energy meter in the upward direction needs to be detected;

[0015] Requirement 3: It is necessary to detect the communication baud rate deviation tolerance of the smart energy meter in the upper and lower directions, and the baud rate deviation response characteristics in the upper and lower directions are consistent;

[0016] Requirement 4 is: it is necessary to detect the communication baud rate deviation tolerance of the smart energy meter in the upper and lower directions, and the baud rate deviation response characteristics in the upper and lower directions are inconsistent;

[0017] S2, determine whether Q is non-empty;

[0018] If yes, execute S3;

[0019] If no, execute S6;

[0020] S3, take out the first element q in Q as the communication baud rate to be tested in the current round, and reduce the number of elements in Q by 1;

[0021] Take out the first element in D as the allowable deviation for the current round, and reduce the number of elements in D by 1;

[0022] S4, initializing corresponding limit parameters and step width according to the communication baud rate to be tested and the detection requirements of the current round;

[0023] S5, perform the current round limit exploration in combination with the current round allowable deviation to update the limit parameters and step width, and add the corresponding updated results to R, and then execute S2;

[0024] S6, characterizes the communication baud rate deviation tolerance of the smart energy meter on q based on the result in R.

[0025] The method for detecting the communication baud rate deviation tolerance of the smart electric energy meter implements the method or process according to the embodiment of the present disclosure.

[0026] In a second aspect, the present invention discloses a device for detecting the communication baud rate deviation tolerance of a smart electric energy meter, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to execute the steps of the method for detecting the communication baud rate deviation tolerance of a smart electric energy meter as disclosed in the first aspect.

[0027] The device for detecting the communication baud rate deviation tolerance of the smart electric energy meter implements the method or process according to the embodiment of the present disclosure.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] 1. The present invention supplements the current research on the baud rate deviation tolerance of smart energy meters to a certain extent, can provide a reference for the research on the communication reliability of smart energy meters, and helps to speed up the debugging and testing progress of smart energy meters.

[0030] 2. The present invention uses the step width as the communication baud rate sampling interval, sets the upper and lower response limits {r2, r3} and the upper and lower non-response limits {r1, r4} of the smart energy meter to form the sampling boundary, and designs a reasonable parameter update strategy, so the detection efficiency is relatively high. Preliminary practice shows that the present invention can obtain satisfactory results in only three to four cycles at the fastest.

[0031] 3. The present invention also designs corresponding methods for different scenarios, which can be adapted to different types of smart energy meters and realize the detection of the tolerance of the communication baud rate deviation of the smart energy meter. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 The process of the first method for detecting the communication baud rate deviation tolerance of the smart energy meter provided in the first embodiment of the present invention is as follows: Figure 1 ;

[0034] Figure 2 The process of the first method for detecting the communication baud rate deviation tolerance of the smart energy meter provided in the first embodiment of the present invention is as follows: Figure 2 ;

[0035] Figure 3 The process of the second method for detecting the communication baud rate deviation tolerance of the smart energy meter provided in the second embodiment of the present invention is as follows Figure 1 ;

[0036] Figure 4 The process of the second method for detecting the communication baud rate deviation tolerance of the smart energy meter provided in the second embodiment of the present invention is as follows Figure 2 ;

[0037] Figure 5A flowchart of a third method for detecting the communication baud rate deviation tolerance of a smart electric energy meter provided in Embodiment 3 of the present invention;

[0038] Figure 6 This is a flow chart of a fourth method for detecting communication baud rate deviation tolerance of a smart electric energy meter provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

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

[0040] It should be noted that when a component is referred to as being "mounted on" another component, it may be directly on the other component or there may be a central component. When a component is considered to be "set on" another component, it may be directly set on the other component or there may be a central component at the same time. When a component is considered to be "fixed to" another component, it may be directly fixed on the other component or there may be a central component at the same time.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "or / and" used herein includes any and all combinations of one or more of the related listed items.

[0042] Considering the actual situation of smart energy meters, there may be three situations when testing the communication baud rate deviation tolerance: ① Only the communication baud rate deviation tolerance of the smart energy meter in the downward direction needs to be tested; ② Only the communication baud rate deviation tolerance of the smart energy meter in the upward direction needs to be tested; ③ The communication baud rate deviation tolerance of the smart energy meter in the up and down directions needs to be tested. Among them, ③ can be further divided into two types: the baud rate deviation response characteristics in the up and down directions are consistent, and the baud rate deviation response characteristics in the up and down directions are inconsistent.

[0043] Therefore, for smart energy meters, the detection requirements can be divided into four types:

[0044] Requirement 1 is: only the communication baud rate deviation tolerance of the smart energy meter in the downward direction needs to be detected;

[0045] Requirement 2 is: only the communication baud rate deviation tolerance of the smart energy meter in the upward direction needs to be detected;

[0046] Requirement 3: It is necessary to detect the communication baud rate deviation tolerance of the smart energy meter in the upper and lower directions, and the baud rate deviation response characteristics in the upper and lower directions are consistent;

[0047] Requirement 4 is: It is necessary to detect the communication baud rate deviation tolerance of the smart electric energy meter in the upper and lower directions, and the baud rate deviation response characteristics in the upper and lower directions are inconsistent.

[0048] Example 1

[0049] Please see Figure 1-2 , which shows a flow chart of the first method for detecting the communication baud rate deviation tolerance of a smart energy meter provided in this embodiment 1, which shows the first requirement: a scenario where only a lower bound detection is required.

[0050] The first method for detecting the communication baud rate deviation tolerance of a smart electric energy meter comprises the following steps:

[0051] S1, perform global initialization;

[0052] Among them, S1 includes:

[0053] Add the communication baud rate to be tested to list Q;

[0054] Initialize the deviation tolerance measurement result R to an empty set;

[0055] Initialize the allowable deviation list D (ie, the lower limit allowable deviation list D1) according to the detection requirement (ie, requirement one).

[0056] Among them, the capacity of Q and D1 is the same and corresponds one to one, and its capacity is the total number of communication baud rates to be tested;

[0057] The elements in Q should be different;

[0058] The elements in D1 can be the same, but different allowable deviations should be set for communication baud rates that differ greatly.

[0059] The purpose of S1 is to set parameters applicable to each communication baud rate detection to be tested, and to perform a certain degree of abstraction, so as to handle different communication baud rates in the same way.

[0060] It should be noted that, since the detection object is a smart energy meter, S1 is installed in the detection device rather than on the smart energy meter: according to actual detection requirements, other programs can be installed in the detection device to facilitate the detection process, such as message address setting, time tag setting, etc.

[0061] S2, determine whether Q is non-empty;

[0062] If yes, execute S3;

[0063] If no, execute S6.

[0064] S2 actually determines whether there is still a communication baud rate that needs to be detected:

[0065] If so, a round of testing is conducted;

[0066] If not, it means that the detection has been completed and the final R can be obtained.

[0067] S3, take out the first element q in Q as the communication baud rate to be tested in the current round, and reduce the number of elements in Q by 1;

[0068] Take the first element d in D as the allowable deviation for the current round, and reduce the number of elements in D by 1 (that is, take the first element d1 in D1 as the lower bound allowable deviation for the current round, and reduce the number of elements in D1 by 1).

[0069] S3 can be regarded as round initialization. After taking out the first element in Q and D1, the number of elements in Q and D1 is reduced by 1, which is one of the necessary conditions to ensure the termination of this method.

[0070] S4, initializing corresponding limit parameters and step width according to the communication baud rate to be tested in the current round and the detection requirements.

[0071] Since only the lower bound detection is required, S4 only needs to initialize the communication baud rate lower bound parameters {r1, r2} and step width Δr1 of the current round.

[0072] Among them, r2 represents the lower limit of the response, which is the minimum communication baud rate that the smart energy meter can respond to near q;

[0073] r1 is the lower limit of no response, indicating that the smart energy meter does not respond to the communication baud rate less than r2.

[0074] Specifically, S4 can be set as follows:

[0075] Δr1 is initialized to q×α (α is 1% to 5%; if q×α is not an integer, it is rounded off);

[0076] r2 is initialized to q (if q is not an integer, it is rounded up);

[0077] r1 is initialized to r2-(q×α×β) (β is 5 to 10; if r2-(q×α×β) is not an integer, it is rounded up), or directly taken as 1.

[0078] For example, if q is 1200, r2 is initialized to 1200; Δr1 is initialized to 2% of q, that is, 24; r1 is initialized to r2-5Δr1, that is, 1200-24*5=1080.

[0079] S5, perform boundary exploration of the current round in combination with the allowable deviation of the current round to update the boundary parameters and step width, and add the corresponding updated results to R, and then execute S2.

[0080] S5 can be performed in a uniform sampling manner or in an unrestricted uniform sampling manner.

[0081] ①See Figure 1 , if S5 adopts uniform sampling, it includes:

[0082] S501, sampling in [r1, r2] with Δr1 as a step, and performing response detection on the smart electric energy meter at the sampling point; updating [r1, r2] to reduce the interval between r1 and r2 according to whether the smart electric energy meter responds;

[0083] S502, determining whether Δr1 is not greater than d1;

[0084] If yes, add {r1,r2,q} to R first, then execute S2;

[0085] If not, Δr1 is updated to a smaller value first, and then S501 is executed.

[0086] For ①:

[0087] If r1 and r2 are not much different, then uniformly sample with Δr1 in [r1, r2], and then perform response detection at each sampling point: update the largest unresponsive baud rate to the new r1, and update the slightly larger sampling point adjacent to the new r1 to the new r2. For example: based on 1200 (response), 1176 (response), 1152 (response), 1128 (unresponsive), 1104 (unresponsive), 1080 (unresponsive), update r1 to 1128, and update r2 to 1152; then determine whether Δr1 is not greater than the expected d1; if greater, update Δr1 to 0.5% of q (i.e. 6, which is smaller than the initialization value of Δr1, 24); then continue sampling and perform response detection.

[0088] Although the calculation cost is slightly higher, the reliability of the test is very high due to the large amount of data obtained (in extreme cases, whether the electricity meter can report a message is also affected by certain random factors. Although this rarely occurs in actual measurements, it cannot be ruled out that it responds at a small baud rate but not at a slightly larger baud rate, especially when the intervals between sampling points are small. Therefore, multiple response tests need to be repeated for one sampling point to verify).

[0089] Of course, it is recommended to downsample from r2 to r1 to reduce the number of attempts. See above, after 1128 (no response), 1104 (no response) and 1080 (no response) are actually no longer necessary. In other words, r2 does not have to reach r1, and downsampling can be stopped in advance based on actual detection conditions. Although upsampling from r1 to r2 is also possible, it is easy to cause too many attempts.

[0090] It should be noted that when the communication baud rate of the sampling point is not an integer, it should be rounded up according to the principle of rounding to ensure that the updated {r1, r2} are both integers.

[0091] In addition, if one or more of the sampling points happens to still be at the response / non-response boundary, that is, the new value is the same as the old value, the update is still performed.

[0092] If r1 and r2 differ greatly, then the uniform sampling using r1 or r2 as the starting point is likely to consume computing resources at both ends far from the boundary. For example: [r1, r2] is initialized to [600, 1200], and the actual boundary is [1128, 1152]. Then, during the test, sampling is performed every 24 seconds between 600 and 1200, and there will be a large number of invalid tests between 600 and 1128. A more efficient method such as binary search can be used to quickly narrow the range of the boundary. For example, between 600 and 1200, first test the response of 900, and then test 1050 if there is still no response, and then test 1125, and so on.

[0093] ②See Figure 2 If S5 adopts the method of unrestricted uniform adoption, it includes:

[0094] S511, determine whether r2-r1 is greater than d1;

[0095] If yes, then sampling is performed in [r1, r2] with Δr1 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r1, r2] is updated according to whether the smart electric energy meter responds to reduce the interval between r1 and r2, and Δr1 is updated to a smaller value, and then S511 is executed;

[0096] If no, execute S512;

[0097] S512, first add {r1, r2, q} to R, and then execute S2.

[0098] For ②:

[0099] Since the size relationship between Δr1 and d1 is not used as the judgment criterion, but r2-r1 is directly compared with d1, it can adapt to the situation of uneven sampling without uniform sampling.

[0100] It should be noted that under uniform sampling conditions, r2-r1 is actually the same value as Δr1. Only in non-uniform sampling, such as when using binary selection, the values ​​of r2-r1 and Δr1 may not be equal. In ②, since Δr1 is updated at the end of each step, the final step is actually the deviation of the next step, so r2-r1 needs to be used as the judgment standard.

[0101] The specific method of sampling and performing response detection in ② to update [r1, r2] can be found in ①, which will not be repeated here.

[0102] For ① and ②, updating Δr1 to a smaller value is the second necessary condition to ensure the termination of this method. In addition, due to the randomness of the response message of the smart energy meter, the update of Δr1 should not be updated linearly with the cycle. For example, in the early and late cycle processes, it is more appropriate to update Δr1 with Δr1 / 10 to Δr1 / 5 respectively.

[0103] S6, characterizes the communication baud rate deviation tolerance of the smart energy meter on q based on the result in R.

[0104] S6 can output or save R to a specified file, making it easy to store and read data.

[0105] Among them, the last R of S6 contains {r1,r2,q};

[0106] A smaller r2 indicates that the smart energy meter has a stronger response capability to messages lower than the standard communication baud rate and a higher tolerance for communication baud rate deviation; a larger r2 indicates that the smart energy meter has a weaker response capability to messages lower than the standard communication baud rate and a lower tolerance for communication baud rate deviation.

[0107] r2-r1 represents the actual deviation of this result; q-r2 or (q-r2) / q is used as the communication baud rate deviation tolerance of the smart energy meter in the downward direction of q.

[0108] If the value of q-r2 or (q-r2) / q is large, it means that the smart electric energy meter can respond to a larger communication baud rate range downward and has a higher tolerance for communication baud rate deviation in the downward direction; conversely, if the value of q-r2 or (q-r2) / q is small, it means that the smart electric energy meter can respond to a smaller communication baud rate range downward and has a lower tolerance for communication baud rate deviation in the downward direction.

[0109] Example 2

[0110] Please see Figure 3-4 , which shows a flow chart of a second method for detecting the communication baud rate deviation tolerance of a smart energy meter provided in this embodiment 2, which shows the second requirement: a scenario where only an upper bound detection is required.

[0111] The second method for detecting the communication baud rate deviation tolerance of the smart energy meter includes the following steps:

[0112] S1, perform global initialization;

[0113] Among them, S1 includes:

[0114] Add the communication baud rate to be tested to list Q;

[0115] Initialize the deviation tolerance measurement result R to an empty set;

[0116] Initialize the allowable deviation list D (ie, upper limit allowable deviation list D2) according to the detection requirement (ie, requirement 2).

[0117] Among them, the capacity of Q and D2 is the same and corresponds one to one, and its capacity is the total number of communication baud rates to be tested;

[0118] The elements in Q should be different;

[0119] The elements in D2 can be the same, but different allowable deviations should be set for communication baud rates that differ greatly.

[0120] The purpose of S1 is to set parameters applicable to each communication baud rate detection to be tested, and to perform a certain degree of abstraction, so as to handle different communication baud rates in the same way.

[0121] It should be noted that, since the detection object is a smart energy meter, S1 is installed in the detection device rather than on the smart energy meter: according to actual detection requirements, other programs can be installed in the detection device to facilitate the detection process, such as message address setting, time tag setting, etc.

[0122] S2, determine whether Q is non-empty;

[0123] If yes, execute S3;

[0124] If no, execute S6.

[0125] S2 actually determines whether there is still a communication baud rate that needs to be detected:

[0126] If so, a round of testing is conducted;

[0127] If not, it means that the detection has been completed and the final R can be obtained.

[0128] S3, take out the first element q in Q as the communication baud rate to be tested in the current round, and reduce the number of elements in Q by 1;

[0129] Take the first element d in D as the allowable deviation for the current round, and reduce the number of elements in D by 1 (that is, take the first element d2 in D2 as the upper limit allowable deviation for the current round, and reduce the number of elements in D2 by 1).

[0130] S3 can be regarded as round initialization. After taking out the first element in Q and D2, the number of elements in Q and D2 is reduced by 1, which is one of the necessary conditions to ensure the termination of this method.

[0131] S4, initializing corresponding limit parameters and step width according to the communication baud rate to be tested in the current round and the detection requirements.

[0132] Since only the upper bound detection is required, S4 only needs to initialize the communication baud rate upper bound parameters {r3, r4} and the step width Δr2 of the current round.

[0133] Among them, r3 represents the upper limit of the response, which is the maximum communication baud rate that the smart energy meter can respond to near q;

[0134] r4 is the upper limit of non-response, indicating that the smart energy meter does not respond to the communication baud rate greater than r3.

[0135] Specifically, S4 can be set as follows:

[0136] Δr2 is initialized to q×α (α is 1% to 5%; if q×α is not an integer, it is rounded off);

[0137] r3 is initialized to q (if q is not an integer, it is rounded up);

[0138] r4 is initialized to r2+(q×α×β) (β is 5 to 10; if r2-(q×α×β) is not an integer, it is rounded up), or a maximum value is directly taken.

[0139] For example, if q is 1200, then r3 is initialized to 1200; Δr2 is initialized to 2% of q, that is, 24; r1 is initialized to r2+5Δr1, that is, 1200+24*5=1320.

[0140] S5, perform boundary exploration of the current round in combination with the allowable deviation of the current round to update the boundary parameters and step width, and add the corresponding updated results to R, and then execute S2.

[0141] S5 can be performed in a uniform sampling manner or in an unrestricted uniform sampling manner.

[0142] ①See Figure 3 , if S5 adopts uniform sampling, it includes:

[0143] S501, sampling in [r3, r4] with Δr2 as a step, and performing response detection on the smart electric energy meter at the sampling point; updating [r3, r4] to reduce the interval between r3 and r4 according to whether the smart electric energy meter responds;

[0144] S502, determining whether Δr2 is not greater than d2;

[0145] If yes, add {q,r3,r4} to R first, then execute S2;

[0146] If not, Δr2 is updated to a smaller value first, and then S501 is executed.

[0147] For ①:

[0148] If r3 and r4 are not much different, then uniformly sample with Δr2 in [r3, r4], and then perform response detection at each sampling point: update the baud rate of the smallest response to the new r3, and update the slightly larger sampling point adjacent to the new r3 to the new r4. For example: based on 1200 (response), 1224 (response), 1248 (response), 1272 (no response), 1296 (no response), 1320 (no response), update r3 to 1248, update r4 to 1272; then determine whether Δr2 is not greater than the expected d2; if greater, update Δr2 to 0.5% of q (i.e. 6, which is smaller than the initialization value of Δr2, 24); then continue sampling and perform response detection.

[0149] Although the calculation cost is slightly higher, the reliability of the test is very high due to the large amount of data obtained (in extreme cases, whether the electricity meter can report a message is also affected by certain random factors. Although this rarely occurs in actual measurements, it cannot be ruled out that it responds at a small baud rate but not at a slightly larger baud rate, especially when the intervals between sampling points are small. Therefore, multiple response tests need to be repeated for one sampling point to verify).

[0150] Of course, it is recommended to upsample from r3 to r4 to reduce the number of attempts. See above, after 1272 (no response), 1296 (no response) and 1320 (no response) are actually no longer necessary. In other words, r3 does not necessarily have to reach r4, and upsampling can be stopped in advance based on actual detection conditions. Although downsampling from r4 to r3 is also possible, it is easy to cause too many attempts.

[0151] It should be noted that when the communication baud rate of the sampling point is not an integer, it should be rounded up according to the principle of rounding to ensure that the updated {r3, r4} are all integers.

[0152] In addition, if one or more of the sampling points happens to still be at the response / non-response boundary, that is, the new value is the same as the old value, the update is still performed.

[0153] If r3 and r4 differ greatly, then the uniform sampling using r3 or r4 as the starting point is likely to consume computing resources at both ends far from the boundary. For example: [r3, r4] is initialized to [1100, 1700], and the actual boundary is [1248, 1272]. Then, during the test, sampling is performed every 24 seconds between 1300 and 1700, resulting in a large number of invalid tests between 1300 and 1600. A more efficient method such as binary search can be used to quickly narrow the range of the boundary. For example, between 1300 and 1700, first test the response of 1500, and then test 1400 if it does not respond. If it still does not respond, test 1350, and so on.

[0154] ②See Figure 4 If S5 adopts the method of unrestricted uniform adoption, it includes:

[0155] S511, determine whether r4-r3 is greater than d2;

[0156] If yes, then sampling is performed in [r3, r4] with Δr2 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r3, r4] is updated according to whether the smart electric energy meter responds to reduce the interval between r3 and r4, and Δr2 is updated to a smaller value, and then S511 is executed;

[0157] If no, execute S512;

[0158] S512, first add {q, r3, r4} to R, and then execute S2.

[0159] For ②:

[0160] Since the size relationship between Δr2 and d2 is not used as the judgment criterion, but r4-r3 is directly compared with d2, it can adapt to the situation of uneven sampling without uniform sampling.

[0161] It should be noted that under uniform sampling conditions, r4-r3 is actually the same value as Δr2. Only in non-uniform sampling, such as when using the binary method, the values ​​of r4-r3 and Δr2 may not be equal. In ②, since Δr2 is updated at the end of each step, the final step is actually the deviation of the next step, so r4-r3 needs to be used as the judgment standard.

[0162] The specific method of sampling and performing response detection in ② to update [r3, r4] can be found in ①, which will not be repeated here.

[0163] For ① and ②, updating Δr2 to a smaller value is the second necessary condition to ensure the termination of this method. In addition, due to the randomness of the response message of the smart energy meter, the update of Δr2 should not be updated linearly with the cycle. For example, in the early and late cycle processes, it is more appropriate to update Δr2 with Δr2 / 10~Δr2 / 5 respectively.

[0164] S6, characterizes the communication baud rate deviation tolerance of the smart energy meter on q based on the result in R.

[0165] S6 can output or save R to a specified file, making it easy to store and read data.

[0166] Among them, the last R of S6 contains {q,r3,r4};

[0167] A larger r3 indicates that the smart energy meter has a stronger response capability to messages with a higher communication baud rate than the standard communication baud rate and a higher tolerance for communication baud rate deviation; a smaller r3 indicates that the smart energy meter has a weaker response capability to messages with a higher communication baud rate than the standard communication baud rate and a lower tolerance for communication baud rate deviation.

[0168] r4-r3 represents the actual deviation of this result; r3-q or (r3-q) / q is used as the communication baud rate deviation tolerance of the smart energy meter in the q-up direction.

[0169] If the value of r3-q or (r3-q) / q is large, it means that the smart electric energy meter can respond to a larger communication baud rate range and a higher tolerance for upward communication baud rate deviation; conversely, if the value of r3-q or (r3-q) / q is small, it means that the smart electric energy meter can respond to a smaller communication baud rate range and a lower tolerance for upward communication baud rate deviation.

[0170] Example 3

[0171] See also Figure 5 , Figure 5 A flowchart of the third method for detecting the communication baud rate deviation tolerance of a smart energy meter provided in this embodiment 3 is shown, which illustrates the scenario where requirement three: both the upper and lower bounds need to be detected, and the baud rate deviation response characteristics in the upper and lower directions are consistent.

[0172] The third method for detecting the communication baud rate deviation tolerance of the smart energy meter includes the following steps:

[0173] S1, perform global initialization;

[0174] Among them, S1 includes:

[0175] Add the communication baud rate to be tested to list Q;

[0176] Initialize the deviation tolerance measurement result R to an empty set;

[0177] Initialize the allowable deviation list D (ie, the unified allowable deviation list D0) according to the detection requirement (ie, requirement three).

[0178] Among them, the capacity of Q and D0 is the same and corresponds one to one, and its capacity is the total number of communication baud rates to be tested;

[0179] The elements in Q should be different;

[0180] The elements in D0 can be the same, but different allowable deviations should be set for communication baud rates that differ greatly.

[0181] The purpose of S1 is to set parameters applicable to each communication baud rate detection to be tested, and to perform a certain degree of abstraction, so as to handle different communication baud rates in the same way.

[0182] It should be noted that, since the detection object is a smart energy meter, S1 is installed in the detection device rather than on the smart energy meter: according to actual detection requirements, other programs can be installed in the detection device to facilitate the detection process, such as message address setting, time tag setting, etc.

[0183] S2, determine whether Q is non-empty;

[0184] If yes, execute S3;

[0185] If no, execute S6.

[0186] S2 actually determines whether there is still a communication baud rate that needs to be detected:

[0187] If so, a round of testing is conducted;

[0188] If not, it means that the detection has been completed and the final R can be obtained.

[0189] S3, take out the first element q in Q as the communication baud rate to be tested in the current round, and reduce the number of elements in Q by 1;

[0190] Take the first element d in D as the allowable deviation for the current round, and reduce the number of elements in D by 1 (that is, take the first element d0 in D0 as the allowable deviation for the current round, and reduce the number of elements in D0 by 1).

[0191] S3 can be regarded as round initialization. After taking out the first element in Q and D0, the number of elements in Q and D0 is reduced by 1, which is one of the necessary conditions to ensure the termination of this method.

[0192] S4, initializing corresponding limit parameters and step width according to the communication baud rate to be tested in the current round and the detection requirements.

[0193] Since both the upper and lower bounds need to be detected, S4 needs to initialize the communication baud rate limit parameters {r1, r2, r3, r4} and step width Δr0 of the current round.

[0194] In this embodiment, r1 and r2 here can be performed with reference to S4 in Embodiment 1, and r3 and r4 can be performed with reference to S4 in Embodiment 2.

[0195] S5, perform boundary exploration of the current round in combination with the allowable deviation of the current round to update the boundary parameters and step width, and add the corresponding updated results to R, and then execute S2.

[0196] Since both the upper bound and the lower bound need to be detected and both involve the update of Δr0, whether the upper bound detection is performed first and then the lower bound detection, or the lower bound detection is performed first and then the upper bound detection, Δr0 needs to be reinitialized between the two to eliminate interference.

[0197] That is, S5 includes: first performing S51, reinitializing Δr0, and then performing S52;

[0198] Alternatively, perform S52 first, reinitialize Δr0, and then perform S51.

[0199] S51 and S52 may be performed in a uniform sampling manner or in an unrestricted uniform sampling manner.

[0200] (I) If S51 is performed in a uniform sampling manner, then S51 includes:

[0201] S5101, sampling in [r1, r2] with Δr0 as a step, and detecting the response of the smart electric energy meter at the sampling point; updating [r1, r2] to reduce the interval between r1 and r2 according to whether the smart electric energy meter responds;

[0202] S5102, determining whether Δr0 is not greater than d0;

[0203] If yes, add {r1,r2,q} to R first, then execute S2;

[0204] If not, update Δr0 to a smaller value first, and then execute S5101.

[0205] (ii) If S51 is performed by unrestricted uniform adoption, S51 includes:

[0206] S5111, determine whether r2-r1 is greater than d0;

[0207] If yes, then sampling is performed in [r1, r2] with Δr0 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r1, r2] is updated according to whether the smart electric energy meter responds to reduce the interval between r1 and r2, and Δr0 is updated to a smaller value, and then S5111 is executed;

[0208] If no, execute S5112;

[0209] S5112, first add {r1, r2, q} to R, and then execute S2.

[0210] (III) If S52 is performed by uniform sampling, S52 includes:

[0211] S5201, sampling in [r3, r4] with Δr0 as a step, and detecting the response of the smart electric energy meter at the sampling point; updating [r3, r4] to reduce the interval between r3 and r4 according to whether the smart electric energy meter responds;

[0212] S5202, determine whether Δr0 is not greater than d0;

[0213] If yes, add {q,r3,r4} to R first, then execute S2;

[0214] If not, update Δr0 to a smaller value first, and then execute S5201.

[0215] (IV) If S52 is carried out in an unrestricted uniform manner, then S52 includes:

[0216] S52 includes:

[0217] S5211, determine whether r4-r3 is greater than d0;

[0218] If yes, then sampling is performed in [r3, r4] with Δr0 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r3, r4] is updated according to whether the smart electric energy meter responds to reduce the interval between r3 and r4, and Δr0 is updated to a smaller value, and then S5211 is executed;

[0219] If no, execute S5212;

[0220] S5212, first add {q, r3, r4} to R, and then execute S2.

[0221] The above (i) and (ii) can be performed with reference to S5 in Example 1; the above (iii) and (iv) can be performed with reference to S5 in Example 2.

[0222] S6, characterizes the communication baud rate deviation tolerance of the smart energy meter on q based on the result in R.

[0223] S6 can output or save R to a specified file, making it easy to store and read data.

[0224] Among them, the last R of S6 contains {r1,r2,q,r3,r4};

[0225] r2-r1 and r4-r3 represent the actual deviation of the result. From S5, we can know that these two values ​​are the same and must be no greater than d0.

[0226] Therefore, q-r2 or (q-r2) / q can be used as the communication baud rate deviation tolerance of the smart energy meter in the q downward direction.

[0227] If the value of q-r2 or (q-r2) / q is large, it means that the smart electric energy meter can respond to a larger communication baud rate range downward and has a higher tolerance for communication baud rate deviation in the downward direction; conversely, if the value of q-r2 or (q-r2) / q is small, it means that the smart electric energy meter can respond to a smaller communication baud rate range downward and has a lower tolerance for communication baud rate deviation in the downward direction.

[0228] r3-q or (r3-q) / q can be used as the communication baud rate deviation tolerance of the smart electric energy meter in the q-up direction.

[0229] If the value of r3-q or (r3-q) / q is large, it means that the smart electric energy meter can respond to a larger communication baud rate range and a higher tolerance for upward communication baud rate deviation; conversely, if the value of r3-q or (r3-q) / q is small, it means that the smart electric energy meter can respond to a smaller communication baud rate range and a lower tolerance for upward communication baud rate deviation.

[0230] Of course, r3-r2 or (r3-r2) / q may also be used as the communication baud rate deviation tolerance of the smart energy meter on q.

[0231] If the value of r3-r2 or (r3-r2) / q is large, it means that the smart energy meter can respond to a larger communication baud rate range and a higher tolerance for communication baud rate deviation; conversely, if the value of r3-r2 or (r3-r2) / q is small, it means that the smart energy meter can respond to a smaller communication baud rate range and a lower tolerance for communication baud rate deviation.

[0232] It should be noted that, generally speaking, a smaller r2 and a larger r3 are ideal results for the baud rate deviation tolerance of smart energy meter communication, and should be strived for as much as possible; a larger r2 and a smaller r3 are bad results for the baud rate deviation tolerance of smart energy meter communication, and should be avoided as much as possible. However, in actual situations, for example, both r2 and r3 are larger or smaller, which is why it is necessary to detect the upper and lower bounds separately.

[0233] Example 4

[0234] See also Figure 6 , Figure 6 A flowchart of the fourth method for detecting the communication baud rate deviation tolerance of a smart energy meter provided in this embodiment 4 is shown, which illustrates the scenario where requirement 4: both the upper and lower bounds need to be detected, and the baud rate deviation response characteristics in the upper and lower directions are inconsistent.

[0235] The fourth method for detecting the communication baud rate deviation tolerance of the smart electric energy meter includes the following steps:

[0236] S1, perform global initialization;

[0237] Among them, S1 includes:

[0238] Add the communication baud rate to be tested to list Q;

[0239] Initialize the deviation tolerance measurement result R to an empty set;

[0240] Initialize the allowable deviation list D (including: lower limit allowable deviation list D1, upper limit allowable deviation list D2) according to the detection requirement (ie: requirement four).

[0241] Among them, Q has the same capacity as D1 and D2, and corresponds one to one, and its capacity is the total number of communication baud rates to be tested;

[0242] The elements in Q should be different;

[0243] The elements in D1 can be the same, but for communication baud rates with large differences, different allowable deviations should be set; the elements in D2 can be the same, but for communication baud rates with large differences, different allowable deviations should be set.

[0244] The purpose of S1 is to set parameters applicable to each communication baud rate detection to be tested, and to perform a certain degree of abstraction, so as to handle different communication baud rates in the same way.

[0245] It should be noted that, since the detection object is a smart energy meter, S1 is installed in the detection device rather than on the smart energy meter: according to actual detection requirements, other programs can be installed in the detection device to facilitate the detection process, such as message address setting, time tag setting, etc.

[0246] S2, determine whether Q is non-empty;

[0247] If yes, execute S3;

[0248] If no, execute S6.

[0249] S2 actually determines whether there is still a communication baud rate that needs to be detected:

[0250] If so, a round of testing is conducted;

[0251] If not, it means that the detection has been completed and the final R can be obtained.

[0252] S3, take out the first element q in Q as the communication baud rate to be tested in the current round, and reduce the number of elements in Q by 1;

[0253] Take the first element d in D as the current round allowable deviation, and reduce the number of elements in D by 1 (that is, take the first element d1 in D1 as the current round lower bound allowable deviation, and reduce the number of elements in D1 by 1;

[0254] Take out the first element d2 in D2 as the upper limit allowed deviation of the current round, and reduce the number of elements in D2 by 1).

[0255] S3 can be regarded as round initialization. Among them, after taking out the first element in Q, D1, and D2, the number of elements in Q, D1, and D2 is reduced by 1 respectively, which is one of the necessary conditions to ensure the termination of this method.

[0256] S4, initializing corresponding limit parameters and step width according to the communication baud rate to be tested in the current round and the detection requirements.

[0257] Since both the upper and lower bounds need to be detected, S4 needs to initialize the communication baud rate limit parameters {r1, r2, r3, r4}, step width Δr1, and step width Δr2 of the current round.

[0258] In this embodiment, r1 and r2 here can be performed with reference to S4 in Embodiment 1, and r3 and r4 can be performed with reference to S4 in Embodiment 2.

[0259] S5, perform boundary exploration of the current round in combination with the allowable deviation of the current round to update the boundary parameters and step width, and add the corresponding updated results to R, and then execute S2.

[0260] Since both the upper bound and the lower bound need to be detected, Δr1 is used for the upper bound detection and Δr2 is used for the lower bound detection; therefore, whether the upper bound detection is performed first and then the lower bound detection, or the lower bound detection is performed first and then the upper bound detection, or the upper bound detection and the lower bound detection are performed at the same time, there will be no mutual interference.

[0261] That is, S5 includes: performing S51 and S52.

[0262] S51 and S52 may be performed in a uniform sampling manner or in an unrestricted uniform sampling manner.

[0263] (I) If S51 is performed in a uniform sampling manner, then S51 includes:

[0264] S5101, sampling in [r1, r2] with Δr1 as a step, and detecting the response of the smart electric energy meter at the sampling point; updating [r1, r2] to reduce the interval between r1 and r2 according to whether the smart electric energy meter responds;

[0265] S5102, determining whether Δr1 is not greater than d1;

[0266] If yes, add {r1,r2,q} to R first, then execute S2;

[0267] If not, update Δr1 to a smaller value first, and then execute S5101.

[0268] (ii) If S51 is performed by unrestricted uniform adoption, S51 includes:

[0269] S5111, determine whether r2-r1 is greater than d1;

[0270] If yes, then sampling is performed in [r1, r2] with Δr1 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r1, r2] is updated according to whether the smart electric energy meter responds to reduce the interval between r1 and r2, and Δr1 is updated to a smaller value, and then S5111 is executed;

[0271] If no, execute S5112;

[0272] S5112, first add {r1, r2, q} to R, and then execute S2.

[0273] (III) If S52 is performed by uniform sampling, S52 includes:

[0274] S5201, sampling in [r3, r4] with Δr2 as a step, and detecting the response of the smart electric energy meter at the sampling point; updating [r3, r4] to reduce the interval between r3 and r4 according to whether the smart electric energy meter responds;

[0275] S5202, determining whether Δr2 is not greater than d2;

[0276] If yes, add {q,r3,r4} to R first, then execute S2;

[0277] If not, update Δr2 to a smaller value first, and then execute S5201.

[0278] (IV) If S52 is carried out in an unrestricted uniform manner, then S52 includes:

[0279] S52 includes:

[0280] S5211, determine whether r4-r3 is greater than d2;

[0281] If yes, then sampling is performed in [r3, r4] with Δr2 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r3, r4] is updated according to whether the smart electric energy meter responds to reduce the interval between r3 and r4, and Δr2 is updated to a smaller value, and then S5211 is executed;

[0282] If no, execute S5212;

[0283] S5212, first add {q, r3, r4} to R, and then execute S2.

[0284] The above (i) and (ii) can be performed with reference to S5 in Example 1; the above (iii) and (iv) can be performed with reference to S5 in Example 2.

[0285] S6, characterizes the communication baud rate deviation tolerance of the smart energy meter on q based on the result in R.

[0286] S6 can output or save R to a specified file, making it easy to store and read data.

[0287] Among them, the last R of S6 contains {r1,r2,q,r3,r4};

[0288] r2-r1 and r4-r3 represent the actual deviation of the result. From S5, we can know that r2-r1 must not be greater than d1, and r4-r3 must not be greater than d2.

[0289] Therefore, q-r2 or (q-r2) / q can be used as the communication baud rate deviation tolerance of the smart energy meter in the q downward direction.

[0290] If the value of q-r2 or (q-r2) / q is large, it means that the smart electric energy meter can respond to a larger communication baud rate range downward and has a higher tolerance for communication baud rate deviation in the downward direction; conversely, if the value of q-r2 or (q-r2) / q is small, it means that the smart electric energy meter can respond to a smaller communication baud rate range downward and has a lower tolerance for communication baud rate deviation in the downward direction.

[0291] r3-q or (r3-q) / q can be used as the communication baud rate deviation tolerance of the smart electric energy meter in the q-up direction.

[0292] If the value of r3-q or (r3-q) / q is large, it means that the smart electric energy meter can respond to a larger communication baud rate range and a higher tolerance for upward communication baud rate deviation; conversely, if the value of r3-q or (r3-q) / q is small, it means that the smart electric energy meter can respond to a smaller communication baud rate range and a lower tolerance for upward communication baud rate deviation.

[0293] Of course, r3-r2 or (r3-r2) / q may also be used as the communication baud rate deviation tolerance of the smart energy meter on q.

[0294] If the value of r3-r2 or (r3-r2) / q is large, it means that the smart energy meter can respond to a larger communication baud rate range and a higher tolerance for communication baud rate deviation; conversely, if the value of r3-r2 or (r3-r2) / q is small, it means that the smart energy meter can respond to a smaller communication baud rate range and a lower tolerance for communication baud rate deviation.

[0295] Example 5

[0296] This embodiment 5 discloses a detection device for the communication baud rate deviation tolerance of a smart energy meter, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to implement the steps of the detection method for the communication baud rate deviation tolerance of a smart energy meter disclosed in embodiment 1.

[0297] This embodiment 5 also discloses a readable storage medium, in which computer program instructions are stored. When the computer program instructions are read and executed by a processor, the steps of the method for detecting the communication baud rate deviation tolerance of the smart electric energy meter disclosed in embodiment 1 are executed.

[0298] This embodiment 5 also discloses a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the method for detecting the communication baud rate deviation tolerance of the smart electric energy meter disclosed in embodiment 1 are implemented.

[0299] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for detecting the tolerance of baud rate deviation of smart electric energy meter communication, characterized in that: It includes the following steps: S1, perform global initialization; Among them, S1 includes: Add the communication baud rate to be tested to list Q; Initialize the deviation tolerance measurement result R to an empty set; Initialize the allowable deviation list D according to the detection requirements; Among them, the testing requirements include: requirement one, requirement two, requirement three, and requirement four; Requirement 1 is: only the communication baud rate deviation tolerance of the smart energy meter in the downward direction needs to be detected; Requirement 2 is: only the communication baud rate deviation tolerance of the smart energy meter in the upward direction needs to be detected; Requirement 3: It is necessary to detect the communication baud rate deviation tolerance of the smart energy meter in the upper and lower directions, and the baud rate deviation response characteristics in the upper and lower directions are consistent; Requirement 4 is: it is necessary to detect the communication baud rate deviation tolerance of the smart energy meter in the upper and lower directions, and the baud rate deviation response characteristics in the upper and lower directions are inconsistent; S2, determine whether Q is non-empty; If yes, execute S3; If no, execute S6; S3, take out the first element q in Q as the communication baud rate to be tested in the current round, and reduce the number of elements in Q by 1; Take out the first element in D as the allowable deviation for the current round, and reduce the number of elements in D by 1; S4, initializing corresponding limit parameters and step width according to the communication baud rate to be tested and the detection requirements of the current round; S5, perform the current round limit exploration in combination with the current round allowable deviation to update the limit parameters and step width, and add the corresponding updated results to R, and then execute S2; S6, characterizes the communication baud rate deviation tolerance of the smart energy meter on q based on the result in R.

2. The method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 1, characterized in that: When the detection requirement is requirement 1: In S1, D is: lower limit allowable deviation list D1; In S3, the first element in D is taken as the allowable deviation of the current round, and the number of elements in D is reduced by 1: the first element d1 in D1 is taken as the lower bound allowable deviation of the current round, and the number of elements in D1 is reduced by 1; S4 includes: initializing the communication baud rate lower limit parameters {r1, r2} and step width Δr1 of the current round; Among them, r1 is the lower bound of no response; r2 is the lower bound of response, which is the minimum communication baud rate that the smart energy meter can respond to near q.

3. A method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 2, characterized in that: When the detection requirement is requirement 1: S5 includes: S501, sampling in [r1, r2] with Δr1 as a step, and performing response detection on the smart electric energy meter at the sampling point; updating [r1, r2] to reduce the interval between r1 and r2 according to whether the smart electric energy meter responds; S502, determining whether Δr1 is not greater than d1; If yes, add {r1,r2,q} to R first, then execute S2; If no, then update Δr1 to a smaller value first, and then execute S501; or, S5 includes: S511, determine whether r2-r1 is greater than d1; If yes, then sampling is performed in [r1, r2] with Δr1 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r1, r2] is updated according to whether the smart electric energy meter responds to reduce the interval between r1 and r2, and Δr1 is updated to a smaller value, and then S511 is executed; If not, execute S512; S512, first add {r1, r2, q} to R, and then execute S2; S6 includes: S601, obtain {r1, r2, q} in R; S602, using q-r2 or (q-r2) / q as the communication baud rate deviation tolerance of the smart electric energy meter in the q downward direction.

4. The method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 1, characterized in that: When the detection requirement is requirement 2: In S1, D is the upper limit allowable deviation list D2; In S3, the first element in D is taken as the allowable deviation of the current round, and the number of elements in D is reduced by 1: the first element d2 in D2 is taken as the upper limit allowable deviation of the current round, and the number of elements in D2 is reduced by 1; S4 includes: initializing the communication baud rate upper limit parameters {r3, r4} and step width Δr2 of the current round; Among them, r3 represents the lower limit of response, which is the maximum communication baud rate that the smart energy meter can respond to near q; r4 is the upper limit of non-response.

5. A method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 4, characterized in that: When the detection requirement is requirement 2: S5 includes: S501, sampling in [r3, r4] with Δr2 as a step, and performing response detection on the smart electric energy meter at the sampling point; updating [r3, r4] to reduce the interval between r3 and r4 according to whether the smart electric energy meter responds; S502, determining whether Δr2 is not greater than d2; If yes, add {q,r3,r4} to R first, then execute S2; If no, then update Δr2 to a smaller value first, and then execute S501; or, S5 includes: S511, determine whether r4-r3 is greater than d2; If yes, then sampling is performed in [r3, r4] with Δr2 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r3, r4] is updated according to whether the smart electric energy meter responds to reduce the interval between r3 and r4, and Δr2 is updated to a smaller value, and then S511 is executed; If not, execute S512; S512, first add {q, r3, r4} to R, and then execute S2; S6 includes: S601, obtain {q, r3, r4} in R; S602, taking r3-q or (r3-q) / q as the communication baud rate deviation tolerance of the smart electric energy meter in the q upward direction.

6. A method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 1, characterized in that: When the detection requirement is requirement three: In S1, D is the unified allowable deviation list D0; In S3, the first element in D is taken as the allowable deviation of the current round, and the number of elements in D is reduced by 1: the first element d0 in D0 is taken as the allowable deviation of the current round, and the number of elements in D0 is reduced by 1; S4 includes: initializing the communication baud rate limit parameters {r1, r2, r3, r4} and the step width Δr0 of the current round; Among them, r1 is the lower limit of no response; r2 is the lower limit of response, which is the minimum communication baud rate that the smart energy meter can respond to near q; r3 is the lower limit of response, which is the maximum communication baud rate that the smart energy meter can respond to near q; r4 is the upper limit of no response.

7. A method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 6, characterized in that: When the detection requirement is requirement three: S5 includes: first performing S51, reinitializing Δr0, and then performing S52; Or, first perform S52, reinitialize Δr0, and then perform S51; Among them, S51 includes: S5101, sampling in [r1, r2] with Δr0 as a step, and detecting the response of the smart electric energy meter at the sampling point; updating [r1, r2] to reduce the interval between r1 and r2 according to whether the smart electric energy meter responds; S5102, determining whether Δr0 is not greater than d0; If yes, add {r1,r2,q} to R first, then execute S2; If no, then update Δr0 to a smaller value first, and then execute S5101; Or, S51 includes: S5111, determine whether r2-r1 is greater than d0; If yes, then sampling is performed in [r1, r2] with Δr0 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r1, r2] is updated according to whether the smart electric energy meter responds to reduce the interval between r1 and r2, and Δr0 is updated to a smaller value, and then S5111 is executed; If no, execute S5112; S5112, first add {r1, r2, q} to R, then execute S2; Among them, S52 includes: S5201, sampling in [r3, r4] with Δr0 as a step, and detecting the response of the smart electric energy meter at the sampling point; updating [r3, r4] to reduce the interval between r3 and r4 according to whether the smart electric energy meter responds; S5202, determine whether Δr0 is not greater than d0; If yes, add {q,r3,r4} to R first, then execute S2; If no, then update Δr0 to a smaller value first, and then execute S5201; or, S52 includes: S5211, determine whether r4-r3 is greater than d0; If yes, then sampling is performed in [r3, r4] with Δr0 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r3, r4] is updated according to whether the smart electric energy meter responds to reduce the interval between r3 and r4, and Δr0 is updated to a smaller value, and then S5211 is executed; If no, execute S5212; S5212, first add {q, r3, r4} to R, then execute S2; S6 includes: S601, obtain {r1, r2, q, r3, r4} in R; S602, using q-r2 or (q-r2) / q as the communication baud rate deviation tolerance of the smart electric energy meter in the q-down direction, and using r3-q or (r3-q) / q as the communication baud rate deviation tolerance of the smart electric energy meter in the q-up direction; Or / and, r3-r2 or (r3-r2) / q is used as the communication baud rate deviation tolerance of the smart electric energy meter on q.

8. A method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 2, characterized in that: When the detection requirement is requirement four: D in S1 includes: a lower limit allowable deviation list D1 and an upper limit allowable deviation list D2; In S3, the first element in D is taken as the allowable deviation of the current round, and the number of elements in D is reduced by 1: the first element d1 in D1 is taken as the lower bound allowable deviation of the current round, and the number of elements in D1 is reduced by 1; Take out the first element d2 in D2 as the upper limit allowable deviation of the current round, and reduce the number of elements in D2 by 1; S4 includes: initializing the communication baud rate limit parameters {r1, r2, r3, r4}, step width Δr1, and step width Δr2 of the current round; Among them, r1 is the lower limit of no response; r2 is the lower limit of response, which is the minimum communication baud rate that the smart energy meter can respond to near q; r3 is the lower limit of response, which is the maximum communication baud rate that the smart energy meter can respond to near q; r4 is the upper limit of no response.

9. A method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to claim 8, characterized in that: When the detection requirement is requirement four: S5 includes: performing S51 and S52; Among them, S51 includes: S5101, sampling is performed in [r1, r2] with a step of Δr1, and a response detection of the smart electric energy meter is performed at the sampling point; and [r1, r2] is updated according to whether the smart electric energy meter responds to reduce the interval between r1 and r2; S5102, determining whether Δr1 is not greater than d1; If yes, add {r1,r2,q} to R first, then execute S2; If no, then update Δr1 to a smaller value first, and then execute S5101; Or, S51 includes: S5111, determine whether r2-r1 is greater than d1; If yes, then sampling is performed in [r1, r2] with Δr1 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r1, r2] is updated according to whether the smart electric energy meter responds to reduce the interval between r1 and r2, and Δr1 is updated to a smaller value, and then S5111 is executed; If no, execute S5112; S5112, first add {r1, r2, q} to R, then execute S2; Among them, S52 includes: S5201, sampling in [r3, r4] with Δr2 as a step, and detecting the response of the smart electric energy meter at the sampling point; updating [r3, r4] to reduce the interval between r3 and r4 according to whether the smart electric energy meter responds; S5202, determining whether Δr2 is not greater than d2; If yes, add {q,r3,r4} to R first, then execute S2; If no, then update Δr2 to a smaller value first, and then execute S5201; or, S52 includes: S5211, determine whether r4-r3 is greater than d2; If yes, then sampling is performed in [r3, r4] with Δr2 as a step, and the response detection of the smart electric energy meter is performed at the sampling point; [r3, r4] is updated according to whether the smart electric energy meter responds to reduce the interval between r3 and r4, and Δr2 is updated to a smaller value, and then S5211 is executed; If no, execute S5212; S5212, first add {q, r3, r4} to R, then execute S2; S6 includes: S601, obtain {r1, r2, q, r3, r4} in R; S602, using q-r2 or (q-r2) / q as the communication baud rate deviation tolerance of the smart electric energy meter in the q-down direction, and using r3-q or (r3-q) / q as the communication baud rate deviation tolerance of the smart electric energy meter in the q-up direction; Or / and, r3-r2 or (r3-r2) / q is used as the communication baud rate deviation tolerance of the smart electric energy meter on q.

10. A detection device for the communication baud rate deviation tolerance of a smart electric energy meter, characterized in that: The invention comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to execute the steps of the method for detecting the communication baud rate deviation tolerance of a smart electric energy meter according to any one of claims 1 to 9.