Water affair Internet of Things long connection cluster management method and system
By introducing a load balancing scheduler in the water IoT system, dynamically allocating the device traffic entrance address and elastic expansion, the problem of unbalanced data transmission is solved, and the stable long connection between the device and the platform is achieved and the system performance improvement is improved.
Patent Information
- Application Number
- CN202411762545.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-25
AI Technical Summary
In water IoT systems, uneven data transmission causes equipment to be overloaded or idle, affecting system performance and stability.
A load balancing scheduler is introduced to collect resource occupation information of terminal equipment regularly, calculate the load index of each traffic inlet, dynamically allocate the traffic inlet address of the new access device, and alarm and elastic capacity expansion when the load is overloaded.
It realizes the stability of long connection between water IoT sensing devices and IoT platforms, ensures balanced resource allocation, shortens response time, improves system stability, and has dynamic adaptability.
Smart Images

Figure CN119697193A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart water technology, and in particular to a water Internet of Things long connection cluster management method and system. Background Art
[0002] Data collection and transmission in the water Internet of Things is an important part of realizing intelligent control and management. Generally speaking, data transmission adopts a distributed cluster deployment method. For this method, load balancing is a very important part. Due to the large number of devices for data collection and transmission and the large data flow, there will be an imbalance in data transmission, causing some devices to be overloaded while others are idle. This will not only affect the efficiency of data transmission, but also reduce the overall performance of the water Internet of Things.
[0003] At present, most water IoT use centralized IoT platforms with a single traffic entrance. The architecture of the centralized IoT platform is roughly as follows: Figure 1 In this mode, there are the following main disadvantages: 1) Single point failure risk: Since all data flows through a single central node for processing and management, if this central node fails, the entire system may be affected, resulting in service interruption; 2) Scalability limitations: With the rapid growth in the number of devices, the central node may face bottlenecks in processing power and storage space, making it difficult for the system to scale horizontally to cope with larger-scale data processing and connection management needs; 3) Performance bottleneck: The centralized architecture may encounter delays in data processing and command distribution, especially in the case of high concurrent access or large data transmission, the central node may become a constraint on the system's response speed; 4) Network dependency: The communication between the central node and each device has high requirements for network stability, and any network interruption may lead to obstruction of information transmission.
[0004] like Figure 2 As shown in the figure, the water IoT platform using a distributed system can overcome the defects of the traditional centralized system that will lead to resource shortage and response bottleneck of the central host. However, due to the large number of devices for data collection and transmission and the large data flow, the distributed system will have uneven data transmission, causing some devices to be overloaded while others are idle. This mode has the following main disadvantages: 1) Uneven resource allocation: Due to improper design of load balancing algorithms, some servers or service instances may be overloaded with requests, while other servers are idle or lightly loaded, resulting in resource waste and reduced overall system efficiency. 2) Increased response time: An unreasonable load balancing strategy may cause IoT device connections to be assigned to servers with weaker processing capabilities or higher current loads, thereby increasing the response time of the device and affecting data transmission. 3) System instability: Load balancing fails to effectively identify and avoid distributing requests to servers that have reached or are close to their capacity limits, which may cause these servers to overload and crash, triggering a chain reaction and affecting the stability and availability of the entire system. 4) Lack of dynamic adaptability: Without taking into account the real-time changing system load conditions and server performance fluctuations, static or fixed-rule load balancing strategies may not be able to effectively adapt to traffic peaks and valleys, and cannot achieve true on-demand allocation.
[0005] How to achieve the stability of long connections between water IoT sensing devices and IoT platforms is a technical problem that needs to be solved urgently. Summary of the invention
[0006] In this regard, the present invention provides a water Internet of Things long connection cluster management method, system, electronic device, computer storage medium and computer program product to solve the above-mentioned technical problems.
[0007] The present invention discloses a water affairs Internet of Things long connection cluster management method, the method comprising the following steps: The load balancing scheduler is introduced to be responsible for the connection scheduling of the terminal devices with long connections, as follows: The load balancing scheduler collects resource usage information of each connected terminal device in a regular and cyclic manner, and calculates the load index of each traffic entrance based on the dynamic load balancing allocation algorithm; The load balancing scheduler allocates a traffic entry address to the newly connected terminal device according to the resource occupancy information of each traffic entry and the load index of each traffic entry, and sends the allocated traffic entry address to the newly connected terminal device, so that the newly connected terminal device attempts to establish a connection with the corresponding traffic entry according to the traffic entry address; In addition, load monitoring is introduced to issue alarms and elastically expand capacity when the overall system load is overloaded.
[0008] Optionally, introduce load monitoring to issue an alarm and elastically expand capacity when the overall system load is overloaded, including: The load balancing scheduler monitors the overall load of the computing system. When the load index of all traffic entrances is greater than the warning value, an alarm prompt is sent to the alarm system and the elastic expansion script is called synchronously. The elastic expansion script automatically generates a virtual server and deploys traffic entry-related programs, and informs the load balancing scheduler of the local IP information to facilitate the load balancing scheduler to allocate subsequent device traffic.
[0009] Optionally, the load balancing scheduler allocates a traffic entry address to a newly connected terminal device according to resource occupancy information of each traffic entry and a load index of each traffic entry, including: The load balancing scheduler obtains historical resource occupancy information of the newly connected terminal device, wherein the historical resource occupancy information includes resource occupancy information of several newly connected terminal devices in different time periods, and uses a deep prediction model to predict the target resource occupancy information of the newly connected terminal device in the current time period based on the historical resource occupancy information; According to the target resource occupancy information, the resource occupancy information of each traffic entrance, and the load index of each traffic entrance, a number of non-idle available traffic entrances are screened out; The target allocation quantity is determined based on the target resource occupancy information, and a first number of non-idle available traffic entrances and a second number of idle traffic entrances are screened and obtained. The sum of the first number and the second number is the target allocation quantity.
[0010] Optionally, determining a target allocation quantity according to the target resource occupancy information includes: Determine a first target allocation quantity according to the target resource occupation information and a preset corresponding relationship; Obtaining the fluctuation intensity of the load index of each non-idle available traffic inlet, and calculating a fluctuation adjustment coefficient according to the fluctuation intensity; The first target allocation quantity is optimized and adjusted using the fluctuation adjustment coefficient to obtain a second target allocation quantity, where the second target allocation quantity is the final target allocation quantity.
[0011] Optionally, the optimizing and adjusting the first target allocation quantity by using the fluctuation adjustment coefficient to obtain a second target allocation quantity includes: The fluctuation adjustment coefficient is used to optimize and adjust the proportion of the first quantity in the first target allocation quantity, and correspondingly, the final first quantity and the second quantity are determined based on the adjusted proportion of the first quantity.
[0012] Optionally, optionally, the depth prediction model includes a convolution module and a Transformer prediction module, the Transformer prediction module includes a first encoder, a second encoder, and a decoder, the first resource occupancy information predicted by the first encoder and the second resource occupancy information predicted by the second encoder are weightedly fused and input into the decoder, and the decoder outputs the target resource occupancy information.
[0013] The present invention also discloses a water affairs Internet of Things long connection cluster management system, the system comprising a processor and a memory, the processor calls and executes the computer code in the memory to implement the following steps: The load balancing scheduler is introduced to be responsible for the connection scheduling of the terminal devices with long connections, as follows: The load balancing scheduler collects resource usage information of each connected terminal device in a regular and cyclic manner, and calculates the load index of each traffic entrance based on the dynamic load balancing allocation algorithm; The load balancing scheduler allocates a traffic entry address to the newly connected terminal device according to the resource occupancy information of each traffic entry and the load index of each traffic entry, and sends the allocated traffic entry address to the newly connected terminal device, so that the newly connected terminal device attempts to establish a connection with the corresponding traffic entry according to the traffic entry address; In addition, load monitoring is introduced to issue an alarm and elastically expand capacity when the overall system load is overloaded. The present invention also discloses an electronic device, comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement any of the above methods.
[0014] The present invention also discloses a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement any of the above methods.
[0015] The present invention also discloses a computer program product, wherein the computer program product includes a computer program, and the computer program is executed by a processor of an electronic device to implement any of the above methods.
[0016] The beneficial effects of the present invention are at least: The present invention introduces a load balancing scheduler to monitor the connection status of each flow entrance in real time to achieve dynamic load. When the load suddenly increases, the system will issue an alarm according to the configuration and automatically expand the capacity, thereby achieving the stability of the long connection between the water Internet of Things sensing device and the Internet of Things platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a schematic diagram of the structure of the existing centralized IoT platform; Figure 2 It is a structural diagram of an existing water Internet of Things platform that uses a distributed system; Figure 3 It is a flow chart of a method for managing a long connection cluster of a water affairs Internet of Things disclosed in an embodiment of the present invention; Figure 4 It is a schematic diagram of the structure of the water affairs Internet of Things platform of the distributed system disclosed in the embodiment of the present invention; Figure 5 It is a structural diagram of a water affairs Internet of Things long connection cluster management system disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The following is a description of the implementation of the present application by specific specific embodiments. People familiar with the technology can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0020] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0021] like Figure 3 , Figure 4 As shown, an embodiment of the present invention discloses a method for managing a long connection cluster of a water affairs Internet of Things, the method comprising the following steps: The load balancing scheduler is introduced to be responsible for the connection scheduling of long-connected terminal devices, as follows: The load balancing scheduler collects resource usage information of each connected terminal device in a regular and cyclic manner, and calculates the load index of each traffic entrance based on the dynamic load balancing allocation algorithm; The load balancing scheduler allocates a traffic entry address to the newly connected terminal device according to the resource occupancy information of each traffic entry and the load index of each traffic entry, and sends the allocated traffic entry address to the newly connected terminal device, so that the newly connected terminal device attempts to establish a connection with the corresponding traffic entry according to the traffic entry address; In addition, load monitoring is introduced to issue alarms and elastically expand capacity when the overall system load is overloaded.
[0022] The present invention can realize the long connection cluster management between the IoT sensing device and the IoT platform, and realize the stable transmission between the device and the platform. Specifically, the following beneficial technical effects can be obtained: 1) Balanced resource allocation: By introducing a load balancing scheduler, the load index of the server at the traffic entrance is calculated to make the load of all traffic entrances consistent, and the system will not be unstable due to excessive load on individual servers; 2) Shortened response time: A reasonable load balancing strategy allows IoT device connections to be assigned to servers with higher processing capabilities, thereby increasing the connection stability of the device and improving the device's response rate; 3) Improved system stability: The load balancing scheduler can effectively identify and avoid distributing requests to servers that have reached or are close to their capacity limits, which will prevent these servers from overloading and crashing, thereby improving the stability and availability of the entire system. 4) Improve dynamic adaptability: The load balancing scheduler takes into account the real-time changes in system load conditions and server performance fluctuations, effectively adapts to traffic peaks and valleys, and truly distributes device traffic on demand. At the same time, dynamic capacity expansion further improves the dynamic load level of the system.
[0023] Optionally, introduce load monitoring to issue an alarm and elastically expand capacity when the overall system load is overloaded, including: The load balancing scheduler monitors the overall load of the computing system. When the load index of all traffic entrances is greater than the warning value, an alarm prompt is sent to the alarm system and the elastic expansion script is called synchronously. The elastic expansion script automatically generates a virtual server and deploys traffic entry-related programs, and informs the load balancing scheduler of the local IP information to facilitate the load balancing scheduler to allocate subsequent device traffic.
[0024] In this embodiment, the load balancing scheduler takes into account the real-time changing system load conditions and server performance fluctuations, effectively adapts to traffic peaks and valleys, and truly distributes device traffic on demand. At the same time, dynamic capacity expansion further improves the dynamic load level of the system.
[0025] Optionally, the load balancing scheduler allocates a traffic entry address to a newly connected terminal device according to resource occupancy information of each traffic entry and a load index of each traffic entry, including: The load balancing scheduler obtains historical resource occupancy information of the newly connected terminal device, wherein the historical resource occupancy information includes resource occupancy information of several newly connected terminal devices in different time periods, and uses a deep prediction model to predict the target resource occupancy information of the newly connected terminal device in the current time period based on the historical resource occupancy information; According to the target resource occupancy information, the resource occupancy information of each traffic entrance, and the load index of each traffic entrance, a number of non-idle available traffic entrances are screened out; The target allocation quantity is determined based on the target resource occupancy information, and a first number of non-idle available traffic entrances and a second number of idle traffic entrances are screened and obtained. The sum of the first number and the second number is the target allocation quantity.
[0026] In this embodiment, when a new terminal device is connected, the load balancing scheduler obtains the historical resource occupancy information of the newly connected terminal device. The historical resource occupancy information is the actual resource occupancy information of the newly connected terminal device in each historical time period. The historical resource occupancy information is analyzed using a deep prediction model to predict the target resource occupancy information of the newly connected terminal device corresponding to the current time period.
[0027] Then, according to the determined target resource occupancy information, the resource occupancy information of each traffic entrance, and the load index of each traffic entrance, several non-idle available traffic entrances suitable for the newly connected terminal device can be screened out. A non-idle available traffic entrance refers to a traffic entrance that has been accessed by other terminal devices and has a remaining resource amount greater than the target resource occupancy of the newly connected terminal device and a load index lower than the highest load index.
[0028] Next, the number of traffic entrances that should be allocated to the newly connected terminal device, i.e., the target allocation number, is determined based on the target resource occupancy information. Among them, multiple traffic entrances are initially allocated to the newly connected terminal device, and the load balancing scheduler can select the optimal traffic entrance based on the dynamic load conditions of each allocated traffic entrance. At the same time, other allocated traffic entrances can be used as alternative traffic entrances. When the optimal traffic entrance is overloaded due to excessive fluctuations in the resource occupancy information of some connected or newly connected terminal devices, the newly connected terminal device can be switched to the selected traffic entrance. At the same time, the target allocation number is divided into a first number and a second number according to a ratio (for example, 2:8, or 3:7), and the first number and the second number of traffic entrances are selected from the non-idle available traffic entrances and the idle traffic entrances, respectively. Obviously, the first number is smaller than the second number.
[0029] Optionally, determining a target allocation quantity according to the target resource occupancy information includes: Determine a first target allocation quantity according to the target resource occupation information and a preset corresponding relationship; Obtaining the fluctuation intensity of the load index of each non-idle available traffic inlet, and calculating a fluctuation adjustment coefficient according to the fluctuation intensity; The first target allocation quantity is optimized and adjusted using the fluctuation adjustment coefficient to obtain a second target allocation quantity, where the second target allocation quantity is the final target allocation quantity.
[0030] In this embodiment, the first target allocation quantity corresponding to each target resource occupancy information is configured in advance, that is, a preset corresponding relationship is determined. After obtaining the specific target resource occupancy information, the corresponding first target allocation quantity can be quickly determined according to the preset corresponding relationship. The target resource occupancy information refers to the expected data transmission volume of the newly connected terminal device.
[0031] At the same time, the resource occupancy of other connected terminal devices in the non-idle traffic entrances for the corresponding traffic entrances changes dynamically, and this dynamic change may cause the corresponding non-idle available traffic entrance to no longer be adapted to the newly connected terminal device. Therefore, the present invention takes this situation into consideration, specifically: first obtain the fluctuation intensity of the load index of each non-idle available traffic entrance, the fluctuation intensity can be obtained by comprehensively calculating the first mean of the fluctuation amplitude within a preset period (for example, half an hour) and the second mean of the fluctuation frequency. Obviously, the first mean and the second mean are positively correlated with the fluctuation intensity, but the present invention does not limit the specific calculation formula. After determining the fluctuation intensity, the fluctuation adjustment coefficient can also be determined according to another preset corresponding relationship. The fluctuation adjustment coefficient is a value greater than 1, and the fluctuation adjustment coefficient is used to optimize and adjust the first target allocation quantity obtained above to obtain the final second target allocation quantity.
[0032] Therefore, through this embodiment, the present invention can dynamically allocate an appropriate number of traffic entrances available for access to newly connected terminal devices, ensuring that the resource occupation requirements of the newly connected terminal devices are met, thereby achieving a stable long connection, and giving priority to allocating non-idle available traffic entrances, thereby achieving full utilization of existing traffic entrances.
[0033] Optionally, the optimizing and adjusting the first target allocation quantity by using the fluctuation adjustment coefficient to obtain a second target allocation quantity includes: The fluctuation adjustment coefficient is used to optimize and adjust the proportion of the first quantity in the first target allocation quantity, and correspondingly, the final first quantity and the second quantity are determined based on the adjusted proportion of the first quantity.
[0034] In this embodiment, the first target allocation quantity determined is divided into a first quantity and a second quantity according to a fixed ratio (for example, 3:7). After the fluctuation adjustment coefficient is obtained, the fluctuation adjustment coefficient is used to adjust the proportion of the first quantity (for example, adjusted to 2:8), and the proportion of the second quantity is also passively adjusted accordingly, so that the new first quantity and second quantity can be determined.
[0035] Optionally, the depth prediction model includes a convolution module and a Transformer prediction module, the Transformer prediction module includes a first encoder, a second encoder, and a decoder, the first resource occupancy information predicted by the first encoder and the second resource occupancy information predicted by the second encoder are weighted fused and input into the decoder, and the decoder outputs the target resource occupancy information.
[0036] In this embodiment, the aforementioned depth prediction model includes a convolution module and a Transformer prediction module, and the Transformer prediction module adopts a dual encoder structure, so that the predicted target resource occupancy information is more accurate. The convolution module is used to extract feature information from historical resource occupancy information and input the feature information to each encoder for processing and analysis.
[0037] like Figure 5 As shown, an embodiment of the present invention further discloses a water Internet of Things long connection cluster management system, the system comprising a processor and a memory, the processor calls and executes the computer code in the memory to implement the following steps: The load balancing scheduler is introduced to be responsible for the connection scheduling of long-connected terminal devices, as follows: The load balancing scheduler collects resource usage information of each connected terminal device in a regular and cyclic manner, and calculates the load index of each traffic entrance based on the dynamic load balancing allocation algorithm; The load balancing scheduler allocates a traffic entry address to the newly connected terminal device according to the resource occupancy information of each traffic entry and the load index of each traffic entry, and sends the allocated traffic entry address to the newly connected terminal device, so that the newly connected terminal device attempts to establish a connection with the corresponding traffic entry according to the traffic entry address; In addition, load monitoring is introduced to issue alarms and elastically expand capacity when the overall system load is overloaded.
[0038] An embodiment of the present invention further discloses an electronic device, comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the method described in the above embodiment.
[0039] An embodiment of the present invention further discloses a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is executed by a processor to implement the method described in the above embodiment.
[0040] An embodiment of the present invention further discloses a computer program product, wherein the computer program product includes a computer program, and the computer program is executed by a processor of an electronic device to implement any of the above methods.
[0041] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0042] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0043] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.
[0044] 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0045] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0046] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0047] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for managing a long connection cluster of a water affairs Internet of Things, characterized in that: The method comprises the following steps: The load balancing scheduler is introduced to be responsible for the connection scheduling of the terminal devices with long connections, as follows: The load balancing scheduler collects resource usage information of each connected terminal device in a regular and cyclic manner, and calculates the load index of each traffic entrance based on the dynamic load balancing allocation algorithm; The load balancing scheduler allocates a traffic entry address to the newly connected terminal device according to the resource occupancy information of each traffic entry and the load index of each traffic entry, and sends the allocated traffic entry address to the newly connected terminal device, so that the newly connected terminal device attempts to establish a connection with the corresponding traffic entry according to the traffic entry address; In addition, load monitoring is introduced to issue alarms and elastically expand capacity when the overall system load is overloaded.
2. A method for managing a long connection cluster of a water affairs Internet of Things according to claim 1, characterized in that: Introduce load monitoring. When the overall system load is overloaded, issue an alarm and elastically expand the capacity, including: The load balancing scheduler monitors the overall load of the computing system. When the load index of all traffic entrances is greater than the warning value, an alarm prompt is sent to the alarm system and the elastic expansion script is called synchronously. The elastic expansion script automatically generates a virtual server and deploys traffic entry-related programs, and informs the load balancing scheduler of the local IP information to facilitate the load balancing scheduler to allocate subsequent device traffic.
3. A method for managing a long connection cluster of a water affairs Internet of Things according to claim 2, characterized in that: The load balancing scheduler allocates traffic entry addresses to newly connected terminal devices based on the resource occupancy information of each traffic entry and the load index of each traffic entry, including: The load balancing scheduler obtains historical resource occupancy information of the newly connected terminal device, wherein the historical resource occupancy information includes resource occupancy information of several newly connected terminal devices in different time periods, and uses a deep prediction model to predict the target resource occupancy information of the newly connected terminal device in the current time period based on the historical resource occupancy information; According to the target resource occupancy information, the resource occupancy information of each traffic entrance, and the load index of each traffic entrance, a number of non-idle available traffic entrances are screened out; The target allocation quantity is determined based on the target resource occupancy information, and a first number of non-idle available traffic entrances and a second number of idle traffic entrances are screened and obtained. The sum of the first number and the second number is the target allocation quantity.
4. A method for managing a long connection cluster of a water affairs Internet of Things according to claim 3, characterized in that: Determining a target allocation quantity according to the target resource occupation information includes: Determine a first target allocation quantity according to the target resource occupation information and a preset corresponding relationship; Obtaining the fluctuation intensity of the load index of each non-idle available traffic inlet, and calculating a fluctuation adjustment coefficient according to the fluctuation intensity; The first target allocation quantity is optimized and adjusted using the fluctuation adjustment coefficient to obtain a second target allocation quantity, where the second target allocation quantity is the final target allocation quantity.
5. A method for managing a long connection cluster of a water affairs Internet of Things according to claim 4, characterized in that: Optimizing and adjusting the first target allocation quantity using the fluctuation adjustment coefficient to obtain a second target allocation quantity includes: The fluctuation adjustment coefficient is used to optimize and adjust the proportion of the first quantity in the first target allocation quantity, and correspondingly, the final first quantity and the second quantity are determined based on the adjusted proportion of the first quantity.
6. A method for managing a long connection cluster of a water affairs Internet of Things according to claim 5, characterized in that: Optionally, the depth prediction model includes a convolution module and a Transformer prediction module, the Transformer prediction module includes a first encoder, a second encoder, and a decoder, the first resource occupancy information predicted by the first encoder and the second resource occupancy information predicted by the second encoder are weighted fused and input into the decoder, and the decoder outputs the target resource occupancy information.
7. A water affairs Internet of Things long connection cluster management system, the system comprising a processor and a memory, characterized in that: The processor calls and executes the computer code in the memory to implement the following steps: The load balancing scheduler is introduced to be responsible for the connection scheduling of the terminal devices with long connections, as follows: The load balancing scheduler collects resource usage information of each connected terminal device in a regular and cyclic manner, and calculates the load index of each traffic entrance based on the dynamic load balancing allocation algorithm; The load balancing scheduler allocates a traffic entry address to the newly connected terminal device according to the resource occupancy information of each traffic entry and the load index of each traffic entry, and sends the allocated traffic entry address to the newly connected terminal device, so that the newly connected terminal device attempts to establish a connection with the corresponding traffic entry according to the traffic entry address; In addition, load monitoring is introduced to issue alarms and elastically expand capacity when the overall system load is overloaded.
8. An electronic device, comprising: At least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the method according to any one of claims 1 to 6.
9. A computer storage medium storing a computer program, characterized in that: The computer program is executed by a processor to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that: The computer program is executed by a processor of an electronic device to implement the method according to any one of claims 1 to 6.