A method and system for obtaining a device address
By using a mechanism that confirms downlink messages broadcast by the master device and uplink messages sent by the slave device, the addresses of slave devices in the photovoltaic Internet of Things system are obtained through round-robin search. This solves the problems of low efficiency and low accuracy caused by manual operation, and achieves efficient and accurate address acquisition and networking.
Patent Information
- Application Number
- CN202511317656.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-16
AI Technical Summary
In existing photovoltaic Internet of Things (IoT) systems, obtaining device addresses relies on manual operation, resulting in low access efficiency, high costs, and poor accuracy.
The master device broadcasts downlink messages containing parameters such as the search address range, receives uplink search messages from slave devices and generates acknowledgment messages, searches in rounds and modifies the address range to form a slave device address list, replacing manual scanning and reducing invalid communication and signal congestion.
It improves the efficiency and accuracy of obtaining device addresses, reduces the risk and cost of human error, and provides reliable whitelist data for subsequent network configuration.
Smart Images

Figure CN120811882B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and more specifically to a method and system for obtaining device addresses. Background Technology
[0002] The Internet of Things (IoT) system in a photovoltaic (PV) power plant typically consists of a cloud platform, master devices, and slave devices. A cloud platform connects to multiple master devices, and a master device connects to multiple slave devices. Slave devices are used to manage and control PV panels and collect raw data from them, then send the collected data to the connected master devices. The master devices then send the received data to the cloud platform.
[0003] To achieve the above process, the master device needs to be connected to the cloud platform before the slave devices collect data, and the slave devices need to be connected to the master device. The process for slave devices to connect to the master device is as follows: First, staff scan the barcode or QR code affixed to each slave device at the factory to obtain the slave device address and device type information preset at the factory. Then, staff create a whitelist from this information and configure this whitelist to the master device associated with each slave device through the cloud platform, allowing the master device to allow the corresponding slave device to connect. Finally, the master device network is initiated through the cloud platform, enabling all slave devices to connect to their physically connected master devices.
[0004] Therefore, existing technologies rely on manual operation to obtain the device addresses for access. However, the number of slave devices in a photovoltaic Internet of Things (IoT) system is enormous. Relying on manual acquisition of slave device addresses is time-consuming and labor-intensive, and prone to human error, resulting in low access efficiency, high costs, and poor accuracy. Summary of the Invention
[0005] In view of this, the present invention provides a method and system for obtaining device addresses to solve the problems of low access efficiency, high cost and poor accuracy caused by the reliance on manual operation to obtain device addresses in the prior art.
[0006] In a first aspect, the present invention provides a method for obtaining a device address, applied to a master device, the method comprising:
[0007] A search downlink message is generated based on the search parameters and broadcast; the search parameters include at least the search address range.
[0008] If a search uplink message is received, a search acknowledgment message is generated and broadcast. The search uplink message is sent by a slave device that has not received a search acknowledgment message to the master device when it receives a search downlink message. A slave device that has not received a search acknowledgment message is a slave device that has not found its own slave device address in the search acknowledgment message.
[0009] Repeat the above search process until the search stopping condition is met, thus completing one round of search;
[0010] Modify the search address range in the search parameters, and execute the next round of search process based on the modified search parameters, until the union of the search address ranges of the downlink packets in all search rounds covers the preset address range;
[0011] Based on the search uplink messages received in all search rounds, confirm the list of slave device addresses connected to the master device.
[0012] This invention replaces traditional manual scanning to obtain slave device addresses by broadcasting downlink messages containing parameters such as the search address range. Upon receiving a search uplink message, i.e., after a slave device responds, a search confirmation message is generated and broadcast, avoiding duplicate searches, reducing invalid communication, and improving network efficiency. By repeating the above search process of broadcasting, receiving, and generating confirmation messages until the search stops, slave devices that fail to respond in time due to signal delays, momentary interference, etc., can be covered, reducing the probability of omissions in a single search. Modifying the search address range and repeating the search process after each round of search can distribute a large number of slave devices across multiple rounds of search, avoiding signal congestion caused by too many responding devices in a single round. Finally, the uplink messages from multiple rounds of search are summarized, and a slave address list is obtained by confirming them, providing accurate whitelist data for subsequent network deployment. By sending messages to make slave devices respond with their own device addresses, manual operation is replaced, reducing the risk and cost of human error. Furthermore, round-based searching can reduce network signal congestion, and the automatically generated slave device address list provides a reliable basis for subsequent cloud platform whitelist configuration and network startup, improving access efficiency.
[0013] In one optional implementation, the search parameters include the search interval response time;
[0014] If a search uplink message is received, before generating and broadcasting a search acknowledgment message, the method further includes:
[0015] Determine the range difference of the search address range for the downlink packets;
[0016] The product of the range difference and the search interval response time is determined as the first waiting time;
[0017] During the first waiting period, receive all search uplink messages arriving at the master device.
[0018] This invention calculates the first waiting time of the master device by using the range difference and the interval time, and uses it as the time window for the master device to receive search uplink messages. This can avoid the low search efficiency caused by the master device waiting indefinitely, and ensure that all possible uplink messages are received within the window.
[0019] In one optional implementation, the search parameters further include a signature location, which indicates the position of the signature in the slave device address;
[0020] Based on the search uplink messages received in all search rounds, confirm the list of slave device addresses connected to the master device, including:
[0021] An initial address list is generated based on the search uplink messages received in all search rounds;
[0022] Modify the feature code position in the search parameters to zero;
[0023] The search downlink message is regenerated based on the modified search parameters and broadcast.
[0024] If a search uplink message is received, a search acknowledgment message is generated and broadcast.
[0025] Based on the received search uplink message, supplement the initial address list to obtain the slave device address list;
[0026] Confirm from the device address list.
[0027] This invention summarizes the uplink messages received by range-based search to form an initial address list, modifies the feature code position in the search parameters to zero to perform a full search, integrates the newly added slave device addresses in the full search into the initial list to fill any omissions that may exist in the range-based search, and finally searches and confirms the supplemented list again to improve the completeness and accuracy of address acquisition.
[0028] In one alternative implementation, searching for uplink messages includes both device address and current data;
[0029] Confirm the list of device addresses, including:
[0030] For each slave device address in the slave device address list, obtain the current data from the search uplink message corresponding to the slave device address;
[0031] If the current data is zero, a data read downlink message is sent to the slave device corresponding to the slave device address;
[0032] Receive data sent from the device, read uplink messages, and complete one round of supplementary acquisition;
[0033] Repeat the above supplementary acquisition process until the preset number of supplementary acquisition rounds is reached, and obtain the data read uplink messages received in all supplementary acquisition rounds.
[0034] For each slave device address, if the current data in all data reads of the uplink messages corresponding to the slave device is zero, then the slave device address of the slave device will be removed from the slave device address list.
[0035] This invention confirms the address list using current data and supplements it through multiple rounds during the confirmation process, taking into account environmental interference and preventing normal slave devices from being incorrectly removed. This ensures that the final slave address list only contains slave devices that are actually physically connected to the current master device, thus improving the accuracy of address acquisition.
[0036] In a second aspect, the present invention provides a method for obtaining a device address, applied to a slave device, the method comprising:
[0037] Upon receiving a search downlink message, it determines whether a search confirmation has been received. The search downlink message is generated and broadcast by the master device based on search parameters, which include at least the search address range.
[0038] If no search confirmation message has been received from the master device, or if the slave device address is not found in the search confirmation message, then no search confirmation has been received; the search confirmation message is generated and broadcast by the master device after receiving the search uplink message.
[0039] If no confirmation is obtained through the search, determine whether the device address is within the search address range of the downlink search message;
[0040] If the device address is within the search address range, a search uplink message is generated and sent to the master device.
[0041] This invention performs a search confirmation check upon receiving a downlink search message to avoid duplicate searches. If no confirmation is received, it checks if the device is within the search address range. This prevents irrelevant devices from sending messages, reduces network bandwidth consumption and signal interference, and ensures the master device only processes the slave devices currently requiring coverage, thus improving search accuracy. If the device is within the range, it sends an uplink message to the master device, providing data for automatic address acquisition.
[0042] In an optional implementation, after determining whether a search confirmation has been obtained upon receiving a search downlink message, the method further includes:
[0043] If a search confirmation message has been received from the master device and the search confirmation message matches the search downlink message, then the search downlink message is ignored after the search confirmation is received.
[0044] After determining whether the device address is within the search address range for the search downlink packet, the method further includes:
[0045] If the device address is not within the search address range, then the search downlink packets are ignored.
[0046] This invention avoids duplicate response messages by ignoring search downlink messages when a device confirms a search, and avoids unrelated devices occupying network resources by ignoring messages when the device is not within the search address range, thereby reducing interference with effective communication.
[0047] In one alternative implementation, the downlink message is searched for a signature location, which is used to indicate the location of the signature in the slave device address.
[0048] Determining whether the slave device address is within the search address range for downlink packets includes:
[0049] Extract the signature from the device address based on the location indicated by the signature location;
[0050] Determine whether the signature is within the search address range of the downlink message.
[0051] This invention performs precise range filtering by judging the feature code and search address range, ensuring that each search only processes the target device, and processes a large number of slave devices in batches, avoiding network signal congestion caused by centralized processing and improving communication efficiency.
[0052] In one optional implementation, the search downlink message includes a search interval response time;
[0053] Send a search uplink message to the master device, including:
[0054] Determine the relative sorting result of the feature codes within the search address range;
[0055] Determine the product of the relative sorting result and the search interval response time, and sum the product with the random time to determine the second waiting time;
[0056] After the second waiting period, a search uplink message is sent to the master device.
[0057] This invention ensures that different slave devices can respond in time slots by determining a second waiting time when a slave device sends a message, thereby avoiding signal concentrating conflicts caused by disordered transmission and improving the communication success rate.
[0058] In one alternative implementation, the method further includes:
[0059] Receive data and read downlink messages;
[0060] If the slave device address matches the slave device address in the data read downlink message, the current current data is obtained to form a data read uplink message, and the data read uplink message is sent to the master device corresponding to the data read downlink message.
[0061] This invention reads downlink messages by receiving data and forms uplink messages from the current current data when the addresses match. This helps determine whether the slave device and the master device have an actual physical connection, thereby helping to generate an accurate slave device address list.
[0062] Thirdly, the present invention provides a system for obtaining device addresses, the system comprising a master device and a slave device, and performing the following steps:
[0063] The master device generates a search downlink message based on the search parameters and broadcasts the search downlink message; the search parameters include at least: a search address range;
[0064] When the device receives a search downlink message, it determines whether a search confirmation has been obtained.
[0065] If a slave device has not received a search confirmation message from the master device, or has not found its own slave device address in the search confirmation message, then it has not been searched and confirmed.
[0066] If the slave device has not been confirmed by the search, then determine whether the slave device address is within the search address range of the search downlink message;
[0067] If the device address is within the search address range, the slave device generates a search uplink message and sends the search uplink message to the master device.
[0068] If the master device receives a search uplink message, it generates and broadcasts a search confirmation message.
[0069] The main device repeats the above search process until the search stopping condition is met, thus completing one round of search.
[0070] The master device modifies the search address range in the search parameters and executes the next round of search process based on the modified search parameters until the union of the search address ranges of the downlink packets in all search rounds covers the preset address range.
[0071] The master device confirms the list of slave device addresses connected to the master device based on the search uplink messages received in all search rounds.
[0072] Fourthly, the present invention provides a device for obtaining a device address, applied to a master device, the device comprising:
[0073] The sending module is used to generate a search downlink message based on the search parameters and broadcast the search downlink message; wherein the search parameters include at least: a search address range;
[0074] The generation module is used to generate and broadcast a search acknowledgment message if a search uplink message is received. The search uplink message is sent to the master device by a slave device that has not received a search acknowledgment message when it receives a search downlink message. The slave device that has not received a search acknowledgment message is a slave device that has not found its own slave device address in the search acknowledgment message.
[0075] The first search module is used to repeatedly execute the above search process until the search stopping condition is met, thus completing one round of search.
[0076] The second search module is used to modify the search address range in the search parameters and execute the next round of search process based on the modified search parameters until the union of the search address ranges of the downlink packets in all search rounds covers the preset address range.
[0077] The confirmation module is used to confirm the list of slave device addresses connected to the master device based on the search uplink messages received in all search rounds.
[0078] Fifthly, the present invention provides a device for obtaining a device address, applied to a slave device, the device comprising:
[0079] The first judgment module is used to determine whether a search confirmation has been obtained when a search downlink message is received; wherein, the search downlink message is generated and broadcast by the master device according to the search parameters, and the search parameters include at least the search address range;
[0080] The search confirmation module is used to determine whether a search confirmation has been performed if a search confirmation message has not been received from the master device or if the slave device address is not found in the search confirmation message. The search confirmation message is generated and broadcast by the master device after receiving the search uplink message.
[0081] The second judgment module is used to determine whether the slave device address is within the search address range of the search downlink message if no search confirmation has been obtained.
[0082] The first sending module is used to generate a search uplink message and send the search uplink message to the master device if the slave device address is within the search address range.
[0083] In a sixth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the slave device address acquisition method of the first aspect or any corresponding embodiment described above, or to perform the slave device address acquisition method of the second aspect or any corresponding embodiment described above.
[0084] In a seventh aspect, the present invention provides a computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a computer to perform the slave device address acquisition method of the first aspect or any corresponding embodiment thereof, or to perform the slave device address acquisition method of the second aspect or any corresponding embodiment thereof. Attached Figure Description
[0085] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0086] Figure 1 This is a schematic diagram of an Internet of Things (IoT) system in a photovoltaic power plant according to an embodiment of the present invention;
[0087] Figure 2 This is a flowchart of a method for obtaining the slave device address of a master device according to an embodiment of the present invention;
[0088] Figure 3 This is a flowchart of a method for obtaining a slave device address applied to a slave device according to an embodiment of the present invention;
[0089] Figure 4 This is a flowchart illustrating the interaction between the master and slave devices in a system for obtaining device addresses, according to an embodiment of the present invention.
[0090] Figure 5 This is a schematic diagram of an Internet of Things (IoT) system in another photovoltaic power station according to an embodiment of the present invention;
[0091] Figure 6 This is a structural block diagram of a slave device address acquisition device applied to a master device according to an embodiment of the present invention;
[0092] Figure 7 This is a structural block diagram of a slave device address acquisition device applied to a slave device according to an embodiment of the present invention;
[0093] Figure 8 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0094] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0095] Figure 1 This is a schematic diagram of an Internet of Things (IoT) system in a photovoltaic power plant according to an embodiment of the present invention, such as... Figure 1 As shown, a cloud platform connects to multiple master devices, and each master device connects to multiple slave devices. Technical personnel manually scan for slave device addresses and configure these addresses to the master devices via the cloud platform to achieve master-slave networking. However, the number of slave devices in a photovoltaic IoT system is enormous. Relying on manual methods would consume a significant amount of time and manpower, and is prone to human error, resulting in low access efficiency, high costs, and poor accuracy. This invention replaces manual operation by sending messages to enable slave devices to respond with their own device addresses, reducing the risk and cost of human error. Furthermore, round-robin searching reduces network signal congestion, and the automatically generated slave device address list provides a reliable basis for subsequent cloud platform whitelist configuration and network initiation, improving access efficiency.
[0096] According to an embodiment of the present invention, a method embodiment for obtaining a device address is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0097] This embodiment provides a method for obtaining device addresses, applied to a master device. Figure 2 This is a flowchart of a method for obtaining a slave device address applied to a master device according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0098] Step S201: Generate a search downlink message based on the search parameters and broadcast the search downlink message; wherein, the search parameters include at least: the search address range.
[0099] Specifically, in a photovoltaic (PV) power plant, the master device is typically a data concentrator, while slave devices include intelligent shutdown devices, intelligent optimizers, etc. Due to the large number of slave devices in a PV power plant, generating and broadcasting messages using search parameters can trigger slave devices to automatically report preset device addresses, replacing traditional manual scanning. These search parameters are set before each search round, including the master device address, search sequence number, search interval response time, signature location, and search address range. The master device address refers to the unique identifier of the master device itself, avoiding cross-device interference in multi-master scenarios; the search sequence number marks the current search round, preventing duplicate searches; the search interval response time is a preset value used to determine the waiting time in this search round; the signature location indicates the position of the signature in the slave device address; and the search address range limits the range of slave devices covered in this search round. The master device generates a downlink search message using the above search parameters and broadcasts this message to the slave devices in the PV power plant. This broadcasting method can simultaneously cover all slave devices, improving the efficiency of large-scale slave device networking operations.
[0100] Step S202: If a search uplink message is received, a search acknowledgment message is generated and broadcast; wherein, the search uplink message is sent by a slave device that has not received a search acknowledgment to the master device when it receives a search downlink message, and the slave device that has not received a search acknowledgment is a slave device that has not found its own slave device address in the search acknowledgment message.
[0101] Specifically, slave devices that have not been searched will generate a search uplink message containing their own slave device address based on the search downlink message and send it to the master device. After receiving the search uplink message, the master device generates a search acknowledgment message containing the addresses of these slave devices and broadcasts it. This acknowledgment mechanism prevents slave devices that have already been searched from participating in subsequent searches in the same round, thereby avoiding duplicate reporting by slave devices, reducing the number of messages sent in the system, and improving the overall communication efficiency of the system.
[0102] Step S203: Repeat the above search process until the search stopping condition is met, thus completing one round of search.
[0103] Specifically, the search stops when the number of searches reaches a preset number to avoid inefficiency caused by indefinite searching. Alternatively, the search stops when no more uplink search messages are received after a preset number of consecutive searches, indicating that the slave devices within the search address range have essentially responded. Optionally, the above search stopping conditions are merely examples and are not intended to be limiting. By repeating steps S201 and S202, a preset time can be waited after each search before the next search is performed, until the search stopping condition is reached, completing one round of searching. This can cover slave devices that did not respond in time due to signal delays, transient interference, or other accidental factors, ensuring that no slave device within the current search address range is missed.
[0104] Step S204: Modify the search address range in the search parameters, and execute the next round of search process based on the modified search parameters, until the union of the search address ranges of the downlink messages in all search rounds covers the preset address range.
[0105] Specifically, the search address range is determined by the number of bits in the feature code, which can be flexibly set according to the scale of the slave devices in the photovoltaic power plant. It is important to clarify that the slave device address is unique, while the feature code is a set of bits extracted from the slave device address based on its position. Therefore, the feature code is not unique and cannot be used to identify slave devices. The feature code is set to facilitate address searching in rounds.
[0106] For example, if the signature is in the 11th position, the number of bits is 1, and the corresponding preset address range is 0~9; if the signature is in the 11th-12th position, the number of bits is 2, and the corresponding preset address range is 00~99; if the signature is in the 10th-12th position, the number of bits is 3, and the preset address range is 000~999; if the signature is in the 9th-12th position, the number of bits is 4, and the preset address range is 0000~9999; and so on, with a maximum of 12 bits.
[0107] It's easy to understand that the more slave devices in a photovoltaic power station, the more signatures are needed, and the more locations of these signatures become. This ensures that each signature doesn't correspond to too many slave devices. If the aforementioned preset address range is used as the search address range for a single round of search, it would lead to concentrated packet transmission, causing network signal congestion and affecting the transmission of other data when the number of slave devices is large. Therefore, a preliminary search address range is determined, and this range is modified after each round of search until the union of the search address ranges from all search rounds covers the corresponding preset address range, at which point the search stops. By performing round-based searches, a large number of devices are distributed across multiple rounds of processing, avoiding signal congestion while ensuring that all possible slave device addresses are covered, balancing efficiency and completeness.
[0108] Assuming the feature code in this search is located at the 11th bit, with a bit length of 1, the corresponding preset address range is 0-9. The first round of search sets the address range to 0-4. Therefore, slave devices with addresses "xxxxxxxxxx0x", "xxxxxxxxxx1x", "xxxxxxxxxx2x", "xxxxxxxxxx3x", and "xxxxxxxxxx4x" (where x represents any number from 0 to 9) need to respond in this round of search. The second round of search sets the address range to 5-9. Therefore, slave devices with addresses "xxxxxxxxxx5x", "xxxxxxxxxx6x", "xxxxxxxxxx7x", "xxxxxxxxxx8x", and "xxxxxxxxxx9x" need to respond in this round of search. In this way, two rounds of search cover 0-9, thus covering all slave devices. Optionally, the search address range for each round of search can also be flexibly set. For example, the search address range for the first round of search can be set to 0~2, the search address range for the second round of search can be set to 3~5, and the search address range for the third round of search can be set to 6~9. As long as the union of all search rounds covers the preset address range, it is sufficient.
[0109] Alternatively, assuming the signature is located at the 10th and 11th bits, and the first round of search address range is set to 00~09, then slave devices with addresses “xxxxxxxxx00x”, “xxxxxxxxx01x”, “xxxxxxxxx02x”, “xxxxxxxxx03x”…“xxxxxxxxx09x” all need to respond during this round of search. The second round of search address range is 10~19, and so on, with the 10th round of search address range being 90~99. Thus, the preset address range of 00~99 is covered through 10 rounds of search. Optionally, the search address ranges in each round of search can be continuous or non-contiguous, overlapping or non-overlapping, as long as the union of all search rounds covers the preset address range. This embodiment of the invention does not restrict the setting of the search address range for each round.
[0110] Step S205: Based on the search uplink messages received in all search rounds, confirm the list of slave device addresses connected to the master device.
[0111] Specifically, the search uplink message carries the address of the slave device. The master device summarizes the search uplink messages received in all search rounds, removes duplicate addresses, and forms a slave device address list, laying the foundation for slave devices to access the master device and realizing the automation and intelligence of the process of obtaining the whitelist required for networking.
[0112] This invention replaces traditional manual address scanning by broadcasting downlink messages containing parameters such as the search address range. Upon receiving a search uplink message (i.e., after a slave device responds), a search confirmation message is generated and broadcast, avoiding duplicate searches, reducing invalid communication, and improving network efficiency. By repeating the search process of broadcasting search downlink messages, receiving search uplink messages, and generating confirmation messages until the search stops, slave devices that fail to respond in time due to signal delays, momentary interference, etc., can be covered, reducing the probability of omissions in a single search. Modifying the search address range and repeating the search process after each round of search can distribute a large number of slave devices across multiple rounds of search, avoiding signal congestion caused by too many responding devices in a single round. Finally, the uplink messages from multiple rounds of search are summarized, and a slave address list is obtained by confirming them, providing accurate basic data for subsequent network operations. By sending messages to make slave devices respond with their own device addresses, manual operation is replaced, reducing the risk and cost of human error. Furthermore, round-based searching reduces network signal congestion, and the automatically generated slave device address list provides a reliable basis for subsequent cloud platform whitelist configuration and network startup, improving access efficiency.
[0113] This embodiment provides a method for obtaining a device address, applied to a slave device. Figure 3 This is a flowchart of a method for obtaining a slave device address applied to a slave device according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0114] Step S301: Upon receiving a search downlink message, determine whether a search confirmation has been obtained; wherein, the search downlink message is generated and broadcast by the master device based on search parameters, and the search parameters include at least the search address range.
[0115] Specifically, each time a slave device receives a search downlink message, it first determines whether it has already been searched by the master device corresponding to the search downlink message, thus avoiding duplicate responses from the slave device to the same master device and improving search efficiency.
[0116] Step S302: If no search confirmation message has been received from the master device, or the slave device address has not been found in the search confirmation message, then no search confirmation has been performed; wherein, the search confirmation message is generated and broadcast by the master device after receiving the search uplink message.
[0117] Specifically, a search acknowledgment message is a response message generated by the master device after receiving a search uplink message. It contains the addresses of all slave devices found in the search. Therefore, there are three scenarios in which a slave device has not received a search acknowledgment: First, it has not received a search downlink message from the master device, meaning it has not participated in any search by the master device; second, although it has received a search downlink message, the message does not contain its own slave device address, meaning the master device has not found the slave device; third, although it has received a search downlink message matching the search range and a search acknowledgment message, the search acknowledgment message does not contain its own slave device address, meaning the master device has not successfully received the search uplink message sent by the slave device.
[0118] Step S303: If no search confirmation has been obtained, determine whether the slave device address is within the search address range of the search downlink message.
[0119] Specifically, the search address range includes the search range of the master device in this round of search. Therefore, by determining whether the slave device address is within the search address range, it is possible to determine whether the slave device is within the search range of the master device, thereby accurately filtering out the slave devices that need to respond to this search, avoiding slave devices that are out of range from sending messages, and further reducing network signal congestion.
[0120] In step S304, if the slave device address is within the search address range, a search uplink message is generated and sent to the master device.
[0121] Specifically, if the slave device address is within the search address range, the slave device generates a search uplink message and unicasts it to the master device, enabling automatic acquisition of the slave device address. The unicast method reduces signal interference, improves communication efficiency, and ensures information accuracy. The search uplink message includes the slave device address, slave device type, and current current data.
[0122] This invention performs a search confirmation check upon receiving a downlink search message to avoid duplicate searches. If no confirmation is received, it checks if the device is within the search address range. This prevents irrelevant devices from sending messages, reduces network bandwidth consumption and signal interference, and ensures the master device only processes the slave devices currently requiring coverage, thus improving search accuracy. If the device is within the range, it sends an uplink message to the master device, providing data for automatically obtaining the slave device's address.
[0123] This embodiment provides a system for obtaining device addresses, which includes a master device and a slave device. Figure 4 This is a flowchart illustrating the interaction between the master and slave devices in a system for obtaining device addresses, according to an embodiment of the present invention. Figure 4As shown, the master device generates a search downlink message based on the search parameters and broadcasts it. The search parameters include at least a search address range. When a slave device receives a search downlink message, it determines whether a search confirmation has been received. If the slave device has not received a search confirmation message from the master device, or has not found its own slave device address in the search confirmation message, then no search confirmation has been received. If the slave device has not received a search confirmation, it determines whether its address is within the search address range of the search downlink message. If the slave device address is within the search address range, the slave device generates a search uplink message and sends it to the master device. If the master device receives the search uplink message, it generates and broadcasts a search confirmation message. The master device repeats the above search process until the search stopping condition is met, completing one round of search. The master device modifies the search address range in the search parameters and executes the next round of search based on the modified search parameters until the union of the search address ranges of the search downlink messages from all search rounds covers the preset address range. Based on the search uplink messages received in all search rounds, the master device confirms the list of slave device addresses connected to the master device.
[0124] In some optional implementations, the slave device address acquisition system includes a master device and a slave device, and the detailed process of the system includes the following steps:
[0125] Step S401: The master device generates a search downlink message based on the search parameters and broadcasts the search downlink message; wherein, the search parameters include at least: a search address range. For details, please refer to [link to relevant documentation]. Figure 2 Step S201 of the illustrated embodiment will not be described again here.
[0126] Step S402: When the slave device receives a search downlink message, it determines whether a search confirmation has been obtained. For details, please refer to [link to relevant documentation]. Figure 3 Step S301 of the illustrated embodiment will not be described again here.
[0127] Step S403: If the slave device has not received a search acknowledgment message from the master device, or has not found its own slave device address in the search acknowledgment message, then no search acknowledgment has been performed. For details, please refer to [link to relevant documentation]. Figure 3 Step S302 of the illustrated embodiment will not be described again here.
[0128] In step S404, if the slave device has received a search confirmation message sent by the master device, and the search confirmation message matches the search downlink message, then the search downlink message is ignored after the search confirmation.
[0129] Specifically, if a slave device has received a search acknowledgment message from the master device, and the slave device address in that message matches its own address, and the search sequence number and master device address in the acknowledgment message are identical to those in the received search downlink message, then the two messages are considered a match, and the slave device is deemed to have received search confirmation. In this case, the slave device will directly ignore the currently received search downlink message, preventing duplicate responses from the same master device. This precise acknowledgment mechanism ensures that slave devices already searched by the master device do not respond repeatedly, and avoids misjudgments due to information mismatches. This ensures search integrity while reducing network communication pressure.
[0130] Step S405: If the slave device has not been confirmed by the search, determine whether the slave device address is within the search address range of the search downlink message. The search downlink message carries the signature location, which is used to indicate the position of the signature in the slave device address.
[0131] Specifically, step S405 includes:
[0132] Step S4051: Extract the feature code from the device address according to the location indicated by the feature code location.
[0133] Specifically, the slave device address must be unique, and its form can be a MAC address (Media Access Control Address) or a factory-preset identification code. The identification code is generated at the factory according to a preset naming rule, and each bit of the identification code is represented by BCD (Binary-Coded Decimal) code. When the master device sets the signature code position, the core principle is to select a distinctive part of the slave device address, without needing to search using the entire slave device address, effectively reducing communication pressure. Taking the slave device address as an identification code as an example, bits 9-12 are the production serial number, which is unique for each device and suitable as the signature code position. Since all slave devices follow the same address naming rule, the master device can pre-determine the signature code position according to the rule before searching and send it to the slave device via a search downlink message. After receiving it, the slave device directly extracts data from the corresponding position in its own address as the signature code, based on the position indicated by the signature code.
[0134] Step S4052: The device determines whether the signature code is within the search address range of the search downlink message.
[0135] Specifically, after extracting the signature from the device, it is necessary to determine whether the signature falls within the search address range specified in the search downlink message, thereby filtering out the slave devices that need to respond in this search.
[0136] Step S406: If the slave device address is not within the search address range, the slave device ignores the search downlink packets.
[0137] Specifically, if the extracted signature from the device is not within the search address range (e.g., signature 15, while the search address range is 00-05), the device is determined not to belong to the search. In this case, the device will directly ignore the packet, preventing irrelevant devices from consuming network resources. By using signature matching and search address range analysis for precise range filtering, each search processes only the target device, allowing for batch processing of a large number of devices and avoiding network signal congestion caused by centralized processing, thus improving communication efficiency.
[0138] Step S407: If the device address is within the search address range, the device generates a search uplink message and sends a search uplink message to the master device. The search downlink message includes the search interval response time.
[0139] Specifically, step S407 above, which sends a search uplink message to the master device, includes:
[0140] Step S4071: Determine the relative sorting result of the feature codes within the search address range from the device.
[0141] Specifically, if the device address is within the search address range, the relative ranking of its signature within that range is determined: using the starting value of the search address range as a base, the difference between the signature and the starting value is calculated, and then 1 is added. For example, if the signature is 04 and the current search address range is 00~09, then 04 ranks 5 within 00~09; if the signature is 13 and the current search address range is 10~19, then 13 ranks 4 within 10~19.
[0142] Step S4072: Determine the product of the relative sorting result and the search interval response time from the device, and determine the sum of the product and the random time as the second waiting time.
[0143] Specifically, the search interval response time is generally measured in seconds, and the random time is generally measured in milliseconds; the specific values can be set according to actual needs. Since different slave devices may have the same signature, meaning their relative sorting results may be the same, the product of the corresponding relative sorting result and the search interval response time will also be the same. By adding a random time to this product, the waiting times of these slave devices can be made different, thus staggering the timing of sending search uplink messages.
[0144] Step S4073: After the second waiting time, the slave device sends a search uplink message to the master device.
[0145] Specifically, since there may be a large number of slave devices found each time, if these slave devices send messages simultaneously in a short period of time, it will cause interference between signals and lead to message errors. Therefore, a second waiting time is calculated for each slave device, so that each slave device waits for its corresponding waiting time before unicasting and sending messages, which greatly reduces the probability of communication failure caused by network signal congestion.
[0146] Step S408: The master device determines the range difference of the search address range for the search downlink packets.
[0147] Specifically, after sending the search downlink message, the master device needs to calculate the range difference of the search address range: the difference between the maximum and minimum values of the search range. For example, if the search address range is 10~15, then the range difference is 15-10=5.
[0148] In step S409, the master device determines the first waiting time as the product of the range difference and the search interval response time.
[0149] Specifically, the range difference is the product of the search interval response time as the first waiting time, which is used as the time window for the master device to receive the search uplink message.
[0150] Step S410: During the first waiting period, the master device receives all search uplink messages arriving at the master device.
[0151] Specifically, the master device receives the search uplink message during the first waiting time. This not only controls the duration of each search round through a fixed window, but also ensures that all uplink messages that meet the conditions are received, providing complete data support for the subsequent generation of search confirmation messages and the completion of device identification.
[0152] Step S411: If the master device receives a search uplink message, it generates and broadcasts a search acknowledgment message. For details, please refer to [link to relevant documentation]. Figure 2 Step S202 of the illustrated embodiment will not be described again here.
[0153] Step S412: The master device repeats the above search process until the search stopping condition is met, completing one round of search. For details, please refer to [link to relevant documentation]. Figure 2 Step S203 of the illustrated embodiment will not be described again here.
[0154] Step S413: The master device modifies the search address range in the search parameters and executes the next round of search based on the modified search parameters until the union of the search address ranges of the downlink packets from all search rounds covers the preset address range. For details, please refer to [link to relevant documentation]. Figure 2 Step S204 of the illustrated embodiment will not be described again here.
[0155] In step S414, the master device confirms the list of slave device addresses connected to the master device based on the search uplink messages received in all search rounds. The search parameters also include the signature location, which is used to indicate the position of the signature in the slave device address.
[0156] Specifically, step S414 includes:
[0157] Step S4141: Generate an initial address list based on the search uplink messages received in all search rounds.
[0158] Specifically, the slave device addresses in all the uplink messages obtained through the above steps are used as the initial address list.
[0159] In step S4142, the master device modifies the feature code position in the search parameters to zero.
[0160] Specifically, after completing the range-based search, the master device modifies the feature code position in the search parameters to 0, canceling the feature code extraction requirement. This means that all slave devices do not need to determine whether the feature code is within the range; as long as it hasn't been confirmed by the master device, they must respond to the search. Range-based searches may miss some devices due to signal interference, slave device delays, etc., while a full search with the feature code position at 0 can cover all slave devices, effectively filling in any gaps.
[0161] In step S4143, the master device regenerates the search downlink message based on the modified search parameters and broadcasts the search downlink message.
[0162] Specifically, the master device regenerates the search downlink message based on the modified search parameters and broadcasts it to all slave devices, triggering a full search. All slave devices that have not been acknowledged by the master device, upon receiving the message, do not need to determine if the signature is within the specified range and directly proceed to the response process.
[0163] Step S4144: If the master device receives a search uplink message, it generates and broadcasts a search acknowledgment message. For details, please refer to [link to relevant documentation]. Figure 2 Step S202 of the illustrated embodiment will not be described again here.
[0164] Step S4145: Based on the received search uplink message, supplement the initial address list to obtain the slave device address list.
[0165] Specifically, the master device integrates the slave device addresses from all the uplink search messages received during the full search process into the existing initial address list, thereby supplementing and updating the list to form a more complete and accurate slave device address list. This provides a reliable basis for subsequent cloud platform confirmation and network configuration, reducing the risk of missing data collection due to device omissions.
[0166] Step S4146: Confirm the list of device addresses.
[0167] In some optional implementations, step S4146 above includes:
[0168] Step a1: For each slave device address in the slave device address list, the master device obtains the current data from the search uplink message corresponding to the slave device address.
[0169] Specifically, Figure 5 This is a schematic diagram of an Internet of Things (IoT) system in another photovoltaic power station according to an embodiment of the present invention, such as... Figure 5 As shown, in this embodiment, the main device is a concentrator. The system contains concentrators 1 to n, each corresponding to one inverter, and each inverter connects to multiple photovoltaic strings. Before any concentrator initiates the search process, the connection circuits of the inverters corresponding to other concentrators need to be disconnected. That is, when concentrator 1 searches, K1 is connected, and K2 to Kn are disconnected, ensuring that the current in strings 1-1 to 1-m is not zero, while the current in other strings is zero. When concentrator 2 searches, K2 is connected, and K1 and K3 to Kn are disconnected; and so on. Ideally, concentrator 1 only communicates with the slave devices in strings 1-1 to 1-m. However, in real-world scenarios, signal crosstalk exists, and concentrator 1 may establish communication connections with slave devices in other strings, such as string n-1. If concentrator 1 finds a slave device in string n-1, it needs to verify the obtained slave device address list using current data to confirm whether the found slave device belongs to concentrator 1.
[0170] In some optional implementations, if there is only one master device in the IoT system of the photovoltaic power station, it is impossible for it to communicate with other master devices in the network. Therefore, there is no need for current verification. The slave device address list supplemented in step S418 is taken as the final slave device address list and can be reported to the cloud platform for staff confirmation.
[0171] In step a2, if the current data is zero, the master device sends a data read downlink message to the slave device corresponding to the slave device address.
[0172] Specifically, when the master device detects that the current data of a slave device is zero, it needs to unicast a data read downlink message to the slave device, instructing it to re-report the current current data.
[0173] Step a3: Read downlink packets from the device receiving data.
[0174] Specifically, the device receives data from the master device, reads downlink messages, and prepares to supplement and report current data.
[0175] Step a4: If the slave device address is consistent with the slave device address in the data read downlink message, the slave device obtains the current current data to form a data read uplink message and sends the data read uplink message to the master device corresponding to the data read downlink message.
[0176] Specifically, the device verifies the address in the downlink message of the received data. If it matches its own address, it immediately generates an uplink message for the currently collected current data and sends it to the master device via unicast.
[0177] Step a5: The master device receives the data read uplink message sent by the slave device and completes one round of supplementary acquisition.
[0178] Specifically, the master device receives the uplink message from all slave devices whose current data is 0, thus completing a supplementary data acquisition for zero-current devices.
[0179] Step a6: The master device repeats the above supplementary acquisition process until the number of supplementary acquisition rounds reaches the preset number of rounds, and obtains the data read uplink messages received in all supplementary acquisition rounds.
[0180] Specifically, since a single zero current may be caused by instantaneous environmental factors, such as cloudy weather or a shadow blocking the photovoltaic panel, the main equipment repeats steps S419-S423 to perform a preset number of supplementary acquisitions in order to eliminate environmental interference and reduce misjudgments.
[0181] Step a7: For each slave device address, if the current data in all rounds of uplink messages read by the slave device is zero, the master device removes the slave device address from the slave device address list.
[0182] Specifically, in the string path of the physical connection of the master device, a normal slave device should have continuous current, while a misconnected slave device will always have zero current. Therefore, if a slave device collects 0 current data in all preset rounds of supplementary acquisition, then the slave device does not belong to the physical connection range of the current master device, and its address is removed from the slave device address list. This ensures that the final slave address list only contains slave devices with actual physical connections, providing accurate slave device information for subsequent cloud platform confirmation and networking.
[0183] This invention replaces traditional manual address scanning by broadcasting downlink messages containing parameters such as the search address range. Upon receiving an uplink search message (i.e., after a slave device responds), a search confirmation message is generated and broadcast, avoiding duplicate searches, reducing invalid communication, and improving network efficiency. By repeating the search process of broadcasting, receiving, and generating confirmation messages until the search stops, slave devices that fail to respond in time due to signal delays, momentary interference, etc., can be covered, reducing the probability of omissions in a single search. Modifying the search address range and repeating the search process after each round of search can distribute a large number of slave devices across multiple rounds of search, avoiding signal congestion caused by too many responding devices in a single round. Finally, the uplink messages from multiple rounds of search are summarized, and a slave address list is obtained by confirming them, providing accurate basic data for subsequent network deployment. By sending messages to make slave devices respond with their own device addresses, manual operation is replaced, reducing the risk and cost of human error. Furthermore, round-based searching reduces network signal congestion, and the automatically generated slave device address list provides a reliable basis for subsequent cloud platform whitelist configuration and network startup, improving access efficiency.
[0184] This embodiment also provides a device for obtaining a device address, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0185] This embodiment provides a device for obtaining device address, applied to a master device, such as... Figure 6 As shown, it includes:
[0186] The sending module 601 is used to generate a search downlink message based on the search parameters and broadcast the search downlink message; wherein the search parameters include at least the search address range.
[0187] The generation module 602 is used to generate and broadcast a search acknowledgment message if a search uplink message is received; wherein, the search uplink message is sent by a slave device that has not received a search acknowledgment to the master device when it receives a search downlink message, and the slave device that has not received a search acknowledgment is a slave device that has not found its own slave device address in the search acknowledgment message.
[0188] The first search module 603 is used to repeatedly execute the above search process until the search stopping condition is met, thus completing one round of search.
[0189] The second search module 604 is used to modify the search address range in the search parameters and execute the next round of search process based on the modified search parameters until the union of the search address ranges of the downlink messages in all search rounds covers the preset address range.
[0190] The confirmation module 605 is used to confirm the list of slave device addresses connected to the master device based on the search uplink messages received in all search rounds.
[0191] In some optional implementations, the search parameters include the search interval response time;
[0192] Generation module 602, the device further includes:
[0193] The first determining module is used to determine the range difference of the search address range for searching downlink packets.
[0194] The second determining module is used to determine the first waiting time by multiplying the range difference and the search interval response time.
[0195] The receiving module is used to receive all search uplink messages arriving at the master device during the first waiting period.
[0196] In some optional implementations, the search parameters also include a signature location, which indicates the position of the signature in the slave device address;
[0197] Confirmation module 605 includes:
[0198] The first generation unit is used to generate an initial address list based on the search uplink messages received in all search rounds.
[0199] The modification unit is used to change the position of the feature code in the search parameters to zero.
[0200] The sending unit is used to regenerate the search downlink message based on the modified search parameters and broadcast the search downlink message.
[0201] The second generation unit is used to generate and broadcast a search acknowledgment message if a search uplink message is received.
[0202] The supplementary unit is used to supplement the initial address list based on the received search uplink message to obtain the slave device address list.
[0203] The confirmation unit is used to confirm the list of device addresses.
[0204] In some alternative implementations, searching for uplink messages includes both device address and current data;
[0205] The confirmation unit includes:
[0206] The acquisition sub-unit is used to acquire current data from the search uplink message corresponding to each slave device address in the slave device address list.
[0207] The transmitting subunit is used to send a data read downlink message to the slave device corresponding to the slave device address if the current data is zero.
[0208] The receiving subunit is used to receive data read uplink messages sent by the device and complete a round of supplementary acquisition.
[0209] The supplementary acquisition subunit is used to repeat the above supplementary acquisition process until the number of supplementary acquisition rounds reaches the preset number of rounds, and to obtain the data read uplink messages received in all supplementary acquisition rounds.
[0210] The removal sub-unit is used to remove the slave device address from the slave device address list if the current data in all data read uplink messages corresponding to each slave device address is zero.
[0211] This embodiment provides a device for obtaining device address, applied to a slave device, such as... Figure 7 As shown, it includes:
[0212] The first judgment module 701 is used to determine whether a search confirmation has been obtained when a search downlink message is received; wherein, the search downlink message is generated and broadcast by the master device according to the search parameters, and the search parameters include at least the search address range.
[0213] The search confirmation module 702 is used to confirm that no search has been performed if no search confirmation message has been received from the master device or if the slave device address is not found in the search confirmation message. The search confirmation message is generated and broadcast by the master device after receiving the search uplink message.
[0214] The second judgment module 703 is used to determine whether the slave device address is within the search address range of the search downlink message if no search confirmation has been obtained.
[0215] The first sending module 704 is used to generate a search uplink message and send the search uplink message to the master device if the slave device address is within the search address range.
[0216] In some alternative implementations, after the first determination module 701, the device further includes:
[0217] The first ignore module is used to ignore the search downlink message if a search confirmation message sent by the master device has been received and the search confirmation message matches the search downlink message.
[0218] Following the second judgment module 703, the device also includes:
[0219] The second ignore module is used to ignore the search downlink packet if the slave device address is not within the search address range.
[0220] In some optional implementations, the downlink message is searched for a signature location, which is used to indicate the location of the signature in the slave device address;
[0221] The second judgment module 703 includes:
[0222] The first determining unit is used to extract the feature code from the device address according to the position indicated by the feature code position.
[0223] The judgment unit is used to determine whether the signature code is within the search address range of the search downlink message.
[0224] In some optional implementations, the search downlink message includes a search interval response time;
[0225] The first transmitting module 704 includes:
[0226] The second determining unit is used to determine the relative sorting result of the feature code within the search address range;
[0227] The second determining unit is used to determine the product of the relative sorting result and the search interval response time, and to determine the sum of the product and the random time as the second waiting time.
[0228] The sending unit is used to send a search uplink message to the master device after a second waiting period.
[0229] In some alternative embodiments, the device further includes:
[0230] The receiving module is used to receive data and read downlink messages.
[0231] The second sending module is used to obtain the current current data to form a data reading uplink message if the slave device address is consistent with the slave device address in the data reading downlink message, and send the data reading uplink message to the master device corresponding to the data reading downlink message.
[0232] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0233] In this embodiment, the device address acquisition device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0234] This invention also provides a computer device having the above-described features. Figure 6 or Figure 7 The device shown is for obtaining device addresses.
[0235] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 8 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take a processor 10 as an example.
[0236] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0237] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0238] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0239] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0240] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0241] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0242] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0243] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for obtaining a device address, characterized in that, Applied to a master device, the method includes: A search downlink message is generated based on the search parameters and broadcast; wherein, the search parameters include at least: a search address range and a feature code position, and the feature code position is used to indicate the position of the feature code in the slave device address; If a search uplink message is received, a search confirmation message is generated and broadcast; wherein, the search uplink message is sent by a slave device that has not been searched and confirmed to the master device when it receives the search downlink message, and the slave device that has not been searched and confirmed to be confirmed is a slave device that has not found its own slave device address in the search confirmation message, and the search uplink message includes the slave device address and current data; Repeat the above search process until the search stopping condition is met, thus completing one round of search; Modify the search address range in the search parameters, and execute the next round of search process based on the modified search parameters until the union of the search address ranges of the downlink messages in all search rounds covers the preset address range, which is determined by the feature code position; Based on the search uplink messages received in all search rounds, confirm the list of slave device addresses that have been connected to the master device; The step of confirming the list of slave device addresses accessing the master device based on the search uplink messages received in all search rounds includes: An initial address list is generated based on the search uplink messages received in all search rounds; Modify the feature code position in the search parameters to zero; The search downlink message is regenerated based on the modified search parameters and broadcast. If a search uplink message is received, a search confirmation message is generated and broadcast. Based on the received search uplink message, the initial address list is supplemented to obtain the slave device address list; Confirm the list of device addresses; The confirmation of the slave device address list includes: For each slave device address in the slave device address list, current data is obtained from the search uplink message corresponding to the slave device address; If the current data is zero, a data read downlink message is sent to the slave device corresponding to the slave device address; Receive the data read uplink message sent by the slave device to complete one round of supplementary acquisition; Repeat the above supplementary acquisition process until the preset number of supplementary acquisition rounds is reached, and obtain the data read uplink messages received in all supplementary acquisition rounds. For each slave device address, if the current data in all data read uplink messages corresponding to the slave device is zero, then the slave device address of the slave device is removed from the slave device address list.
2. The method according to claim 1, characterized in that, The search parameters include the search interval and response time; Before generating and broadcasting a search acknowledgment message if a search uplink message is received, the method further includes: Determine the range difference of the search address range for the search downlink message; The product of the range difference and the search interval response time is determined as the first waiting time; During the first waiting period, all search uplink messages arriving at the master device are received.
3. A method for obtaining a device address, characterized in that, Applied to a slave device, the method includes: Upon receiving a search downlink message, it is determined whether a search confirmation has been obtained. The search downlink message is generated and broadcast by the master device based on search parameters, which include at least: a search address range and a feature code position. The feature code position is used to indicate the location of the feature code in the slave device address. If no search confirmation message has been received from the master device, or if the slave device address is not found in the search confirmation message, then no search confirmation has been made; wherein, the search confirmation message is generated and broadcast by the master device after receiving the search uplink message, and the search uplink message includes the slave device address and current data; If no search confirmation is obtained, it is determined whether the slave device address is within the search address range of the search downlink message; If the slave device address is within the search address range, a search uplink message is generated and sent to the master device; The above process is repeated until the master device meets the search stop condition and completes one round of search, so that the master device can modify the search address range in the search parameters and execute the next round of search based on the modified search parameters, until the union of the search address ranges of the downlink messages of all search rounds covers the preset address range, which is determined by the feature code position, and the slave device address list accessing the master device is confirmed based on the search uplink messages received in all search rounds. The step of confirming the list of slave device addresses accessing the master device based on the search uplink messages received in all search rounds includes: An initial address list is generated based on the search uplink messages received in all search rounds; Modify the feature code position in the search parameters to zero; The search downlink message is regenerated based on the modified search parameters and broadcast. If a search uplink message is received, a search confirmation message is generated and broadcast. Based on the received search uplink message, the initial address list is supplemented to obtain the slave device address list; Confirm the list of device addresses; The confirmation of the slave device address list includes: For each slave device address in the slave device address list, current data is obtained from the search uplink message corresponding to the slave device address; If the current data is zero, a data read downlink message is sent to the slave device corresponding to the slave device address; Receive the data read uplink message sent by the slave device to complete one round of supplementary acquisition; Repeat the above supplementary acquisition process until the preset number of supplementary acquisition rounds is reached, and obtain the data read uplink messages received in all supplementary acquisition rounds. For each slave device address, if the current data in all data read uplink messages corresponding to the slave device is zero, then the slave device address of the slave device is removed from the slave device address list.
4. The method according to claim 3, characterized in that, Upon receiving a search downlink message, after determining whether a search confirmation has been obtained, the method further includes: If a search confirmation message sent by the master device has been received, and the search confirmation message matches the search downlink message, then the search downlink message is ignored after the search confirmation. After determining whether the slave device address is within the search address range of the search downlink packet, the method further includes: If the slave device address is not within the search address range, the search downlink message is ignored.
5. The method according to claim 3, characterized in that, The search downlink message carries a signature location, which is used to indicate the position of the signature in the slave device address; The step of determining whether the slave device address is within the search address range of the search downlink packet includes: The feature code is extracted from the slave device address based on the position indicated by the feature code position; Determine whether the feature code is within the search address range of the search downlink message.
6. The method according to claim 5, characterized in that, The search downlink message includes the search interval response time; Sending the search uplink message to the master device includes: Determine the relative sorting result of the feature code within the search address range; The product of the relative sorting result and the search interval response time is determined, and the sum of the product and the random time is determined as the second waiting time; After the second waiting time, the search uplink message is sent to the master device.
7. The method according to claim 3, characterized in that, The method further includes: Receive data and read downlink messages; If the slave device address is consistent with the slave device address in the data read downlink message, then the current current data is obtained to form a data read uplink message, and the data read uplink message is sent to the master device corresponding to the data read downlink message.
8. A system for obtaining device address, characterized in that, The system includes a master device and a slave device, and performs the following steps: The master device generates a search downlink message based on the search parameters and broadcasts the search downlink message; wherein, the search parameters include at least: a search address range and a feature code position, and the feature code position is used to indicate the position of the feature code in the slave device address; When the slave device receives a search downlink message, it determines whether a search confirmation has been obtained. If the slave device has not received a search confirmation message from the master device, or if its own slave device address is not found in the search confirmation message, then the search has not been confirmed. If the slave device has not been confirmed by the search, it is determined whether the slave device address is within the search address range of the search downlink message; If the slave device address is within the search address range, the slave device generates a search uplink message and sends the search uplink message to the master device. The search uplink message includes the slave device address and current data. If the master device receives a search uplink message, it generates and broadcasts a search confirmation message. The master device repeats the above search process until the search stopping condition is met, thus completing one round of search. The master device modifies the search address range in the search parameters and executes the next round of search process based on the modified search parameters until the union of the search address ranges of the downlink packets in all search rounds covers the preset address range, which is determined by the feature code position. The master device confirms the list of slave device addresses connected to the master device based on the search uplink messages received in all search rounds. The step of confirming the list of slave device addresses accessing the master device based on the search uplink messages received in all search rounds includes: An initial address list is generated based on the search uplink messages received in all search rounds; Modify the feature code position in the search parameters to zero; The search downlink message is regenerated based on the modified search parameters and broadcast. If a search uplink message is received, a search confirmation message is generated and broadcast. Based on the received search uplink message, the initial address list is supplemented to obtain the slave device address list; Confirm the list of device addresses; The confirmation of the slave device address list includes: For each slave device address in the slave device address list, current data is obtained from the search uplink message corresponding to the slave device address; If the current data is zero, a data read downlink message is sent to the slave device corresponding to the slave device address; Receive the data read uplink message sent by the slave device to complete one round of supplementary acquisition; Repeat the above supplementary acquisition process until the preset number of supplementary acquisition rounds is reached, and obtain the data read uplink messages received in all supplementary acquisition rounds. For each slave device address, if the current data in all data read uplink messages corresponding to the slave device is zero, then the slave device address of the slave device is removed from the slave device address list.
Citation Information
Patent Citations
Site information searching method and device, master site, slave site, system and medium
CN119892155A