Data synchronization method for meeting integration requirements of ship navigation system
By building data distribution, arbitration and large-scale data transmission mechanisms in the ship navigation system, the problems of complex structure and poor interoperability compatibility of existing systems are solved, and data consistency between multiple nodes and high reliability and flexibility of the system are achieved.
Patent Information
- Application Number
- CN202411795449.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing ship navigation system has problems such as complex system structure, difficulty in deployment and maintenance, high single point failure rate, and poor interoperability compatibility, which is difficult to meet the requirements of complex navigation systems for large ocean-going ships, multi-part deployment, high integration and high safety.
A data synchronization method is adopted to ensure data consistency between multiple nodes of the ship navigation system and system deployment flexibility, backup redundancy and collaborative sharing by building data distribution mechanisms, arbitration mechanisms and large-scale data transmission mechanisms.
It realizes seamless operation between multiple nodes of the ship navigation system, reduces errors and exceptions caused by data inconsistency, improves the reliability and flexibility of the system, and meets the needs of high integration and high security.
Smart Images

Figure CN119814816A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data transmission, and in particular relates to a data synchronization method for realizing the integration requirements of a ship navigation system. Background Art
[0002] At present, ship navigation systems mainly adopt a distributed integration method based on buses and networks. Electronic charts, navigation radars, driving information displays and other equipment exist in the form of independent devices with satellite positioning, compasses, speedometers, depth sounders, AIS and other sensors. As a result, the ship navigation system has problems such as complex system structure, difficult deployment and maintenance, high single-point failure rate, and poor interoperability. It is difficult to meet the requirements of large ocean-going ships for complex navigation systems, multi-location deployment, high integration, and high security.
[0003] In the prior art, Chinese invention patent 202021697090.1 discloses a ship information integration and management control system. Its implementation adopts a system design method to organically combine various navigation systems, communication equipment and radar collision avoidance systems on board through a fieldbus network. The functional division of each module in the system is clear, and the unified NMEA-0183 data format is transmitted between each other through serial asynchronous communication, realizing centralized and comprehensive processing of system information. The above patent adopts a modular architecture, which can achieve rapid maintenance through module replacement, but the single point failure of the module will affect related functions, and the system fault tolerance is limited. During deployment, the differences between the modules make the configuration and connection more complicated, which limits the flexibility of the system. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies in the above-mentioned prior art and to provide a data synchronization method for realizing the integration requirements of a ship navigation system. The present invention is suitable for the integration of a multi-node ship integrated navigation system to ensure that any node can access all functions of the system to meet the system's deployment flexibility, backup redundancy and collaborative sharing requirements.
[0005] In order to achieve the above invention purpose, the technical solution provided by the present invention is as follows:
[0006] A data synchronization method for realizing the integration requirements of a ship navigation system, the method specifically comprising the following steps:
[0007] S1, build a data distribution mechanism. The data distribution mechanism includes the transport layer, session layer, presentation layer and application layer. The transport layer uses TCP connection. The session layer uses message transceivers to decouple the data synchronization process from functional components. The presentation layer uses data serialization and deserialization to convert structured data into byte streams, which are then sent and received over the network. The application layer uses the publish-subscribe model to implement asynchronous communication and event-driven architecture.
[0008] S2, build an arbitration mechanism. The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Multiple functional components run inside the node of the ship navigation system. The same functional component elects the master and slave through the data distribution mechanism between nodes. The master is responsible for distributing its own data or distributing it after arbitrating the received slave data;
[0009] S3 builds a large-scale data transmission mechanism and uses data distribution, conflict arbitration and FTP transmission to achieve large-scale file data synchronization. The master control is responsible for file distribution. The master control distributes the file name, size and checksum to be synchronized to the slave control. The slave control uses the FTP protocol to download files from the master control and clears redundant files to complete data synchronization.
[0010] Furthermore, the data distribution mechanism is specifically as follows:
[0011] S11, obtaining a synchronized listening port, a sending port and a socket option according to the preset configuration data of the node of the ship navigation system;
[0012] S12, nodes are paired with each other and TCP connections are established between them; nodes are selected as servers and clients according to the size of IP addresses;
[0013] S13, each node of the ship navigation system is equipped with a message transceiver, which is responsible for sending and receiving messages. The message is the smallest unit of a complete data synchronization process, and the smallest unit includes data, data type, domain and keyword; the functional component subscribes to the synchronization data by registering the data domain and keyword with the message transceiver; the message transceiver runs in parallel with the functional components inside the node, and the message transceiver and the functional components adopt an event-driven communication method;
[0014] S14, when the functional component in the node sends synchronous data, it notifies the message transceiver of the data together with the data domain, keyword and data type in an asynchronous event mode. The message transceiver processes the data domain, keyword and data type of the sent synchronous data into a serialization header, processes the sent data into a serialization body, and then splices the two into a message, and then publishes the message to all nodes through the TCP connection;
[0015] S15, after the node receives the message, the message transceiver in the node extracts the data field, keyword and data type from the fixed format serialization header, deserializes according to the data type, and pushes the data to the corresponding functional component of the node according to the data field and keyword to complete the data distribution.
[0016] Furthermore, the arbitration mechanism is specifically as follows:
[0017] S21, start each node of the ship navigation system, initialize the internal functional components of the node, and in the initialization state of the functional component, default itself to the master-slave pending state, and regularly distribute master declaration messages to the outside. If the master declaration message of other functional components is not received within 1 minute, the local functional component becomes the master;
[0018] S22, the local functional component receives the master declaration message sent by the remote functional component, and performs master-slave election judgment; according to the conditions, it determines whether to give up the master identity and become a slave;
[0019] S23, the slave starts the timer and listens to the master declaration from the master. When the master declaration is not received within the time limit, the slave enters the master-slave pending state, distributes the master declaration message to the outside, and re-elects a new master according to the method of S22.
[0020] Furthermore, the specific conditions for the master control election judgment are: 1) whether the remote function component is designated as the master control of the function; 2) whether the authority of the local function component is lower than that of the remote function component; 3) whether the serial number of the local node is greater than that of the remote node; 4) whether the startup time of the local node is later than that of the remote node; a sequential judgment is performed during the election judgment, and when any of the above conditions is met, the local function component gives up the master control identity.
[0021] Furthermore, during the data synchronization process, for independent data generated by a distributed task, the functional component responsible for the task distributes the data to components of other nodes, and other nodes merge the data with their own data after receiving the data; for data that causes conflicts, after other nodes distribute the data, only the master has the right to receive the data and handle potential conflicts; after resolving the conflict, the master distributes conflict-free data again, and other nodes merge the data with their own data after receiving the data.
[0022] Furthermore, the large data transmission mechanism is specifically as follows:
[0023] S31, each node of the ship navigation system obtains the master and slave identities of the local data transmission function based on the preset configuration data. According to the listening port number, user name, password, file path, transmission mode and encryption settings of the FTP server, the master creates the FTP service when the node is initialized;
[0024] S32, the data transmission function components of each node of the ship navigation system elect a master control, and the master control distributes large data files, which are nautical chart data files imported through a CD;
[0025] S33, the master control determines all the files to be synchronized and initiates the synchronization process, saves the files in the file path of the FTP server, and synchronizes each file name, size and checksum to the slave control;
[0026] S34, the slave controller obtains parameters for connecting to the FTP server based on the preset configuration data, and establishes an FTP connection with the master controller;
[0027] S35, the slave control downloads the file from the master control according to the name of the synchronization file. When the slave control detects that the file already exists locally, it compares the file size and checksum. If they are consistent, there is no need to download the file. If they are inconsistent, the file is deleted and downloaded again.
[0028] S36, after the slave control completes the download, it synchronizes the result to the master control. When all online slave controls complete the download, the master control ends the synchronization process.
[0029] A computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned data synchronization methods.
[0030] An electronic device comprises: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include any one of the data synchronization methods described above.
[0031] Based on the above technical solution, the data synchronization method for realizing the integration requirements of ship navigation system in the present invention has achieved the following technical advantages through practical application:
[0032] 1. The present invention is a data synchronization method for realizing the integration requirements of ship navigation systems. It uses universal and scalable hardware devices to connect and combine through Ethernet to build integrated navigation system networks of various sizes. Through platform software, it provides a rich configuration and integration interface to provide a basic environment and support for the interaction between distributed nodes in the system. Users can access multiple system functions including navigation sensor data management, planned route monitoring, radar transceiver control, chart data installation, etc. on any node to achieve integrated operation.
[0033] 2. The data synchronization method for realizing the integration requirements of ship navigation systems of the present invention is applicable to the integration of multi-node ship integrated navigation systems, ensuring that any node can obtain consistent system data, reducing errors and anomalies caused by inconsistent data, providing users with a seamless operation experience between multiple nodes, and reducing the workload of installation and maintenance of nautical chart data, so as to meet the system's deployment flexibility, backup redundancy and collaborative sharing requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 The invention discloses a connection diagram of a ship integrated navigation system in a data synchronization method for realizing the integration requirements of a ship navigation system.
[0035] Figure 2 It is a principle diagram of a data synchronization method for realizing the integration requirements of a ship navigation system according to the present invention.
[0036] Figure 3 The present invention is a flow chart of a data distribution mechanism and an arbitration mechanism for a data synchronization method for realizing the integration requirements of a ship navigation system.
[0037] Figure 4 It is a large data transmission flow chart in a data synchronization method for realizing the integration requirements of a ship navigation system according to the present invention.
[0038] Figure 5 The present invention discloses a task timing diagram of a multi-node ship integrated navigation system. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is described below by the specific examples shown in the accompanying drawings. However, it should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0040] like Figure 1-5 As shown, the present invention belongs to a data synchronization method for realizing the integration requirements of a ship navigation system, and the method specifically comprises the following steps:
[0041] S1, build a data distribution mechanism. The data distribution mechanism includes the transport layer, session layer, presentation layer and application layer. The transport layer uses TCP connection. The session layer uses message transceivers to decouple the data synchronization process from functional components. The presentation layer uses data serialization and deserialization to convert structured data into byte streams, which are then sent and received over the network. The application layer uses the publish-subscribe model to implement asynchronous communication and event-driven architecture.
[0042] The data distribution mechanism is a mechanism used to ensure that all workstations in the ship navigation system network can obtain consistent data at the same time. These workstations are called nodes. The OSI model can be used to describe the principle of the data distribution mechanism: the transport layer uses TCP connection to ensure reliable, connection-oriented communication services. The session layer uses message transceivers to decouple the data synchronization process from functional components. The presentation layer uses data serialization-deserialization to convert structured data into a transmittable byte stream, which is then sent and received over the network. The application layer uses a publish-subscribe model to implement asynchronous communication and event-driven architecture;
[0043] S2, build an arbitration mechanism. The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Multiple functional components run inside the node of the ship navigation system. The same functional component elects the master and slave through the data distribution mechanism between nodes. The master is responsible for distributing its own data or distributing it after arbitrating the received slave data;
[0044] The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Multiple functional components are running inside the nodes in the system, and the same functional components of different nodes are running in a redundantly distributed form. The same functional component is elected through the data distribution mechanism between nodes, and a node is selected according to the rules. This node is used as the master of this functional component, and other nodes become slaves. The master is responsible for distributing its own data, or distributing it after arbitrating the received slave data. Similarly, the master is responsible for sending instructions to the controlled object, or sending it after arbitrating the received slave instructions. The data status and control status of the slave are consistent with the master. The master will broadcast its own validity periodically, and if it times out, the election process will be triggered. When the master fails, the slaves will re-elect to determine the new master. Before the new master is determined, no node will synchronize data externally or have control. After the new master is determined, it obtains control of the functional component;
[0045] S3, builds a large-scale data transmission mechanism, and comprehensively utilizes data distribution, conflict arbitration and FTP transmission to achieve large-scale file data synchronization. The master control is responsible for file distribution. The master control distributes the file name, size and checksum to be synchronized to the slave control. The slave control uses the FTP protocol to download files from the master control and clears redundant files to complete data synchronization.
[0046] Figure 3 A flowchart showing the establishment of data distribution mechanism and arbitration mechanism.
[0047] The data distribution mechanism is specifically as follows:
[0048] S11, obtaining a synchronized listening port, a sending port and a socket option according to the preset configuration data of the node of the ship navigation system;
[0049] S12, nodes are paired with each other and TCP connections are established between them; nodes are selected as servers and clients according to the size of IP addresses;
[0050] S13, each node of the ship navigation system is equipped with a message transceiver, which is responsible for sending and receiving messages. The message is the smallest unit of a complete data synchronization process, and the smallest unit includes data, data type, domain and keyword; the functional component subscribes to the synchronization data by registering the data domain and keyword with the message transceiver; the message transceiver runs in parallel with the functional components inside the node, and the message transceiver and the functional components adopt an event-driven communication method;
[0051] S14, when the functional component in the node sends synchronous data, it notifies the message transceiver of the data together with the data domain, keyword and data type in an asynchronous event mode. The message transceiver processes the data domain, keyword and data type of the sent synchronous data into a serialization header, processes the sent data into a serialization body, and then splices the two into a message, and then publishes the message to all nodes through the TCP connection;
[0052] S15, after the node receives the message, the message transceiver in the node extracts the data field, keyword and data type from the fixed format serialization header, deserializes according to the data type, and pushes the data to the corresponding functional component of the node according to the data field and keyword to complete the data distribution.
[0053] The arbitration mechanism is specifically:
[0054] S21, start each node of the ship navigation system, initialize the internal functional components of the node, and in the initialization state of the functional component, default itself to the master-slave pending state, and regularly distribute master declaration messages to the outside. If the master declaration message of other functional components is not received within 1 minute, the local functional component becomes the master;
[0055] S22, the local functional component receives the master declaration message sent by the remote functional component, and performs master-slave election judgment; according to the conditions, it determines whether to give up the master identity and become a slave;
[0056] S23, the slave starts the timer and listens to the master declaration from the master. When the master declaration is not received within the time limit, the slave enters the master-slave pending state, distributes the master declaration message to the outside, and re-elects a new master according to the method of S22.
[0057] The specific conditions for the master control election are: 1) whether the remote function component is designated as the master control of the function; 2) whether the authority of the local function component is lower than that of the remote function component; 3) whether the serial number of the local node is greater than that of the remote node; 4) whether the startup time of the local node is later than that of the remote node; the election is judged in sequence, and when any of the above conditions is met, the local function component gives up the master control identity.
[0058] During the data synchronization process, for independent data generated by a distributed task, the functional component responsible for the task distributes the data to the components of other nodes, and other nodes merge the data with their own data after receiving it; for data that causes conflicts, after other nodes distribute the data, only the master has the right to receive the data and handle potential conflicts; after resolving the conflict, the master distributes conflict-free data again, and other nodes merge the data with their own data after receiving it.
[0059] Figure 4 A large data transmission flow chart is shown, and the large data transmission mechanism is specifically as follows:
[0060] S31, each node of the ship navigation system obtains the master and slave identities of the local data transmission function based on the preset configuration data. According to the listening port number, user name, password, file path, transmission mode and encryption settings of the FTP server, the master creates the FTP service when the node is initialized;
[0061] S32, the data transmission function components of each node of the ship navigation system elect a master control, and the master control distributes large data files, which are nautical chart data files imported through a CD;
[0062] S33, the master determines all the files to be synchronized and initiates the synchronization process, saves the files in the file path of the FTP server, and synchronizes each file name, size and checksum to other nodes;
[0063] S34, the slave controller obtains parameters for connecting to the FTP server based on the preset configuration data, and establishes an FTP connection with the master controller;
[0064] S35, the slave control downloads the file from the master control according to the name of the synchronization file. When the slave control detects that the file already exists locally, it compares the file size and checksum. If they are consistent, there is no need to download the file. If they are inconsistent, the file is deleted and downloaded again.
[0065] S36, after the slave control completes the download, it synchronizes the result to the master control. When all online slave controls complete the download, the master control ends the synchronization process.
[0066] A computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned data synchronization methods.
[0067] An electronic device comprises: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include any one of the data synchronization methods described above.
[0068] The embodiments of the present invention provide a data synchronization method, device and medium for meeting the needs of ship navigation system integration, so as to ensure the integrity and accuracy of system integration. Figure 1 The connection diagram of the integrated navigation system of the ship involved in the embodiment is shown, which includes multiple multifunctional nodes and is interconnected through a dual redundant ring network. The network also includes switches, sensor adapters, navigation sensors, IP radars and other equipment. By adopting the data synchronization method, equipment and medium in the present invention, each node can achieve real-time synchronization of data and operations. Among them, the master-slave election and arbitration mechanism run automatically in the background. Although they are transparent to the user, they ensure the synchronization of human-machine operations and the consistency of calculated data. Therefore, users can access all system functions and data on all nodes, including navigation sensor data management, planned route monitoring, radar transceiver control, chart data installation, etc. Figure 2 The schematic diagram of the data synchronization method is shown. First, each node establishes a one-to-one TCP connection with other nodes to form a reliable data distribution network to ensure that data sent by any node can be received by other nodes. Secondly, a data distribution mechanism is established based on the publish-subscribe model. The functional component specifies the domain and keyword when sending data. After the remote node receives the data, it pushes the data to the corresponding functional component based on this information. Third, the functional components of each node perform master-slave election through data distribution to ensure the consistency of the master and slave identities. Fourth, the data processed and the instructions issued by the slave need to be summarized to the master for arbitration. Finally, after the master resolves the data conflict or completes the control action, it distributes the final data to the slave to maintain state consistency.
[0069] Example 1
[0070] like Figure 5 , shown is a task timing diagram of a multi-node ship integrated navigation system based on data synchronization according to an embodiment of the present invention.
[0071] After the multi-node of the navigation system is started, the initialization of each internal functional component is completed. Depending on the configuration, the functional component determines the master and slave in different ways. The chart data installation component obtains the master and slave role assignment according to the preset settings, and the sensor management component and the route monitoring component obtain the master and slave role assignment through elections. The chart data installation component master initializes the FTP server settings and opens the chart data installation operation to the user. The sensor management component master is responsible for receiving the original sensor message, processing the original message into sampled data with a parser, and then compensating, deducing and evaluating the quality of the acquired sampled data, and finally distributing the results to the slave control.
[0072] When the navigation system performs the chart installation task, the user first imports the chart ENC data on the master control through a removable storage device, and then performs the chart installation and synchronization operations. On the one hand, the chart data installation component automatically installs the ENC data and converts it into SENC data that can be directly used by the electronic chart. On the other hand, it copies the imported ENC data to the shared path of the FTP server, counts the size and checksum of each data file, forms an ENC file list, and distributes it to the slave control. The master control updates the file synchronization progress in real time based on the file transfer status report synchronized from the slave control. When all slave controls have completed the download of ENC data, the data synchronization ends, and the component automatically deletes all files under the shared path of the FTP server. After the chart data installation component of the slave control receives the ENC file list information synchronized from the master control, it downloads the files in the list one by one from the FTP server. Whenever a file is downloaded, the size and checksum of the file are compared with the information in the list, and the comparison results are distributed as a file transfer status report to report to the master control whether the file transfer is normal. When all files are downloaded, the component automatically installs these ENC files and converts them into SENC data that can be directly used by the electronic chart. After the installation is complete, the component automatically deletes all downloaded ENC files.
[0073] When the navigation system performs the route monitoring task, the user first performs the route loading operation. The route monitoring component in the background synchronizes the instruction type (loading), basic route data (waypoint coordinates, route segment deviation threshold, planned speed), and route detection data (whether there are any abnormalities in the route detection, and the specific reasons for each abnormality) to the main control. After the main control loads the route, it performs route monitoring calculations, obtains the next waypoint number, distance, direction, current deviation distance, ETA and other route monitoring parameters, and then synchronizes them to all devices.
[0074] When the navigation system performs the radar transceiver control task, the user first obtains the transceiver control authority, and the radar transceiver management component issues an application in the background. After receiving the application, the master control determines whether to allow the node to obtain the transceiver control authority according to the preset "node-transceiver" authority management configuration. If the application is approved, the master control will issue a license and synchronize the latest "node-transceiver" control authority allocation table to the slave control. If the node can obtain control authority, the user can perform control operations such as transceiver transmission / standby on the node, as well as screen adjustment settings such as gain and clutter suppression. .
[0075] In order to optimize the production process and reduce costs of integrated ship navigation systems, it is necessary to use standard parts on a large scale during the production process to reduce equipment costs, control labor costs and time costs during delivery and deployment, and at the same time face the challenges of diverse and rapidly changing shipowner needs, requiring the system to have high reliability during operation. This involves solving the establishment of a data synchronization mechanism to ensure data consistency, coordinate and handle possible data conflicts, and build a system based on the data synchronization mechanism. Use standardized equipment and a unified network interface to simplify system design and integration. Use the system's dynamic configurability to cope with complex and changing needs. Standardize, automate, and engineer the system configuration process to effectively control risks in project delivery to meet customized needs in different scenarios.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods of the invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.
Claims
1. A data synchronization method for realizing the integration requirements of a ship navigation system, characterized in that: The method specifically comprises the following steps: S1, build a data distribution mechanism. The data distribution mechanism includes the transport layer, session layer, presentation layer and application layer. The transport layer uses TCP connection. The session layer uses message transceivers to decouple the data synchronization process from functional components. The presentation layer uses data serialization and deserialization to convert structured data into byte streams, which are then sent and received over the network. The application layer uses the publish-subscribe model to implement asynchronous communication and event-driven architecture. S2, build an arbitration mechanism. The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Multiple functional components run inside the node of the ship navigation system. The same functional component elects the master and slave through the data distribution mechanism between nodes. The master is responsible for distributing its own data or distributing it after arbitrating the received slave data; S3 builds a large-scale data transmission mechanism and uses data distribution, conflict arbitration and FTP transmission to achieve large-scale file data synchronization. The master control is responsible for file distribution. It first distributes the file name, size and checksum to be synchronized to the slave control. The slave control uses the FTP protocol to download files from the master control and clears redundant files to complete data synchronization.
2. A data synchronization method for realizing the integration requirements of a ship navigation system according to claim 1, characterized in that: The data distribution mechanism is specifically as follows: S11, obtaining a synchronized listening port, a sending port and a socket option according to the preset configuration data of the node of the ship navigation system; S12, nodes are paired with each other and TCP connections are established between them; nodes are selected as servers and clients according to the size of IP addresses; S13, each node of the ship navigation system is equipped with a message transceiver, which is responsible for sending and receiving messages. The message is the smallest unit of a complete data synchronization process, and the smallest unit includes data, data type, domain and keyword; the functional component subscribes to the synchronization data by registering the data domain and keyword with the message transceiver; the message transceiver runs in parallel with the functional components inside the node, and the message transceiver and the functional components adopt an event-driven communication method; S14, when the functional component in the node sends synchronous data, it notifies the message transceiver of the data together with the data domain, keyword and data type in an asynchronous event mode. The message transceiver processes the data domain, keyword and data type of the sent synchronous data into a serialization header, processes the sent data into a serialization body, and then splices the two into a message, and then publishes the message to all nodes through the TCP connection; S15, after the node receives the message, the message transceiver in the node extracts the data field, keyword and data type from the fixed format serialization header, deserializes according to the data type, and pushes the data to the corresponding functional component of the node according to the data field and keyword to complete the data distribution.
3. A data synchronization method for realizing the integration requirements of a ship navigation system according to claim 1, characterized in that: The arbitration mechanism is specifically: S21, start each node of the ship navigation system, initialize the internal functional components of the node, and when the functional components are initialized, they default to the master-slave pending state and regularly distribute master declaration messages to the outside. If no master declaration message is received from other functional components within 1 minute, the local functional component becomes the master; S22, the local functional component receives the master declaration message sent by the remote functional component, and performs master-slave election judgment; according to the conditions, it determines whether to give up the master identity and become a slave; S23, the slave starts the timer and monitors the master declaration message from the master. When the master declaration is not received within the time limit, the slave enters the master-slave pending state, distributes the master declaration message to the outside, and re-elects a new master according to the method of S22.
4. A data synchronization method for realizing the integration requirements of a ship navigation system according to claim 3, characterized in that: The specific conditions for the master control election are: 1) whether the remote function component is designated as the master control of the function; 2) whether the authority of the local function component is lower than that of the remote function component; 3) whether the serial number of the local node is greater than that of the remote node; 4) whether the startup time of the local node is later than that of the remote node; the election is judged in sequence, and when any of the above conditions is met, the local function component gives up the master control identity.
5. A data synchronization method for realizing the integration requirements of a ship navigation system according to claim 3, characterized in that: During the data synchronization process, for independent data generated by a distributed task, the functional component responsible for the task distributes the data to the components of other nodes, and other nodes receive the data and merge it with their own data; for data that causes conflicts, after other nodes distribute the data, only the master has the right to receive the data and handle potential conflicts; After resolving the conflict, the master distributes conflict-free data again, and other nodes receive the data and merge it with their own data.
6. A data synchronization method for realizing the integration requirements of a ship navigation system according to claim 1, characterized in that: The large data transmission mechanism is specifically: S31, each node of the ship navigation system obtains the master and slave identities of the local data transmission function based on the preset configuration data. According to the listening port number, user name, password, file path, transmission mode and encryption settings of the FTP server, the master creates the FTP service when the node is initialized; S32, the data transmission function components of each node of the ship navigation system elect a master control, and the master control distributes large data files, which are nautical chart data files imported through a CD; S33, the master determines all the files to be synchronized and initiates the synchronization process, saves the files in the file path of the FTP server, and synchronizes each file name, size and checksum to other nodes; S34, the slave controller obtains parameters for connecting to the FTP server based on the preset configuration data, and establishes an FTP connection with the master controller; S35, the slave control downloads the file from the master control according to the name of the synchronization file. When the slave control detects that the file already exists locally, it compares the file size and checksum. If they are consistent, there is no need to download the file. If they are inconsistent, the file is deleted and downloaded again. S36, after the slave control completes the download, it synchronizes the result to the master control. When all online slave controls complete the download, the master control ends the synchronization process.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the data synchronization method according to any one of claims 1 to 6.
8. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing the data synchronization method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Ship information integration and management control system
CN213582270U
Two-bus-based data synchronizing method and system
CN106874237A
Intelligent ship comprehensive information redundancy monitoring system
CN111614502A
Data center cluster multi-activity arbitration method and system
CN116016542A
Method and apparatus for reliable and scalable distribution of data files in distributed networks
WO2001077841A2