Networking method, communication system, electronic device, storage medium and program product

Through the user terminal, the networking is automatically organized based on the communication quality information between the slave and the master station, the problems of complexity and high maintenance cost of LoRa network in the prior art are solved, and efficient and reliable irrigation system networking is realized.

CN120129092APending Publication Date: 2025-06-10SHANGHAI HUACE NAVIGATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510400441.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The prior art has complexity in realizing the networking and management of LoRa networks, which leads to inconvenient deployment, time-consuming and error-prone, and increases the maintenance cost of the system.

Method used

The user terminal sends network notifications to each master station, obtains communication quality information between the slave station and the master station, and automatically organizes the network based on this information to form a networking system to ensure the reliability of the communication link between the slave station and the master station.

Benefits of technology

It improves networking efficiency, reduces maintenance costs, and ensures the reliability and stability of the irrigation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120129092A_ABST
    Figure CN120129092A_ABST
Patent Text Reader

Abstract

The invention provides a networking method, a communication system, electronic equipment, a storage medium and a program product, and relates to the technical field of communication. According to the scheme, automatic networking is carried out through the user terminal according to the communication quality of each slave station, so that remote networking can be carried out through the user terminal in an irrigation scene, the networking efficiency is higher, the maintenance cost is low, networking is carried out based on the communication quality information, the reliability of communication links between the slave stations and the master station can be ensured, and the user experience is improved. Therefore, the irrigation reliability is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a networking method, a communication system, an electronic device, a storage medium, and a program product. Background Art

[0002] In the field of modern agricultural irrigation, the application of wireless communication technologies has become increasingly popular. In particular, LoRa (Long Range) technology, with its characteristics of low power consumption, long distance, and high capacity, has become one of the key technologies in agricultural irrigation systems. However, there are some obvious limitations in the existing technologies for realizing the networking and management of LoRa networks, which affect the overall performance of the system and the user experience.

[0003] Existing irrigation systems usually adopt a communication solution that combines LoRa and 4G networks. This solution uses LoRa to achieve low-power, long-distance communication between irrigation devices and gateways, and at the same time uploads data to the cloud or a remote management platform through the 4G network to achieve wide-area coverage and real-time monitoring. Although this combined solution meets the needs of agricultural irrigation to a certain extent, the complexity of manually configuring LoRa parameters to achieve networking brings many inconveniences to actual deployment. Technical personnel need to perform local networking according to the communication coverage range of LoRa and manually configure parameters for local networking. This process is not only time-consuming and laborious but also error-prone, increasing the maintenance cost of the system. When reinstalling every year, it is necessary to manually configure LoRa parameters again, which is time-consuming and laborious. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a networking method, a communication system, an electronic device, a storage medium, and a program product to improve the problems of high labor cost and high maintenance cost caused by manual networking in the existing technology.

[0005] In a first aspect, the embodiments of this application provide a networking method for networking devices in an irrigation system. The irrigation system includes at least one master station and multiple slave stations. The multiple slave stations are irrigation devices, and the slave stations communicate with the master stations through LoRa modules. Each master station is used to communicate with a user terminal. The method is applied to the user terminal and includes:

[0006] Sending a networking notification to each master station, where the networking notification is used to instruct each master station to obtain communication quality information of each slave station with respect to the master station;

[0007] Obtaining the communication quality information of the multiple slave stations obtained by each master station sent by each master station;

[0008] Network the at least one master station and the multiple slave stations according to the communication quality information to form at least one networked system, and each networked system includes a master station and slave stations connected to the master station.

[0009] In the above implementation process, this solution enables the user terminal to perform automatic networking according to the communication quality of each slave station. In the irrigation scenario, remote networking can be carried out through the user terminal, with higher networking efficiency and lower maintenance costs. Moreover, networking based on the communication quality information can ensure the reliability of the communication link between the slave station and the master station, thereby ensuring the reliability of irrigation.

[0010] Optionally, the networking the at least one master station and the multiple slave stations according to the communication quality information to form at least one networked system includes:

[0011] Assign each slave station to a corresponding master station according to the communication quality information;

[0012] For each master station and the slave stations assigned to it, configure corresponding carrier frequencies to form at least one networked system, where the carrier frequencies of the master station and the slave stations in each networked system are the same, and the carrier frequencies of each networked system are different from each other.

[0013] In the above implementation process, by assigning slave stations to corresponding master stations according to the communication quality information, the utilization of the communication quality information ensures the connection reliability between the slave stations and the master stations, reducing the influence of signal occlusion and interference. At the same time, configuring different carrier frequencies for each networked system avoids frequency interference between adjacent networked systems, ensuring the stability of communication and the accuracy of data transmission.

[0014] Optionally, the assigning each slave station to a corresponding master station according to the communication quality information includes:

[0015] For each master station, according to the communication quality information of the multiple slave stations obtained by the master station, assign the slave stations whose communication quality indicated by the communication quality information is greater than the set communication quality to the master station.

[0016] In the above implementation process, by assigning slave stations with communication quality higher than the set threshold to the corresponding master stations according to the communication quality information, the communication link between the slave stations and the master stations is ensured to have high reliability. This dynamic allocation method based on communication quality not only reduces the influence of signal occlusion and interference, but also improves the communication efficiency and the overall stability of the system. At the same time, by optimizing the connection relationship between the slave stations and the master stations, connections with poor communication quality are avoided, reducing the risk of data transmission errors and communication interruptions.

[0017] Optionally, after allocating the slave stations with communication quality greater than the set communication quality indicated by the communication quality information to the master station, the following steps are further included:

[0018] If there is a situation where the same slave station is allocated to different master stations, then adjust the allocation of this slave station to the master station with the optimal communication quality.

[0019] In the above implementation process, a conflict resolution mechanism is introduced during the slave station allocation process to ensure that each slave station is finally allocated to the master station with the optimal communication quality. This mechanism effectively avoids potential conflicts between slave stations and multiple master stations, further improving the reliability of the communication link. By dynamically adjusting the ownership of slave stations, the system can better adapt to complex communication environments, optimize the network topology structure, and ensure that each slave station can establish a connection with the master station with the strongest signal and the least interference.

[0020] Optionally, after allocating the slave stations with communication quality greater than the set communication quality indicated by the communication quality information to the master station, the following steps are further included:

[0021] Count the number of slave stations allocated to each master station, and determine the first master station with the largest number of slave stations and the second master station with the smallest number of slave stations;

[0022] If the difference in the number of slave stations between the first master station and the second master station exceeds the set threshold, then select slave stations that meet the set conditions from the slave stations allocated to the first master station and re-allocate them to the second master station.

[0023] In the above implementation process, by counting the number of slave stations allocated to each master station and making dynamic adjustments when the difference in the number of slave stations exceeds the set threshold, an even distribution of slave stations among master stations is achieved. This even distribution mechanism effectively avoids problems such as excessive power consumption and communication delays caused by overloading of individual master stations, while ensuring the communication efficiency and stability of the entire system.

[0024] Optionally, the step of selecting slave stations that meet the set conditions from the slave stations allocated to the first master station and re-allocate them to the second master station includes:

[0025] Obtain the communication quality information between each slave station allocated to the first master station and the second master station;

[0026] Sort the slave stations allocated to the first master station according to the communication quality information, and select a set number of target slave stations from the sorted slave stations and allocate them to the second master station, where the communication quality of the target slave stations is higher than or equal to the communication quality of other unselected slave stations.

[0027] In the above implementation process, the above dynamic adjustment mechanism ensures that the slave stations can still maintain good communication quality after reallocation, avoiding the decline in communication performance caused by simple quantity adjustment. At the same time, by selecting the slave stations with the best communication quality for reallocation, this solution further optimizes the network topology, improves the overall communication efficiency and stability of the system, ensures the load balance of each master station, reduces power consumption, extends the service life of the equipment, and is more suitable for large-scale irrigation systems in complex environments.

[0028] Optionally, configuring corresponding carrier frequencies for each master station and the slave stations assigned to it includes:

[0029] Determine the carrier frequencies of each master station, where the difference between the carrier frequencies of two adjacent master stations is greater than a set value;

[0030] Send a first carrier frequency configuration instruction to each master station, where the first carrier frequency configuration instruction includes the carrier frequency of the corresponding master station and the slave station identifier under this master station, and the first carrier frequency configuration instruction is used to instruct each master station to configure the corresponding carrier frequency for its slave stations;

[0031] Receive the slave station carrier frequency configuration results sent by each master station;

[0032] Send a second carrier frequency configuration instruction to each master station, where the second carrier frequency configuration instruction includes the carrier frequency of the corresponding master station, and the second carrier frequency configuration instruction is used to instruct each master station to configure its own carrier frequency.

[0033] In the above implementation process, by configuring different carrier frequencies for each master station and the slave stations assigned to it, it is ensured that the difference between the carrier frequencies of adjacent master stations is greater than the set value, thus effectively avoiding frequency interference and improving the stability and reliability of communication. By sending the carrier frequency configuration instructions step by step, first configuring the frequency for the slave stations and then for the master stations, the orderliness and accuracy of the configuration process are ensured. At the same time, receiving the slave station carrier frequency configuration results fed back by the master stations further verifies the success of the configuration, enhancing the reliability and maintainability of the system.

[0034] Optionally, after sending the second carrier frequency configuration instruction to each master station, it further includes:

[0035] Send an instruction to obtain the device version information of its slave stations to each master station, where the device version information instruction includes the slave station identifier, and the device version information instruction is used to instruct to obtain the device version information therein;

[0036] If the device version information of its slave stations sent by each master station is successfully received, it is determined that the network formation is successful.

[0037] In the above implementation process, obtaining the device version information not only verifies whether the slave station has successfully received and applied the new carrier frequency configuration, but also confirms whether the communication link between the slave station and the master station is normal. This verification mechanism effectively improves the success rate of network formation and the reliability of the system, and reduces the network formation failure caused by configuration errors or communication failures.

[0038] Optionally, the first carrier frequency configuration instruction includes an identification queue, the identification queue includes the slave station identifiers under this master station, and the identification queue is a queue of slave station identifiers formed by sorting the communication quality of the slave stations from low to high. The first carrier frequency configuration instruction is specifically used to instruct the master station to configure the corresponding carrier frequencies for its slave stations in sequence according to the identification queue. Among them, slave stations with weak signals are more vulnerable to interference and signal attenuation. Configuring frequencies for these slave stations first can ensure that they can establish a stable communication link as soon as possible during network formation. This reduces communication interruptions or data loss caused by signal problems and improves the overall stability of the system.

[0039] Optionally, determining the carrier frequencies of each master station includes:

[0040] Generating the corresponding carrier frequencies through a preset hash algorithm according to the master station identifiers of each master station.

[0041] In the above implementation process, by generating the corresponding carrier frequencies through a preset hash algorithm according to the master station identifiers of each master station, the uniqueness and traceability of the carrier frequencies are ensured. This frequency generation method based on the master station identifier not only simplifies the frequency allocation process, avoids frequency conflicts, but also improves the automation degree and management efficiency of the system.

[0042] Optionally, before sending the network formation notification to each master station, it further includes:

[0043] If there is previous network formation information stored, send a first frequency configuration instruction to each master station. The first frequency configuration instruction includes a default carrier frequency, and the first frequency configuration instruction is used to instruct each master station to configure the default carrier frequency for its previously networked slave stations;

[0044] Send a second frequency configuration instruction to each master station. The second frequency configuration instruction includes the default carrier frequency, and the second frequency configuration instruction is used to instruct each master station to configure its own carrier frequency as the default carrier frequency.

[0045] In the above implementation process, the LoRa carrier frequencies of all master stations and slave stations are first restored to the default carrier values. In this way, regardless of whether the master stations and slave stations have been networked before, or whether they are under different carrier frequencies, they can be unified to the default carrier frequency at the beginning of networking, thus ensuring communication between the master stations and slave stations, and then networking is carried out to ensure the smooth progress of the networking process.

[0046] Optionally, obtaining the communication quality information of the multiple slave stations obtained by each master station includes:

[0047] Receiving the initial communication quality information of the multiple slave stations obtained by each master station;

[0048] Determining the communication quality information of each slave station according to the initial communication quality information and the communication attenuation value in the irrigation scenario.

[0049] In the above implementation process, by considering the communication attenuation value in the irrigation scenario, it can be ensured that the communication between the slave station and the master station remains stable even when the crops grow most lushly.

[0050] Optionally, the communication attenuation value is determined in the following manner:

[0051] Determine the communication attenuation value corresponding to the crop according to the crop type. In this way, the situation of different crops can be considered, and the corresponding communication attenuation value can be determined, which can more accurately predict and compensate the attenuation of the signal in the farmland environment, thereby optimizing the performance of the wireless communication link. This dynamic adjustment mechanism based on crop characteristics not only improves the reliability and stability of communication, but also reduces communication interruptions and data loss caused by signal attenuation, ensuring the efficient operation of the irrigation system.

[0052] Optionally, the communication attenuation value is determined in the following manner:

[0053] Determine the communication attenuation value corresponding to the crop according to the crop type and the current growth cycle of the crop. This solution can more accurately adapt to the dynamic changes in the farmland environment by comprehensively considering the crop type and the current growth cycle. Different crops have different effects on signal transmission at different growth stages. By dynamically adjusting the attenuation value, the occlusion and attenuation of the signal during the growth process of the crop can be effectively compensated, ensuring the stability and reliability of the communication link.

[0054] Optionally, each master station is configured with a short-range wireless communication method and a cellular mobile communication method, and each master station is used to communicate with the user terminal through the short-range wireless communication method or the cellular mobile communication method. This multi-communication mode not only improves the adaptability of the system, enabling it to meet the needs of different users in different scenarios, but also enhances the fault tolerance of the system. When one communication method is unavailable, the other method can be used as a backup, thus ensuring the continuous and stable operation of the irrigation system.

[0055] In a second aspect, an embodiment of the present application provides a communication system, which includes a user terminal and an irrigation system. The irrigation system includes at least one master station and multiple slave stations. The multiple slave stations are irrigation devices, and the slave stations communicate with the master station through LoRa modules, and each master station communicates with the user terminal;

[0056] The user terminal is used to send a networking notification to each master station, and the networking notification is used to instruct each master station to obtain the communication quality information of each slave station and the master station;

[0057] Each master station is used to obtain the communication quality information from each slave station and send it to the user terminal;

[0058] The user terminal is further used to form at least one networking system by networking the at least one master station and the multiple slave stations according to the obtained communication quality information of the multiple slave stations. Each networking system includes a master station and the slave stations connected to the master station.

[0059] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method provided in the first aspect above are run.

[0060] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in the first aspect above are run.

[0061] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions. When the computer program instructions are read and run by a processor, the steps in the method provided in the first aspect above are executed.

[0062] Other features and advantages of the present application will be described in the subsequent specification, and part of them will become obvious from the specification, or be understood by implementing the embodiments of the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings. Description of the Drawings

[0063] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0064] Figure 1 It is a schematic structural diagram of a communication system provided by an embodiment of the present application;

[0065] Figure 2 It is a flowchart of a networking method provided by an embodiment of the present application;

[0066] Figure 3 It is a schematic flowchart of a frequency configuration process provided by an embodiment of the present application;

[0067] Figure 4 It is a schematic flowchart of frequency configuration and balanced networking provided by an embodiment of the present application;

[0068] Figure 5 It is a specific example flowchart of a networking method provided by an embodiment of the present application;

[0069] Figure 6 It is a structural block diagram of a networking device provided by an embodiment of the present application;

[0070] Figure 7 It is a schematic structural diagram of an electronic device for executing a networking method provided by an embodiment of the present application. Detailed implementation manners

[0071] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application.

[0072] It should be noted that the terms "system" and "network" in the embodiments of the present invention can be used interchangeably. "Multiple" means two or more. In view of this, in the embodiments of the present invention, "multiple" can also be understood as "at least two". "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " generally represents an "or" relationship between the associated objects before and after without special instructions.

[0073] It should also be noted that all actions of obtaining signals, information, or data in the present application are carried out on the premise of complying with the corresponding data protection regulations and policies of the country where it is located and obtaining authorization from the owner of the corresponding device.

[0074] An embodiment of the present application provides a networking method, which is used to network devices in an irrigation system. The irrigation system includes at least one master station and multiple slave stations. The multiple slave stations are irrigation devices. The slave stations communicate with the master station through LoRa modules. Each master station is used to communicate with a user terminal. The user terminal obtains the communication quality information of each slave station, and then automatically networks according to the communication quality of each slave station through the user terminal. In this way, in an irrigation scenario, remote networking can be performed through the user terminal, with higher networking efficiency and lower maintenance costs. And networking based on communication quality information can ensure the reliability of the communication link between the slave station and the master station, thereby ensuring the reliability of irrigation.

[0075] Before introducing the networking method of this solution, first introduce the networking system involved in this solution.

[0076] Please refer to Figure 1 , Figure 1 FIG. 12 is a schematic structural diagram of a communication system 10 provided by an embodiment of the present application. The communication system 10 includes a user terminal 11 and an irrigation system 12. The irrigation system 12 includes at least one master station and multiple slave stations (multiple master stations are shown in the figure). The multiple slave stations are irrigation devices. The slave stations communicate with the master station through LoRa modules. Each master station communicates with the user terminal 11. Among them, the master station and the slave station in the irrigation system 12 are networked through the following networking method.

[0077] In practical applications, the slave station is an irrigation device. An LoRa module is deployed in the slave station, and an LoRa module is also deployed in the master station. Therefore, the slave station communicates with the master station through the LoRa module.

[0078] In some embodiments, each master station may be configured with a short-range wireless communication method and a cellular mobile communication method. Each master station can communicate with the user terminal through the short-range wireless communication method or the cellular mobile communication method.

[0079] It can be understood that the master station can also be an irrigation device, that is, the master station can be a device obtained by adding a short-range wireless communication method and a cellular mobile communication method to the slave station. The master station also has the functions of the slave station. In some cases, the master station can be used as a slave station, and the slave station can be used as a master station after adding the above communication methods. Of course, the master station can also not be an irrigation device, but only be used as a gateway between the slave station and the user terminal. That is, the master station can be used as an irrigation control device, as well as a server or gateway device.

[0080] Among them, short-range wireless communication methods such as Bluetooth and WiFi, and cellular mobile communication methods can be communication methods such as 3G, 4G, and 5G. When the cellular mobile communication method cannot communicate, the master station can switch to the short-range wireless communication method to communicate with the user terminal. This multi-communication mode not only improves the adaptability of the system, enabling it to meet the needs of different users in different scenarios, but also enhances the fault tolerance of the system. When one communication method is unavailable, the other method can be used as a backup, thus ensuring the continuous and stable operation of the irrigation system.

[0081] Both the master station and the slave station can be powered by batteries, and a low-power logic is designed to ensure that the usage duration of the master station and the slave station without charging can meet the crop growth cycle in the irrigation scenario.

[0082] In some embodiments, the master station may include an MCU, a network module, a Bluetooth module, and a LoRa module. The MCU can have multiple low-power modes and support wake-up by interrupt. The network module can integrate two 4G modules and support dual-network backup to ensure seamless switching to another operator network when a single operator network is unavailable. That is, the two 4G modules are used to solve the problem that a single operator cannot cover all areas or one operator may be interfered at certain time points and cannot transmit data normally, realizing real-time seamless switching of the network under dual-network dual-communication, stable and reliable data transmission. Adding a Bluetooth solution can directly communicate the user terminal with the master station without passing through the 4G network and the server, and control the master station and the slave station to realize short-range wireless control of irrigation equipment, solving the usage scenario in a network-free environment where there is no 4G network at the positions of farmland water outlet piles. The LoRa module can select a high-performance LoRa chip and support long-distance communication and low-power mode. The Bluetooth module can support fast connection and low-power communication.

[0083] The low-power design solution of the master station can put the MCU, the network module, and the LoRa module into sleep, and power off other modules (such as Bluetooth). The two 4G modules maintain a TCP long connection. When receiving data or URC (Unsolicited Result Code) notification, the MCU is woken up through GPIO (General Purpose Input / Output) interrupt. The LoRa module is set to the air wake-up mode, with a sleep time of 5 seconds, a wake-up time of 0 seconds, and a delay print time of 50 milliseconds when receiving data. When receiving data, the MCU is woken up through GPIO interrupt. Except for the MCU, the network module, and the LoRa module, other modules (such as Bluetooth) are powered off in the sleep state to further reduce power consumption.

[0084] The wake-up mechanism of the master station includes remote wake-up, button wake-up, and timed wake-up. For remote wake-up, wake-up instructions can be remotely sent via a 4G network or LoRa signal. After the MCU receives the instruction, it wakes up from the sleep mode. There are two buttons, left and right, configured on the master station. Pressing either button can wake up the device. The button signal is connected to the GPIO pin of the MCU, and the wake-up function is implemented through an external interrupt. For timed wake-up, a timer can be used to regularly wake up from the sleep mode to check the network connection status and receive data.

[0085] If the Bluetooth function of the master station is to be started, it can be enabled by long-pressing the two buttons on the master station for more than 2 seconds when in the wake-up state. After the Bluetooth module is started, the MCU enters a non-sleep mode to ensure the stability of Bluetooth communication. If there is no connection request within 100 seconds after the Bluetooth module is started, it can automatically power off, and the MCU resumes the sleep mode. If there is a connection request within 100 seconds, the Bluetooth module remains on until the connection is disconnected, and then the MCU resumes the sleep mode.

[0086] The slave station can include an MCU and a LoRa module. The MCU can select a low-power chip, which has multiple low-power modes and supports wake-up through interrupts. The LoRa module supports long-distance communication and low-power modes.

[0087] The low-power design solution of the slave station includes the sleep mode and power-off processing. For example, the MCU and the LoRa module enter the sleep mode, and other modules perform power-off processing. The LoRa module can be set to the wake-up mode in the air, with a sleep time of 5 seconds, a wake-up time of 0 seconds, and a data reception delay printing time of 50 ms. When receiving data, the MCU is woken up through a GPIO interrupt. Except for the MCU and the LoRa module, other modules are powered off in the sleep state to further reduce power consumption.

[0088] The wake-up mechanism of the slave station also includes remote wake-up, button wake-up, and timed wake-up. For remote wake-up, wake-up instructions can be remotely sent via a LoRa signal. After the MCU receives the instruction, it wakes up from the sleep mode. There are two buttons, left and right, configured on the slave station. Pressing either button can wake up the device. The button signal is connected to the GPIO pin of the MCU, and the wake-up function is implemented through an external interrupt. For timed wake-up, a timer can be used to regularly wake up from the sleep mode to check the network connection status and receive data.

[0089] Since the basic conditions for LoRa to achieve communication are that the network number, air rate, and carrier frequency of LoRa devices need to be the same, generally, each slave station and each master station are configured with the same parameters at the factory. When installing irrigation equipment on-site, in order to ensure the reliability of communication, local networking needs to be carried out according to the communication coverage range of LoRa, that is, each slave station and each master station need to be networked.

[0090] Next, in combination with the above communication system 10, the implementation process of the networking method will be introduced. Please refer toFigure 2 , Figure 2 is a flowchart of a networking method provided by an embodiment of this application. This method is used to network devices in an irrigation system. This method is applied to a user terminal and includes the following steps:

[0091] Step S110: Send a networking notification to each master station.

[0092] In practical applications, a networking APP can be installed in the user terminal. This networking method can be implemented through the networking APP. When networking is required, the user can click one-key networking on the networking APP. At this time, the user terminal can first detect whether any one of the two 4G networks of the master station is successfully connected. If so, the next operation can be performed. If both 4G networks are connected fails, the user is prompted to connect to the master station using Bluetooth.

[0093] The user can press any button on the master station to wake up the master station, and then the user can press the left and right buttons simultaneously for more than 2s to activate the Bluetooth function of the master station. The user turns on the Bluetooth of the user terminal and then connects to the master station via Bluetooth.

[0094] The user terminal needs to first confirm that the carrier frequencies of all master stations and all slave stations are the same default carrier frequency. If they are not the same, they need to be configured to be the same first to facilitate communication between the master station and the slave station.

[0095] After confirming that the carrier frequencies of all master stations and slave stations are consistent, the user can trigger a networking notification through the networking APP, and the user terminal can send a networking notification to each master station. The networking notification can be used to instruct each master station to obtain the communication quality information of each slave station with this master station.

[0096] After each master station receives the networking notification, it will send the networking notification to all slave stations. The networking notification includes a timeout period. After the master station and the slave station receive the networking notification, the LoRa modules of the master station and the slave station are set to the non-sleep mode to ensure timely response during the networking process. The preamble time is set to 0s to reduce communication latency. And the one-key networking timeout period can also be dynamically set according to the number of slave stations in the networking. For example, the timeout period can be set as a function of the number of slave stations. For example, for every 10 additional slave stations, the timeout period increases by 300s. In case of timeout, the low-power mode of the master station and the slave station can be restored to avoid unnecessary power consumption. For example, if the networking operation is not completed within the timeout period, the MCU and LoRa modules of the slave station and the master station resume the sleep mode, the master station and the slave station exit the one-key networking process, and return to the normal working mode.

[0097] After the user terminal sends a networking notification to each master station, the master station forwards the networking notification to each slave station, thus notifying all master stations and all slave stations to exit the sleep mode so that the master stations and slave stations can prepare for networking. Here, the networking notification may include two instructions. One is the wake-up instruction to wake up all master stations and slave stations, and the second is the communication quality acquisition instruction for indicating the acquisition of the communication quality information of the slave stations. For example, if the master stations include Master Station 1, Master Station 2, and Master Station 3, and the slave stations include Slave Stations No. 1 - 50, Master Station 1 will send a networking notification to Slave Stations No. 1 - 50 to obtain the communication quality information between Slave Stations No. 1 - 50 and Master Station 1, Master Station 2 will send a networking notification to Slave Stations No. 1 - 50 to obtain the communication quality information between Slave Stations No. 1 - 50 and Master Station 2, and Master Station 3 will send a networking notification to Slave Stations No. 1 - 50 to obtain the communication quality information between Slave Stations No. 1 - 50 and Master Station 3.

[0098] Step S120: Obtain the communication quality information of multiple slave stations obtained by each master station.

[0099] After each slave station receives the networking notification, it will measure the communication quality information between itself and each master station. The communication quality information may include information such as signal strength, signal-to-noise ratio, bit error rate, latency, and transmission distance. Taking signal strength and signal-to-noise ratio as examples, after receiving the instruction, the slave station can use its wireless communication module to measure the signal strength and signal-to-noise ratio from the master station, and the slave station can send the measured information to the master station. For each master station, after receiving the communication quality information sent by each slave station, it can forward it to the user terminal. For example, Master Station 1 sends the communication quality information of Slave Stations No. 1 - 50 it received to the user terminal, and Master Stations 2 and 3 also send the communication quality information of Slave Stations No. 1 - 50 they each received to the user terminal.

[0100] In this way, the user terminal can obtain the communication quality information of multiple slave stations received by each master station.

[0101] Step S130: Network at least one master station and multiple slave stations according to the communication quality information to form at least one networking system.

[0102] Since the communication quality information can reflect the communication reliability between each slave station and the master station, the user terminal can network the slave stations and master stations based on the communication quality information to try to network the slave stations and master stations with better communication quality, thereby ensuring the reliability of the subsequent irrigation process.

[0103] Each formed networking system may include a master station and the slave stations connected to the master station. For example, Master Station 1 and Slave Stations No. 1 - 16 form Networking System 1, Master Station 2 and Slave Stations No. 17 - 33 form Networking System 2, and Master Station 3 and Slave Stations No. 34 - 50 form Networking System 3.

[0104] It should be noted that if there is only one master station, after the user terminal obtains the communication quality information of all slave stations obtained by the master station, some slave stations with better communication quality indicated by the communication quality information (such as the signal strength being greater than the set strength) can be assigned to the master station. At this time, the unassigned slave stations can be discarded, and then the assigned slave stations can be networked with the master station to obtain a networking system. It can be understood that in the subsequent embodiments, some implementation manners are applicable to the case of at least two master stations, and some implementation manners are applicable to the case of at least one master station.

[0105] After the networking system is formed, each slave station within each networking system can communicate with the master station, that is, each master station can only communicate with each slave station within its own networking system, and each master station can communicate with the user terminal. When irrigation operation is required, an irrigation instruction can be sent through the user terminal. After each master station receives the irrigation instruction, it can control the slave stations within its networking system to perform irrigation operations.

[0106] In the above implementation process, the user terminal automatically networks according to the communication quality of each slave station. In this way, in the irrigation scenario, remote networking can be performed through the user terminal, with higher networking efficiency and lower maintenance costs. Moreover, networking based on the communication quality information can ensure the reliability of the communication link between the slave station and the master station, thereby ensuring the reliability of irrigation.

[0107] Based on the above embodiments, during the networking process, each slave station can be assigned to the corresponding master station according to the communication quality information first, and then for each master station and the slave stations assigned to it, the corresponding carrier frequencies are configured to form at least one networking system. Among them, the carrier frequencies of the master station and the slave stations in each networking system are the same, and the carrier frequencies of each networking system are different from each other.

[0108] For example, after the user terminal obtains the communication quality information of the slave stations sent by each master station, it can be classified and stored according to the master station. All the communication quality information of the slave stations and the master station is stored under each master station. For each master station, then the slave stations with better communication quality can be assigned to the master station. For example, for master station 1, the communication quality of slave stations 1 - 10 is better, then slave stations 1 - 10 can be assigned to master station 1, and the same method can be used for master station 2 and master station 3.

[0109] After the slave stations are allocated to each master station, there may be duplicate or unallocated slave stations. For the duplicate ones, they can be processed by deduplication. For example, if slave station 1 is allocated to master station 1 and master station 2, then during deduplication, either one can be arbitrarily retained. For instance, if slave station 1 is allocated to master station 1, then slave station 1 in the allocation list of master station 2 can be deleted at this time. For the unallocated slave stations, such as slave station 15, the communication quality information between this slave station 15 and each master station can be obtained, and then the master station with the best communication quality can be selected and allocated to it. For example, if the communication quality between slave station 15 and master station 2 is the best, then slave station 15 can be allocated to master station 2, that is, slave station 15 is added to the allocation list of master station 2.

[0110] Understandably, during the allocation process, for the convenience of recording, an allocation list will be constructed for each master station. After a slave station is allocated to a certain master station, the slave station will be added to the allocation list of this master station to facilitate subsequent network formation based on this allocation list. At this time, each master station and the slave stations in the allocation list of this master station can be used as a network formation system.

[0111] After the slave stations are allocated to the master stations, carrier frequency configuration can be carried out. For example, the user terminal can send corresponding carrier frequency configuration instructions to each master station to indicate the master station and the slave stations allocated to this master station to perform carrier frequency configuration. After the carrier frequency is configured, it can be indicated that the network formation is completed. For example, for master station 1 and the slave stations allocated to master station 1, configure carrier frequency a to form network formation system 1. For master station 2 and the slave stations allocated to master station 2, configure carrier frequency b to form network formation system 2. For master station 3 and the slave stations allocated to master station 3, configure carrier frequency c to form network formation system 3, and the carrier frequencies a, b, and c are different.

[0112] In the above implementation process, by allocating the slave stations to the corresponding master stations according to the communication quality information, the utilization of the communication quality information ensures the connection reliability between the slave stations and the master stations, and reduces the influence of signal occlusion and interference. At the same time, different carrier frequencies are configured for each network formation system, avoiding frequency interference between adjacent network formation systems and ensuring the stability of communication and the accuracy of data transmission.

[0113] Based on the above embodiments, in the manner of allocating the corresponding slave stations to the master stations, for each master station, according to the communication quality information of multiple slave stations obtained by this master station, the slave stations whose communication quality indicated by the communication quality information is greater than the set communication quality can be allocated to this master station.

[0114] For example, master station 1 obtains the communication quality information between slave stations 1 - 50 and master station 1, and then the slave stations whose communication quality is greater than the set communication quality can be selected and allocated to this master station 1. Taking signal strength and signal-to-noise ratio as examples, the slave stations with signal strength greater than the set strength and signal-to-noise ratio greater than the set signal-to-noise ratio can be selected for allocation, and the remaining slave stations may be allocated to other master stations.

[0115] In some other embodiments, in order to achieve fast allocation, the communication quality information of these 50 slave stations can also be sorted in descending order of communication quality, and then a set number of slave stations with better communication quality are selected and allocated to master station 1. For example, 15 slave stations with better communication quality are selected and allocated to master station 1.

[0116] In the above implementation process, by allocating slave stations with communication quality higher than the set threshold to the corresponding master stations according to the communication quality information, the communication link between the slave stations and the master stations is ensured to have high reliability. This dynamic allocation method based on communication quality not only reduces the influence of signal occlusion and interference, but also improves the communication efficiency and the overall stability of the system. At the same time, by optimizing the connection relationship between the slave stations and the master stations, the connections with poor communication quality are avoided, and the risk of data transmission errors and communication interruptions is reduced.

[0117] Based on the above embodiments, after the slave stations are allocated in the above manner, if there is a situation where the same slave station is allocated to different master stations, the slave station can be adjusted and allocated to the master station with the best communication quality.

[0118] For example, after the allocation according to the above communication quality, if slave station 1 is allocated to master station 1 and master station 2, then at this time, the communication quality between slave station 1 and master station 1 and the communication quality between slave station 1 and master station 2 can be compared, such as the magnitude of the signal strength. Then, the master station with a larger signal strength is selected. For example, if the signal strength between slave station 1 and master station 1 is greater, then slave station 1 is allocated to master station 1. At this time, slave station 1 can be deleted from the allocation list of master station 2, and slave station 1 in the allocation list of master station 1 is retained, so as to achieve allocation adjustment.

[0119] In the above implementation process, a conflict resolution mechanism is introduced during the slave station allocation process to ensure that each slave station is finally allocated to the master station with the best communication quality. This mechanism effectively avoids potential conflicts between the slave stations and multiple master stations, and further improves the reliability of the communication link. By dynamically adjusting the attribution of the slave stations, the system can better adapt to complex communication environments, optimize the network topology structure, and ensure that each slave station can establish a connection with the master station with the strongest signal and the least interference.

[0120] Based on the above embodiments, after the slave stations are allocated in the above manner, the number of slave stations allocated to each master station may not be balanced. In order to balance the number of slave stations of each master station and avoid the problem of too high power consumption of the master station caused by too many slave stations, the number of slave stations allocated to each master station can also be counted, and the first master station with the largest number of slave stations and the second master station with the smallest number of slave stations are determined. If the difference in the number of slave stations between the first master station and the second master station exceeds the set threshold, then slave stations that meet the set conditions are selected from the slave stations allocated to the first master station and reallocated to the second master station.

[0121] For example, the number of slave stations of master station 1 is the largest, which is 30, and the number of slave stations of master station 3 is the smallest, which is 9. If the set threshold is 20 (which can be specifically set according to actual requirements), at this time, the difference in the number of slave stations (21) between master station 1 and master station 3 exceeds the set threshold, then slave stations that meet the set conditions can be selected from master station 1 and assigned to master station 3.

[0122] Among them, the set conditions can refer to the set quantity. For example, in order to achieve balanced distribution, the set quantity here is [(the largest number of slave stations - the smallest number of slave stations) / 2]. According to the above example, after rounding, the set quantity is 10, which means that 10 slave stations will be selected from master station 1 and assigned to slave station 2.

[0123] Among them, when adjusting the balanced distribution, each slave station has been assigned and de-duplicated. In this case, the slave stations of master station 1 and master station 3 do not repeat, so slave station selection can be directly carried out.

[0124] One implementation method is to select 10 slave stations with lower communication quality from master station 1 and assign them to master station 3, that is, the communication quality of these 10 slave stations with master station 1 is lower than that of the remaining 20 slave stations with master station 1. For example, the 30 slave stations under master station 1 can be sorted in descending order of communication quality, and then the last 10 slave stations can be selected and assigned to master station 3.

[0125] It should be noted that when adjusting the balanced distribution, if each slave station has not been de-duplicated, in this case, the duplicate slave stations can be preferentially assigned to master station 3. For example, first determine the duplicate-assigned slave stations from the slave stations of master station 1 and master station 3, such as including slave station 2, slave station 3, slave station 5, and slave station 6. At this time, these 4 slave stations can be preferentially assigned to master station 3, that is, these slave stations are deleted from the assignment list of master station 1. At this time, master station 1 has 26 remaining slave stations, and master station 3 still has 9 slave stations, then balanced distribution is carried out again. At this time, 8 ((26 - 9) / 2) slave stations can be selected from master station 1 and assigned to master station 3, and the selection method can also be to select 8 slave stations with lower communication quality.

[0126] It can be understood that after de-duplicating the slave stations, the number of slave stations under each master station can be viewed as a whole, and then the balanced distribution can be achieved by adjusting the number of slave stations to ensure that the number of slave stations under each master station is approximately the same.

[0127] In the above implementation process, by counting the number of slave stations assigned to each master station and dynamically adjusting when the difference in the number of slave stations exceeds the set threshold, the balanced distribution of the number of slave stations between master stations is achieved. This balancing mechanism effectively avoids the problems of excessive power consumption and communication delay caused by overloading of individual master stations, and at the same time ensures the communication efficiency and stability of the entire system.

[0128] Based on the above embodiments, in the manner of selecting slave stations from the first master station and allocating them to the second master station, it can be selected based on the communication quality between each slave station in the first master station and the first master station, or it can also be selected based on the communication quality between each slave station in the first master station and the second master station. Specifically, the communication quality information between each slave station allocated to the first master station and the second master station can be obtained first, and then the slave stations allocated to the first master station can be sorted according to the communication quality information, and a set number of target slave stations can be selected from the sorted slave stations and allocated to the second master station, where the communication quality of the target slave stations is higher than or equal to the communication quality of other unselected slave stations.

[0129] Continuing with the above example, the number of slave stations of master station 1 (the first master station) is 30, and the number of slave stations of master station 3 (the second master station) is 9. If the slave stations have been de-duplicated (if not, de-duplication is preferred), then the set number of slave stations to be selected is 10. Since the communication quality information of all slave stations sent by master station 3 has been obtained in S120 above, this communication quality information may include the communication quality information of the 30 slave stations under master station 1. Therefore, the communication quality of these 30 slave stations can be directly sorted according to the communication quality information obtained by master station 3, indicating the communication situation between these 30 slave stations and master station 3, and then the top 10 slave stations in the sorting can be selected and allocated to master station 3. The communication quality of these 10 slave stations with master station 3 is higher than or equal to the communication quality of the remaining 20 unselected slave stations with master station 3.

[0130] In some embodiments, if de-duplication is performed during the balance adjustment, the re-allocated slave stations can be preferentially allocated. For example, in the above example, the duplicate slave stations between master station 1 and master station 3 are retained and allocated to master station 3, and the allocation in master station 1 is deleted. If de-duplication is performed before the balance adjustment, one way is to arbitrarily select and delete one of the duplicate slave stations under a master station. Other ways can be to perform de-duplication according to the communication quality, such as retaining the slave station with the best communication quality as mentioned in the above embodiments. For example, if slave station 2 is re-allocated to master station 1 and master station 3, and the communication quality of slave station 2 with master station 1 is better, then slave station 2 is networked with master station 1, and then slave station 2 can be deleted from the allocation list of master station 3.

[0131] In some embodiments, if the overall communication quality of the slave stations allocated under a certain master station is relatively good, the number of its slave stations should be allowed to be larger, and this situation can preferentially ensure the reliability and stability of communication.

[0132] In the above implementation process, the above dynamic adjustment mechanism ensures that the slave stations can still maintain good communication quality after reallocation, avoiding the decline in communication performance caused by simple quantity adjustment. At the same time, by selecting the slave stations with the best communication quality for reallocation, this solution further optimizes the network topology, improves the overall communication efficiency and stability of the system, ensures the load balance of each master station, reduces power consumption, extends the service life of the equipment, and is more suitable for large-scale irrigation systems in complex environments.

[0133] On the basis of the above embodiments, after allocating each slave station, it is also necessary to configure the carrier frequency. When configuring the carrier frequency, the carrier frequencies of each master station can be determined first. Among them, the difference between the carrier frequencies of two adjacent master stations is greater than the set value. Then, a first carrier frequency configuration instruction can be sent to each master station. The first carrier frequency configuration instruction includes the carrier frequency of the corresponding master station and the slave station identifier under this master station. The first carrier frequency configuration instruction is used to instruct each master station to configure the corresponding carrier frequency for its slave stations. Then, receive the slave station carrier frequency configuration results sent by each master station, and then send a second carrier frequency configuration instruction to each master station. The second carrier frequency configuration instruction includes the carrier frequency of the corresponding master station. The second carrier frequency configuration instruction is used to instruct each master station to configure its own carrier frequency.

[0134] Among them, two adjacent master stations can be understood as master stations adjacent in geographical location. For example, master stations will be deployed in the field. The geographical locations of each master station can be obtained in advance, and then it can be known which master stations are adjacent in geographical location. For example, if master station 1 is adjacent to master station 2, and master station 2 is adjacent to master station 3, then the difference between the carrier frequencies of master station 1 and master station 2 will be greater than the set value, and the difference between the carrier frequencies of master station 2 and master station 3 will be greater than the set value.

[0135] Among them, the set value can be set according to actual needs. For example, it is 2MHz. In this way, the carrier frequencies of adjacent local area networks will be set to differ by at least 2MHz to avoid cross-frequency interference and ensure that the devices within each local area network can communicate normally.

[0136] After the networking APP determines the carrier frequencies of each master station, it can send configuration instructions. For example, the carrier frequency a of master station 1, the carrier frequency b of master station 2, and the carrier frequency c of master station 3. The networking APP can send a first carrier frequency configuration instruction to master station 1. This instruction includes the carrier frequency a and the slave station identifier (which can be the SN number of the slave station) of the slave stations allocated to master station 1. Send a first carrier frequency configuration instruction to master station 2. This instruction includes the carrier frequency b and the slave station identifier of the slave stations allocated to master station 2. Send a first carrier frequency configuration instruction to master station 3. This instruction includes the carrier frequency c and the slave station identifier of the slave stations allocated to master station 3.

[0137] After receiving the configuration instructions, Master Station 1, Master Station 2, and Master Station 3 can obtain the corresponding carrier frequencies and slave station identifiers, and then send the corresponding carrier frequencies to each slave station according to the slave station identifiers. After receiving the carrier frequencies, the slave stations can adjust their own carrier frequencies to the received carrier frequencies, thereby realizing the configuration of the carrier frequencies of the slave stations.

[0138] After receiving the carrier frequencies, the slave stations can first reply to the master stations whether the reception is successful, then set the carrier frequencies of the LoRa modules locally, and then restart the LoRa modules. After configuring the carrier frequencies, the slave stations will send the carrier frequency configuration results to the master stations to indicate whether the configuration is successful, and the master stations will feedback the carrier frequency configuration results of the slave stations to the networking APP.

[0139] After receiving the carrier frequency configuration results of the slave stations, if the networking APP determines that all slave stations have been successfully configured, it can configure the carrier frequencies of the master stations. If the slave stations are not successfully configured, the above process can be repeated for reconfiguration.

[0140] The networking APP sends second carrier frequency configuration instructions to each master station. For example, the configuration instruction sent to Master Station 1 includes carrier frequency a, the configuration instruction sent to Master Station 2 includes carrier frequency b, and the configuration instruction sent to Master Station 3 includes carrier frequency c. At this time, after receiving the configuration instructions, the master stations configure the carrier frequencies of the LoRa modules locally, restart the LoRa modules, and then reply to the networking APP with the configuration results.

[0141] It can be understood that configuring the carrier frequencies of the slave stations first is to ensure that the communication between the slave stations and the master stations is not interrupted. If the carrier frequencies of the master stations are configured first, it may cause the carrier frequencies of the master stations and the slave stations in a networking system to be inconsistent, resulting in the inability of the master stations and the slave stations to communicate, and thus the carrier frequencies of the slave stations cannot be configured continuously.

[0142] In some other embodiments, the carrier frequencies of each master station can also be equally spaced carrier frequencies, that is, the difference between the carrier frequencies of adjacent master stations is the same and is greater than the set value.

[0143] In the above implementation process, by configuring different carrier frequencies for each master station and its assigned slave stations, it is ensured that the difference between the carrier frequencies of adjacent master stations is greater than the set value, thereby effectively avoiding frequency interference and improving the stability and reliability of communication. By sending the carrier frequency configuration instructions step by step, first configuring the frequencies for the slave stations and then for the master stations, the orderliness and accuracy of the configuration process are ensured. At the same time, receiving the carrier frequency configuration results of the slave stations fed back by the master stations further verifies the success or failure of the configuration, enhancing the reliability and maintainability of the system.

[0144] On the basis of the above embodiments, in order to ensure successful networking, after configuring the carrier frequencies of the master stations and slave stations, an instruction for obtaining the device version information of their slave stations may be sent to each master station. The device version information instruction includes the slave station identifier, and the device version information instruction is used to indicate obtaining the device version information of the slave stations. If the device version information of the slave stations sent by each master station is successfully received, it is determined that the networking is successful.

[0145] Referring to Figure 3 ( Figure 3 (where the mobile phone APP in [] is the networking APP), after configuring the carrier frequencies of the master stations and slave stations as described above, if the configuration is successful, within a networking system, the carrier frequencies of the master stations and their slave stations are the same, and normal communication can be established between the master stations and slave stations. Therefore, at this time, an instruction for obtaining the device version information of their slave stations may be sent to each master station. For example, send this instruction to Master Station 1, Master Station 2, and Master Station 3 respectively. The instruction sent to Master Station 1 includes the slave station identifiers of the slave stations under Master Station 1 to instruct Master Station 1 to obtain the device version information from these slave stations. After receiving this instruction, Master Station 1 can, according to the slave station identifiers, sequentially send information acquisition instructions to each slave station to obtain the device version information of the slave stations. This information may include information such as the boot, firmware, and LoRa module version of the slave stations. For Master Station 2 and Master Station 3, obtain the device version information of their respective slave stations in a similar manner.

[0146] Each master station may send the obtained device version information of the slave stations to the networking APP. The networking APP can verify whether the device version information of each slave station is successfully received. If successful, it can continue to obtain the device version information of the master stations. If not, the above frequency configuration process can be repeated (for example, if the device version information of Slave Station 2 under Master Station 1 is not obtained, the carrier frequency configuration instruction for Slave Station 2 can be resent to Master Station 1). If the networking APP can successfully obtain the device version information of the master stations (the device version information of the master stations may include information such as the boot, firmware, LoRa module version, and Bluetooth module version), it is determined that the networking is successful.

[0147] In the above implementation process, the acquisition of device version information not only verifies whether the slave stations have successfully received and applied the new carrier frequency configuration, but also confirms whether the communication link between the slave stations and the master stations is normal. This verification mechanism effectively improves the success rate of networking and the reliability of the system, and reduces the networking failures caused by configuration errors or communication failures.

[0148] On the basis of the above embodiments, if a certain slave station fails to network, it can be marked, or it is allowed to retry networking. If it still fails after retrying a certain number of times, the slave station failure can be prompted, and it is recommended that the user intervene manually. If the networking fails, the slave station can be marked and it is prompted that manual intervention is required. Then the user terminal can remove the slave station from the networking process to prevent it from dragging down the overall progress.

[0149] Based on the above embodiments, when the master station configures carrier frequencies for each slave station, the master station can freely select the configuration order. In actual situations, considering that slave stations with weak signals are more susceptible to interference and signal attenuation, these slave stations can be preferentially configured with frequencies.

[0150] Specifically, when the networking APP generates the first carrier frequency configuration instruction, for each master station, it can generate an identification queue of the slave stations under that master station. This identification queue is formed by sorting the slave stations in ascending order of communication quality. Therefore, the first carrier frequency configuration instruction can include the identification queue, which includes the identification of the slave stations under that master station. The first carrier frequency configuration instruction is specifically used to instruct the master station to sequentially configure the corresponding carrier frequencies for its slave stations according to the identification queue.

[0151] For example, taking master station 1 as an example, the networking APP can first sort the slave stations according to the communication quality information of each slave station assigned to master station 1. For example, sort these slave stations in ascending order of communication quality, and then form an identification queue. The slave station corresponding to the identification at the first position in this identification queue has the lowest communication quality, and the slave station corresponding to the identification at the last position has the highest communication quality. Then, the first carrier frequency configuration instruction sent by the networking APP to master station 1 includes this identification queue. After receiving the first carrier frequency configuration instruction, master station 1 sequentially configures the frequencies of each slave station according to the identification queue in the instruction. For example, first configure the frequency for the slave station ranked first in the identification queue, and then configure the frequency for the slave station ranked second, and so on.

[0152] In the above implementation process, slave stations with weak signals are more susceptible to interference and signal attenuation. Preferentially configuring frequencies for these slave stations can ensure that they can establish a stable communication link as soon as possible during the networking process. This reduces communication interruptions or data loss caused by signal problems and improves the overall stability of the system. Moreover, slave stations with weak signals may require more attempts and adjustments to successfully configure frequencies. If these slave stations are processed preferentially, problems can be discovered and adjusted earlier, avoiding problems being discovered only in the later stage of networking, thereby reducing the overall networking time.

[0153] Based on the above embodiments, in the method of determining the carrier frequencies of each master station, one method is for the user to set the carrier frequencies according to actual needs, and other methods can be to generate the corresponding carrier frequencies through a preset hash algorithm based on the master station identification of each master station.

[0154] Among them, due to the protocol of LoRa module communication, its device identification is transmitted as device ID number, so the device ID number of the master station and the slave station can be associated with their own SN number. Since the device ID number of the LoRa module can be configured in the range of 0-65535, the device ID number of the LoRa module of the master station and the slave station can be obtained based on the value of the 13 bits after the SN number of the device, such as the device ID number of the master station is the value of the 13 bits after the SN number + 1000, and the device ID number of the slave station is the value of the 13 bits after the SN number + 2000. Of course, the specific rules for obtaining the device ID number can be set according to actual needs, not limited to this implementation method.

[0155] When the master station receives the frequency configuration instruction, it can parse the SN number of the slave station and determine the device ID number of the slave station according to the above rules. Then, when communicating with the slave station, it can carry the slave station device ID number to realize information confirmation.

[0156] The master station identifier here can be the device ID number of the master station or the SN number of the master station. When generating the carrier frequency, the SN number of the master station can be hashed using a preset hash algorithm (the specific hash algorithm can be flexibly selected according to actual needs) to hash a carrier frequency in the range of 470-510MHz as the carrier frequency of the master station. Of course, the device ID number can also be hashed. Since the master station identifiers of each master station are different, different carrier frequencies can be obtained, thereby realizing different carrier frequencies configured for different LANs and avoiding the problem of frequency crosstalk.

[0157] In some other implementations, a group of available carrier frequencies may be predefined, and when networking, a carrier frequency may be randomly selected for each master station.

[0158] In the above implementation process, the corresponding carrier frequency is generated by using a preset hash algorithm according to the master station identification of each master station, thereby ensuring the uniqueness and traceability of the carrier frequency. This frequency generation method based on the master station identification not only simplifies the frequency allocation process and avoids frequency conflicts, but also improves the automation and management efficiency of the system.

[0159] Based on the above embodiment, when networking, since it is unknown whether the carrier frequency has been configured between each slave station and each master station, the carrier frequency configuration can be performed first to ensure that each master station can communicate with each slave station.

[0160] When the master station and the slave station leave the factory, the carrier frequency of the LoRa module is set to the default carrier frequency, that is, the carrier frequency of the master station and the slave station are the default carrier frequency, which means that all devices are configured with the same default carrier frequency when leaving the factory, thus ensuring that the master station and the slave station can communicate based on this default frequency before networking. During the first installation, since the carrier frequencies of the master station and the slave station are the same, the above networking process can be started directly at this time.

[0161] In the irrigation scenario, after the master station and slave stations are installed in the first year, they may be dismantled and stored after the crops are harvested, waiting to be installed in the second year. Since the master station and slave stations have been networked for the first time, after the master station and slave stations are dismantled, it is impossible to distinguish which master stations and which slave stations are a networked system. Therefore, when installing them later, the carrier frequencies of these master stations and slave stations can be restored to the default carrier frequencies.

[0162] Specifically, refer to Figure 4 ( Figure 4 The mobile phone APP is the networking APP), and if the previous networking information is stored, a first frequency configuration instruction is sent to each master station, the first frequency configuration instruction includes a default carrier frequency, and the first frequency configuration instruction is used to instruct each master station to configure the default carrier frequency for its previously networked slave station; and then a second frequency configuration instruction is sent to each master station, the second frequency configuration instruction includes the default carrier frequency, and the second frequency configuration instruction is used to instruct each master station to configure its own carrier frequency to the default carrier frequency.

[0163] Among them, if the previous networking information is stored, it means that these slave stations have been networked before, and the user terminal stores the carrier frequency configuration information after the last networking, such as the carrier frequency configured for master station 1 and its slave station is a, the carrier frequency configured for master station 2 and its slave station is b, and the carrier frequency configured for master station 3 and its slave station is c. The master station and slave stations with the same carrier frequency can communicate.

[0164] At this time, for the master station 1, the first frequency configuration instruction it sends includes the default carrier frequency. At this time, the master station 1 first sends the default carrier frequency to the slave stations previously networked, so that these slave stations configure the carrier frequency as the default carrier frequency, and the frequency configuration of the slave stations of the master stations 2 and 3 is also the same. Then the second frequency configuration instruction is sent to each master station, and then the carrier frequency of each master station can also be configured as the default carrier frequency. At this time, the carrier frequencies of each master station and each slave station are all the default carrier frequencies, and each master station and each slave station can communicate, so that each master station can obtain the communication quality information between each slave station.

[0165] Of course, if a new or replaced master station is added during subsequent installation, the new or replaced master station can be configured as the carrier frequency of the slave station that communicates with it. For example, if master station 2 fails after the first year of use, a new master station 4 is added to replace master station 2. The carrier frequency of master station 4 can be configured as the carrier frequency of the original master station 2, that is, the carrier frequency of master station 4 is configured to b, so that master station 4 can communicate with the slave stations whose carrier frequency was b before, so that the frequency of these slave stations can be configured through master station 4.

[0166] After configuring the default carrier frequency, you can trigger the one-click networking process through the networking APP. Since the slave station is powered by a battery, if there is no action after the setting timeout, the LoRa module and MCU will go into sleep mode. In order to save the one-click networking time, during the networking process, the LoRa modules of all slave stations are set to not sleep, and the preamble time is set to 0, eliminating the preamble time for each communication between the master station and the slave station.

[0167] After the master station receives the networking notification from the networking APP, it broadcasts to wake up all slave stations. After receiving the broadcast information, the slave station sets the LoRa module to not sleep and the preamble time to 0. Then all the master stations also set the LoRa module to not sleep and the preamble time to 0. Finally, the master station replies to the networking notification of the networking APP via 4G or Bluetooth.

[0168] In order to ensure that the slave stations and the master station of each LAN can communicate normally, the communication quality information provides an important basis for networking. Given that the LoRa module uses half-duplex mode and only one device can send signals at the same carrier frequency, the networking APP will attach the SN number of the slave station when sending the communication quality information. After the master station receives the instruction, it will cache the SN number of the slave station and send the communication quality information acquisition instruction to each slave station in turn. After receiving the instruction, the slave station will measure and reply the current communication quality information to the master station. Subsequently, the master station replies to the networking APP with the communication quality information of each slave station and itself. Finally, the networking APP can allocate slave stations based on the communication quality information to achieve the optimal allocation from slave stations to master stations and complete the networking.

[0169] In the above implementation process, the LoRa carrier frequencies of all master stations and slave stations are restored to the default carrier value. In this way, no matter whether the master station and the slave stations have been networked before or whether they are at different carrier frequencies, they can be unified to the default carrier frequency at the beginning of networking, thereby ensuring the communication between the master station and the slave stations, and then networking can be carried out to ensure the smooth progress of the networking process.

[0170] On the basis of the above embodiments, in the networking process of the intelligent irrigation system, in order to ensure that the slave station can maintain good communication with the master station throughout the entire crop growth cycle, it is necessary to consider the dynamic changes in communication quality. Specifically, as the crops grow, they may block the wireless signal, resulting in a decrease in communication quality. Therefore, when networking, not only the current communication quality should be considered, but also the communication quality in the worst scenario that may occur in the future should be estimated.

[0171] Therefore, in the method of determining the communication quality information of each slave station, it is also possible to first receive the initial communication quality information of multiple slave stations obtained by each master station sent by the master station, and then determine the communication quality information of each slave station based on the initial communication quality information and the communication attenuation value under the irrigation scenario.

[0172] Among them, the communication attenuation value can be determined based on historical data under the irrigation scenario, environmental factors (such as crop growth rate, height, etc.) and actual test results. After the user terminal obtains the communication quality information of each slave station from each master station, the communication quality information can be subtracted from the communication attenuation value to obtain the communication quality information of each slave station.

[0173] In some implementations, the user terminal may be configured with corresponding communication attenuation values ​​for different crop types, so the communication attenuation value corresponding to the crop may be determined according to the crop type.

[0174] The crop type can be manually input into the user terminal by the user, or the camera installed on the slave station can collect crop images and transmit them to the user terminal through the master station. The image recognition algorithm or neural network model deployed on the user terminal can identify the crop type based on the crop image. Then the user terminal can find the communication attenuation value corresponding to the crop type according to the crop type.

[0175] In this way, the conditions of different crops can be considered and the corresponding communication attenuation values ​​can be determined, which can more accurately predict and compensate for the attenuation of signals in the farmland environment, thereby optimizing the performance of the wireless communication link. This dynamic adjustment mechanism based on crop characteristics not only improves the reliability and stability of communication, but also reduces communication interruptions and data loss caused by signal attenuation, ensuring the efficient operation of the irrigation system.

[0176] In some embodiments, considering that crops block signals differently in different growth cycles, the user terminal may also be configured with crop types and communication attenuation values ​​in different growth cycles, so that the communication attenuation value of the corresponding crop may be determined based on the crop type and the current growth cycle of the crop.

[0177] For example, the communication attenuation value of the same crop in May is different from that in August, so different communication attenuation values ​​can be set in combination with the crop growth cycle. This solution determines the communication attenuation value by comprehensively considering the crop type and the current growth cycle, and can more accurately adapt to the dynamic changes in the farmland environment. Different crops have different effects on signal transmission at different growth stages. By dynamically adjusting the attenuation value, the signal can be effectively compensated for the shielding and attenuation during the crop growth process, ensuring the stability and reliability of the communication link.

[0178] In some implementations, the communication attenuation value may also be a fixed value. Irrigation systems are generally deployed in locations such as sorghum and corn, so the heights of the crops are basically the same, so the communication attenuation is not much different. Therefore, a unified communication attenuation value may be set.

[0179] In some embodiments, the communication attenuation value can also be predicted by a neural network model, such as the deployment environment factors of the current slave station (such as crop type, crop growth rate, crop height, terrain, etc.) and historical data (including communication quality information at different time points, such as signal strength, signal-to-noise ratio, etc.) can be input into the neural network model, and the communication attenuation value can be predicted and output by the neural network model. It can be understood that the neural network model can be obtained by training a large amount of data in advance. Among them, the neural network model can be a long short-term memory network model, a convolutional neural network model, a generative adversarial network model, etc.

[0180] In some embodiments, if multiple communication attenuation values ​​are determined through the above-mentioned methods, in actual applications, one of the communication attenuation values ​​can be arbitrarily selected for use, or multiple communication attenuation values ​​can be averaged or weighted averaged to obtain a final communication attenuation value. In this way, the communication attenuation value determined by combining multiple methods can better reflect the signal attenuation under actual conditions.

[0181] When determining the communication quality information, taking signal strength as an example, if the initial signal strength X1 of slave station 1 obtained by master station 1, if the communication attenuation value determined by the above method is k, then X1-k can be used as the signal strength between slave station 1 and master station 1. When slave station 1 is subsequently allocated, the signal strength (X1-k) can be used as the basis for allocation, and the same applies to other slave stations.

[0182] In the above implementation process, by considering the communication attenuation value in the irrigation scenario, it can be ensured that the communication between the slave station and the master station can remain stable even when the crops grow to the most lush.

[0183] The following is a specific example to illustrate the above networking process. For details, please refer to Figure 5 .

[0184] (1) Enter a certain plot through the Networking APP (referred to as the mobile APP in the figure), click on the one-key networking, and first check whether any of the two networks of the main station has successfully logged in. If so, go to step (6);

[0185] (2) The main station fails to log in to both 4G networks, prompting the user to use the mobile phone Bluetooth to connect to the main station;

[0186] (3) The user presses any button on the master station to wake up the master station;

[0187] (4) The user double-clicks the button for more than 2 seconds to activate the master station Bluetooth;

[0188] (5) The user turns on the Bluetooth on his mobile phone within 100 seconds and connects to the Bluetooth of the main station;

[0189] (6) The mobile phone APP confirms that the carrier frequencies of all slave stations and master stations that are not networked are set to the default carrier frequencies;

[0190] (7) The mobile phone APP sends a one-key networking notification through 4G or Bluetooth. After the master station and the slave station receive the one-key networking notification, the LoRa module and the MCU are set to not sleep, the preamble time is set to 0s, and the one-key networking timeout time is dynamically set according to the number of networked slave stations. When the timeout expires, LoRa and the MCU resume sleep mode, and the master station and the slave station exit the one-key networking process;

[0191] (8) The mobile phone APP obtains the LoRa signal strength and signal-to-noise ratio of each slave station and each master station through 4G or Bluetooth. If all acquisitions fail or all time out, the mobile phone APP exits the one-key networking process;

[0192] (9) Mobile phone APP performs balanced networking;

[0193] (10) The mobile phone APP sends the carrier frequency of the slave station and the corresponding master station after the networking is established through 4G or Bluetooth;

[0194] (11) The mobile phone APP sends instructions to obtain the version information of the slave and master devices through 4G or Bluetooth. Since the LoRa module parameter modification requires a restart, in step (10), the slave receives the instruction to set the carrier frequency, first replies that the reception is successful, and then sets the parameters. After the carrier frequencies of the slave and master are set and the LoRa module is restarted, the successful acquisition of the device version information indicates that the carrier frequency is set successfully;

[0195] (12) The mobile phone APP ends the one-click networking process.

[0196] The networking method of this solution is divided into two sub-processes, balanced networking and carrier frequency configuration. Balanced networking is to network based on the communication quality information of each master station and all slave stations, to ensure normal communication, and to balance the number of slave stations in each LAN, so that each master station and slave station can meet the power consumption requirements of one operating season (5 months) without charging; carrier frequency configuration is to set the carrier frequencies of adjacent LANs to differ by at least 2MHz to ensure that there is no crosstalk when sending and receiving at the same time.

[0197] In conjunction with the above embodiments, please refer to Figure 6 , Figure 6 This is a structural block diagram of a networking device 200 provided in an embodiment of the present application. The device 200 may be a module, a program segment or a code on an electronic device (user terminal). It should be understood that the device 200 corresponds to the above networking method embodiment and can execute each step involved in the networking method embodiment. The specific functions of the device 200 can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here.

[0198] Optionally, the networking device 200 includes:

[0199] Notification module 210, used to send a networking notification to each master station, wherein the networking notification is used to instruct each master station to obtain communication quality information between each slave station and the master station;

[0200] The information acquisition module 220 is used to acquire the communication quality information of the plurality of slave stations obtained by each master station sent by the master station;

[0201] The networking module 230 is used to network the at least one master station with the multiple slave stations according to the communication quality information to form at least one networking system, each networking system including a master station and slave stations connected to the master station.

[0202] Optionally, the networking module 230 is used to assign each slave station to a corresponding master station according to the communication quality information; for each master station and the slave station assigned to it, a corresponding carrier frequency is configured to form at least one networking system, wherein the carrier frequencies of the master station and the slave station in each networking system are the same, and the carrier frequencies of the networking systems are different from each other.

[0203] Optionally, the networking module 230 is configured to allocate, for each master station, a slave station whose communication quality indicated by the communication quality information is greater than a set communication quality to the master station according to the communication quality information of the multiple slave stations obtained by the master station.

[0204] Optionally, the networking module 230 is configured to adjust and allocate the slave station to the master station with the best communication quality if the same slave station is allocated to different master stations.

[0205] Optionally, the networking module 230 is configured to count the number of slave stations allocated to each master station, and determine a first master station with the largest number of slave stations and a second master station with the smallest number of slave stations; if the difference in the number of slave stations between the first master station and the second master station exceeds a set threshold, then select slave stations that meet the set conditions from the slave stations allocated to the first master station and re-allocate them to the second master station.

[0206] Optionally, the networking module 230 is configured to obtain communication quality information between each slave station allocated to the first master station and the second master station; sort the slave stations allocated to the first master station according to the communication quality information, and select a set number of target slave stations from the sorted slave stations and allocate them to the second master station, where the communication quality of the target slave stations is higher than or equal to the communication quality of other unselected slave stations.

[0207] Optionally, the networking module 230 is configured to determine the carrier frequencies of each master station, where the difference between the carrier frequencies of two adjacent master stations is greater than a set value; send a first carrier frequency configuration instruction to each master station, the first carrier frequency configuration instruction includes the carrier frequency corresponding to the master station and the slave station identifier under this master station, and the first carrier frequency configuration instruction is used to instruct each master station to configure the corresponding carrier frequency for its slave stations; receive the slave station carrier frequency configuration results sent by each master station; send a second carrier frequency configuration instruction to each master station, the second carrier frequency configuration instruction includes the carrier frequency corresponding to the master station, and the second carrier frequency configuration instruction is used to instruct each master station to configure its own carrier frequency.

[0208] Optionally, the networking module 230 is configured to send an instruction to each master station to obtain the device version information of its slave stations, the device version information instruction includes the slave station identifier, and the device version information instruction is used to instruct to obtain the device version information of the slave stations; if the device version information of the slave stations sent by each master station is successfully received, it is determined that the networking is successful.

[0209] Optionally, the first carrier frequency configuration instruction includes an identifier queue, the identifier queue includes the slave station identifiers under this master station, and the identifier queue is a queue of slave station identifiers formed by sorting the communication quality of the slave stations from low to high. The first carrier frequency configuration instruction is specifically used to instruct the master station to configure the corresponding carrier frequency for its slave stations in sequence according to the identifier queue.

[0210] Optionally, the networking module 230 is configured to generate corresponding carrier frequencies according to the master station identifiers of each master station through a preset hash algorithm.

[0211] Optionally, the networking device 200 further includes:

[0212] A default frequency configuration module, which is used to send a first frequency configuration instruction to each master station if previous networking information is stored. The first frequency configuration instruction includes a default carrier frequency, and is used to instruct each master station to configure the default carrier frequency for the slave stations that were previously networked with it; send a second frequency configuration instruction to each master station, the second frequency configuration instruction includes the default carrier frequency, and the second frequency configuration instruction is used to instruct each master station to configure its own carrier frequency to the default carrier frequency.

[0213] Optionally, the information acquisition module 220 is configured to receive the initial communication quality information of the multiple slave stations obtained by each master station; determine the communication quality information of each slave station according to the initial communication quality information and the communication attenuation value in the irrigation scenario.

[0214] Optionally, each master station is configured with a short-range wireless communication method and a cellular mobile communication method, and each master station is used to communicate with the user terminal through the short-range wireless communication method or the cellular mobile communication method.

[0215] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0216] Please refer to Figure 7 , Figure 7 FIG. is a schematic structural diagram of an electronic device for executing a networking method provided by an embodiment of the present application. The electronic device is a user terminal and may include: at least one processor 310, such as a CPU, at least one communication interface 320, at least one memory 330, and at least one communication bus 340. Among them, the communication bus 340 is used to realize the connection and communication between these components. Among them, the communication interface 320 of the device in the embodiment of the present application is used to communicate signaling or data with other node devices. The memory 330 may be a high-speed RAM memory, or a non-volatile memory, such as at least one disk memory. Optionally, the memory 330 may also be at least one storage device located far from the aforementioned processor. The memory 330 stores computer-readable instructions, and when the computer-readable instructions are executed by the processor 310, the electronic device executes the implementation process of the above networking method.

[0217] It can be understood that Figure 7 the structure shown is only schematic, and the electronic device may further include more or fewer components than those shown in Figure 7 , or have a different configuration from that shown in Figure 7 . Figure 7The components shown in can be implemented by hardware, software, or a combination thereof.

[0218] An embodiment of this application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it executes the method process performed by the electronic device in the above embodiment of the networking method.

[0219] This embodiment discloses a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided in the above method embodiments. For example, it includes:

[0220] Send a networking notification to each master station, where the networking notification is used to instruct each master station to obtain the communication quality information between each slave station and the master station;

[0221] Obtain the communication quality information of the multiple slave stations obtained by each master station sent by each master station;

[0222] Network the at least one master station and the multiple slave stations according to the communication quality information to form at least one networking system. Each networking system includes a master station and slave stations connected to the master station.

[0223] In summary, an embodiment of this application provides a networking method, a communication system, an electronic device, a storage medium, and a program product. In this solution, the user terminal automatically networks according to the communication quality of each slave station. Thus, in an irrigation scenario, remote networking can be performed through the user terminal, with higher networking efficiency and lower maintenance costs. Moreover, networking based on communication quality information can ensure the reliability of the communication link between the slave station and the master station, thereby ensuring the reliability of irrigation.

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

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

[0226] Furthermore, in each of the embodiments of the present application, the various functional modules may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.

[0227] In this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0228] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A networking method, characterized in that: The method is used for networking equipment in an irrigation system, wherein the irrigation system includes at least one master station and multiple slave stations, wherein the multiple slave stations are irrigation equipment, and the slave stations communicate with the master station via a LoRa module, and each master station is used to communicate with a user terminal. The method includes: Sending a networking notification to each master station, wherein the networking notification is used to instruct each master station to obtain communication quality information between each slave station and the master station; Acquire communication quality information of the plurality of slave stations obtained by each master station and sent by the master station; The at least one master station is networked with the plurality of slave stations according to the communication quality information to form at least one networking system, each networking system comprising a master station and slave stations connected to the master station.

2. The method according to claim 1, characterized in that The step of networking the at least one master station with the plurality of slave stations according to the communication quality information to form at least one networking system comprises: Allocating each slave station to a corresponding master station according to the communication quality information; For each master station and its assigned slave station, a corresponding carrier frequency is configured to form at least one networking system, wherein the carrier frequencies of the master station and the slave stations in each networking system are the same, and the carrier frequencies of the networking systems are different from each other.

3. The method according to claim 2, characterized in that The allocating each slave station to the corresponding master station according to the communication quality information comprises: For each master station, based on the communication quality information of the plurality of slave stations obtained by the master station, a slave station whose communication quality indicated by the communication quality information is greater than a set communication quality is allocated to the master station.

4. The method according to claim 3, characterized in that: After allocating the slave station whose communication quality indicated by the communication quality information is greater than the set communication quality to the master station, the method further includes: If the same slave station is assigned to different master stations, the slave station will be adjusted and assigned to the master station with the best communication quality.

5. The method according to claim 3, characterized in that: After allocating the slave station whose communication quality indicated by the communication quality information is greater than the set communication quality to the master station, the method further includes: Count the number of slave stations assigned to each master station, and determine the first master station with the largest number of slave stations and the second master station with the smallest number of slave stations; If the difference in the number of slave stations between the first master station and the second master station exceeds a set threshold, a slave station that meets the set condition is selected from the slave stations allocated to the first master station and reallocated to the second master station.

6. The method according to claim 5, characterized in that The selecting a slave station satisfying a set condition from the slave stations allocated to the first master station and reallocating the slave station to the second master station comprises: Acquire communication quality information between each slave station assigned to the first master station and the second master station; The slave stations assigned to the first master station are sorted according to the communication quality information, and a set number of target slave stations are selected from the sorted slave stations and assigned to the second master station, wherein the communication quality of the target slave stations is higher than or equal to the communication quality of other unselected slave stations.

7. The method according to claim 2, characterized in that The configuring of the corresponding carrier frequency for each master station and the slave station assigned thereto includes: Determine the carrier frequency of each master station, wherein the difference between the carrier frequencies of two adjacent master stations is greater than a set value; Sending a first carrier frequency configuration instruction to each master station, the first carrier frequency configuration instruction including the carrier frequency of the corresponding master station and the slave station identifier under the master station, the first carrier frequency configuration instruction being used to instruct each master station to configure the corresponding carrier frequency for its slave station; Receive the slave station carrier frequency configuration results sent by each master station; A second carrier frequency configuration instruction is sent to each master station, where the second carrier frequency configuration instruction includes the carrier frequency of the corresponding master station, and the second carrier frequency configuration instruction is used to instruct each master station to configure its own carrier frequency.

8. The method according to claim 7, characterized in that After sending the second carrier frequency configuration instruction to each master station, the method further includes: Sending to each master station an instruction for obtaining device version information of its slave station, wherein the device version information instruction includes a slave station identifier, and the device version information instruction is used to instruct to obtain device version information from the slave station; If the device version information of the slave stations sent by each master station is successfully received, it is determined that the networking is successful.

9. The method according to claim 7, characterized in that: The first carrier frequency configuration instruction includes an identification queue, which includes the slave station identifications under the master station. The identification queue is a queue of slave station identifications formed by sorting the communication qualities of the slave stations from low to high. The first carrier frequency configuration instruction is specifically used to instruct the master station to configure corresponding carrier frequencies for its slave stations in sequence according to the identification queue.

10. The method according to claim 7, characterized in that Determining the carrier frequency of each master station includes: According to the master station identification of each master station, the corresponding carrier frequency is generated by a preset hash algorithm.

11. The method according to any one of claims 1 to 10, characterized in that: Before sending the networking notification to each master station, the method further includes: If the previous networking information is stored, a first frequency configuration instruction is sent to each master station, where the first frequency configuration instruction includes a default carrier frequency, and the first frequency configuration instruction is used to instruct each master station to configure the default carrier frequency for its previously networked slave station; A second frequency configuration instruction is sent to each master station, where the second frequency configuration instruction includes the default carrier frequency, and the second frequency configuration instruction is used to instruct each master station to configure its own carrier frequency to the default carrier frequency.

12. The method according to any one of claims 1 to 10, characterized in that: The obtaining of the communication quality information of the plurality of slave stations sent by each master station and obtained by the master station includes: receiving initial communication quality information of the plurality of slave stations obtained by each master station and sent by the master station; The communication quality information of each slave station is determined according to the initial communication quality information and the communication attenuation value in the irrigation scenario.

13. The method according to claim 12, characterized in that The communication attenuation value is determined by: According to the crop type, the communication attenuation value of the corresponding crop is determined.

14. The method according to claim 12, characterized in that The communication attenuation value is determined by: The communication attenuation value of the corresponding crop is determined according to the crop type and the current growth cycle of the crop.

15. The method according to any one of claims 1 to 10, characterized in that: Each master station is configured with a short-range wireless communication mode and a cellular mobile communication mode, and each master station is used to communicate with a user terminal through the short-range wireless communication mode or the cellular mobile communication mode.

16. A communication system, characterized in that: The communication system includes a user terminal and an irrigation system. The irrigation system includes at least one master station and multiple slave stations. The multiple slave stations are irrigation equipment. The slave stations communicate with the master station through a LoRa module, and each master station communicates with the user terminal. The user terminal is used to send a networking notification to each master station, wherein the networking notification is used to instruct each master station to obtain communication quality information between each slave station and the master station; Each of the master stations is used to obtain communication quality information from each slave station and send it to the user terminal; The user terminal is also used to network the at least one master station with the multiple slave stations based on the communication quality information of the multiple slave stations to form at least one networking system, each networking system including a master station and slave stations connected to the master station.

17. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 15 is executed.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 15 is performed.

19. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are read and executed by a processor, the method according to any one of claims 1 to 15 is executed.