Method and system for adjusting communication strategy, storage medium and wireless gateway
By grouping and simulating sensors in a wireless communication system and adjusting their communication strategies, the problem of degraded communication performance between the wireless gateway and sensors was solved, thereby improving communication performance and network stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2026-03-24
AI Technical Summary
In existing wireless communication systems, when the communication performance between wireless gateways and sensors deteriorates, data packet loss is severe, leading to a decline in network stability and communication performance. Existing retransmission methods exacerbate this performance degradation, and there is a lack of effective technical solutions to improve communication performance.
By monitoring communication performance indicators, grouping sensors and performing simulation analysis on their communication strategies, adjustments are made to optimize communication strategies to improve performance, including clock synchronization, retransmission, collision detection, frequency switching, switching communication methods, and multi-channel backup.
It effectively improves the communication performance between the wireless gateway and the sensor, solves the problem of communication performance degradation, and improves the stability and communication efficiency of the network.
Smart Images

Figure CN114679695B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communications, and more specifically, to a method and system for adjusting a communication strategy, a storage medium, and a wireless gateway. Background Technology
[0002] In existing wireless communication systems (specifically referring to wireless communication systems with sensors and gateways), the wireless gateway can collect statistics on the wireless communication performance indicators of all its subordinate sensors, and each sensor can also collect its own wireless communication performance indicators. When the performance of the wireless link between the gateway and the sensors deteriorates, it can lead to the loss of data packets transmitted in the wireless communication system.
[0003] In related technologies, the common approach is to use "retransmission," repeatedly sending lost data packets in the hope that at least one packet will be successfully transmitted among the retransmitted packets. However, this method exacerbates the decline in wireless link performance, thereby affecting the stability of the entire network architecture and negatively impacting the overall network communication performance.
[0004] Regarding the issue of how to effectively improve communication performance when the communication performance between wireless gateways and sensors degrades, no effective technical solution has yet been proposed. Summary of the Invention
[0005] This invention provides a method and system for adjusting communication strategies, a storage medium, and a wireless gateway, to at least address the problem in related technologies of how to effectively improve communication performance when the communication performance between a wireless gateway and a sensor degrades.
[0006] According to an embodiment of the present invention, a method for adjusting a communication strategy is provided, comprising: when a first communication performance index of a target network is detected to be less than a preset threshold, or when an adjustment request is received from a target sensor, grouping all sensors in the target network according to the communication strategies supported by all sensors to obtain multiple groups, wherein the sensors in each of the multiple groups support at least one identical communication strategy, the target network includes: a wireless gateway, all sensors connected to the wireless gateway, and the multiple sensors include: the target sensor; performing simulation analysis on the adjustment method of changing the first communication strategy supported by the sensors in the first group of the multiple groups to a second communication strategy, obtaining a first simulation analysis result of the second communication performance index of the target network; and when the first simulation analysis result indicates that the second communication performance index is greater than the preset threshold, determining to adjust the first communication strategy supported by the sensors in the first group to the second communication strategy.
[0007] Further, in an exemplary embodiment, after performing simulation analysis on the adjustment method of changing the first communication strategy supported by the sensors of the first group in the plurality of groups to the second communication strategy, and obtaining a first simulation analysis result of the second communication performance index of the target network, the method further includes: if the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, performing simulation analysis on the adjustment method of changing the second communication strategy supported by the sensors of the second group in the plurality of groups to the third communication strategy, and obtaining a second simulation analysis result of the third communication performance index of the target network; if the second simulation analysis result indicates that the third communication performance index is greater than the preset threshold, determining to adjust the second communication strategy supported by the sensors of the second group to the third communication strategy.
[0008] Further, in an exemplary embodiment, after performing simulation analysis on the adjustment method of changing the first communication strategy supported by the sensors of the first group in the plurality of groups to the second communication strategy, and obtaining a first simulation analysis result of the second communication performance index of the target network, the method further includes: when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, performing simulation analysis on the adjustment method of changing the second communication strategy supported by the sensors of the first group to the fourth communication strategy, and obtaining a third simulation analysis result of the fourth communication performance index of the target network, wherein the sensors of the first group support at least the first adjustment strategy, the second adjustment strategy, and the fourth adjustment strategy; when the third simulation analysis result indicates that the third communication performance index is greater than the preset threshold, determining that the second communication strategy supported by the sensors of the first group is adjusted to the fourth communication strategy.
[0009] Furthermore, in an exemplary embodiment, before performing simulation analysis on the adjustment method of the first communication strategy supported by the sensors of the first group in the plurality of groups to the second communication strategy, and obtaining the first simulation analysis result of the second communication performance index of the target network, the method further includes: sorting the plurality of groups according to the number of sensors in each group or the number of communication strategies supported by the sensors in each group in the plurality of groups; and determining the group with the most sensors in the sorted plurality of groups as the first group.
[0010] Further, in an exemplary embodiment, simulation analysis is performed on the adjustment method of the first communication strategy supported by the sensors of the first group in the plurality of groups to the second communication strategy, to obtain a first simulation analysis result of the second communication performance index of the target network. This includes: determining the sensor type of the sensors in the first group, and determining the simulation algorithm of the sensors in the first group according to the sensor type; determining the second communication performance index of the sensors in the first group using the second adjustment strategy according to the simulation algorithm, wherein the second communication performance index includes at least one of the following: packet loss rate, communication success rate, and communication latency; and determining the first simulation analysis result of the second communication performance index of the target network according to the second communication performance index.
[0011] Further, in an exemplary embodiment, when the second communication performance indicator includes the packet loss rate, determining the second communication performance indicator of the sensor of the first group adopting the second adjustment strategy according to the simulation algorithm includes: obtaining the first number of packets sent and the first number of packets lost by the sensor of the first group within a preset time period; when it is determined that the sensor of the first group supports collision detection, determining the collision detection delay corresponding to the sensor of the first group and the second number of packets lost within the preset time period, wherein the second number of packets lost is obtained from the first number of packets lost; when it is determined that the sensor of the first group supports retransmission, determining the second number of packets sent and the third number of packets lost within a simulated retransmission time period corresponding to the sensor of the first group, wherein the second number of packets sent is the number of retransmission packets sent by the sensor of the first group within the simulated retransmission time period; determining the packet loss rate as the ratio of the first value and the second value, wherein the first value is the difference between the sum of the first number of packets sent and the second number of packets sent and the difference between the second number of packets lost and the third number of packets lost; the second value is the sum of the first number of packets sent and the second number of packets sent.
[0012] Furthermore, in an exemplary embodiment, the method further includes: determining the first packet loss quantity by: determining a first time set of sensor-transmitted messages of the first group, wherein each element in the first time set represents the transmission time when the sensor of the first group transmits a message, and the number of elements in the first time set is the first packet loss quantity;
[0013] The first and second adjacent element values of each element in the first time set are determined, wherein the difference between the sending time of each element and the sending time corresponding to the first adjacent element value is less than or equal to a preset unit time, and the difference between the sending time corresponding to the second adjacent element value and the sending time of each element is less than or equal to a preset unit time; the combined result of the first and second adjacent element values of multiple elements is determined as a second time set, wherein the number of elements in the second time set is the first packet loss number, and the second time set includes a first subset and a second subset, wherein the first subset is the combined result of the first adjacent element values of multiple elements, and the second subset is the combined result of the second adjacent element values of multiple elements.
[0014] Further, in an exemplary embodiment, the method further includes: determining the second packet loss quantity by: when it is determined that the sensor of the first group supports collision detection, updating the second neighboring element value in the second subset according to the collision detection delay, and updating the first neighboring element value and the second neighboring element value of each element in the first time set in real time; determining the first neighboring element value and the second neighboring element value of each element in the current first time set; determining the merging result of the first neighboring element value and the second neighboring element value of multiple elements as a third time set, wherein the number of elements in the third time set is the second packet loss quantity.
[0015] Further, in an exemplary embodiment, the method further includes: determining the third packet loss quantity by: when it is determined that the sensor of the first group supports retransmission, updating the first adjacent element value in the first subset according to the simulated retransmission time period to obtain the fourth adjacent element value, and determining the merged result of multiple fourth adjacent element values as the third subset; updating the second adjacent element value in the second subset according to the simulated retransmission time period to obtain the fifth adjacent element value, and determining the merged result of multiple fifth adjacent element values as the fourth subset; wherein, the sum of the number of elements in the third subset and the number of elements in the fourth subset is the first group's... The number of retransmitted packets by the sensor; merging the third subset, the fourth subset, and the first time set to obtain a fourth time set; determining the sixth and seventh adjacent element values of each element in the fourth time set, and determining the merged result of multiple sixth and seventh adjacent element values as a fifth time set, wherein the number of elements in the fifth time set is the third number of packet losses, the difference between the transmission time of each element and the transmission time corresponding to the sixth adjacent element value is less than or equal to a preset unit time, and the difference between the transmission time corresponding to the seventh adjacent element value and the transmission time of each element is less than or equal to a preset unit time.
[0016] Further, in an exemplary embodiment, when the second communication performance indicator includes the packet loss rate, determining the second communication performance indicator of the sensor of the first group adopting the second adjustment strategy according to the simulation algorithm includes: obtaining the first number of packets sent and the first number of packets lost by the sensor of the first group within a preset time period; if it is determined that the sensor of the first group does not support collision detection, and if it is determined that the sensor of the first group supports retransmission, determining the second number of packets sent and the third number of packets lost within the simulated retransmission time period corresponding to the sensor of the first group, wherein the second number of packets sent is the number of retransmission packets sent by the sensor of the first group within the simulated retransmission time period; determining the packet loss rate as the ratio of the first value and the second value, wherein the first value is the difference between the first number of packets sent and the difference between the second number of packets lost and the third number of packets lost; and the second value is the first number of packets sent.
[0017] Furthermore, in an exemplary embodiment, when the second communication performance indicator includes the packet loss rate, determining the second communication performance indicator of the sensor of the first group adopting the second adjustment strategy according to the simulation algorithm includes: obtaining the first number of packets sent and the first number of packets lost by the sensor of the first group within a preset time period; and determining the ratio of the first number of packets sent to the first number of packets lost as the packet loss rate when it is determined that the sensor of the first group does not support retransmission.
[0018] Furthermore, in an exemplary embodiment, all sensors within the target network are grouped according to the communication strategies supported by all sensors to obtain multiple groups, including: obtaining the communication strategy supported by each of the sensors; and grouping sensors that all support at least one of the same communication strategies into the same group to obtain the multiple groups.
[0019] According to another embodiment of the present invention, a communication strategy adjustment system is provided, comprising: a wireless gateway, and all sensors connected to the wireless gateway, wherein the wireless gateway is configured to, upon detecting that a first communication performance index of a target network is less than a preset threshold, or upon receiving an adjustment request from a target sensor, group all sensors in the target network according to the communication strategies supported by all sensors, resulting in multiple groups, wherein the sensors in each of the multiple groups support at least one identical communication strategy, the target network comprising: the wireless gateway, and all sensors connected to the wireless gateway, the multiple sensors comprising: the target sensor; the wireless gateway is further configured to perform simulation analysis on the adjustment method of the first communication strategy supported by the sensors in a first group of the multiple groups to a second communication strategy, obtaining a first simulation analysis result of the second communication performance index of the target network; and, if the first simulation analysis result indicates that the second communication performance index is greater than the preset threshold, determine to adjust the first communication strategy supported by the sensors in the first group to the second communication strategy.
[0020] Further, in an exemplary embodiment, the wireless gateway includes: a communication strategy adjustment unit, wherein the communication strategy adjustment unit is configured to perform simulation analysis on the adjustment method of adjusting the second communication strategy supported by the sensors of the second group in the plurality of groups to a third communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, to obtain a second simulation analysis result of the third communication performance index of the target network; and to determine that the second communication strategy supported by the sensors of the second group is adjusted to a third communication strategy when the second simulation analysis result indicates that the third communication performance index is greater than the preset threshold.
[0021] Further, in an exemplary embodiment, the wireless gateway includes: a communication strategy adjustment unit, wherein the communication strategy adjustment unit is configured to perform simulation analysis on the adjustment method of the second communication strategy supported by the sensors of the first group to a fourth communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, to obtain a third simulation analysis result of the fourth communication performance index of the target network, wherein the sensors of the first group support at least the first adjustment strategy, the second adjustment strategy, and the fourth adjustment strategy; and when the third simulation analysis result indicates that the third communication performance index is greater than the preset threshold, to determine that the second communication strategy supported by the sensors of the first group is adjusted to the fourth communication strategy.
[0022] Furthermore, in an exemplary embodiment, the wireless gateway includes: a plurality of data transmission backup units, wherein the plurality of data transmission backup units are respectively configured to support a plurality of communication strategies corresponding to all the sensors.
[0023] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the method described above when executed.
[0024] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs the method described above through the computer program.
[0025] This invention addresses the problem in related technologies of effectively improving communication performance when the communication performance between a wireless gateway and a sensor deteriorates, by grouping all sensors within the target network according to the communication strategies supported by all sensors when a first communication performance indicator of the target network is detected to be less than a preset threshold, or by receiving an adjustment request from a target sensor. The invention then simulates and analyzes the adjustment method of the first group of sensors to change from the first communication strategy to the second communication strategy, obtaining a first simulation analysis result for the second communication performance indicator of the target network. If the first simulation analysis result indicates that the second communication performance indicator is greater than the preset threshold, it determines that the first communication strategy supported by the sensors in the first group should be adjusted to the second communication strategy. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0027] Figure 1 This is a hardware structure block diagram of a computer terminal for adjusting a communication strategy according to an embodiment of the present invention.
[0028] Figure 2 This is a schematic diagram of a communication strategy adjustment system according to an embodiment of the present invention;
[0029] Figure 3 A flowchart illustrating the method for adjusting the communication strategy according to embodiments of the present invention;
[0030] Figure 4 This is a schematic diagram of the functional modules of a communication strategy adjustment system according to an embodiment of the present invention;
[0031] Figure 5 This is a flowchart illustrating the smart gateway adjustment strategy according to an embodiment of the present invention;
[0032] Figure 6 This is a simulation flowchart for analyzing communication performance based on packet loss rate according to an embodiment of the present invention;
[0033] Figure 7 This is a flowchart illustrating the intelligent sensor adjustment strategy according to an embodiment of the present invention. Detailed Implementation
[0034] The present invention will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the present application can be combined with each other.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0036] It should be understood that the data used in this way can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in a sequence other than those illustrated or described herein. Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0037] The methods and embodiments provided in this application can be executed on a computer terminal, wireless gateway, or similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal for the communication strategy adjustment method according to an embodiment of the present invention. For example... Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor unit (MPU) or a programmable logic device (PLD)) and a memory 104 for storing data are also shown. In one exemplary embodiment, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 Equivalent functions or ratios shown Figure 1 The functions shown have more different configurations.
[0038] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the communication strategy adjustment method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0039] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0040] According to another embodiment of the present invention, a communication strategy adjustment system is provided, which is used to implement the above embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function.
[0041] This invention provides a schematic diagram of a communication strategy adjustment system. Figure 2 This is a schematic diagram of a communication strategy adjustment system according to an embodiment of the present invention, such as... Figure 2 As shown, the communication strategy adjustment system includes: a wireless gateway 202, all sensors 204 connected to the wireless gateway, and a target network 206.
[0042] In one embodiment, the wireless gateway 202 is used to group all sensors within the target network 206 according to the communication strategies supported by all sensors when it detects that a first communication performance index of the target network 206 is less than a preset threshold, or when it receives an adjustment request sent by the target sensor, to obtain multiple groups. In each of the multiple groups, the sensors in each group support at least one of the same communication strategies. The target network includes: the wireless gateway 202, and all sensors 204 connected to the wireless gateway. The all sensors include: the target sensor.
[0043] It should be noted that communication performance indicators can be understood as reflecting the communication performance during the communication process. For example, communication performance indicators can reflect communication performance from the effectiveness and reliability of information transmission.
[0044] It should be noted that the communication strategy can be understood as the communication method for information transmission between the sensor and the gateway, including clock synchronization, retransmission, collision detection, frequency switching, switching communication methods, frequency hopping, multi-channel backup, etc., but is not limited to these.
[0045] The wireless gateway 202 is further configured to perform simulation analysis on the adjustment method of the first communication strategy supported by the sensors of the first group in the plurality of groups to the second communication strategy, and obtain the first simulation analysis result of the second communication performance index of the target network; and when the first simulation analysis result indicates that the second communication performance index is greater than the preset threshold, determine to adjust the first communication strategy supported by the sensors of the first group to the second communication strategy.
[0046] The system described above, upon detecting that a first communication performance indicator of the target network is less than a preset threshold, or upon receiving an adjustment request from a target sensor, groups all sensors within the target network according to the communication strategies supported by all sensors, resulting in multiple groups. Simulation analysis is then performed on the adjustment method of changing the first communication strategy supported by the sensors in the first group to the second communication strategy, yielding a first simulation analysis result for the second communication performance indicator of the target network. If the first simulation analysis result indicates that the second communication performance indicator is greater than the preset threshold, it is determined that the first communication strategy supported by the sensors in the first group should be adjusted to the second communication strategy. This solves the problem in related technologies of how to effectively improve communication performance when the communication performance between the wireless gateway and the sensor deteriorates.
[0047] It should be noted that the aforementioned preset threshold can be a threshold pre-set according to the communication strategy supported by the sensor, or a threshold for communication performance specified by the customer. The preset threshold is variable, and the present invention does not limit the value of the preset threshold.
[0048] Optionally, in an exemplary embodiment, the wireless gateway includes: a communication strategy adjustment unit, wherein the communication strategy adjustment unit is configured to perform simulation analysis on the adjustment method of the second communication strategy supported by the sensors of the second group among the plurality of groups to a third communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, to obtain a second simulation analysis result of the third communication performance index of the target network; and to determine to adjust the second communication strategy supported by the sensors of the second group to a third communication strategy when the second simulation analysis result indicates that the third communication performance index is greater than the preset threshold.
[0049] Optionally, in an exemplary embodiment, the wireless gateway includes: a communication strategy adjustment unit, wherein the communication strategy adjustment unit is configured to perform simulation analysis on the adjustment method of the second communication strategy supported by the sensors of the first group to the fourth communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, to obtain a third simulation analysis result of the fourth communication performance index of the target network, wherein the sensors of the first group support at least the first adjustment strategy, the second adjustment strategy, and the fourth adjustment strategy; and when the third simulation analysis result indicates that the third communication performance index is greater than the preset threshold, to determine that the second communication strategy supported by the sensors of the first group is adjusted to the fourth communication strategy.
[0050] Optionally, in an exemplary embodiment, the wireless gateway includes: a plurality of data transmission backup units, wherein the plurality of data transmission backup units are respectively configured to support a plurality of communication strategies corresponding to all the sensors.
[0051] This invention provides a method for adjusting a communication strategy. Figure 3 A flowchart illustrating the method for adjusting the communication strategy according to embodiments of the present invention is shown below. Figure 3 As shown, it includes:
[0052] Step S302: When the first communication performance index of the target network is detected to be less than a preset threshold, or when an adjustment request is received from the target sensor, all sensors in the target network are grouped according to the communication strategies supported by all sensors to obtain multiple groups. In each of the multiple groups, the sensors in each group support at least one of the same communication strategies. The target network includes: a wireless gateway, and all sensors connected to the wireless gateway. All sensors include: the target sensor.
[0053] It should be noted that communication performance indicators can be understood as reflecting the communication performance during the communication process. For example, communication performance indicators can reflect communication performance from the effectiveness and reliability of information transmission.
[0054] It should be noted that the communication strategy can be understood as the communication method for information transmission between the sensor and the gateway, including clock synchronization, retransmission, collision detection, frequency switching, switching communication methods, frequency hopping, multi-channel backup, etc., but is not limited to these.
[0055] Step S304: Perform simulation analysis on the adjustment method of the first communication strategy supported by the sensor of the first group in the plurality of groups to the second communication strategy, and obtain the first simulation analysis result of the second communication performance index of the target network.
[0056] Step S306: If the first simulation analysis result indicates that the second communication performance index is greater than the preset threshold, determine to adjust the first communication strategy supported by the sensors in the first group to the second communication strategy.
[0057] It should be noted that the aforementioned preset threshold can be a threshold pre-set according to the communication strategy supported by the sensor, or a threshold for communication performance specified by the customer. The preset threshold is variable, and the present invention does not limit the value of the preset threshold.
[0058] This invention addresses the problem in related technologies of effectively improving communication performance when the communication performance between a wireless gateway and a sensor deteriorates, by grouping all sensors within the target network according to the communication strategies supported by all sensors when a first communication performance indicator of the target network is detected to be less than a preset threshold, or by receiving an adjustment request from a target sensor. The invention then simulates and analyzes the adjustment method of the first group of sensors to change from the first communication strategy to the second communication strategy, obtaining a first simulation analysis result for the second communication performance indicator of the target network. If the first simulation analysis result indicates that the second communication performance indicator is greater than the preset threshold, it determines that the first communication strategy supported by the sensors in the first group should be adjusted to the second communication strategy.
[0059] Optionally, in an exemplary embodiment, a technical solution is also provided after performing simulation analysis on the adjustment method of changing the first communication strategy supported by the sensor of the first group in the plurality of groups to the second communication strategy, and obtaining the first simulation analysis result of the second communication performance index of the target network. The specific steps include: if the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, that is, if after using the adjustment method of changing the first communication strategy to the second communication strategy, the first simulation analysis result indicates that the second communication performance index is still less than the preset threshold, the communication strategy can be further adjusted in the following ways:
[0060] 1) Simulation analysis is performed on the adjustment method of the second communication strategy supported by the sensors of the second group in the plurality of groups to the third communication strategy, and a second simulation analysis result of the third communication performance index of the target network is obtained; when the second simulation analysis result indicates that the third communication performance index is greater than the preset threshold, it is determined that the second communication strategy supported by the sensors of the second group is adjusted to the third communication strategy. In this embodiment of the invention, by continuing to adjust the second communication strategy supported by the sensors of the second group to the third communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, the accuracy and reliability of the communication strategy adjustment result can be improved. The sensors of the second group support at least the first communication strategy, the second communication strategy and the third communication strategy.
[0061] 2) Simulation analysis is performed on the adjustment method of changing the second communication strategy supported by the sensors of the first group to the fourth communication strategy to obtain the third simulation analysis result of the fourth communication performance index of the target network. The sensors of the first group support at least the first adjustment strategy, the second adjustment strategy, and the fourth adjustment strategy. When the third simulation analysis result indicates that the third communication performance index is greater than the preset threshold, it is determined that the second communication strategy supported by the sensors of the first group will be adjusted to the fourth communication strategy. In this embodiment of the invention, by continuing to adjust the second communication strategy supported by the sensors of the first group to the fourth communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, the accuracy and reliability of the communication strategy adjustment result can be improved.
[0062] Furthermore, if the sensors in the first group support at least the first communication strategy, the second communication strategy, the fourth communication strategy, and the fifth communication strategy, the accuracy of the adjustment result can be improved by sequentially adjusting the sensors in the first group from the first communication strategy to the fifth communication strategy. The present invention does not limit the number of communication strategies.
[0063] In an exemplary embodiment, before performing simulation analysis on the adjustment method of the first communication strategy supported by the sensors of the first group in the plurality of groups to the second communication strategy, and obtaining the first simulation analysis result of the second communication performance index of the target network, a technical solution is also provided. The specific steps include: sorting the plurality of groups according to the number of sensors in each group or the number of communication strategies supported by the sensors in each group in the plurality of groups; and determining the group with the most sensors in the sorted plurality of groups as the first group.
[0064] In an exemplary embodiment, to better understand how step S304 implements the simulation analysis of adjusting the first communication strategy supported by the sensors of the first group in the plurality of groups to the second communication strategy, and to obtain the first simulation analysis result of the second communication performance index of the target network, the sensor type of the sensors in the first group can be determined, and the simulation algorithm of the sensors in the first group can be determined according to the sensor type; the second communication performance index of the sensors in the first group using the second adjustment strategy can be determined according to the simulation algorithm, wherein the second communication performance index includes at least one of the following: packet loss rate, communication success rate, and communication latency; and the first simulation analysis result of the second communication performance index of the target network can be determined according to the second communication performance index.
[0065] In one exemplary embodiment, several technical solutions are provided for determining the second communication performance index of a sensor employing the second adjustment strategy for a first group based on the simulation algorithm when the second communication performance index includes the packet loss rate. These solutions are as follows:
[0066] Option 1: Obtain the first packet transmission count and the first packet loss count of the sensors in the first group within a preset time period; if it is determined that the sensors in the first group support collision detection, determine the collision detection delay corresponding to the sensors in the first group and the second packet loss count within the preset time period, wherein the second packet loss count is obtained from the first packet loss count; if it is determined that the sensors in the first group support retransmission, determine the second packet transmission count and the third packet loss count within a simulated retransmission time period corresponding to the sensors in the first group, wherein the second packet transmission count is the number of retransmission packets sent by the sensors in the first group within the simulated retransmission time period; determine the packet loss rate as the ratio of the first value and the second value, wherein the first value is the difference between the sum of the first packet transmission count and the second packet transmission count and the difference between the second packet loss count and the third packet loss count; the second value is the sum of the first packet transmission count and the second packet loss count.
[0067] Option 2: Obtain the first packet transmission count and the first packet loss count of the sensors in the first group within a preset time period; if it is determined that the sensors in the first group do not support collision detection, and if it is determined that the sensors in the first group support retransmission, determine the second packet transmission count and the third packet loss count within the simulated retransmission time period corresponding to the sensors in the first group, wherein the second packet transmission count is the number of retransmission packets sent by the sensors in the first group within the simulated retransmission time period; determine the ratio of the first value and the second value as the packet loss rate, wherein the first value is the difference between the first packet transmission count and the difference between the second packet loss count and the third packet loss count; the second value is the first packet transmission count.
[0068] Option 3: Obtain the number of first packets sent and the number of first packets lost by the sensors in the first group within a preset time period; if it is determined that the sensors in the first group do not support retransmission, determine the ratio of the number of first packets sent to the number of first packets lost as the packet loss rate.
[0069] Further, in an exemplary embodiment, the first packet loss count can be determined by: determining a first time set of sensor-transmitted messages in the first group, where each element in the first time set represents the transmission time of the sensor-transmitted message in the first group, wherein the number of elements in the first time set is the first packet loss count; determining the first adjacent element value and the second adjacent element value of each element in the first time set, wherein the difference between the transmission time of each element and the transmission time corresponding to the first adjacent element value is less than or equal to a preset unit time, and the difference between the transmission time corresponding to the second adjacent element value and the transmission time of each element is less than or equal to a preset unit time; determining a second time set by merging the first adjacent element values and the second adjacent element values of multiple elements, wherein the number of elements in the second time set is the first packet loss count, and the second time set includes a first subset and a second subset, wherein the first subset is the merged result of the first adjacent element values of multiple elements, and the second subset is the merged result of the second adjacent element values of multiple elements.
[0070] It should be noted that the sending time corresponding to the first adjacent element value is earlier than the sending time of each element, and the sending time corresponding to the second adjacent element value is later than the sending time of each element.
[0071] Further, in an exemplary embodiment, the second packet loss quantity can be determined by: when it is determined that the sensor of the first group supports collision detection, updating the second neighboring element value in the second subset according to the collision detection delay, and updating the first neighboring element value and the second neighboring element value of each element in the first time set in real time; determining the first neighboring element value and the second neighboring element value of each element in the current first time set; and determining the merging result of the first neighboring element value and the second neighboring element value of multiple elements as a third time set, wherein the number of elements in the third time set is the second packet loss quantity.
[0072] Further, in an exemplary embodiment, the third packet loss count can be determined as follows: If it is determined that the sensors in the first group support retransmission, the values of the first adjacent elements within the first subset are updated according to the simulated retransmission time period to obtain the values of the fourth adjacent elements, and the combined result of multiple fourth adjacent element values is determined to be the third subset; the values of the second adjacent elements within the second subset are updated according to the simulated retransmission time period to obtain the values of the fifth adjacent elements, and the combined result of multiple fifth adjacent element values is determined to be the fourth subset; wherein the sum of the number of elements in the third subset and the number of elements in the fourth subset is the number of sensors in the first group. The number of retransmitted packets; merging the third subset, the fourth subset, and the first time set to obtain a fourth time set; determining the sixth and seventh adjacent element values of each element in the fourth time set, and determining the merged result of multiple sixth and seventh adjacent element values as a fifth time set, wherein the number of elements in the fifth time set is the third number of packet losses, the difference between the sending time of each element and the sending time corresponding to the sixth adjacent element value is less than or equal to a preset unit time, and the difference between the sending time corresponding to the seventh adjacent element value and the sending time of each element is less than or equal to a preset unit time.
[0073] It should be noted that the sending time of the sixth adjacent element value is earlier than the sending time of each element, and the sending time of the seventh adjacent element value is later than the sending time of each element.
[0074] In an exemplary embodiment, to better understand how to group all sensors in the target network according to the communication strategies supported by all sensors in step S302 to obtain multiple groups, the communication strategies supported by each of the sensors can be obtained; sensors that all support at least one of the same communication strategies are grouped into the same group to obtain the multiple groups.
[0075] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0076] Next, the method for adjusting the communication strategy of the present invention will be described with reference to the following embodiments.
[0077] Figure 4 This is a schematic diagram of the functional modules of a communication strategy adjustment system according to an embodiment of the present invention. Figure 4 As shown, the communication strategy adjustment system includes a wireless gateway function module 402 and a smart sensor function module 404. The wireless gateway function module 402 is used to implement the above... Figure 2 The wireless gateway 202 in the above-mentioned functions, and the smart sensor function module 404 are used to implement the above-mentioned functions. Figure 2 The function of sensor 204 in the middle.
[0078] The wireless gateway function module 402 includes: a first device control unit 4022, a gateway data processing unit 4024, a first communication monitoring unit 4026, a first data transmission main unit 4028, a first data transmission backup unit 4030, and a communication strategy adjustment main unit 4032.
[0079] The intelligent sensor functional module 404 includes: a second device control unit 4042, a data acquisition unit 4044, a second communication monitoring unit 4046, a second data transmission main unit 4048, a second data transmission backup unit 4050, and a communication strategy adjustment sub-unit 4052.
[0080] The first device control unit 4022 is used to control the gateway data processing unit 4024, the first communication monitoring unit 4026, the first data transmission main unit 4028, the first data transmission backup unit 4030, and the communication strategy adjustment main unit 4032 in the wireless gateway function module 402, and to control the first device control unit 4042, the gateway data processing unit 4044, the second communication monitoring unit 4046, the second data transmission main unit 4048, the second data transmission backup unit 4050, and the communication strategy adjustment sub-unit 4052 in the intelligent sensor function module 404.
[0081] The gateway data processing unit 4024 is responsible for processing the data received by the gateway.
[0082] The first communication monitoring unit 4026 is used to monitor the wireless communication performance between the wireless gateway and the smart sensor functional module 404. For example, the wireless communication performance can be monitored by monitoring communication performance indicators such as signal quality, communication success rate, and communication latency.
[0083] The first data transmission master unit 4028 is used to exchange communication data with the second data transmission master unit 4048 in the smart sensor function module 404.
[0084] The first data transmission backup unit 4030 is used to support multiple communication strategies corresponding to the multiple sensors mentioned above. N represents the type of communication strategy that can be supported. N is a natural number. The data transmission cost of the first data transmission backup unit 4030 is related to the type of communication strategy supported by the first data transmission backup unit 4030. Different types of communication strategies correspond to different data transmission costs.
[0085] In an optional embodiment of the present invention, the communication strategy adjustment main unit 4032 has a simulation analysis function, which can perform simulation analysis on the adjustment method of the first communication strategy supported by the sensor corresponding to the intelligent sensor function module 404 to the second communication strategy, and obtain the simulation analysis result of the second communication performance index of the target network formed by the wireless gateway function module 402 and the intelligent sensor function module 404. When the simulation analysis result indicates that the second communication performance index is less than the preset threshold, the unit performs simulation analysis on the adjustment method of the second communication strategy supported by the sensor corresponding to the intelligent sensor function module 404 to the third communication strategy, and obtains the second simulation analysis result of the third communication performance index of the target network; and when the second simulation analysis result indicates that the third communication performance index is greater than the preset threshold, the unit determines to adjust the second communication strategy supported by the sensor corresponding to the intelligent sensor function module 404 to the third communication strategy.
[0086] In an optional embodiment of the present invention, the communication strategy adjustment main unit 4032 is further configured to, when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, perform simulation analysis on the adjustment method of the second communication strategy supported by the sensor corresponding to the intelligent sensor function module 404 to the fourth communication strategy, and obtain a third simulation analysis result of the fourth communication performance index of the target network, wherein the sensor corresponding to the intelligent sensor function module 404 supports at least the first adjustment strategy, the second adjustment strategy, and the fourth adjustment strategy; when the third simulation analysis result indicates that the third communication performance index is greater than the preset threshold, determine to adjust the second communication strategy supported by the sensor corresponding to the intelligent sensor function module 404 to the fourth communication strategy.
[0087] The second device control unit 4042 is used to implement the control process of the second device control unit 4042, data acquisition unit 4044, second communication monitoring unit 4046, second data transmission main unit 4048, second data transmission backup unit 4050, and communication strategy adjustment sub-unit 4052 in the intelligent sensor function module 404.
[0088] The data acquisition unit 4044 is used to acquire the raw data of the sensor corresponding to the intelligent sensor function module 404.
[0089] The second communication monitoring unit 4046 is used to monitor the wireless communication performance of the sensor corresponding to the smart sensor function module 404.
[0090] The second data transmission backup unit 4050 is used to provide the communication strategies that the sensor corresponding to the smart sensor function module 404 can support.
[0091] The communication strategy adjustment sub-unit 4052 is used to receive the communication strategy adjustment command sent by the communication strategy adjustment master unit 4032 to realize the communication strategy adjustment process of the sensor corresponding to the intelligent sensor function module 404.
[0092] The system described above, upon detecting that a first communication performance indicator of the target network is less than a preset threshold, or upon receiving an adjustment request from a target sensor, groups all sensors within the target network according to the communication strategies supported by all sensors, resulting in multiple groups. Simulation analysis is then performed on the adjustment method of changing the first communication strategy supported by the sensors in the first group to the second communication strategy, yielding a first simulation analysis result for the second communication performance indicator of the target network. If the first simulation analysis result indicates that the second communication performance indicator is greater than the preset threshold, it is determined that the first communication strategy supported by the sensors in the first group should be adjusted to the second communication strategy. This solves the problem in related technologies of how to effectively improve communication performance when the communication performance between the wireless gateway and the sensor deteriorates.
[0093] In an exemplary embodiment, the communication strategy adjustment main unit 4032 is further configured to: obtain the first number of packets sent and the first number of packets lost by the sensors of the first group within a preset time period; if it is determined that the sensors of the first group support collision detection, determine the collision detection delay corresponding to the sensors of the first group and the second number of packets lost within the preset time period, wherein the second number of packets lost is obtained from the first number of packets lost; if it is determined that the sensors of the first group support retransmission, determine the second number of packets sent and the third number of packets lost within a simulated retransmission time period corresponding to the sensors of the first group, wherein the second number of packets sent is the number of retransmission packets sent by the sensors of the first group within the simulated retransmission time period; and determine the packet loss rate as the ratio of the first value and the second value, wherein the first value is the difference between the sum of the first number of packets sent and the second number of packets sent and the difference between the second number of packets lost and the third number of packets lost; and the second value is the sum of the first number of packets sent and the second number of packets sent.
[0094] In an exemplary embodiment, the communication strategy adjustment main unit 4032 is further configured to: obtain the first packet transmission count and the first packet loss count of the sensor in the first group within a preset time period; if it is determined that the sensor in the first group does not support collision detection, and if it is determined that the sensor in the first group supports retransmission, determine the second packet transmission count and the third packet loss count within a simulated retransmission time period corresponding to the sensor in the first group, wherein the second packet transmission count is the number of retransmission packets transmitted by the sensor in the first group within the simulated retransmission time period; and determine the packet loss rate as the ratio of the first value and the second value, wherein the first value is the difference between the first packet transmission count and the difference between the second packet loss count and the third packet loss count; and the second value is the first packet transmission count.
[0095] In an exemplary embodiment, the communication strategy adjustment main unit 4032 is further configured to: obtain the first number of packets sent and the first number of packets lost by the sensors of the first group within a preset time period; and, if it is determined that the sensors of the first group do not support retransmission, determine the ratio of the first number of packets sent to the first number of packets lost as the packet loss rate.
[0096] Next, combine Figure 5 The functions implemented by the wireless gateway module 402 described above are explained.
[0097] Figure 5 This is a flowchart illustrating the smart gateway adjustment strategy according to an embodiment of the present invention. Figure 5 As shown, a technical solution for adjusting communication strategies through a smart gateway is provided, and the specific solution is as follows:
[0098] Step S501: After starting to adjust the communication strategy, determine whether the communication performance between the wireless gateway and subordinate sensors (equivalent to all sensors in the target network) in the current communication network (equivalent to the target network) is too low, or whether a request to adjust the communication strategy is received from the subordinate sensors. If yes, then proceed to step S502; if no, then end the adjustment of the communication strategy.
[0099] Step S502: Read the information sent by the subordinate sensor;
[0100] Step S503: Group the subordinate sensors according to the type of communication strategy they support;
[0101] Step S504: Sort all groups in descending order of the number of sensors, that is, the group with the larger number of sensors will be ranked first.
[0102] Step S505: Obtain M groups, determine the group with the largest number of sensors as the current group, and set the group number M = 1, where M is a natural number;
[0103] Step S506: Simulate the communication strategy adjustment process of the Mth group of packets, analyze the communication performance of the Mth group of packets after adjustment, and obtain the simulation analysis result of the communication performance of the Mth group of packets after adjustment (equivalent to the above first simulation analysis result).
[0104] Step S507: Determine whether the communication performance of the Mth group of packets after adjustment is too low. If yes, execute Step S509; if no, execute Step S508.
[0105] Step S508: Adjust the communication strategy according to the simulation analysis result and end the adjustment of the communication strategy.
[0106] Step S509: Increment the packet sequence number M by 1, i.e., M = M + 1, and execute Step S506.
[0107] Through the above steps, for the problem of the decline in wireless transmission performance, based on the intelligent gateway and intelligent sensors, when the intelligent gateway detects a decline in the communication performance within the target network, this method coordinates the subordinate sensors to implement targeted adjustment of the communication strategy to improve the stability of the wireless network and the reliability of data transmission. Or, when the intelligent sensor detects a decline in its own communication performance, it requests the intelligent gateway to coordinate and adjust the communication strategy to improve the reliability of its own data transmission and the stability of the wireless network system.
[0108] In one embodiment, it can be combined with Figure 6 to further illustrate the simulation analysis process of the above Steps S506 to Step S507. Figure 6 It is a simulation flowchart for analyzing communication performance according to the packet loss rate of the embodiment of the present invention. As Figure 6 shown, it includes:
[0109] Step S601: Read the sensor information in the packet.
[0110] Step S602: Poll the sensors in sequence to simulate the set of packet sending times (equivalent to the above first set of times) {t ,
[0112] , i , j , i ,
[0111] , k , i+1 , i , i , }.
[0111] Among them, the number of elements in the above set of packet sending times {t i} is equivalent to the above first packet sending quantity.
[0112] Step S603: Record the second set of times in the set of packet sending times {t i} where the difference between adjacent time points is less than T. The second set of times includes {t j , j = i: t i+1 - t i < T} and {t k , k = i + 1: tk+1 -t i <T}。
[0113] Among them, the number of elements in the second time set is equivalent to the above first packet loss quantity.
[0114] Step S604: Determine whether the sensor supports the communication strategy of collision detection. If yes, execute Step S605; if no, execute Step S606.
[0115] Step S605: Solve the set {t k} corresponding to the time point set (equivalent to the above second subset) {t k,A} according to the collision detection delay, and replace the element value of {t i} in the packet time set {t k} with the corresponding {t k,A} element.
[0116] Among them, the transmission time corresponding to the element of the time point set {t k,A} is the sum value of the transmission time corresponding to the element of the set {t k} and the collision detection delay.
[0117] Step S606: Re-solve the third time set {t i} in the packet time set {t j , j = i: t i+1 -t i <T} and {t k , k = i + 1: t k+1 -t i <T}, where the number of elements in the third time set is equivalent to the above second packet loss quantity.
[0118] Step S607: Determine whether the sensor supports the communication strategy of retransmission. If yes, execute Step S608; if no, execute Step S614.
[0119] Step S608: Obtain the simulated retransmission time set including {t j} and {t k} according to the second time set, and add them to the packet time set {t j,R}. If the number of elements of {t k,R} and {t i} are N j,R and N k,R respectively, then the retransmission packet number (equivalent to the above second packet transmission quantity) is N j,R + N k,R , then the retransmission packet number (equivalent to the above second packet transmission quantity) is N j,R + N k,R.
[0120] Step S609: Determine the fourth time set in the message time set {t i} where the difference between adjacent time points is less than T, including {t j , j = i: t i+1 - t i < T} and {t k , k = i + 1: t k+1 - t i < T}.
[0121] Among them, the number of elements in the fourth time set is equivalent to the above-mentioned third packet loss quantity, that is, the number of packet losses after retransmission.
[0122] Step S610: The number of elements in the message time set {t i} is N' i , which is the total number of packets sent; the number of elements in {t j} and {t k} are N j and N k , respectively, and the total number of packet losses is N j + N k .
[0123] Step S611: Solve the packet loss rate
[0124] In one embodiment, the packet loss rate can be analyzed based on the communication success rate and communication delay. Specifically: For sensors that do not support retransmission, their communication success rate = 1 - packet loss rate; for sensors that support retransmission, their communication success rate = 1 - packet loss rate + retransmission packet loss rate; for sensors that do not support retransmission and do not have collision detection, there is no communication delay, and their communication success rate = 1 - packet loss rate; for sensors that support retransmission and collision detection, their communication delay is the difference between the time of their first packet transmission and the time of successful packet transmission, and their communication success rate = 1 - packet loss rate + retransmission packet loss rate.
[0125] Among them, the packet loss rate = total number of packet losses / total number of packets sent;
[0129] S613: Determine that the communication performance of the simulation output meets the requirements, and end the simulation.
[0130] S614: Let N be the number of the input. j,R +N k,R =0.
[0131] S615: The simulation output communication performance is determined to be unsatisfactory, and the simulation ends.
[0132] By following the steps above and analyzing the target network's communication performance after simulation adjustments using the packet loss rate, the sensor strategy can be adjusted based on the communication performance indicators indicated by the simulation results. This improves the accuracy and reliability of the strategy adjustment, thereby enhancing the communication efficiency of wireless communication.
[0133] In an optional embodiment of the present invention, when the communication monitoring unit of the smart gateway detects a decline in communication performance within the network, or receives a policy adjustment request from a subordinate sensor, a policy adjustment process is triggered, specifically including:
[0134] (1) Group the subordinate sensors according to the communication strategy and count the number of sensors in each communication strategy group.
[0135] It should be noted that when a sensor supports multiple communication strategies, each communication strategy group needs to collect statistics on that sensor.
[0136] (2). After grouping, sort all groups in descending order according to the number of sensors in the group, and put the group with more sensors in the group first.
[0137] (3). Simulation analysis: Assuming that there are M groups after the grouping is completed, after adjusting the strategy of the m-th group, analyze the communication performance of the system (m = 1 to M-1).
[0138] In one embodiment, the communication success rate λ and packet loss rate can be determined by combining the following formulas.
[0139]
[0140] In one embodiment, the process of analyzing communication performance by communication latency can be described in conjunction with Table 1.
[0141] Table 1
[0142]
[0143]
[0144] As shown in Table 1 above, for example, for sensors that do not support retransmission and have no collision detection, there is no communication delay; for sensors that support retransmission and collision detection, in the absence of retransmission, the communication delay is its first packet transmission time t. i Time t for successful packet sending k,A, The difference, in the case of retransmission, means that the communication delay is the time t of the first packet transmission. i Time t for successful packet sending k,R The difference.
[0145] (4) When the communication performance is still too low, continue to adjust the (m+1)th group and use the simulation analysis in step (3) to analyze the performance after adjustment.
[0146] (5) When the communication performance meets the requirements, adjust the communication strategy for groups 1 to m respectively.
[0147] Figure 7 This is a flowchart illustrating the intelligent sensor adjustment strategy according to an embodiment of the present invention. Figure 7 As shown, a technical solution is provided that, when a smart sensor detects a decline in its own communication performance, it requests a policy adjustment from a smart gateway and triggers a policy adjustment process, including:
[0148] Step S701: Determine whether the communication performance of the sensor itself is too low based on the sensor information. If yes, proceed to step S702; otherwise, end the current process.
[0149] Step S702: Request the smart gateway to adjust the communication policy.
[0150] Step S703: Receive the adjustment instruction for adjusting the communication strategy determined and sent by the smart gateway.
[0151] Step S704: Complete the communication strategy adjustment according to the adjustment instruction.
[0152] By following the steps above, when a smart sensor detects a decline in its own communication performance, it can request the smart gateway to coordinate and adjust the communication strategy, thereby improving the reliability of its data transmission and the stability of the wireless network system.
[0153] Embodiments of the present invention also provide a storage medium comprising a stored program, wherein the program, when executed, performs any of the methods described above.
[0154] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0155] S1, when the first communication performance index of the target network is detected to be less than a preset threshold, or when an adjustment request is received from the target sensor, all sensors in the target network are grouped according to the communication strategies supported by all sensors to obtain multiple groups. In each of the multiple groups, the sensors in each group support at least one of the same communication strategies. The target network includes: a wireless gateway, and all sensors connected to the wireless gateway. All sensors include: the target sensor.
[0156] S2, perform simulation analysis on the adjustment method of the first communication strategy supported by the sensor of the first group in the multiple groups to the second communication strategy, and obtain the first simulation analysis result of the second communication performance index of the target network.
[0157] S3, if the first simulation analysis result indicates that the second communication performance index is greater than the preset threshold, determine to adjust the first communication strategy supported by the sensors in the first group to the second communication strategy.
[0158] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0159] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0160] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0161] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0162] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0163] S1, when the first communication performance index of the target network is detected to be less than a preset threshold, or when an adjustment request is received from the target sensor, all sensors in the target network are grouped according to the communication strategies supported by all sensors to obtain multiple groups. In each of the multiple groups, the sensors in each group support at least one of the same communication strategies. The target network includes: a wireless gateway, and all sensors connected to the wireless gateway. All sensors include: the target sensor.
[0164] S2, perform simulation analysis on the adjustment method of the first communication strategy supported by the sensor of the first group in the multiple groups to the second communication strategy, and obtain the first simulation analysis result of the second communication performance index of the target network.
[0165] S3, if the first simulation analysis result indicates that the second communication performance index is greater than the preset threshold, determine to adjust the first communication strategy supported by the sensors in the first group to the second communication strategy.
[0166] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0167] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0168] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for adjusting a communication strategy, characterized in that, include: If the first communication performance index of the target network is detected to be less than a preset threshold, or if an adjustment request is received from the target sensor, all sensors in the target network are grouped according to the communication strategies supported by all sensors to obtain multiple groups. In each of the multiple groups, the sensors in each group support at least one of the same communication strategies. The target network includes: a wireless gateway, and all sensors connected to the wireless gateway. All sensors include: the target sensor. Determine the sensor type of the sensor in the first group among the plurality of groups, and determine the simulation algorithm of the sensor in the first group based on the sensor type; When the second communication performance index of the target network includes packet loss rate, the second communication performance index of the sensor of the first group adopting the second communication strategy is determined according to the simulation algorithm. This determination includes: obtaining the first number of packets sent and the first number of packets lost by the sensor of the first group within a preset time period; if the sensor of the first group supports collision detection, determining the collision detection delay corresponding to the sensor of the first group and the second number of packets lost within the preset time period, wherein the second number of packets lost is obtained from the first number of packets lost; if the sensor of the first group supports retransmission, determining the second number of packets sent and the third number of packets lost within a simulated retransmission time period corresponding to the sensor of the first group, wherein the second number of packets sent is the number of retransmitted packets sent by the sensor of the first group within the simulated retransmission time period; and determining the packet loss rate as the ratio of a first value and a second value, wherein the first value is the difference between the sum of the first number of packets sent and the second number of packets sent and the difference between the second number of packets lost and the third number of packets lost; and the second value is the sum of the first number of packets sent and the second number of packets sent. The first simulation analysis result for determining the second communication performance index of the target network based on the packet loss rate; If the first simulation analysis result indicates that the second communication performance index is greater than the preset threshold, it is determined that the first communication strategy supported by the sensors in the first group should be adjusted to the second communication strategy.
2. The method for adjusting the communication strategy according to claim 1, characterized in that, After determining the first simulation analysis result of the second communication performance index of the target network based on the packet loss rate, the method further includes: If the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, the second communication strategy supported by the sensor of the second group in the plurality of groups is adjusted to the third communication strategy, and the second simulation analysis result of the third communication performance index of the target network is obtained. If the second simulation analysis result indicates that the third communication performance index is greater than the preset threshold, it is determined that the second communication strategy supported by the sensors in the second group should be adjusted to the third communication strategy.
3. The method for adjusting the communication strategy according to claim 1, characterized in that, After determining the first simulation analysis result of the second communication performance index of the target network based on the packet loss rate, the method further includes: If the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, the adjustment method of the second communication strategy supported by the sensors of the first group to the fourth communication strategy is simulated and analyzed to obtain the third simulation analysis result of the fourth communication performance index of the target network. The sensors of the first group support at least the first communication strategy, the second communication strategy and the fourth communication strategy. If the third simulation analysis result indicates that the fourth communication performance index is greater than the preset threshold, it is determined that the second communication strategy supported by the sensors in the first group should be adjusted to the fourth communication strategy.
4. The method for adjusting the communication strategy according to claim 1, characterized in that, Before determining the sensor type of the sensor in the first group among the plurality of groups, and determining the simulation algorithm for the sensor in the first group based on the sensor type, the method further includes: The multiple groups are sorted according to the number of sensors in each group or the number of communication strategies supported by the sensors in each group. The group with the most sensors among the sorted groups is determined as the first group.
5. The method for adjusting the communication strategy according to claim 1, characterized in that, The method further includes: The first number of lost packets is determined in the following way: A first time set of sensor-transmitted messages in the first group is determined, where each element in the first time set represents the transmission time of the sensor-transmitted message in the first group, and the number of elements in the first time set is equal to the number of packets sent. The first and second adjacent element values of each element in the first time set are determined, where the difference between the transmission time of each element and the transmission time corresponding to the first adjacent element value is less than or equal to a preset unit time, and the difference between the transmission time corresponding to the second adjacent element value and the transmission time of each element is less than or equal to a preset unit time. The combined result of multiple first and second adjacent element values of each element is determined as a second time set, where the number of elements in the second time set is equal to the number of packets lost. The second time set includes a first subset and a second subset, where the first subset is the combined result of multiple first adjacent element values of each element, and the second subset is the combined result of multiple second adjacent element values of each element.
6. The method for adjusting the communication strategy according to claim 5, characterized in that, The method further includes: The second packet loss quantity is determined in the following manner: If it is determined that the sensors in the first group support collision detection, the value of the second neighboring element in the second subset is updated according to the collision detection delay, and the value of the first neighboring element and the value of the second neighboring element of each element in the first time set are updated in real time. Determine the first and second adjacent element values for each element in the current first time set; The combined result of the first and second adjacent element values of each of the multiple elements is determined as the third time set, wherein the number of elements in the third time set is the second packet loss number.
7. The method for adjusting the communication strategy according to claim 6, characterized in that, The method further includes: The third packet loss quantity is determined in the following manner: If it is determined that the sensors in the first group support retransmission, the first adjacent element value in the first subset is updated according to the simulated retransmission time period to obtain the fourth adjacent element value, and the merging result of multiple fourth adjacent element values is determined to be the third subset. The second adjacent element value in the second subset is updated according to the simulated retransmission time period to obtain the fifth adjacent element value, and the merging result of multiple fifth adjacent element values is determined to be the fourth subset; wherein, the sum of the number of elements in the third subset and the number of elements in the fourth subset is the number of retransmission packets sent by the sensor in the first group. The third subset, the fourth subset, and the first time set are merged to obtain the fourth time set; The sixth and seventh neighboring element values of each element in the fourth time set are determined, and the merging result of multiple sixth and seventh neighboring element values is determined as the fifth time set. The number of elements in the fifth time set is the third packet loss number. The difference between the sending time of each element and the sending time corresponding to the sixth neighboring element value is less than or equal to one preset unit time, and the difference between the sending time corresponding to the seventh neighboring element value and the sending time of each element is less than or equal to one preset unit time.
8. The method for adjusting the communication strategy according to claim 1, characterized in that, The step of determining the second communication performance index of the sensor in the first group using the second communication strategy according to the simulation algorithm further includes: Obtain the number of packets sent and the number of packets lost by the sensors in the first group within a preset time period; If it is determined that the sensors in the first group do not support collision detection, and if it is determined that the sensors in the first group support retransmission, the second number of packets sent and the third number of packets lost in the simulated retransmission time period corresponding to the sensors in the first group are determined, wherein the second number of packets sent is the number of retransmission packets sent by the sensors in the first group in the simulated retransmission time period. The ratio of the first value and the second value is determined as the packet loss rate, wherein the first value is the difference between the first number of packets sent and the difference between the second number of packets lost and the third number of packets lost; and the second value is the first number of packets sent.
9. The method for adjusting the communication strategy according to claim 1, characterized in that, The step of determining the second communication performance index of the sensor in the first group using the second communication strategy according to the simulation algorithm further includes: Obtain the number of packets sent and the number of packets lost by the sensors in the first group within a preset time period; If it is determined that the sensors in the first group do not support retransmission, the ratio of the first number of packets sent to the first number of packets lost is determined as the packet loss rate.
10. The method for adjusting the communication strategy according to claim 1, characterized in that, All sensors within the target network are grouped according to the communication strategies supported by all sensors, resulting in multiple groups, including: Obtain the communication strategy supported by each of the aforementioned sensors; Sensors that all support at least one of the same communication strategies are grouped into the same group to obtain the multiple groups.
11. A communication strategy adjustment system, characterized in that, include: A wireless gateway, and all the sensors connected to the wireless gateway, the wireless gateway being used to perform the adjustment method of the communication strategy as described in any one of claims 1 to 10.
12. The communication strategy adjustment system according to claim 11, characterized in that, The wireless gateway includes: a communication policy adjustment unit, wherein... The communication strategy adjustment unit is configured to perform simulation analysis on the adjustment method of the second communication strategy supported by the sensors of the second group among the plurality of groups to the third communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, thereby obtaining a second simulation analysis result of the third communication performance index of the target network; and to determine to adjust the second communication strategy supported by the sensors of the second group to the third communication strategy when the second simulation analysis result indicates that the third communication performance index is greater than the preset threshold.
13. The communication strategy adjustment system according to claim 11, characterized in that, The wireless gateway includes: a communication policy adjustment unit, wherein... The communication strategy adjustment unit is used to perform simulation analysis on the adjustment method of the second communication strategy supported by the sensors of the first group to the fourth communication strategy when the first simulation analysis result indicates that the second communication performance index is less than the preset threshold, so as to obtain a third simulation analysis result of the fourth communication performance index of the target network, wherein the sensors of the first group support at least the first communication strategy, the second communication strategy and the fourth communication strategy. If the third simulation analysis result indicates that the fourth communication performance index is greater than the preset threshold, it is determined that the second communication strategy supported by the sensors in the first group should be adjusted to the fourth communication strategy.
14. The communication strategy adjustment system according to claim 11, characterized in that, The wireless gateway includes multiple data transmission backup units, wherein the multiple data transmission backup units are respectively used to support multiple communication strategies corresponding to all the sensors.
15. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the adjustment method of the communication strategy as described in any one of claims 1 to 10 when it is run.
16. A wireless gateway, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute, through the computer program, the adjustment method of the communication strategy as described in any one of claims 1 to 10.
Citation Information
Patent Citations
System and method for dynamically changing communication policy rule
JP2014155096A