Communication module protocol control method and system
By dynamically analyzing and monitoring the communication tasks and network quality of IoT devices and choosing the most suitable communication protocol type, the problem of communication efficiency and accuracy of IoT devices in high environments in real-time and latency requirements is solved, and the system flexibility and reliability improvement is achieved.
Patent Information
- Application Number
- CN202510412515.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-05-02
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
How to effectively control the communication protocols used by IoT devices to ensure the efficiency and accuracy of information interaction, especially in environments with high real-time and latency requirements.
By obtaining the current communication protocol type and device type of the communication target, analyzing the data content and device type to determine the communication task type and communication quality requirements, monitoring the network quality status, and selecting the most matching target communication protocol type from the supported protocol types for adjustment.
It realizes dynamic selection of the optimal communication protocol based on the network state, improves the flexibility and adaptability of the system, enhances fault tolerance and reliability, and ensures stable and efficient operation in a complex and changeable Internet of Things environment.
Smart Images

Figure CN119922249A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet of Things communication technology, and in particular to a communication module protocol control method and system. Background Art
[0002] A communication module is an integrated electronic component designed to enable data transmission between devices. Such modules usually contain the necessary hardware and software to support specific communication protocols or standards, such as Wi-Fi, Bluetooth, Zigbee, LoRa, NB-IoT, 4G / 5G, etc. In the Internet of Things (IoT), communication modules play a vital role. As a bridge connecting the physical world and the digital world, it enables different types of devices to communicate with each other and access the Internet. With the rapid development of IoT technology, the number and types of IoT devices are also increasing rapidly, and many IoT devices use different communication protocols. At the same time, some IoT devices have strict requirements on real-time performance and latency when working. In actual deployment, the status of the device and the surrounding environment may change dynamically, which puts higher requirements on the working ability of the communication module.
[0003] Therefore, how to effectively control the communication protocols used by IoT devices to ensure the efficiency and accuracy of information interaction among IoT devices is an urgent problem to be solved. Summary of the invention
[0004] In order to improve the above problems, the present invention provides a communication module protocol control method and system.
[0005] According to a first aspect of an embodiment of the present invention, a communication module protocol control method is provided, the method comprising: Acquire the current communication protocol type used to communicate with the communication target and the device type of the communication target; Determine the current communication task type and the communication quality requirement of the communication task type according to the data content communicated with the communication target and the device type; Acquire the network quality status when communicating with the communication target, and determine whether the current network quality status can meet the communication quality requirements of the communication task type; If it cannot be achieved, determining a target communication protocol type that has the highest matching degree with the communication quality requirement from the communication protocol types supported by the communication target; The communication protocol type for communicating with the communication target is adjusted to the target communication protocol type.
[0006] Optionally, the step of determining the current communication task type and the communication quality requirement of the communication task type according to the data content communicated with the communication target and the device type specifically includes: Analyzing the data content to determine the nature of the current communication task; Determining a current communication task type from predefined communication task types according to the nature of the current communication task and the device type; The communication quality parameter items included in the communication quality requirement and the required value range of each communication quality parameter item are determined according to the current communication task type and the device type.
[0007] Optionally, the step of obtaining the network quality status when communicating with the communication target and judging whether the current network quality status can meet the communication quality requirement of the communication task type specifically includes: Obtaining a parameter value corresponding to the communication quality parameter item in the network quality status; Compare the obtained parameter values with the required value range of each communication quality parameter item respectively; Determine whether the parameter value can reach the required value range.
[0008] Optionally, the communication quality parameter item includes a primary parameter item and a secondary parameter item, and the step of judging whether the parameter value can reach the required value range specifically includes: For the main parameter items, if the parameter value corresponding to any item exceeds the required value range, it is considered that the current network quality status cannot meet the communication quality requirements of the communication task type; For the secondary parameter items, when the parameter value corresponding to any item exceeds the required value range and the difference reaches the preset parameter threshold, it is considered that the current network quality status cannot meet the communication quality requirement of the communication task type.
[0009] Optionally, the step of determining, from the communication protocol types supported by the communication target, a target communication protocol type having the highest matching degree with the communication quality requirement specifically includes: Get a list of available communication protocol types for the communication target; Determine other communication protocol types other than the current communication protocol type in the list of available communication protocol types; Calculating the matching degree of other communication protocol types with the communication quality requirement in turn; The communication protocol type with the highest matching degree is selected as the target communication protocol type.
[0010] Optionally, the method for calculating the matching degree between the communication protocol type and the communication quality requirement specifically includes: For the type of communication protocol currently being calculated, a network quality state of the communication protocol used to communicate with the communication target is estimated to obtain a parameter estimation value corresponding to the communication quality parameter item; Scoring each communication quality parameter item according to the difference between the parameter estimation value and the required value range; Based on the weight assigned to each communication quality parameter item, a weighted total score is obtained, and the higher the weighted total score is, the higher the matching degree is, wherein the weight of the main parameter item is greater than the weight of the secondary parameter item.
[0011] Optionally, the method for estimating the network quality status specifically includes: Acquire historical data of communicating with the communication target using the communication protocol type that needs to be calculated; Based on the historical data and current network environment parameters, the network quality status is estimated.
[0012] Optionally, the method for estimating the network quality status specifically includes: Determine whether there are other devices of the same type as the communication target in the current network; Obtain the network quality status of other devices when using the communication protocol type that requires calculation to perform the same communication task type with other devices; Estimate the network quality status based on the network quality status of other devices.
[0013] Optionally, the method further comprises: If the matching degree between other communication protocol types and the communication quality requirement is less than a preset matching degree threshold, recalculating the matching degree between the current communication protocol type and the communication quality requirement; The communication protocol type with the highest matching degree is selected from all calculated matching degrees as the target communication protocol type.
[0014] A second aspect of an embodiment of the present invention provides a communication module protocol control system, including: A type acquisition unit, used to acquire the current communication protocol type used to communicate with the communication target and the device type of the communication target; A requirement determination unit, configured to determine a current communication task type and a communication quality requirement of the communication task type according to data content to be communicated with the communication target and the device type; A state judgment unit, used to obtain the network quality state when communicating with the communication target, and judge whether the current network quality state can meet the communication quality requirements of the communication task type; a protocol determination unit, configured to determine, if the requirement cannot be met, a target communication protocol type that has the highest matching degree with the communication quality requirement from the communication protocol types supported by the communication target; A protocol control unit, used to adjust the communication protocol type for communicating with the communication target to the target communication protocol type In summary, the present invention provides a communication module protocol control method and system, which can effectively realize the dynamic selection of the optimal communication protocol according to the network status through network status monitoring, definition of evaluation criteria and protocol management. It not only improves the flexibility and adaptability of the system, but also enhances the fault tolerance and reliability of the system, ensuring stable and efficient operation in a complex and changeable Internet of Things environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 A method flow chart of a communication module protocol control method according to an embodiment of the present invention; Figure 2 This is a functional module block diagram of a communication module protocol control system according to an embodiment of the present invention.
[0017] Reference numerals: Type acquisition unit 110; requirement determination unit 120; state determination unit 130; protocol determination unit 140; protocol control unit 150. DETAILED DESCRIPTION
[0018] With the rapid development of IoT technology, the number and types of IoT devices are also increasing rapidly, and many IoT devices use different communication protocols. At the same time, some IoT devices have strict requirements on real-time performance and latency when working. In actual deployment, the status of the device and the surrounding environment may change dynamically, which puts higher requirements on the working ability of the communication module.
[0019] Therefore, how to effectively control the communication protocols used by IoT devices to ensure the efficiency and accuracy of information interaction among IoT devices is an urgent problem to be solved.
[0020] In view of this, the designers of the present invention have designed a communication module protocol control method and system.
[0021] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0024] In the description of the present invention, it should be noted that the terms "top", "bottom", "inside", "outside", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the invented product is usually placed when in use, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0025] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0026] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0027] A communication module protocol control method provided in this embodiment will be described in detail below.
[0028] See also Figure 1 , this embodiment provides a communication module protocol control method, the method comprising: Step S101, obtaining the current communication protocol type used to communicate with the communication target and the device type of the communication target.
[0029] Most IoT devices' communication modules support multiple communication protocols and can query the type of protocol currently in use. For example, this information can be easily obtained through the API or the built-in status query interface. When the system starts, the communication module is automatically initialized and its configuration file is loaded. After that, the type of communication protocol currently in use can be obtained by calling the query interface of the communication module. For example, if the LoRaWAN protocol is currently in use, the system will record this information. In actual execution, considering the dynamic changes in the environment and in order to reduce the overhead caused by repeated queries, this information can be cached for a period of time.
[0030] The device type can usually be determined by the device identifier (such as MAC address, device model, etc.), which is generally obtained and stored when the device is initialized. When the device is first connected to the system, its basic information (such as MAC address, device model, etc.) is registered to the central management system. According to the unique identifier of the device (such as MAC address), the device type is queried from the central management system or device description file. When a new device is first connected to the system, the system will ask the device to provide its basic information, such as MAC address and device model, and register this information to the central management system. After that, the record in the central management system can be queried based on the device's MAC address to determine the type of the device. For example, the MAC address of a device is 00:A1:B2:C3:D4:E5. After the system query, it is found that the device is a sensor node.
[0031] As a preferred method of the embodiment of the present invention, in order to ensure that the device type identification mechanism can handle devices of different manufacturers and models, it is possible to consider using a device description file (such as JSON or XML format) to define the device type and the protocols it supports.
[0032] By obtaining the current communication protocol type and the device type of the communication target, you can initially understand the current communication situation with the communication target.
[0033] Step S102: determining a current communication task type and a communication quality requirement of the communication task type according to the data content to be communicated with the communication target and the device type.
[0034] For the same communication target, the communication quality requirements for communication are different depending on the tasks it is currently performing. Therefore, it is necessary to determine the current communication task type based on the data content and device type being communicated, and then determine the corresponding communication quality requirements based on the characteristics of the device type. For example, some applications (such as video surveillance and remote control) have high requirements for real-time performance and require low latency; some applications (such as sensor data upload and industrial automation) have high requirements for data transmission reliability and require low packet loss rate; and applications with high bandwidth requirements (such as high-definition video streaming and large data volume file transfer) require higher network bandwidth.
[0035] As a preferred embodiment of the present invention, step S102 specifically includes: Analyzing the data content to determine the nature of the current communication task; Determining a current communication task type from predefined communication task types according to the nature of the current communication task and the device type; The communication quality parameter items included in the communication quality requirement and the required value range of each communication quality parameter item are determined according to the current communication task type and the device type.
[0036] The analysis of data content can be carried out from one or more aspects: data format, data size, transmission cycle, and content feature extraction. Specifically, data format analysis includes checking the format of the data packet (such as JSON, XML, binary, etc.) to determine its purpose. For example, video stream data is usually in binary format, while sensor data may be in JSON or XML format. Data size analysis includes measuring the size of the data packet to determine whether it is a large file transmission or frequent small data packet transmission. For example, video stream data packets are usually large, while sensor data packets are small. Transmission cycle analysis includes analyzing the frequency of data transmission to determine whether it is periodic data transmission (such as sensor data). For example, sensor data may be sent every few seconds or minutes, while video stream data is continuous. Content feature extraction includes extracting key features in the data, such as timestamp, device ID, data type, etc., to further confirm the nature of the task. For example, if the data contains timestamp and device ID, it may be periodic monitoring data; if the data contains a large amount of image information, it may be a video stream. Assuming that the received data packet is in binary format, the data packet is large and the transmission frequency is high, the system can preliminarily determine that this is a video stream data, which belongs to the nature of the "real-time video transmission" task.
[0037] The predefined communication task types include real-time video transmission, periodic data collection, remote control, fault alarm, file transfer, voice call, etc. Taking the device type as an example, the information sent by the smart camera may be image information uploaded after real-time image collection, or it may be an alarm message sent when a device fault is detected. For image information, its communication task type is real-time video transmission, and for alarm information, its communication task type is remote control. For these two different types of communication tasks, the communication quality requirements are definitely different. The communication quality parameter items corresponding to the communication quality requirements include delay, packet loss rate, bandwidth, jitter, reliability, etc. For different communication task types, the number of communication quality parameter items included in the communication quality requirements and the value requirement range of each parameter item are also different. For example, when the communication task type is real-time video transmission, the communication quality parameter items include delay, packet loss rate, and bandwidth. The specific value requirement range is: the maximum allowable delay time is 100ms, the minimum required bandwidth is 5Mbps, and the maximum allowable packet loss rate is 1%. When the communication task type is fault alarm, the communication quality parameter items include reliability and bandwidth. The specific value requirement range is: the reliability requirement is set to ≥ 99.9%, and the minimum required bandwidth is 1Mbps.
[0038] The setting of the numerical requirement range of the communication quality parameter item may be related to the type of communication task as well as the type of device. Different types of devices have different capabilities, and the appropriate numerical requirement range should be determined in combination with the specific hardware parameters of different types of devices.
[0039] In practical applications, based on user needs, the numerical requirement range of the communication quality parameter item can also be actively adjusted to achieve the expected control effect.
[0040] Step S103, obtaining the network quality status when communicating with the communication target, and determining whether the current network quality status can meet the communication quality requirement of the communication task type.
[0041] When obtaining the network quality status, you can only obtain the parameter values corresponding to the communication quality parameter items and then compare them with the value requirement range of each communication quality parameter item, or you can obtain all parameter values and then select the parameter values corresponding to the communication quality parameter items for comparison.
[0042] Specifically, as a preferred method of the embodiment of the present invention, step S103 specifically includes: Obtaining a parameter value corresponding to the communication quality parameter item in the network quality status; Compare the obtained parameter values with the required value range of each communication quality parameter item respectively; Determine whether the parameter value can reach the required value range.
[0043] Taking the communication task type of real-time video transmission as an example, the obtained network quality status includes the current average delay, the current packet loss rate, and the current available bandwidth, which are compared with the numerical requirement range of the communication quality parameter items - the maximum allowable delay time is 100ms, the minimum required bandwidth is 5Mbps, and the maximum allowable packet loss rate is 1%.
[0044] Assume that the current network quality status is as follows: average delay: 80ms, packet loss rate: 0.5%, available bandwidth: 2Mbps; Compare these values to the required ranges for the communication quality parameter items: Average delay (80ms) < task requirement (100ms); Packet loss rate (0.5%) < task requirement (1%); Available bandwidth (2Mbps) < mission requirement (5Mbps) is out of range; It can be seen that there are situations where the numerical value of the communication quality parameter item is outside the required range. At this time, it can be determined that the current network quality status cannot meet the communication quality requirements of the communication task type. However, considering that different communication task types have different levels of attention to different communication quality parameter items, as a preferred implementation of an embodiment of the present invention, the communication quality parameter items can be classified, and the communication quality parameter items can be divided into primary parameter items and secondary parameter items. Different judgment conditions are set for the primary parameter items and the secondary parameter items, respectively, to obtain a more accurate judgment result. Specifically, the communication quality parameter items include primary parameter items and secondary parameter items, and the step of judging whether the parameter value can reach the required numerical value range specifically includes: For the main parameter items, if the parameter value corresponding to any item exceeds the required value range, it is considered that the current network quality status cannot meet the communication quality requirements of the communication task type; For the secondary parameter items, when the parameter value corresponding to any item exceeds the required value range and the difference reaches the preset parameter threshold, it is considered that the current network quality status cannot meet the communication quality requirement of the communication task type.
[0045] By distinguishing between primary and secondary parameters, we prioritize those indicators that are critical to mission success (such as latency and packet loss rate). This ensures that even in poor network conditions, critical tasks can be successfully executed.
[0046] The network quality is judged as substandard only when the main parameter items do not meet the requirements, avoiding unnecessary switching operations caused by small fluctuations in the secondary parameter items. At the same time, by distinguishing between the main and secondary parameter items, the system can dynamically adjust resource allocation according to actual needs.
[0047] It should be noted that the division of the main parameter items and the secondary parameter items corresponding to different communication task types may be different, which is related to the main focus of the communication task type when communicating.
[0048] As a preferred method of an embodiment of the present invention, considering that different application scenarios have different priorities and requirements, the division of the main parameter items and the secondary parameter items can be flexibly adjusted according to the requirements of the specific task, so that the execution of the method can better match the application scenario. On the other hand, in addition to the division of the main parameter items and the secondary parameter items, the adjustment of the communication quality parameter items also includes the dynamic adjustment of the numerical requirement range and the parameter threshold. Different numerical requirement ranges and parameter thresholds can be set according to the differences in the execution of the same type of tasks in different scenarios or the fluctuations of the network environment.
[0049] The following are some examples of common communication task types: 1. Communication task type: real-time video transmission; Main parameters: Delay - value requirement range: ≤ 100ms; Packet loss rate - numerical requirement range: ≤ 1%.
[0050] Secondary parameters: Bandwidth - value requirement range: ≥ 5Mbps; preset parameter threshold: 1Mbps; Jitter - value requirement range: ≤ 30ms; preset parameter threshold: 10ms.
[0051] 2. Communication task type: periodic data collection; Main parameters: Bandwidth - numerical requirement range: ≥ 500Kbps; Packet loss rate - numerical requirement range: ≤ 0.1%.
[0052] Secondary parameters: Delay - value requirement range: ≤ 500ms; preset parameter threshold: 100ms; Jitter - value requirement range: ≤ 100ms; preset parameter threshold: 50ms.
[0053] 3. Communication task type: fault alarm; Main parameters: Delay - value requirement range: ≤ 100ms; Packet loss rate - value requirement range: ≤ 1%; Reliability - numerical requirement range: ≥ 99.9%.
[0054] Secondary parameters: Bandwidth - Value requirement range: ≥ 1Mbps; preset parameter threshold: 200Kbps.
[0055] Step S104: If the requirement cannot be met, determine the target communication protocol type that has the highest matching degree with the communication quality requirement from the communication protocol types supported by the communication target.
[0056] According to the above steps, if it is determined that the current network quality status cannot meet the communication quality requirements of the communication task type, it means that the communication protocol type needs to be switched, so the target communication protocol type for switching needs to be determined. The selection standard of the target communication protocol type is the communication quality requirements.
[0057] Specifically, as a preferred method of the embodiment of the present invention, step S104 specifically includes: Get a list of available communication protocol types for the communication target; Determine other communication protocol types other than the current communication protocol type in the list of available communication protocol types; Calculating the matching degree of other communication protocol types with the communication quality requirement in turn; The communication protocol type with the highest matching degree is selected as the target communication protocol type.
[0058] The list of available communication protocol types of the communication target can query all the communication protocol types supported by the device from the central management system or device description file based on the unique identifier of the communication target (such as MAC address). As a preferred method, the queried communication protocol types are sorted into a list and the main performance characteristics of each protocol are recorded.
[0059] For example, suppose a device supports the following communication protocols: MQTT: low latency, high reliability, medium bandwidth; WebSocket: low latency, medium reliability, high bandwidth; HTTP: medium latency, medium reliability, medium bandwidth; These protocols and their main performance characteristics can be organized into a list to facilitate subsequent comparison and selection.
[0060] In order to determine which communication protocol is most suitable for the current task requirements, each protocol needs to be evaluated in detail. In the embodiment of the present invention, the selection is made by calculating the matching degree between the protocol and the communication quality requirement of the communication task type.
[0061] Specifically, the method for calculating the matching degree between the communication protocol type and the communication quality requirement includes: For the type of communication protocol currently being calculated, a network quality state of the communication protocol used to communicate with the communication target is estimated to obtain a parameter estimation value corresponding to the communication quality parameter item; Scoring each communication quality parameter item according to the difference between the parameter estimation value and the required value range; Based on the weight assigned to each communication quality parameter item, a weighted total score is obtained, and the higher the weighted total score is, the higher the matching degree is, wherein the weight of the main parameter item is greater than the weight of the secondary parameter item.
[0062] It should be noted that the weight assigned to each communication quality parameter item is related to its influence on the successful completion of the communication task. Therefore, the weight of the main parameter item is definitely greater than the weight of the secondary parameter item. The weights of multiple main parameter items may be the same or different.
[0063] When calculating the weighted total score, different weighting algorithms can be used. For example, the difference can be divided into stages and then scored, and then multiplied by the weight and summed up; or the score can be calculated based on the specific value of the difference, and then multiplied by the weight and summed up.
[0064] The following is a specific calculation method: S=w1×(1−∣P1−L1∣ / L1)+w2×(1−∣P2−L12∣ / L12)+… Wherein, S is the matching score, w1, w2... are the weights assigned to each communication quality parameter item, L1, L1... are the boundary values of the numerical requirement range of each communication quality parameter item, and P1, P2... are the parameter estimation values corresponding to each communication quality parameter item.
[0065] Based on the above calculation method, an example is used to illustrate the above.
[0066] It is assumed that the required range of the communication quality parameter items specifically includes: Delay: ≤ 100ms; Packet loss rate: ≤ 1%; Bandwidth: ≥ 1Mbps; Jitter: ≤ 30ms; The assigned weights are: delay 0.4, packet loss rate 0.3, bandwidth 0.2, and jitter 0.1.
[0067] The three available communication protocols MQTT, WebSocket, and HTTP for the communication target are calculated based on the parameter estimation values, specifically: 1.MQTT; Parameter estimate values: Latency: 90ms; Packet loss rate: 0.1%; Bandwidth: 1.2Mbps; Jitter: 25ms; Calculate the matching degree: S=0.4×(1-|90-100| / 100)+0.3×(1-|0.1-1| / 1)+0.2×(1-|1.2-1| / 1)+0.1×(1-|25-30| / 30)=0.783.
[0068] 2. WebSocket; Parameter estimate values: Delay: 80ms; Packet loss rate: 0.5%; Bandwidth: 2Mbps; Jitter: 35ms; Calculate the matching degree: S=0.4×(1-|80-100| / 100)+0.3×(1-|0.5-1| / 1)+0.2×(1-|2-1| / 1)+0.1×(1-|35-30| / 30)=0.613.
[0069] 3.HTTP; Parameter estimate values: Delay: 150ms; Packet loss rate: 0.8% Bandwidth: 1.5Mbps; Jitter: 40ms; Calculate the matching degree: S=0.4×(1-|150-100| / 100)+0.3×(1-|0.8-1| / 1)+0.2×(1-|1.5-1| / 1)+0.1×(1-|40-30| / 30)=0.437.
[0070] According to the above calculation results, MQTT has the highest matching degree, and MQTT is selected as the target communication protocol.
[0071] It should be noted that in actual scenarios, the calculation results of all available communication protocol types may be poor. Even if the communication protocol type with the highest calculated matching degree cannot fully meet the communication quality requirements, it is still necessary to select an optimal communication protocol type. Specifically, as a preferred implementation, if the matching degree of other communication protocol types with the communication quality requirements is less than a preset matching degree threshold, the matching degree of the current communication protocol type with the communication quality requirements is recalculated; The communication protocol type with the highest matching degree is selected from all calculated matching degrees as the target communication protocol type.
[0072] The matching threshold is used to determine whether any communication protocol can meet the communication quality requirements under the current network conditions. A reasonable matching threshold can be set according to the actual application scenario and business needs. Assuming that the matching threshold set by the system is 0.7, it means that only when the matching score of a certain communication protocol type is greater than or equal to 0.7 will it be selected as the new target communication protocol.
[0073] If the matching degree of other communication protocol types of the communication target is less than the preset matching degree threshold, it means that the current network environment is indeed bad. At this time, it is compared with the current communication protocol type again to determine whether the communication protocol type needs to be switched. If the matching degree of the calculated current communication protocol type is greater than the matching degrees of all other communication protocol types, then even if it is determined in the previous step that the current communication protocol type does not meet the communication quality requirements, the operation of switching the communication protocol type is still not performed.
[0074] As a preferred approach, the calculation of the matching degree may be retried multiple times within a certain period of time until a communication protocol type with a matching degree score greater than a matching degree threshold is successfully obtained and used as the target communication protocol.
[0075] It should be noted that when calculating the matching degree, for other communication protocol types, it depends on the parameter estimation value obtained after estimating the network quality status. Therefore, if the estimation of the parameter estimation value is approximately accurate, then the matching degree calculation result obtained is approximately accurate. In this embodiment, several different methods can be used to estimate other currently unused communication protocol types. One is a method for estimating the network quality status based on historical data, and the other is an estimation method based on the actual situation of other devices of the same type.
[0076] Specifically, the method for estimating the network quality status based on historical data includes: Acquire historical data of communicating with the communication target using the communication protocol type that needs to be calculated; Based on the historical data and current network environment parameters, the network quality status is estimated.
[0077] The historical data-based estimation method relies on historical data to predict the communication quality under the current network conditions. By analyzing the performance of a specific communication protocol under the same or similar conditions in the past, the current network quality status can be estimated. The historical data of the communication target using the type of communication protocol to be calculated is extracted from the database. Then, based on this, the historical data similar to the current task type and network environment (such as time period, geographical location, network load, etc.) is screened out.
[0078] For example, suppose you need to evaluate the performance of the MQTT protocol on a smart camera device. Query the database for historical data of the device transmitting video streams using the MQTT protocol in the past month, and filter out records in time periods with similar network loads.
[0079] For the filtered historical data, extract key features (such as latency, packet loss rate, bandwidth, jitter, etc.) from the historical data, and then use regression models (such as linear regression, time series analysis, etc.) to analyze the trends and patterns in the historical data. Finally, combine the current network load (for example, the current network load is 10% higher than the historical data) to estimate the latency and packet loss rate of the MQTT protocol under the current network conditions.
[0080] The method for estimating the network quality status based on the actual situation of other similar devices includes: Determine whether there are other devices of the same type as the communication target in the current network; Obtain the network quality status of other devices when using the communication protocol type that requires calculation to perform the same communication task type with other devices; Estimate the network quality status based on the network quality status of other devices.
[0081] The estimation method based on the actual situation of other similar devices is estimated by referring to the actual network quality status of other similar devices in the current network. Assuming that other devices are running the same type of communication tasks in the same network environment, their network quality status can provide valuable reference for the current device.
[0082] First, you can query all devices and their types in the current network from the network management system or device directory, then filter out other devices of the same type as the communication target device, and finally obtain the current network quality status (such as delay, packet loss rate, bandwidth, jitter, etc.) of other devices through the network monitoring module. For example, you can obtain data such as the delay and packet loss rate of other smart camera devices when they are currently transmitting video streams using the MQTT protocol from the network monitoring module.
[0083] When making an estimate, perform statistical analysis on the network quality status data of other devices (such as calculating the average value, standard deviation, etc.). Based on the statistical results and the specific conditions of the current device (such as location, load, etc.), estimate the network quality status of the current device. For example, the average delay of other smart camera devices currently using the MQTT protocol is calculated to be 95ms, and the average packet loss rate is 0.4%. Combined with the specific location and load of the current device, it is estimated that the delay of the current device is about 98ms, and the packet loss rate is about 0.5%.
[0084] As a preferred method, the selection of the estimation method can be dynamically adjusted according to the changes in the network environment. Monitor the changes in the current network environment (such as network load, device status, etc.) in real time. Dynamically select a more suitable estimation method according to the changes in the network status. For example, when the network environment is relatively stable, it relies more on historical data; when the network environment fluctuates greatly, it relies more on the actual operation data of the current same type of equipment.
[0085] In practical applications, these two methods can also be selected or combined according to specific circumstances to obtain a more accurate network quality status estimate. As a preferred method, a more comprehensive network quality status estimate is made by combining historical data with the actual situation of current devices of the same type. Specifically, the estimate results based on historical data and the estimate results based on the actual situation of other devices of the same type can be combined for comprehensive analysis. According to different weights (such as the credibility of historical data and the number of current devices), the results of the two methods are weighted averaged to obtain the final estimate result.
[0086] For example, if both historical data and actual operating data of current devices of the same type are used for estimation, the system assigns a 60% weight to the estimation result of historical data and a 40% weight to the estimation result of current devices of the same type, and performs a weighted average to obtain the final network quality status estimation.
[0087] Step S105: adjusting the communication protocol type for communicating with the communication target to the target communication protocol type.
[0088] Through the above steps, the target communication protocol type is determined, and the next step is to perform the specific communication protocol switching action. After confirming the target communication protocol type, it is necessary to notify the relevant system components (such as network modules, device managers, etc.) to prepare for protocol switching.
[0089] It should be noted that before switching the protocol, it is necessary to check the status of the currently ongoing task to ensure that no important data is lost or critical tasks are interrupted during the switching process. For non-critical tasks, you can temporarily pause them to allow for smooth protocol switching. For critical tasks (such as fault alarms), record their current status (such as transmission progress, sent data, etc.) so that they can be continued after the switch.
[0090] After confirming that all preparations are complete, you need to disconnect the currently used communication protocol connection to prepare for establishing a new connection. After disconnecting the current connection, you need to initialize and configure the target communication protocol to establish a new communication connection. After the new connection is successfully established, you need to resume the previously paused tasks and ensure that all tasks can continue to run normally. After completing the communication protocol switch, you need to verify whether the new connection is working properly and whether all tasks can continue to execute smoothly.
[0091] In summary, the communication module protocol control method provided by the present invention can effectively realize the dynamic selection of the optimal communication protocol according to the network status through network status monitoring, definition of evaluation criteria and protocol management. It not only improves the flexibility and adaptability of the system, but also enhances the fault tolerance and reliability of the system, ensuring stable and efficient operation in a complex and changeable Internet of Things environment.
[0092] like Figure 2 As shown, the communication module protocol control system provided by the present invention comprises: A type acquisition unit 110 is used to acquire the current communication protocol type used to communicate with a communication target and the device type of the communication target; A requirement determination unit 120, configured to determine a current communication task type and a communication quality requirement of the communication task type according to data content communicated with the communication target and the device type; The state judgment unit 130 is used to obtain the network quality state when communicating with the communication target, and judge whether the current network quality state can meet the communication quality requirement of the communication task type; The protocol determination unit 140 is used to determine the target communication protocol type with the highest matching degree with the communication quality requirement from the communication protocol types supported by the communication target if the requirement cannot be met; The protocol control unit 150 is used to adjust the communication protocol type for communicating with the communication target to the target communication protocol type.
[0093] The communication module protocol control system provided in the embodiment of the present invention is used to implement the above-mentioned communication module protocol control method, so the specific implementation method is the same as the above-mentioned method and will not be repeated here.
[0094] Through the above-mentioned communication module protocol control method, the efficiency and accuracy of the entire Internet of Things system are significantly improved at multiple levels. First, through the detailed division of primary and secondary parameter items, the system can give priority to those indicators that are critical to the success of the mission, thereby ensuring that key tasks can still be successfully completed in a complex network environment, reducing unnecessary downgrades or retry operations caused by fluctuations in secondary parameters, and improving the overall reliability of the system. Secondly, based on the estimation method of historical data and the actual situation of the same type of equipment, the system can more accurately evaluate the current network quality status, provide solid data support for protocol selection, and further enhance the scientificity and accuracy of decision-making. These measures work together to not only optimize resource utilization and reduce unnecessary system overhead, but also improve user experience, enabling the system to maintain efficient, stable and accurate operation in various complex application scenarios.
[0095] In summary, the present invention provides a communication module protocol control method and system, which can effectively realize the dynamic selection of the optimal communication protocol according to the network status through network status monitoring, definition of evaluation criteria and protocol management. It not only improves the flexibility and adaptability of the system, but also enhances the fault tolerance and reliability of the system, ensuring stable and efficient operation in a complex and changeable Internet of Things environment.
[0096] In several embodiments disclosed in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0097] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0098] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A communication module protocol control method, characterized in that: The method comprises: Acquire the current communication protocol type used to communicate with the communication target and the device type of the communication target; Determine the current communication task type and the communication quality requirement of the communication task type according to the data content communicated with the communication target and the device type; Acquire the network quality status when communicating with the communication target, and determine whether the current network quality status can meet the communication quality requirements of the communication task type; If it cannot be achieved, determining a target communication protocol type that has the highest matching degree with the communication quality requirement from the communication protocol types supported by the communication target; The communication protocol type for communicating with the communication target is adjusted to the target communication protocol type.
2. The communication module protocol control method according to claim 1, characterized in that: The step of determining the current communication task type and the communication quality requirement of the communication task type according to the data content communicated with the communication target and the device type specifically includes: Analyzing the data content to determine the nature of the current communication task; Determining a current communication task type from predefined communication task types according to the nature of the current communication task and the device type; The communication quality parameter items included in the communication quality requirement and the required value range of each communication quality parameter item are determined according to the current communication task type and the device type.
3. The communication module protocol control method according to claim 2, characterized in that: The step of obtaining the network quality status when communicating with the communication target and determining whether the current network quality status can meet the communication quality requirement of the communication task type specifically includes: Obtaining a parameter value corresponding to the communication quality parameter item in the network quality status; Compare the obtained parameter values with the required value range of each communication quality parameter item respectively; Determine whether the parameter value can reach the required value range.
4. The communication module protocol control method according to claim 3, characterized in that: The communication quality parameter items include primary parameter items and secondary parameter items, and the step of judging whether the parameter value can reach the required value range specifically includes: For the main parameter items, if the parameter value corresponding to any item exceeds the required value range, it is considered that the current network quality status cannot meet the communication quality requirements of the communication task type; For the secondary parameter items, when the parameter value corresponding to any item exceeds the required value range and the difference reaches the preset parameter threshold, it is considered that the current network quality status cannot meet the communication quality requirement of the communication task type.
5. The communication module protocol control method according to claim 4, characterized in that: The step of determining the target communication protocol type with the highest matching degree with the communication quality requirement from the communication protocol types supported by the communication target specifically includes: Get a list of available communication protocol types for the communication target; Determine other communication protocol types other than the current communication protocol type in the list of available communication protocol types; Calculating the matching degree of other communication protocol types with the communication quality requirement in turn; The communication protocol type with the highest matching degree is selected as the target communication protocol type.
6. The communication module protocol control method according to claim 5, characterized in that: The method for calculating the matching degree between the communication protocol type and the communication quality requirement specifically includes: For the communication protocol type currently being calculated, a network quality state of the communication protocol used to communicate with the communication target is estimated to obtain a parameter estimation value corresponding to the communication quality parameter item; Scoring each communication quality parameter item according to the difference between the parameter estimation value and the required value range; Based on the weight assigned to each communication quality parameter item, a weighted total score is obtained, and the higher the weighted total score is, the higher the matching degree is, wherein the weight of the main parameter item is greater than the weight of the secondary parameter item.
7. The communication module protocol control method according to claim 6, characterized in that: The method for estimating the network quality status includes: Acquire historical data of communicating with the communication target using the communication protocol type that needs to be calculated; Based on the historical data and current network environment parameters, the network quality status is estimated.
8. The communication module protocol control method according to claim 6, characterized in that: The method for estimating the network quality status includes: Determine whether there are other devices of the same type as the communication target in the current network; Obtain the network quality status of other devices when using the communication protocol type that requires calculation to perform the same communication task type with other devices; Estimate the network quality status based on the network quality status of other devices.
9. The communication module protocol control method according to claim 6, characterized in that: The method further comprises: If the matching degree between other communication protocol types and the communication quality requirement is less than a preset matching degree threshold, recalculating the matching degree between the current communication protocol type and the communication quality requirement; The communication protocol type with the highest matching degree is selected from all calculated matching degrees as the target communication protocol type.
10. A communication module protocol control system, characterized in that: include: A type acquisition unit, used to acquire the current communication protocol type used to communicate with the communication target and the device type of the communication target; A requirement determination unit, configured to determine a current communication task type and a communication quality requirement of the communication task type according to data content to be communicated with the communication target and the device type; A state judgment unit, used to obtain the network quality state when communicating with the communication target, and judge whether the current network quality state can meet the communication quality requirements of the communication task type; a protocol determination unit, configured to determine, if the requirement cannot be met, a target communication protocol type that has the highest matching degree with the communication quality requirement from the communication protocol types supported by the communication target; The protocol control unit is used to adjust the communication protocol type for communicating with the communication target to the target communication protocol type.
Citation Information
Patent Citations
Communication control method and device
CN114449059A
Control method of intelligent traffic system based on automatic protocol docking
CN119479336A
Method and device for measuring the quality of at least one internet protocol service
WO2006008349A1
Cited By
Communication protocol configuration optimization method and device, electronic equipment and storage medium
CN120711082A
Equipment configuration method and device, electronic equipment and readable storage medium
CN121037209A
Communication method and communication system
CN121334041A
Dynamic adaptation method for multi-mode functional module of intelligent fusion terminal
CN122027713A