A data synchronization method for meeting the integration requirements of ship navigation systems

By employing data distribution, arbitration, and large file transfer mechanisms, the complexity and interoperability issues of ship navigation systems are resolved, achieving data consistency and flexibility in multi-node systems and providing a highly secure and integrated navigation system.

CN119814816BActive Publication Date: 2025-11-14CSSC MARINE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411795449.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-11-14
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

Existing ship navigation systems suffer from complex system structures, difficult deployment and maintenance, high single-point failure rates, and poor interoperability and compatibility, making it difficult to meet the navigation system requirements of large ocean-going vessels.

Method used

By employing data distribution, arbitration, and large-scale data transmission mechanisms, and utilizing TCP connections, message transceivers, publish-subscribe patterns, and FTP transfer, data synchronization and automatic master-slave election are achieved, ensuring data consistency and redundancy among nodes.

Benefits of technology

It enables flexible deployment and collaborative sharing of ship navigation systems, reduces errors caused by data inconsistencies, provides a seamless operating experience, and reduces the workload of nautical chart data installation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814816B_ABST
    Figure CN119814816B_ABST
Patent Text Reader

Abstract

This invention discloses a data synchronization method for achieving the integration requirements of a ship navigation system. The method specifically includes the following steps: S1, constructing a data distribution mechanism, which includes a transport layer, a session layer, a presentation layer, and an application layer; S2, constructing an arbitration mechanism, which determines the master-slave mode by distributing and processing arbitration information. For components with the same function, the master and slave are determined through election via the data distribution mechanism between nodes; S3, constructing a large-scale data transmission mechanism, utilizing data distribution, conflict arbitration, and FTP transmission to achieve large file data synchronization, thus completing the data synchronization. This invention is applicable to the integration of multi-node ship navigation systems, ensuring that any node can access all system functions to meet the system's deployment flexibility, backup redundancy, and collaborative sharing requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data transmission technology, specifically relating to a data synchronization method for achieving the integration requirements of a ship navigation system. Background Technology

[0002] Currently, ship navigation systems mainly adopt a distributed integration approach based on bus and network. Electronic charts, navigation radar, and navigation information displays exist as independent devices, along with sensors such as satellite positioning, compasses, logs, depth sounders, and AIS. This results in complex system structures, difficult deployment and maintenance, high single-point failure rates, and poor interoperability and compatibility for ship navigation systems. Consequently, these systems cannot meet the increasingly complex, multi-part deployment, high integration, and high security requirements of large ocean-going vessels.

[0003] In the prior art, Chinese invention patent 202021697090.1 discloses a ship information integration and management control system. This system employs a system design approach, organically combining various shipboard navigation systems, communication equipment, and radar collision avoidance systems through a fieldbus network. The functions of each module in the system are clearly defined, and they transmit a unified NMEA-0183 data format via serial asynchronous communication, achieving centralized and comprehensive processing of system information. While this patent uses a modular architecture, allowing for rapid maintenance through module replacement, single-point failures in modules can affect related functions, limiting system fault tolerance. Furthermore, the differences between modules during deployment lead to complex configuration and connections, restricting system flexibility. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a data synchronization method for realizing the integration requirements of ship navigation systems. This invention is applicable to the integration of multi-node ship integrated navigation systems, ensuring that any node can access all functions of the system to meet the system's deployment flexibility, backup redundancy and collaborative sharing requirements.

[0005] To achieve the above-mentioned objectives, the technical solution provided by this invention patent is as follows:

[0006] A data synchronization method for achieving the integration requirements of a ship navigation system, the method specifically includes the following steps:

[0007] S1, Construct a data distribution mechanism, which includes a transport layer, a session layer, a presentation layer, and an application layer. The transport layer uses TCP connections, 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, and then sends and receives data over the network, and the application layer adopts a publish-subscribe pattern to implement asynchronous communication and an event-driven architecture.

[0008] S2, Construct an arbitration mechanism. The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Multiple functional components run within the nodes of the ship navigation system. The same functional component elects the master and slave controllers through the data distribution mechanism between nodes. The master controller is responsible for distributing its own data or distributing the data received from the slave controllers after arbitration.

[0009] S3 constructs a large-scale data transmission mechanism, utilizing data distribution, conflict arbitration, and FTP transfer to achieve large file data synchronization. The master controller is responsible for file distribution, distributing the file names, sizes, and checksums to be synchronized to the slave controllers. The slave controllers use the FTP protocol to download files from the master controller and remove redundant files, thus completing data synchronization.

[0010] Furthermore, the data distribution mechanism is specifically as follows:

[0011] S11, based on the preset configuration data of the nodes of the ship navigation system, obtain the synchronous listening port, sending port and socket options;

[0012] S12, nodes pair up with each other and establish TCP connections between nodes; select nodes as server and client based on IP address size;

[0013] S13, each node of the ship navigation system is equipped with a message transceiver. The message transceiver is responsible for sending and receiving messages. A message is the smallest unit of a complete data synchronization process. The smallest unit includes data, data type, domain, and keyword. Functional components subscribe to synchronized data by registering data domains and keywords with the message transceiver. The message transceiver and the functional components inside the node operate in parallel. The message transceiver and the functional components adopt an event-driven communication method.

[0014] S14, when the functional components within a node send synchronous data, they notify the message transceiver of the data along with the data field, keyword, and data type in an asynchronous event manner. The message transceiver processes the data field, keyword, and data type of the sent synchronous data into a serialized header, processes the sent data into a serialized body, and then concatenates the two into a message. Finally, it publishes the message to all nodes through a TCP connection.

[0015] S15, after receiving the message, the message transceiver within the node extracts the data field, keyword, and data type from the serialization header in a fixed format, performs deserialization according to the data type, and pushes the data to the corresponding functional components of the node according to the data field and keyword, thus completing the data distribution.

[0016] Furthermore, the arbitration mechanism is specifically as follows:

[0017] S21, each node of the ship's navigation system is started, and the internal functional components of the node are initialized. In the initialization state, the functional component defaults to a master-slave pending state and periodically distributes master control declaration messages to external components. If no master control declaration message is received from another functional component within 1 minute, the local functional component becomes the master.

[0018] S22, the local functional component receives the master declaration message from the remote functional component and performs a master-slave election; based on the conditions, it determines whether to relinquish its master status and become a slave.

[0019] S23: The slave controller starts a timer to listen for the master control declaration from the master controller. If no master control declaration is received within the timeout period, the slave controller enters a master-slave standby state, distributes the master control declaration message to the outside world, and re-elects a new master controller according to the method in S22.

[0020] Furthermore, the specific conditions for the master control election judgment are as follows: 1) whether the remote functional component is designated as the master control of the function; 2) whether the local functional component has lower permissions than the remote functional component; 3) whether the sequence 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 judgment is performed in sequence, and when any of the above conditions are met, the local functional component relinquishes its master control status.

[0021] Furthermore, during the data synchronization process, for independent data generated by a distributed task, the functional component responsible for that task distributes the data to components of other nodes, and the 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 controller has the right to receive the data and handle potential conflicts. After resolving the conflict, the master controller redistributes conflict-free data, and the other nodes merge the data with their own data after receiving it.

[0022] Furthermore, the large-scale data transmission mechanism is specifically as follows:

[0023] S31, each node of the ship navigation system obtains master / slave control status for local data transmission based on preset configuration data. The master controller creates an FTP service during node initialization based on the FTP server's listening port number, username, password, file path, transmission mode, and encryption settings.

[0024] S32, the data transmission function components of each node of the ship navigation system elect a master controller, and the master controller distributes large data files, which are nautical chart data files imported via optical disc;

[0025] S33: After the master controller decides all the files to be synchronized, it initiates the synchronization process, saves the files in the file path of the FTP server, and synchronizes the name, size and checksum of each file to the slave controller.

[0026] S34, the slave controller obtains the 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 controller downloads the file from the master controller according to the name of the synchronization file. When the slave controller detects that the file already exists locally, it compares the file size and checksum. If they match, there is no need to download the file. If they do not match, the file is deleted and then downloaded again.

[0028] S36: After the slave controller completes the download, it synchronizes the result to the master controller. Once all online slave controllers have completed the download, the master controller ends the synchronization process.

[0029] A computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the data synchronization method described in any one of the preceding claims.

[0030] An electronic device includes: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include the data synchronization method described in any one of the preceding claims.

[0031] Based on the above technical solution, the data synchronization method for achieving the integration requirements of ship navigation systems, as proposed in this invention patent, has achieved the following technical advantages through practical application:

[0032] 1. This invention discloses a data synchronization method for achieving integrated requirements of ship navigation systems. Utilizing general-purpose and scalable hardware, it constructs integrated navigation system networks of varying sizes through Ethernet connections and combinations. Platform-based software provides rich configuration and integration interfaces, offering a basic environment and support for interaction between distributed nodes within the system. Users can access various system functions from any node, including navigation sensor data management, planned route monitoring, radar transceiver control, and chart data installation, achieving integrated operation.

[0033] 2. The data synchronization method of the present invention for realizing the integration requirements of ship navigation system is applicable to the integration of multi-node ship integrated navigation system. It ensures that any node can obtain consistent system data, reduces errors and anomalies caused by data inconsistency, provides users with a seamless operation experience between multiple nodes, and reduces the workload of nautical chart data installation and maintenance, so as to meet the system's deployment flexibility, backup redundancy and collaborative sharing requirements. Attached Figure Description

[0034] Figure 1 This is a connection diagram of a ship integrated navigation system in a data synchronization method for achieving the integration requirements of a ship navigation system according to the present invention.

[0035] Figure 2 This is a schematic diagram of a data synchronization method for achieving the integration requirements of a ship navigation system according to the present invention.

[0036] Figure 3 This is a flowchart illustrating a data synchronization method for achieving the integration requirements of a ship navigation system, comprising a data distribution mechanism and an arbitration mechanism.

[0037] Figure 4 This is a flowchart of a large-scale data transmission process in a data synchronization method for achieving the integration requirements of a ship navigation system, as described in this invention.

[0038] Figure 5 This is a mission timing diagram for a multi-node integrated ship navigation system according to the present invention. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the invention is described below with reference to specific examples shown in the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0040] like Figure 1-5 As shown, this invention pertains to a data synchronization method for achieving the integration requirements of a ship navigation system. The method specifically includes the following steps:

[0041] S1, Construct a data distribution mechanism, which includes a transport layer, a session layer, a presentation layer, and an application layer. The transport layer uses TCP connections, 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, and then sends and receives data over the network, and the application layer adopts a publish-subscribe pattern to implement asynchronous communication and an event-driven architecture.

[0042] A data distribution mechanism is used to ensure that all workstations in a ship navigation system network can simultaneously obtain consistent data; these workstations are called nodes. The principle of the data distribution mechanism can be described using the OSI model: The transport layer uses TCP connections 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 adopts a publish-subscribe pattern to implement asynchronous communication and an event-driven architecture.

[0043] S2, Construct an arbitration mechanism. The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Multiple functional components run within the nodes of the ship navigation system. The same functional component elects the master and slave controllers through the data distribution mechanism between nodes. The master controller is responsible for distributing its own data or distributing the data received from the slave controllers after arbitration.

[0044] The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Each node in the system runs multiple functional components, with the same functional component on different nodes operating in a redundant distribution. The same functional component elects a master node through a data distribution mechanism among nodes, selecting one node based on rules, while the other nodes become slave nodes. The master node is responsible for distributing its own data, or arbitrating received slave data before distributing it. Similarly, the master node is responsible for sending instructions to the controlled object, or arbitrating received slave instructions before sending them. The data and control states of the slave nodes are consistent with those of the master node. The master node periodically broadcasts its own validity; if it times out, an election process is triggered. When the master node fails, all slave nodes re-elect to determine a new master node. Before a new master node is determined, no node synchronizes data externally or has control. After a new master node is determined, it gains control of the functional component.

[0045] S3 constructs a large-scale data transmission mechanism, which comprehensively utilizes data distribution, conflict arbitration, and FTP transfer to achieve large file data synchronization. The master controller is responsible for file distribution. The master controller distributes the file names, sizes, and checksums of the files to be synchronized to the slave controllers. The slave controllers use the FTP protocol to download files from the master controller and remove redundant files to complete data synchronization.

[0046] Figure 3 The flowcharts for establishing the data distribution and arbitration mechanisms are shown.

[0047] The data distribution mechanism is specifically as follows:

[0048] S11, based on the preset configuration data of the nodes of the ship navigation system, obtain the synchronous listening port, sending port and socket options;

[0049] S12, nodes pair up with each other and establish TCP connections between nodes; select nodes as server and client based on IP address size;

[0050] S13, each node of the ship navigation system is equipped with a message transceiver. The message transceiver is responsible for sending and receiving messages. A message is the smallest unit of a complete data synchronization process. The smallest unit includes data, data type, domain, and keyword. Functional components subscribe to synchronized data by registering data domains and keywords with the message transceiver. The message transceiver and the functional components inside the node operate in parallel. The message transceiver and the functional components adopt an event-driven communication method.

[0051] S14, when the functional components within a node send synchronous data, they notify the message transceiver of the data along with the data field, keyword, and data type in an asynchronous event manner. The message transceiver processes the data field, keyword, and data type of the sent synchronous data into a serialized header, processes the sent data into a serialized body, and then concatenates the two into a message. Finally, it publishes the message to all nodes through a TCP connection.

[0052] S15, after receiving the message, the message transceiver within the node extracts the data field, keyword, and data type from the serialization header in a fixed format, performs deserialization according to the data type, and pushes the data to the corresponding functional components of the node according to the data field and keyword, thus completing the data distribution.

[0053] The arbitration mechanism is specifically as follows:

[0054] S21, each node of the ship's navigation system is started, and the internal functional components of the node are initialized. In the initialization state, the functional component defaults to a master-slave pending state and periodically distributes master control declaration messages to external components. If no master control declaration message is received from another functional component within 1 minute, the local functional component becomes the master.

[0055] S22, the local functional component receives the master declaration message from the remote functional component and performs a master-slave election; based on the conditions, it determines whether to relinquish its master status and become a slave.

[0056] S23: The slave controller starts a timer to listen for the master control declaration from the master controller. If no master control declaration is received within the timeout period, the slave controller enters a master-slave standby state, distributes the master control declaration message to the outside world, and re-elects a new master controller according to the method in S22.

[0057] The specific conditions for master election judgment are as follows: 1) whether the remote functional component is designated as the master of the function; 2) whether the local functional component has lower permissions than the remote functional component; 3) whether the sequence 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 judgment is performed in sequence, and when any of the above conditions are met, the local functional component relinquishes its master status.

[0058] During the data synchronization process, for independent data generated by a distributed task, the functional component responsible for that task distributes the data to components of other nodes. After receiving the data, the other nodes merge it with their own data. For data that causes conflicts, after other nodes distribute the data, only the master controller has the right to receive the data and handle potential conflicts. After resolving the conflict, the master controller then distributes conflict-free data, and after receiving the data, the other nodes merge it with their own data.

[0059] Figure 4 A flowchart of a large data transmission process is shown, and the specific mechanism for large data transmission is as follows:

[0060] S31, each node of the ship navigation system obtains master / slave control status for local data transmission based on preset configuration data. The master controller creates an FTP service during node initialization based on the FTP server's listening port number, username, password, file path, transmission mode, and encryption settings.

[0061] S32, the data transmission function components of each node of the ship navigation system elect a master controller, and the master controller distributes large data files, which are nautical chart data files imported via optical disc;

[0062] S33: After the master controller decides all the files to be synchronized, it initiates the synchronization process, saves the files in the file path of the FTP server, and synchronizes the name, size and checksum of each file to other nodes.

[0063] S34, the slave controller obtains the 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 controller downloads the file from the master controller according to the name of the synchronization file. When the slave controller detects that the file already exists locally, it compares the file size and checksum. If they match, there is no need to download the file. If they do not match, the file is deleted and then downloaded again.

[0065] S36: After the slave controller completes the download, it synchronizes the result to the master controller. Once all online slave controllers have completed the download, the master controller ends the synchronization process.

[0066] A computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the data synchronization method described in any one of the preceding claims.

[0067] An electronic device includes: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include the data synchronization method described in any one of the preceding claims.

[0068] This invention provides a data synchronization method, device, and medium for ship navigation system integration, which ensures the integrity and accuracy of system integration. Figure 1 The diagram illustrates the connection of the integrated ship navigation system described in this embodiment. It includes multiple multi-functional nodes interconnected via a dual-redundant ring network. The network also includes switches, sensor adapters, navigation sensors, IP radar, and other equipment. By employing the data synchronization method, equipment, and media described in this invention, each node can achieve real-time synchronization of data and operations. The master-slave election and arbitration mechanisms operate automatically in the background, transparent to the user, but ensuring synchronization of human-machine operations and consistency of calculated data. Users can therefore access all system functions and data on all nodes, including navigation sensor data management, planned route monitoring, radar transceiver control, and chart data installation. Figure 2 The diagram illustrates the principle of the data synchronization method. First, each node establishes a one-to-one TCP connection with other nodes, forming a reliable data distribution network to ensure that data sent by any node can be received by other nodes. Second, a data distribution mechanism is established based on a publish-subscribe pattern. Functional components specify domains and keywords when sending data, and remote nodes push the data to the corresponding functional components based on this information. Third, the functional components of each node conduct master-slave election through data distribution to ensure consistency in the identity of the master and slave controllers. Fourth, data processed and instructions issued by the slave controllers must first be aggregated to the master controller for arbitration. Finally, after resolving data conflicts or completing control actions, the master controller distributes the final data to the slave controllers to maintain state consistency.

[0069] Example 1

[0070] like Figure 5 The figure shown is a mission 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 navigation system's multiple nodes are started, the initialization of its internal functional components is completed. Depending on the configuration, the method by which these components determine master / slave roles varies. The chart data installation component obtains its master / slave role assignment according to predefined settings, while the sensor management component and route monitoring component obtain their roles through election. The chart data installation component master initializes the FTP server settings, enabling chart data installation operations for users. The sensor management component master is responsible for receiving raw sensor messages, processing them into sampled data using a parser, then performing compensation, deduction, and quality assessment on the acquired sampled data, and finally distributing the results to the slave controllers.

[0072] When performing chart installation, the navigation system first imports ENC data from the main controller via a removable storage device, then performs chart installation and synchronization. The chart data installation component automatically installs the ENC data, converting it into SENC data directly usable on electronic charts. Simultaneously, it copies the imported ENC data to a shared path on the FTP server, calculates the size and checksum of each data file, and distributes the resulting ENC file list to the slave controllers. The main controller updates the file synchronization progress in real-time based on the file transfer status reports from the slave controllers. Once all slave controllers have completed downloading the ENC data, data synchronization ends, and the component automatically deletes all files from the shared path on the FTP server. After receiving the ENC file list from the main controller, the chart data installation component on each slave controller downloads the files from the FTP server one by one. Upon completion of each file download, it compares the file size and checksum with the information in the list, generates a file transfer status report, and distributes it to the main controller to report whether the file transfer was successful. Once all files have been downloaded, the component automatically installs these ENC files, converting them into SENC data directly usable on electronic charts. After installation, the component automatically deletes all downloaded ENC files.

[0073] When the navigation system performs route monitoring tasks, the user first loads the route. The route monitoring component in the background then synchronizes the instruction type (loading), basic route data (waypoint coordinates, route segment deviation threshold, planned speed), and route detection data (whether there are any anomalies in the route detection and the specific reasons for each anomaly) to the main controller. After loading the route, the main controller performs route monitoring calculations and obtains route monitoring parameters such as the next waypoint number, distance, bearing, current deviation distance, and ETA, which are then synchronized to all devices.

[0074] When the navigation system performs radar transceiver control tasks, the user first obtains transceiver control permissions, and the radar transceiver management component in the background issues a request. Upon receiving the request, the master controller determines whether to allow the node to obtain transceiver control rights based on the preset "node-transceiver" permission management configuration. If the request is approved, the master controller issues permission and synchronizes the latest "node-transceiver" control rights allocation table to the slave controllers. If the node can obtain control rights, the user can perform transceiver transmission / standby control operations on that node, as well as adjust screen settings such as gain and clutter suppression.

[0075] To optimize the production process and reduce costs of integrated ship navigation systems, it is necessary to adopt standardized components on a large scale during production to reduce equipment costs, control labor and time costs during delivery and deployment, and address the challenges of diverse and rapidly changing shipowner demands, requiring high system reliability during operation. This involves establishing a data synchronization mechanism to ensure data consistency and handle potential data conflicts, and building the system based on this mechanism. Standardized equipment and unified network interfaces simplify system design and integration. Dynamic configurability allows the system to handle complex and changing requirements. Standardized, automated, and engineered management of the system configuration process effectively controls project delivery risks and meets customized needs in different scenarios.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them; although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can still be made to the specific implementation of the invention or equivalent substitutions can be made to some technical features without departing from the spirit of the technical solutions of the present invention, and all such modifications and substitutions should be covered within the scope of the technical solutions claimed in the present invention.

Claims

1. A data synchronization method for achieving the integration requirements of a ship navigation system, characterized in that, The method specifically includes the following steps: S1, Construct a data distribution mechanism, which includes a transport layer, a session layer, a presentation layer, and an application layer. The transport layer uses TCP connections, 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, and then sends and receives data over the network, and the application layer adopts a publish-subscribe pattern to implement asynchronous communication and an event-driven architecture. S2, Construct an arbitration mechanism. The arbitration mechanism determines the master-slave mode by distributing and processing arbitration information. Multiple functional components run within the nodes of the ship navigation system. The same functional component elects the master and slave controllers through the data distribution mechanism between nodes. The master controller is responsible for distributing its own data or distributing the data received from the slave controllers after arbitration. S3 constructs a large-scale data transmission mechanism, utilizing data distribution, conflict arbitration, and FTP transfer to achieve large file data synchronization. The master controller is responsible for file distribution, first distributing the file names, sizes, and checksums of the files to be synchronized to the slave controllers. The slave controllers use the FTP protocol to download the files from the master controller and remove redundant files, thus completing data synchronization.

2. The data synchronization method for achieving the integration requirements of a ship navigation system according to claim 1, characterized in that, The data distribution mechanism is specifically as follows: S11, based on the preset configuration data of the nodes of the ship navigation system, obtain the synchronous listening port, sending port and socket options; S12, nodes pair up with each other and establish TCP connections between nodes; select nodes as server and client based on IP address size; S13, each node of the ship navigation system is equipped with a message transceiver. The message transceiver is responsible for sending and receiving messages. A message is the smallest unit of a complete data synchronization process. The smallest unit includes data, data type, domain, and keyword. Functional components subscribe to synchronized data by registering data domains and keywords with the message transceiver. The message transceiver and the functional components inside the node operate in parallel. The message transceiver and the functional components adopt an event-driven communication method. S14, when the functional components within a node send synchronous data, they notify the message transceiver of the data along with the data field, keyword, and data type in an asynchronous event manner. The message transceiver processes the data field, keyword, and data type of the sent synchronous data into a serialized header, processes the sent data into a serialized body, and then concatenates the two into a message. Finally, it publishes the message to all nodes through a TCP connection. S15, after receiving the message, the message transceiver within the node extracts the data field, keyword, and data type from the serialization header in a fixed format, performs deserialization according to the data type, and pushes the data to the corresponding functional components of the node according to the data field and keyword, thus completing the data distribution.

3. The data synchronization method for achieving the integration requirements of a ship navigation system according to claim 1, characterized in that, The arbitration mechanism is specifically as follows: S21, start each node of the ship navigation system, initialize the internal functional components of the node. In the initialization state of the functional components, they default to a master-slave pending state and periodically distribute master control declaration messages to the outside world. If no master control declaration message is received from another functional component within 1 minute, the local functional component becomes the master; S22, the local functional component receives the master declaration message from the remote functional component and performs a master-slave election; based on the conditions, it determines whether to relinquish its master status and become a slave. S23, the slave controller starts a timer to listen for master control declaration messages from the master controller. If no master control declaration is received within the timeout period, the slave controller enters a master-slave standby state, distributes master control declaration messages to the outside world, and re-elects a new master controller according to the method in S22.

4. A data synchronization method for achieving the integration requirements of a ship navigation system according to claim 3, characterized in that, The specific conditions for master-slave election are as follows: 1) whether the remote functional component is designated as the master of the function; 2) whether the local functional component has lower privileges than the remote functional component; 3) whether the sequence 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 conducted in sequence. When any of the above conditions are met, the local functional component relinquishes its master status.

5. A data synchronization method for achieving 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 that task distributes the data to components on other nodes. After receiving the data, the other nodes merge it with their own data. For data that causes conflicts, after other nodes distribute the data, only the master controller has the right to receive the data and handle potential conflicts. After resolving the conflict, the master controller redistributes the conflict-free data, and other nodes receive the data and merge it with their own data.

6. A data synchronization method for achieving the integration requirements of a ship navigation system according to claim 1, characterized in that, The large-scale data transmission mechanism is specifically as follows: S31, each node of the ship navigation system obtains the master-slave control identity for local data transmission based on preset configuration data. According to the listening port number, username, password, file path, transmission mode and encryption settings of the FTP server, the master controller creates the FTP service during node initialization. S32, the data transmission function components of each node of the ship navigation system elect a master controller, and the master controller distributes large data files, which are nautical chart data files imported via optical disc; S33: After the master controller decides all the files to be synchronized, it initiates the synchronization process, saves the files in the file path of the FTP server, and synchronizes the name, size and checksum of each file to other nodes. S34, the slave controller obtains the 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 controller downloads the file from the master controller according to the name of the synchronization file. When the slave controller detects that the file already exists locally, it compares the file size and checksum. If they match, there is no need to download the file. If they do not match, the file is deleted and then downloaded again. S36: After the slave controller completes the download, it synchronizes the result to the master controller. Once all online slave controllers have completed the download, the master controller 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, it controls the device on which the computer-readable storage medium is located to perform 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 configured to be executed by the one or more processors, the one or more programs including methods for performing the data synchronization method according to 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