Ship power monitoring data processing method and device, electronic equipment and storage medium

By adopting a multi-node elastic writing approach in the ship power system monitoring service cluster, the reliability and consistency issues of ship power monitoring data processing were resolved, ensuring the stability and integrity of the data under abnormal conditions.

CN121833716APending Publication Date: 2026-04-10THE 711TH RES INST OF CHINA STATE SHIPBUILDING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing marine power system monitoring software platforms suffer from poor reliability and data consistency in processing marine power monitoring data.

Method used

A method for processing ship power monitoring data is adopted, in which the target power monitoring data is stored in a pre-written log file through the main monitoring service node, and a pre-written log copy is generated and sent to multiple slave monitoring service nodes. When preset conditions are met, the data is written to the local database, ensuring that the data is processed by the slave nodes when the main node fails, thus realizing elastic writing across multiple nodes.

Benefits of technology

This avoids data loss due to single-node failure during the writing process, improves the reliability and consistency of data processing, and ensures fault recovery even in abnormal situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833716A_ABST
    Figure CN121833716A_ABST
Patent Text Reader

Abstract

The invention discloses a ship power monitoring data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: enabling a main monitoring service node to respond to a data writing request for target power monitoring data, and storing the target power monitoring data into a pre-writing log file, marking the target power monitoring data as a first data state indicating that the target power monitoring data is not written into a database; generating a pre-write log copy based on the pre-write log file, and sending the pre-write log copy to a plurality of slave monitoring service nodes; and writing target power monitoring data in the pre-writing log file into a local database under the condition that the number of the slave monitoring service nodes receiving the pre-writing log copy meets a preset condition, and marking the target dynamic monitoring data in the pre-writing log file as a second data state indicating that the target dynamic monitoring data is written into the database. According to the invention, the processing reliability and the data consistency of the ship power monitoring data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of marine technology, specifically to a method, apparatus, electronic device, and storage medium for processing marine power monitoring data. Background Technology

[0002] Since ships operate independently at sea for extended periods, their power systems, as core components, require real-time monitoring and management using highly reliable monitoring software platforms. The reliability of these software systems is crucial for ensuring safe navigation, fault warnings, remote diagnosis, and maintenance of ships.

[0003] However, the ship power system monitoring software platform in related technologies suffers from poor reliability and data consistency in processing ship power monitoring data. Summary of the Invention

[0004] To address the problems of existing technologies, this application provides a method, apparatus, electronic device, and storage medium for processing ship dynamic monitoring data. The specific technical solution is as follows: On the one hand, a method for processing ship power monitoring data is provided, applied to a ship power system monitoring service cluster, wherein the ship power system monitoring service cluster includes a master monitoring service node and multiple slave monitoring service nodes, and the method includes: In response to a data write request for target power monitoring data, the main monitoring service node stores the target power monitoring data in a write-ahead log file and marks the target power monitoring data as a first data state; the first data state indicates that it has not been written to the database. The master monitoring service node generates a write-ahead log copy based on the write-ahead log file and sends the write-ahead log copy to the plurality of slave monitoring service nodes. If the number of slave monitoring service nodes that receive the write-ahead log copy meets a preset condition, the master monitoring service node writes the target power monitoring data in the write-ahead log file to the local database and marks the target power monitoring data in the write-ahead log file as a second data status, the second data status indicating that it has been written to the database.

[0005] In some embodiments, the method further includes: In response to receiving the pre-written log copy, the multiple monitoring service nodes read the target power monitoring data marked as the first data state from the pre-written log copy and write the target power monitoring data into the local database.

[0006] In some embodiments, the method further includes: If the primary monitoring service node is determined to be faulty, each of the secondary monitoring service nodes broadcasts a heartbeat message at its own preset time interval. Based on the heartbeat message broadcast results of each of the slave monitoring service nodes, a new master monitoring service node is determined from the plurality of slave monitoring service nodes; the new master monitoring service node is the slave monitoring service node that first sends the heartbeat message to the other slave monitoring service nodes. The new master monitoring service node updates the version information of the write-ahead log copy and synchronizes the updated version of the write-ahead log copy to the remaining slave monitoring service nodes.

[0007] In some embodiments, the method further includes: The main monitoring service node sends heartbeat messages to each of the slave monitoring service nodes at preset time intervals. If the multiple slave monitoring service nodes do not receive a heartbeat message from the master monitoring service node, then the master monitoring service node is determined to be faulty.

[0008] In some embodiments, the method further includes: The new primary monitoring service node carries a log index marker in the heartbeat message sent to the secondary monitoring service node, the log index marker indicating the latest updated log index; By obtaining the log index marker from the heartbeat message from the monitoring service node, the log record corresponding to the log index marker in the latest version of the write-ahead log copy is written to the local database.

[0009] In some embodiments, the method further includes: Based on a redundant communication network structure, a network communication link is constructed between each monitoring service node in the ship power system monitoring service cluster; the redundant communication network structure includes a ring network and a dual-star network. The current communication transmission link is determined based on the constructed network communication link.

[0010] In some embodiments, the method further includes: Monitor the current link status of the communication transmission link and obtain the current link status monitoring results; If the current link status monitoring result indicates a link anomaly, a communication transmission link switch is performed based on the constructed network communication link.

[0011] On the other hand, a ship power monitoring data processing device is provided, configured in a ship power system monitoring service cluster, the ship power system monitoring service cluster including a master monitoring service node and multiple slave monitoring service nodes, the device comprising: The write-ahead log unit is configured to respond to a data write request for target power monitoring data through the main monitoring service node, store the target power monitoring data in a write-ahead log file, and mark the target power monitoring data as a first data state; the first data state indicates that it has not been written to the database; The log copy sending unit is configured to generate a write-ahead log copy based on the write-ahead log file through the main monitoring service node, and send the write-ahead log copy to the plurality of slave monitoring service nodes; The data entry unit is configured to, when the number of slave monitoring service nodes receiving the pre-written log copy meets a preset condition, write the target power monitoring data in the pre-written log file to the local database, and mark the target power monitoring data in the pre-written log file as a second data status, the second data status indicating that it has been written to the database.

[0012] In some implementations, the data entry unit is further configured to, in response to receiving the pre-written log copy from the plurality of monitoring service nodes, read the target power monitoring data marked with the first data state from the pre-written log copy, and write the target power monitoring data into a local database.

[0013] In some embodiments, the apparatus further includes: The heartbeat broadcasting unit is configured to broadcast heartbeat messages through each of the slave monitoring service nodes at their respective preset time intervals when it is determined that the main monitoring service node has failed. The new master node determination unit is configured to determine a new master monitoring service node from the plurality of slave monitoring service nodes based on the heartbeat message broadcast results of each slave monitoring service node; the new master monitoring service node is the slave monitoring service node that first sends the heartbeat message to the other slave monitoring service nodes. The log replica update unit is configured to update the version information of the write-ahead log replica through the new master monitoring service node, and synchronize the updated latest version of the write-ahead log replica to the remaining slave monitoring service nodes.

[0014] In some embodiments, the apparatus further includes: The failure monitoring unit is configured to send heartbeat messages to each of the slave monitoring service nodes at preset time intervals through the master monitoring service node; if the slave monitoring service nodes do not receive the heartbeat message from the master monitoring service node, the master monitoring service node is determined to be faulty.

[0015] In some embodiments, the apparatus further includes: The log index sending unit is configured to carry a log index tag in the heartbeat message sent by the new primary monitoring service node to the secondary monitoring service node, the log index tag indicating the latest updated log index; The data update unit is configured to obtain the log index marker from the heartbeat message from the monitoring service node, and write the log record corresponding to the log index marker in the latest version of the write-ahead log copy to the local database.

[0016] In some embodiments, the apparatus further includes: The network communication link construction unit is configured to construct network communication links between monitoring service nodes in the ship power system monitoring service cluster based on a redundant communication network structure; the redundant communication network structure includes a ring network and a dual-star network. A communication transmission link determination module is used to determine the current communication transmission link based on the constructed network communication link.

[0017] In some embodiments, the apparatus further includes: The link status unit is configured to monitor the link status of the current communication transmission link and obtain the current link status monitoring result; The communication transmission link switching unit is configured to switch the communication transmission link based on the constructed network communication link when the current link status monitoring result indicates that the link is abnormal.

[0018] On the other hand, an electronic device is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the ship dynamic monitoring data processing method of any of the above aspects.

[0019] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the ship dynamic monitoring data processing method of any of the above aspects.

[0020] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the ship dynamic monitoring data processing method of any of the above aspects.

[0021] The ship power monitoring data processing method of this application embodiment, in response to a data write request for target power monitoring data, stores the target power monitoring data in a pre-written log file and marks the target power monitoring data as a first data state, indicating that it has not been written to the database. The target power monitoring data indicates the power parameters of the ship's power system. Then, the main monitoring service node generates a pre-written log copy based on the pre-written log file and sends the pre-written log copy to multiple slave monitoring service nodes. When it is determined that the number of slave monitoring service nodes receiving the pre-written log copy meets a preset condition, the main monitoring service node writes the target power monitoring data in the pre-written log file to the local database and marks the target power monitoring data in the pre-written log file as a second data state indicating that it has been written to the database. This multi-node elastic writing method of "log first, data later" avoids the problem of data loss caused by the failure of a single node during the writing process, ensuring that even if an anomaly occurs during operation, fault recovery can be performed based on the pre-written log file, thus improving the reliability and data consistency of ship power monitoring data processing. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a method for processing ship power monitoring data provided in an embodiment of this application; Figure 2 This is another flowchart illustrating the ship power monitoring data processing method provided in the embodiments of this application; Figure 3 This is another flowchart illustrating the ship power monitoring data processing method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the ship power monitoring data processing device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0026] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0027] "A and / or B" includes the following three combinations: A only, B only, and a combination of A and B.

[0028] The use of “based on” in this application implies openness and inclusivity, because processes, steps, calculations or other actions “based on” one or more of the stated conditions or values ​​may in practice be based on additional conditions or values ​​beyond those stated.

[0029] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0030] Please see Figure 1 The diagram illustrates a flowchart of a ship power monitoring data processing method provided in this application. This method can be applied to a ship power system monitoring service cluster, which includes multiple monitoring service nodes that can provide monitoring services for the ship power system. Specifically, the multiple monitoring service nodes include a master monitoring service node and multiple slave monitoring service nodes.

[0031] It should be noted that the nodes mentioned in the embodiments of this application can be servers. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0032] It should be noted that this specification provides the operational steps of the methods described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual system or product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown... Figure 1 As shown, the ship dynamics monitoring data processing method may include: S101, in response to the data write request for the target power monitoring data by the main monitoring service node, the target power monitoring data is stored in the pre-written log file and the target power monitoring data is marked as the first data state.

[0033] The first data status indication is not written to the database. The target power monitoring data can indicate the system parameters of the monitored ship power system.

[0034] S103, the master monitoring service node generates a write-ahead log copy based on the write-ahead log file and sends the write-ahead log copy to the multiple slave monitoring service nodes.

[0035] S105, if the number of slave monitoring service nodes that have received the write-ahead log copy meets a preset condition, the target power monitoring data in the write-ahead log file is written to the local database through the master monitoring service node, and the target power monitoring data in the write-ahead log file is marked as a second data status, the second data status indicating that it has been written to the database.

[0036] The preset condition can be that more than half of the slave monitoring service nodes receive the write-ahead log copy. For example, if the total number of slave monitoring service nodes is 5, then the preset condition can be that the number of slave monitoring service nodes receiving the write-ahead log copy is greater than or equal to 3. Therefore, when 3 slave monitoring service nodes receive the write-ahead log copy, the target power monitoring data in the write-ahead log file can be written to the local database of the master monitoring service node through the master monitoring service node.

[0037] It should be noted that in this embodiment, the primary monitoring service node can be determined through a flexible competition mechanism. Specifically, each monitoring service node in the marine power system monitoring service cluster possesses complete candidate node capabilities, including a unique node identifier, a complete operating environment, and healthy equipment and network status. Each monitoring service node sets a broadcast heartbeat message transmission interval, which can be a random number, typically 1 to 3 seconds. Based on this interval, each time the marine power system monitoring service cluster powers on, the monitoring service node that first broadcasts a heartbeat message becomes the primary monitoring service node. Other monitoring service nodes automatically set their node status to slave node upon receiving the heartbeat message from the primary monitoring service node. Thus, the multiple monitoring service nodes other than the primary monitoring service node are referred to as multiple slave monitoring service nodes.

[0038] The above implementation method avoids data loss caused by the failure of a single node to be written to the database in the event of a single node failure during the writing process. It ensures that even if an anomaly occurs during operation, fault recovery can be performed based on the pre-written log file, thereby improving the reliability and data consistency of ship power monitoring data processing.

[0039] In some implementations, the method may further include: In response to receiving the pre-written log copy, the multiple monitoring service nodes read the target power monitoring data marked as the first data state from the pre-written log copy and write the target power monitoring data into the local database.

[0040] Understandably, after the monitoring service node writes the target power monitoring data to the local database, it can mark the target power monitoring data in the write-ahead log copy as a second data state indicating that it has been written to the database, thereby ensuring data consistency between the master monitoring service node and the slave monitoring service node.

[0041] In some implementations, please refer to Figure 2 The diagram shown is a flowchart illustrating another method for processing ship power monitoring data provided in this application embodiment. Figure 2 As shown, the method may further include: S201, if it is determined that the main monitoring service node has failed, each of the slave monitoring service nodes broadcasts a heartbeat message at its own preset time interval.

[0042] For example, the primary monitoring service node can send heartbeat messages to each secondary monitoring service node at preset time intervals. If multiple secondary monitoring service nodes do not receive a heartbeat message from the primary monitoring service node, the primary monitoring service node is determined to be faulty. The preset time interval can be set based on practical experience, for example, it can be a random number interval of 1 to 3 seconds. Specifically, the primary monitoring service node can be determined to be faulty if more than half of the secondary monitoring service nodes do not receive a heartbeat message from the primary monitoring service node, or it can be determined to be faulty if all secondary monitoring service nodes do not receive a heartbeat message from the primary monitoring service node, thereby improving the accuracy of fault determination.

[0043] The preset time interval for broadcasting heartbeat messages by each monitoring service node can be the same or different. In this embodiment, the preset time interval for broadcasting heartbeat messages by each monitoring service node is the same, and can be a random number of 1 to 3 seconds.

[0044] S203, based on the heartbeat message broadcast results of each of the slave monitoring service nodes, determine a new master monitoring service node from the plurality of slave monitoring service nodes.

[0045] The new master monitoring service node is the slave monitoring service node that first sends heartbeat messages to other slave monitoring service nodes. The heartbeat message broadcast results of each slave monitoring service node indicate whether the corresponding slave monitoring service node's heartbeat message has been sent to other slave monitoring service nodes, and the order in which they were sent.

[0046] S205, the version information of the write-ahead log copy is updated through the new master monitoring service node, and the updated version of the write-ahead log copy is synchronized to the remaining slave monitoring service nodes.

[0047] Specifically, the version information of the write-ahead log replica can increment with the number of times the primary monitoring service node is switched. That is, the version of the write-ahead log replica increases by 1 each time the primary monitoring service node is switched. After the new primary monitoring service node updates the version information of the write-ahead log replica, it synchronizes the latest version of the write-ahead log replica to the remaining secondary monitoring service nodes, thereby ensuring the data consistency of the remaining monitoring service nodes.

[0048] In some implementations, the method may further include: the new master monitoring service node carrying a log index marker in a heartbeat message sent to the slave monitoring service node, the log index marker indicating the latest updated log index; the slave monitoring service node obtaining the log index marker from the heartbeat message and writing the log record corresponding to the log index marker in the latest version of the write-ahead log copy to a local database.

[0049] Specifically, after the new master monitoring service node synchronizes the latest version of the write-ahead log copy to the remaining slave monitoring service nodes, the new master monitoring service node can carry a log index marker in the heartbeat message sent to the slave monitoring service nodes. This log index marker indicates the latest updated log index, so each slave monitoring service node can obtain the log index marker from the received heartbeat message and write the log record corresponding to the log index marker in the latest version of the write-ahead log copy to the local database, further improving the data consistency between different monitoring service nodes.

[0050] In some implementations, please refer to Figure 3 The diagram shown is a flowchart illustrating another method for processing ship power monitoring data provided in this application embodiment. Figure 3 As shown, before step S101, the method may further include: S301, Based on a redundant communication network structure, a network communication link is constructed between each monitoring service node in the ship power system monitoring service cluster; the redundant communication network structure includes a ring network and a dual-star network.

[0051] Specifically, Turbo Ring and Turbo Chain technologies can be used to form a redundant ring network of monitoring service nodes. Based on this, the network can be connected through inter-ring coupling to achieve maximum network redundancy. As long as there is a physical path between two sites, communication between the sites can be guaranteed.

[0052] S303, determine the current communication transmission link based on the constructed network communication link.

[0053] Specifically, the current communication transmission link can be any of the redundant communication network structures, and can be configured based on actual needs. The various monitoring service nodes of the ship propulsion system monitoring service cluster can communicate through the current communication transmission link.

[0054] The above implementation method enables the ship power system monitoring service cluster to have redundant communication capabilities. After the current communication transmission link is disconnected, it can switch to another link, realizing high availability connection between multiple communication paths. This ensures that data transmission is not interrupted in the event of a failure of a certain communication path, thereby improving the stability and reliability of ship power monitoring data processing.

[0055] See also Figure 3 After step S303, the method may further include: S305, monitor the link status of the current communication transmission link and obtain the current link status monitoring result.

[0056] S307, if the current link status monitoring result indicates that the link is abnormal, the communication transmission link is switched based on the constructed network communication link.

[0057] Specifically, the current link status of a communication transmission link can be characterized by key parameters such as network status, latency, and packet loss. The current link status monitoring result indicates whether the link is abnormal. This is achieved by comparing the monitored key parameters of the current communication transmission link with preset threshold parameters, such as a packet loss rate threshold. If the packet loss rate of the current communication transmission link is greater than or equal to the threshold, a current link status monitoring result indicating an abnormal link is generated; conversely, if the packet loss rate is less than the threshold, a current link status monitoring result indicating a normal link is generated.

[0058] In this embodiment of the application, when the current link status monitoring result indicates that the link is abnormal, the communication transmission link is switched based on the network communication link constructed in the aforementioned step S301. This enables seamless communication transmission link switching within milliseconds, ensuring high reliability and service continuity of the communication link.

[0059] Corresponding to the ship power monitoring data processing methods provided in the above embodiments, this application also provides a ship power monitoring data processing device. Since the ship power monitoring data processing device provided in this application corresponds to the ship power monitoring data processing methods provided in the above embodiments, the implementation methods of the aforementioned ship power monitoring data processing methods are also applicable to the ship power monitoring data processing device provided in this embodiment, and will not be described in detail in this embodiment.

[0060] Please see Figure 4 The diagram shows a structural schematic of a ship power monitoring data processing device provided in an embodiment of this application. This device has the function of implementing the ship power monitoring data processing method described in the above-described method embodiments. This function can be implemented by hardware or by hardware executing corresponding software. Specifically, this ship power monitoring data processing device is configured in a ship power system monitoring service cluster, which includes a master monitoring service node and multiple slave monitoring service nodes, such as... Figure 4 As shown, the ship dynamics monitoring data processing device 400 may include: The write-ahead log unit 410 is configured to respond to a data write request for target power monitoring data through the main monitoring service node, store the target power monitoring data in a write-ahead log file, and mark the target power monitoring data as a first data state; the first data state indicates that it has not been written to the database; Log copy sending unit 420 is configured to generate a write-ahead log copy based on the write-ahead log file through the main monitoring service node, and send the write-ahead log copy to the plurality of slave monitoring service nodes; The data entry unit 430 is configured to, when the number of slave monitoring service nodes receiving the pre-written log copy meets a preset condition, write the target power monitoring data in the pre-written log file to the local database, and mark the target power monitoring data in the pre-written log file as a second data status, the second data status indicating that it has been written to the database.

[0061] In some implementations, the data entry unit 430 is further configured to, in response to receiving the write-ahead log copy from the plurality of monitoring service nodes, read the target power monitoring data marked as the first data state in the write-ahead log copy, and write the target power monitoring data into a local database.

[0062] In some embodiments, the device 400 further includes: The heartbeat broadcasting unit is configured to broadcast heartbeat messages through each of the slave monitoring service nodes at their respective preset time intervals when it is determined that the main monitoring service node has failed. The new master node determination unit is configured to determine a new master monitoring service node from the plurality of slave monitoring service nodes based on the heartbeat message broadcast results of each slave monitoring service node; the new master monitoring service node is the slave monitoring service node that first sends the heartbeat message to the other slave monitoring service nodes. The log replica update unit is configured to update the version information of the write-ahead log replica through the new master monitoring service node, and synchronize the updated latest version of the write-ahead log replica to the remaining slave monitoring service nodes.

[0063] In some embodiments, the device 400 further includes: The failure monitoring unit is configured to send heartbeat messages to each of the slave monitoring service nodes at preset time intervals through the master monitoring service node; if the slave monitoring service nodes do not receive the heartbeat message from the master monitoring service node, the master monitoring service node is determined to be faulty.

[0064] In some embodiments, the device 400 further includes: The log index sending unit is configured to carry a log index tag in the heartbeat message sent by the new primary monitoring service node to the secondary monitoring service node, the log index tag indicating the latest updated log index; The data update unit is configured to obtain the log index marker from the heartbeat message from the monitoring service node, and write the log record corresponding to the log index marker in the latest version of the write-ahead log copy to the local database.

[0065] In some embodiments, the device 400 further includes: The network communication link construction unit is configured to construct network communication links between monitoring service nodes in the ship power system monitoring service cluster based on a redundant communication network structure; the redundant communication network structure includes a ring network and a dual-star network. A communication transmission link determination module is used to determine the current communication transmission link based on the constructed network communication link.

[0066] In some embodiments, the device 400 further includes: The link status unit is configured to monitor the link status of the current communication transmission link and obtain the current link status monitoring result; The communication transmission link switching unit is configured to switch the communication transmission link based on the constructed network communication link when the current link status monitoring result indicates that the link is abnormal.

[0067] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0068] This application also provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement any of the ship dynamic monitoring data processing methods provided in the above method embodiments.

[0069] The methods and embodiments provided in this application can be executed on a computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 5 This is a schematic diagram of the structure of an electronic device that performs a ship power monitoring data processing method according to an embodiment of this application. The electronic device can participate in or include the ship power monitoring data processing device provided in the embodiment of this application. Figure 5As shown, the server 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 510 (CPUs 510 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 530 for storing data, and one or more storage media 520 (e.g., one or more mass storage devices) for storing application programs 523 or data 522. The memory 530 and storage media 520 may be temporary or persistent storage. The program stored in the storage media 520 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 510 may be configured to communicate with the storage media 520 and execute the series of instruction operations stored in the storage media 520 on the server 500. Server 500 may also include one or more power supplies 560, one or more wired or wireless network interfaces 550, one or more input / output interfaces 540, and / or one or more operating systems 521, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0070] The input / output interface 540 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 500. In one example, the input / output interface 540 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 540 may be a radio frequency (RF) module used for wireless communication with the Internet.

[0071] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic equipment. For example, server 500 may also include... Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown.

[0072] Embodiments of this application also provide a computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a ship power monitoring data processing method. The at least one instruction or the at least one program is loaded and executed by the processor to implement any of the ship power monitoring data processing methods provided in the above-described method embodiments.

[0073] Embodiments of this application also provide a computer program product including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform any of the ship dynamic monitoring data processing methods provided in the above-described method embodiments.

[0074] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0075] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0076] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0077] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0078] The above provides a detailed description of a ship dynamic monitoring data processing method, apparatus, electronic device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method of processing data for monitoring the power of a marine vessel, characterized by, The method is applied to a ship power system monitoring service cluster, the ship power system monitoring service cluster comprises a master monitoring service node and a plurality of slave monitoring service nodes, and the method comprises the following steps: In response to a data write request for target power monitoring data, the master monitoring service node stores the target power monitoring data into a prewrite log file and marks the target power monitoring data as a first data state; the first data state indicates that the target power monitoring data has not been written into a database; The master monitoring service node generates a prewrite log copy based on the prewrite log file and sends the prewrite log copy to the plurality of slave monitoring service nodes; If the number of the slave monitoring service nodes that receive the prewrite log copy meets a preset condition, the master monitoring service node writes the target power monitoring data in the prewrite log file into a local database and marks the target power monitoring data in the prewrite log file as a second data state; the second data state indicates that the target power monitoring data has been written into the database.

2. The method of claim 1, wherein, The method further comprises the following steps: In response to receiving the prewrite log copy, the plurality of slave monitoring service nodes read target power monitoring data marked as the first data state in the prewrite log copy and write the target power monitoring data into a local database.

3. The method of claim 1, wherein, The method further comprises the following steps: If the master monitoring service node is determined to be invalid, each slave monitoring service node broadcasts a heartbeat packet at a preset time interval; According to the heartbeat packet broadcast results of the slave monitoring service nodes, a new master monitoring service node is determined from the plurality of slave monitoring service nodes; the new master monitoring service node is a slave monitoring service node that first sends a heartbeat packet to other slave monitoring service nodes; The new master monitoring service node updates version information of the prewrite log copy and synchronizes the updated latest version of the prewrite log copy to the remaining slave monitoring service nodes.

4. The method of claim 3, wherein, The method further comprises the following steps: The master monitoring service node sends a heartbeat packet to each slave monitoring service node at a preset time interval; If the plurality of slave monitoring service nodes do not receive the heartbeat packet from the master monitoring service node, the master monitoring service node is determined to be invalid.

5. The method of claim 3, wherein, The method further comprises the following steps: The new master monitoring service node carries a log index mark in the heartbeat packet sent to the slave monitoring service nodes; the log index mark indicates the latest updated log index; The slave monitoring service node obtains the log index mark from the heartbeat packet and writes a log record corresponding to the log index mark in the latest version of the prewrite log copy into a local database.

6. The method of claim 1, wherein, The method further comprises the following steps: Based on a redundant communication network structure, a network communication link between each monitoring service node in the ship power system monitoring service cluster is constructed; the redundant communication network structure comprises a ring network and a double-star network; Based on the constructed network communication link, a current communication transmission link is determined.

7. The method of claim 6, wherein, The method further comprises the following steps: The link state of the current communication transmission link is monitored to obtain a current link state monitoring result; In a case where the current link state monitoring result indicates a link exception, a communication transmission link is switched based on the constructed network communication link.

8. A marine power monitoring data processing apparatus, characterized by, The device is configured in a ship power system monitoring service cluster, and the ship power system monitoring service cluster includes a master monitoring service node and a plurality of slave monitoring service nodes. A pre-write log unit is configured to store, by the master monitoring service node, target power monitoring data into a pre-write log file in response to a data write request for the target power monitoring data, and mark the target power monitoring data as a first data state; the first data state indicates that the target power monitoring data is not written into a database; A log copy sending unit is configured to generate, by the master monitoring service node, a pre-write log copy based on the pre-write log file, and send the pre-write log copy to the plurality of slave monitoring service nodes; A data warehousing unit is configured to write, by the master monitoring service node, the target power monitoring data in the pre-write log file into a local database in a case where a quantity of the slave monitoring service nodes that receive the pre-write log copy satisfies a preset condition, and mark the target power monitoring data in the pre-write log file as a second data state; the second data state indicates that the target power monitoring data is written into the database.

9. The apparatus of claim 7, wherein, The device further includes: A heartbeat broadcasting unit is configured to broadcast, by each of the slave monitoring service nodes, a heartbeat packet at a preset time interval in a case where the master monitoring service node is determined to be invalid; A new master node determining unit is configured to determine, from the plurality of slave monitoring service nodes, a new master monitoring service node according to a result of heartbeat packet broadcasting of each of the slave monitoring service nodes; the new master monitoring service node is a slave monitoring service node that first sends a heartbeat packet to other slave monitoring service nodes; A log copy updating unit is configured to update, by the new master monitoring service node, version information of the pre-write log copy, and synchronize the updated latest version of the pre-write log copy to the remaining slave monitoring service nodes.

10. An electronic device, comprising: The device includes a processor and a memory, and the memory stores at least one instruction or at least one program; the at least one instruction or the at least one program is loaded and executed by the processor to implement the ship power monitoring data processing method according to any one of claims 1-7.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores at least one instruction or at least one program; the at least one instruction or the at least one program is loaded and executed by the processor to implement the ship power monitoring data processing method according to any one of claims 1-7.

12. A computer program product, characterised in that, The device includes a computer program, and the computer program is executed by the processor to implement the ship power monitoring data processing method according to any one of claims 1-7.