Bluetooth heartbeat detection method and system for electric energy meter and acquisition terminal, and medium
By regularly checking the heartbeat status of the Bluetooth module and handling faults based on the response results, the problem of the smart power meter not detecting the damage to the Bluetooth module in time is solved, ensuring the normal operation of the metering and communication functions.
Patent Information
- Application Number
- CN202411988940.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-16
AI Technical Summary
When using Bluetooth modules, the smart power meter cannot detect damage in time, resulting in malfunctions and affecting the metering and communication functions.
By setting the time interval between the time and week, checking the heartbeat status information of the Bluetooth module, recording the number of query times, and determining the module failure based on the response results, and temporarily or permanently shutting down the module working power.
Ensure that even if the Bluetooth module is damaged, it will not affect the normal operation of the metering and communication functions of the power meter and acquisition terminal, and improve the reliability and stability of the system.
Smart Images

Figure CN120018182A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of heartbeat detection technology, and in particular to a Bluetooth heartbeat detection method, system and medium for an electric energy meter and a collection terminal. Background Art
[0002] When the Bluetooth module is used in smart meters and data collection terminals, the smart electricity meter cannot promptly know the damage of the Bluetooth module, which will cause the smart meter to work abnormally and lead to malfunction. It is difficult to promptly judge and handle the abnormal status of the Bluetooth module, affecting the metering and communication functions of the electricity meter and the data collection terminal. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a Bluetooth heartbeat detection method, system and medium for an electric energy meter and a collection terminal. By querying the heartbeat, the Bluetooth working power supply without a Bluetooth heartbeat is promptly shut down to ensure that even if the Bluetooth module is damaged on site, it will not affect the normal operation of the metering and communication of the electric energy meter and the collection terminal.
[0004] The embodiment of the present application also provides a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal, comprising:
[0005] Set a time period, query the heartbeat status information of the Bluetooth module based on the set time period interval, record the number of queries, and obtain the response result of the Bluetooth module;
[0006] Set the query limit number N. If the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module and query the heartbeat status information of the Bluetooth module N times again;
[0007] If the query times reach 2N times, the Bluetooth module is judged to be faulty and the power supply of the Bluetooth module is temporarily turned off;
[0008] Set the daily startup time, periodically turn on the temporarily shut down Bluetooth module power supply, and analyze whether the Bluetooth module is faulty based on the obtained Bluetooth module response results;
[0009] If there is a fault, the working power of the Bluetooth module will be permanently turned off, and fault data will be generated and transmitted to the terminal in real time;
[0010] If no fault exists, clear the previous fault and reset the query count.
[0011] Optionally, in the Bluetooth heartbeat detection method for the electric energy meter and the collection terminal described in the embodiment of the present application, a time period is set, and the heartbeat status information of the Bluetooth module is queried based on the set time period interval, specifically including:
[0012] Turn on the working power of the Bluetooth module and analyze the working power connection status;
[0013] If the power connection status is displayed as successful, obtain the Bluetooth request configuration parameter information, and send the Bluetooth request configuration parameter information to the Bluetooth module;
[0014] Analyze whether the Bluetooth module receives Bluetooth request configuration parameter information within a set time, where the set time is 3S;
[0015] If no Bluetooth request configuration parameter information is received within the set time, the heartbeat status information of the Bluetooth module is queried at a set time period interval, and the set time period is 10 minutes;
[0016] If the Bluetooth request configuration parameter information is received within the set time, the Bluetooth module is initialized and configured based on the Bluetooth request configuration parameter information.
[0017] Optionally, in the Bluetooth heartbeat detection method for the electric energy meter and the collection terminal described in the embodiment of the present application, a query limit number N is set. If the query number reaches the query limit number N and the Bluetooth module does not respond, the Bluetooth module is reset, and the heartbeat status information of the Bluetooth module is queried N times, specifically including:
[0018] Set the query limit number N = 3 times. Each time Bluetooth is activated to request configuration parameter information, a query record is generated to obtain the query number.
[0019] When the query times are equal to 3, analyze the response status and response times of the Bluetooth module in the three query records;
[0020] If the number of responses of the Bluetooth module in the three query records is zero, the reset instruction is initiated, and the Bluetooth module is reset based on the reset instruction;
[0021] After the reset is completed, the heartbeat status information of the Bluetooth module is queried again.
[0022] Optionally, in the Bluetooth heartbeat detection method for the electric energy meter and the collection terminal described in the embodiment of the present application, a daily startup time is set, the temporarily closed Bluetooth module working power is periodically turned on, and whether the Bluetooth module is faulty is analyzed according to the obtained Bluetooth module response result, specifically including:
[0023] Set the daily startup time, which is from 4 am to 8 am;
[0024] Get the current time point. If the current time point reaches the daily startup time, generate a startup program.
[0025] Trial start of the temporarily shut down Bluetooth module working power supply based on the startup program, and acquisition of status information of the Bluetooth module working power supply;
[0026] Analyze whether the working power supply of the Bluetooth module is started successfully based on the status information of the working power supply of the Bluetooth module;
[0027] If the startup is successful, the Bluetooth module response result is obtained to analyze whether the Bluetooth module has a fault;
[0028] If the startup fails, the current time point is monitored in real time, and the startup program is triggered again when the next daily startup time is reached.
[0029] Optionally, in the Bluetooth heartbeat detection method for the electric energy meter and the data collection terminal described in the embodiment of the present application, after permanently turning off the working power of the Bluetooth module, the method further includes:
[0030] Analyze the fault status information of the Bluetooth module based on the response result of the Bluetooth module;
[0031] If there is a fault, the working power of the Bluetooth module is permanently turned off to obtain the shutdown status information;
[0032] Analyze the fault status information and shutdown status information of the Bluetooth module;
[0033] If the Bluetooth module fails and is in a state where the working power of the Bluetooth module is permanently turned off, the Bluetooth module is re-powered on and the heartbeat status information of the Bluetooth module is analyzed. If a Bluetooth working mode switching command is received during the re-power-on detection, no response is executed;
[0034] If the Bluetooth module fails and the power of the Bluetooth module is not permanently turned off based on the shutdown status information analysis, if a Bluetooth working mode switching command is received, an abnormal response is returned without re-detecting the abnormal status.
[0035] Optionally, in the Bluetooth heartbeat detection method for the electric energy meter and the collection terminal described in the embodiment of the present application, clearing the previously occurred fault and resetting the query times specifically includes:
[0036] Get the number of Bluetooth module queries;
[0037] Compare the query times with the query limit times to analyze whether the Bluetooth module is temporarily shut down. If so, a temporary fault is obtained.
[0038] Obtain the response result of the Bluetooth module, and analyze whether the Bluetooth module is faulty based on the response result;
[0039] When there is no fault, the clear command is started, the temporary fault data is erased based on the clear command, and the query times are cleared.
[0040] In a second aspect, an embodiment of the present application provides a Bluetooth heartbeat detection system for an electric energy meter and a collection terminal, the system comprising: a memory and a processor, the memory comprising a program of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal, and the program of the Bluetooth heartbeat detection method for an electric energy meter and a collection terminal implements the following steps when executed by the processor:
[0041] Set a time period, query the heartbeat status information of the Bluetooth module based on the set time period interval, record the number of queries, and obtain the response result of the Bluetooth module;
[0042] Set the query limit number N. If the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module and query the heartbeat status information of the Bluetooth module N times again;
[0043] If the query times reach 2N times, the Bluetooth module is judged to be faulty and the working power of the Bluetooth module is temporarily turned off;
[0044] Set the daily startup time, periodically turn on the temporarily shut down Bluetooth module power supply, and analyze whether the Bluetooth module is faulty based on the obtained Bluetooth module response results;
[0045] If there is a fault, the working power of the Bluetooth module will be permanently turned off, and fault data will be generated and transmitted to the terminal in real time;
[0046] If no fault exists, clear the previous fault and reset the query count.
[0047] Optionally, in the Bluetooth heartbeat detection system for the electric energy meter and the collection terminal described in the embodiment of the present application, setting a time period, and querying the heartbeat status information of the Bluetooth module based on the set time period interval specifically includes:
[0048] Turn on the working power of the Bluetooth module and analyze the working power connection status;
[0049] If the power connection status is displayed as successful, obtain the Bluetooth request configuration parameter information, and send the Bluetooth request configuration parameter information to the Bluetooth module;
[0050] Analyze whether the Bluetooth module receives Bluetooth request configuration parameter information within a set time, wherein the set time is 3S;
[0051] If no Bluetooth request configuration parameter information is received within the set time, the heartbeat status information of the Bluetooth module is queried at a set time period interval, and the set time period is 10 minutes;
[0052] If the Bluetooth request configuration parameter information is received within the set time, the Bluetooth module is initialized and configured based on the Bluetooth request configuration parameter information.
[0053] Optionally, in the Bluetooth heartbeat detection system for the electric energy meter and the collection terminal described in the embodiment of the present application, a query limit number N is set. If the query number reaches the query limit number N and the Bluetooth module does not respond, the Bluetooth module is reset, and the heartbeat status information of the Bluetooth module is queried N times, specifically including:
[0054] Set the query limit number N = 3 times. Each time Bluetooth is activated to request configuration parameter information, a query record is generated to obtain the query number.
[0055] When the query times are equal to 3, analyze the response status and response times of the Bluetooth module in the three query records;
[0056] If the number of responses of the Bluetooth module in the three query records is zero, the reset instruction is initiated, and the Bluetooth module is reset based on the reset instruction;
[0057] After the reset is completed, the heartbeat status information of the Bluetooth module is queried again.
[0058] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a Bluetooth heartbeat detection method program for an electric energy meter and a collection terminal. When the Bluetooth heartbeat detection method program for an electric energy meter and a collection terminal is executed by a processor, the steps of the Bluetooth heartbeat detection method for an electric energy meter and a collection terminal as described in any one of the above items are implemented.
[0059] As can be seen from the above, the embodiment of the present application provides a Bluetooth heartbeat detection method, system and medium for an electric energy meter and a collection terminal. By setting a time period, the heartbeat status information of the Bluetooth module is queried based on the set time period interval, the number of queries is recorded, and the response result of the Bluetooth module is obtained; the query limit number N is set, if the query number reaches the query limit number N and the Bluetooth module has no response, the Bluetooth module is reset, and the heartbeat status information of the Bluetooth module is queried N times; if the query number reaches 2N times, it is determined that the Bluetooth module has a fault, and the working power of the Bluetooth module is temporarily turned off; the daily start time is set, the temporarily turned off Bluetooth module working power is periodically turned on, and whether the Bluetooth module has a fault is analyzed based on the obtained Bluetooth module response result; if there is a fault, the working power of the Bluetooth module is permanently turned off, and fault data is generated, and the fault data is transmitted to the terminal in real time; if there is no fault, the previous fault is cleared and the query number is reset; by querying the heartbeat, the Bluetooth working power without Bluetooth heartbeat is promptly turned off to ensure that even if the Bluetooth module is damaged on site, it will not affect the normal operation of the metering and communication of the electric energy meter and the collection terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 A flowchart of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal provided in an embodiment of the present application;
[0062] Figure 2 A flow chart of obtaining heartbeat status information of a Bluetooth module of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal provided in an embodiment of the present application;
[0063] Figure 3 A flow chart of periodic interval query of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0065] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0066] Please refer to Figure 1 , Figure 1 This is a flow chart of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal in some embodiments of the present application. The Bluetooth heartbeat detection method for an electric energy meter and a collection terminal is used in a terminal device, and the Bluetooth heartbeat detection method for an electric energy meter and a collection terminal includes the following steps:
[0067] S101, setting a time period, querying the heartbeat status information of the Bluetooth module based on the set time period interval, recording the number of queries, and obtaining a response result of the Bluetooth module;
[0068] S102, setting a query limit number N, if the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module, and query the heartbeat status information of the Bluetooth module N times again;
[0069] S103, if the query times reaches 2N times, it is determined that the Bluetooth module is faulty, and the working power of the Bluetooth module is temporarily turned off;
[0070] S104, setting a daily start time, periodically turning on the temporarily turned-off working power of the Bluetooth module, and analyzing whether the Bluetooth module is faulty according to the acquired Bluetooth module response result;
[0071] S105, if there is a fault, the working power of the Bluetooth module is permanently turned off, and fault data is generated and transmitted to the terminal in real time. If there is no fault, the previous fault is cleared and the query number is reset.
[0072] It should be noted that the fault status is analyzed by periodically querying the response of the Bluetooth module, thereby selectively shutting down the working voltage of the Bluetooth module and generating fault data in real time, thereby improving the detection accuracy of the electric energy meter and the collection terminal.
[0073] Please refer to Figure 2 , Figure 2 The present invention is a flowchart of obtaining the heartbeat status information of the Bluetooth module of a method for detecting the heartbeat of an electric energy meter and a collection terminal using Bluetooth in some embodiments of the present invention. According to an embodiment of the present invention, a time period is set, and the heartbeat status information of the Bluetooth module is queried based on the set time period interval, specifically including:
[0074] S201, turning on the working power of the Bluetooth module and analyzing the working power connection status;
[0075] S202, if the power connection status is displayed as successful, obtaining Bluetooth request configuration parameter information, and sending the Bluetooth request configuration parameter information to the Bluetooth module;
[0076] S203, analyzing whether the Bluetooth module receives Bluetooth request configuration parameter information within a set time, where the set time is 3S;
[0077] S204, if no Bluetooth request configuration parameter information is received within the set time, query the heartbeat status information of the Bluetooth module at a set time period interval, and set the time period to 10 minutes;
[0078] S205: If the Bluetooth request configuration parameter information is received within the set time, the Bluetooth module is initialized and configured based on the Bluetooth request configuration parameter information.
[0079] It should be noted that the Bluetooth module working power supply is connected, and whether the Bluetooth module receives the Bluetooth request configuration parameter information is analyzed, so as to accurately configure the parameters of the Bluetooth module. When the configuration information cannot be received, the heartbeat status of the Bluetooth module is queried at intervals to achieve multiple parameter configuration responses of the Bluetooth module.
[0080] According to an embodiment of the present invention, a query limit number N is set. If the query number reaches the query limit number N and the Bluetooth module does not respond, the Bluetooth module is reset, and the heartbeat status information of the Bluetooth module is queried N times, specifically including:
[0081] Set the query limit number N = 3 times. Each time Bluetooth is activated to request configuration parameter information, a query record is generated to obtain the query number.
[0082] When the query times are equal to 3, analyze the response status and response times of the Bluetooth module in the three query records;
[0083] If the number of responses of the Bluetooth module in the three query records is zero, the reset instruction is initiated, and the Bluetooth module is reset based on the reset instruction;
[0084] After the reset is completed, the heartbeat status information of the Bluetooth module is queried again.
[0085] It should be noted that the energy meter and the data collection terminal query the Bluetooth module heartbeat at intervals of 10 minutes (each query has a 3-time retransmission mechanism). If there is no response to the heartbeat query for three consecutive times, the Bluetooth module is reset once. If there is no response to the heartbeat query for three consecutive times, the Bluetooth module is considered to be faulty and the power supply of the Bluetooth module is turned off.
[0086] According to an embodiment of the present invention, a daily startup time is set, the temporarily shut-down Bluetooth module working power is periodically turned on, and whether the Bluetooth module is faulty is analyzed according to the acquired Bluetooth module response result, specifically including:
[0087] Set the daily startup time, which is from 4 am to 8 am;
[0088] Get the current time point. If the current time point reaches the daily startup time, generate a startup program.
[0089] Trial start of the temporarily shut down Bluetooth module working power supply based on the startup program, and acquisition of status information of the Bluetooth module working power supply;
[0090] Analyze whether the working power supply of the Bluetooth module is started successfully based on the status information of the working power supply of the Bluetooth module;
[0091] If the startup is successful, the Bluetooth module response result is obtained to analyze whether the Bluetooth module has a fault;
[0092] If the startup fails, the current time point is monitored in real time, and the startup program is triggered again when the next daily startup time is reached.
[0093] It should be noted that after determining that the Bluetooth module is faulty, the power of the Bluetooth module is periodically turned on at 4:00 a.m. every day to repeatedly determine whether the Bluetooth module is faulty. After 10 cycles, the power of the Bluetooth module is permanently turned off and the Bluetooth module fault is actively reported.
[0094] According to an embodiment of the present invention, after permanently turning off the working power of the Bluetooth module, the method further includes:
[0095] Analyze the fault status information of the Bluetooth module based on the response result of the Bluetooth module;
[0096] If there is a fault, the working power of the Bluetooth module is permanently turned off to obtain the shutdown status information;
[0097] Analyze the fault status information and shutdown status information of the Bluetooth module;
[0098] If the Bluetooth module fails and is in a state of permanently shutting down the working power of the Bluetooth module, the Bluetooth module will be re-powered on and the heartbeat status information of the Bluetooth module will be analyzed. If a Bluetooth working mode switching command is received during the re-power-on detection, no response will be executed;
[0099] If the Bluetooth module fails and the power of the Bluetooth module is not permanently shut down based on the shutdown status information analysis, if a Bluetooth working mode switching command is received, an abnormal response is returned without re-detecting the abnormal status.
[0100] It should be noted that when the Bluetooth module is analyzed to have a fault and enter a permanently shut down state, the power-on mode is triggered to perform a power-on test on the Bluetooth module, thereby accurately analyzing the abnormal situation of the Bluetooth module.
[0101] According to an embodiment of the present invention, clearing the previously occurred fault and resetting the query times specifically includes:
[0102] Get the number of Bluetooth module queries;
[0103] Compare the query times with the query limit times to analyze whether the Bluetooth module is temporarily shut down. If so, a temporary fault is obtained.
[0104] Obtain the response result of the Bluetooth module, and analyze whether the Bluetooth module is faulty based on the response result;
[0105] When there is no fault, the clear command is started, the temporary fault data is erased based on the clear command, and the query times are cleared.
[0106] It should be noted that by analyzing the response results of the Bluetooth module, it is determined whether to start the clear command, so as to clear the temporary faults previously detected in the normally operating Bluetooth module, improve the operating safety of the Bluetooth module, and simultaneously clear the query times to prevent abnormal judgments when calculating the query times and the corresponding results.
[0107] Please refer to Figure 3 , Figure 3 This is a periodic interval query flow chart of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal in some embodiments of the present application.
[0108] According to an embodiment of the present invention, the Bluetooth power supply is turned on, and it is analyzed whether a Bluetooth request configuration parameter command is received within Bluetooth 3S;
[0109] If no Bluetooth configuration parameter request command is received, the heartbeat query command is sent directly, and whether a response is received within 500ms is analyzed. If a response is received, the Bluetooth fault status and the number of queries are cleared. If no response is received, the heartbeat query command is sent again. If no response is received after the heartbeat query command is sent for the fifth time, whether there is a heartbeat is analyzed for the sixth time. If there is no heartbeat, the Bluetooth module working power is turned on. If there is a heartbeat, the Bluetooth power is turned off.
[0110] If a Bluetooth configuration parameter request command is received, the system will reply with the configuration response, clear the Bluetooth fault status, and clear the query heartbeat count.
[0111] It should be noted that the interval for sending the query heartbeat command is 500ms.
[0112] In a second aspect, an embodiment of the present application provides a Bluetooth heartbeat detection system for an electric energy meter and a collection terminal, the system comprising: a memory and a processor, the memory comprising a program of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal, and when the program of the Bluetooth heartbeat detection method for an electric energy meter and a collection terminal is executed by the processor, the following steps are implemented:
[0113] Set a time period, query the heartbeat status information of the Bluetooth module based on the set time period interval, record the number of queries, and obtain the response result of the Bluetooth module;
[0114] Set the query limit number N. If the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module and query the heartbeat status information of the Bluetooth module N times again;
[0115] If the query times reach 2N times, the Bluetooth module is judged to be faulty and the power supply of the Bluetooth module is temporarily turned off;
[0116] Set the daily startup time, periodically turn on the temporarily shut down Bluetooth module power supply, and analyze whether the Bluetooth module is faulty based on the obtained Bluetooth module response results;
[0117] If there is a fault, the working power of the Bluetooth module will be permanently turned off, and fault data will be generated and transmitted to the terminal in real time;
[0118] If no fault exists, clear the previous fault and reset the query count.
[0119] It should be noted that the fault status is analyzed by periodically querying the response of the Bluetooth module, thereby selectively shutting down the working voltage of the Bluetooth module and generating fault data in real time, thereby improving the detection accuracy of the electric energy meter and the collection terminal.
[0120] According to an embodiment of the present invention, setting a time period, and querying the heartbeat status information of the Bluetooth module based on the set time period interval specifically includes:
[0121] Turn on the working power of the Bluetooth module and analyze the working power connection status;
[0122] If the power connection status is displayed as successful, obtain the Bluetooth request configuration parameter information, and send the Bluetooth request configuration parameter information to the Bluetooth module;
[0123] Analyze whether the Bluetooth module receives the Bluetooth request configuration parameter information within the set time, and the set time is 3S;
[0124] If no Bluetooth request configuration parameter information is received within the set time, the heartbeat status information of the Bluetooth module is queried at a set time interval, and the set time period is 10 minutes;
[0125] If the Bluetooth request configuration parameter information is received within the set time, the Bluetooth module is initialized and configured based on the Bluetooth request configuration parameter information.
[0126] It should be noted that the Bluetooth module working power supply is connected, and whether the Bluetooth module receives the Bluetooth request configuration parameter information is analyzed, so as to accurately configure the parameters of the Bluetooth module. When the configuration information cannot be received, the heartbeat status of the Bluetooth module is queried at intervals to achieve multiple parameter configuration responses of the Bluetooth module.
[0127] According to an embodiment of the present invention, a query limit number N is set. If the query number reaches the query limit number N and the Bluetooth module does not respond, the Bluetooth module is reset, and the heartbeat status information of the Bluetooth module is queried N times, specifically including:
[0128] Set the query limit number N = 3 times. Each time Bluetooth is activated to request configuration parameter information, a query record is generated to obtain the query number.
[0129] When the query times are equal to 3, analyze the response status and response times of the Bluetooth module in the three query records;
[0130] If the number of responses of the Bluetooth module in the three query records is zero, the reset instruction is initiated, and the Bluetooth module is reset based on the reset instruction;
[0131] After the reset is completed, the heartbeat status information of the Bluetooth module is queried again.
[0132] It should be noted that the energy meter and the data collection terminal query the Bluetooth module heartbeat at intervals of 10 minutes (each query has a 3-time retransmission mechanism). If there is no response to the heartbeat query for three consecutive times, the Bluetooth module is reset once. If there is no response to the heartbeat query for three consecutive times, the Bluetooth module is considered to be faulty and the power supply of the Bluetooth module is turned off.
[0133] According to an embodiment of the present invention, a daily startup time is set, the temporarily shut-down Bluetooth module working power is periodically turned on, and whether the Bluetooth module is faulty is analyzed according to the acquired Bluetooth module response result, specifically including:
[0134] Set the daily startup time, which is from 4 am to 8 am;
[0135] Get the current time point. If the current time point reaches the daily startup time, generate a startup program.
[0136] Trial start of the temporarily shut down Bluetooth module working power supply based on the startup program, and acquisition of status information of the Bluetooth module working power supply;
[0137] Analyze whether the working power supply of the Bluetooth module is started successfully based on the status information of the working power supply of the Bluetooth module;
[0138] If the startup is successful, the Bluetooth module response result is obtained to analyze whether the Bluetooth module has a fault;
[0139] If the startup fails, the current time point is monitored in real time, and the startup program is triggered again when the next daily startup time is reached.
[0140] It should be noted that after determining that the Bluetooth module is faulty, the power of the Bluetooth module is periodically turned on at 4:00 a.m. every day to repeatedly determine whether the Bluetooth module is faulty. After 10 cycles, the power of the Bluetooth module is permanently turned off and the Bluetooth module fault is actively reported.
[0141] According to an embodiment of the present invention, after permanently turning off the working power of the Bluetooth module, the method further includes:
[0142] Analyze the fault status information of the Bluetooth module based on the response result of the Bluetooth module;
[0143] If there is a fault, the working power of the Bluetooth module is permanently turned off to obtain the shutdown status information;
[0144] Analyze the fault status information and shutdown status information of the Bluetooth module;
[0145] If the Bluetooth module fails and is in a state where the working power of the Bluetooth module is permanently turned off, the Bluetooth module is re-powered on and the heartbeat status information of the Bluetooth module is analyzed. If a Bluetooth working mode switching command is received during the re-power-on detection, no response is executed;
[0146] If the Bluetooth module fails and the power of the Bluetooth module is not permanently turned off based on the shutdown status information analysis, if a Bluetooth working mode switching command is received, an abnormal response is returned without re-detecting the abnormal status.
[0147] It should be noted that when the Bluetooth module is analyzed to have a fault and enter a permanently shut down state, the power-on mode is triggered to perform a power-on test on the Bluetooth module, thereby accurately analyzing the abnormal situation of the Bluetooth module.
[0148] According to an embodiment of the present invention, clearing the previously occurred fault and resetting the query times specifically includes:
[0149] Get the number of Bluetooth module queries;
[0150] Compare the query times with the query limit times to analyze whether the Bluetooth module is temporarily shut down. If so, a temporary fault is obtained.
[0151] Obtain the response result of the Bluetooth module, and analyze whether the Bluetooth module is faulty based on the response result;
[0152] When there is no fault, the clear command is started, the temporary fault data is erased based on the clear command, and the query times are cleared.
[0153] It should be noted that by analyzing the response results of the Bluetooth module, it is determined whether to start the clear command, so as to clear the temporary faults previously detected in the normally operating Bluetooth module, improve the operating safety of the Bluetooth module, and simultaneously clear the query times to prevent abnormal judgments when calculating the query times and the corresponding results.
[0154] Please refer to Figure 3 , Figure 3 This is a periodic interval query flow chart of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal in some embodiments of the present application.
[0155] According to an embodiment of the present invention, the Bluetooth power supply is turned on, and it is analyzed whether a Bluetooth request configuration parameter command is received within Bluetooth 3S;
[0156] If no Bluetooth configuration parameter request command is received, the heartbeat query command is sent directly, and whether a response is received within 500ms is analyzed. If a response is received, the Bluetooth fault status and the number of queries are cleared. If no response is received, the heartbeat query command is sent again. If no response is received after the heartbeat query command is sent for the fifth time, whether there is a heartbeat is analyzed for the sixth time. If there is no heartbeat, the Bluetooth module working power is turned on. If there is a heartbeat, the Bluetooth power is turned off.
[0157] If a Bluetooth configuration parameter request command is received, the system will reply with the configuration response, clear the Bluetooth fault status, and clear the query heartbeat count.
[0158] It should be noted that the interval for sending the query heartbeat command is 500ms.
[0159] A third aspect of the present invention provides a computer-readable storage medium, which includes a program for a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal. When the program for a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal is executed by a processor, the steps of the Bluetooth heartbeat detection method for an electric energy meter and a collection terminal as described in any of the above items are implemented.
[0160] The present invention discloses a Bluetooth heartbeat detection method, system and medium for an electric energy meter and a data acquisition terminal. The method includes setting a time period, querying the heartbeat status information of a Bluetooth module based on the set time period interval, recording the number of queries, and obtaining the response result of the Bluetooth module; setting a limited number of queries N, and if the number of queries reaches the limited number of queries N and the Bluetooth module has no response, resetting the Bluetooth module, and then querying the heartbeat status information of the Bluetooth module N times; if the number of queries reaches 2N times, determining that the Bluetooth module has a fault, and temporarily turning off the working power of the Bluetooth module; setting a daily start time, periodically turning on the temporarily turned-off working power of the Bluetooth module, and analyzing whether the Bluetooth module has a fault based on the obtained Bluetooth module response result; if a fault exists, permanently turning off the working power of the Bluetooth module, generating fault data, and transmitting the fault data to the terminal in real time; if no fault exists, clearing the fault that occurred previously and resetting the number of queries; and timely turning off the Bluetooth working power without the Bluetooth heartbeat by querying the heartbeat, so as to ensure that even if the Bluetooth module is damaged on site, the normal operation of the metering and communication of the electric energy meter and the data acquisition terminal will not be affected.
[0161] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0162] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0163] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0164] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, the aforementioned program can be stored in a readable storage medium, and when the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0165] Or, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
Claims
1. A Bluetooth heartbeat detection method for an electric energy meter and a collection terminal, characterized in that: include: Set a time period, query the heartbeat status information of the Bluetooth module based on the set time period interval, record the number of queries, and obtain the response result of the Bluetooth module; Set the query limit number N. If the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module and query the heartbeat status information of the Bluetooth module N times again; If the query times reach 2N times, the Bluetooth module is judged to be faulty and the working power of the Bluetooth module is temporarily turned off; Set the daily startup time, periodically turn on the temporarily shut down Bluetooth module power supply, and analyze whether the Bluetooth module is faulty based on the obtained Bluetooth module response results; If there is a fault, the working power of the Bluetooth module will be permanently turned off, and fault data will be generated and transmitted to the terminal in real time; If no fault exists, clear the previous fault and reset the query count.
2. The Bluetooth heartbeat detection method for electric energy meter and collection terminal according to claim 1, characterized in that: Set a time period to query the heartbeat status information of the Bluetooth module based on the set time period interval, including: Turn on the working power of the Bluetooth module and analyze the working power connection status; If the power connection status is displayed as successful, obtain the Bluetooth request configuration parameter information, and send the Bluetooth request configuration parameter information to the Bluetooth module; Analyze whether the Bluetooth module receives Bluetooth request configuration parameter information within a set time, where the set time is 3S; If no Bluetooth request configuration parameter information is received within the set time, the heartbeat status information of the Bluetooth module is queried at a set time period interval, and the set time period is 10 minutes; If the Bluetooth request configuration parameter information is received within the set time, the Bluetooth module is initialized and configured based on the Bluetooth request configuration parameter information.
3. The Bluetooth heartbeat detection method for electric energy meter and collection terminal according to claim 2 is characterized in that: Set the query limit number N. If the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module and query the heartbeat status information of the Bluetooth module N times, including: Set the query limit number N = 3 times. Each time Bluetooth is activated to request configuration parameter information, a query record is generated to obtain the query number. When the query times are equal to 3, analyze the response status and response times of the Bluetooth module in the three query records; If the number of responses of the Bluetooth module in the three query records is zero, the reset instruction is initiated, and the Bluetooth module is reset based on the reset instruction; After the reset is completed, the heartbeat status information of the Bluetooth module is queried again.
4. The Bluetooth heartbeat detection method for electric energy meter and collection terminal according to claim 3 is characterized in that: Set the daily startup time, periodically turn on the temporarily shut down Bluetooth module power supply, and analyze whether the Bluetooth module is faulty based on the obtained Bluetooth module response results, including: Set the daily startup time, which is from 4 am to 8 am; Get the current time point. If the current time point reaches the daily startup time, generate a startup program. Trial start of the temporarily shut down Bluetooth module working power supply based on the startup program, and acquisition of status information of the Bluetooth module working power supply; Analyze whether the working power supply of the Bluetooth module is started successfully based on the status information of the working power supply of the Bluetooth module; If the startup is successful, the Bluetooth module response result is obtained to analyze whether the Bluetooth module has a fault; If the startup fails, the current time point is monitored in real time, and the startup program is triggered again when the next daily startup time is reached.
5. The Bluetooth heartbeat detection method for electric energy meter and collection terminal according to claim 1, characterized in that: Permanently shutting down the Bluetooth module power supply also includes: Analyze the fault status information of the Bluetooth module based on the response result of the Bluetooth module; If there is a fault, the working power of the Bluetooth module is permanently turned off to obtain the shutdown status information; Analyze the fault status information and shutdown status information of the Bluetooth module; If the Bluetooth module fails and is in a state where the working power of the Bluetooth module is permanently turned off, the Bluetooth module is re-powered on and the heartbeat status information of the Bluetooth module is analyzed. If a Bluetooth working mode switching command is received during the re-power-on detection, no response is executed; If the Bluetooth module fails and the power of the Bluetooth module is not permanently turned off based on the shutdown status information analysis, if a Bluetooth working mode switching command is received, an abnormal response is returned without re-detecting the abnormal status.
6. The Bluetooth heartbeat detection method for electric energy meter and data collection terminal according to claim 5, characterized in that: Clear the previous fault and reset the query count, including: Get the number of Bluetooth module queries; Compare the query times with the query limit times to analyze whether the Bluetooth module is temporarily shut down. If so, a temporary fault is obtained. Obtain the response result of the Bluetooth module, and analyze whether the Bluetooth module is faulty based on the response result; When there is no fault, the clear command is started, the temporary fault data is erased based on the clear command, and the query times are cleared.
7. A Bluetooth heartbeat detection system for electric energy meters and collection terminals, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program of a Bluetooth heartbeat detection method for an electric energy meter and a collection terminal, and when the program of the Bluetooth heartbeat detection method for an electric energy meter and a collection terminal is executed by the processor, the following steps are implemented: Set a time period, query the heartbeat status information of the Bluetooth module based on the set time period interval, record the number of queries, and obtain the response result of the Bluetooth module; Set the query limit number N. If the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module and query the heartbeat status information of the Bluetooth module N times again; If the query times reach 2N times, the Bluetooth module is judged to be faulty and the power supply of the Bluetooth module is temporarily turned off; Set the daily startup time, periodically turn on the temporarily shut down Bluetooth module power supply, and analyze whether the Bluetooth module is faulty based on the obtained Bluetooth module response results; If there is a fault, the working power of the Bluetooth module will be permanently turned off, and fault data will be generated and transmitted to the terminal in real time; If no fault exists, clear the previous fault and reset the query count.
8. The Bluetooth heartbeat detection system for electric energy meter and data collection terminal according to claim 7, characterized in that: Set a time period to query the heartbeat status information of the Bluetooth module based on the set time period interval, including: Turn on the working power of the Bluetooth module and analyze the working power connection status; If the power connection status is displayed as successful, obtain the Bluetooth request configuration parameter information, and send the Bluetooth request configuration parameter information to the Bluetooth module; Analyze whether the Bluetooth module receives Bluetooth request configuration parameter information within a set time, where the set time is 3S; If no Bluetooth request configuration parameter information is received within the set time, the heartbeat status information of the Bluetooth module is queried at a set time period interval, and the set time period is 10 minutes; If the Bluetooth request configuration parameter information is received within the set time, the Bluetooth module is initialized and configured based on the Bluetooth request configuration parameter information.
9. The Bluetooth heartbeat detection system for electric energy meter and data collection terminal according to claim 8, characterized in that: Set the query limit number N. If the query number reaches the query limit number N and the Bluetooth module does not respond, reset the Bluetooth module and query the heartbeat status information of the Bluetooth module N times, including: Set the query limit number N = 3 times. Each time Bluetooth is activated to request configuration parameter information, a query record is generated to obtain the query number. When the query times are equal to 3, analyze the response status and response times of the Bluetooth module in the three query records; If the number of responses of the Bluetooth module in the three query records is zero, the reset instruction is initiated, and the Bluetooth module is reset based on the reset instruction; After the reset is completed, the heartbeat status information of the Bluetooth module is queried again.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a Bluetooth heartbeat detection method program for an electric energy meter and a collection terminal. When the Bluetooth heartbeat detection method program for an electric energy meter and a collection terminal is executed by a processor, the steps of the Bluetooth heartbeat detection method for an electric energy meter and a collection terminal as described in any one of claims 1 to 6 are implemented.