A method and system for automatic ordering of devices based on wireless signal strength

By collecting signal strength data through Bluetooth communication between devices, automatically identifying endpoints and central devices, constructing a physical sequence linked list and assigning logical addresses, the problem of low sorting efficiency and poor adaptability of photovoltaic devices is solved, and low-cost, high-reliability automatic sorting is achieved.

CN122160720APending Publication Date: 2026-06-05SHANGHAI MOKUN NEW ENERGY TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI MOKUN NEW ENERGY TECH
Filing Date
2026-03-10
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, the sequencing of photovoltaic equipment relies on manual intervention, which is inefficient and prone to errors, cannot adapt to changes in equipment position, and high-precision positioning technology is too expensive.

Method used

Signal strength data is collected through Bluetooth communication between devices, the sum of signal strength values ​​is calculated, endpoints and central devices are identified, a physical sequential linked list is constructed and logical addresses are assigned to achieve automatic sorting.

Benefits of technology

It achieves low-cost, high-reliability automatic sorting of photovoltaic equipment, with a one-to-one correspondence between logical addresses and physical locations, adapting to equipment changes and reducing operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122160720A_ABST
    Figure CN122160720A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of wireless communication, in particular to a device automatic sequencing method and system based on wireless signal strength, which comprises the following steps: multiple devices enter a ranging mode, perform wireless communication with each other and collect signal strength data between each other; according to the collected signal strength data, the signal strength total value of each device is calculated, and the end-point device and the center device in the physical arrangement are identified according to the signal strength total value. The application automatically calculates the signal strength total value and identifies the end-point device and the center device by collecting the signal strength data between the devices, then constructs a physical order linked list and allocates a logical address; the relative order between the devices is accurately derived, so that the logical address and the physical position are one-to-one corresponding; meanwhile, the resequencing can be automatically triggered when the devices change, the problems of low efficiency and easy error in manual sequencing are solved, the automatic sequencing of photovoltaic devices is realized in a high-reliability and low-cost mode, and the application has good practical value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wireless communication technology, and in particular to a method and system for automatic device sorting based on wireless signal strength. Background Technology

[0002] In photovoltaic tracking systems or module arrays, devices are typically installed in rows, either linearly or in a matrix. For ease of monitoring and management, logical addresses need to be assigned to each device according to their physical location. Traditionally, this relies on manual intervention: during installation, staff set the address for each device individually, or after installation, on-site testing determines the correspondence between address and location. Furthermore, the industry has attempted to achieve automatic sorting using distance measurement between devices, such as proximity detection based on Bluetooth Received Signal Strength Indication (RSSI). However, due to the susceptibility of RSSI to environmental influences, a mature and reliable automatic sorting solution has not yet been developed.

[0003] Existing technologies have significant shortcomings: manual numbering is not only inefficient but also prone to data corruption due to omissions, duplicates, or misalignments; in wireless or parallel topologies, device addresses and physical locations are difficult to correlate one-to-one, making it impossible for maintenance personnel to visually assess the actual device layout from the monitoring interface; when device locations change, are added, or deleted, the address sorting cannot be automatically updated, requiring manual reconfiguration, which increases maintenance costs and the risk of errors. Although high-precision positioning technologies (such as GPS and UWB) can achieve accurate positioning, their cost is too high and they are too redundant for applications requiring only relative order. There is a lack of low-cost technologies that can automatically obtain the relative order of devices without manual intervention. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method and system for automatic device sorting based on wireless signal strength, which utilizes the distribution characteristics of RSSI between devices to overcome the shortcomings of existing technologies such as excessive manual intervention, lack of adaptability, and high cost.

[0005] In a first aspect, embodiments of the present invention provide a method for automatically ranking devices based on wireless signal strength, the method comprising: Multiple devices enter ranging mode, communicate wirelessly with each other, and collect signal strength data between them; Based on the collected signal strength data, the sum of the signal strength of each device is calculated, and the endpoint devices and central devices in the physical arrangement are identified based on the sum of the signal strength. Select the starting device for sorting from the identified endpoint devices, and determine the nearest device of the current device one by one based on the signal strength data and distribution characteristics between each device, and construct a physical order linked list containing all devices; Logical addresses are assigned to each device based on the physical order linked list, thus completing the automatic sorting.

[0006] In conjunction with the first aspect, the wireless communication is Bluetooth communication, and the signal strength data is the received signal strength indicator (RSSI) value, the steps include: For each device, it periodically broadcasts its own identifier and scans the broadcast messages of other devices in the vicinity. After multiple samplings, an RSSI dataset between each device and its surrounding devices is formed. The RSSI dataset is an N×N matrix, where N is the total number of devices, and the diagonal elements of the matrix are empty.

[0007] In conjunction with the first aspect, the steps of calculating the sum of signal strength for each device based on the collected signal strength data, and identifying the endpoint devices and central devices in the physical arrangement based on the sum of signal strength values, include: Based on the corresponding strength data of the equipment, calculate the sum of the absolute values ​​of RSSI between the equipment and all other equipment, and use it as the sum of the RSSI values ​​of the equipment; Compare the combined RSSI values ​​of all devices, and determine the two devices with the smallest combined RSSI values ​​as the two endpoint devices in the physical arrangement; If the total number of devices is odd, the device with the largest RSSI value will be identified as the central device in the physical arrangement. If the total number of devices is even, the two devices with the largest RSSI values ​​will be identified as devices in the central area.

[0008] In conjunction with the first aspect, the steps of selecting the starting end device from the identified end devices, determining the nearest neighbor device of the current device sequentially based on the signal strength data and distribution characteristics between each device, and constructing a physical order linked list containing all devices include: Select one of the two endpoint devices as the starting endpoint device; The starting device is designated as the target device and added to the physical order linked list; the remaining devices form an unsorted set of devices. Obtain the RSSI values ​​between the target device and each unsorted device in the unsorted device set, and determine candidate neighboring devices based on the RSSI distribution pattern of the target device; Based on the RSSI value and confidence parameters of the candidate neighboring devices, a comprehensive score is calculated, and the unranked device with the highest score is determined as the target neighboring device of the target device. Add the target's neighboring devices to the physical order linked list, update the target's neighboring devices to the new target devices, and remove them from the unsorted device set until the unsorted device set is empty, thus obtaining a physical order linked list containing all devices.

[0009] In conjunction with the first aspect, the steps for determining candidate neighboring devices based on the RSSI distribution pattern of the target device include: If the RSSI distribution of the target device exhibits a single-peak steep drop, then the target device is determined to have only one candidate neighbor device. If the RSSI distribution of the target device is bimodal and relatively symmetrical, then the target device is determined to be located in the middle of the array and has two candidate neighboring devices.

[0010] In conjunction with the first aspect, after determining candidate neighboring devices based on the RSSI distribution pattern of the target device, the method further includes: If a proximity conflict is detected between two candidate neighboring devices, the conflict resolution mechanism is activated. Conflict resolution mechanisms include: triggering a round of directed RSSI retest, or having the node with the highest current confidence level among the candidate neighboring devices or the central device act as the arbitration node to make a decision.

[0011] In conjunction with the first aspect, the steps of automatically sorting devices by allocating logical addresses to each device based on the physical order linked list include: Based on the physical order linked list, with the starting device as the first priority, incremental logical address numbers are assigned to each device in sequence; Write the logical address sequence numbers into the address storage units of the corresponding devices to complete the address configuration.

[0012] In conjunction with the first aspect, after automatically sorting devices by allocating logical addresses according to the physical order linked list, the process also includes: Initiate sequence verification and continuously monitor signal strength changes; When a device is added, removed, or its location is changed, the physical sequence list and logical address are automatically updated.

[0013] Secondly, this application also provides an automatic device sorting system based on wireless signal strength for performing the above method; the system includes multiple devices, each device including: The Bluetooth communication module is used to enter ranging mode, periodically broadcast its own identifier and scan the broadcast messages of other surrounding devices, and collect the received signal strength index (RSSI) values ​​between them. The sum value calculation module is used to calculate the sum value of RSSI of this device based on the collected RSSI values. The sum value of RSSI is the sum of the absolute values ​​of RSSI of all other devices received by this device. The endpoint center identification module is used to obtain the sum of RSSI values ​​of all devices and identify the endpoint devices and center devices in the physical arrangement based on the sum of RSSI values. The sorting linked list construction module is used to select the sorting start device from the identified endpoint devices, determine the nearest neighbor device of the current device based on the RSSI values ​​and distribution characteristics between each device, and construct a physical order linked list containing all devices. The address allocation module is used to allocate logical addresses to this device according to the physical sequential linked list.

[0014] In conjunction with the second aspect, the system also includes a main controller, which is used to obtain the physical sequential linked list and send logical addresses to each device via wired or wireless communication.

[0015] Thirdly, this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor runs the computer program to cause the electronic device to perform the above-described method.

[0016] Fourthly, this application provides a readable storage medium storing computer program instructions, which are read and executed by a processor to perform the above-described method.

[0017] The embodiments of the present invention bring the following beneficial effects: This application provides a method and system for automatic device sorting based on wireless signal strength. The method includes: multiple devices entering ranging mode, communicating wirelessly with each other and collecting signal strength data between them; calculating the sum of signal strength for each device based on the collected signal strength data, and identifying endpoint devices and center devices in the physical arrangement based on the sum of signal strength; selecting the starting endpoint device for sorting from the identified endpoint devices, and successively determining the nearest neighbor device of the current device based on the signal strength data and distribution characteristics between each device, constructing a physical order linked list containing all devices; and assigning logical addresses to each device according to the physical order linked list to complete the automatic sorting.

[0018] This invention provides an automatic device sorting method based on wireless signal strength. By collecting signal strength data between devices, the method automatically calculates the sum of signal strength values ​​and identifies endpoints and central devices, thereby constructing a physical order linked list and assigning logical addresses. By accurately deriving the relative order between devices, it ensures a one-to-one correspondence between logical addresses and physical locations. Furthermore, it can automatically trigger resorting when devices change, solving the problems of low efficiency and error-proneness of manual sorting. This invention achieves automatic sorting of photovoltaic devices in a highly reliable and low-cost manner, and has good practical value.

[0019] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0021] 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.

[0022] Figure 1 A flowchart illustrating an automatic device sorting method based on wireless signal strength, provided in an embodiment of the present invention; Figure 2 A schematic diagram of an automatic device sorting system based on wireless signal strength is provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the electronic device structure provided in an embodiment of the present invention.

[0023] Figure label: 10-Bluetooth communication module, 20-Total value calculation module, 30-Endpoint center identification module, 40-Sorted linked list construction module, 50-Address allocation module; 130 - Processor, 131 - Memory, 132 - Bus, 133 - Communication interface. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions 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.

[0025] To facilitate understanding of this embodiment, the technical terms used in this application will be briefly introduced below.

[0026] Bluetooth Low Energy (BLE) modules are communication modules that integrate Bluetooth Low Energy technology. They are characterized by low cost, low power consumption, and the ability to act as both broadcasters and scanners, enabling the construction of peer-to-peer communication networks between devices.

[0027] Received Signal Strength Indication (RSSI): This refers to the signal power value measured by the Bluetooth receiver when receiving a signal, which can be used to roughly estimate the distance between devices.

[0028] Device Identifier: A unique identifier used to distinguish each device. It can be a Bluetooth MAC address, serial number, or a temporarily generated random code, and is carried in broadcast messages to identify the device.

[0029] RSSI sum: refers to the sum of the absolute values ​​of RSSI received by a device from all other devices. By comparing the sum of RSSI values ​​of each device, the position of the device in the physical arrangement (such as the endpoint or center) can be determined.

[0030] Interconnected ranging mode: This refers to the working mode in which the device, after being powered on, simultaneously acts as a broadcasting device (periodically sending its own identifier) ​​and a scanning device (listening to surrounding broadcasts), spontaneously collecting and exchanging signals.

[0031] Physical sequence linked list: refers to an ordered list constructed according to the actual arrangement order of devices in space, which is used to assign logical addresses to each device later.

[0032] After introducing the technical terms used in this application, the application scenarios and design concepts of the embodiments of this application will be briefly described below.

[0033] Photovoltaic equipment needs to be numbered sequentially according to its physical location. Existing methods rely on manual setting of each unit, which is inefficient, prone to errors, and cannot be automatically updated after equipment changes, resulting in a disconnect between address and location.

[0034] Based on this, this application provides a method and system for automatic device sorting based on wireless signal strength.

[0035] Example 1 This application provides a method for automatic device sorting based on wireless signal strength, combined with... Figure 1 As shown, the method includes: S110: Multiple devices enter ranging mode, communicate wirelessly with each other, and collect signal strength data between them.

[0036] S120 calculates the sum of signal strength for each device based on the collected signal strength data, and identifies the endpoint devices and central devices in the physical arrangement based on the sum of signal strength.

[0037] S130: Select the sorting start device from the identified endpoint devices, and determine the nearest neighbor device of the current device one by one based on the signal strength data and distribution characteristics between each device, and construct a physical order linked list containing all devices.

[0038] S140 assigns logical addresses to each device according to the physical order linked list, thus completing automatic sorting.

[0039] This application automatically calculates the sum of signal strength values ​​by collecting signal strength data between devices, identifies endpoints and the central device, and then determines the nearest neighbor relationship to construct a complete physical order linked list. Finally, it assigns logical addresses to each device. The entire process requires no manual intervention, solving the problems of error-prone and inefficient manual numbering. Furthermore, this method accurately derives the order of devices in the physical arrangement based on signal strength distribution characteristics, ensuring a one-to-one correspondence between logical addresses and physical locations in linear, wireless, or parallel topology scenarios, overcoming the difficulty in confirming physical locations. On this basis, by continuously monitoring signal strength changes, it automatically triggers reordering when devices are added, removed, or their locations change, achieving adaptive adjustment of the system and avoiding the maintenance costs and error risks associated with manual reconfiguration. In addition, this method only requires integrating a low-power Bluetooth module and can complete the sorting using conventional RSSI metrics, eliminating the need for high-precision positioning devices such as GPS and UWB or complex fingerprint database construction. This significantly reduces hardware and deployment costs while meeting the application requirements of only relative order. In this way, this application realizes the automatic identification of the physical sequence of photovoltaic equipment and the automatic allocation of logical addresses in a low-cost, highly reliable, and adaptive manner, overcoming many defects of the prior art, and has good practical value and promotion prospects.

[0040] In this embodiment, step S110 aims to establish a communication foundation for subsequent signal strength data acquisition, specifically: First, a BLE module is integrated into each device (specifically, a photovoltaic device in this embodiment). Upon power-up, all devices automatically enter an interconnected ranging mode, which employs a decentralized peer-to-peer network architecture: each device simultaneously acts as both a Bluetooth advertiser and a scanner. As an advertiser, each device periodically sends broadcast messages carrying its own identification information, which can be the device's factory MAC address, serial number, or a temporarily generated random code. As a scanner, each device continuously listens for broadcast messages sent by other nearby devices.

[0041] This simultaneous transmit and receive mode allows devices to spontaneously form an interconnected network without relying on a main controller or central node. When a device scans a broadcast message from a neighboring device, it records the identifier of the other party in the message and measures the received signal strength. This process continues, performing multiple scans over several seconds, enabling each device to collect multiple signal strength values ​​with all other surrounding devices.

[0042] In this way, step S110 establishes a fully interconnected Bluetooth communication environment, providing raw signal strength detection data for subsequent steps. This initialization process does not rely on external infrastructure and can be completed using only the device's integrated BLE module, meeting the practical needs of low cost and easy deployment at photovoltaic sites. Furthermore, due to the use of a periodic broadcast and scanning mechanism, the system can adapt to changes in the number of devices: newly added devices automatically join the interconnected ranging network upon power-on, requiring no manual configuration.

[0043] In conjunction with the first aspect, the wireless communication is Bluetooth communication, and the signal strength data is the Received Signal Strength Indicator (RSSI) value. Step S110 specifically includes: S111, each device periodically broadcasts its own identifier and scans the broadcast messages of other devices in the vicinity. After multiple samplings, an RSSI dataset between each device and its surrounding devices is formed. The RSSI dataset is an N×N matrix, where N is the total number of devices, and the diagonal elements of the matrix are empty.

[0044] In this embodiment, the device automatically enters the interconnected ranging mode after power-on. This mode adopts a decentralized peer-to-peer network architecture, where each device simultaneously acts as a Bluetooth advertiser and a scanner. When acting as an advertiser, each device periodically sends broadcast messages containing its own identifier (such as device ID, Bluetooth MAC address, or temporary random code). When acting as a scanner, each device continuously listens for broadcast messages from other surrounding devices.

[0045] When a device scans for BLE broadcasts from other nearby devices, it records the device identifier of the other device and measures the received RSSI value. After multiple scans over a preset time (e.g., several seconds), each device can collect multiple RSSI values ​​with all other surrounding devices. Through this collection process, the system can construct an N×N RSSI dataset, in the following form: N is the total number of devices participating in the sorting; This dataset can be represented in matrix form, where rows represent receiving devices and columns represent broadcasting devices; The element in the i-th row and j-th column of the matrix represents the RSSI value received by device i from device j; Since the device does not measure its own signal, the diagonal elements in the matrix (i.e., the positions where i=j) are empty.

[0046] This RSSI dataset fully records the signal strength relationships between all pairs of devices, providing basic data support for subsequent RSSI sum calculation, endpoint device identification, and proximity relationship derivation.

[0047] In conjunction with the first aspect, step S120 includes: S210, Based on the corresponding strength data of the equipment, calculate the sum of the absolute values ​​of RSSI between the equipment and all other equipment, and use it as the sum of the RSSI values ​​of the equipment; S220, compare the sum of RSSI values ​​of all devices, and determine the two devices with the smallest sum of RSSI values ​​as the two endpoint devices in the physical arrangement; S230, if the total number of devices is odd, the device with the largest RSSI value is determined as the central device in the physical arrangement; S240, if the total number of devices is even, the two devices with the largest RSSI sum will be identified as devices in the central area.

[0048] Based on the signal strength data collected in step S110 (i.e., the RSSI dataset obtained in step S111), step S120 automatically identifies the endpoint devices and central devices in the physical arrangement by calculating the sum of RSSI values ​​for each device and comparing the sum values ​​of each device.

[0049] In step S210, each device extracts the RSSI values ​​of all other devices received by itself based on the signal strength data from step S110.

[0050] Since RSSI values ​​are typically expressed as negative numbers (e.g., -60 dBm), a larger value (i.e., a smaller absolute value) indicates a weaker signal, while a smaller value (i.e., a larger absolute value) indicates a stronger signal. To facilitate comparison of the sum of signal strengths, this step takes the absolute value of each RSSI value and then sums them to obtain the total RSSI value for the device. The mathematical expression is as follows:

[0051] in, For equipment The combined RSSI value, For equipment Received device RSSI value, This represents the total number of devices. This total value reflects the equipment... The total signal strength received from all other devices.

[0052] In a lined array of devices, the magnitude of this sum value is closely related to the device's position: a device in the middle can simultaneously receive signals from multiple devices on its left and right sides, resulting in a larger sum value; while devices at both ends can only receive signals from one side, resulting in a smaller sum value. This physical characteristic provides the basis for identification in this step.

[0053] Subsequently, step S220 sorts and compares the RSSI sum values ​​of all devices, and the two devices with the smallest RSSI sum values ​​are determined to be the two endpoint devices in the physical arrangement. This is because, under an ideal linear arrangement, an endpoint device has only one neighbor, receiving fewer signals with relatively weaker strength, thus resulting in the smallest sum value. If a device is isolated (e.g., far away from other devices), its sum value will also be extremely small. However, this application addresses the normal scenario of devices installed in a row, where the two minimum values ​​correspond to the two endpoints.

[0054] Subsequently, step S230 determines the device with the largest RSSI sum as the central device in the physical arrangement.

[0055] When the total number of devices is odd, the device with the highest sum of RSSI values ​​is identified as the central device in the physical arrangement. With an odd number of devices arranged in a line, the device in the very center receives signals from an equal number of devices on its left and right sides, and its distance from its neighbors is relatively balanced. Therefore, the device receives the largest total signal strength, and its sum of RSSI values ​​is the global maximum. Identifying this central device provides a crucial reference point for subsequent neighbor relationship deduction.

[0056] When the total number of devices is even, the two devices with the highest sum of RSSI values ​​are both identified as central area devices. When an even number of devices are arranged in a row, there is no single device in the exact middle; instead, there are two devices located in the central area (i.e., the last one in the left half and the first one in the right half). Both of these devices can receive strong signals from both sides, and their sum of RSSI values ​​is close and is among the largest of all devices. Identifying these two devices as central area devices helps to more accurately handle the symmetry under even-numbered arrangements when constructing the physical order linked list later, avoiding misjudgments caused by taking only a single maximum value.

[0057] It should be noted that the above determination is based on a typical linear installation of the devices, with relatively uniform spacing between them and a relatively stable signal propagation environment. During the RSSI summation calculation, preprocessing such as averaging multiple samples effectively suppresses transient interference and improves the accuracy of the determination. The identified endpoint and center devices will provide crucial references for selecting the starting point for sorting and deriving proximity relationships in subsequent steps.

[0058] After identifying the endpoint devices and the central device, the system enters the physical sequence linked list construction phase. The core of this phase is to start from the selected starting endpoint device, utilize the distribution characteristics and confidence mechanism of RSSI between devices, and iteratively determine the nearest neighbor device for each device, ultimately generating a complete device arrangement order.

[0059] In conjunction with the first aspect, step S130 includes: S131, Select one of the two endpoint devices as the starting endpoint device.

[0060] As one feasible approach, one of the two endpoint devices can be randomly selected as the starting point; As another feasible approach, a deterministic selection can be made by combining the device identifier, for example, selecting the one with the smallest RSSI value and the smallest device ID number as the starting point.

[0061] In this embodiment, the latter method is preferred to ensure the uniqueness and reproducibility of the sorting process. The starting device will serve as the initial node for subsequent proximity relationship derivation.

[0062] S132, select the starting device as the target device and add it to the physical order linked list, and the remaining devices form an unsorted set of devices.

[0063] The selected starting device is designated as the target device and added to the physical order list, marked as sorted. The remaining N-1 devices constitute the unsorted device set U. At this point, the physical order list contains only the starting device, and the unsorted device set contains all other devices to be sorted.

[0064] S133, obtain the RSSI values ​​between the target device and each unsorted device in the unsorted device set, and determine candidate neighboring devices based on the RSSI distribution pattern of the target device.

[0065] From the RSSI dataset constructed in step S111, extract the RSSI values ​​between the current target device and each candidate neighboring device in the unsorted device set U. Simultaneously, analyze the RSSI distribution pattern of the target device. This distribution pattern refers to the distribution characteristics of the RSSI values ​​received by the target device from all surrounding devices in the intensity dimension, specifically including the number of peaks, peak intensity, and symmetry.

[0066] S134. Based on the RSSI measurement value and the corresponding confidence parameter, a comprehensive score is calculated, and the unranked device with the highest score is determined as the nearest neighbor device of the target device.

[0067] A confidence parameter is associated with each set of RSSI values. This parameter comprehensively reflects the reliability of the RSSI values ​​and is calculated based on the following factors: the stability of RSSI over time (the fluctuation range of multiple sampled values), the consistency of historical measurements (whether the trend is reasonable compared to past periods), and the signal fluctuation (the magnitude of variance over a short period). Understandably, the smaller the fluctuation, the higher the consistency, and the smaller the variance, the higher the confidence level.

[0068] Based on the RSSI value and its confidence parameter, a comprehensive score is calculated for the target device and each device in the unsorted device set U. The scoring formula can use a weighted summation method, for example:

[0069] Among them, the target device Unsorted devices detected The RSSI score, For target equipment Received unsorted The absolute value of RSSI, For the corresponding confidence level parameter, and The preset weighting coefficients are used (which can be adjusted according to the actual scenario, for example, each set to 0.5). The higher the score, the greater the probability that Y is the nearest neighbor device of X. Among all unsorted devices, the device with the highest score is selected as the nearest neighbor device of the target device X.

[0070] S135, add the nearest device to the physical order list, update the nearest device to the new target device, and remove it from the unsorted device set until the unsorted device set is empty, thus obtaining a physical order list containing all devices.

[0071] The nearest neighbor device determined in step S134 is added to the physical order list as the next node in the sequence of the current target device. Then, this nearest neighbor device is removed from the unsorted device set U and updated to the new target device. Steps S133 to S135 are repeated, each time using the new target device as a basis to continue searching for its nearest neighbor, gradually expanding the physical order list.

[0072] Since the endpoint devices of a linear array only have one-sided neighbors, the unsorted device set U will become empty as the iterative process approaches the other endpoint device, and the iteration will naturally terminate. At this point, the physical order linked list contains all N devices, and the order is a complete permutation from the starting end to the other end.

[0073] In conjunction with the first aspect, step S133, which involves determining candidate neighboring devices based on the RSSI distribution pattern of the target device, includes: S1331, if the RSSI distribution of the target device exhibits a single-peak steep drop characteristic, then the target device is determined to have only one candidate neighboring device.

[0074] S1332, if the RSSI distribution of the target device is bimodal and relatively symmetrical, then the target device is determined to be located in the middle of the array and has two candidate neighboring devices.

[0075] In step S133, after obtaining the RSSI values ​​between the target device and each device in the unsorted device set, the RSSI distribution pattern of the target device is further analyzed to determine the number of its candidate neighboring devices. This analysis is based on a typical scenario where devices are installed in a row, in which the RSSI distribution pattern of the devices has a clear correspondence with their positions in the array.

[0076] RSSI distribution pattern refers to the statistical characteristics of the RSSI values ​​received by a target device from all other surrounding devices, sorted by signal strength. It mainly includes the number of peaks, peak strength, and symmetry. Because the devices are linearly arranged, the signal strength between adjacent devices will be significantly higher than that between non-adjacent devices, thus forming obvious peaks on the RSSI distribution map. Specifically: When the RSSI distribution of a target device exhibits a single, obvious peak, and the signal strength on both sides of the peak rapidly decreases, it indicates that the device has only one signal strength significantly higher than other neighboring devices. This pattern typically occurs at the end devices of an array or on devices approaching the end, because the end device has neighbors on only one side, while the other side has no devices or is far away.

[0077] When the RSSI distribution of a target device exhibits two distinct peaks of similar intensity, and these two peaks are roughly symmetrically distributed, it indicates that the device has two signal strengths significantly higher than those of other neighboring devices. This pattern typically occurs with devices in the middle of the array, because there is a directly adjacent device on each side of the central device, and the distance between them is approximately equal.

[0078] In this application, a "strong neighbor" refers to a device that is physically directly adjacent to the target device, and is determined based on its RSSI value being significantly higher than that of other non-adjacent devices. Since Bluetooth signal strength attenuates with increasing distance, the RSSI value between adjacent devices is typically a certain threshold higher (e.g., 10-20 dBm) than that between non-adjacent devices, thus forming a noticeable peak on the distribution map. Specifically: For a target device that is determined to have "only one strong neighbor", it means that the device has only one directly adjacent device on one side in the physical arrangement, and no device on the other side (such as an endpoint) or a device on the other side but it is far away (such as an isolated device). In this case, the candidate neighboring device is the unique strong neighbor.

[0079] For a target device to be determined as having "two strong neighbors," it means that the device is located in the middle of the array, with one directly adjacent device on each of its left and right sides. In this case, the candidate neighboring devices are these two strong neighbors.

[0080] It should be noted that the determination of "strong neighbors" is not based solely on a single RSSI measurement, but rather on a comprehensive analysis combining multiple sample averaging, confidence weighting, and distribution patterns. For example, if a device's RSSI distribution exhibits a bimodal pattern, but the intensity difference between the two peaks is too large or the symmetry is poor, the system may further determine whether there is a device malfunction or signal interference by incorporating confidence parameters.

[0081] In this embodiment, determining the number of candidate neighboring devices through the RSSI distribution pattern helps narrow the search range and improve ranking accuracy in the subsequent comprehensive scoring step. Specifically: For a target device with only one strong neighbor, its nearest neighbor is that unique strong neighbor, which can be directly identified as the nearest neighbor without the need for multi-device scoring comparison, thereby improving sorting efficiency.

[0082] For a target device with two strong neighbors, a comprehensive score comparison is required between the two candidate neighbor devices. The RSSI strength and confidence parameters are combined to determine which one should be selected as the next device in the sequential list in the current iteration (for example, when sorting from left to right, the left neighbor may have already been sorted, and the right neighbor is the real target neighbor device).

[0083] This distribution-based preprocessing mechanism effectively utilizes the physical constraints of linear permutations, reduces algorithm complexity, and enhances the robustness of the sorting results.

[0084] In conjunction with the first aspect, after step S130, the following is also included: S150, if a proximity conflict is detected between two candidate neighboring devices, the conflict resolution mechanism is activated; Conflict resolution mechanisms include: triggering a round of directed RSSI retest, or having the node with the highest current confidence level among the candidate neighboring devices or the central device act as the arbitration node to make a decision.

[0085] During the iterative construction of the physical order linked list in step S130, the system determines candidate neighboring devices based on the RSSI distribution pattern and selects the nearest neighbor device through a comprehensive score. However, in practical applications, neighbor relationship conflicts may occur due to signal interference, environmental changes, or device malfunctions. This step aims to activate the corresponding resolution mechanism when a conflict is detected, ensuring the accuracy and robustness of the sorting results.

[0086] Proximity conflict refers to a logical contradiction in the neighbor determination between devices during iterative sorting, making it impossible to establish a consistent order relationship. Typical conflict scenarios include, but are not limited to, the following two: A. Bidirectional pointing conflict: Device A determines device B as its nearest neighbor, while device B has already determined device C as its nearest neighbor in a previous iteration, and the neighbor relationship between device B and device C is inconsistent with the direction in which device A points to B. For example, during the sorting process from left to right, the current target device A determines B on its right as its nearest neighbor, but B has previously been determined as C's left neighbor, causing the sequence chain to fork or loop.

[0087] B. Abnormal number of candidate neighboring devices: Based on the RSSI distribution pattern analysis of the target device in step S133, there should be two candidate neighboring devices (such as the middle device), but the actual number of candidate devices participating in the scoring is inconsistent with expectations, or the scores of the two candidate devices are extremely close and difficult to distinguish, resulting in the inability to determine the unique nearest neighbor device.

[0088] Conflict detection is integrated throughout the entire iterative sorting process. After step S134 determines the nearest neighbor device using a comprehensive score, the system checks whether this determination is compatible with the topology of the existing sorted linked list. Specifically, the system maintains a neighbor relationship graph between devices. When a newly added neighbor relationship contradicts an existing relationship in the graph (e.g., a cycle, branch, or degree anomaly), it is considered a conflict. When a neighbor relationship conflict is detected, the system initiates one of the following two resolution mechanisms: First, a directional RSSI retest is triggered: the current sorting process is paused, and the devices involved in the command conflict (e.g., device A and device B) enter directional retest mode. In this mode, these devices increase their scanning frequency for a short period, specifically performing multiple RSSI samplings on each other and with other surrounding devices, and reporting the newly collected data. Based on the latest RSSI dataset obtained after the retest, the system recalculates the combined RSSI value, distribution pattern, and confidence parameters of the relevant devices to eliminate misjudgments caused by transient interference or abnormal fluctuations. After the retest is completed, the system returns to the conflict point and re-determines the proximity relationship based on the updated data.

[0089] Secondly, when targeted retesting cannot resolve conflicts (e.g., multiple retests still yield inconsistent results), or when conflicts involve multiple devices leading to excessively high retesting costs, the system introduces an arbitration mechanism. The arbitration node is determined using one of the following two methods: The device with the highest confidence parameter in the current ranking process is selected as the arbitration node. This device is considered to have high reliability due to the stability, consistency, and low volatility of its RSSI measurements, and its observation data can be used as the basis for adjudication.

[0090] The central device identified in step S120 is selected as the arbitration node. Located in the center of the array, the central device can receive signals from multiple devices on both the left and right sides, providing a more comprehensive observation perspective, and its RSSI data is generally more valuable for global reference.

[0091] Arbitration nodes independently determine conflict relationships based on their stored RSSI values ​​(i.e., the signal strength received by the arbitration node from the conflicting device and other related devices) and a pre-constructed partial sorting list. For example, an arbitration node can compare the RSSI values ​​received from device A and device B to determine which device is closer to it, thus inferring the correct neighbor order. The arbitration node's decision serves as the final ruling, updating the sorting list accordingly and continuing subsequent iterations.

[0092] Regardless of the conflict resolution mechanism used, after conflict resolution, the system will re-verify the compatibility of the newly determined neighbor relationships with the existing sorted linked list. If the verification passes, the iterative update in step S135 continues; if conflicts still exist, the resolution mechanism can be repeated or the anomaly can be recorded for manual intervention. This conflict resolution mechanism effectively addresses the ambiguities and contradictions that RSSI measurements may introduce in complex environments, significantly improving the robustness and reliability of the sorting algorithm and ensuring accurate construction of the physical order linked list of devices even in real-world scenarios with significant signal fluctuations.

[0093] In conjunction with the first aspect, step S140 includes: S141, Based on the physical order linked list, with the starting device as the first priority, assign incremental logical address numbers to each device in sequence.

[0094] S142, write the logical address sequence number into the address storage unit of the corresponding device to complete the address configuration.

[0095] After successfully constructing the physical order linked list containing all devices in step S130, the system enters the logical address allocation stage. This step aims to assign a logical address corresponding to the location of each device based on the determined physical order, thereby achieving consistency between device identification and physical layout. Specifically, this includes: In step S141, based on the physical order linked list generated in step S130, the system determines the order of each device in the array. This linked list starts with the device selected in step S131 as the first element and proceeds sequentially to the devices at the other end. Based on this, the system assigns an incrementing logical address number to each device in the linked list: Assign the starting device address 1 (or other starting number, such as 0); The second device in the physical sequential list is assigned address 2; This process continues until the endpoint device at the end of the linked list is assigned address N, where N is the total number of devices.

[0096] This allocation rule ensures a one-to-one correspondence between logical addresses and physical locations: the smaller the address number, the closer the device is to the starting end; the larger the address number, the closer the device is to the other end. It should be noted that the starting device may physically be located at either the left or right end of the array, depending on the selection rule in step S131. Regardless of which end is chosen as the starting end, the allocation result is a set of logical addresses that strictly correspond to the physical order, only the numbering direction is reversed. In practical applications, directional ambiguity can be eliminated through a unified convention (e.g., stipulating that device 1 is always the leftmost device), or the direction can be confirmed through simple verification during the installation and commissioning phase.

[0097] After the logical address sequence number is allocated in step S141, step S142 requires writing the address value corresponding to each device into its internal address storage unit, so that the device can identify its own address and respond to the addressing of the monitoring system during subsequent operation. In this embodiment, the address writing can be implemented in the following two ways: One approach is centralized configuration: If the photovoltaic tracking system has a centralized master controller (e.g., the central control unit of the photovoltaic tracking system), the master controller can generate an address mapping table for each device based on a physical sequential linked list. The master controller sends the corresponding logical address to each device one by one via wired communication (e.g., RS485, Modbus) or wireless communication (e.g., Bluetooth, Wi-Fi). After receiving the address instruction, the device writes it into a non-volatile memory (e.g., EEPROM, Flash) to ensure that the address is not lost after power failure. The advantage of centralized configuration is unified management, making it easy for the master controller to grasp the global address allocation.

[0098] The second approach is decentralized autonomy: In scenarios without a centralized controller, devices can negotiate and write addresses independently via Bluetooth communication. The specific process is as follows: The starting device detects that it is the first in the sequence (based on the selection result of step S131), actively sets its own address to 1, and writes it into the storage unit; The starting device notifies its nearest neighbor device (i.e., the second device in the chain) via Bluetooth broadcast or unicast, "Please set the address to number 2"; After receiving the notification, the second device sets its own address to number 2 and writes it to the storage unit. Then it also notifies its nearest neighbor device (the third device) to set its address. The address is passed sequentially until the endpoint device at the end of the linked list completes the address setting.

[0099] Decentralized autonomy does not rely on a central node, has strong self-organizing capabilities and deployment flexibility, and is suitable for scenarios without a master controller or where the master controller has failed.

[0100] Regardless of the method used, once the address is written, each device will have a logical address uniquely corresponding to its physical location. The photovoltaic tracking system can then enter normal operation, and the monitoring system can accurately locate the physical location of each device through the logical address without manual verification.

[0101] In conjunction with the first aspect, after step S140, the following also includes: S160 initiates sequential verification and continuously monitors changes in signal strength.

[0102] After the address configuration is complete, the system initiates a sequence check to verify whether the allocated logical addresses match the actual physical arrangement. The check can use one or a combination of the following two methods: Master controller polling verification: The centralized controller sends query commands to each device sequentially according to their logical addresses (1, 2, ..., N). Upon receiving a command, each device returns a response. The master controller verifies the correctness of the address configuration by comparing the response order with the expected order. If a device does not respond or its response order is incorrect, the verification is considered to have failed.

[0103] Equipment flashing indicator: The system controls each device to illuminate its indicator lights (such as LEDs) sequentially according to their logical address order. Installers or automated inspection equipment can visually verify this by observing whether the flashing order matches the actual arrangement. This method is particularly suitable for the commissioning phase or manual spot checks.

[0104] After successful verification, the system enters continuous monitoring mode. In this mode, each device continues to maintain the periodic broadcasting and scanning functions of its Bluetooth module, collecting RSSI data from surrounding devices in real time and comparing it with historical data. The main monitoring content includes: Are there any new device identifiers appearing in the scan results (new device added)? Does the original device's identifier continue to disappear (device removed)? Has the distribution of RSSI values ​​between devices changed significantly (location change, such as equipment being swapped)?

[0105] In practical applications, to reduce monitoring power consumption and computational overhead, the system can be set to a low sampling frequency (e.g., once per minute), and the subsequent adaptive update process will only be triggered when abnormal changes are detected.

[0106] S170 automatically updates the physical sequence list and logical address when a device is added, removed, or its location changes.

[0107] When the continuous monitoring mechanism in step S160 detects a change in device topology, the system automatically triggers a reordering process to update the physical order list and logical addresses. The specific triggering conditions and processing methods are as follows: A. When a new device powers on and enters the interconnected ranging mode, its broadcast identifier will be scanned by surrounding existing devices. Once existing devices stably receive the new device's signal for several consecutive monitoring cycles, they determine it to be a newly added device. The system then automatically re-executes steps S110 to S140: Re-acquire RSSI data and include the new device in the N×N dataset; Recalculate the RSSI sum and identify the endpoints and central devices; Reconstruct the physical order linked list containing the new device; Logical addresses are reassigned to all devices in the new order.

[0108] B. If the broadcast signal of an existing device completely disappears within several consecutive monitoring periods, and surrounding devices cannot scan the device, it is determined that the device has been removed. In this case, the device is removed from the existing topology, and the sorting process is automatically re-executed to reallocate addresses to the remaining devices, ensuring that addresses are continuous and without gaps.

[0109] C. If the relative positions of devices change (e.g., two devices are swapped), the distribution characteristics of the RSSI dataset will change significantly. The system compares the current RSSI sum with historical records. If it detects changes in endpoint devices, offsets in the center device, or discrepancies in proximity relationships with the original linked list, it determines that there has been a position change. This triggers a reordering process, reconstructing the physical order linked list based on the new RSSI data and updating the addresses.

[0110] During the reordering process, the original mapping relationship between logical addresses and device identifiers can be retained as a reference, but the final address reconfiguration is based on the recalculated physical order linked list. To avoid system oscillation caused by frequent update triggers, a trigger threshold (e.g., the same change is detected in three consecutive monitoring cycles) and a debouncing mechanism can be set. Through the above steps S160 and S170, a complete closed loop from initial automatic sorting to subsequent adaptive maintenance is achieved. Not only can device sorting be completed in one go during the installation phase, but it can also dynamically respond to topology changes during operation and maintenance, always maintaining synchronization between logical addresses and physical locations, thus solving the defects of lacking adaptive adjustment and requiring manual reconfiguration.

[0111] Secondly, this application provides an automatic device sorting system based on wireless signal strength for performing the above-described method. The system includes multiple devices, each device comprising: a Bluetooth communication module 10, a total value calculation module 20, an endpoint center identification module 30, a sorting list construction module 40, and an address allocation module 50, such as... Figure 2 As shown.

[0112] The Bluetooth communication module 10 is used to enter ranging mode, periodically broadcast its own identifier and scan the broadcast messages of other surrounding devices, and collect the received signal strength index (RSSI) values ​​between them.

[0113] The sum value calculation module 20 is used to calculate the sum value of RSSI of this device based on the collected RSSI values. The sum value of RSSI is the sum of the absolute values ​​of RSSI of all other devices received by this device.

[0114] Endpoint center identification module 30 is used to obtain the combined RSSI value of all devices and identify the endpoint devices and center devices in the physical arrangement based on the combined RSSI value.

[0115] The sorting linked list construction module 40 is used to select the sorting start end device from the identified end devices, determine the nearest neighbor device of the current device one by one based on the RSSI values ​​and distribution characteristics between each device, and construct a physical order linked list containing all devices.

[0116] Address allocation module 50 is used to allocate logical addresses to this device according to the physical order linked list.

[0117] Specifically, each device is equipped with a Bluetooth communication module 10, which is responsible for putting the device into interconnected ranging mode. In this mode, the device periodically broadcasts its own identifier (such as device ID or Bluetooth MAC address) while continuously scanning broadcast messages from other surrounding devices, thereby collecting Received Signal Strength Indicator (RSSI) values ​​with each neighboring device. This raw RSSI data forms the basis for all subsequent analyses.

[0118] Each device is also equipped with a summation calculation module 20. This module obtains the RSSI measurement values ​​received by this device from all other devices via the Bluetooth communication module 10, and sums the absolute values ​​of these RSSI values ​​to calculate the summation value of this device's RSSI. This summation value reflects the total signal strength received by this device and is an important basis for determining the device's position in the array.

[0119] The endpoint center identification module 30 collects the combined RSSI values ​​of all devices and performs comparative analysis. This module identifies the two devices with the smallest combined RSSI values ​​as the two endpoint devices in the physical arrangement. Simultaneously, based on whether the total number of devices is odd or even, it identifies at least one device with the largest combined RSSI value as the center device (one device if the total number is odd, two devices if the total number is even). This identification result provides a crucial reference anchor for subsequent sorting.

[0120] After identifying the endpoints and the central device, the sorting list construction module 40 selects one of the two endpoint devices as the starting endpoint device for sorting. Subsequently, based on the RSSI measurements and distribution characteristics (such as unimodal or bimodal morphology) between each device, the module performs a comprehensive score in conjunction with the confidence parameter, and successively determines the nearest neighbor device of the current device, constructing a physical order list containing all devices through an iterative process.

[0121] Finally, the address allocation module 50 assigns a logical address corresponding to the physical location of each device based on the constructed physical sequence linked list. After allocation, each device writes its own address into the storage unit, thereby achieving the unification of logical identification and physical layout.

[0122] Through the coordinated work of the above modules, the physical sequence identification and logical address allocation of photovoltaic devices can be completed automatically without human intervention, effectively solving the problems of low efficiency, error-proneness and inability to adaptively adjust in existing technologies.

[0123] Secondly, the system also includes a main controller, which is used to obtain the physical sequential linked list and send logical addresses to each device via wired or wireless communication.

[0124] Building upon the aforementioned system, this system also includes a main controller. This main controller establishes communication connections with each device via wired or wireless means to obtain the physical sequential linked list generated by the sorted linked list construction module. The main controller generates a logical address mapping table for each device based on this linked list and sends the corresponding logical addresses to each device one by one via the communication link. Upon receiving the address instruction, each device's address allocation module writes the received logical address into its storage unit. By introducing the main controller, the system achieves centralized management and unified distribution of addresses, facilitating maintenance personnel to grasp the global address allocation status from a central node. It also reduces the processing complexity at the device level and avoids communication conflicts that may arise from inter-device negotiation.

[0125] Thirdly, embodiments of this application provide an electronic device, combined with Figure 3 As shown, the electronic device includes a memory 131 and a processor 130. The memory 131 stores a computer program, and the processor 130 runs the computer program to make the electronic device perform the above-described method.

[0126] Furthermore, combined Figure 3 The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.

[0127] The memory 131 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0128] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131, and processor 130 reads the information in memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0129] Fourthly, embodiments of this application provide a readable storage medium storing computer program instructions, which are read and executed by a processor to perform the above-described method.

[0130] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0131] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0132] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0133] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0134] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for automatically sorting devices based on wireless signal strength, characterized in that, The method includes: Multiple devices enter ranging mode, communicate wirelessly with each other, and collect signal strength data between them; Based on the collected signal strength data, the sum of the signal strength of each device is calculated, and the endpoint devices and central devices in the physical arrangement are identified based on the sum of the signal strength. Select a sorting start device from the identified endpoint devices, and determine the nearest neighbor device of the current device one by one based on the signal strength data and distribution characteristics between the devices, and construct a physical order linked list containing all the devices; Logical addresses are assigned to each device based on the physical order linked list to complete automatic sorting.

2. The method according to claim 1, characterized in that, The wireless communication is Bluetooth communication, and the step of receiving signal strength data as the RSSI value includes: For each of the aforementioned devices, the device periodically broadcasts its own identifier and scans the broadcast messages of other surrounding devices. After multiple samplings, an RSSI dataset between each of the aforementioned devices and the surrounding devices is formed. The RSSI dataset is an N×N matrix, where N is the total number of devices, and the diagonal elements of the matrix are empty.

3. The method according to claim 2, characterized in that, The steps of calculating the sum of signal strength for each device based on the collected signal strength data, and identifying the endpoint devices and central devices in the physical arrangement based on the sum of signal strength values, include: Based on the strength data corresponding to the device, the sum of the absolute values ​​of RSSI between the device and all other devices is calculated as the combined RSSI value of the device. Compare the combined RSSI values ​​of all the devices, and determine the two devices with the smallest combined RSSI values ​​as the two endpoint devices in the physical arrangement; If the total number of devices is odd, the device with the largest RSSI value will be determined as the central device in the physical arrangement; If the total number of devices is even, the two devices with the largest RSSI values ​​will be identified as devices in the central area.

4. The method according to claim 1, characterized in that, The steps of selecting a sorting start device from the identified endpoint devices, determining the nearest neighbor device of the current device sequentially based on the signal strength data and distribution characteristics between the devices, and constructing a physical order linked list containing all the devices include: Select one of the two endpoint devices as the starting endpoint device; The starting device is taken as the target device and added to the physical order linked list; the remaining devices form an unsorted set of devices. Obtain the RSSI values ​​between the target device and each unsorted device in the unsorted device set, and determine candidate neighboring devices based on the RSSI distribution pattern of the target device; Based on the RSSI value and confidence parameter of the candidate neighboring devices, a comprehensive score is performed, and the unsorted device with the highest score is determined as the target neighboring device of the target device. The target neighboring device is added to the physical order linked list, and the target neighboring device is updated to the new target device. At the same time, it is removed from the unsorted device set until the unsorted device set is empty, resulting in a physical order linked list containing all devices.

5. The method according to claim 4, characterized in that, The step of determining candidate neighboring devices based on the RSSI distribution pattern of the target device includes: If the RSSI distribution of the target device exhibits a single-peak steep drop characteristic, then it is determined that the target device has only one candidate neighbor device. If the RSSI distribution of the target device is bimodal and relatively symmetrical, then the target device is determined to be located in the middle of the array and has two candidate neighboring devices.

6. The method according to claim 4, characterized in that, After determining candidate neighboring devices based on the RSSI distribution pattern of the target device, the method further includes: If a proximity conflict is detected between two candidate neighboring devices, the conflict resolution mechanism is activated. The conflict resolution mechanism includes: triggering a round of directed RSSI retest, or having the candidate neighboring device or the central device with the highest current confidence level act as an arbitration node to make a decision.

7. The method according to claim 1, characterized in that, The steps of allocating logical addresses to each device according to the physical order linked list and completing automatic sorting include: Based on the physical sequence linked list, with the starting device as the first priority, incremental logical address numbers are assigned to each device in sequence; Write the logical address sequence number into the address storage unit of the corresponding device to complete the address configuration.

8. The method according to claim 1, characterized in that, After allocating logical addresses to each device according to the physical order linked list and completing the automatic sorting step, the method further includes: Initiate sequence verification and continuously monitor signal strength changes; When a device is added, removed, or its location is changed, the physical sequence list and logical address are automatically updated.

9. An automatic device sorting system based on wireless signal strength, characterized in that, Used to perform the method as described in any one of claims 1-8; The system comprises multiple devices, each including: The Bluetooth communication module is used to enter ranging mode, periodically broadcast its own identifier and scan the broadcast messages of other surrounding devices, and collect the received signal strength index (RSSI) values ​​between them. The sum value calculation module is used to calculate the sum value of RSSI of this device based on the collected RSSI values. The sum value of RSSI is the sum of the absolute values ​​of RSSI of all other devices received by this device. The endpoint center identification module is used to obtain the sum of RSSI values ​​of all devices and identify the endpoint devices and center devices in the physical arrangement based on the sum of RSSI values. The sorting linked list construction module is used to select the sorting start device from the identified endpoint devices, determine the nearest neighbor device of the current device based on the RSSI values ​​and distribution characteristics between each device, and construct a physical order linked list containing all devices. The address allocation module is used to allocate logical addresses to this device according to the physical sequence linked list.

10. The system according to claim 9, characterized in that, It also includes a main controller, which is used to obtain the physical sequence linked list and send logical addresses to each of the devices via wired or wireless communication.