Dynamic network topological relation determination method and device based on communication timestamp
By connecting the device to the gateway with the highest signal strength and combining communication timestamps, the problem of inaccurate determination of network topology in advanced metering architectures was solved, ensuring the accuracy of control commands.
Patent Information
- Application Number
- CN202511116580.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-12-12
AI Technical Summary
In advanced metering architectures, the back-end system struggles to accurately determine dynamically changing network topology relationships, leading to erroneous control commands.
The system obtains connection signal strength values through the device and connects to the gateway with the highest signal strength. It then acquires meter data and combines it with communication timestamps. Based on this data, the system determines the network topology.
It enables accurate determination of dynamic network topology even in cases of gateway data backlog and delayed transmission, thus avoiding control command errors.
Smart Images

Figure CN121125505A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of advanced metering architecture technology, and more specifically, to a method and apparatus for determining dynamic network topology relationships based on communication timestamps. Background Technology
[0002] Advanced Metering Infrastructure (AMI) is a smart grid technology, such as... Figure 4 As shown, it typically includes devices (such as smart meters), relays, gateways, and a back-end system. The devices upload the collected parameter values to the back-end system via the relays / gateways, and the back-end system can also send control commands to the devices via the relays / gateways.
[0003] The backend system needs to determine the network topology (i.e., which devices are connected to gateway 1, which devices are connected to gateway 2, and so on). Devices connect to nearby gateways based on signal strength. For example, for device A, when the connection strength of gateway 1 is greater than that of gateway 2, device A will automatically connect to gateway 1; when the connection strength of gateway 3 is greater than that of gateway 1, device A will automatically connect to gateway 3. Therefore, the network topology changes dynamically.
[0004] Because network topology changes dynamically, the backend system cannot guarantee that the determined network topology will always be accurate. If the network topology is determined incorrectly (for example, device A is actually connected to gateway 2, but the system determines that device A is connected to gateway 1), then the backend system will be unable to issue control commands accurately. Summary of the Invention
[0005] In a first aspect of the embodiments of this disclosure, a method for determining dynamic network topology relationships based on communication timestamps is provided, comprising: The device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value; the device obtains the first meter data and sends the obtained first meter data to the gateway currently connected to the device. The first meter data includes the device's unique identification code and device parameter values. The gateway receives the first meter data, and when the gateway receives the first meter data, it obtains the communication timestamp and combines the first meter data with the communication timestamp to obtain the second meter data; the gateway sends the second meter data to the system, and the second meter data includes the device unique identifier, device parameter value, communication timestamp and gateway unique identifier; The system receives data from the second meter, and when the system receives the second meter data, it determines the network topology based on the second meter data.
[0006] As a preferred option, connecting to the gateway with the highest connection signal strength specifically includes: Determine whether the gateway with the highest current connection signal strength is the same as the gateway with the highest connection signal strength in the previous connection. If the gateway with the highest current connection signal strength is the same as the gateway with the highest connection signal strength in the previous connection, then maintain the connection with the gateway with the highest current connection signal strength. If the gateway with the highest current connection signal strength is different from the gateway with the highest current connection signal strength, then disconnect from the gateway with the highest current connection signal strength and connect to the gateway with the highest current connection signal strength.
[0007] Preferably, the equipment acquires the first meter data specifically including: If the gateway with the highest current signal strength value is different from the gateway with the highest signal strength value in the last connection, the device will acquire the first meter data at the current moment and start timing from the initial timing value; If the gateway with the highest current signal strength is the same as the gateway with the highest signal strength in the last connection, then it is determined whether the current timing value is greater than or equal to the preset timing value. If the current timing value is greater than or equal to the preset timing value, the device acquires the first meter data at the current moment and starts timing from the initial timing value.
[0008] As a preferred option, obtaining the communication timestamp specifically includes: Determine the time value at which the gateway receives the first meter data and use this time value as the communication timestamp.
[0009] As a preferred method, determining the network topology based on the second meter data specifically includes: The data sending gateway is determined based on the gateway's unique identifier of the second meter data, and the data acquisition device is determined based on the device's unique identifier of the second meter data. Determine whether the data acquisition device is currently located in the network topology of the data sending gateway. If the data acquisition device is currently located in the network topology of the data sending gateway, then determine that the network topology remains unchanged, and acquire the communication timestamp based on the second meter data, and use the communication timestamp as the most recent communication timestamp of the data acquisition device. If the data acquisition device is not currently located in the network topology of the data sending gateway, then the communication timestamp of the second meter data acquisition is used, and the communication timestamp is compared with the most recent communication timestamp of the data acquisition device. If the communication timestamp is after the most recent communication timestamp, the network topology is redefined so that the data acquisition device is currently located in the network topology of the data sending gateway, and the communication timestamp is used as the most recent communication timestamp of the data acquisition device; if the communication timestamp is before the most recent communication timestamp, the network topology remains unchanged.
[0010] In a second aspect of the embodiments of this disclosure, a dynamic network topology determination apparatus based on communication timestamps is provided, comprising: The first meter data acquisition and transmission module is configured to acquire the connection signal strength value of each gateway and connect to the gateway with the highest connection signal strength value; the device acquires the first meter data and sends the acquired first meter data to the gateway currently connected to the device. The first meter data includes the device's unique identification code and device parameter values. The second meter data acquisition and transmission module is configured to receive the first meter data from the gateway, and when the gateway receives the first meter data, it acquires the communication timestamp and combines the first meter data with the communication timestamp to obtain the second meter data; the gateway sends the second meter data to the system, and the second meter data includes the device unique identifier, device parameter values, communication timestamp and gateway unique identifier; The network topology determination module is configured to receive second meter data from the system and determine the network topology based on the second meter data when the system receives the second meter data.
[0011] Preferably, the first meter data acquisition and transmission module includes: The gateway connection unit is configured to determine whether the gateway with the highest current connection signal strength value is the same as the gateway with the highest connection signal strength value in the previous connection. If the gateway with the highest current connection signal strength value is the same as the gateway with the highest connection signal strength value in the previous connection, the connection with the gateway with the highest current connection signal strength value is maintained; if the gateway with the highest current connection signal strength value is different from the gateway with the highest connection signal strength value in the previous connection, the connection with the gateway with the highest connection signal strength value in the previous connection is disconnected and the connection with the gateway with the highest current connection signal strength value is established.
[0012] Preferably, the first meter data acquisition and transmission module also includes: The first meter data acquisition unit is configured to acquire the first meter data at the current moment if the gateway with the highest current signal strength value is different from the gateway with the highest signal strength value in the previous connection, and start timing from the initial timing value. If the gateway with the highest current signal strength is the same as the gateway with the highest signal strength in the last connection, then it is determined whether the current timing value is greater than or equal to the preset timing value. If the current timing value is greater than or equal to the preset timing value, the device acquires the first meter data at the current moment and starts timing from the initial timing value.
[0013] In a third aspect of the embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to the first aspect.
[0014] In a fourth aspect of the embodiments of this disclosure, an electronic device is provided, including one or more processors and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the method provided according to the first aspect.
[0015] It should be understood that the description in the Summary of the Invention section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Beneficial effects
[0016] The method and apparatus for determining dynamic network topology based on communication timestamps in this disclosure can accurately determine dynamic network topology relationships through the device unique identifier, communication timestamp, and gateway unique identifier in the second meter data. Even if the gateway experiences a delay in sending data to the system due to data backlog, it will not lead to errors in determining the network topology relationship.
[0017] Further or more detailed beneficial effects will be described in conjunction with specific embodiments in the detailed implementation. Attached Figure Description
[0018] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein: Figure 1 A flowchart of a method for determining dynamic network topology based on communication timestamps according to an embodiment of this disclosure is shown; Figure 2 A block diagram of a dynamic network topology determination apparatus based on communication timestamps according to an embodiment of the present disclosure is shown; Figure 3 A block diagram of an electronic device according to an embodiment of the present disclosure is shown; Figure 4 A schematic diagram of a portion of the network topology according to an embodiment of this disclosure is shown. Detailed Implementation
[0019] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0020] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0021] Figure 1 A flowchart of a dynamic network topology determination method 100 based on communication timestamps according to an embodiment of this disclosure is shown. The method 100 includes: Step 102. The device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value; the device obtains the first meter data and sends the obtained first meter data to the gateway currently connected to the device. The first meter data includes the device's unique identification code and device parameter values.
[0022] This embodiment assumes that there is only one device A. Device A will obtain the connection signal strength value of the additional gateway at a certain frequency (e.g., 1 second). Existing technology can be directly used to obtain the connection signal strength value of the gateway.
[0023] In this embodiment, connecting to the gateway with the highest connection signal strength specifically includes: Determine whether the gateway with the highest current connection signal strength is the same as the gateway with the highest connection signal strength in the previous connection. If the gateway with the highest current connection signal strength is the same as the gateway with the highest connection signal strength in the previous connection, then maintain the connection with the gateway with the highest current connection signal strength. If the gateway with the highest current connection signal strength is different from the gateway with the highest current connection signal strength, then disconnect from the gateway with the highest current connection signal strength and connect to the gateway with the highest current connection signal strength.
[0024] This embodiment assumes that device A has three additional gateways (Gateway 1, Gateway 2 and Gateway 3).
[0025] When device A executes the step "the device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value" for the first time, device A will obtain the connection signal strength values of gateways 1, 2, and 3. Assuming that the connection signal strength value of gateway 1 is greater than that of gateway 2, and the connection signal strength value of gateway 2 is greater than that of gateway 3, then gateway 1 is the gateway with the highest connection signal strength value at this time. Device A then connects to gateway 1.
[0026] After 1 second, device A executes the step "the device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value" for the second time. Device A will obtain the connection signal strength values of gateways 1, 2, and 3. Assuming that the connection signal strength value of gateway 1 is greater than that of gateway 2, and the connection signal strength value of gateway 2 is greater than that of gateway 3, then gateway 1 is currently the gateway with the highest connection signal strength value. Device A will then determine if the gateway with the highest connection signal strength value in the previous connection was also gateway 1. Since the gateway with the highest connection signal strength value in the previous connection was also gateway 1, device A continues to maintain the connection with gateway 1.
[0027] One second later, device A executes the step "the device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value" for the third time. Device A will obtain the connection signal strength values of gateways 1, 2, and 3. Assuming gateway 1 is powered off at this point, the connection signal strength value of gateway 2 is now greater than that of gateway 3, and the connection signal strength value of gateway 3 is greater than that of gateway 1. Therefore, gateway 2 is now the gateway with the highest connection signal strength value. Device A then checks if the gateway with the highest connection signal strength value in the previous step was gateway 2. Since the gateway with the highest connection signal strength value in the previous step was gateway 1 (not gateway 2), device A disconnects from gateway 1 and connects to gateway 2.
[0028] One second later, device A executes the step "the device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value" for the fourth time. Device A will obtain the connection signal strength values of gateways 1, 2, and 3. Assuming that the connection signal strength value of gateway 2 is greater than that of gateway 3, and the connection signal strength value of gateway 3 is greater than that of gateway 1, then gateway 2 is currently the gateway with the highest connection signal strength value. Device A will then determine if the gateway with the highest connection signal strength value in the previous connection was gateway 2. Since the gateway with the highest connection signal strength value in the previous connection was also gateway 2, device A continues to maintain the connection with gateway 2.
[0029] After N seconds, device A executes the step "the device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value" for the Nth time. Device A will obtain the connection signal strength values of gateways 1, 2, and 3. Assuming that power is restored to network 1 at this time, the connection signal strength value of gateway 1 is now greater than that of gateway 2, and the connection signal strength value of gateway 2 is greater than that of gateway 3. Therefore, gateway 1 is now the gateway with the highest connection signal strength value. Device A then checks whether the gateway with the highest connection signal strength value in the previous connection was gateway 1. Since the gateway with the highest connection signal strength value in the previous connection was gateway 2 (not gateway 1), device A disconnects from gateway 2 and connects to gateway 1.
[0030] In addition, in this embodiment, when device A performs the step "the device obtains the connection signal strength value of each gateway and connects with the gateway with the highest connection signal strength value", it will also simultaneously perform the step "the device obtains the first meter data and sends the obtained first meter data to the gateway currently connected to the device".
[0031] In this embodiment, the process of the device acquiring the first meter data specifically includes: If the gateway with the highest current signal strength value is different from the gateway with the highest signal strength value in the last connection, the device will acquire the first meter data at the current moment and start timing from the initial timing value; If the gateway with the highest current signal strength is the same as the gateway with the highest signal strength in the last connection, then it is determined whether the current timing value is greater than or equal to the preset timing value. If the current timing value is greater than or equal to the preset timing value, the device acquires the first meter data at the current moment and starts timing from the initial timing value.
[0032] When device A connects to the gateway (let's say gateway 1) for the first time, gateway 1 has the highest current signal strength. The gateway with the highest signal strength in the previous connection does not exist. Therefore, device A can be considered different from the gateway with the highest signal strength in the previous connection. Consequently, device A needs to obtain its first meter reading at this moment. This first meter reading may include the device's unique identifier and device parameter values. Specifically, the device parameter value could be the value of a certain parameter at the current moment, such as the current electricity consumption.
[0033] When device A disconnects from a gateway and connects to another gateway (assuming it disconnects from gateway 1 and connects to gateway 2), the gateway with the highest signal strength value in the previous connection was gateway 1, while the gateway with the highest signal strength value in the current connection is gateway 2. At this time, the gateway with the highest signal strength value in the current connection is different from the gateway with the highest signal strength value in the previous connection. Therefore, device A needs to obtain the first meter data at the current moment.
[0034] If device A is always connected to a certain gateway (let's say gateway 1), then the gateway with the highest current signal strength (gateway 1) is the same as the gateway with the highest signal strength in the last connection (gateway 1). In this case, device A only needs to obtain the first meter data once every certain period of time (e.g., every 5 minutes).
[0035] Each time device A acquires the first meter reading, it immediately sends the acquired first meter reading to the gateway currently connected to the device. For example, if device A is always connected to gateway 1, then during that period, device A will send all the first meter readings it acquires to gateway 1. If device A switches from gateway 1 to gateway 2, then device A will send the currently acquired first meter reading to gateway 2.
[0036] Figure 1 A flowchart of a dynamic network topology determination method 100 based on communication timestamps according to an embodiment of the present disclosure is shown. The method 100 further includes: Step 104. The gateway receives the first meter data, and when the gateway receives the first meter data, it obtains the communication timestamp and combines the first meter data with the communication timestamp to obtain the second meter data; the gateway sends the second meter data to the system, and the second meter data includes the device unique identifier, device parameter value, communication timestamp and gateway unique identifier.
[0037] In this embodiment, obtaining the communication timestamp specifically includes: Determine the time value at which the gateway receives the first meter data and use this time value as the communication timestamp.
[0038] Assume that Gateway 1 has received the first meter reading. Upon receiving the first meter reading, Gateway 1 immediately acquires a time value; this time value is the time when Gateway 1 received the first meter reading. Gateway 1 uses this time value as the acquired communication timestamp.
[0039] After obtaining the communication timestamp, Gateway 1 will combine the first meter data with the communication timestamp to obtain the second meter data. At this time, the second meter data includes the device's unique identifier (assuming it corresponds to device A), device parameter values, communication timestamp, and gateway's unique identifier.
[0040] After obtaining the second meter data, Gateway 1 will send the second meter data to the system.
[0041] Figure 1 A flowchart of a dynamic network topology determination method 100 based on communication timestamps according to an embodiment of the present disclosure is shown. The method 100 further includes: Step 106. The system receives the second meter data, and when the system receives the second meter data, it determines the network topology based on the second meter data.
[0042] In this embodiment, determining the network topology based on the second meter data specifically includes: The data sending gateway is determined based on the gateway's unique identifier of the second meter data, and the data acquisition device is determined based on the device's unique identifier of the second meter data. Determine whether the data acquisition device is currently located in the network topology of the data sending gateway. If the data acquisition device is currently located in the network topology of the data sending gateway, then determine that the network topology remains unchanged, and acquire the communication timestamp based on the second meter data, and use the communication timestamp as the most recent communication timestamp of the data acquisition device. If the data acquisition device is not currently located in the network topology of the data sending gateway, then the communication timestamp of the second meter data acquisition is used, and the communication timestamp is compared with the most recent communication timestamp of the data acquisition device. If the communication timestamp is after the most recent communication timestamp, the network topology is redefined so that the data acquisition device is currently located in the network topology of the data sending gateway, and the communication timestamp is used as the most recent communication timestamp of the data acquisition device; if the communication timestamp is before the most recent communication timestamp, the network topology remains unchanged.
[0043] Because Gateway 1 connects to many other devices besides Device A, it receives a lot of second-meter data. This second-meter data needs to be sent to the system in batches. In other words, when Gateway 1 receives a second-meter data point based on Device A, if there are many other second-meter data points that need to be sent to the system, this second-meter data point needs to wait in the queue and cannot be sent to the system immediately.
[0044] Suppose that while a second meter's data is waiting to be transmitted, the connection signal strength of gateway 2 suddenly becomes greater than that of gateway 1. Device A will then disconnect from gateway 1 and connect to gateway 2. In other words, the network topology at this point should be device A connected to gateway 2. Now suppose that this second meter data from gateway 1 happens to be sent to the system at this moment. Upon receiving this second meter data, the system will assume that the network topology is now that device A is connected to gateway 1, leading to an inaccurate determination of the network topology by the system.
[0045] Therefore, the second metering data in this embodiment will include a unique device identifier, a communication timestamp, and a unique gateway identifier.
[0046] When the system receives data from a second meter, it can identify the data sending gateway (let's say gateway 1) using the gateway's unique identifier in the second meter data, and identify the data receiving device (let's say device A) using the device's unique identifier in the second meter data. The network topology determined by the data receiving device and the data sending gateway is that device A is connected to gateway 1.
[0047] If the original network topology determined by the system was that device A was connected to gateway 1, then the data acquisition device was currently located in the network topology of the data sending gateway, so the network topology remained unchanged. Even if the network topology did not need to be changed, the system still needed to obtain the communication timestamp from the second meter data and use that timestamp as the most recent communication timestamp of device A.
[0048] For example, device A is always connected to gateway 1. The previous second meter reading included: Device A; Date: Year Month Day Hour 3 Minutes 28; Gateway 1. The current second meter reading includes: Device A; Date: Year Month Day Hour 8 Minutes 26; Gateway 1. Because the original network topology was Device A connected to gateway 1, and the current network topology is also Device A connected to gateway 1, the network topology remains unchanged. Furthermore, "Date: Year Month Day Hour 8 Minutes 26" is used as the most recent communication timestamp for device A.
[0049] If the network topology originally determined by the system does not involve device A connecting to gateway 1, then the data acquisition device is not currently located within the network topology of the data sending gateway. In this case, the system first needs to obtain the communication timestamp from the second meter data, and then compare the communication timestamp with the most recent communication timestamp of device A. If the communication timestamp is after the most recent communication timestamp, the network topology is redefined to connect device A to gateway 1, and the communication timestamp is used as the most recent communication timestamp of the data acquisition device. If the communication timestamp is before the most recent communication timestamp, the network topology remains unchanged.
[0050] For example, device A was originally connected to gateway 1, but now it is connected to gateway 2. The previous second meter data included: Device A; Date: Year Month Day Hour 8:08:26; Gateway 1. The current second meter data includes: Device A; Date: Year Month Day Hour 10:18; Gateway 2. The original network topology was Device A connected to gateway 1, while the network topology determined based on the current second meter data is Device A connected to gateway 2. Therefore, the communication timestamp in the current second meter data (i.e., Date: Year Month Day Hour 10:18) is compared with Device A's most recent communication timestamp (Date: Year Month Day Hour 8:08:26). Since the newly acquired communication timestamp is after Device A's most recent communication timestamp, the network topology is changed to Device A connected to gateway 2. Furthermore, "Date: Year Month Day Hour 10:18" is used as Device A's most recent communication timestamp.
[0051] For example, device A was originally connected to gateway 1, but now it is connected to gateway 2 and has been connected to gateway 2 for some time. The second meter data, which was originally cached in gateway 1 and awaiting transmission to the system, is only now being sent. The previous second meter data included: Device A; Date: XX / ...
[0052] The dynamic network topology determination method based on communication timestamps in this embodiment can accurately determine the dynamic network topology relationship through the device unique identifier, communication timestamp and gateway unique identifier in the second meter data. Even if the gateway is delayed in sending data to the system due to data backlog, it will not cause errors in determining the network topology relationship.
[0053] Figure 2 A block diagram of a dynamic network topology determination apparatus 200 based on communication timestamps according to an embodiment of the present disclosure is shown. The apparatus 200 includes: The first meter data acquisition and transmission module 202 is configured to acquire the connection signal strength value of each gateway and connect to the gateway with the highest connection signal strength value; the device acquires the first meter data and sends the acquired first meter data to the gateway currently connected to the device. The first meter data includes the device's unique identification code and device parameter values. The second meter data acquisition and transmission module 204 is configured to receive the first meter data from the gateway, and when the gateway receives the first meter data, it acquires the communication timestamp and combines the first meter data with the communication timestamp to obtain the second meter data; the gateway sends the second meter data to the system, and the second meter data includes the device unique identification code, device parameter value, communication timestamp and gateway unique identification code; The network topology determination module 206 is configured to receive second meter data from the system, and to determine the network topology based on the second meter data when the system receives the second meter data.
[0054] The first meter data acquisition and transmission module 202 includes: The gateway connection unit is configured to determine whether the gateway with the highest current connection signal strength value is the same as the gateway with the highest connection signal strength value in the previous connection. If the gateway with the highest current connection signal strength value is the same as the gateway with the highest connection signal strength value in the previous connection, the connection with the gateway with the highest current connection signal strength value is maintained; if the gateway with the highest current connection signal strength value is different from the gateway with the highest connection signal strength value in the previous connection, the connection with the gateway with the highest connection signal strength value in the previous connection is disconnected and the connection with the gateway with the highest current connection signal strength value is established.
[0055] The first meter data acquisition unit is configured to acquire the first meter data at the current moment if the gateway with the highest current signal strength value is different from the gateway with the highest signal strength value in the previous connection, and start timing from the initial timing value. If the gateway with the highest current signal strength is the same as the gateway with the highest signal strength in the last connection, then it is determined whether the current timing value is greater than or equal to the preset timing value. If the current timing value is greater than or equal to the preset timing value, the device acquires the first meter data at the current moment and starts timing from the initial timing value.
[0056] Furthermore, the second meter data acquisition and transmission module 204 specifically includes: The communication timestamp acquisition unit is configured to determine the time value at which the gateway receives the first meter data and use the time value as the communication timestamp.
[0057] Furthermore, the network topology determination module 206 specifically includes: The gateway device determination unit is configured to determine the data sending gateway based on the gateway unique identifier of the second meter data, and to determine the data acquisition device based on the device unique identifier of the second meter data. The network topology relationship determination unit is configured to determine whether the data acquisition device is currently located in the network topology relationship of the data sending gateway. If the data acquisition device is currently located in the network topology relationship of the data sending gateway, the network topology relationship is determined to remain unchanged, and the communication timestamp is obtained based on the second meter data, and the communication timestamp is used as the most recent communication timestamp of the data acquisition device. If the data acquisition device is not currently located in the network topology of the data sending gateway, then the communication timestamp of the second meter data acquisition is used, and the communication timestamp is compared with the most recent communication timestamp of the data acquisition device. If the communication timestamp is after the most recent communication timestamp, the network topology is redefined so that the data acquisition device is currently located in the network topology of the data sending gateway, and the communication timestamp is used as the most recent communication timestamp of the data acquisition device; if the communication timestamp is before the most recent communication timestamp, the network topology remains unchanged.
[0058] Figure 3 A block diagram of an electronic device 300 according to some embodiments of the present disclosure is shown. The device 300 includes a processor 301, which performs various appropriate actions and processes based on computer program instructions loaded into random access memory (RAM) 303 according to computer program instructions stored in read-only memory (ROM) 302. Various programs and data required for the operation of the device 300 may also be stored in RAM 303. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0059] The various processes and procedures described above, such as method 100, can be executed by processor 301. For example, in some embodiments, method 100 may be implemented as a software program tangibly contained in a machine-readable medium. In some embodiments, part or all of the software program may be loaded and / or installed on device 300 via ROM 302. When the software program is loaded into RAM 303 and executed by processor 301, one or more actions of method 100 described above may be performed.
[0060] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.
[0061] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0062] This disclosure can be a method, apparatus, system, and / or program product. The program product may include a machine-readable storage medium on which machine-readable program instructions for performing various aspects of this disclosure are loaded. The machine-readable program instructions described herein can be downloaded from the machine-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the machine-readable program instructions from the network and forwards them to the machine-readable storage medium in the respective computing / processing device.
[0063] Machine program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. Machine-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as a standalone software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the machine-readable program instructions. This electronic circuitry can execute the machine-readable program instructions to implement various aspects of this disclosure.
[0064] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Furthermore, although operations are depicted in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0065] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for determining dynamic network topology based on communication timestamps, characterized in that, include: The device obtains the connection signal strength value of each gateway and connects to the gateway with the highest connection signal strength value; The device acquires the first meter data and sends the acquired first meter data to the gateway currently connected to the device. The first meter data includes the device's unique identification code and device parameter values. The gateway receives the first meter data, and when the gateway receives the first meter data, it obtains the communication timestamp and combines the first meter data with the communication timestamp to obtain the second meter data; the gateway sends the second meter data to the system, and the second meter data includes a unique device identifier, device parameter values, a communication timestamp and a unique gateway identifier; The system receives second meter data, and when the system receives the second meter data, it determines the network topology based on the second meter data.
2. The method according to claim 1, characterized in that, Connecting to the gateway with the highest connection signal strength specifically includes: Determine whether the gateway with the highest current connection signal strength is the same as the gateway with the highest connection signal strength in the previous connection. If the gateway with the highest current connection signal strength is the same as the gateway with the highest connection signal strength in the previous connection, then maintain the connection with the gateway with the highest current connection signal strength. If the gateway with the highest current connection signal strength is different from the gateway with the highest current connection signal strength, then disconnect from the gateway with the highest current connection signal strength and connect to the gateway with the highest current connection signal strength.
3. The method according to claim 2, characterized in that, The equipment acquires the first meter data specifically including: If the gateway with the highest current signal strength value is different from the gateway with the highest signal strength value in the last connection, the device will acquire the first meter data at the current moment and start timing from the initial timing value; If the gateway with the highest current signal strength is the same as the gateway with the highest signal strength in the last connection, then it is determined whether the current timing value is greater than or equal to the preset timing value. If the current timing value is greater than or equal to the preset timing value, the device acquires the first meter data at the current moment and starts timing from the initial timing value.
4. The method according to claim 1, characterized in that, Obtaining the communication timestamp specifically includes: The time value at which the gateway receives the first meter data is determined, and the time value is used as the communication timestamp.
5. The method according to claim 4, characterized in that, Determining the network topology based on the second meter data specifically includes: The data sending gateway is determined based on the gateway unique identifier of the second meter data, and the data acquisition device is determined based on the device unique identifier of the second meter data. Determine whether the data acquisition device is currently located in the network topology of the data sending gateway. If the data acquisition device is currently located in the network topology of the data sending gateway, then determine that the network topology remains unchanged, and acquire the communication timestamp based on the second meter data, and use the communication timestamp as the most recent communication timestamp of the data acquisition device. If the data acquisition device is not currently located in the network topology of the data sending gateway, then the communication timestamp is acquired based on the second meter data, and the communication timestamp is compared with the most recent communication timestamp of the data acquisition device. If the communication timestamp is after the most recent communication timestamp, the network topology is redefined so that the data acquisition device is currently located in the network topology of the data sending gateway, and the communication timestamp is used as the most recent communication timestamp of the data acquisition device. If the communication timestamp is before the most recent communication timestamp, the network topology remains unchanged.
6. A device for determining dynamic network topology based on communication timestamps, characterized in that, include: The first meter data acquisition and transmission module is configured to acquire the connection signal strength value of each gateway and connect to the gateway with the highest connection signal strength value; the device acquires the first meter data and sends the acquired first meter data to the gateway currently connected to the device, the first meter data including the device's unique identification code and device parameter values; The second meter data acquisition and transmission module is configured to receive the first meter data from the gateway, and when the gateway receives the first meter data, it acquires the communication timestamp and combines the first meter data with the communication timestamp to obtain the second meter data; the gateway sends the second meter data to the system, and the second meter data includes a unique device identifier, device parameter values, a communication timestamp, and a unique gateway identifier; The network topology determination module is configured to receive second meter data from the system, and to determine the network topology based on the second meter data when the system receives the second meter data.
7. The apparatus according to claim 6, characterized in that, The first meter data acquisition and transmission module includes: The gateway connection unit is configured to determine whether the gateway with the highest current connection signal strength value is the same as the gateway with the highest connection signal strength value in the previous connection. If the gateway with the highest current connection signal strength value is the same as the gateway with the highest connection signal strength value in the previous connection, the connection with the gateway with the highest current connection signal strength value is maintained; if the gateway with the highest current connection signal strength value is different from the gateway with the highest connection signal strength value in the previous connection, the connection with the gateway with the highest connection signal strength value in the previous connection is disconnected and the connection with the gateway with the highest current connection signal strength value is established.
8. The apparatus according to claim 7, characterized in that, The first meter data acquisition and transmission module further includes: The first meter data acquisition unit is configured to acquire the first meter data at the current moment if the gateway with the highest current signal strength value is different from the gateway with the highest signal strength value in the previous connection, and start timing from the initial timing value. If the gateway with the highest current signal strength is the same as the gateway with the highest signal strength in the last connection, then it is determined whether the current timing value is greater than or equal to the preset timing value. If the current timing value is greater than or equal to the preset timing value, the device acquires the first meter data at the current moment and starts timing from the initial timing value.
9. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-5.
10. An electronic device, characterized in that, include: One or more processors, and memory associated with the one or more processors, the memory for storing program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1-5.