A load balancing method for a direct-connected Internet of Things platform
By linking between the terminal side and the system side of the IoT platform, using time offset and time-based modes to adjust the data reporting time, the problem of insufficient network bandwidth and high cost caused by terminal cycle reporting data is solved, and data dispersion is achieved Reporting reduces the cost of hardware terminals and investment in network equipment.
Patent Information
- Application Number
- CN202111433455.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-11-29
AI Technical Summary
In the prior art, when terminals directly connected to the Internet of Things platform report data periodically, it leads to insufficient network bandwidth, resulting in data congestion and increased costs.
By linking between the terminal side and the system side, the time offset mode and the timing mode are used to adjust the data reporting time, reduce the investment in broadband and network equipment on the system side, and the automatic offset and platform offset mode are used to distribute the data reporting time. .
It effectively reduces the investment in system-side broadband and network equipment, solves the problem of data congestion, saves costs, and improves the competitiveness of hardware terminal products.
Smart Images

Figure CN114237874B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of Internet of Things, and in particular relates to a load balancing method for a direct-connected Internet of Things platform. Background Art
[0002] Now there are more and more terminals directly connected to the IoT platform, and general terminals need to report data periodically. When the periodic time is up, the terminal needs to report data periodically. At this time, the amount of data reported at the same time is very large. When the platform network bandwidth is not large enough and the amount of data is particularly large, the platform's load balancing alone is not enough to meet the influx of data.
[0003] Load balancing is built on the existing network structure. It provides a cheap, effective and transparent method to expand the bandwidth of network terminals and servers, increase throughput, enhance network data processing capabilities, and improve network flexibility and availability.
[0004] Common software load balancing technologies include the following:
[0005] 1. DNS-based load balancing: Since the same name can be configured for multiple different addresses in the DNS server, the client that queries the name will eventually get one of the addresses when resolving the name. Therefore, this proxy method achieves load balancing by resolving domain names and IPs through random names in the DNS service.
[0006] 2. Reverse proxy load balancing (such as the combination of Apache+JK2+Tomcat): This proxy method is different from the ordinary proxy method. The standard proxy method is that the client uses the proxy to access multiple external Web servers. It is called reverse proxy mode because this proxy method is used by multiple clients to access internal Web servers instead of external servers.
[0007] 3. Load balancing technology based on NAT (Network Address Translation) (such as Linux Virtual Server, LVS for short): This technology uses an address translation gateway to evenly convert each external connection into a different internal server address, so that the computers in the external network communicate with the servers at the addresses they have converted, thereby achieving the purpose of load balancing. The network address translation gateway is located between the external address and the internal address, which can not only forward the external client to a mapped internal address when accessing a certain external address of the translation gateway, but also enable the computer with the internal address to access the external network.
[0008] The above methods are all ways to achieve load balancing on the system side. When reporting data periodically, it is easy to cause a large amount of data to congest the network, which increases the requirements and costs of network transmission capacity. Summary of the invention
[0009] In view of the problem that the existing technology uses the system side to implement load balancing, which leads to data congestion and increased costs, the present invention provides a load balancing method for a direct-connected Internet of Things platform to solve the problem that a large amount of data is congested in the network due to periodic data reporting. The method can reduce the investment in hardware terminals and network bandwidth, save costs, have good economic benefits, and improve the competitiveness of hardware terminal products.
[0010] The present invention adopts the following technical solution: a load balancing method for a direct-connected Internet of Things platform, comprising the following steps:
[0011] Step 1, select the time synchronization mode to complete the time synchronization so that the time of the central processor is synchronized with the time of the clock module;
[0012] Step 2, select the data offset mode:
[0013] When the time offset enable variable A of each terminal is 1, it is determined whether the value of the time offset variable B is 0. If yes, the automatic offset mode is executed; otherwise, the platform offset mode is executed.
[0014] When the time offset enable variable A of each terminal is 0, the non-offset mode is executed;
[0015] Step 3: Report data according to the data offset mode.
[0016] The idea of this application is to link the terminal side and the system side, effectively reducing the investment in system-side broadband and network equipment, solving the problem of large amounts of data congesting the network, saving costs, achieving good economic benefits, and improving the competitiveness of terminal-side hardware products.
[0017] There are two variables inside the terminal, namely the time offset enable variable A and the time offset variable B. When A is 0, it means that no time offset occurs, and the terminal reports data at the agreed periodic time node; when A is 1, it means that time offset occurs, and the time offset mode is determined by variable B; when the value of B is 0, the automatic offset mode is adopted; when the value of B is other values and the value is less than the reporting period, the time offset is performed according to the value of B, that is, the platform offset mode is performed.
[0018] Furthermore, the time synchronization process in step 1 is as follows:
[0019] Step 1.1, determine whether the platform synchronization flag value is 1, if not, proceed to step 1.2; if yes, proceed to step 1.3;
[0020] Step 1.2, perform network time synchronization and determine whether it is successful. If yes, use the network time to calibrate the clock module; if no, the clock module is not calibrated;
[0021] Step 1.3, determine whether the platform initiates a time synchronization operation. If yes, update the platform time synchronization flag value to 1, and use the time of the clock module under the platform; if no, the clock module is not calibrated;
[0022] Step 1.4, determine whether the data reporting cycle time has arrived, if yes, execute step 2; if no, return to step 1.1.
[0023] The time synchronization modes are divided into platform time synchronization mode, network time synchronization mode, local time synchronization mode, and default time mode according to priority:
[0024] The platform time synchronization mode is a method of obtaining the time of the clock module by receiving the time synchronization instruction issued by the platform at the central processor; corresponding to the case where the platform time synchronization flag value is 1 in step 1.1;
[0025] The network time synchronization mode is a mode where the central processor sends a time synchronization command to the wireless module, so that the wireless module obtains the network time from the specified NTP server and feeds it back to the central processor and writes it into the clock module; this corresponds to the situation in step 1.2 where the network time is used to calibrate the clock module;
[0026] The local time calibration mode is a mode in which the time is written into the CPU and transmitted to the clock module through local setting means (such as serial port or display menu mode);
[0027] The default time mode is the time written into the clock module when the terminal leaves the factory.
[0028] Furthermore, in step 2, the process of the automatic offset mode is:
[0029] Step 2.1, collect the terminal code of the terminal side, which is generally determined by the factory when it leaves the factory. Each terminal code is unique and increases sequentially;
[0030] Step 2.2, determine the time offset value of the corresponding terminal according to the code of each terminal, and meet the following conditions:
[0031] Y = (X / 100)*(T / 2);
[0032] Wherein, X is the last two digits of each terminal code, T is the cycle time; and Y is the time offset value of each terminal.
[0033] The invention has the beneficial effects: The idea of the invention is to link the terminal side and the system side, effectively reducing the investment in system side broadband and network equipment, solving the problem of large amounts of data congesting the network, saving costs, achieving good economic benefits, and improving the competitiveness of terminal side hardware products. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 Schematic diagram of the terminal reporting time offset mode;
[0035] Figure 2 This is a schematic diagram of the time synchronization function;
[0036] Figure 3 It is a schematic diagram of the terminal structure;
[0037] Figure 4 Flowchart of the load balancing method for direct connection to the IoT platform. DETAILED DESCRIPTION
[0038] The following is an explanation and description of the technical solutions of the embodiments of the present invention in conjunction with the accompanying drawings of the present invention, but the following embodiments are only preferred embodiments of the present invention, not all. Based on the embodiments in the implementation mode, other embodiments obtained by those skilled in the art without creative work are all within the protection scope of the present invention.
[0039] A prerequisite for load balancing is that the terminal time must be accurate. Figure 2 As shown, the terminal consists of a wireless module, a clock module, a central processing unit, and a power supply. The wireless module is responsible for communicating and interacting with the platform to exchange data. If the central processing unit has a real-time time function, a separate clock module is not required. If there is no clock module function, an external clock module chip is required. There are four ways to synchronize the terminal, namely, platform synchronization, network synchronization, local synchronization, and default time. The first is to prioritize platform synchronization, that is, after the platform synchronization is successful, subsequent network synchronization and local synchronization will not work. The second preferred is network synchronization. When the platform does not synchronize, the terminal synchronizes with the network through the wireless module. After there is no platform synchronization in the first preferred embodiment, the terminal synchronizes with the network regularly. When the difference between the local time and the network time exceeds the allowed threshold, it is updated to the network time. The third preferred is local synchronization. When the platform does not synchronize, or the network synchronization is unsuccessful, the user's local terminal time can respond. However, when other higher priority synchronizations are restored, the higher priority synchronization will still prevail. When the platform time calibration, network time calibration, and local time calibration are not triggered or are unsuccessful, the clock module read at power-on is used as the start time.
[0040] The load balancing method of the direct-connected Internet of Things platform of this embodiment is as follows: Figures 1 to 4 As shown, the following steps are included:
[0041] Step 1, select the time synchronization mode to complete the time synchronization so that the time of the central processor is synchronized with the time of the clock module;
[0042] The time synchronization process is as follows:
[0043] Step 1.1, determine whether the platform synchronization flag value is 1, if not, proceed to step 1.2; if yes, proceed to step 1.3;
[0044] Step 1.2, perform network time synchronization and determine whether it is successful. If yes, use the network time to calibrate the clock module; if no, the clock module is not calibrated;
[0045] Step 1.3, determine whether the platform initiates a time synchronization operation. If yes, update the platform time synchronization flag value to 1, and use the time of the clock module under the platform; if no, the clock module is not calibrated;
[0046] Step 1.4, determine whether the data reporting cycle time has arrived, if yes, execute step 2; if no, return to step 1.1;
[0047] Step 2, select the data offset mode:
[0048] When the time offset enable variable A of each terminal is 1, it is determined whether the value of the time offset variable B is 0. If yes, the automatic offset mode is executed; otherwise, the platform offset mode is executed.
[0049] When the time offset enable variable A of each terminal is 0, the non-offset mode is executed;
[0050] Step 2, the process of automatic offset mode is:
[0051] Step 2.1, collect the terminal code of the terminal side, which is generally determined by the factory when it leaves the factory. Each terminal code is unique and increases sequentially;
[0052] Step 2.2, determine the time offset value of the corresponding terminal according to the code of each terminal, and meet the following conditions:
[0053] Y = (X / 100)*(T / 2);
[0054] Where X is the last two digits of each terminal code, T is the cycle time, and Y is the time offset value of each terminal.
[0055] Step 3: Report data according to the data offset mode.
[0056] When the terminal leaves the factory, it has a unique terminal code. The codes of the same type of terminal are increased in sequence. For example, if the number of 1000 products starts from 000000000001, the 1000th product is 00000000001000. The terminal has three types of periodic reporting time offsets. The periodic time refers to a fixed time. For example, 5 minutes. The nodes of the periodic time are 05 minutes, 10 minutes, 15 minutes, 20 minutes, 25 minutes, 30 minutes, 35 minutes, 40 minutes, 45 minutes, 50 minutes, and 55 minutes of the system time.
[0057] The offset time means that data reporting starts after a delay of an offset time from the periodic time node agreed with the system.
[0058] The terminal factory preset value is reported in the terminal autonomous offset time mode. For example, for the number mentioned above, take the last 2 digits as the adjustment variable of the offset time as X, the cycle time is T, and the terminal reporting offset time is agreed to be no more than half of the cycle time. For example, the terminal number is 0000000000032, and the offset time value Y = (X / 100) * (T / 2) = 0.8 minutes or 48 seconds. That is, the cycle time node starts reporting after 48 seconds of offset. In this way, the offset time of the periodic report is evenly distributed from 0 to within 150. It ensures that the data reported by the terminal periodically is dispersed within the cycle time, rather than reported by the node of the cycle time, which reduces the traffic burden.
[0059] There are two variables inside the terminal, namely the time offset enable variable A and the time offset variable B. When A is 0, it means that no time offset occurs, and the terminal reports data at the agreed periodic time node; when A is 1, it means that time offset occurs, and the time offset mode is determined by variable B; when the value of B is 0, the automatic offset mode is adopted; when the value of B is other values and the value is less than the reporting period, the time offset is performed according to the value of B, that is, the platform offset mode is performed.
[0060] The values of A and B are reported to the platform when the terminal is connected to the platform, and the platform also responds to the terminal parameters below the terminal;
[0061] The idea of this application is to link the terminal side and the system side, effectively reducing the investment in system-side broadband and network equipment, solving the problem of large amounts of data congesting the network, saving costs, achieving good economic benefits, and improving the competitiveness of terminal-side hardware products.
[0062] The load balancing strategy of the present invention effectively supplements the existing load balancing strategy of the system, starting from the terminals accessing the Internet of Things system, reporting data in a time-sharing and average manner, and greatly increasing the number of terminal accesses on the basis of the same bandwidth. It has obvious economic benefits and reduces the bandwidth investment and network equipment investment on the system side.
[0063] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the contents described in the drawings and the above specific embodiments. Any modification that does not deviate from the functional and structural principles of the present invention will be included in the scope of the claims.
Claims
1. A load balancing method for a direct-connected Internet of Things platform, characterized in that: The steps include: Step 1, select the time synchronization mode to complete the time synchronization so that the time of the central processor is synchronized with the time of the clock module; Step 2, select the data offset mode: When the time offset enable variable A of each terminal is 1, it is determined whether the value of the time offset variable B is 0. If yes, the automatic offset mode is executed; if no, the platform offset mode is executed; When the time offset enable variable A of each terminal is 0, the non-offset mode is executed; Step 3: Report data according to the data offset mode.
2. The load balancing method for a direct-connected Internet of Things platform according to claim 1, characterized in that: The time synchronization process in step 1 is as follows: Step 1.1, determine whether the platform synchronization flag value is 1, if not, proceed to step 1.2; if yes, proceed to step 1.3; Step 1.2, perform network time synchronization and determine whether it is successful. If yes, use the network time to calibrate the clock module; if no, the clock module is not calibrated; Step 1.3, determine whether the platform initiates a time synchronization operation, if yes, update the platform time synchronization flag value to 1, and use the time of the clock module under the platform; If not, the clock module is not calibrated; Step 1.4, determine whether the data reporting cycle time has arrived, if yes, proceed to step 2; If no, return to step 1.
1.
3. The load balancing method for a direct-connected Internet of Things platform according to claim 1 or 2, characterized in that: Step 2, the process of automatic offset mode is: Step 2.1, collecting the terminal code of the terminal side; Step 2.2, determine the time offset value of the corresponding terminal according to the code of each terminal, and meet the following conditions: Y = (X / 100)*(T / 2); Wherein, X is the last two digits of each terminal code, T is the cycle time; and Y is the time offset value of each terminal.
Citation Information
Patent Citations
Time synchronizing method and device
CN106712879A
Access control method of 5G internet of things electric power data collection terminal
CN107969015A