Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Example 1
As shown in fig. 1,embodiment 1 of the present invention provides a network adaptation method for ship communication, including the following steps:
s1, establishing a handshake protocol between the sending node and the receiving node;
s2, sending a frame according to the request of the handshake protocol to detect the network quality parameter, and selecting a communication parameter value according to the detected value of the network quality parameter;
s3, sending the communication parameter value according to the allowed sending frame of the handshake protocol, and adjusting the communication parameter according to the communication parameter value;
and S4, transmitting the data frame according to the adjusted communication parameters to realize communication.
Due to the complex and various ship communication environments, the wireless transmission media are variable, and a single fixed node communication parameter, such as a transmission speed, cannot meet the communication requirements among all nodes, an appropriate communication parameter needs to be selected according to the network environment and the channel state among the transceiving nodes. Therefore, the embodiment of the invention provides a network adaptive algorithm for ship communication. Meanwhile, the ship is not fixed, so that the receiving nodes in the coverage area of the sending node have different distances, the signal strength at each receiving node is different due to the channel attenuation of signals from the sending node to each receiving node, and when the signals are weak, the spreading factor needs to be improved to reduce the signal-to-noise ratio (bit error rate); when the signal is strong, the spreading factor needs to be reduced, so that the data transmission rate is improved, and therefore the implementation steps of the network adaptive algorithm for ship communication provided by the embodiment of the invention are as follows:
according to the embodiment of the invention, data communication among different nodes needs to be established, a handshake protocol is established before the data communication, and is used for establishing a data communication request and permission between a sending node and a receiving node, so that the data packet loss rate can be reduced. The handshake protocol established between the sending node and the receiving node can detect the network quality parameters such as signal strength, signal time delay, channel occupancy rate and the like, and realize accurate estimation of the wireless channel state. The sending node automatically selects communication parameters such as a sending frequency band, a communication speed, a routing path, a sending rate and the like according to the detection result of the network quality parameters, feeds back a CTS (clear to send frame) with the communication parameters to the sending node, and adjusts a local modulation coding mode of the receiving node to receive a DATA (DATA frame); s4: after receiving the CTS, the sending node adjusts communication parameters such as sending rate, modulation coding mode and the like to be consistent with the receiving node according to the CTS requirement; and after the adjustment is completed, the sending node and the receiving node complete the communication of DATA-ACK (DATA frame-acknowledgement frame). And after the data frame and the confirmation frame are sent, switching the sending node and the receiving node to basic communication parameters, and performing self-adaptive adjustment when the next communication is needed.
It should be understood that at least one of the sending node and the receiving node in the present invention is a ship communication node, and the other one may be a ship communication node, or may be other communication nodes, such as a base station communication node. That is to say, the network adaptive method for ship communication provided by the invention can realize distributed data interactive communication between ships, centralized data interactive communication between each ship and the base station, and centralized data interactive communication between each ship and other communication nodes.
Specifically, the communication protocol for data path in the present invention is preferably a communication protocol designed according to the message habit of the AI S, so as to improve compatibility.
The invention establishes a network adaptive algorithm, improves the network communication quality of the system, reduces the system time delay and the error rate, improves the spectrum occupancy rate, can ensure that ships accurately and efficiently identify surrounding ships in ports or wide water areas, reduces the collision danger, solves the problems of low AI S data quality, high power consumption and the like at present, and can be widely applied to the auxiliary navigation and safety supervision of the ships in closed water areas.
Preferably, the request-to-send frame includes a frame header, a ship identification code, request-to-send data, and a frame trailer; the sending-allowed frame comprises a frame head, a ship identification code, sending-allowed data, a frame tail and communication parameters.
Specifically, the formats of the request-to-send frame and the allowed-to-send frame in this embodiment are shown in the following table:
TABLE 1 handshake protocol
The path parameter in this embodiment is signal strength.
Preferably, the communication parameter adjustment is performed according to the communication parameter value, specifically:
and the communication parameter value is a spread spectrum factor, and the communication speed is adjusted according to the spread spectrum factor.
In this embodiment, a suitable spreading factor is selected according to the detected value of the network quality parameter, and then the communication speed is adjusted according to the selected spreading factor, so that the communication speed can adapt to the current network state.
Preferably, the network quality parameters include signal strength, signal delay and channel occupancy, and the communication parameters include a transmission frequency band, a spreading factor, a communication speed and a routing path.
Preferably, a handshake protocol is established between the sending node and the receiving node, specifically:
the sending node sends the request sending frame to the receiving node;
and the receiving node sends the transmission permission frame to the sending node after receiving the request transmission frame, so as to realize the establishment of a handshake protocol.
A handshake protocol is established between the sending node and the receiving node by requesting transmission of frames and permitting transmission and reception of frames. Meanwhile, the self-adaptive adjustment of the network parameters is realized by means of the process of establishing a handshake protocol, so that the communication efficiency between the sending node and the receiving node is higher, and the communication effect is better.
Preferably, the selecting the communication parameter value according to the detected value of the network quality parameter specifically comprises:
establishing a mapping relation table among communication distance, network quality parameters and communication parameters;
and acquiring the real-time communication distance between the sending node and the receiving node, and selecting corresponding communication parameter values in the mapping relation table according to the real-time communication distance and the network quality parameter detection values.
The mapping relationship table established in this embodiment is as follows:
TABLE 2 mapping relationship between communication distance and signal strength, spreading factor, data rate
And selecting proper communication parameters for the communication between the sending node and the receiving node according to the current network condition and the communication distance. The communication quality between the sending node and the receiving node is ensured, and meanwhile, the antenna is not required to be arranged, so that the power consumption is low.
Preferably, a handshake protocol is established between the sending node and the receiving node, specifically:
establishing the handshake protocol on a common channel;
reallocating the communication channel after the handshake protocol is established;
communication is performed on the reallocated communication channel.
The handshake protocol is established directly on the common channel since it does not require too high a network quality to be established. After the handshake protocol is established and the communication parameters are adjusted, the communication is switched to a more appropriate channel for subsequent formal communication, and the processes of data frame sending, ship identification and the like are carried out.
Preferably, the reallocating the communication channel after the handshake protocol is established is specifically:
setting an initial channel allocation scheme;
calculating the interference amount of the current channel allocation scheme according to the utility function;
and judging whether the current channel allocation scheme can reach an equilibrium state or not according to the interference amount, if so, adopting the current channel allocation scheme for communication, otherwise, switching to the next channel allocation scheme, and turning to the previous step.
The preferred embodiment performs adaptive adjustment on the communication channel on the basis of adjusting the communication parameters, and solves the problem of VHF channel congestion of the AIS equipment at present.
Specifically, the available frequency band in this embodiment is 470-510MHz, which needs to be monitored by the radio management committee, and is increased from 470.3MHz to 509.7MHz every 200KHz, and 144 channels are total, wherein channels No. 6-38 and No. 45-77 are used for china power usage, and are not available in ship identification, and the remaining 78 channels are available. Due to the fact that network resources are limited, the number of ships is large, communication data packets are dense, all ship nodes adopt a spectrum allocation model based on a game theory to conduct channel self-adaptive allocation, whether a utility function can reach an equilibrium state is calculated at a sending node, if yes, channel allocation is conducted according to the strategy, if not, the next channel is continuously switched to, and a channel allocation strategy which can reach the equilibrium state is searched. And after the channel allocation strategy which can reach the equilibrium state is found and the data frame communication is completed, returning to the initial allocation channel again, and waiting for the next time of communication needing to be carried out, carrying out channel self-adaptive allocation.
Preferably, the calculating the interference amount of the current channel allocation scheme according to the utility function specifically includes:
wherein, Ui() As a utility function, PkIs a node skK is equal to [1, n ]]N is the total number of nodes, GkjIs a node skTo node sjI () is an interference equation, which means that when a node receives and transmits data, interference occurs using the same channel;
the interference equation is:
the link gain is:
wherein d isijIs a node skAnd node sjThe communication distance of (2).
The purpose of channel adaptive allocation is to minimize the interference amount, and the implementation adopts a utility function of a spectrum allocation model based on a game theory to calculate the overall interference amount of the current allocation strategy of the system. And a frequency spectrum allocation model based on a game theory is adopted, so that the channel utilization rate and the throughput of the system are improved. The problem that the existing AIS equipment channel is not enough is solved.
Judging whether the current channel allocation scheme can reach an equilibrium state according to the interference amount, specifically:
and judging whether the interference amount is smaller than a set threshold value, if so, indicating that the balance state can be achieved, otherwise, indicating that the balance state cannot be achieved.
Example 2
As shown in fig. 2, an embodiment 2 of the present invention provides a network adaptive device for ship communication, which includes a processor and a memory, where the memory stores a computer program, and the computer program is executed by the processor to implement the network adaptive method for ship communication provided inembodiment 1.
Specifically, the network adaptive device for ship communication further comprises a wireless communication module, a display screen, an SD card, a sensor and the like. The wireless communication module is used for establishing communication connection so as to realize a network self-adaptive method of ship communication. The wireless communication module can adopt loRa communication module to realize, and loRa communication module has point-to-point data bidirectional transmission function, is used for the sending and receiving of data respectively. The various sensors are used for acquiring position information, navigation speed information, course information and motion information of the ship, for example, the position information and the navigation speed information can be detected by a GPS module, the course information can be detected by a compass sensor, the motion information can be detected by an acceleration sensor, whether the ship is in a navigation state or not can be judged according to the motion information of the ship, and data detected by the sensors are sent as data frames, so that mutual identification among network self-adaption devices of different ship communication is realized. The display screen is used for displaying detection data, identification results and the like. The SD card is used for storing ship navigation information, and ship static information is stored in the SD card module and comprises a ship identification number, a ship length, a ship width, a ship type, ship draft and the like.
The network adaptive device for ship communication provided by the embodiment of the invention is used for realizing a network adaptive method for ship communication, so that the technical effect of the network adaptive method for ship communication is achieved, and the network adaptive device for ship communication also has the technical effect, and the details are not repeated herein.
Example 3
As shown in fig. 3, an embodiment 3 of the present invention provides a network adaptive system for ship communication, including at least two network adaptive devices for ship communication provided in embodiment 2, and further including a base station, where the network adaptive devices for ship communication implement mutual communication by using the network adaptive method for ship communication provided inembodiment 1, and the network adaptive devices for ship communication implement mutual communication with the base station by using the network adaptive method for ship communication provided inembodiment 1.
Fig. 3 shows six ship communication network adaptive devices, and obviously, the number of the network adaptive devices may be other, a base station is not shown in fig. 3, two ship communication network adaptive devices may communicate with each other by using the ship communication network adaptive method provided inembodiment 1, the ship communication network adaptive devices and the base station may communicate with each other by using the ship communication network adaptive method provided inembodiment 1, and the communication quality is good, and arrows in fig. 3 only show some communication connection possibilities. All network-adapted devices communicating with the vessel are connected by wireless communication, such as LoRa. The ship user can send the ship data to the network self-adaptive device for communication of other ships in the communication range through the network self-adaptive device for communication of the ships, and can also forward the data of other ships. The wireless communication module adopts a network self-adaptive method of ship communication to detect the network state of the system before sending data, and automatically selects an optimal communication path, a communication channel and the like according to the network state.
The network adaptive system for ship communication provided by the embodiment of the invention comprises a network adaptive device for ship communication, and the network adaptive device for ship communication is used for communication by adopting a network adaptive method for ship communication, so that the technical effect of the network adaptive method for ship communication is achieved, and the network adaptive system for ship communication is also achieved, and the details are not repeated herein.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention. Any other corresponding changes and modifications made according to the technical idea of the present invention should be included in the protection scope of the claims of the present invention.