Switch Search Table Method and System Based on Combined Bluetooth and RS485 Communication

By combining Bluetooth and RS485 communication technology, a fast and accurate meter address search is achieved, solving the problems of slow meter search speed, low efficiency and "table links" in traditional methods, ensuring the accuracy and efficiency of power data processing.

CN116527442BActive Publication Date: 2025-06-20GUANGDONG ELECTRIC POWER SCI RES INST ENERGY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310717244.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2025-06-20
Estimated Expiration
2043-06-16

AI Technical Summary

Technical Problem

The traditional RS485, Bluetooth, and power carrier table search methods have problems such as slow search speed, low efficiency, easy to miss tables when addressed, and possible "table links to tables", resulting in errors in the table files.

Method used

The switch search method based on the combined communication between Bluetooth and RS485 is adopted. The meter address is obtained through an external Bluetooth module and converted into a Bluetooth MAC address. The Bluetooth MAC address information matrix is ​​obtained in the observer mode by using the switch's built-in Bluetooth module, and the Bluetooth MAC address information matrix is ​​obtained in the observer mode, and the meter address information matrix to be searched is generated, and the query message is sent one by one through the RS485 polling bus to quickly obtain the meter address.

Benefits of technology

This greatly shortens the search time, improves the accuracy of search tables, avoids the problem of "traveling to the Taiwan area", and ensures the accuracy of the Taiwan area archives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116527442B_ABST
    Figure CN116527442B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric power data processing, and discloses a switch meter search method and system based on Bluetooth and RS485 combined communication. The method obtains the meter address of an electric energy meter, converts the meter address into a Bluetooth MAC address, obtains all Bluetooth MAC addresses in observer mode through a Bluetooth module built into the switch, forms a MAC address information matrix, removes Bluetooth MAC addresses generated by non-meter addresses, parses the meter Bluetooth MAC address matrix, generates a meter address information matrix to be searched, narrows the unknown table search range to a known table information matrix to be searched, polls through an RS485 polling bus to quickly obtain all meter address information mounted on a switch bus, and outputs the searched meter information matrix, thereby greatly shortening the meter search time, improving the meter search accuracy, and effectively avoiding the "cross-station area" problem caused by searching equipment in nearby stations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power data processing, and particularly to a switch meter search method and system based on combined Bluetooth and RS485 communication. Background Art

[0002] With the construction and application of low-voltage centralized meter reading systems, the basic archives of the substation area and the affiliation relationship between households and transformers have become the main factors affecting the success rate of automatic meter reading in the substation area and the statistical line loss of the substation area. In the current power collection system, the meter search function can bring great convenience to data collection, measurement and billing, etc., and reduce the workload of meter collection and billing personnel.

[0003] Since there are a large number of low-voltage users and many customer archives are stored in the concentrator, if there are differences in these two aspects, phenomena such as incorrect meter reading and missed meter reading may occur, which will affect the normal operation of the entire system. Therefore, after the installation of the electric energy meter is completed, it is necessary to carefully check the electric energy meter and user archives to ensure the accuracy of the archives and the normal communication function of the electric energy, so as to avoid additional inconvenience. However, traditional carrier and RS485 channel electric energy meters have always suffered from the disadvantage of slow meter search speed, and there is no particularly good solution to this problem nowadays.

[0004] Traditional RS485, Bluetooth, and power carrier meter search methods mainly adopt a meter search scheme with digit reduction, starting from the lowest address 00 to 99 in sequence, sending the meter address one by one until all meter addresses are traversed, or an improved random traversal method. Its disadvantages are as follows:

[0005] 1) The meter search speed is slow and the efficiency is low. Especially, each search requires traversing all meter addresses, which takes a long time and seriously affects the meter reading efficiency.

[0006] 2) The addresses may be duplicated, resulting in bus conflicts, so that the reply message received by the intelligent switch is a scrambled message, leading to the situation of missed meters and being unable to adapt to the complex on-site usage conditions.

[0007] 3) There may be a phenomenon of "mixing substation areas" in the on-site installation of electric meters, and non-substation area meters are searched through Bluetooth or carrier communication methods, resulting in incorrect substation area archives.

[0008] In summary, the current traditional meter search methods are not only slow and inefficient in meter search, but also prone to missed meters in addresses, and there may be a phenomenon of "mixing substation areas", where non-substation area meters are searched through Bluetooth or carrier communication methods, resulting in incorrect substation area archives. Summary of the Invention

[0009] The present invention provides a switch meter search method and system based on Bluetooth and RS485 combined communication, which solves the technical problem that the current traditional meter search method is not only slow and inefficient, but also prone to missing addresses and the phenomenon of "cross-station area". Electric meters other than the station area are searched through Bluetooth or carrier communication, thus causing errors in the station area file.

[0010] In view of this, the first aspect of the present invention provides a switch meter search method based on Bluetooth and RS485 combined communication, wherein both the electric energy meter and the switch have built-in Bluetooth modules and RS485 communication ports, the electric energy meter is connected to an external Bluetooth module via the built-in Bluetooth module, and the electric energy meter is connected to the switch via an RS485 polling bus; the method comprises the following steps:

[0011] Acquire the meter address of the electric energy meter through an external Bluetooth module, and convert the meter address into a Bluetooth MAC address using a preset MAC address generation rule;

[0012] The built-in Bluetooth module of the switch acquires all Bluetooth MAC addresses within its preset detection range in observer mode, and forms a MAC address information matrix;

[0013] The MAC address information matrix is ​​verified by the switch, and the Bluetooth MAC addresses generated by non-meter addresses in the MAC address information matrix are removed to obtain the meter Bluetooth MAC address matrix;

[0014] Parsing the electric meter Bluetooth MAC address matrix to generate an electric meter address information matrix to be searched;

[0015] Sending messages for querying the meter addresses one by one through the RS485 polling bus according to the meter address information matrix;

[0016] Determine whether a reply to the response message is received. If a reply to the response message is received, save the corresponding meter address in the searched meter information matrix; if no reply to the response message is received, remove the corresponding meter address until each meter address in the meter address information matrix is ​​traversed and the searched meter information matrix is ​​output.

[0017] Preferably, the step of obtaining the meter address of the electric energy meter through an external Bluetooth module and converting the meter address into a Bluetooth MAC address using a preset MAC address generation rule specifically includes:

[0018] Obtaining the meter address of the electric energy meter through an external Bluetooth module;

[0019] Convert the meter address into a 5-byte hex code;

[0020] Use 5-bit cyclic redundancy check on the 5-byte hexadecimal code to obtain a check result, and perform an OR operation on the check result with the 0xC0 byte. The result of the OR operation is used as the 6th high byte. Combine the 5-byte hexadecimal code with the 6th high byte to obtain a 6-byte Bluetooth MAC address.

[0021] Preferably, the step of obtaining all Bluetooth MAC addresses within a preset detection range in observer mode through the built-in Bluetooth module of the switch and forming a MAC address information matrix specifically includes:

[0022] Send the Bluetooth MAC address to the built-in Bluetooth module of the electricity meter;

[0023] Broadcast the Bluetooth MAC address through the built-in Bluetooth module of the electricity meter;

[0024] Configure the built-in Bluetooth module of the switch to observer mode, scan the broadcasts within the preset detection range, and save all broadcast Bluetooth MAC addresses to the MAC address information matrix.

[0025] Preferably, the step of parsing the electricity meter Bluetooth MAC address matrix to generate an electricity meter address information matrix to be searched specifically includes:

[0026] Use cyclic redundancy check on the lower 5 bytes of each Bluetooth MAC address in the electricity meter Bluetooth MAC address matrix to obtain a check result for the lower 5 bytes. Perform an OR operation with the 0xC0 byte to obtain a new 6th byte. Compare the new 6th byte with the 6th byte of the Bluetooth MAC address. If the comparison is consistent, save the corresponding Bluetooth MAC address to the electricity meter address information matrix to be searched until all broadcast Bluetooth MAC addresses are traversed;

[0027] Delete the 6th high byte of each Bluetooth MAC address in the electricity meter address information matrix to be searched, form a 5-byte hexadecimal code from the remaining 5 bytes, and convert the 5-byte hexadecimal code into an electricity meter address.

[0028] In a second aspect, the present invention also provides a switch meter search system based on combined Bluetooth and RS485 communication. Both the electricity meter and the switch are built with a Bluetooth module and an RS485 communication port. The electricity meter is connected to an external Bluetooth module through the built-in Bluetooth module, and the electricity meter is connected to the switch through the RS485 polling bus; the system includes:

[0029] An address conversion module for obtaining the electricity meter address of the electricity meter through an external Bluetooth module and converting the electricity meter address into a Bluetooth MAC address using a preset MAC address generation rule;

[0030] An address detection module, configured to obtain all Bluetooth MAC addresses within a preset detection range thereof in observer mode through the Bluetooth module built in the switch, and form a MAC address information matrix;

[0031] An address verification module, configured to verify the MAC address information matrix through the switch, and remove the Bluetooth MAC addresses generated by non-electric meter addresses in the MAC address information matrix to obtain an electric meter Bluetooth MAC address matrix;

[0032] An address parsing module, configured to parse the electric meter Bluetooth MAC address matrix to generate an electric meter address information matrix to be searched;

[0033] A polling meter search module, configured to send messages for querying electric meter addresses one by one through the RS485 polling bus according to the electric meter address information matrix;

[0034] A message response module, configured to determine whether a reply to a response message is received. If a reply to the response message is received, the corresponding electric meter address is saved to the searched electric meter information matrix; if a reply to the response message is not received, the corresponding electric meter address is removed until each electric meter address in the electric meter address information matrix is traversed, and the searched electric meter information matrix is output.

[0035] Preferably, the address conversion module specifically includes:

[0036] An electric meter address acquisition module, configured to obtain the electric meter address of the electric energy meter through an external Bluetooth module;

[0037] A conversion module, configured to convert the electric meter address into a 5-byte hexadecimal code, further configured to perform 5-bit cyclic redundancy check on the 5-byte hexadecimal code to obtain a check result, perform an OR operation on the check result and the 0xC0 byte, use the obtained OR operation result as the 6th high byte, and combine the 5-byte hexadecimal code with the 6th high byte to obtain a 6-byte Bluetooth MAC address.

[0038] Preferably, the address detection module specifically includes:

[0039] An address sending module, configured to send the Bluetooth MAC address to the Bluetooth module built in the electric meter;

[0040] A Bluetooth broadcast module, configured to broadcast the Bluetooth MAC address through the Bluetooth module built in the electric meter;

[0041] A Bluetooth observer module, configured to configure the built-in Bluetooth module of the switch into observer mode, scan the broadcasts within a preset detection range, and save all the broadcast Bluetooth MAC addresses to the MAC address information matrix.

[0042] Preferably, the address resolution module specifically includes:

[0043] A byte comparison module, which is used to perform cyclic redundancy check on the lower 5 bytes of each Bluetooth MAC address in the electric meter Bluetooth MAC address matrix, obtain the check result of the lower 5 bytes, perform an OR operation with the 0xC0 byte to obtain a new 6th byte, compare the new 6th byte with the 6th byte of the Bluetooth MAC address, if the comparison is consistent, save the corresponding Bluetooth MAC address to the electric meter address information matrix to be searched until all the broadcast-searched Bluetooth MAC addresses are traversed;

[0044] An address operation module, which is used to delete the upper 6th byte of each Bluetooth MAC address in the electric meter address information matrix to be searched, form a 5-byte hexadecimal code from the remaining 5 bytes, and convert the 5-byte hexadecimal code into an electric meter address.

[0045] From the above technical solutions, it can be seen that the present invention has the following advantages:

[0046] The present invention obtains the electric meter address of the electric energy meter, converts the electric meter address into a Bluetooth MAC address, obtains all Bluetooth MAC addresses in observer mode through the built-in Bluetooth module of the switch, and forms a MAC address information matrix, checks the MAC address information matrix, eliminates the Bluetooth MAC addresses generated by non-electric meter addresses, obtains the electric meter Bluetooth MAC address matrix, and also resolves the electric meter Bluetooth MAC address matrix to generate an electric meter address information matrix to be searched, reduces the unknown meter search range to the known meter search information matrix, polls through the RS485 polling bus, quickly obtains all the electric meter address information mounted on the switch bus, and outputs the searched electric meter information matrix, thus greatly shortening the meter search time and improving the meter search accuracy. By adopting a communication method combining Bluetooth and RS485, it can effectively avoid the "cross-region" problem caused by searching for devices in the nearby transformer areas. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a flowchart of a switch meter search method based on combined Bluetooth and RS485 communication provided by an embodiment of the present invention;

[0048] Figure 2 It is a schematic structural diagram of a switch meter search system based on combined Bluetooth and RS485 communication provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0049] To enable those skilled in the art to better understand the solution of the present invention, the following will clearly and completely describe the technical solution in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.

[0050] A method for a switch to search for a meter based on combined Bluetooth and RS485 communication provided by the invention. Both the electricity meter and the switch are internally provided with a Bluetooth module and an RS485 communication port. The electricity meter is connected to an external Bluetooth module through the internally provided Bluetooth module, and the electricity meter is connected to the switch through an RS485 polling bus.

[0051] Among them, in addition to the basic Bluetooth communication function, the Bluetooth module should also have the following functions:

[0052] (1) The Bluetooth modules internally provided in the electricity meter and the switch should support two modes: short messages with ATT_MTU_SIZE = 23 bytes (the maximum length of data actually transmitted over the Bluetooth link is 20 bytes) and long messages with ATT_MTU_SIZE = 247 bytes (the maximum length of data actually transmitted over the Bluetooth link is 244 bytes).

[0053] (2) The Bluetooth modules internally provided in the electricity meter and the switch should support communication with the switch and the electricity meter, and support the function of converting the electricity meter address into a Bluetooth MAC address;

[0054] (3) The internally provided Bluetooth module must support the UUID setting function, must support CSA#2, the Bluetooth module of the default electricity meter is in the broadcast state, and the Bluetooth module of the switch is in the observer mode.

[0055] For ease of understanding, please refer to Figure 1 , the present invention provides a method for a switch to search for a meter based on combined Bluetooth and RS485 communication, including the following steps:

[0056] Step S1: Obtain the electricity meter address of the electricity meter through an external Bluetooth module, and convert the electricity meter address into a Bluetooth MAC address by using a preset MAC address generation rule.

[0057] Step S2: Obtain all Bluetooth MAC addresses within its preset detection range in the observer mode through the Bluetooth module internally provided in the switch, and form a MAC address information matrix.

[0058] Among them, in observer mode, the module is non-connected. Compared with the one-to-many broadcast in broadcaster mode, observer can receive data one-to-many. In this mode, the device can only listen to and read the broadcast data in the air. The only difference from the host is that it cannot initiate a connection and can only continuously scan the slave.

[0059] The observer working mode can be applied to data acquisition concentrator applications, such as sensor concentrator acquisition and other functions; another typical example is the Bluetooth gateway, the Bluetooth module is in observer mode, no broadcasting, it can scan the surrounding broadcasting devices, but cannot request to connect to the broadcasting devices.

[0060] Step S3, verifying the MAC address information matrix through a switch, removing Bluetooth MAC addresses generated by non-meter addresses in the MAC address information matrix, and obtaining the meter Bluetooth MAC address matrix.

[0061] It is understandable that the MAC address information matrix is ​​verified, and the Bluetooth MAC addresses generated by non-meter addresses in the MAC address information matrix are eliminated, so that the searched meter address is more accurate.

[0062] Among them, after the meter address is converted into a Bluetooth MAC address, a mapping relationship is generated and stored in a database. Each Bluetooth MAC address in the MAC address information matrix is ​​matched in the database. If no match is found, the Bluetooth MAC address generated by the non-meter address is removed.

[0063] Step S4, parsing the electric meter Bluetooth MAC address matrix to generate an electric meter address information matrix to be searched.

[0064] Step S5, sending messages for querying the meter addresses one by one through the RS485 polling bus according to the meter address information matrix.

[0065] Step S6, determine whether a reply to the response message is received. If a reply to the response message is received, save the corresponding meter address to the searched meter information matrix; if no reply to the response message is received, remove the corresponding meter address until each meter address in the meter address information matrix is ​​traversed and the searched meter information matrix is ​​output.

[0066] In practical applications, steps S1 to S6 may be cycled at regular intervals.

[0067] It should be noted that the present invention obtains the electricity meter address of the electricity meter, converts the electricity meter address into a Bluetooth MAC address, obtains all Bluetooth MAC addresses in observer mode through the built-in Bluetooth module of the switch, forms a MAC address information matrix, verifies the MAC address information matrix, eliminates the Bluetooth MAC addresses generated by non-electricity meter addresses, obtains the electricity meter Bluetooth MAC address matrix, and also analyzes the electricity meter Bluetooth MAC address matrix to generate an electricity meter address information matrix to be searched, reduces the unknown meter search range to a known meter search information matrix to be searched, polls through the RS485 polling bus to quickly obtain all the electricity meter address information mounted on the switch bus, and outputs the searched electricity meter information matrix, thereby greatly shortening the meter search time and improving the meter search accuracy. By adopting a communication method combining Bluetooth and RS485, the problem of "crossing the transformer area" caused by searching for devices in the nearby transformer area can be effectively avoided.

[0068] In a specific embodiment, step S1 specifically includes:

[0069] S101, obtaining the electricity meter address of the electricity meter through an external Bluetooth module.

[0070] S102, converting the electricity meter address into a 5-byte hexadecimal code.

[0071] S103, performing 5-bit cyclic redundancy check on the 5-byte hexadecimal code to obtain a check result, performing an OR operation on the check result and the 0xC0 byte, using the obtained OR operation result as the high 6th byte, and combining the 5-byte hexadecimal code with the high 6th byte to obtain a 6-byte Bluetooth MAC address.

[0072] In an example, if the electricity meter address is 123456789999, after adopting hexadecimal encoding, the electricity meter address is 0x1CBE991DEF, and the hexadecimal encoding of this address is converted into a 6-byte one-dimensional array [00, 1C, BE, 99, 1D, EF].

[0073] Then, according to the 5-bit cyclic redundancy check, the polynomial formula x 5 +x 4 +x 2 +1 is calculated to obtain the result 0F byte, perform an OR operation on the 0F byte and the 0xC0 byte, fill it into the 6th byte to obtain 0xCF, and finally obtain the one-dimensional array [CF, 1C, BE, 99, 1D, EF]. This array is transmitted to the built-in Bluetooth module of the electricity meter through the communication port as the Bluetooth MAC address.

[0074] In a specific embodiment, step S2 specifically includes:

[0075] S201, sending the Bluetooth MAC address to the built-in Bluetooth module of the electricity meter;

[0076] S202, broadcast the Bluetooth MAC address via the built-in Bluetooth module of the electricity meter;

[0077] S203, configure the built-in Bluetooth module of the switch into observer mode, scan the broadcasts within a preset detection range, and save all the broadcast Bluetooth MAC addresses to the MAC address information matrix.

[0078] In one example, by using the built-in Bluetooth module of the switch in Bluetooth observer mode to obtain the MAC addresses of all surrounding Bluetooth broadcasts, the following multi-dimensional MAC address information matrix is obtained:

[0079]

[0080] where the subscript n represents the number of Bluetooth MAC addresses.

[0081] In a specific embodiment, step S4 specifically includes:

[0082] S401, perform cyclic redundancy check on the lower 5 bytes of each Bluetooth MAC address in the electricity meter Bluetooth MAC address matrix, perform an OR operation on the obtained check result of the lower 5 bytes with the 0xC0 byte to obtain a new 6th byte, compare the new 6th byte with the 6th byte of the Bluetooth MAC address, if they are consistent, save the corresponding Bluetooth MAC address to the electricity meter address information matrix to be searched until all the Bluetooth MAC addresses searched from the broadcasts are traversed.

[0083] S402, perform a deletion operation on the high 6th byte of each Bluetooth MAC address in the electricity meter address information matrix to be searched, form a 5-byte hexadecimal code from the remaining 5 bytes, and convert the 5-byte hexadecimal code into an electricity meter address.

[0084] In one example, take X 16 Y 16 perform an AND operation with the 0x3F byte to obtain the cyclic redundancy check (CRC-5) check result of this MAC address, and then according to the 5-bit cyclic redundancy check result, polynomial formula x 5 +x 4 +x 2 +1 calculate the CRC-5 check result of X 15 Y 15 ~X 11 Y 11 The obtained CRC-5 check result is compared with the CRC-5 check result obtained from X 16 Y 16 If they are consistent, X 15 Y 15 ~X 11 Y 11Convert it to hexadecimal encoding, and then convert the hexadecimal encoding to the electricity meter address.

[0085] The above is a detailed description of an embodiment of a method for searching for electricity meters of a switch based on combined Bluetooth and RS485 communication provided by the present invention. The following is a detailed description of an embodiment of a system for searching for electricity meters of a switch based on combined Bluetooth and RS485 communication provided by the present invention.

[0086] For ease of understanding, please refer to Figure 2 , a system for searching for electricity meters of a switch based on combined Bluetooth and RS485 communication provided by the present invention. Both the electricity meter and the switch are built-in with a Bluetooth module and an RS485 communication port. The electricity meter is connected to an external Bluetooth module through the built-in Bluetooth module, and the electricity meter is connected to the switch through the RS485 polling bus; the system includes:

[0087] An address conversion module 100, configured to obtain the electricity meter address of the electricity meter through an external Bluetooth module, and convert the electricity meter address to a Bluetooth MAC address by using a preset MAC address generation rule;

[0088] An address detection module 200, configured to obtain all Bluetooth MAC addresses within a preset detection range in observer mode through the Bluetooth module built in the switch, and form a MAC address information matrix;

[0089] An address verification module 300, configured to verify the MAC address information matrix through the switch, eliminate the Bluetooth MAC addresses generated by non-electricity meter addresses in the MAC address information matrix, and obtain an electricity meter Bluetooth MAC address matrix;

[0090] An address parsing module 400, configured to parse the electricity meter Bluetooth MAC address matrix to generate an electricity meter address information matrix to be searched;

[0091] A polling electricity meter search module 500, configured to send a message for querying the electricity meter address one by one through the RS485 polling bus according to the electricity meter address information matrix;

[0092] A message response module 600, configured to determine whether a reply to the response message is received. If a reply to the response message is received, the corresponding electricity meter address is saved to the searched electricity meter information matrix; if a reply to the response message is not received, the corresponding electricity meter address is eliminated until each electricity meter address in the electricity meter address information matrix is traversed, and the searched electricity meter information matrix is output.

[0093] In a specific embodiment, the address conversion module specifically includes:

[0094] An electricity meter address acquisition module, configured to obtain the electricity meter address of the electricity meter through an external Bluetooth module;

[0095] A conversion module is used to convert the electricity meter address into a 5-byte hexadecimal code, and is also used to perform a 5-bit cyclic redundancy check on the 5-byte hexadecimal code to obtain a check result, and perform an OR operation on the check result and the 0xC0 byte. The result of the OR operation is used as the 6th high byte, and the 5-byte hexadecimal code is combined with the 6th high byte to obtain a 6-byte Bluetooth MAC address.

[0096] In a specific embodiment, the address detection module specifically includes:

[0097] An address sending module is used to send the Bluetooth MAC address to the built-in Bluetooth module of the electricity meter;

[0098] A Bluetooth broadcast module is used to broadcast the Bluetooth MAC address through the built-in Bluetooth module of the electricity meter;

[0099] A Bluetooth observer module is configured as an observer mode through the built-in Bluetooth module of the switch, scans the broadcasts within a preset detection range, and saves all the broadcast Bluetooth MAC addresses to the MAC address information matrix.

[0100] In a specific embodiment, the address parsing module specifically includes:

[0101] A byte comparison module is used to perform a cyclic redundancy check on the lower 5 bytes of each Bluetooth MAC address in the electricity meter Bluetooth MAC address matrix to obtain a check result of the lower 5 bytes and perform an OR operation with the 0xC0 byte to obtain a new 6th byte. The new 6th byte is compared with the 6th byte of the Bluetooth MAC address. If the comparison is consistent, the corresponding Bluetooth MAC address is saved to the electricity meter address information matrix to be searched until all the broadcast Bluetooth MAC addresses are traversed and searched;

[0102] An address operation module is used to delete the 6th high byte of each Bluetooth MAC address in the electricity meter address information matrix to be searched, form a 5-byte hexadecimal code from the remaining 5 bytes, and convert the 5-byte hexadecimal code into an electricity meter address.

[0103] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0104] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling, direct coupling, or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms.

[0105] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0106] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0107] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of the present invention.

Claims

1. A method for a switch to search for a table based on combined Bluetooth and RS485 communication, characterized in that The electric energy meter and the switch are both equipped with a built-in Bluetooth module and an RS485 communication port. The electric energy meter is connected to an external Bluetooth module via the built-in Bluetooth module, and the electric energy meter is connected to the switch via an RS485 polling bus. The method comprises the following steps: Acquire the meter address of the electric energy meter through an external Bluetooth module, and convert the meter address into a Bluetooth MAC address using a preset MAC address generation rule; The built-in Bluetooth module of the switch acquires all Bluetooth MAC addresses within its preset detection range in observer mode, and forms a MAC address information matrix; The MAC address information matrix is ​​verified by the switch, and the Bluetooth MAC addresses generated by non-meter addresses in the MAC address information matrix are removed to obtain the meter Bluetooth MAC address matrix; Parsing the electric meter Bluetooth MAC address matrix to generate an electric meter address information matrix to be searched; Sending messages for querying the meter addresses one by one through the RS485 polling bus according to the meter address information matrix; Determine whether a reply to the response message is received. If a reply to the response message is received, save the corresponding meter address in the searched meter information matrix; if no reply to the response message is received, remove the corresponding meter address until each meter address in the meter address information matrix is ​​traversed and the searched meter information matrix is ​​output.

2. The method for a switch to search for a table based on combined Bluetooth and RS485 communication according to claim 1, characterized in that The steps of obtaining the meter address of the electric energy meter through an external Bluetooth module and converting the meter address into a Bluetooth MAC address using a preset MAC address generation rule specifically include: Obtaining the meter address of the electric energy meter through an external Bluetooth module; Convert the meter address into a 5-byte hex code; The 5-byte hex code is checked using a 5-bit cyclic redundancy check to obtain a check result, and the check result is ORed with the 0xC0 byte, the ORed result is used as the high sixth byte, the 5-byte hex code is combined with the high sixth byte to obtain a 6-byte Bluetooth MAC address.

3. The method for a switch to search for a table based on combined Bluetooth and RS485 communication according to claim 2, characterized in that The steps of obtaining all Bluetooth MAC addresses within a preset detection range of the switch in observer mode through the built-in Bluetooth module of the switch and forming a MAC address information matrix specifically include: Sending the Bluetooth MAC address to the Bluetooth module built into the electric meter; Broadcasting the Bluetooth MAC address via a Bluetooth module built into the electric meter; The built-in Bluetooth module of the switch is configured as an observer mode, and the broadcasts within a preset detection range are scanned, and all broadcast Bluetooth MAC addresses are saved in a MAC address information matrix.

4. The method for a switch to search for a table based on combined Bluetooth and RS485 communication according to claim 3, characterized in that The step of parsing the electric meter Bluetooth MAC address matrix to generate an electric meter address information matrix to be searched specifically includes: The lower 5 bytes of each Bluetooth MAC address in the electricity meter Bluetooth MAC address matrix are verified using cyclic redundancy check. The verification result of the lower 5 bytes is ORed with the 0xC0 byte to obtain a new 6th byte. The new 6th byte is compared with the 6th byte of the Bluetooth MAC address. If the comparison is consistent, the corresponding Bluetooth MAC address is saved to the electricity meter address information matrix to be searched until all the Bluetooth MAC addresses broadcast and searched are traversed; The 6th byte from the highest position of each Bluetooth MAC address in the electricity meter address information matrix to be searched is deleted. The remaining 5 bytes are combined into a 5-byte hexadecimal code, and the 5-byte hexadecimal code is converted into an electricity meter address.

5. A switch table search system based on combined Bluetooth and RS485 communication, characterized in that Both the electricity meter and the switch are built-in with Bluetooth modules and RS485 communication ports. The electricity meter is connected to an external Bluetooth module through the built-in Bluetooth module, and the electricity meter is connected to the switch through the RS485 polling bus; Its system includes: An address conversion module, which is used to obtain the electricity meter address of the electricity meter through an external Bluetooth module and convert the electricity meter address into a Bluetooth MAC address using a preset MAC address generation rule; An address detection module, which is used to obtain all Bluetooth MAC addresses within its preset detection range in observer mode through the Bluetooth module built in the switch and form a MAC address information matrix; An address verification module, which is used to verify the MAC address information matrix through the switch, eliminate the Bluetooth MAC addresses generated by non-electricity meter addresses in the MAC address information matrix, and obtain an electricity meter Bluetooth MAC address matrix; An address parsing module, which is used to parse the electricity meter Bluetooth MAC address matrix to generate an electricity meter address information matrix to be searched; A polling electricity meter search module, which is used to send messages querying the electricity meter address one by one through the RS485 polling bus according to the electricity meter address information matrix; A message response module, which is used to determine whether a response message reply is received. If a response message reply is received, the corresponding electricity meter address is saved to the electricity meter information matrix that has been searched; if a response message reply is not received, the corresponding electricity meter address is eliminated until each electricity meter address in the electricity meter address information matrix is traversed, and the electricity meter information matrix that has been searched is output.

6. The switch table search system based on combined Bluetooth and RS485 communication according to claim 5, characterized in that The address conversion module specifically includes: An electricity meter address acquisition module, which is used to obtain the electricity meter address of the electricity meter through an external Bluetooth module; A conversion module, which is used to convert the electricity meter address into a 5-byte hexadecimal code, and is also used to verify the 5-byte hexadecimal code using 5-bit cyclic redundancy check to obtain a verification result, and OR the verification result with the 0xC0 byte. The result of the OR operation is used as the 6th byte from the highest position. The 5-byte hexadecimal code is combined with the 6th byte from the highest position to obtain a 6-byte Bluetooth MAC address.

7. The switch table search system based on combined Bluetooth and RS485 communication according to claim 6, characterized in that, The address detection module specifically includes: An address sending module, which is used to send the Bluetooth MAC address to the Bluetooth module built in the electricity meter; A Bluetooth broadcast module, which is used to broadcast the Bluetooth MAC address through the Bluetooth module built in the electricity meter; A Bluetooth observer module, which is configured as an observer mode through the built-in Bluetooth module of the switch, scans broadcasts within a preset detection range, and saves the Bluetooth MAC addresses of all broadcasts to the MAC address information matrix.

8. The switch table search system based on combined Bluetooth and RS485 communication according to claim 7, characterized in that, The address resolution module specifically includes: A byte comparison module, which uses cyclic redundancy check for the lower 5 bytes of each Bluetooth MAC address in the electricity meter Bluetooth MAC address matrix, obtains the check result of the lower 5 bytes and performs an OR operation with the 0xC0 byte to obtain a new 6th byte, compares the new 6th byte with the 6th byte of the Bluetooth MAC address. If the comparison is consistent, the corresponding Bluetooth MAC address is saved to the electricity meter address information matrix to be searched until all Bluetooth MAC addresses searched from all broadcasts are traversed; An address operation module, which deletes the high 6th byte of each Bluetooth MAC address in the electricity meter address information matrix to be searched, forms a 5-byte hexadecimal code from the remaining 5 bytes, and converts the 5-byte hexadecimal code into an electricity meter address.

Citation Information

Patent Citations

  • Bluetooth-based electric energy meter statistical method and device and storage medium

    CN111063183A

  • Method and system for establishing Bluetooth connection based on two-dimensional code

    CN111866839A