An internet of things gateway communication protocol collaborative optimization method and system
By constructing a hierarchical system of communication protocol collaboration rules and a sliding time window mechanism, the communication path of the IoT gateway is dynamically adjusted, which solves the problem of flexibility and adaptability of the IoT gateway in a multi-protocol environment and improves communication efficiency and system stability.
Patent Information
- Application Number
- CN202510778569.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-06-11
AI Technical Summary
Existing IoT gateways lack flexible and intelligent methods for handling multiple communication protocols, and cannot effectively adapt to the dynamically changing IoT environment, resulting in low communication efficiency and insufficient resource utilization.
A hierarchical system of collaborative rules for communication protocols is constructed. Dynamic path selection is performed through level labels and protocol combination path trees. Real-time performance monitoring and adaptive adjustment are combined with a sliding time window mechanism to optimize communication strategies.
It enables differentiated management of communication events in the Internet of Things (IoT) environment, improves system response efficiency and resource utilization, enhances system flexibility and robustness, and supports continuous availability and communication quality in complex network environments.
Smart Images

Figure CN120343115B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of Internet of Things, in particular to an Internet of Things gateway communication protocol collaborative optimization method and system. BACKGROUND
[0002] With the development and popularization of Internet of Things technology, more and more devices are connected to the network through various communication protocols, forming a complex Internet of Things ecosystem. As a key node connecting different devices, protocols and networks, the Internet of Things gateway plays a crucial role in data transmission, device management and service provision. However, existing Internet of Things gateways face several challenges when handling multiple communication protocols.
[0003] In related technologies, different Internet of Things applications may use different communication protocols, which requires the gateway to effectively manage and convert these protocols. However, existing technologies often lack a flexible and intelligent way to select the appropriate protocol combination path to meet the needs of different types of communication tasks. At the same time, due to the complexity and variability of the Internet of Things environment, network conditions and device states may change at any time. Existing gateway technologies mostly rely on static configuration, lack of network condition change perception ability and automatic adjustment strategy, and cannot adapt well to dynamic changing environment, which needs to be improved. SUMMARY
[0004] The purpose of the present application is to provide an Internet of Things gateway communication protocol collaborative optimization method and system to solve the problems raised in the background.
[0005] In a first aspect, the application provides an Internet of Things gateway communication protocol collaborative optimization method, which adopts the following technical solution:
[0006] A communication protocol collaborative rule hierarchical system is constructed to obtain the level labels corresponding to various communication events;
[0007] Based on the level labels of various communication events, a protocol combination path corresponding to each level is set to form a protocol invocation path tree;
[0008] During the execution of the communication task, the corresponding protocol combination path is invoked according to the protocol invocation path tree;
[0009] When multiple protocol combination paths share communication resources, the communication scheduling priority of each protocol combination path is calculated, and the scheduling task is executed through priority sorting;
[0010] During the execution of the communication task, a sliding time window mechanism is constructed to collect the execution feedback data of each protocol combination path to obtain a sliding window execution result;
[0011] Judge whether the sliding window execution result exceeds the preset performance threshold value, dynamically adjust the hierarchical system parameters of the communication task according to the judgment result, and update the protocol combination path.
[0012] Preferably, the step of constructing a communication protocol cooperative rule hierarchy to obtain the level label corresponding to each type of communication event is specifically:
[0013] The maximum allowed response delay time threshold value is set for each type of communication event, and the real-time score of each type of communication event is quantified according to the response delay time threshold value, to obtain a real-time score;
[0014] A dependency mapping relationship graph is established between each type of communication event and the business module, and the business importance score of each type of communication event is quantified based on the dependency mapping relationship graph to obtain an importance score;
[0015] The system action range and communication load level after triggering each type of communication event are obtained, and the system influence degree score of each type of communication event is evaluated based on the system action range and communication load level to obtain an influence degree score;
[0016] The real-time score, importance score and influence degree score are integrated, and a comprehensive response score of each type of communication event is calculated by weighted calculation;
[0017] The comprehensive response score is matched with a preset response score level interval to obtain the level label corresponding to each type of communication event.
[0018] Preferably, based on the level label of each type of communication event, a corresponding protocol combination path is set for each level to form a protocol calling path tree, and the step is specifically:
[0019] Based on the level label of each type of communication event, a corresponding protocol combination path is set for each level;
[0020] The protocol combination paths corresponding to each level are organized in a tree structure to construct a protocol calling path tree;
[0021] The root node of the protocol calling path tree is a communication event level node, the branch node is a protocol combination sequence, and the leaf node is a communication protocol parameter;
[0022] The protocol calling path tree is stored in the Internet of Things gateway device, and when a communication event is received, the corresponding protocol path can be matched according to the communication event level label and the scheduling task is executed.
[0023] Preferably, during the communication task execution process, the step of calling the corresponding protocol combination path according to the protocol calling path tree is specifically:
[0024] During the communication task execution process, device state information and external trigger event information associated with the current communication task are acquired, the external trigger event information including system control instruction information, user intervention instruction information, and abnormal alarm linkage information;
[0025] The device state information and the external trigger event information are jointly input, the communication protocol coordination rule hierarchical system is matched, and an event level label to which the communication task belongs is determined;
[0026] In the protocol calling path tree, a protocol combination path corresponding to the event level label is searched, and a path search result is obtained;
[0027] Based on the path search result, the corresponding protocol combination path is called, and the communication task is executed.
[0028] Preferably, based on the path search result, the corresponding protocol combination path is called, and the communication task is executed, specifically as follows:
[0029] Based on the path search result, if there are multiple protocol combination paths corresponding to the event level label, the adaptation degree scores of the protocol combination paths are calculated, and the adaptation degree scores of the protocol combination paths are obtained;
[0030] Based on the adaptation degree scores, the protocol combination path with the highest adaptation degree score is set as the main execution path of the communication task, and the remaining protocol combination paths are set as the backup execution paths of the communication task in descending order of the adaptation degree scores;
[0031] If the main execution path fails or the main execution path execution times out, the protocol is switched in order according to the backup execution paths, and the communication task is executed.
[0032] Preferably, when there are multiple protocol combination paths sharing communication resources, the communication scheduling priorities of the protocol combination paths are calculated, and the scheduling tasks are executed through priority sorting, specifically as follows:
[0033] When there are multiple protocol combination paths sharing communication resources, resource conflict detection is performed, and the protocol combination paths that cause resource conflicts are added to a scheduling conflict queue;
[0034] The communication scheduling priority of each protocol combination path in the scheduling conflict queue is calculated, and a communication scheduling priority value is obtained;
[0035] All protocol combination paths in the scheduling conflict queue are sorted in descending order of the communication scheduling priority values, and a protocol path priority sequence is obtained;
[0036] Based on the protocol path priority sequence, the scheduling tasks are executed in order.
[0037] Preferably, in the communication task execution process, a sliding time window mechanism is constructed to collect the execution feedback data of each protocol combination path to obtain the sliding window execution result, and the step is specifically as follows:
[0038] In the communication task execution process, a sliding time window mechanism is constructed to collect the execution feedback data of each protocol combination path after each protocol combination path execution is completed.
[0039] The execution feedback data includes an execution success identifier, an execution retry number, and an exception code feedback.
[0040] Based on the execution success identifier, the number of execution successes in a preset time window is counted to obtain an execution success rate.
[0041] Based on the execution retry number, the total number of execution retries in the preset time window is counted to obtain an execution retry rate.
[0042] Based on the exception code feedback, the exception code feedback is classified and counted to determine the communication failure reason to obtain an execution failure reason.
[0043] The execution success rate, the execution retry rate, and the execution failure reason are comprehensively considered to obtain the sliding window execution result.
[0044] Preferably, it is judged whether the sliding window execution result exceeds a preset performance threshold, and the hierarchical system parameters of the communication task are dynamically adjusted according to the judgment result to update the protocol combination path, and the step is specifically as follows:
[0045] A corresponding performance threshold is set for each communication protocol combination path, and the performance threshold includes a success rate threshold and a retry rate threshold.
[0046] Based on the sliding window execution result, the execution success rate and the execution retry rate in the sliding window execution result are compared with the performance threshold one by one to determine whether the sliding window execution result exceeds the performance threshold.
[0047] If any index in the sliding window execution result exceeds the corresponding performance threshold, it is determined as abnormal execution.
[0048] For the abnormal execution, the execution failure reason in the sliding window execution result is extracted, the hierarchical system parameters of the communication event are adjusted according to the execution failure reason to obtain an updated level label, and the protocol combination path is updated according to the updated level label.
[0049] In a second aspect, the application provides an Internet of Things gateway communication protocol collaborative optimization system, which adopts the following technical scheme:
[0050] An Internet of Things gateway communication protocol collaborative optimization system includes:
[0051] a hierarchical construction module, which constructs a hierarchical system of communication protocol cooperation rules to obtain a level label corresponding to each type of communication event;
[0052] a path tree construction module, which sets a corresponding protocol combination path for each level based on the level label of each type of communication event to form a protocol calling path tree;
[0053] a path management module, which calls a corresponding protocol combination path according to the protocol calling path tree during the execution of a communication task;
[0054] a resource conflict module, which calculates the communication scheduling priority of each protocol combination path when multiple protocol combination paths share a communication resource, and executes a scheduling task through priority sorting;
[0055] a sliding window monitoring module, which constructs a sliding time window mechanism to collect execution feedback data of each protocol combination path and obtain a sliding window execution result during the execution of a communication task;
[0056] an adaptive adjustment module, which judges whether the sliding window execution result exceeds a preset performance threshold, dynamically adjusts the hierarchical system parameters of the communication task according to the judgment result, and updates the protocol combination path.
[0057] In summary, the present application has at least one of the following beneficial technical effects:
[0058] 1. The present application classifies the diversified communication events in the Internet of Things environment into levels, each level corresponds to a different processing strategy, realizes the differentiated management of communication tasks, improves the system response efficiency, provides a basis for subsequent protocol selection and scheduling, and enhances the flexibility of the system. For communication events of different levels, multiple protocol combination paths are preset to form a protocol calling path tree, and the optimal protocol combination is quickly matched according to the level of the communication event at runtime, improving the intelligent level of protocol selection and avoiding the use of a single protocol to adapt to all scenarios. At the same time, the cost of protocol switching is reduced, and the communication efficiency is improved. When multiple communication tasks compete for priority resources, the communication scheduling priority of each protocol combination path is calculated, and a priority queue is used for task scheduling to prevent resource conflicts and communication congestion, improve system throughput and task completion rate, maximize resource utilization, and improve overall communication quality. A fixed-length time window is set, and a sliding time window mechanism is used to dynamically monitor the execution performance of each protocol combination path, realize real-time performance monitoring and trend prediction, provide feedback data for subsequent strategy adjustment, and enhance the self-learning and optimization ability of the system. If the performance of a protocol combination path decreases, the adjustment mechanism is triggered to dynamically modify the level division standard of the communication event, update the protocol combination path tree, replace a better path, realize the closed-loop optimization of the communication strategy, and improve the robustness and fault tolerance of the system to adapt to the changing network environment and business requirements.
[0059] 2. There can be multiple protocol combination paths at the same level, and the system comprehensively evaluates and scores each path according to current network environment, device resource state, historical performance, etc., to realize fine selection of paths at the same level, improve the adaptability and intelligent level of protocol selection, and avoid performance bottlenecks caused by fixed paths. The path with the highest score is used as the main execution path for priority attempt, and the remaining paths are sorted according to the score as backup paths, which are tried in turn when the main path fails. A communication path system combining main and backup is constructed to improve the success rate of tasks, realize fault-tolerant mechanism in the communication process, and reduce communication interruption caused by single-point path failure; at the same time, the reliability and stability of the system are improved, and the continuous availability of communication in complex network environment is supported.
[0060] 3. A performance threshold is set for each communication protocol combination path, including a success rate threshold and a retry rate threshold, the success rate threshold reflecting communication reliability, and the retry rate threshold reflecting communication stability, to realize quantifiable monitoring of communication quality. The success rate in the current period is compared with the preset success rate threshold, and the retry rate is compared with the preset retry rate threshold, if any index exceeds the threshold, it is determined that the path is in an abnormal execution state, realizing automatic judgment of path execution state, avoiding single index misjudgment, improving evaluation accuracy, and enhancing fault tolerance capability of the system in complex network environment. When a path continuously appears low success rate or high retry rate, it is marked as an abnormal path, triggering the subsequent dynamic adjustment mechanism, quickly identifying unstable paths or potential fault points, and preventing task failure or service quality degradation caused by path problems. The execution failure reason in the sliding window execution result is extracted, the event level division of the communication task is reversed according to the failure reason, and then a more optimal protocol combination path is matched in the protocol calling path tree according to the new level label. The dynamic adjustment of communication task priority is realized, the communication guarantee of key tasks is improved, the system is promoted from static configuration to dynamic evolution, and closed-loop communication optimization is realized. BRIEF DESCRIPTION OF DRAWINGS
[0061] Fig. 1 is a specific step schematic diagram of an embodiment of the Internet of Things gateway communication protocol cooperative optimization method of the application.
[0062] Fig. 2 is a module connection schematic diagram of an embodiment of the Internet of Things gateway communication protocol cooperative optimization system of the application. DETAILED DESCRIPTION
[0063] The application will be further described in detail below in conjunction with embodiments and Figs. 1-2 The embodiments of the application are not limited to this.
[0064] The application discloses an Internet of Things gateway communication protocol cooperative optimization method, specifically comprising the following steps:
[0065] Step S1, a communication protocol collaborative rule hierarchy is constructed to obtain a level label corresponding to each type of communication event;
[0066] Step S2, based on the level label of each type of communication event, a corresponding protocol combination path is set for each level to form a protocol calling path tree;
[0067] Step S3, during the communication task execution process, the corresponding protocol combination path is called according to the protocol calling path tree;
[0068] Step S4, when there are multiple protocol combination paths sharing communication resources, the communication scheduling priority of each protocol combination path is calculated, and the scheduling task is executed through priority sorting;
[0069] Step S5, during the communication task execution process, a sliding time window mechanism is constructed to collect the execution feedback data of each protocol combination path to obtain a sliding window execution result;
[0070] Step S6, whether the sliding window execution result exceeds a preset performance threshold is judged, and the hierarchy parameters of the communication task are dynamically adjusted according to the judgment result to update the protocol combination path.
[0071] In actual application, the diversified communication events in the Internet of Things environment are classified by level, and clear responses are set according to business importance and system impact, such as regular level and warning level. Each level corresponds to a different processing strategy, realizes differentiated management of communication tasks, improves system response efficiency, provides basis for subsequent protocol selection and scheduling, and enhances system flexibility. For communication events of different levels, multiple communication protocol combination paths are preset to form a protocol calling path tree, and the optimal protocol combination is quickly matched according to the communication event level during runtime to improve the intelligent level of protocol selection and avoid single protocol adaptation to all scenarios. At the same time, the protocol switching cost is reduced, and the communication efficiency is improved. When multiple communication tasks compete for priority resources at the same time, the communication scheduling priority of each protocol combination path is calculated, and the priority queue is used for task scheduling to prevent resource conflict and communication congestion, improve system throughput and task completion rate, realize resource utilization maximization, and improve overall communication quality. A fixed length time window is set, and the sliding time window mechanism is used to dynamically monitor the execution performance of each protocol combination path to realize real-time performance monitoring and trend prediction, provide feedback data for subsequent strategy adjustment, and enhance the self-learning and optimization ability of the system. If the performance of a protocol combination path decreases, the adjustment mechanism is triggered to dynamically modify the level division standard of the communication event, update the protocol combination path tree, and replace a better path to realize closed-loop optimization of the communication strategy, improve the robustness and fault tolerance of the system, and adapt to the changing network environment and business requirements.
[0072] The step of constructing a communication protocol collaborative rule hierarchical system to obtain the level labels corresponding to the various communication events is specifically as follows:
[0073] In step S11, a maximum allowed response delay time threshold is set for each type of communication event, and a real-time score of each type of communication event is quantified according to the response delay time threshold, to obtain a real-time score;
[0074] In step S12, a dependency mapping relationship graph is established between each type of communication event and a business module, and a business importance score of each type of communication event is quantified based on the dependency mapping relationship graph, to obtain an importance score;
[0075] In step S13, a system action range and a communication load level after each type of communication event is triggered are obtained, and a system influence degree score of each type of communication event is evaluated based on the system action range and the communication load level, to obtain an influence degree score;
[0076] In step S14, the real-time score, the importance score, and the influence degree score are comprehensively calculated to obtain a comprehensive response score of each type of communication event;
[0077] In step S15, the comprehensive response score is matched with a preset response score level interval, to obtain a level label corresponding to each type of communication event.
[0078] In actual application, an acceptable maximum delay time is set for each type of communication event, and a real-time score of each type of communication event is quantified according to the deviation degree of the actual response time from the threshold, to realize quantitative management of the timeliness of communication tasks and provide fast response guarantee for high-priority tasks. An association graph is constructed between communication events and business modules, the criticality of the event in the overall system business process is analyzed, a business importance score is obtained, the influence degree of different communication events on the system function integrity is determined, and the identification and priority processing capability of the system for key business events is improved. The system influence degree score of each type of communication event is evaluated according to the system action range and the communication load level, to avoid system performance degradation or collapse caused by high-load communication tasks, realize visualization and quantification of the overall influence of communication tasks on the system, and help to reasonably formulate resource allocation and scheduling strategies. The three dimensions of real-time, importance, and influence degree are weighted and fused according to the weights, to obtain a unified comprehensive score, and the weights can be dynamically adjusted according to specific application scenarios, such as industrial scenarios that emphasize real-time, medical scenarios that emphasize importance, and multi-dimensional index fusion that improves the scientificity and adaptability of evaluation, supports personalized configuration, and meets the needs of different industries. The comprehensive response score is matched with a preset level interval, to obtain a level label corresponding to each type of communication event, to convert complex scoring results into a form easy to understand and apply, to provide a basis for subsequent protocol selection and path planning, and to realize structured management and automated response of communication tasks.
[0079] Based on the level label of various communication events, a corresponding protocol combination path is set for each level to form a protocol calling path tree, specifically as follows:
[0080] Step S21, based on the level label of various communication events, a corresponding protocol combination path is set for each level;
[0081] Step S22, the protocol combination paths corresponding to each level are organized in a tree structure to construct a protocol calling path tree;
[0082] Step S23, the root node of the protocol calling path tree is a communication event level node, the branch node is a protocol combination sequence, and the leaf node is a communication protocol parameter;
[0083] Step S24, the protocol calling path tree is stored in the Internet of Things gateway device, and when a communication event is received, the corresponding protocol path can be matched according to the communication event level label and the scheduling task is executed.
[0084] In actual application, after the communication events are divided into high, medium and low levels, one or more applicable communication protocol combinations are preset for each level, realizing accurate matching between communication events and protocols, avoiding the problem of single protocol adapting to all scenarios, and improving communication efficiency and resource utilization. The protocol combination paths corresponding to each level are organized in a tree structure to construct a protocol calling path tree, and the tree structure is used to manage the communication event level, protocol combination sequence and specific parameters in layers, enhancing the maintainability and readability of the system, which is beneficial to rapid retrieval and decision-making. The root node in the tree structure represents the communication event level, the branch node represents the protocol combination and its execution order, and the leaf node contains specific communication parameters such as IP address, port and encryption method, realizing the modularization and standardization of the communication process, and facilitating automatic execution and remote management. The complete protocol path tree structure is stored locally in the gateway, and after receiving a communication event, the corresponding protocol path is quickly located through the level label, the protocol stack is automatically loaded and the communication task is executed, reducing communication delay and improving system real-time performance.
[0085] In the communication task execution process, according to the protocol calling path tree, the corresponding protocol combination path is called, specifically as follows:
[0086] Step S31, in the communication task execution process, the device state information and external trigger event information associated with the current communication task are obtained, and the external trigger event information includes system control instruction information, user intervention instruction information and abnormal alarm linkage information;
[0087] Step S32, the device state information and external trigger event information are jointly input to match the communication protocol cooperation rule hierarchical system to determine the event level label to which the communication task belongs;
[0088] Step S33, in the protocol calling path tree, a protocol combination path corresponding to the event level label is searched to obtain a path search result;
[0089] Step S34, based on the path search result, a corresponding protocol combination path is called to execute the communication task.
[0090] In actual application, the device state information and the external trigger event information associated with the current communication task are obtained, the device state information includes device online state, resource occupation, etc., comprehensive perception of the communication task running environment is realized, blind start of high-load communication process when device resource is insufficient or network is unstable is avoided, and system stability and task execution success rate are improved. The device state information and the external trigger event information are jointly input into the communication event grading model constructed, the event level label of the communication event is output according to real-time, importance, influence degree and other dimensions, dynamic classification management of the communication task is realized, protocol selection is matched with actual demand, and basis is provided for subsequent protocol path calling. According to the level label of the communication task, the optimal protocol combination path is quickly located in the preset protocol calling path tree, automatic matching and loading of the protocol path are realized, system response efficiency and intelligent level are improved, manual intervention is reduced, and automation degree is improved. The selected protocol stack is loaded and relevant parameters are initialized, complete communication process such as data encapsulation, transmission and response is executed, closed-loop execution of the communication task is realized, and stability and reliability of the communication process are improved.
[0091] The step of calling a corresponding protocol combination path to execute the communication task based on the path search result is specifically:
[0092] Step S341, based on the path search result, if there are multiple protocol combination paths corresponding to the event level label, the adaptation degree scores of the protocol combination paths are scored to obtain the adaptation degree scores of the protocol combination paths;
[0093] Step S342, based on the adaptation degree scores, the protocol combination path with the highest adaptation degree score is set as the main execution path of the communication task, and the remaining protocol combination paths are set as the backup execution paths of the communication task in descending order of the adaptation degree scores;
[0094] Step S343, if the main execution path fails or the main execution path executes beyond a time limit, protocol switching is sequentially performed according to the backup execution path order to execute the communication task.
[0095] In actual application, multiple protocol combination paths can exist in the same level. The system comprehensively evaluates and scores each path according to the current network environment, device resource state, historical performance, and other factors, realizes fine selection of paths in the same level, improves the adaptability and intelligent level of protocol selection, and avoids performance bottleneck caused by fixed paths. The path with the highest score is used as the main execution path for priority attempt, and the remaining paths are sorted according to the score as backup paths, which are tried in turn when the main path fails. The communication path system combining main and backup is constructed, the task success rate is improved, the fault tolerance mechanism in the communication process is realized, the communication interruption caused by single-point path failure is reduced, the reliability and stability of the system are improved, and the continuous availability of communication in complex network environment is supported.
[0096] When multiple protocol combination paths share communication resources, the communication scheduling priority of each protocol combination path is calculated, and the scheduling task is executed through priority sorting, specifically as follows:
[0097] In step S41, when multiple protocol combination paths share communication resources, resource conflict detection is performed, and the protocol combination paths that cause resource conflicts are added to the scheduling conflict queue.
[0098] In step S42, the communication scheduling priority of each protocol combination path in the scheduling conflict queue is calculated to obtain a communication scheduling priority value.
[0099] In step S43, all protocol combination paths in the scheduling conflict queue are sorted according to the communication scheduling priority value from high to low to obtain a protocol path priority sequence.
[0100] In step S44, based on the protocol path priority sequence, the scheduling task is executed in turn.
[0101] In actual application, the use of communication resources by each protocol combination path is monitored in real time, including network bandwidth, CPU, memory, channel, etc. If multiple paths simultaneously request the same type of resource, it is determined that there is a resource conflict. The conflicting paths are collectively placed in a scheduling conflict queue for processing to prevent communication failure or system lag due to resource contention, improve the transparency and controllability of resource scheduling, and support the stable operation of the system in a complex environment. Each path in the conflict queue is given a comprehensive score, which can include event level label, real-time requirement, historical success rate, business importance, communication load size, communication duration, etc. A communication scheduling priority value corresponding to each path is finally generated. This realizes differentiated management of communication tasks, supports a quality-of-service-driven resource allocation strategy, improves the intelligence level of the system, reduces human intervention, helps to identify critical tasks and prioritize processing. The conflicting paths are sorted according to the priority values to form a path sequence arranged in order of priority. The protocol combination paths are executed in order of priority. As many as possible are executed concurrently if resources permit. If resources are insufficient, a queuing mechanism is used to gradually release resources and continue execution, improving communication efficiency and resource utilization, reducing communication delay, improving system response capability, and ensuring timely completion of high-priority tasks.
[0102] During the execution of the communication task, a sliding time window mechanism is constructed to collect execution feedback data of each protocol combination path to obtain a sliding window execution result, specifically as follows.
[0103] In step S51, during the execution of the communication task, a sliding time window mechanism is constructed to collect execution feedback data of each protocol combination path after each protocol combination path is executed.
[0104] In step S52, the execution feedback data includes an execution success identifier, an execution retry count, and an exception code feedback.
[0105] In step S53, based on the execution success identifier, the number of execution successes within a preset time window is counted to obtain an execution success rate.
[0106] In step S54, based on the execution retry count, the total number of execution retries within a preset time window is counted to obtain an execution retry rate.
[0107] In step S55, based on the exception code feedback, the exception code feedback is classified and counted to determine the cause of communication failure to obtain an execution failure cause.
[0108] In step S56, the execution success rate, the execution retry rate, and the execution failure cause are comprehensively considered to obtain a sliding window execution result.
[0109] In actual application, a fixed length time window is set in the system, such as the last 5 minutes, and the key feedback information in the execution process is recorded after the protocol combination path is executed, including whether it is successful, whether it needs to be retried, and what kind of abnormal code appears, so as to realize continuous monitoring of the execution of the communication path, provide dynamic and real-time data basis for performance evaluation, and help to build a closed-loop feedback mechanism and improve the self-adaptive ability of the system. The success rate of execution is calculated by counting the number of successful executions of a path in the set time window and calculating the proportion of the number of successful executions in the total number of executions, which reflects the stability of the path in the current network environment and indicates the overall availability of the communication path. The average number of retries of a path in the time window is counted, and the ratio of the number of retries to the number of executions is calculated to obtain the execution retry rate, which reflects the fluctuation degree of the network environment where the path is located and reveals the instability of the communication path, which helps to determine whether to replace a more stable path and helps to optimize the resource scheduling strategy. The abnormal codes are classified and counted to determine the cause of communication failure, help to locate the problem source, support protocol stack exception diagnosis and repair, and provide a basis for protocol parameter tuning. The sliding window execution result is obtained by comprehensively considering the execution success rate, execution retry rate and execution failure reason, which is the final evaluation output of the path performance, realizes the quantitative expression of the execution effect of the communication path, supports the horizontal comparison between paths, provides a basis for the dynamic update of the protocol path tree, and promotes the evolution of the system towards self-learning and autonomous optimization.
[0110] It is judged whether the sliding window execution result exceeds the preset performance threshold, and the hierarchical system parameters of the communication task are dynamically adjusted according to the judgment result to update the protocol combination path, specifically as follows:
[0111] In step S61, a corresponding performance threshold is set for each communication protocol combination path, and the performance threshold includes a success rate threshold and a retry rate threshold.
[0112] In step S62, based on the sliding window execution result, the execution success rate and the execution retry rate in the sliding window execution result are compared with the performance threshold respectively to judge whether the sliding window execution result exceeds the performance threshold.
[0113] In step S63, if any index in the sliding window execution result exceeds the corresponding performance threshold, it is determined as abnormal execution.
[0114] In step S64, for the abnormal execution, the execution failure reason in the sliding window execution result is extracted, the hierarchical system parameters of the communication event are adjusted according to the execution failure reason, the updated level label is obtained, and the protocol combination path is updated according to the updated level label.
[0115] In actual application, a corresponding performance threshold is set for each communication protocol combination path, including a success rate threshold and a retry rate threshold. The success rate threshold reflects the communication reliability, and the retry rate threshold reflects the communication stability, so as to realize the quantifiable monitoring of the communication quality. The success rate in the current period is compared with the preset success rate threshold, and the retry rate is compared with the preset retry rate threshold. If any index exceeds the threshold, it is determined that the path is in an abnormal execution state, so as to realize the automatic judgment of the path execution state, avoid the single index misjudgment, improve the evaluation accuracy, and enhance the fault tolerance of the system in the complex network environment. When a certain path continuously appears low success rate or high retry rate, it is marked as an abnormal path, and a subsequent dynamic adjustment mechanism is triggered to quickly identify unstable paths or potential fault points, so as to prevent the task failure or the service quality decline caused by the path problem. The execution failure reasons in the sliding window execution result are extracted, such as authentication failure, connection timeout, and resource shortage. According to the failure reasons, the event level division of the communication task is reversely affected, for example, the original medium priority task is upgraded to high priority due to frequent timeout, and then a new level label is obtained to match a more optimal protocol combination path in the protocol calling path tree. The dynamic adjustment of the communication task priority is realized, the communication guarantee strength of the key task is improved, the system is promoted from static configuration to dynamic evolution, and the closed-loop communication optimization is realized.
[0116] An Internet of Things gateway communication protocol cooperative optimization system, by applying an Internet of Things gateway communication protocol cooperative optimization method as described above, comprising:
[0117] A hierarchical construction module constructs a communication protocol cooperative rule hierarchical system to obtain the level labels corresponding to various communication events.
[0118] A path tree construction module sets a corresponding protocol combination path for each level based on the level labels of various communication events to form a protocol calling path tree.
[0119] A path management module calls a corresponding protocol combination path according to the protocol calling path tree during the communication task execution process.
[0120] A resource conflict module calculates the communication scheduling priorities of various protocol combination paths when multiple protocol combination paths share communication resources, and executes the scheduling tasks through priority sorting.
[0121] A sliding window monitoring module constructs a sliding time window mechanism to collect the execution feedback data of each protocol combination path to obtain a sliding window execution result during the communication task execution process.
[0122] An adaptive adjustment module judges whether the sliding window execution result exceeds the preset performance threshold, dynamically adjusts the hierarchical system parameters of the communication task according to the judgment result, and updates the protocol combination path.
[0123] In actual application, firstly, the hierarchical construction module is used to realize intelligent identification and differentiated management of task priority through multi-dimensional scoring and grade division of communication events, and to provide decision basis for subsequent protocol selection. Through the path tree construction module, different level communication events and corresponding protocol combination path are structured and organized to form a protocol execution strategy tree which can be quickly matched and called, thereby improving system response efficiency and maintainability. Then, the path management module automatically matches the optimal protocol path according to the level label of the communication task to realize intelligent scheduling and efficient execution of the communication process. The resource conflict module is used to detect and solve the communication resource contention problem when multiple paths are concurrently executed, and the priority is sorted to ensure that the key task is executed first, thereby improving the system stability and resource utilization. Then, the sliding window monitoring module is used to dynamically collect protocol path execution feedback data, and to real-time evaluate the path performance, thereby providing reliable data support for system adaptive optimization. Finally, the adaptive adjustment module is used to dynamically adjust the communication event level and protocol path configuration based on the performance evaluation result, thereby realizing the closed-loop optimization and autonomous evolution ability of the system.
[0124] The above are preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Therefore, any equivalent changes made on the basis of the structure, shape and principle of the present application shall be covered within the protection scope of the present application.
Claims
1. A collaborative optimization method for IoT gateway communication protocols, characterized in that, Includes the following steps: Construct a hierarchical system for communication protocol coordination rules to obtain level labels corresponding to various communication events, including the following steps: A maximum allowable response delay time threshold is set for various types of communication events, and the real-time score of each type of communication event is quantified based on the response delay time threshold to obtain a real-time score. Establish a dependency mapping relationship graph between various communication events and business modules, and quantify the business importance score of various communication events based on the dependency mapping relationship graph to obtain the importance score; Obtain the system scope and communication load level after various communication events are triggered, and evaluate the system impact score of various communication events based on the system scope and communication load level to obtain the impact score. By combining the real-time score, importance score, and impact score, a weighted comprehensive response score for each type of communication event is calculated. The comprehensive response score is matched with a preset response score level range to obtain the level label corresponding to each type of communication event; Based on the level labels of various communication events, a corresponding protocol combination path is set for each level to form a protocol call path tree, including the following steps: Based on the level labels of various communication events, a corresponding protocol combination path is set for each level; Organize the protocol combination paths corresponding to each level into a tree structure to construct a protocol call path tree; The root node of the protocol call path tree is the communication event level node, the branch nodes are the protocol combination sequence, and the leaf nodes are the communication protocol parameters. The protocol call path tree is stored in the IoT gateway device. When a communication event is received, the corresponding protocol path can be matched according to the communication event level label and the scheduling task can be executed. During the execution of the communication task, the corresponding protocol combination path is invoked according to the protocol call path tree, including the following steps: During the execution of a communication task, the device status information and external trigger event information associated with the current communication task are obtained. The external trigger event information includes system control command information, user intervention command information, and abnormal alarm linkage information. The device status information and external trigger event information are input together and matched with the communication protocol coordination rule classification system to determine the event level label to which the communication task belongs; In the protocol call path tree, retrieve the protocol combination path corresponding to the event level label to obtain the path retrieval result; Based on the path retrieval results, the corresponding protocol combination path is invoked to execute the communication task; When multiple protocol combination paths share communication resources, the communication scheduling priority of each protocol combination path is calculated, and the scheduling task is executed by prioritizing the paths. During the execution of the communication task, a sliding time window mechanism is constructed to collect the execution feedback data of each protocol combination path and obtain the sliding window execution result; Determine whether the sliding window execution result exceeds the preset performance threshold, and dynamically adjust the hierarchical system parameters of the communication task and update the protocol combination path based on the determination result.
2. The IoT gateway communication protocol collaborative optimization method according to claim 1, characterized in that, The step of calling the corresponding protocol combination path based on the path retrieval result and executing the communication task is as follows: Based on the path retrieval results, if multiple protocol combination paths correspond to the event level tags, then each protocol combination path is given a fit score to obtain the fit score of each protocol combination path. Based on the adaptation score, the protocol combination path with the highest adaptation score is set as the main execution path of the communication task, and the remaining protocol combination paths are set as alternative execution paths of the communication task in descending order of adaptation score. If the main execution path fails or times out, the protocol will be switched sequentially according to the order of the backup execution paths to execute the communication task.
3. The IoT gateway communication protocol collaborative optimization method according to claim 1, characterized in that, The step of calculating the communication scheduling priority of each protocol combination path and executing the scheduling task according to the priority order when multiple protocol combination paths share communication resources is as follows: When multiple protocol combination paths share communication resources, resource conflict detection is performed, and the protocol combination paths with resource conflicts are added to the scheduling conflict queue. For each protocol combination path in the scheduling conflict queue, the communication scheduling priority is calculated to obtain the communication scheduling priority value; All protocol combination paths in the scheduling conflict queue are sorted from high to low according to their communication scheduling priority values to obtain a protocol path priority sequence; Based on the protocol path priority sequence, the scheduling tasks are executed sequentially.
4. The IoT gateway communication protocol collaborative optimization method according to claim 1, characterized in that, The steps for constructing a sliding time window mechanism, collecting execution feedback data for each protocol combination path, and obtaining the sliding window execution result during the execution of the communication task are as follows: During the execution of communication tasks, a sliding time window mechanism is constructed to collect execution feedback data for each protocol combination path after each protocol combination path is executed. The execution feedback data includes an execution success identifier, the number of execution retries, and an exception code feedback. Based on the execution success identifier, the number of successful executions within a preset time window is counted to obtain the execution success rate; Based on the number of execution retries, the total number of execution retries within a preset time window is calculated to obtain the execution retry rate; Based on the error code feedback, the error code feedback is classified and statistically analyzed to determine the reason for communication failure and obtain the reason for execution failure. The sliding window execution result is obtained by combining the execution success rate, execution retry rate, and reasons for execution failure.
5. The IoT gateway communication protocol collaborative optimization method according to claim 4, characterized in that, The steps of determining whether the sliding window execution result exceeds a preset performance threshold, dynamically adjusting the hierarchical parameters of the communication task based on the determination result, and updating the protocol combination path are as follows: Set a corresponding performance threshold for each communication protocol combination path, the performance threshold including a success rate threshold and a retry rate threshold; Based on the sliding window execution results, the execution success rate and execution retry rate in the sliding window execution results are compared with the performance thresholds one by one to determine whether the sliding window execution results exceed the performance thresholds. If any metric in the sliding window execution result exceeds the corresponding performance threshold, it is determined to be abnormal execution; For the abnormal execution, extract the execution failure reason from the sliding window execution result, adjust the hierarchical parameters of the communication event according to the execution failure reason to obtain the update level label, and update the protocol combination path according to the update level label.
6. A collaborative optimization system for IoT gateway communication protocols, characterized in that, The method for collaborative optimization of IoT gateway communication protocols as described in any one of claims 1-5 includes: The hierarchical construction module builds a hierarchical system for communication protocol collaboration rules and obtains the level labels corresponding to various communication events. The path tree construction module sets corresponding protocol combination paths for each level based on the level labels of various communication events, forming a protocol call path tree; The path management module, during the execution of a communication task, invokes the corresponding protocol combination path according to the protocol call path tree. The resource conflict module calculates the communication scheduling priority of each protocol combination path when multiple protocol combination paths share communication resources, and executes the scheduling task by prioritizing the paths. The sliding window monitoring module constructs a sliding time window mechanism during the execution of communication tasks, collects execution feedback data for each protocol combination path, and obtains the sliding window execution result. The adaptive adjustment module determines whether the sliding window execution result exceeds the preset performance threshold, and dynamically adjusts the hierarchical system parameters of the communication task and updates the protocol combination path based on the determination result.
Citation Information
Patent Citations
Dynamic calculation path optimization method and system based on ant colony algorithm
CN117689095A
Signal I / O control device based on multiple protocols and data transmission method thereof
CN119363853A