A dynamic communication method and system for Internet of Things (IoT) terminals

By using a lightweight neural network prediction model in IoT terminals, combined with historical network state parameters and terminal status, the future network quality and switching cost are calculated, solving the problem of inaccurate link switching timing in existing technologies, and achieving more efficient communication link switching and service transmission continuity.

CN122093884APending Publication Date: 2026-05-26SHENZHEN HUIQING IOT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN HUIQING IOT TECH CO LTD
Filing Date
2026-04-10
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

When existing IoT terminals switch links between multiple candidate communication networks, they mainly rely on the link status parameters at the current moment to make judgments. This makes it difficult to reflect the trend of link quality changes in a short period of time, resulting in inaccurate timing of communication link switching.

Method used

By acquiring the current communication link of IoT terminals and the historical network status parameters of each candidate communication network, a lightweight neural network prediction model is used to predict the network quality within a preset time window in the future. The risk value of service transmission and the switching value are calculated. Combined with the terminal status parameters, a comprehensive value assessment is performed, triggering a hierarchical decision engine to select the target communication network and establish a backup communication link to ensure the continuity of service transmission.

Benefits of technology

It improves the rationality and accuracy of communication link switching timing, ensures the continuity of service transmission, reduces delays and interruptions during link switching, and enhances the dynamic communication capabilities of IoT terminals in heterogeneous network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122093884A_ABST
    Figure CN122093884A_ABST
Patent Text Reader

Abstract

This invention relates to the field of Internet of Things (IoT) communication technology and discloses a dynamic communication method and system for IoT terminals. The method includes: acquiring historical network state parameters and terminal state parameters; predicting the future quality of candidate networks using a lightweight neural network; calculating the service risk cost and handover cost to maintain the current link; if the risk cost is greater than the handover cost, triggering a hierarchical decision engine to screen target networks and protocols; loading a protocol stack to establish a backup link; migrating sessions and data; and then switching the link. This invention, by combining a hierarchical decision-making mechanism of network quality prediction and cost comparison, enables early and smooth handover of IoT terminals between heterogeneous networks, solving the problem of service interruption caused by delayed handover timing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) communication technology, and more specifically, to a dynamic communication method and system for IoT terminals. Background Technology

[0002] As IoT terminals are increasingly used in scenarios such as mobile data collection, vehicle monitoring, industrial sensing, and remote control, they typically need to access different types of communication networks to meet business transmission requirements. Different communication networks vary in coverage, link latency, transmission stability, and communication costs. When the environment of an IoT terminal changes, the communication link status also fluctuates. Therefore, IoT terminals often need to switch between multiple candidate communication networks to maintain the continuity of data transmission. Heterogeneous wireless network handover has always been a common problem in existing research, and current technologies typically focus on optimizing handover latency, packet loss rate, and service continuity.

[0003] In existing technologies, network handover triggering methods for IoT terminals or mobile terminals are mostly based on the link status parameters detected at the current moment. For example, the network handover process is initiated only after the received signal strength, signal-to-noise ratio, latency, packet loss rate, or bandwidth status reaches a preset threshold. The typical handover process is triggered based on the received signal strength threshold; some solutions use parameters such as latency, jitter, throughput, and packet loss rate as network selection inputs, and select the target network through a multi-attribute decision method.

[0004] However, the aforementioned technical solutions primarily rely on the current link status to make switching decisions, focusing on responding to existing link degradation and lacking the ability to anticipate future link status trends in the near future. In application scenarios where IoT terminals have enhanced mobility and higher service continuity requirements, triggering a switchover only after the current communication link has already shown significant degradation can easily lead to a delayed switchover initiation, resulting in insufficient timeliness between the link switching process and the service transmission process. Summary of the Invention

[0005] In view of this, the present invention proposes a dynamic communication method and system for IoT terminals, aiming to solve the problem that existing IoT terminals, when switching links between multiple candidate communication networks, mainly rely on the link status parameters at the current moment to make switching judgments, which makes it difficult to reflect the trend of link quality changes in a short period of time, resulting in inaccurate timing of communication link switching.

[0006] In one aspect, the present invention proposes a dynamic communication method for an Internet of Things (IoT) terminal, comprising: Obtain the current communication link of the IoT terminal and the historical network status parameters of each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal; The historical network state parameters corresponding to the candidate communication network are input into a lightweight neural network prediction model of the microcontroller deployed on the IoT terminal to obtain the network quality prediction result of the candidate communication network within a future preset time window. The service transmission risk cost value for maintaining the current communication link is calculated based on the network quality prediction results of the current communication link. The switching cost value for communication link switching is calculated based on the terminal status parameters and the network quality prediction results of each candidate communication network. The service transmission risk cost value and the switching cost value are converted into a directly comparable comprehensive cost value through a unified evaluation rule. If the service transmission risk value is less than or equal to the handover value, the current communication link is maintained; if the service transmission risk value is greater than the handover value, the hierarchical decision engine is triggered, and each candidate communication network is screened according to the preset hierarchical decision order based on the terminal status parameters and the network quality prediction results of each candidate communication network to determine the target communication network and the target communication protocol that matches the target communication network. Load the corresponding target protocol stack module according to the target communication protocol, and establish a backup communication link corresponding to the target communication network; After the backup communication link is established, session migration synchronization information is sent to the service peer. After receiving the session migration confirmation information returned by the service peer, the data to be transmitted and the communication status information of the current communication link are migrated to the backup communication link. The IoT terminal is controlled to switch from the current communication link to the target communication network, and data transmission is performed through the target communication protocol.

[0007] Furthermore, when obtaining the current communication link of the IoT terminal and the historical network status parameters of each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal, the following are included: Based on the network quality prediction results of the current communication link in the previous prediction period and the caching duration of the historical cached data corresponding to each candidate communication network, determine whether each candidate communication network meets the measurement activation conditions. Perform state measurements on candidate communication networks that meet the measurement activation conditions, and obtain the network state parameters of the corresponding candidate communication network in the current sampling period; Historical cached data is retrieved for candidate communication networks that do not meet the measurement activation conditions; Align and store the network status parameters of the current communication link and each candidate communication network according to the timestamp to form a historical network status parameter sequence; Obtain the service priority and remaining battery power of the IoT terminal as terminal status parameters.

[0008] Furthermore, when calculating the risk cost of maintaining the current communication link based on the network quality prediction results of the current communication link, it includes: Based on the service priority in the terminal status parameters, extract at least one of the following service constraint parameters: latency constraint, packet loss rate constraint, and throughput constraint corresponding to the current service. Extract at least one of the predicted parameters from the predicted latency, predicted packet loss rate, and predicted throughput of the current communication link within a future preset time window; The prediction parameters are compared with the business constraint parameters one by one to obtain the corresponding deviation from the business constraint. Generate service transmission risk components based on the deviation of each service constraint. By summarizing the risk components of each service transmission, the service transmission risk value for maintaining the current communication link is obtained.

[0009] Furthermore, when calculating the switching cost of communication link handover based on the terminal state parameters and the network quality prediction results of each candidate communication network, the calculation includes: For each candidate communication network, at least one prediction parameter is extracted from the corresponding network quality prediction results, namely, the predicted value of link delay, the predicted value of link throughput, and the predicted value of link stability. At least one switching parameter is extracted from the predicted value of protocol stack loading overhead and the predicted value of link switching energy consumption. Based on the remaining battery power parameter in the terminal status parameters, the prediction parameters and switching parameters corresponding to each candidate communication network are constrained and corrected. The corrected prediction parameters and handover parameters are used to construct the handover cost components of the corresponding candidate communication networks; The switching cost components corresponding to each candidate communication network are summarized to obtain the switching cost value of the communication link switching for each candidate communication network.

[0010] Furthermore, if the risk value of service transmission exceeds the risk value of switching, before triggering the tiered decision engine, the following steps are also taken: The risk cost of the service transmission is compared with the switching cost corresponding to each candidate communication network to determine the cost difference corresponding to each candidate communication network. A set of candidate networks to be screened is generated from candidate communication networks whose cost difference is greater than a preset trigger threshold. A switching trigger flag is generated when the set of candidate networks to be screened is not empty; In response to the switching trigger flag, the hierarchical decision engine is activated to filter candidate communication networks in the set of candidate networks to be filtered.

[0011] Furthermore, the hierarchical decision engine is triggered, and according to a preset hierarchical decision order, based on the terminal state parameters and the network quality prediction results of each candidate communication network, the candidate communication networks are screened to determine the target communication network and the target communication protocol that matches the target communication network. This includes: The candidate communication networks in the candidate network set to be screened are filtered in the first layer according to business priority, and candidate communication networks that do not meet the current business transmission level requirements are eliminated. The candidate communication networks after the first layer of filtering are filtered according to the remaining power, and the candidate communication networks that do not meet the access conditions corresponding to the current remaining power range are eliminated. Read the network quality prediction results and switching cost corresponding to the candidate communication networks after the second layer of filtering; The target communication network is determined based on the combined ranking results of network quality prediction and handover cost. Read the protocol mapping relationship corresponding to the target communication network to determine the target communication protocol that matches the target communication network.

[0012] Furthermore, when loading the corresponding target protocol stack module according to the target communication protocol, it includes: Identify functional modules in the currently running protocol stack that are not shared with the target communication protocol; Retrieve the protocol stack module that corresponds to the target communication protocol and is not currently loaded from the modular protocol stack; The retrieved protocol stack module is loaded into the runtime environment, and the connection parameters in the protocol stack module are initialized. Retain the functional modules shared with the target communication protocol in the currently running protocol stack.

[0013] Furthermore, after the backup communication link is established, session migration synchronization information is sent to the service peer, and upon receiving session migration confirmation information from the service peer, the process of migrating the data to be transmitted and communication status information in the current communication link to the backup communication link includes: Generate session migration synchronization information that includes the backup communication link identifier and the current session identifier; Send session migration synchronization information to the service peer through the current communication link; Receive session migration confirmation information returned by the service peer, and perform matching and verification on the session migration confirmation information; After the matching verification is successful, the data to be transmitted in the current communication link is written into the transmission buffer corresponding to the backup communication link; Preset verification data is sent through the current communication link and the backup communication link; After receiving the verification response from the service peer regarding the backup communication link, the data transmission channel is switched to the backup communication link.

[0014] Furthermore, after controlling the IoT terminal to switch from the current communication link to the target communication network and perform data transmission through the target communication protocol, it also includes: Obtain the actual network status parameters of the target communication network within a future preset time window; The prediction error is obtained by comparing the actual network state parameters with the network quality prediction results corresponding to the target communication network. Based on the prediction error, at least one parameter among the candidate communication network's measurement activation condition, the calculation parameter of the service transmission risk cost value, and the handover trigger threshold is adjusted, and the lightweight neural network prediction model is incrementally adjusted. The adjusted parameters will be used for network quality prediction and communication link switching decisions in the next prediction period.

[0015] Compared with existing technologies, the advantages of this invention are as follows: By acquiring historical network state parameters of the current communication link and each candidate communication network, and using a lightweight neural network prediction model to obtain network quality prediction results of the candidate communication networks within a future preset time window, communication link adjustments no longer depend solely on the current link state, but can be judged in conjunction with subsequent network quality change trends, thereby improving the rationality of communication link switching timing; by separately calculating the service transmission risk value of maintaining the current communication link and the switching value of communication link switching, and converting them into a directly comparable comprehensive value through unified evaluation rules, a clear quantitative basis is provided for whether to perform link switching, thereby improving the precision of link switching decisions. For the purpose of this approach, by selecting candidate communication networks according to a preset hierarchical decision-making order after the handover is triggered, based on terminal status parameters and network quality prediction results of each candidate communication network, the target communication network and target communication protocol can be determined while taking into account both business needs and terminal operating status, thereby improving the adaptability of the target communication network selection. By loading the target protocol stack module and establishing a backup communication link before the formal handover, and performing session migration synchronization, migration of data to be transmitted and communication status information after the backup communication link is established, and then switching the current communication link to the target communication network, the connection between the link handover process and the business transmission process can be made smoother, which is conducive to ensuring the continuity of business transmission in the dynamic communication process of IoT terminals.

[0016] On the other hand, this application also provides a dynamic communication system for an IoT terminal, used to implement the aforementioned dynamic communication method for the IoT terminal, including: The historical parameter acquisition module is configured to acquire the historical network status parameters of the current communication link of the IoT terminal and each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal. The network quality prediction module is configured to input the historical network state parameters corresponding to the candidate communication network into a lightweight neural network prediction model of the microcontroller deployed on the IoT terminal, and obtain the network quality prediction result of the candidate communication network within a future preset time window. The cost value calculation module is configured to calculate the service transmission risk cost value for maintaining the current communication link based on the network quality prediction results of the current communication link, and to calculate the switching cost value for communication link switching based on the terminal status parameters and the network quality prediction results of each candidate communication network; the service transmission risk cost value and the switching cost value are converted into a directly comparable comprehensive cost value through a unified evaluation rule. The hierarchical decision module is configured to maintain the current communication link if the service transmission risk value is less than or equal to the handover value; and to trigger the hierarchical decision engine if the service transmission risk value is greater than the handover value, and to screen each candidate communication network according to a preset hierarchical decision order based on the terminal status parameters and the network quality prediction results of each candidate communication network, and to determine the target communication network and the target communication protocol that matches the target communication network. The link establishment module is configured to load the corresponding target protocol stack module according to the target communication protocol and establish a backup communication link corresponding to the target communication network. After the backup communication link is established, the session migration module is configured to send session migration synchronization information to the service peer. After receiving the session migration confirmation information returned by the service peer, it migrates the data to be transmitted and the communication status information of the current communication link to the backup communication link. The link switching module is configured to control the IoT terminal to switch from the current communication link to the target communication network and perform data transmission through the target communication protocol.

[0017] It is understandable that the aforementioned dynamic communication system and method for IoT terminals have the same beneficial effects, and will not be elaborated further here. Attached Figure Description

[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating a dynamic communication method for an IoT terminal provided in an embodiment of the present invention; Figure 2 This is a functional block diagram of a dynamic communication system for an Internet of Things (IoT) terminal, provided as an embodiment of the present invention. Detailed Implementation

[0019] Exemplary embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, embodiments and features in the embodiments of the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0020] See Figure 1 As shown, this application proposes a dynamic communication method for an Internet of Things (IoT) terminal, comprising: S1: Obtain the current communication link of the IoT terminal and the historical network status parameters of each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal; S2: Input the historical network state parameters corresponding to the candidate communication network into the lightweight neural network prediction model of the microcontroller deployed on the IoT terminal to obtain the network quality prediction results of the candidate communication network within a future preset time window; S3: Calculate the service transmission risk value for maintaining the current communication link based on the network quality prediction results of the current communication link, and calculate the switching value for communication link switching based on the terminal status parameters and the network quality prediction results of each candidate communication network; the service transmission risk value and the switching value are converted into a directly comparable comprehensive value through a unified evaluation rule. S4: If the risk value of service transmission is less than or equal to the switching risk value, maintain the current communication link; if the risk value of service transmission is greater than the switching risk value, trigger the hierarchical decision engine, and according to the preset hierarchical decision order, screen each candidate communication network based on the terminal status parameters and the network quality prediction results of each candidate communication network to determine the target communication network and the target communication protocol that matches the target network. S5: Load the corresponding target protocol stack module according to the target communication protocol, and establish a backup communication link corresponding to the target communication network; S6: After the backup communication link is established, send session migration synchronization information to the service peer. After receiving the session migration confirmation information returned by the service peer, migrate the data to be transmitted and the communication status information of the current communication link to the backup communication link. S7: Controls the IoT terminal to switch from the current communication link to the target communication network and performs data transmission through the target communication protocol.

[0021] Specifically, an IoT terminal can be a terminal device with multi-standard communication capabilities, such as an in-vehicle monitoring terminal, an industrial data acquisition terminal, a mobile inspection terminal, or a smart gateway. Internally, an IoT terminal includes at least a microcontroller, multiple communication interfaces, and modular protocol stacks corresponding to different communication networks. The current communication link refers to the communication connection that the IoT terminal is currently using for business data transmission. The candidate communication network refers to an alternative network that is available for access at the current location and operating state of the IoT terminal, such as 4G, 5G, Wi-Fi, NB-IoT, LoRa, or other low-power wide-area networks. The preset historical time period is a data window used to construct the network state time series. Its length can be determined by combining the terminal's moving speed, service latency sensitivity, and microcontroller storage resources. In some implementations, it can be 30 seconds, 60 seconds, or 120 seconds. If the terminal moves quickly, a shorter historical time period is preferred; if the terminal's working environment changes slowly, a longer historical time period can be used. Historical network state parameters are used to characterize the communication state of the link within the historical time period and can include at least one of the following: Received Signal Strength Indication (RSSI), Signal-to-Noise Ratio (SNR), Round-Trip Delay, Packet Loss Rate, Throughput, Jitter Value, Retransmission Count, and Channel Occupancy Rate. The current communication... Historical network status parameters of the link can be continuously collected by the IoT terminal during normal communication. The historical network status parameters of each candidate communication network can be obtained by a combination of periodic terminal measurement, event-triggered measurement, and historical cache retrieval. For example, the terminal performs a short-term detection on non-current link networks every 5 seconds, or initiates additional measurement when the signal fluctuation amplitude of the current communication link exceeds a preset fluctuation threshold. To avoid prediction distortion caused by candidate networks not being updated for a long time, a cache duration threshold can be set for each candidate communication network, such as 10 seconds, 20 seconds, or 30 seconds. When the cache duration of the historical cache data corresponding to a candidate communication network reaches the cache threshold... When the duration threshold is reached, even if the current communication link quality is still stable, a supplementary measurement is performed on the candidate communication network. The terminal status parameters are used to characterize the operating status of the service side and the terminal side, and can include at least service priority and remaining power. The service priority can be divided into three levels: high, medium and low, according to the service's requirements for latency, throughput and continuity. For example, real-time alarm services are set to high priority, periodic monitoring and reporting services are set to medium priority, and non-real-time log synchronization services are set to low priority. The remaining power can be calculated by the battery management unit based on the remaining capacity, discharge current and terminal voltage, or the power percentage can be read directly.After obtaining historical network state parameters, the historical network state parameters corresponding to the candidate communication network are input into a lightweight neural network prediction model deployed on a microcontroller. This lightweight neural network prediction model outputs the network quality prediction results for the candidate communication network within a preset future time window. The preset future time window is the prediction range for forward-looking link switching judgment and can be set according to service response requirements and switching preparation time, for example, 5 seconds, 10 seconds, or 15 seconds. To balance prediction lead and prediction error, 10 seconds is preferred in most scenarios. The lightweight neural network prediction model can employ pruned and quantized processing... A reasonable recurrent neural network model, such as a pruned LSTM or GRU model, can be used. The training samples can consist of multi-network state data collected by the terminal under different locations, speeds, and interference conditions. During training, historical network state parameter sequences are used as input, and the link quality labels actually observed within the corresponding future time window are used as supervision signals. Initial model parameters are obtained through offline training, and then the model parameters are deployed to a microcontroller for inference. Considering the limited resources of the microcontroller, the model parameter size can be controlled within 50KB, and the inference latency can be controlled within 100ms. Before input... Historical network state parameters can be time-aligned, missing values ​​imputed, and normalized. For example, RSSI, latency, and throughput of different dimensions can be mapped to a unified numerical range, and then a fixed-length input sequence can be formed in chronological order. The network quality prediction result is not a single indicator, but a comprehensive representation of the link status within a future preset time window. It can be composed of at least one of predicted latency, predicted packet loss rate, predicted throughput, and predicted stability, or it can be further weighted to form a network quality score. After obtaining the prediction result, the service transmission rate to maintain the current communication link can be calculated based on the network quality prediction result of the current communication link. The transmission risk value reflects the degree of service loss that may result from continuing to use the current communication link. Specifically, the service constraint parameters corresponding to the current service can be extracted based on the service priority in the terminal status parameters. For example, high-priority services can be set with a latency of no more than 100ms, a packet loss rate of no more than 1%, and a throughput rate of no less than a preset lower limit. Medium-priority services can be set with a latency of no more than 500ms and a packet loss rate of no more than 3%. Low-priority services can relax the relevant constraints. The above service constraint parameters can be preset by service specifications, service level agreements, equipment design requirements, or historical operation statistics.Then, the predicted latency, predicted packet loss rate, and predicted throughput of the current communication link within a future preset time window are compared item by item with the corresponding service constraint parameters to obtain the service constraint deviation. For example, this includes the deviation of predicted latency from the latency constraint, the deviation of predicted packet loss rate from the packet loss rate constraint, and the deviation of predicted throughput from the minimum throughput constraint. These deviations are then weighted and summed according to preset weights to obtain the service transmission risk cost. The preset weights can be determined based on service priority; for example, high-priority services have higher weights for latency and continuity, while low-priority services have higher weights for energy consumption and throughput. Simultaneously, based on terminal status parameters... The switching cost of communication link handover is calculated based on the network quality prediction results of each candidate communication network. The switching cost reflects the overall cost of performing link handover. Specifically, prediction parameters such as predicted latency, predicted throughput, and predicted stability are extracted for each candidate communication network. These are then combined with switching parameters such as protocol stack loading overhead, link handover energy consumption, and connection establishment latency. The protocol stack loading overhead can be obtained by pre-testing the loading time and storage usage of different protocol stack modules. The link handover energy consumption can be obtained by testing the terminal's performance during different network access, authentication, and connection establishment processes under experimental conditions. Current consumption is measured, and connection establishment delay can be obtained by averaging or quantile values ​​from multiple link establishment tests. Remaining power parameters serve as constraints and corrections; for example, when remaining power is below 20%, the cost of switching to high-power networks is increased; when remaining power is between 20% and 50%, the cost of high-power candidate networks is moderately increased; and when remaining power is above 50%, the penalty for performance-priority networks is reduced. The predicted parameters and switching parameters of each candidate communication network, after correction, form a switching cost component, which is then further aggregated to obtain the switching cost of the communication link switching. Due to the risk cost of service transmission and the switching cost... The value of a replacement may come from different dimensions. Therefore, before comparison, it needs to be converted into a comprehensive value that can be directly compared using a unified evaluation rule. The unified evaluation rule can be implemented by dimensionless and weighted summation. For example, both risk items and cost items can be mapped to a score range of 0 to 100, and then the comprehensive value can be calculated according to preset weights. The preset weights can be obtained based on historical experiments or can be pre-configured through a business strategy table. If the risk value of business transmission is less than or equal to the switching value, it means that the risk caused by continuing to maintain the current communication link is not higher than the comprehensive cost of performing the switching. In this case, the current communication link is maintained to continue transmitting business data.If the risk value of service transmission exceeds the risk value of switching, a hierarchical decision engine is triggered. This engine further determines which candidate communication network to switch to and which communication protocol to use, provided the switching is worthwhile. The preset hierarchical decision order can be set based on service objectives and terminal resource constraints. In some implementations, the preset hierarchical decision order can be service priority, remaining battery power, and network quality prediction results. That is, candidate networks that do not meet the current service level requirements are first eliminated, then candidate networks that do not match the current remaining battery power are eliminated, and finally, the remaining candidate networks are sorted according to network quality prediction results to determine the target communication network. For example, high-priority services prioritize low-latency, high-stability networks, and low-power networks are prioritized when battery power is low. After determining the target communication network, the target communication protocol is determined based on the corresponding communication standard. For example, when the target communication network is a 5G network, a cellular data communication protocol stack is determined; when the target communication network is a Wi-Fi network, a wireless LAN communication protocol stack is determined; and when the target communication network is an NB-IoT network, a narrowband IoT communication protocol stack is determined. Then, based on the target communication network... The terminal loads the corresponding target protocol stack module. The target protocol stack module can adopt a modular design, including at least some of the following: access control module, connection management module, data transmission module, and security authentication module. To reduce loading overhead, only the different functional modules required by the target communication protocol but not included in the currently running protocol stack can be loaded, while retaining common modules. After the protocol stack is loaded, a backup communication link is established based on the access parameters of the target communication network. The access parameters may include at least one of the following: network identifier, authentication parameters, frequency point information, channel parameters, and access node address. The backup communication link refers to a new communication connection established in advance while the current communication link remains operational, so as to facilitate the subsequent migration of service data. After the backup communication link is established, the terminal sends session migration synchronization information to the service peer. The session migration synchronization information is used to notify the service peer that subsequent data transmission will be migrated to the backup communication link. The session migration synchronization information may include at least one of the following: backup communication link identifier, current session identifier, terminal address information, authentication context identifier, and cached data identifier. The service peer can be a server, cloud platform, edge gateway, or access proxy node.When the terminal receives the session migration confirmation information returned by the service peer, it migrates the data to be transmitted and the communication status information in the current communication link to the backup communication link. The communication status information may include at least one of the following: transmission buffer, retransmission queue, sequence number status, connection context, and authentication status. During migration, the data to be transmitted can first be written into the transmission buffer corresponding to the backup communication link, and then preset verification data can be sent through both the current and backup communication links. When the service peer returns a verification response for the backup communication link, it indicates that the backup communication link is ready to carry service data. At this point, the data transmission channel is switched from the current communication link to the target communication network, and data transmission continues through the target communication protocol. In some implementations, to avoid insufficient adaptability due to long-term fixed parameters, after the switch is completed and a preset future time window has passed, the actual network status parameters of the target communication network can be collected. The actual network status parameters are then compared with the corresponding network quality prediction results to obtain the prediction error. Based on the prediction error, the measurement activation conditions of the candidate communication network, the calculation parameters of the service transmission risk cost value, and the switching trigger threshold are adjusted, thereby providing an updated parameter basis for network quality prediction and link switching decisions in the next prediction cycle.

[0022] In some embodiments of this application, obtaining the current communication link of the IoT terminal and the historical network status parameters of each candidate communication network within a preset historical time period, as well as the terminal status parameters of the IoT terminal, includes: Based on the network quality prediction results of the current communication link in the previous prediction period and the caching duration of the historical cached data corresponding to each candidate communication network, determine whether each candidate communication network meets the measurement activation conditions. Perform state measurements on candidate communication networks that meet the measurement activation conditions, and obtain the network state parameters of the corresponding candidate communication network in the current sampling period; Historical cached data is retrieved for candidate communication networks that do not meet the measurement activation conditions; Align and store the network status parameters of the current communication link and each candidate communication network according to the timestamp to form a historical network status parameter sequence; Obtain the service priority and remaining battery power of the IoT terminal as terminal status parameters.

[0023] Specifically, the current communication link refers to the communication connection that the IoT terminal is currently carrying business data transmission at the moment. Each candidate communication network refers to an alternative network that the IoT terminal has the potential to access under its current location and hardware conditions, such as a 4G network, 5G network, Wi-Fi network, NB-IoT network, or LoRa network. The previous prediction period refers to the time interval corresponding to the previous round of network quality prediction. The network quality prediction results of the previous prediction period are used to characterize the link change trend of the current communication link in the subsequent prediction window within that time interval. This can include predicted latency, predicted packet loss rate, predicted throughput, or a comprehensive network quality score. The cache duration of historical cached data refers to the time interval between the most recent valid measurement data of a candidate communication network and the current moment. This parameter is used to prevent some candidate communication networks from being remeasured for a long time, which could lead to distortion of subsequent prediction inputs. The measurement activation condition can be determined jointly based on the prediction degradation degree of the current communication link and the freshness of the historical cached data of each candidate communication network. For example, when the network quality prediction result of the current communication link in the previous prediction period is lower than a preset stability threshold, the candidate communication network can be determined to meet the measurement activation condition. Alternatively, when the cache duration of the historical cached data corresponding to a candidate network exceeds a preset cache duration threshold... When the value is set, it can also be determined that the corresponding candidate communication network meets the measurement activation conditions. The preset stability threshold can be set based on historical link quality statistics, for example, by lowering the long-term average of the network quality score by 10% to 20% as the stability threshold. The preset buffer duration threshold can be set based on the terminal's moving speed, the rate of environmental change, and the allowable measurement overhead; for example, it can be set to 10 to 30 seconds in low-mobility scenarios and 5 to 10 seconds in high-mobility scenarios. When performing state measurements on candidate communication networks that meet the measurement activation conditions, the status of the corresponding candidate communication network can be obtained through short-term detection, channel scanning, link probing, or access attempts. Network status parameters within the previous sampling period may include at least one of the following: Received Signal Strength Indicator (RSSI), Signal-to-Noise Ratio (SNR), Round-Trip Delay, Packet Loss Rate, Throughput, Retransmission Count, and Jitter Value. The current sampling period can be set according to the terminal service type and processing capability. For example, it can be 1 to 5 seconds in scenarios with high real-time requirements, and 5 to 10 seconds in scenarios with periodic reporting. Calling historical cache data for candidate communication networks that do not meet the measurement activation conditions means directly reading the network status parameters formed by the previous sampling period or the most recent valid measurement of the corresponding candidate communication network to reduce unnecessary scanning actions and measurement energy consumption.When aligning and storing network state parameters corresponding to the current communication link and each candidate communication network according to timestamps, data from different sources can first be uniformly converted to the same time base, and then resampled, interpolated, or filled with missing values ​​according to a preset sampling granularity. For example, parameters not collected at the same time can be processed using nearest neighbor alignment or linear interpolation. Then, the parameters are written into the historical parameter cache in chronological order, forming a sequence of historical network state parameters that can be called by subsequent lightweight neural network prediction models. When obtaining the service priority and remaining battery power of IoT terminals, service priorities can be pre-classified according to the latency requirements, continuity requirements, and data importance of the current services. For example, alarm reporting and control command services can be set as high priority, periodic monitoring and reporting services as medium priority, and log synchronization and batch data aggregation services as low priority. Remaining battery power can be calculated by the battery management unit based on the battery's remaining capacity, terminal voltage, and discharge current, or the battery's state of charge percentage can be directly used as a characterization value. Thus, service priority and remaining battery power can be used as terminal state parameters, providing an input basis for cost calculation and hierarchical decision-making for subsequent network quality prediction results.

[0024] In some embodiments of this application, when calculating the service transmission risk cost of maintaining the current communication link based on the network quality prediction results of the current communication link, the following steps are included: Based on the service priority in the terminal status parameters, extract at least one of the following service constraint parameters: latency constraint, packet loss rate constraint, and throughput constraint corresponding to the current service. Extract at least one of the predicted parameters from the predicted latency, predicted packet loss rate, and predicted throughput of the current communication link within a future preset time window; The prediction parameters are compared with the business constraint parameters one by one to obtain the corresponding deviation from the business constraint. Generate service transmission risk components based on the deviation of each service constraint. By summarizing the risk components of each service transmission, the service transmission risk value for maintaining the current communication link is obtained.

[0025] Specifically, the service transmission risk value is used to characterize the overall risk level of the current service experiencing transmission quality degradation, service timeout, or service interruption within a preset time window, provided that the communication link is not switched and the current communication link continues to transmit service data. The service priority in the terminal status parameters can serve as the entry point for determining service constraint parameters. Different service priorities correspond to different service tolerance ranges. For example, high-priority services typically correspond to stricter latency and packet loss rate constraints, medium-priority services typically correspond to moderately strict latency and throughput constraints, while low-priority services can adopt relatively lenient latency and continuity constraints. In some implementations, service priorities can be pre-established. A mapping table between service constraint parameters, for example, high-priority services correspond to latency constraints of no more than 100ms, packet loss rate constraints of no more than 1%, and minimum throughput constraints of no less than a first preset value; medium-priority services correspond to latency constraints of no more than 500ms, packet loss rate constraints of no more than 3%, and minimum throughput constraints of no less than a second preset value; low-priority services correspond to latency constraints of no more than 1000ms or only minimum throughput constraints. These constraint values ​​can be preset based on service protocol specifications, service level agreements, equipment debugging results, or historical operational statistics, or can be written into the configuration table at the time of equipment shipment. The future preset time window is a predicted range used to assess the subsequent availability of the current communication link, typically... The time required for link switching preparation, the allowable buffer time for services, and the network fluctuation rate are all considered. For example, 5 seconds, 10 seconds, or 15 seconds can be selected, with 10 seconds being the preferred choice in most mobile IoT scenarios. The predicted latency, predicted packet loss rate, and predicted throughput of the current communication link within a future preset time window are extracted. This involves reading the future link quality parameters corresponding to the current communication link from the output of the aforementioned lightweight neural network prediction model. The predicted latency characterizes the future round-trip time or one-way latency level for data transmission, the predicted packet loss rate characterizes the probability of future data packet loss, and the predicted throughput characterizes the data transmission capacity that can be maintained per unit time in the future. The predicted parameters are then compared item by item with the service constraint parameters. It can calculate the excess of predicted latency relative to latency constraints, the excess of predicted packet loss rate relative to packet loss rate constraints, and the deficiency of predicted throughput relative to minimum throughput constraints. If a prediction parameter does not exceed the corresponding constraint, the corresponding deviation can be set to zero. If a prediction parameter exceeds or falls below the corresponding constraint, the excess or deficiency value is taken as the deviation of the business constraint. For example, when the predicted latency is 140ms and the latency constraint is 100ms, the latency deviation can be 40ms; when the predicted packet loss rate is 2% and the packet loss rate constraint is 1%, the packet loss deviation can be 1%; when the predicted throughput is 300kbps and the minimum throughput constraint is 500kbps, the throughput deviation can be 200kbps.When generating service transmission risk components based on deviations from various service constraints, the deviations of different dimensions can first be normalized, for example, mapped to the intervals of 0 to 1 or 0 to 100 respectively. Then, values ​​are assigned according to the risk weights corresponding to different service priorities. For example, in high-priority services, the weights for delay deviation and packet loss deviation can be higher than the weight for throughput deviation, while in low-priority services, the weight for throughput deviation can be appropriately increased. When summing the service transmission risk components, weighted summation, piecewise linear superposition, or lookup table mapping methods can be used to obtain the final service transmission risk cost. For example, the normalized delay risk component, packet loss risk component, and throughput risk component can be multiplied by their corresponding weights and then summed to obtain a risk score within the range of 0 to 100. A higher risk score indicates a greater service transmission risk caused by continuing to maintain the current communication link within a preset time window in the future, thus providing a quantitative basis for a unified evaluation and comparison of the switching cost of subsequent communication link switching.

[0026] In some embodiments of this application, the calculation of the switching cost of communication link handover based on terminal state parameters and network quality prediction results of each candidate communication network includes: For each candidate communication network, at least one prediction parameter is extracted from the corresponding network quality prediction results, namely, the predicted value of link delay, the predicted value of link throughput, and the predicted value of link stability. At least one switching parameter is extracted from the predicted value of protocol stack loading overhead and the predicted value of link switching energy consumption. Based on the remaining power parameter in the terminal status parameters, the prediction parameters and switching parameters corresponding to each candidate communication network are constrained and corrected. The corrected prediction parameters and handover parameters are used to construct the handover cost components of the corresponding candidate communication networks; The switching cost components corresponding to each candidate communication network are summarized to obtain the switching cost value of the communication link switching for each candidate communication network.

[0027] Specifically, the switching cost of communication link switching is used to characterize the comprehensive cost incurred by an IoT terminal in switching from its current communication link to a candidate communication network. Since different candidate communication networks differ in their access methods, link characteristics, protocol processing overhead, and energy consumption levels, the switching cost needs to be calculated separately for each candidate communication network. When extracting prediction parameters for each candidate communication network, at least one parameter can be read from the network quality prediction results of the corresponding candidate communication network within a future preset time window: link latency prediction value, link throughput prediction value, and link stability prediction value. The link latency prediction value is used to characterize the expected service provided by the candidate communication network after the switching is completed. The data transmission latency level and link throughput prediction value are used to characterize the data carrying capacity that the candidate communication network is expected to provide after the handover. The link stability prediction value is used to characterize the ability of the candidate communication network to maintain an available connection within a preset time window in the future. The link stability prediction value can be obtained by at least one of the following: link outage probability within the prediction window, network quality fluctuation amplitude, continuous availability duration, or comprehensive stability score. At the same time, at least one handover parameter is extracted to characterize the additional cost introduced by performing the handover action itself, such as protocol stack loading overhead and link handover energy consumption. The protocol stack loading overhead can be obtained by pre-testing the loading time of the protocol stack modules corresponding to different target communication protocols. The time consumed by the switchover, storage usage, and initialization processing time are obtained and used to form a protocol stack loading overhead parameter table. The link switching energy consumption value can be obtained by sampling the current during the scanning, access authentication, connection establishment, and context switching processes of different candidate communication networks. For example, the average current and duration of each stage are recorded, and the corresponding energy consumption is obtained by integrating the current and time. The result is then written into the switching energy consumption calibration table. The remaining power parameter in the terminal status parameters is used to constrain and correct the above prediction parameters and switching parameters. The reason for this is that the acceptability of the same candidate communication network varies under different remaining power states. For example, when the remaining power is high, the energy consumption penalty corresponding to the high-performance candidate communication network can be appropriately reduced, and when the remaining power is medium... When considering power intervals, both network performance and handover costs can be taken into account. When the remaining power is low, the cost weight of the high-power candidate communication network is increased. In some implementations, multiple power intervals can be preset. For example, the first power interval is when the remaining power is above 50%, the second power interval is when it is between 20% and 50%, and the third power interval is when it is below 20%. Correction rules are configured for different power intervals. For example, in the first power interval, the impact weight of the predicted link throughput and the predicted link stability is increased. In the second power interval, the weight of the predicted link latency, the predicted link throughput, and the energy consumption of the link handover is balanced. In the third power interval, the penalty coefficient of the protocol stack loading overhead and the energy consumption of the link handover is increased.When constructing the corrected prediction parameters and handover parameters into handover cost components for the corresponding candidate communication networks, parameters with different dimensions can first be normalized. For example, latency, throughput, stability, energy consumption, and loading overhead can be mapped to a unified score range. Then, the parameters can be processed according to their influence on handover costs. Higher predicted link latency, lower link stability, higher protocol stack loading overhead, and higher link handover energy consumption result in higher handover costs. Conversely, higher predicted link throughput indicates stronger link carrying capacity after handover, which can be treated as a deduction or reverse scoring item during the handover cost construction process. Based on this, the corrected parameters for each candidate communication network can be constructed into a set of handover cost components, including, for example, latency cost components, throughput correction components, stability risk components, protocol loading cost components, and energy consumption cost components. The handover cost components for each candidate communication network are then processed... During the aggregation, weighted summation, segmented mapping, or table lookup scoring methods can be used to obtain the switching cost value of communication link switching for each candidate communication network. For example, the switching cost components of each candidate communication network can be multiplied by their corresponding weights and then summed to obtain a unified cost score for the corresponding candidate communication network. The weights can be pre-set based on historical switching experiment results, performance priorities of different service scenarios, or equipment factory calibration results. For example, in real-time service scenarios, the weights of the components corresponding to link latency prediction and link stability prediction are increased; in low-power service scenarios, the weights of the components corresponding to link switching energy consumption are increased. Ultimately, each candidate communication network corresponds to an independent switching cost value. The higher the switching cost value, the higher the overall cost required to switch to the corresponding candidate communication network, thus providing a quantitative basis for a unified evaluation and comparison of the service transmission risk cost value for maintaining the current communication link.

[0028] In some embodiments of this application, before triggering the hierarchical decision engine, if the risk value of service transmission is greater than the switching risk value, the following steps are also included: Compare the risk cost of service transmission with the switching cost of each candidate communication network to determine the cost difference of each candidate communication network. A set of candidate networks to be screened is generated from candidate communication networks whose cost difference is greater than a preset trigger threshold. A switching trigger flag is generated when the set of candidate networks to be filtered is not empty; In response to the switching trigger flag, the hierarchical decision engine is started to filter the candidate communication networks in the candidate network set to be screened.

[0029] Specifically, after obtaining the switching cost value for each candidate communication network, although this can be used to determine whether the service transmission risk cost value is higher than the switching cost value, to avoid sending all candidate communication networks directly into the hierarchical decision engine indiscriminately, a pre-screening process based on the cost value difference can be added before officially starting the hierarchical decision engine. When comparing the service transmission risk cost value with the switching cost value corresponding to each candidate communication network, the cost value difference for each candidate communication network can be obtained by subtracting the switching cost value corresponding to each candidate communication network from the service transmission risk cost value of maintaining the current communication link. The cost value difference reflects the overall benefit margin brought by switching to the corresponding candidate communication network relative to continuing to maintain the current communication link. The larger the cost value difference, the higher the service risk undertaken by continuing to maintain the current communication link relative to the switching cost required to switch to the corresponding candidate communication network, thus making the corresponding candidate communication network more suitable as a subsequent screening target. A preset trigger threshold is used to limit the switching to the corresponding candidate communication network to a sufficiently significant benefit only when the cost value difference reaches a certain level. The preset trigger threshold can be set according to historical switching experiment results, network fluctuation intensity, and service tolerance. For example, a cost difference greater than 0 can be used as the basic trigger condition. Alternatively, to reduce the probability of false triggers caused by short-term jitter, the preset trigger threshold can be set to 5, 10, or 15 points. When the cost difference corresponding to a candidate communication network is greater than the preset trigger threshold, that candidate communication network is added to the set of candidate networks to be screened. When the cost differences corresponding to multiple candidate communication networks are all greater than the preset trigger threshold, multiple candidate communication networks can be added to the set of candidate networks to be screened simultaneously, so that the subsequent hierarchical decision engine can perform hierarchical screening within a smaller range. When the set of candidate networks to be screened is empty, it indicates that although there is a risk to business transmission, If the candidate communication networks have not yet demonstrated sufficient switching benefits relative to the current communication link, then the current communication link can be maintained and the network can be re-evaluated in the next prediction cycle instead of proceeding to the subsequent tiered selection process. When the set of candidate networks to be selected is not empty, it means that at least one candidate communication network is better than maintaining the current communication link in terms of overall cost. At this point, a switching trigger flag is generated. The switching trigger flag can be implemented using predefined state variables, event identifiers, or interrupt signals. For example, a logical value of "1" can be defined as allowing the start of the subsequent tiered decision-making process, and a logical value of "0" can be defined as maintaining the current communication link and ending the current prediction.Responding to a handover trigger flag to activate the hierarchical decision engine means that after the microcontroller of the IoT terminal detects that the handover trigger flag is valid, it calls the decision program corresponding to the hierarchical decision engine. It then performs subsequent service priority filtering, remaining power filtering, and network quality ranking only on candidate communication networks in the candidate network set to be screened, without repeating decision calculations for candidate communication networks not yet in the candidate network set. This establishes a pre-gating mechanism between the service transmission risk value and the handover value corresponding to each candidate communication network, improving the targeting of subsequent hierarchical screening and reducing unnecessary decision calculations and unnecessary handovers.

[0030] In some embodiments of this application, when triggering a hierarchical decision engine to filter candidate communication networks according to a preset hierarchical decision order, based on terminal state parameters and network quality prediction results of each candidate communication network, and determining the target communication network and the target communication protocol matching the target network, the process includes: The candidate communication networks in the candidate network set to be screened are filtered in the first layer according to business priority, and candidate communication networks that do not meet the current business transmission level requirements are eliminated. The candidate communication networks after the first layer of filtering are filtered according to the remaining power, and the candidate communication networks that do not meet the access conditions corresponding to the current remaining power range are eliminated. Read the network quality prediction results and switching cost corresponding to the candidate communication networks after the second layer of filtering; The target communication network is determined based on the combined ranking results of network quality prediction and handover cost. Read the protocol mapping relationship corresponding to the target communication network to determine the target communication protocol that matches the target communication network.

[0031] Specifically, the hierarchical decision engine is used to progressively reduce and comprehensively sort candidate communication networks in the candidate network set to be screened, under the premise that the handover triggering conditions have been met. This allows for the selection of a target communication network that matches the current service requirements, the remaining battery power of the terminal, and the future quality status of the candidate network. The preset hierarchical decision order can be pre-set according to service continuity requirements, terminal resource constraints, and link handover strategies. In this embodiment, the preset hierarchical decision order is, in order, service priority, remaining battery power, and a combination of network quality prediction results and handover cost. That is, first, it is determined whether the candidate communication network meets the current service transmission level requirements; then, it is determined whether the candidate communication network meets the access conditions corresponding to the current remaining battery power range; finally, the remaining candidate communication networks are compared according to the combination of network quality prediction results and handover cost. When performing the first layer of filtering on candidate communication networks in the candidate network set to be screened according to service priority, a mapping relationship between service priority and network capability requirements can be pre-established. For example, high-priority services correspond to low latency, high stability, and low packet loss rate requirements; medium-priority services correspond to medium latency and medium throughput requirements; and low-priority services correspond to more lenient latency requirements or only require basic data transmission capabilities. Then, the candidate networks to be screened are read. The network quality prediction results for each candidate communication network in the network set are used to compare the predicted latency, predicted packet loss rate, predicted throughput, and predicted stability of the candidate communication networks with the network capability requirements corresponding to the current service level. If a candidate communication network does not meet the current service transmission level requirements, the corresponding candidate communication network is removed from the candidate network set. For example, when the current service is a high-priority real-time alarm service, the predicted latency of the candidate communication network may be required to be no higher than a first latency threshold, the predicted packet loss rate no higher than a first packet loss rate threshold, and the predicted stability no lower than a first stability threshold. These thresholds can be based on service protocol specifications, service level agreements, or other relevant regulations. The historical operation statistics are preset. When performing a second layer of filtering on the candidate communication networks after the first layer of filtering based on the remaining power, the power range of the IoT terminal can be determined first based on the remaining power in the terminal status parameters. For example, the remaining power is defined as the first power range if it is higher than 50%, the second power range if it is 20% to 50%, and the third power range if it is lower than 20%. Then, a mapping rule between the power range and the network access conditions is established in advance. For example, the first power range allows access to high-performance high-power networks and medium-power networks, the second power range prioritizes the retention of medium and low-power networks, and the third power range only retains low-power networks or emergency communication networks.Network access conditions can include at least one of the following: average access power consumption, link maintenance power consumption, protocol stack loading resource consumption, and connection establishment latency level of the candidate communication network. Therefore, in the second layer of filtering, the access conditions of the candidate communication network can be matched and compared with the current remaining power range one by one, and candidate communication networks that do not meet the access conditions of the current remaining power range can be eliminated. After completing the second layer of filtering, the network quality prediction results and handover cost values ​​of the candidate communication networks after the second layer of filtering are read. This means obtaining the predicted latency, predicted throughput, predicted stability, comprehensive network quality score, and corresponding handover cost value of the retained candidate communication networks within a future preset time window, which are used to perform the final combined ranking. When determining the target communication network according to the combined ranking results of the network quality prediction results and handover cost values, the network quality prediction results and handover cost values ​​can be uniformly quantified first, for example, mapped to the same score range, and then the combined ranking value can be calculated according to the preset ranking rules. The combined ranking value can be obtained by weighted summation, for example, by multiplying the quality score corresponding to the network quality prediction results and the cost score corresponding to the handover cost value by their respective weights to obtain the comprehensive score, where a higher quality score indicates a higher overall score. The stronger the expected transmission capacity of the candidate communication network within a preset time window, the lower the handover cost, indicating a lower overall cost to switch to the corresponding candidate communication network. Therefore, the handover cost can be treated as a reverse cost item in the comprehensive scoring process. In some implementations, the weights of latency and stability in the network quality prediction results can be increased in high-priority service scenarios, while the impact of energy consumption constraints in the handover cost can be increased in low-power service scenarios. After sorting, the candidate communication network with the best combined sorting results is selected as the target communication network. After determining the target communication network, the protocol mapping relationship corresponding to the target communication network is read to determine the target communication protocol that matches the target communication network. The protocol mapping relationship can be implemented through a pre-established protocol mapping table. For example, 5G and 4G networks are mapped to cellular data communication protocols, Wi-Fi networks are mapped to wireless local area network communication protocols, NB-IoT networks are mapped to narrowband IoT communication protocols, and LoRa networks are mapped to low-power wide area communication protocols. Thus, after determining the target communication network, the target communication protocol that matches the target communication network can be directly obtained, providing a clear basis for subsequent loading of the target protocol stack module and establishment of backup communication links.

[0032] In some embodiments of this application, loading the corresponding target protocol stack module according to the target communication protocol includes: Identify functional modules in the currently running protocol stack that are not shared with the target communication protocol; Retrieve the protocol stack module that corresponds to the target communication protocol and is not currently loaded from the modular protocol stack; The retrieved protocol stack module is loaded into the runtime environment, and the connection parameters in the protocol stack module are initialized. Retain the functional modules shared with the target communication protocol in the currently running protocol stack.

[0033] Specifically, the target communication protocol refers to the type of communication protocol that is compatible with the aforementioned target communication network and is used to complete subsequent link access, connection maintenance, and service data transmission. For example, when the target communication network is a 4G or 5G network, the target communication protocol can be a cellular data communication protocol; when the target communication network is a Wi-Fi network, the target communication protocol can be a wireless local area network communication protocol; when the target communication network is an NB-IoT network, the target communication protocol can be a narrowband IoT communication protocol. A modular protocol stack refers to breaking down the software functions corresponding to different communication protocols according to functional boundaries to form multiple independently callable and combinable functional modules. For example, it can include at least some of the following modules: physical access control module, link establishment module, connection management module, data encapsulation and forwarding module, security authentication module, session persistence module, and anomaly recovery module. This allows for on-demand loading of the entire protocol stack when switching between different target communication protocols, without the need for complete unloading and reloading. Instead, it enables loading based on the identification of different modules. When identifying functional modules in the currently running protocol stack that are not shared with the target communication protocol, the configuration table of the currently running protocol stack corresponding to the current communication link and the configuration table of the target protocol stack corresponding to the target communication protocol can be read first. Then, the functional modules in the two configuration tables can be compared item by item to determine which functional modules are... This section identifies common modules required by both the current protocol stack and the target protocol stack, and identifies functional modules that are only needed by the target protocol stack and are not currently loaded. For example, if the current communication link is a 4G network and the target communication network is a Wi-Fi network, the data cache management module and some security context management modules can be retained as common modules, while the wireless access control module and Wi-Fi link association module can be identified as functional modules related to the target communication protocol that are not currently loaded. When retrieving protocol stack modules corresponding to the target communication protocol that are not currently loaded from the modular protocol stack, a pre-established protocol-module mapping table can be used for searching. The table can record the set of functional modules that each communication protocol depends on, the order of module calls, the module initialization parameters, and the dependencies between modules. After determining the target communication protocol, the IoT terminal extracts the protocol stack modules required by the target protocol stack but not currently loaded from the local memory or the pre-loaded module library according to the protocol-module mapping table. When loading the retrieved protocol stack modules into the runtime environment, the microcontroller can schedule memory resources to load the corresponding code segments and data segments into RAM or other executable storage areas, and register the modules into the protocol stack scheduling framework, so that the newly loaded protocol stack modules can establish a calling relationship with the already running shared modules.Connection parameter initialization settings refer to the pre-configuration of basic parameters required by the target protocol stack module to subsequently establish the target communication link. Connection parameters may include at least one of the following: network identifier, access point name, frequency parameters, channel parameters, authentication parameters, address allocation parameters, encryption parameters, retransmission parameters, and timer parameters. These connection parameters can be read from the access configuration file corresponding to the target communication network, the terminal's pre-stored configuration table, the current probe results, or the access information sent by the service peer. For example, for cellular networks, the access point name (APN), authentication method, and packet domain parameters can be initialized; for Wi-Fi networks, the service set identifier (SSID), authentication key, and channel parameters can be initialized; and for NB-IoT networks, the cell access parameter can be initialized. Input parameters and IoT service carrying parameters; retaining functional modules shared with the target communication protocol in the currently running protocol stack means that during the loading of the target protocol stack modules, modules that can be reused by the target communication protocol in the currently running protocol stack are not unloaded. Instead, modules that are already running are directly reused. For example, data cache management modules, message queue modules, error detection modules, log recording modules, and some security context management modules can be shared among multiple communication protocols. By retaining shared modules, on the one hand, the loading time and storage migration overhead during protocol switching can be reduced, and on the other hand, the continuity of some operating states before and after the switch can be maintained, thereby providing a pre-initialized basic operating environment for the subsequent establishment of backup communication links.

[0034] In some embodiments of this application, after the backup communication link is established, session migration synchronization information is sent to the service peer, and after receiving session migration confirmation information returned by the service peer, the process of migrating the data to be transmitted and communication status information in the current communication link to the backup communication link includes: Generate session migration synchronization information that includes the backup communication link identifier and the current session identifier; Send session migration synchronization information to the service peer through the current communication link; Receive session migration confirmation information returned by the service peer, and perform matching and verification on the session migration confirmation information; After the matching verification is successful, the data to be transmitted in the current communication link is written into the transmission buffer corresponding to the backup communication link; Preset verification data is sent through the current communication link and the backup communication link; After receiving the verification response from the service peer regarding the backup communication link, the data transmission channel is switched to the backup communication link.

[0035] Specifically, after the backup communication link is established, the service data is not immediately switched from the current communication link to the backup communication link. Instead, session migration synchronization is performed first to enable the service peer to recognize the changes in the subsequent data transmission path and complete the session context preparation in advance. The session migration synchronization information is used to notify the service peer that the current service session will be migrated from the current communication link to the backup communication link. The session migration synchronization information includes at least a backup communication link identifier and a current session identifier. The backup communication link identifier is used to uniquely identify the established backup communication link. For example, it may include at least one of the following: network identifier, link address information, port identifier, link number, or access node identifier. The current session identifier is used to uniquely identify the session instance corresponding to the current service transmission process. For example, it may use a service session number, connection identifier, transaction serial number, terminal session token, or application layer session ID. In some implementations, to improve the accuracy of the service peer in completing session association and context matching, the session migration synchronization information may further include at least one of the following: terminal identifier, authentication context identifier, encryption context identifier, cached data sequence number range, data volume information to be migrated, or backup communication link establishment timestamp. When generating session migration synchronization information, the session management module of the IoT terminal can read the current session identifier and the current communication link status from the current running session context, and then read the backup communication link identifier from the backup communication link connection management module. The above fields are then encapsulated into a synchronization message according to a preset message format. Sending session migration synchronization information to the service peer through the current communication link is because the current communication link is still in a stable carrying state, ensuring that the synchronization message is delivered to the service peer via the current valid session path, thus preventing the service peer from missing migration requests before recognizing the backup communication link. The service peer can be a cloud server, edge gateway, platform access node, or proxy forwarding node. After receiving the session migration synchronization information, the service peer can query the current service session context based on the current session identifier and the backup communication link identifier, establish a mapping relationship between the current session and the backup communication link, and return session migration confirmation information. The session migration confirmation information indicates that the service peer has completed the registration of the backup communication link and the migration preparation for the current session. The session migration confirmation information may include at least one of the following: current session identifier, backup communication link identifier, confirmation status code, confirmation timestamp, and validity period identifier.After receiving session migration confirmation information from the service peer, the IoT terminal performs matching and verification on the session migration confirmation information. This verification includes checking whether the current session identifier in the confirmation information matches the locally stored current session identifier, whether the backup communication link identifier matches the locally established backup communication link identifier, and whether the confirmation status code indicates that the migration is allowed to take effect. If necessary, it can also verify whether the confirmation timestamp falls within a preset valid time window. For example, the session migration confirmation information is valid for 5 or 10 seconds after being sent. If it exceeds the preset valid time window, a synchronization request can be re-initiated. After successful matching and verification, the data to be transmitted in the current communication link is written to the corresponding transmission buffer of the backup communication link. This means copying or moving data packets that have not yet been successfully sent, encapsulated data frames to be sent, or data blocks to be retransmitted in the current communication link to the corresponding transmission buffer of the backup communication link, so that the backup communication link has the ability to immediately continue sending unfinished service data after the formal switchover. To further confirm that the backup communication link can actually carry service data, preset verification data is sent through the current communication link and the backup communication link before the formal switchover. The preset verification data can be fixed... The system uses pre-formatted probe messages, test data blocks carrying sequence numbers and timestamps, heartbeat data, or small-sized simulated service data. Upon receiving pre-defined verification data from the backup communication link, the service peer returns a verification response for the backup communication link. This response may include the corresponding sequence number, verification result identifier, reception timestamp, or link acknowledgment code. When the IoT terminal receives the verification response from the service peer for the backup communication link, it indicates that the backup communication link has met the carrying conditions in terms of link establishment, session identification, and data reachability. At this point, the data transmission channel is switched to the backup communication link, meaning that subsequent service data transmission through the current communication link is stopped, and subsequent data to be sent is scheduled to the corresponding transmission buffer and transmission path of the backup communication link, thus completing a smooth transition from the current communication link to the backup communication link. In some implementations, if no session migration confirmation information or a verification response for the backup communication link is received within a preset time, the current communication link can continue transmission, and session migration synchronization can be re-executed or the backup communication link can be re-established to avoid service interruption caused by direct switching before the backup communication link has completed effective verification.

[0036] In some embodiments of this application, after controlling the IoT terminal to switch from the current communication link to the target communication network and performing data transmission through the target communication protocol, the method further includes: Obtain the actual network status parameters of the target communication network within a future preset time window; The prediction error is obtained by comparing the actual network state parameters with the network quality prediction results corresponding to the target communication network. Based on the prediction error, at least one parameter among the candidate communication network's measurement activation condition, the calculation parameter of the service transmission risk cost value, and the handover trigger threshold is adjusted, and the lightweight neural network prediction model is incrementally adjusted. The adjusted parameters will be used for network quality prediction and communication link switching decisions in the next prediction period.

[0037] Specifically, after the IoT terminal completes the switch from the current communication link to the target communication network and executes data transmission through the target communication protocol, it can continue to track and collect the actual operating status of the target communication network within a future preset time window, and feed the actual operating results back to the aforementioned prediction-decision process to correct the previous round of network quality prediction results and link switching decision results. In this embodiment, the future preset time window can be consistent with the prediction window used for the aforementioned network quality prediction, such as 5 seconds, 10 seconds, or 15 seconds, so that the prediction results directly correspond to the actual observation results in terms of time scale. Alternatively, it can be based on the time after the target communication network completes the switch. The stabilization time can be adjusted appropriately, for example, a shorter window can be used in the initial handover phase and a longer window can be used in the stable transmission phase; the actual network status parameters are used to characterize the actual operating status of the target communication network after the handover is completed, and can include at least one of the following: actual latency, actual packet loss rate, actual throughput, actual jitter value, actual retransmission count, and actual link hold time. The above parameters can be obtained by the IoT terminal continuing to perform real-time monitoring on the target communication network. For example, the actual latency can be calculated by statistically analyzing the data packet transmission and reception time within a preset time window, the actual packet loss rate can be calculated by statistically analyzing the total number of data packets sent and the total number of data packets lost, and the actual throughput can be calculated by statistically analyzing the amount of data successfully transmitted per unit time. When comparing the actual network state parameters with the network quality prediction results corresponding to the target communication network, the comparison can be performed item by item according to the same parameter dimension. For example, the delay error can be obtained by subtracting the predicted delay from the actual delay, the packet loss error can be obtained by subtracting the predicted packet loss rate from the actual packet loss rate, and the throughput error can be obtained by subtracting the predicted throughput from the actual throughput rate. If necessary, multiple error items can be normalized and weighted to form a comprehensive prediction error. The larger the comprehensive prediction error, the more obvious the deviation between the previous prediction result and the actual operating state. When adjusting the measurement activation conditions of the candidate communication network based on the prediction error, the historical buffer of the candidate communication network can be shortened when the prediction error is consistently large. The system can adjust the allowed retention time of data, lower the stability threshold for trigger state measurements, or increase the frequency of supplementary measurements. For example, when the comprehensive prediction error exceeds the preset error threshold within multiple consecutive prediction periods, the cache duration threshold can be lowered from 20 seconds to 10 seconds to make the historical data of candidate communication networks updated more timely. When adjusting the calculation parameters of the service transmission risk cost value based on the prediction error, the weights corresponding to the service constraint deviation, the normalization intervals of risk components, or the comprehensive summarization methods can be corrected. For example, if the system underestimates the latency risk for a long time, the weight of the latency deviation in the service transmission risk cost value can be increased; if the system overestimates the throughput risk for a long time, the weight corresponding to the throughput deviation can be appropriately reduced.When adjusting the handover trigger threshold based on the prediction error, the threshold used to generate the candidate network set to be screened or to generate the handover trigger flag can be modified. For example, if the terminal frequently triggers handover but the handover benefit is not obvious in historical operation, the handover trigger threshold can be appropriately increased. Conversely, if the handover action is delayed and the service quality has obviously deteriorated before the handover begins, the handover trigger threshold can be appropriately decreased. The above threshold and parameter adjustment methods can adopt a fixed step size adjustment method or a proportional adjustment method. For example, the proportion of the comprehensive prediction error exceeding the preset error threshold can be used as the parameter correction range. The preset error threshold can be set according to offline experimental data, scenario calibration results, or historical operation statistics results. For example, a comprehensive prediction error greater than 10, 15, or 20 points can be used as the condition for triggering parameter adjustment. When incrementally adjusting the lightweight neural network prediction model, without re-executing the complete offline training, the actual network state parameters collected after the handover of the target communication network can be used as incremental samples to slightly update some parameters in the lightweight neural network prediction model. The incremental adjustment can adopt a sliding window sample update method. This can be achieved through online gradient correction or local layer parameter fine-tuning. For example, the main network structure of the lightweight neural network prediction model can be fixed, and only the output layer weights, bias parameters, or normalization parameters can be updated to control the computational and storage overhead on the microcontroller. To avoid excessive perturbation of the model by a single abnormal data point, incremental adjustment trigger conditions can be set. For example, incremental adjustment can only be initiated when the comprehensive prediction error exceeds a preset model adjustment threshold within multiple consecutive prediction periods. The model adjustment threshold can be the same as the aforementioned error threshold or can be set separately. After the incremental adjustment is completed, the updated model parameters can be written back to the model parameter cache or model configuration file. Subsequently, the adjusted measurement activation conditions, service transmission risk cost calculation parameters, switching trigger threshold, and the incrementally adjusted lightweight neural network prediction model are used together for network quality prediction and communication link switching decisions in the next prediction period. This allows the IoT terminal to continuously correct its historical parameter acquisition strategy, risk assessment strategy, switching trigger strategy, and prediction model itself based on changes in the actual network environment during continuous operation, improving the consistency between subsequent network quality prediction results and the actual link status.

[0038] In another preferred embodiment based on the above embodiments, see [reference] Figure 2 As shown, this embodiment provides a dynamic communication system for an Internet of Things (IoT) terminal, including: The historical parameter acquisition module is configured to acquire the historical network status parameters of the current communication link of the IoT terminal and each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal. The network quality prediction module is configured to input the historical network state parameters corresponding to the candidate communication network into a lightweight neural network prediction model of a microcontroller deployed on an IoT terminal, and obtain the network quality prediction results of the candidate communication network within a preset time window in the future. The cost value calculation module is configured to calculate the service transmission risk cost value for maintaining the current communication link based on the network quality prediction results of the current communication link, and to calculate the switching cost value for communication link switching based on the terminal status parameters and the network quality prediction results of each candidate communication network; the service transmission risk cost value and the switching cost value are converted into a comprehensive cost value that can be directly compared through a unified evaluation rule. The hierarchical decision module is configured to maintain the current communication link if the service transmission risk value is less than or equal to the switching value; if the service transmission risk value is greater than the switching value, the hierarchical decision engine is triggered to screen each candidate communication network according to the preset hierarchical decision order, based on the terminal status parameters and the network quality prediction results of each candidate communication network, and determine the target communication network and the target communication protocol that matches the target network. The link establishment module is configured to load the corresponding target protocol stack module according to the target communication protocol and establish a backup communication link corresponding to the target communication network. The session migration module is configured to send session migration synchronization information to the service peer after the backup communication link is established. After receiving the session migration confirmation information returned by the service peer, it migrates the data to be transmitted and the communication status information of the current communication link to the backup communication link. The link switching module is configured to control the IoT terminal to switch from the current communication link to the target communication network and perform data transmission through the target communication protocol.

[0039] It is understandable that, through the coordinated operation of the historical parameter acquisition module, network quality prediction module, cost-value calculation module, hierarchical decision-making module, link establishment module, session migration module, and link switching module, this implementation method can transform the link adjustment process of IoT terminals among multiple candidate communication networks from a passive response mode based on the current state to a proactive processing mode based on the network quality change trend within a future preset time window. Specifically, the historical parameter acquisition module provides continuous state parameter input for the current communication link and candidate communication networks; the network quality prediction module outputs the network quality prediction results of candidate communication networks within subsequent time windows; the cost-value calculation module quantifies the service transmission risk corresponding to maintaining the current communication link and the comprehensive cost required to perform communication link switching; and the hierarchical decision-making module... Based on the aforementioned quantification results, the strategy module further completes the layer-by-layer screening of candidate communication networks, thereby ensuring that the determination process of the target communication network simultaneously considers service transmission requirements, remaining terminal battery power, and the predicted quality of candidate communication networks. After determining the target communication network, the link establishment module first completes the loading of the target protocol stack module and the establishment of the backup communication link. The session migration module then completes the session synchronization of the service peer and the migration of data to be transmitted and communication status information. Finally, the link switching module executes the formal link switching. Therefore, this implementation not only makes the determination of the timing of communication link switching more targeted, but also takes into account the target communication network access preparation and service session continuity during the switching process, thereby helping to improve the rationality of link switching and the continuity of service transmission when IoT terminals conduct dynamic communication in various communication network environments.

[0040] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope defined by the present invention.

Claims

1. A dynamic communication method for an Internet of Things (IoT) terminal, characterized in that, include: Obtain the current communication link of the IoT terminal and the historical network status parameters of each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal; The historical network state parameters corresponding to the candidate communication network are input into a lightweight neural network prediction model of the microcontroller deployed on the IoT terminal to obtain the network quality prediction result of the candidate communication network within a future preset time window. The service transmission risk cost value for maintaining the current communication link is calculated based on the network quality prediction results of the current communication link. The switching cost value for communication link switching is calculated based on the terminal status parameters and the network quality prediction results of each candidate communication network. The service transmission risk cost value and the switching cost value are converted into a directly comparable comprehensive cost value through a unified evaluation rule. If the risk value of the service transmission is less than or equal to the switching risk value, the current communication link shall be maintained. If the risk value of the service transmission is greater than the switching risk value, the hierarchical decision engine is triggered. According to the preset hierarchical decision order, based on the terminal status parameters and the network quality prediction results of each candidate communication network, each candidate communication network is screened to determine the target communication network and the target communication protocol that matches the target communication network. Load the corresponding target protocol stack module according to the target communication protocol, and establish a backup communication link corresponding to the target communication network; After the backup communication link is established, session migration synchronization information is sent to the service peer. After receiving the session migration confirmation information returned by the service peer, the data to be transmitted and the communication status information of the current communication link are migrated to the backup communication link. The IoT terminal is controlled to switch from the current communication link to the target communication network, and data transmission is performed through the target communication protocol.

2. The dynamic communication method for an IoT terminal according to claim 1, characterized in that, When obtaining the current communication link of the IoT terminal and the historical network status parameters of each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal, the following are included: Based on the network quality prediction results of the current communication link in the previous prediction period and the caching duration of the historical cached data corresponding to each candidate communication network, determine whether each candidate communication network meets the measurement activation conditions. Perform state measurements on candidate communication networks that meet the measurement activation conditions, and obtain the network state parameters of the corresponding candidate communication network in the current sampling period; Historical cached data is retrieved for candidate communication networks that do not meet the measurement activation conditions; Align and store the network status parameters of the current communication link and each candidate communication network according to the timestamp to form a historical network status parameter sequence; Obtain the service priority and remaining battery power of the IoT terminal as terminal status parameters.

3. The dynamic communication method for an IoT terminal according to claim 2, characterized in that, When calculating the risk cost of maintaining the current communication link's service transmission based on the network quality prediction results of the current communication link, the following should be included: Based on the service priority in the terminal status parameters, extract at least one of the following service constraint parameters: latency constraint, packet loss rate constraint, and throughput constraint corresponding to the current service. Extract at least one of the predicted parameters from the predicted latency, predicted packet loss rate, and predicted throughput of the current communication link within a future preset time window; The prediction parameters are compared with the business constraint parameters one by one to obtain the corresponding deviation from the business constraint. Generate service transmission risk components based on the deviation of each service constraint. By summarizing the risk components of each service transmission, the service transmission risk value for maintaining the current communication link is obtained.

4. The dynamic communication method for an IoT terminal according to claim 3, characterized in that, When calculating the switching cost of communication link handover based on the terminal status parameters and the network quality prediction results of each candidate communication network, the following steps are included: For each candidate communication network, at least one prediction parameter is extracted from the corresponding network quality prediction results, namely, the predicted value of link delay, the predicted value of link throughput, and the predicted value of link stability. At least one switching parameter is extracted from the predicted value of protocol stack loading overhead and the predicted value of link switching energy consumption. Based on the remaining battery power parameter in the terminal status parameters, the prediction parameters and switching parameters corresponding to each candidate communication network are constrained and corrected. The corrected prediction parameters and handover parameters are used to construct the handover cost components of the corresponding candidate communication networks; The switching cost components corresponding to each candidate communication network are summarized to obtain the switching cost value of the communication link switching for each candidate communication network.

5. The dynamic communication method for an IoT terminal according to claim 4, characterized in that, If the risk value of service transmission exceeds the risk value of switching, before triggering the tiered decision engine, the following steps are also included: The risk cost of the service transmission is compared with the switching cost corresponding to each candidate communication network to determine the cost difference corresponding to each candidate communication network. A set of candidate networks to be screened is generated from candidate communication networks whose cost difference is greater than a preset trigger threshold. A switching trigger flag is generated when the set of candidate networks to be screened is not empty; In response to the switching trigger flag, the hierarchical decision engine is activated to filter candidate communication networks in the set of candidate networks to be filtered.

6. The dynamic communication method for an IoT terminal according to claim 5, characterized in that, When the hierarchical decision engine is triggered, it filters candidate communication networks according to a preset hierarchical decision order, based on terminal status parameters and network quality prediction results of each candidate communication network, and determines the target communication network and the target communication protocol matching the target network, including: The candidate communication networks in the candidate network set to be screened are filtered in the first layer according to business priority, and candidate communication networks that do not meet the current business transmission level requirements are eliminated. The candidate communication networks after the first layer of filtering are filtered according to the remaining power, and the candidate communication networks that do not meet the access conditions corresponding to the current remaining power range are eliminated. Read the network quality prediction results and switching cost corresponding to the candidate communication networks after the second layer of filtering; The target communication network is determined based on the combined ranking results of network quality prediction and handover cost. Read the protocol mapping relationship corresponding to the target communication network to determine the target communication protocol that matches the target communication network.

7. The dynamic communication method for an IoT terminal according to claim 6, characterized in that, When loading the corresponding target protocol stack module according to the target communication protocol, it includes: Identify functional modules in the currently running protocol stack that are not shared with the target communication protocol; Retrieve the protocol stack module that corresponds to the target communication protocol and is not currently loaded from the modular protocol stack; The retrieved protocol stack module is loaded into the runtime environment, and the connection parameters in the protocol stack module are initialized. Retain the functional modules shared with the target communication protocol in the currently running protocol stack.

8. The dynamic communication method for an IoT terminal according to claim 7, characterized in that, After the backup communication link is established, session migration synchronization information is sent to the service peer. Upon receiving session migration confirmation information from the service peer, the process of migrating the data to be transmitted and communication status information from the current communication link to the backup communication link includes: Generate session migration synchronization information that includes the backup communication link identifier and the current session identifier; Send session migration synchronization information to the service peer through the current communication link; Receive session migration confirmation information returned by the service peer, and perform matching and verification on the session migration confirmation information; After the matching verification is successful, the data to be transmitted in the current communication link is written into the transmission buffer corresponding to the backup communication link; Preset verification data is sent through the current communication link and the backup communication link; After receiving the verification response from the service peer regarding the backup communication link, the data transmission channel is switched to the backup communication link.

9. The dynamic communication method for an IoT terminal according to claim 8, characterized in that, After controlling the IoT terminal to switch from the current communication link to the target communication network and perform data transmission through the target communication protocol, it also includes: Obtain the actual network status parameters of the target communication network within a future preset time window; The prediction error is obtained by comparing the actual network state parameters with the network quality prediction results corresponding to the target communication network. Based on the prediction error, at least one parameter among the candidate communication network's measurement activation condition, the calculation parameter of the service transmission risk cost value, and the handover trigger threshold is adjusted, and the lightweight neural network prediction model is incrementally adjusted. The adjusted parameters will be used for network quality prediction and communication link switching decisions in the next prediction period.

10. A dynamic communication system for an Internet of Things (IoT) terminal, used to implement the dynamic communication method for an IoT terminal as described in any one of claims 1-9, characterized in that, include: The historical parameter acquisition module is configured to acquire the historical network status parameters of the current communication link of the IoT terminal and each candidate communication network within a preset historical period, as well as the terminal status parameters of the IoT terminal. The network quality prediction module is configured to input the historical network state parameters corresponding to the candidate communication network into a lightweight neural network prediction model of the microcontroller deployed on the IoT terminal, and obtain the network quality prediction result of the candidate communication network within a future preset time window. The cost value calculation module is configured to calculate the service transmission risk cost value for maintaining the current communication link based on the network quality prediction results of the current communication link, and to calculate the switching cost value for communication link switching based on the terminal status parameters and the network quality prediction results of each candidate communication network; the service transmission risk cost value and the switching cost value are converted into a directly comparable comprehensive cost value through a unified evaluation rule. The hierarchical decision module is configured to maintain the current communication link if the risk value of the service transmission is less than or equal to the switching risk value. If the risk value of the service transmission is greater than the switching risk value, the hierarchical decision engine is triggered. According to the preset hierarchical decision order, based on the terminal status parameters and the network quality prediction results of each candidate communication network, each candidate communication network is screened to determine the target communication network and the target communication protocol that matches the target communication network. The link establishment module is configured to load the corresponding target protocol stack module according to the target communication protocol and establish a backup communication link corresponding to the target communication network. After the backup communication link is established, the session migration module is configured to send session migration synchronization information to the service peer. After receiving the session migration confirmation information returned by the service peer, it migrates the data to be transmitted and the communication status information of the current communication link to the backup communication link. The link switching module is configured to control the IoT terminal to switch from the current communication link to the target communication network and perform data transmission through the target communication protocol.