Electric energy meter calibration tool based on low-power-consumption Bluetooth communication and meter calibration method thereof
Technical Field
The invention relates to the field of power equipment, in particular to an electric energy meter calibration tool based on low-power-consumption Bluetooth communication and a meter calibration method thereof.
Background
After the electric energy meters are produced and assembled, the electric energy meters need to be calibrated, so that the consistency of the delivery performance of each electric energy meter is ensured. In the traditional electric energy meter calibration process, meter calibration equipment reads information of the electric energy meter or sends meter calibration instructions through long-distance 485 communication or HPLC (high performance liquid chromatography) communication. The two meter calibrating devices and methods respectively have the following disadvantages: (1) when the electric energy meter is calibrated in a 485 communication connection mode, a large number of electric energy meter products are generally required to be simultaneously corrected in the meter calibrating process, a long 485 communication line may be required in the process, and transmission errors and reading incapability may be caused if the 485 communication line is too long, so that the success rate of correction of the electric energy meter is influenced. (2) When the connection mode of HPLC communication is adopted for meter calibration, the work efficiency in the meter calibration process is greatly reduced due to the influence of the slow HPLC communication rate. The two modes have limitations in a calibration application scene requiring high speed and high concurrency, and the speed of product production or research and development is greatly reduced.
At present, no calibration tool which is free of wiring, can automatically realize pairing and link distinguishing, does not change the existing intelligent electric energy meter protocol, and can process high-speed and high-concurrency is available. Therefore, the process of performing stable and high-speed meter calibration and reading on the electric energy meter cannot be realized at present.
Disclosure of Invention
The invention provides an electric energy meter calibration tool based on low-power-consumption Bluetooth communication and a meter calibration method thereof, aiming at solving the technical problems that high-speed and high-concurrency meter calibration and meter reading of an electric energy meter are difficult to realize in the prior art.
The invention is realized by adopting the following technical scheme:
the utility model provides an electric energy meter school table frock based on bluetooth low energy communication, this school table frock includes: the Bluetooth module comprises a Bluetooth master module, a plurality of Bluetooth transparent transmission slave modules, a master control unit, a first storage module and a second storage module.
The Bluetooth main module is connected with a computer terminal running meter calibration software and used for sending a meter calibration instruction generated by the meter calibration software; the Bluetooth master module is also connected with the plurality of Bluetooth transparent transmission slave modules in a pairing mode to form a plurality of data or instruction transmission links.
The number of the Bluetooth transparent transmission slave modules is not less than the number of the electric energy meters of a plurality of meters to be calibrated which are simultaneously carried out in each round.
The master control unit is in bidirectional communication connection with the electric energy meters of all the meters to be calibrated through one communication module and is electrically connected with the plurality of Bluetooth transparent transmission slave modules; the master control unit respectively establishes a one-to-one corresponding data transmission link for each Bluetooth transparent transmission slave module and the electric energy meter of the meter to be calibrated.
The first storage module is electrically connected with the Bluetooth main module; the first storage module is used for storing a MAC address table containing MAC addresses of all the Bluetooth transparent transmission slave modules.
The second storage module is electrically connected with the Bluetooth main module; the second storage module is used for storing each round of meter calibration process, and a link binding comparison table is formed between the meter address of each electric energy meter to be calibrated and the corresponding Bluetooth transparent transmission slave module.
The meter calibrating process of the meter calibrating tool is as follows:
one, Bluetooth matching butt joint
Each Bluetooth transparent transmission slave module starts a broadcast state, and the Bluetooth master module acquires an MAC address table in the first storage module and searches for the Bluetooth transparent transmission slave module in the broadcast state; then comparing the MAC address of the Bluetooth transparent transmission slave module in the broadcasting state with the address in the MAC address table, and connecting when the MAC address and the MAC address are consistent to finish the matching butt joint of the Bluetooth master module and each Bluetooth transparent transmission slave module;
second, data link establishment
The master control unit distributes a Bluetooth transparent transmission sub-module for each connected electric energy meter of the meter to be calibrated; then the main control unit sends a meter address reading instruction to each electric energy meter through the communication module, and when the meter address reading success rate of the corresponding electric energy meter reaches a preset index, the connection state of the Bluetooth transparent transmission submodule distributed by the electric energy meter and the Bluetooth main module is kept continuously, otherwise, the connection state of the Bluetooth transparent transmission submodule distributed by the electric energy meter and the Bluetooth main module is disconnected;
table address binding
The Bluetooth master module sends an instruction for reading the meter address of each electric energy meter to the master control unit through different Bluetooth transparent transmission slave modules in a connection state; the main control unit reads the electric energy meter through the communication module after receiving the instruction; after receiving the corresponding table address fed back by the master control unit, the Bluetooth master module stores the binding relationship between the table address of the electric energy meter and the corresponding Bluetooth transparent transmission slave module in the second storage module to form a link relationship distribution table;
four, multi-way concurrent school meter
The Bluetooth main module acquires meter calibration control instructions sent by meter calibration software to each electric energy meter, and then inquires a link relation distribution meter in the second storage module; and then, sending the meter calibration control instruction to the corresponding electric energy meter along a path of 'the Bluetooth master module-the Bluetooth transparent transmission slave module-the master control unit-the communication module-the electric energy meter' according to the corresponding data transmission link, and finishing various operations of the electric energy meter calibration process after the electric energy meter receives the corresponding meter calibration control instruction.
Furthermore, the main control unit is also electrically connected with the indicator light module; the number of the indicator lamps is the same as that of the bluetooth transparent transmission slave modules in the meter calibrating tool, and a one-to-one correspondence relationship is established between the indicator lamps and the bluetooth transparent transmission slave modules; the master control unit sends a control instruction to the indicator light module, and sends a first indication signal according to the condition of successful docking when each Bluetooth transparent transmission slave module is in matched docking with the Bluetooth master module; and when the master control unit copies the meter addresses of the electric energy meters, sending a second indicating signal according to the condition of whether the copying can be successful or not.
Further, 485 communication modules are selected as communication modules for communication connection between the main control unit and each electric energy meter.
Furthermore, the number of the electric energy meters of the meter to be calibrated, which are connected with each main control unit through the 485 communication module, is not less than eight; the number of the electric energy meter connecting stations and the number of the Bluetooth transparent transmission slave modules in each meter calibrating tool are not less than eight.
Further, the first storage module selects a nonvolatile memory; the second storage module selects a random access memory.
Furthermore, the universal unique identification code of the broadcasting and transceiving service in the Bluetooth transparent transmission slave module is consistent with the universal unique identification code of the broadcasting and transceiving service in a national grid power system applied to the electric energy meter.
Further, in the Bluetooth matching and docking process, the Bluetooth master module continuously conducts active scanning until the number of the Bluetooth pass-through slave modules connected with the Bluetooth master module reaches the maximum number of the Bluetooth pass-through slave modules installed in the meter calibrating tool.
Furthermore, in the process of establishing the data link, the number of times that the master control unit sends the meter address reading instruction to each electric energy meter is not less than three, and when the number of times of reading is not less than two successfully, the electric energy meter of the installation station is determined to be normally in communication connection with the master control unit.
The invention also comprises a meter calibrating method of the electric energy meter calibrating tool based on the low-power Bluetooth communication, which is applied to the electric energy meter calibrating tool based on the low-power Bluetooth communication, and the meter calibrating method comprises the following steps:
s1: the electric energy meter establishes bidirectional communication connection with the main control unit through the 485 communication module on each meter calibration station;
s2: the master control unit, the 485 communication module and the Bluetooth transparent transmission slave module are powered on, and the Bluetooth transparent transmission slave module starts broadcasting and waits for connection;
s3: the Bluetooth master module is powered on, the Bluetooth master module scans and matches the Bluetooth transparent transmission slave module in a broadcast state, and the scanning and matching connection process is as follows:
s31: the Bluetooth main module acquires an MAC address table in a first storage module;
s32: the Bluetooth master module scans the Bluetooth transparent transmission slave module in a broadcasting state and acquires an MAC address of the Bluetooth transparent transmission slave module;
s33: the Bluetooth master module compares the MAC address of the Bluetooth transparent transmission slave module in the broadcast state with the address in the MAC address table preset in the first storage module in sequence, judges whether the MAC addresses are the same or not, and makes the following decision:
(1) when the addresses of the Bluetooth master module and the Bluetooth pass-through slave module are consistent, the Bluetooth master module is connected with the corresponding Bluetooth pass-through slave module;
(2) when the addresses of the Bluetooth master module and the Bluetooth pass-through slave module are inconsistent, the Bluetooth master module is not connected with the corresponding Bluetooth pass-through slave module;
s34: the Bluetooth master module compares the number N of the Bluetooth transparent transmission slave modules in the connection state with the maximum number N of the Bluetooth transparent transmission slave modules of the meter calibrating tool, determines the relationship between the two and makes the following decision:
(1) when N is less than N, the Bluetooth main module continues to repeatedly execute the scanning process of the step S32;
(2) when N is equal to N, the Bluetooth main module finishes the scanning and matching docking process;
s4: the master control unit distributes a Bluetooth transparent transmission slave module for each electric energy meter connected through the 485 communication module; then, continuously and repeatedly sending a meter reading instruction to each electric energy meter through the 485 communication module, and making the following decision according to the reading success rate:
(1) when the meter address copying success rate of a certain electric energy meter reaches a preset copying success rate, the connection state of the Bluetooth transparent transmission slave module corresponding to the electric energy meter and the Bluetooth master module is kept;
(2) when the meter address copying success rate of a certain electric energy meter does not reach the preset copying success rate, disconnecting the connection state of the Bluetooth transparent transmission slave module and the Bluetooth master module corresponding to the electric energy meter;
s5: the Bluetooth master module sends a meter reading instruction to the corresponding electric energy meter through the Bluetooth slave module in a connection state, and after receiving corresponding feedback, writes the binding relationship between the meter address and the corresponding Bluetooth transparent transmission slave module into the second storage module to form a link relationship distribution table;
s6: and the meter calibration software operates, the Bluetooth main module acquires the link relation distribution meter in the second storage module, and then sends corresponding meter calibration instructions to be executed by the electric energy meters of all the meters to be calibrated to the electric energy meters along corresponding paths, and the electric energy meters complete corresponding meter calibration processes according to the meter calibration instructions.
Further, in step S33, the main control unit controls the corresponding indicator light to send a first indicator signal according to the connection status of the bluetooth master module and the bluetooth transparent transmission slave module;
in step S4, the main control unit controls the corresponding indicator light to send out a second indicator signal according to whether the electric energy meter can reach the preset meter address reading success rate.
The electric energy meter calibration tool and the electric energy meter calibration method based on the low-power-consumption Bluetooth communication have the following beneficial effects that:
the method adopts a master multi-slave Bluetooth communication module to establish a communication link for data and instruction transmission between the electric energy meter of the meter to be calibrated and the terminal for sending the meter calibrating instruction. Therefore, the Bluetooth module is wirelessly connected, the signal transmission distance is long, the signal transmission speed is high, and meanwhile, the characteristic of multi-object concurrent transmission can be realized. Various defects in the traditional meter calibrating equipment are overcome.
In the meter calibrating tool, the electric energy meters on all stations are connected with the main control unit through the 485 communication module through cables, and the 485 communication module is only used in the meter calibrating tool, so that a longer cable is not needed, and the stability and the accuracy of signal transmission of the communication module can be ensured. And the terminal of the meter calibrating software is connected with each electric energy meter by Bluetooth, so that not only can high-concurrency meter calibrating signal transmission be realized, but also the defect of low HPLC communication transmission rate can be overcome, and high-speed meter calibration can be realized.
The type school table frock still has the commonality strong, characteristics that degree of automation is high. The tool can be suitable for calibrating and testing various intelligent electric energy meters under the existing protocol, and the 485 communication interface of the electric energy meter and the 485 communication module on the main control unit of the tool are connected through cables in the process of calibrating or testing. After connection is completed and the meter calibration tool is powered on, the equipment can automatically carry out module butt joint, communication link distribution and binding, and corresponding meter calibration instructions are executed.
Drawings
Fig. 1 is a schematic block diagram of an electric energy meter calibration tool based on bluetooth low energy communication in embodiment 1 of the present invention;
fig. 2 is a schematic block diagram of an electric energy meter calibration tool based on bluetooth low energy communication in embodiment 2 of the present invention;
fig. 3 is a schematic view of a simulation interface of an electric energy meter calibration tool based on bluetooth low energy communication in embodiment 2 of the present invention;
fig. 4 is a flowchart of a meter calibrating method for an electric energy meter calibrating tool based on bluetooth low energy communication in embodiment 3 of the present invention;
labeled as:
1. a Bluetooth main module; 2. the Bluetooth transparent transmission slave module; 3. a main control unit; 4. a 485 communication module; 5. an indicator light; 6. a first storage module; 7. and a second storage module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Example 1
As shown in FIG. 1, this implementation provides an electric energy meter school table frock based on bluetooth low energy communication, and this school table frock includes: the Bluetooth communication system comprises a Bluetooth main module 1, a plurality of Bluetooth transparent transmission slave modules 2, a main control unit 3, a first storage module 6 and a second storage module 7.
The Bluetooth main module 1 is connected with a computer terminal for running meter calibration software and is used for sending a meter calibration instruction generated by the meter calibration software; the bluetooth master module 1 is also connected with the plurality of bluetooth transparent transmission slave modules 2 in a pairing manner to form a plurality of data or instruction transmission links.
The number of the Bluetooth transparent transmission slave module 2 is not less than the number of the electric energy meters of a plurality of meters to be calibrated which are simultaneously carried out in each round.
The master control unit 3 is in bidirectional communication connection with the electric energy meters of all the meters to be calibrated through one communication module and is electrically connected with the plurality of Bluetooth transparent transmission slave modules 2; the master control unit 3 establishes a one-to-one corresponding data transmission link for each Bluetooth transparent transmission slave module 2 and the electric energy meter of the meter to be calibrated respectively.
The first storage module 6 is electrically connected with the Bluetooth main module 1; the first storage module 6 is used for storing a MAC address table containing MAC addresses of the Bluetooth pass-through slave modules 2.
The second storage module 7 is electrically connected with the Bluetooth main module 1; the second storage module 7 is used for storing each round of meter calibration process, and a link binding comparison table is formed between the meter address of each electric energy meter to be calibrated and the corresponding Bluetooth transparent transmission slave module 2.
The meter calibrating process of the meter calibrating tool is as follows:
one, Bluetooth matching butt joint
Each Bluetooth transparent transmission slave module 2 starts a broadcast state, the Bluetooth master module 1 acquires an MAC address table in the first storage module 6 and searches the Bluetooth transparent transmission slave module 2 in the broadcast state; then comparing the MAC address of the Bluetooth transparent transmission slave module 2 in the broadcasting state with the address in the MAC address table, and connecting when the MAC address and the MAC address are consistent to finish the matching butt joint of the Bluetooth master module 1 and each Bluetooth transparent transmission slave module 2;
second, data link establishment
The main control unit 3 allocates a Bluetooth transparent transmission sub-module for each connected electric energy meter of the meter to be calibrated; then, the main control unit 3 sends a meter address reading instruction to each electric energy meter through the communication module, and when the meter address reading success rate of the corresponding electric energy meter reaches a preset index, the connection state of the Bluetooth transparent transmission submodule distributed by the electric energy meter and the Bluetooth main module 1 is kept continuously, otherwise, the connection state of the Bluetooth transparent transmission submodule distributed by the electric energy meter and the Bluetooth main module 1 is disconnected;
table address binding
The Bluetooth master module 1 sends an instruction for reading the meter address of each electric energy meter to the master control unit 3 through different Bluetooth transparent transmission slave modules 2 in a connection state; the main control unit 3 reads the electric energy meter through the communication module after receiving the instruction; after receiving the corresponding table address fed back by the master control unit 3, the bluetooth master module 1 stores the binding relationship between the table address of the electric energy meter and the corresponding bluetooth transparent transmission slave module 2 in the second storage module 7 to form a link relationship distribution table;
four, multi-way concurrent school meter
The Bluetooth main module 1 acquires meter calibration control instructions sent by meter calibration software to each electric energy meter, and then inquires a link relation distribution table in the second storage module 7; and then, sending the meter calibration control instruction to the corresponding electric energy meter along a path of 'the Bluetooth master module 1-the Bluetooth transparent transmission slave module 2-the master control unit 3-the communication module-the electric energy meter' according to the corresponding data transmission link, and finishing each operation of the electric energy meter calibration process after the electric energy meter receives the corresponding meter calibration control instruction.
The 485 communication module 4 is selected as the communication module for communication connection between the main control unit 3 and each electric energy meter. 485 communication interfaces are reserved in intelligent electric energy meters of various types, and the 485 communication modules 4 are used for connection, so that the meter calibration tool can be suitable for almost all meter calibration tasks of the intelligent electric energy meters.
The number of the electric energy meters of the meter to be calibrated, which are connected with each main control unit 3 through the 485 communication module 4, is eight; the electric energy meter connection stations and the Bluetooth transparent transmission slave modules 2 in each meter calibrating tool are eight in number.
In this embodiment, the first storage module 6 selects a nonvolatile memory, which is a Flash memory; because the bluetooth transparent transmission slave module 2 to be docked always maintains the same group in each bluetooth master-slave module matching and docking process, the MAC address table stored in the corresponding first storage module 6 should be fixed, and it is ensured that the MAC address table should be always stored in the first storage module 6 after each round of table calibration is completed and the device is powered on again, which is convenient for comparison. Therefore, in this embodiment, the memory storing the MAC address table selects the Flash memory of the nonvolatile line.
Correspondingly, when communication links are bound in each round of electric energy meter calibration process, the binding relationship between the meter address of each electric energy meter and the bluetooth transparent transmission slave module 2 is changed, so that when the meter calibration is completed each time and the device is powered on again, the link relationship distribution table stored in the second memory needs to be reestablished and refreshed, therefore, in the implementation, a random storage memory is selected for the second storage module 7, and because the link relationship distribution table stored after the device is powered on needs to be constantly maintained in each round of meter calibration process, refreshing is not needed, so that a Static Random Access Memory (SRAM) is selected here.
Further, the universal unique identification code of the broadcasting and transceiving service in the bluetooth transparent transmission slave module 2 is consistent with the universal unique identification code of the broadcasting and transceiving service in the national grid power system applied to the electric energy meter. Therefore, later-stage universality of the meter calibrating tool can be ensured.
In the process of Bluetooth matching and docking, the Bluetooth master module 1 continuously conducts active scanning until the number of the Bluetooth pass-through slave modules 2 connected with the Bluetooth master module 1 reaches the maximum number of the Bluetooth pass-through slave modules 2 installed in the meter calibrating tool.
In the process of establishing the data link, the number of times that the main control unit 3 sends the meter address reading instruction to each electric energy meter is not less than three, and when the number of times of reading is not less than two successfully, the electric energy meter of the installation station is determined to be in normal communication connection with the main control unit 3. The state of the communication connection relation is determined by adopting a three-time repeated reading mode, so that the connection state fault caused by unstable connection relation can be eliminated, and the signal transmission stability of the equipment in the later meter correcting process is guaranteed.
Example 2
As shown in fig. 2 and 3, the present embodiment is different from embodiment 1 in that: in this embodiment, the main control unit 3 is further electrically connected with the indicator lamp 5 module; the number of the indicator lamps 5 is the same as that of the bluetooth transparent transmission slave modules 2 in the meter calibrating tool, and a one-to-one correspondence relationship is established between the indicator lamps and the bluetooth transparent transmission slave modules; the master control unit 3 sends a control instruction to the indicator lamp 5 module, and sends a first indication signal according to the successful docking condition when each Bluetooth transparent transmission slave module 2 is in matched docking with the Bluetooth master module 1; and when the master control unit 3 copies the meter addresses of the electric energy meters, a second indication signal is sent out according to the condition of whether the copying can be successful or not.
The indicator lamp 5 is adopted to facilitate the matching and butt joint of the Bluetooth master module and the Bluetooth slave module and the later communication link distribution process, and intuitively indicate the connection state between each Bluetooth module and other modules and the connection state between the electric energy meter and other modules. Therefore, when communication faults occur to equipment operators, the connection ports can be overhauled and cleared in a targeted mode, or the electric energy meters which cannot be calibrated can be found out from products for subsequent processing. The accuracy of using the meter calibrating tool to calibrate the meter is improved, and the working efficiency of the meter calibrating process is improved.
Example 3
As shown in fig. 4, this embodiment provides a meter calibrating method for an electric energy meter calibrating tool based on bluetooth low energy communication, where the method is applied to the electric energy meter calibrating tool based on bluetooth low energy communication in embodiment 2, and the meter calibrating method includes the following steps:
s1: the electric energy meter establishes bidirectional communication connection with the main control unit 3 through the 485 communication module 4 on each meter calibration station;
s2: the master control unit 3, the 485 communication module 4 and the Bluetooth transparent transmission slave module 2 are powered on, and the Bluetooth transparent transmission slave module 2 starts broadcasting and waits for connection;
s3: the Bluetooth master module 1 is powered on, the Bluetooth master module 1 scans and matches the Bluetooth transparent transmission slave module 2 in a broadcast state, and the scanning and matching connection process is as follows:
s31: the bluetooth main module 1 acquires an MAC address table in a first storage module 6;
s32: the Bluetooth master module 1 scans the Bluetooth transparent transmission slave module 2 in a broadcasting state and acquires an MAC address of the Bluetooth transparent transmission slave module;
s33: the bluetooth master module 1 compares the MAC address of the bluetooth transparent transmission slave module 2 in the broadcast state with the address in the MAC address table preset in the first storage module 6 in sequence, determines whether the MAC addresses are the same, and makes the following decision:
(1) when the addresses of the two modules are consistent, the Bluetooth master module 1 is connected with the corresponding Bluetooth transparent transmission slave module 2;
(2) when the addresses of the two modules are not consistent, the Bluetooth master module 1 is not connected with the corresponding Bluetooth transparent transmission slave module 2;
s34: the bluetooth master module 1 compares the number N of the bluetooth transparent transmission slave modules 2 in the connection state with the maximum number N of the bluetooth transparent transmission slave modules 2 of the meter calibrating tool, determines the relationship between the two and makes the following decision:
(1) when N is less than N, the bluetooth master module 1 continues to repeatedly perform the scanning process of step S32;
(2) when N is equal to N, the bluetooth main module 1 ends the scanning and matching docking process;
s4: the master control unit 3 allocates a Bluetooth transparent transmission slave module 2 to each electric energy meter connected through the 485 communication module 4; then, continuously and repeatedly sending a meter reading address instruction to each electric energy meter through the 485 communication module 4, and making the following decision according to the reading success rate:
(1) when the meter address copying success rate of a certain electric energy meter reaches a preset copying success rate, the connection state of the Bluetooth transparent transmission slave module 2 corresponding to the electric energy meter and the Bluetooth master module 1 is kept;
(2) when the meter address copying success rate of a certain electric energy meter does not reach the preset copying success rate, disconnecting the connection state of the Bluetooth transparent transmission slave module 2 corresponding to the electric energy meter and the Bluetooth master module 1;
s5: the Bluetooth master module 1 sends a meter reading instruction to the corresponding electric energy meter through the Bluetooth slave module in a connection state, and writes the binding relationship between the meter address and the corresponding Bluetooth transparent transmission slave module 2 into the second storage module 7 after receiving corresponding feedback to form a link relationship distribution table;
s6: and the meter calibration software operates, the Bluetooth main module 1 acquires the link relation distribution meter in the second storage module 7, then sends corresponding meter calibration instructions to be executed by the electric energy meters of all the meters to be calibrated to the electric energy meters along corresponding paths, and the electric energy meters complete corresponding meter calibration processes according to the meter calibration instructions.
In the step S33, the main control unit 3 controls the corresponding indicator lamp 5 to send a first indicator signal according to the connection status of the bluetooth master module 1 and the bluetooth transparent transmission slave module 2;
in step S4, the main control unit 3 controls the corresponding indicator lamp 5 to send a second indicator signal according to whether the electric energy meter can reach the preset meter address reading success rate.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.