Real-time alarm reminding generation method, system and equipment based on ship multi-positioning-source data and storage medium

By performing first- and second-level consumption processing and MQ theme splitting and decoupling processing on ship multi-position source data, combining the consumption retry mechanism and timing task compensation mechanism, the performance problems during ship multi-position source data processing are solved, and the timeliness and stability of real-time alarm reminders are improved.

CN119832768APending Publication Date: 2025-04-15GUANGDONG ESHORE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411972219.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

When processing data of multiple positioning sources of ships, due to large data volume, high concurrency volume and complex alarm policy conditions, transaction timeout, frequent Full GC, and fierce resource competition, resulting in Pod instance restart and Node deadlock, reducing service availability and reducing alarm record timeliness.

Method used

By performing first- and second-level consumption processing on ship multi-position source data, the data and alarm strategy are efficiently matched, the MQ theme splitting and decoupling processing is adopted, and the consumption retry mechanism and the timing task compensation mechanism are combined to improve the timeliness and stability of real-time alarm reminders.

Benefits of technology

It improves the matching efficiency of ship multi-position source data and multi-type alarm strategies, improves the timeliness, consistency and stability of real-time alarm reminders, and ensures high availability and timeliness of alarm information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832768A_ABST
    Figure CN119832768A_ABST
Patent Text Reader

Abstract

The invention relates to a real-time alarm reminding generation method, system and device based on ship multi-positioning-source data and a storage medium. The method comprises the following steps: acquiring first-level positioning data and writing the first-level positioning data into a corresponding first-level MQ theme; performing first-level consumption processing on the first-level positioning data in the first-level MQ theme to obtain second-level positioning data combined by the first-level positioning data and an alarm strategy type; writing the second-level positioning data into a corresponding second-level MQ theme; performing second-level consumption processing on the second-level positioning data in the second-level MQ theme, and judging whether an alarm triggering condition is met or not; and if yes, generating alarm reminding information and sending the alarm reminding information to corresponding alarm reminding personnel. According to the scheme provided by the invention, the large-batch multi-positioning-source data of the ship can be split and decoupled, the efficient matching of the multi-positioning-source data of the ship and the alarm strategy type is realized, and the timeliness, consistency and stability of real-time alarm reminding are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of ship safety alarms, and in particular to a method, system, device and storage medium for generating real-time alarm reminders based on multi-positioning source data of ships. Background Art

[0002] Ships can obtain location data through a variety of positioning sources, such as global satellite navigation systems (such as GPS, Beidou, etc.), marine satellite broadband (ship-borne satellite stations), Tiantong satellite narrowband (ship-borne Tiantong terminals), etc. These different positioning sources can provide a number of positioning-related data such as the longitude and latitude of the ship. In order to achieve the purpose of monitoring, management and safety assurance of ships, the positioning data of multiple positioning sources must first be reported to the monitoring center, shipping management system or other related management platforms to track the position of the ship, judge the status of the ship, and promptly warn relevant personnel to take corresponding measures when abnormal situations occur.

[0003] After the ship's multi-positioning source positioning data is reported, it can automatically trigger the generation of alarm records based on the ship's positioning and the configuration of the alarm strategy. However, due to the large amount of positioning data, high concurrency, and complex trigger conditions set in the alarm strategy, the online running environment has transaction timeouts and frequent Full GC in some scenarios, which in turn leads to resource competition between the Node nodes where the relevant Pod instances are located in the K8S cluster. Due to fierce competition, the Pod instances will be restarted continuously, and even the Node nodes will be deadlocked, reducing service availability, and the alarm records cannot be generated and processed in time, which reduces the timeliness and cannot play a good role in timely alarms. Summary of the invention

[0004] In order to solve or partially solve the problems existing in the related technology, the present application provides a real-time alarm reminder generation method, system, device and storage medium based on ship multi-positioning source data, which can split and decouple large quantities of ship multi-positioning source data, realize efficient matching of ship multi-positioning source data with alarm strategy types, and improve the timeliness, consistency and stability of real-time alarm reminders.

[0005] The first aspect of the present application provides a real-time alarm reminder generation method based on multi-positioning source data of a ship, comprising: Get the first-level positioning data and write it into the corresponding first-level MQ topic; Performing a first-level consumption process on the first-level positioning data in the first-level MQ topic to obtain second-level positioning data that is a combination of the first-level positioning data and an alarm strategy type; Writing the secondary positioning data into the corresponding secondary MQ topic; Perform secondary consumption processing on the secondary positioning data in the secondary MQ topic to determine whether the alarm triggering condition is met; if so, generate alarm reminder information and send it to the corresponding alarm reminder personnel.

[0006] In some implementations of the present application, performing a first-level consumption process on the first-level positioning data in the first-level MQ topic to obtain second-level positioning data combined with the first-level positioning data and the alarm strategy type includes: Compare the first-level positioning data in the first-level MQ topic with the preset alarm strategy list, and determine whether it meets the preset conditions of the alarm strategy; If the condition is satisfied, the primary positioning data is combined with the corresponding alarm strategy type to obtain the secondary positioning data.

[0007] In some implementations of the present application, obtaining the primary positioning data and writing it into the corresponding primary MQ topic includes: Receive real-time positioning data; The real-time positioning data is grouped and processed based on the positioning source of the real-time positioning data to obtain primary positioning data, which is written into a corresponding primary MQ topic.

[0008] In some embodiments of the present application, the method further comprises: When the consumption processing fails, the abnormal data generated by the failure is written into the consumption abnormality table, and the task abnormality compensation processing is performed on the abnormal data in the consumption abnormality table.

[0009] In some embodiments of the present application, when the consumption processing fails, the abnormal data generated by the failure is written into a consumption abnormality table, and task abnormality compensation processing is performed on the abnormal data in the consumption abnormality table, including: When the consumption process fails, the consumption process is repeated until the number of repeated consumption process failures exceeds a preset threshold, generating abnormal data and writing it into a consumption abnormality table; Perform timed task compensation processing on the abnormal data in the consumption abnormality table.

[0010] In some implementations of the present application, the performing of scheduled task compensation processing on the abnormal data in the consumption abnormality table includes: Determine the type of the abnormal data in the consumption abnormality table; the type of the abnormal data includes primary abnormal data and secondary abnormal data; The abnormal data is processed for data reproduction according to the type of the abnormal data to obtain reproduction positioning data, which is written into the corresponding MQ topic, and the identifier and processing status corresponding to the reproduction positioning data in the MQ topic are updated; the reproduction positioning data includes primary positioning data and secondary positioning data.

[0011] The second aspect of the present application provides a real-time alarm reminder generation system based on multi-positioning source data of ships, comprising: The first-level production unit is used to obtain the first-level positioning data and write it into the corresponding first-level MQ topic; A primary consumption unit, used for performing primary consumption processing on the primary positioning data in the primary MQ topic to obtain secondary positioning data which is a combination of the primary positioning data and an alarm strategy type; A secondary production unit, used for writing the secondary positioning data into a corresponding secondary MQ topic; The secondary consumption unit is used to perform secondary consumption processing on the secondary positioning data in the secondary MQ topic to determine whether the alarm triggering condition is met; if so, generate alarm reminder information and send it to the corresponding alarm reminder personnel.

[0012] In some embodiments of the present application, the system further includes a task exception compensation system for writing the abnormal data generated by the failure into a consumption exception table when the consumption processing fails, and performing task exception compensation processing on the abnormal data in the consumption exception table.

[0013] A third aspect of the present application provides an electronic device, including: Processor; and The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method as described above.

[0014] A fourth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described above.

[0015] The technical solution provided by the present application may include the following beneficial effects: by performing primary and secondary consumption processing on the multi-positioning source positioning data of a ship, it is possible to achieve efficient matching of the multi-positioning source positioning data of a ship with the multi-type alarm strategy type, improve the efficiency of generating real-time alarm reminders, and improve the timeliness of alarm reminders. Among them, the primary consumption processing can process the positioning data of the full amount of multi-positioning sources, split and decouple them, and the secondary consumption processing can match the split single positioning source positioning data with the alarm strategy type, thereby splitting a large amount of positioning data into small businesses of multi-positioning source positioning data and multi-type alarm strategies, achieving efficient matching of multi-positioning source positioning data with multi-type alarm strategy types, and improving the timeliness of alarm reminders.

[0016] The technical solution of the present application can also: through the automatic retry mechanism and the scheduled task compensation mechanism in the failure scenario after the first and second level consumption processing, it can ensure the high timeliness of business functions while improving high availability and ensuring the consistency and stability of alarm reminders.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail the exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0019] Figure 1 It is a flowchart of a method for generating a real-time alarm reminder based on multi-positioning source data of a ship, as shown in the first embodiment of the present application; Figure 2 It is a flow chart of a method for generating a real-time alarm reminder based on multi-positioning source data of a ship, as shown in the second embodiment of the present application; Figure 3 It is a schematic diagram of the MQ consumer retry mechanism shown in an embodiment of the present application; Figure 4 is a schematic diagram of a timed task compensation mechanism shown in an embodiment of the present application; Figure 5 It is a structural diagram of a real-time alarm reminder generation system based on multi-positioning source data of a ship shown in Example 1 of the present application; Figure 6 It is a structural diagram of a real-time alarm reminder generation system based on multi-positioning source data of a ship shown in Example 2 of the present application; Figure 7 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0021] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0022] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0023] I. Explanation of terms The Full GC (Full Garbage Collection) described in this article is a garbage collection mechanism in the Java Virtual Machine (JVM) that is used to recycle objects that are no longer used in the entire heap memory. Compared with other partial garbage collection methods (such as Minor GC, etc.), the overhead of Full GC is usually greater, and may cause a short pause in the program during execution.

[0024] The K8S cluster described in this article is Kubernetes, an open source system for automatically deploying, scaling, and managing containerized applications. It can provide a platform to manage containerized workloads and services, and facilitate operations such as container orchestration.

[0025] The Pod described in this article is the smallest deployable computing unit that can be created and managed in Kubernetes. It can contain one or more closely related containers that share storage, network and other resources to jointly perform specific functions.

[0026] The Node described in this article refers to a physical machine or virtual machine in a Kubernetes cluster. It is the host for running Pods. Multiple Pods can run on different Nodes. Nodes provide Pods with basic operating environments such as computing resources, storage resources, and networks.

[0027] The MQ (Message Queue) described in this article is a container that stores messages during transmission, and is used to achieve asynchronous communication and decoupling between applications. It is used to achieve efficient and reliable data exchange in distributed systems. It allows asynchronous communication between the sender and receiver of messages without the need to process the messages immediately, thereby improving the response speed and processing power of the system. The core structure includes producers, consumers, and message middleware. The producer is responsible for sending messages to the queue, and the consumer takes the messages from the queue and processes them. The message middleware is responsible for managing the storage, forwarding, and routing of messages.

[0028] The MQ topic described in this article is the top-level container in the message queue used to identify the logic of the same business. It allows the classification, isolation and distribution of messages, and supports multiple consumers to receive messages independently. Each topic contains multiple message queues, and the queue is the actual minimum storage unit of the message.

[0029] Rocket MQ described in this article is an open source distributed messaging middleware with the characteristics of high throughput and high availability. It can realize reliable messaging and asynchronous processing between different application systems, and is often used to cope with message communication scenarios in complex distributed systems.

[0030] The Broker mentioned in this article refers to the core service component of the message middleware in the Rocket MQ architecture. It is mainly responsible for receiving messages from producers, storing messages, and delivering messages to appropriate consumers, playing a key role in message storage and forwarding.

[0031] The DLQ (Dead Letter Queue) described in this article is a special queue where messages that cannot be successfully processed by consumers after multiple retries in Rocket MQ will be moved to. This allows administrators to manually view and process these failed messages, and is used for unified management and subsequent processing of messages that cannot be processed normally.

[0032] The distributed transactions described in this article refer to transactions where the participants, servers supporting transactions, resource servers, and transaction managers are located on different nodes of different distributed systems, and the ACID characteristics of transactions need to be guaranteed. Distributed transactions involve multiple participants, usually different computer nodes or services, and transaction operations need to be performed across multiple nodes. They are designed to assist in identifying transactions across heterogeneous resources to maintain data consistency and reliability, ensuring that all operations are either fully successful or fully failed to maintain data consistency and integrity.

[0033] The scheduled task described in this article is a commonly used task scheduling method in computer programs. It allows the program to automatically perform certain operations or tasks at a specified time interval or a specific time point. It is widely used in system management, data processing, logging and other fields, and has the characteristics of periodicity, delay and asynchrony.

[0034] The Push mode and Pull mode described in this article are two different data transmission and communication modes. In the push mode, the data or message is actively sent by the sender to the receiver. The sender controls the timing and content of data transmission, while the receiver is in a passive receiving state. In the pull mode, the data or message is actively requested by the receiver. The receiver requests data from the sender according to its own needs.

[0035] II. Specific implementation plan The present application will be described in more detail below.

[0036] After the positioning data of multiple ship positioning sources is reported, the alarm record can be automatically triggered based on the configuration of the ship positioning and alarm strategy. However, due to the large amount of positioning data, high concurrency and complex trigger conditions set in the alarm strategy, transaction timeouts and frequent Full GC occur in the online running environment in some scenarios. This leads to resource competition between the Node nodes where the relevant Pod instances are located in the K8S cluster. Due to fierce competition, the Pod instances will be restarted continuously, and even the Node nodes will be deadlocked, reducing service availability, and the alarm records cannot be generated and processed in time, which reduces the timeliness and cannot play a good role in timely alarm.

[0037] In response to the above problems, an embodiment of the present application provides a real-time alarm reminder generation method based on ship multi-positioning source data, which can split and decouple large quantities of ship multi-positioning source data, achieve efficient matching of ship multi-positioning source data and alarm strategy types, and improve the timeliness, consistency and stability of real-time alarm reminders.

[0038] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0039] Figure 1 It is a flow chart of a method for generating a real-time alarm reminder based on multi-positioning source data of a ship shown in Example 1 of the present application.

[0040] See also Figure 1 The real-time alarm reminder generation method based on ship multi-positioning source data includes: S1. Obtain the first-level positioning data and write it into the corresponding first-level MQ topic.

[0041] In this application, the primary positioning data may be positioning data based on multiple positioning sources of the ship. The positioning data of multiple positioning sources, i.e., the positioning data has different sources, and may specifically include but is not limited to global satellite navigation systems (such as GPS, Beidou), ocean satellite broadband (ship-borne satellite stations), Tiantong satellite narrowband (ship-borne Tiantong terminals), scalable base station positioning, electronic chart positioning, etc.

[0042] In some implementations, real-time positioning data of multiple positioning sources of a ship may be received, and the positioning data may be grouped based on the positioning sources of the real-time positioning data to obtain primary positioning data, and written into a corresponding primary MQ topic.

[0043] The multi-positioning source positioning data of a ship may at least include the ship's longitude, latitude, altitude, speed, heading, acceleration, timestamp, positioning source identification information (such as GPS\Beidou, etc.), ship status information (such as anchored status, underway status, berthed status, etc.), etc.

[0044] It should be noted that the first-level MQ topic is a container for grouping and marking the positioning data of multiple positioning sources of a ship. In some specific embodiments of the present application, different first-level MQ topics can be set based on the sources of the positioning data of multiple positioning sources of the ship, and the positioning data reported by the multiple positioning sources of the ship can be split into different first-level MQ topics based on their different positioning sources, so that the reported positioning data corresponds to the positioning source of the first-level MQ topic.

[0045] The first-level positioning data written into the first-level MQ topic may include relevant information of the ship's positioning data and data identifying the first-level positioning data, including but not limited to the data type, data parameters and relevant identifications of the multi-positioning source positioning data of the positioning data ship in the first-level MQ topic.

[0046] The step of writing to the first-level MQ topic can be completed by the producer, that is, sending the positioning data from different positioning sources as messages to the first-level message queue, namely the first-level MQ topic, to achieve buffering and distribution of the initial data, so that subsequent different groups of consumers can consume and process the first-level positioning data in the first-level MQ topics of different topics.

[0047] In addition, this step may also include data compliance verification of the reported multi-positioning source positioning data of the ship to determine whether the ship positioning data complies with relevant regulations during the reporting process, and to check and verify the positioning data to ensure that the first-level positioning data written into the first-level MQ topic is compliant and formally meets the message requirements, to avoid positioning data with data loss, damage, etc. from being written into the first-level MQ topic to affect the operation of the system, and to meet subsequent consumption, storage, transmission and use requirements.

[0048] The real-time reporting of the multi-positioning source positioning data of the ship can be realized based on different interfaces, which are not limited in this application, including but not limited to API real-time interface, MQ quasi-real-time interface, etc.

[0049] S2. Perform first-level consumption processing on the first-level positioning data in the first-level MQ topic to obtain second-level positioning data that is a combination of the first-level positioning data and the alarm strategy type.

[0050] In this application, the first-level consumption processing of the first-level positioning data can be performed through Push mode. That is, the message queue under the first-level MQ topic will actively push the first-level positioning data to the corresponding consumer, and the consumer can be notified in the first time and start subsequent processing without actively querying. It can ensure the timely processing of the real-time positioning data of the ship, thereby ensuring the timeliness of the alarm.

[0051] In some implementations, the first-level positioning data in the first-level MQ topic can be matched with a preset alarm strategy list, and it can be determined whether it meets the preset conditions of the alarm strategy; if so, the first-level positioning data is combined with its corresponding alarm strategy type to obtain the second-level positioning data.

[0052] A list of alarm strategies is preset in the system. After receiving the multi-positioning source positioning data message of the ship, the consumer matches the alarm strategy list applicable to the ship from a large number of alarm strategies according to the specific situation of the ship, and then groups these positioning data based on the alarm strategy type, so that the grouped single positioning data matches at least one corresponding alarm strategy, and uses the combined data as secondary positioning data.

[0053] The secondary positioning data at least includes the data type and data parameters of the multi-positioning source positioning data of the ship and the alarm strategy corresponding to the relevant identification in the primary MQ topic.

[0054] It should be noted that the preset alarm strategy list includes at least information such as scheduled routes, safe areas, dangerous areas (such as reef areas, etc.), prohibited navigation areas (such as military combat areas, etc.), alarm events, alarm strategy types, emergency coefficients, reminder personnel, reminder methods, and applicable ship identification information.

[0055] Among them, the alarm events at least include alarm events based on location, alarm events based on speed, alarm events caused by ship equipment failure, alarm events related to environmental factors, etc. Different alarm events correspond to different alarm strategy types, emergency coefficients, reminder personnel, and reminder methods. The alarm strategy types at least include deviation from the scheduled route, entering a dangerous area, entering a prohibited navigation area, entering an operation-intensive area, leaving an offshore port, exceeding a safe speed, abnormal object intervention, close collision, ship equipment failure, extreme weather in the sea (for example, the sea wave height exceeds the dangerous value, the sea visibility is lower than the dangerous value, etc.), and failure to report to go out to sea.

[0056] Consumers under the first-level MQ topic match the ship's positioning data and the elements in the preset alarm strategy list. The matching process may involve the calculation and judgment of the distance between the ship's positioning data and the scheduled route. The alarm event corresponding to the positioning data is judged first, and then the type of alarm strategy applicable to it is specifically corresponding. The multi-positioning source positioning data of the ship can be carefully split and matched to improve the accuracy and timeliness of the alarm reminder.

[0057] Judging whether the first-level positioning data in the first-level MQ topic meets the preset conditions of the alarm strategy refers to judging whether the ship at this time meets the conditions of the alarm strategy type based on the first-level positioning data. For example, based on the ship's current latitude and longitude coordinates, heading, speed and other positioning information, as well as different situations such as ship position deviation and speed abnormality, it can be judged which alarm type it meets. For example, if the ship deviates from the scheduled route by 5 nautical miles to meet the preset conditions of the alarm strategy, when the deviation from the route is less than 5 nautical miles, the preset conditions of the alarm strategy are not met, and when it is greater than or equal to 5 nautical miles, the preset conditions of the alarm strategy are met. When the preset conditions of the alarm strategy are met, the corresponding first-level positioning data and its corresponding alarm strategy type are combined to obtain the second-level positioning data. That is, the second-level positioning data is data marked with a label of the alarm strategy type on the first-level positioning data.

[0058] S3. Write the secondary positioning data into the corresponding secondary MQ topic.

[0059] The secondary positioning data obtained after the primary consumption processing by the consumer corresponding to the primary MQ topic can be processed by the producer for secondary production based on its alarm strategy type label, that is, the secondary positioning data is written into the secondary MQ topic corresponding to the alarm strategy type one by one according to the alarm strategy type.

[0060] Therefore, the secondary MQ topic includes multiple different topic consumption queues, each of which corresponds to an alarm strategy type. In the subsequent consumption processing process, consumers under different topics can process the data, thereby improving the processing efficiency of positioning data.

[0061] S4. Perform secondary consumption processing on the secondary positioning data in the secondary MQ topic to determine whether the alarm triggering condition is met; if so, generate alarm reminder information and send it to the corresponding alarm reminder personnel.

[0062] Consumers under the secondary MQ topic can consume in Push mode. That is, the message queue under the secondary MQ topic will actively push the secondary positioning data to the corresponding consumers. Consumers can be notified immediately and start subsequent processing without actively querying. It can ensure the timely processing of real-time positioning data of ships, thereby ensuring the timeliness of alarms.

[0063] During the secondary consumption process, the consumer will combine the actual ship positioning data (including the ship's position coordinates, driving speed, etc.) and refer to the alarm trigger conditions in the preset alarm strategy list to determine whether the ship has reached a state that requires an alarm to be triggered. At this time, the ship's positioning data in the secondary positioning data can be further compared with the trigger threshold set in the alarm strategy trigger condition, and the corresponding alarm emergency coefficient, reminder personnel, etc. can be matched accordingly.

[0064] For example, if the distance a ship deviates from its route exceeds the prescribed x nautical miles, it is judged that it meets the preset conditions of the alarm strategy for ship deviation from its route. Then it will be mapped one-to-one with the alarm strategy type as combined data by consumers under the secondary MQ topic to make further judgments, confirm the degree of deviation and the corresponding alarm urgency coefficient, and generate alarm reminder information if the conditions are met.

[0065] In some embodiments, the alarm reminder information may include an alarm event, an alarm type, an emergency coefficient, etc., and further, an alarm cancellation plan. That is, the alarm strategy list also includes an alarm cancellation plan corresponding to the alarm strategy type. After the alarm reminder information is sent to the corresponding alarm reminder personnel, the relevant personnel eliminate or eliminate the risk. For example, when the ship sails to the left, its corresponding alarm cancellation plan may include sailing 30° to the right for 5 nautical miles to enter the preset route, etc.

[0066] In addition, after the alarm reminder information is generated, a corresponding alarm record production information will be generated in the system, which includes the message identifier, message parameters, message type, etc. of the alarm reminder information.

[0067] The method of the embodiment of the present application can simultaneously split and decouple a large number of positioning data from different positioning sources of ships by combining the first-level MQ topic and the second-level MQ topic, so that the positioning data of each positioning source can be consumed and processed by different groups of consumers, thereby realizing real-time and efficient monitoring of ships and timely and accurate alarm processing of abnormal conditions of ships.

[0068] The embodiment of the present application provides a real-time alarm reminder generation method based on ship multi-positioning source data, which can also utilize the consumer retry mechanism and task exception compensation mechanism to retry the consumption failed data in the primary and secondary consumption exception scenarios as soon as possible, thereby ensuring the high timeliness of business functions while improving its data availability and consistency.

[0069] The existing retry mechanism in Rocket MQ is designed to deal with various abnormal situations that may occur during message sending or consumption. This mechanism ensures that messages can be transmitted and processed correctly as much as possible even under the influence of factors such as network fluctuations, service downtime or program abnormalities. It mainly includes two aspects: producer retry and consumer retry.

[0070] Producer retry: When a producer encounters a failure when trying to send a message to a Broker (such as a network problem, the Broker is temporarily unavailable, etc.), the producer can configure a certain retry strategy to retry. The producer can configure the number of retries and the interval between each retry. By default, Rocket MQ allows producers to retry 2 times. The interval between each retry can be set to gradually increase to reduce the pressure on the Broker. The producer retry process is non-blocking, that is, the producer can continue to send other messages while waiting for a retry.

[0071] Consumer retry: When a consumer encounters an error while processing a message and cannot complete the message processing, Rocket MQ provides a consumer retry mechanism so that it can try to process the message again. The default number of consumer retries is 16, and the time interval between each retry increases exponentially, which gives the consumer enough time to process the message. If the consumer still cannot successfully process the message after multiple retries, the message will be marked as a processing failure and may be moved to a special dead letter queue. Administrators can manually process these failed messages by checking the DLQ later.

[0072] However, the existing producer and consumer retry mechanism in Rocket MQ cannot meet the current application scenarios with high real-time alarm requirements. It only provides an exponential retry interval and a dead letter queue for multiple failures. It cannot solve the business requirements of retrying as quickly as possible under abnormal circumstances for real-time analysis of large amounts of data such as multiple positioning source data of ships and multiple alarm strategy types.

[0073] The existing Seata distributed solution uses the global transaction unique identifier XID and three core components and adopts the commit and rollback mode of global transactions and branch transactions. The independently deployed transaction coordinator is used as the master control. The transaction manager applies to the transaction coordinator to open the global transaction. After the global transaction is successfully created, the transaction coordinator will generate a globally unique XID and pass it to other microservices through the microservice call chain. The resource manager client applies to the master control to register the branch transaction and manage it under the jurisdiction of XID. The transaction manager collects the execution results of each branch transaction and notifies the master control to initiate the commit and rollback operations of the global transaction to form an overall distributed transaction solution.

[0074] It introduces the global transaction unique identifier XID and three core components to solve the problem of distributed transaction data consistency under the microservice architecture, but it brings a large learning cost. In addition, Seata has problems such as low overall performance efficiency, complex Seata-server service deployment, cumbersome transformation of existing business systems to access Seata-client, and additional resource occupation in the entire distributed transaction solution process.

[0075] In response to the above problems, an embodiment of the present application provides a real-time alarm reminder generation method based on multi-positioning source data of ships, which can split and decouple large quantities of multi-positioning source data of ships, and at the same time combine the consumption retry mechanism and the task abnormality compensation processing mechanism to compensate for the consumption abnormal data through minute-level scheduled tasks, while improving the timeliness, consistency and stability of real-time alarm reminders.

[0076] The technical solution of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. Compared with the first embodiment, the real-time alarm reminder generation method based on the multi-positioning source data of the ship also includes: when the consumption processing fails, the abnormal data generated by the failure is written into the consumption abnormality table, and the abnormal data in the consumption abnormality table is subjected to task abnormality compensation processing; further, when the consumption processing fails, it is subjected to repeated consumption processing until the number of repeated consumption processing failures exceeds a preset threshold, abnormal data is generated and written into the consumption abnormality table; the abnormal data in the consumption abnormality table is subjected to timed task compensation processing.

[0077] When the consumption processing step fails, the MQ default retry mechanism is used to repeat the consumption processing. When the number of repeated consumption exceeds the preset threshold, it will be moved to the consumption exception table to wait for the scheduled task compensation processing, and the positioning data will be removed from the message queue of the current MQ topic to ensure the processing efficiency and timeliness of the current message queue. At the same time, the scheduled data moved to the consumption exception table can also be retried again, and it can avoid being moved to the dead letter queue as a record of processing failure, ensuring the reliability and consistency of the alarm reminder.

[0078] Specifically, Figure 2 shown. Figure 2 This is a flow chart of a method for generating a real-time alarm based on multi-positioning source data of a ship according to the second embodiment of the present application. The same contents as those in the first embodiment of the present application will not be repeated.

[0079] See also Figure 2 The real-time alarm reminder generation method based on ship multi-positioning source data includes: S11. Obtain the first-level positioning data and write it into the corresponding first-level MQ topic.

[0080] S21. Performing a first-level consumption process on the first-level positioning data in the first-level MQ topic, if successful, obtaining second-level positioning data that is a combination of the first-level positioning data and the alarm strategy type.

[0081] S22: If consumption fails, repeated consumption is performed.

[0082] When the first-level consumer encounters problems in the process of receiving the first-level positioning data in the first-level MQ topic, matching the first-level positioning data of the ship with the alarm strategy list, judging the alarm strategy type, and grouping the first-level positioning data, such as when the consumption fails due to network fluctuations, temporary system failures, etc., retry processing is performed based on the MQ retry mechanism.

[0083] S23. When the number of repeated consumption processing failures exceeds a first preset threshold, abnormal data is generated and written into a consumption abnormality table.

[0084] The system presets the consumption times of the first-level positioning data under the first-level MQ topic, that is, the first preset threshold. For example, if the consumption is repeated 3 times, it will be automatically moved to the consumption exception table when the set number is exceeded to ensure that the updated real-time first-level positioning data can be consumed and processed efficiently.

[0085] The abnormal data includes the identification, parameters, type, production status, etc. of the primary positioning data.

[0086] S31. Write the secondary positioning data into the corresponding secondary MQ topic.

[0087] S41. Perform secondary consumption processing on the secondary positioning data in the secondary MQ topic to determine whether the alarm triggering condition is met; if so, generate alarm reminder information and send it to the corresponding alarm reminder personnel.

[0088] S42: If consumption fails, repeat consumption processing is performed.

[0089] When the secondary consumer encounters problems in the process of receiving the secondary positioning data in the secondary MQ topic, the process of determining whether the secondary positioning data of the ship meets the alarm trigger conditions, the process of generating alarm reminder information, and the process of sending alarm reminder information, such as network fluctuations, temporary system failures, etc., which lead to consumption failures, retry processing is performed based on the MQ retry mechanism.

[0090] S43: When the number of repeated consumption processing failures exceeds a second preset threshold, abnormal data is generated and written into a consumption abnormality table.

[0091] The system presets the consumption times of the secondary positioning data under the secondary MQ topic, that is, the second preset threshold. For example, if the consumption is repeated 3 times, it will be automatically moved to the consumption exception table when the set number is exceeded to ensure that the updated real-time secondary positioning data can be consumed and processed efficiently.

[0092] S51. Determine the type of abnormal data in the consumption abnormality table.

[0093] The consumption exception table includes an abnormal record identifier, an original first-level MQ message identifier, an original second-level MQ message identifier, a new first-level MQ message identifier, a new second-level MQ message identifier, a first-level / secondary MQ message type, a first-level / secondary MQ message parameter, and a new first-level / secondary MQ message production status. That is, the consumption exception table includes all process parameters and original data of the ship's positioning data in the first-level and second-level production and consumption processes.

[0094] The types of abnormal data include primary abnormal data and secondary abnormal data.

[0095] S52. Perform data reproduction processing on the abnormal data according to the type of the abnormal data to obtain reproduction positioning data, write it into the corresponding MQ topic, and update the identifier and processing status corresponding to the reproduction positioning data in the MQ topic.

[0096] The reproduction positioning data includes primary positioning data and secondary positioning data. That is, based on different abnormal data, the primary abnormal data and the secondary abnormal data will generate corresponding primary reproduction positioning data and secondary reproduction positioning data, which will then be written into the corresponding MQ topics, namely the primary MQ topic and the secondary MQ topic, respectively, so that consumers corresponding to different MQ topics will execute the consumption processing steps again.

[0097] At the same time, when the abnormal data is successfully reproduced, the identification and processing status corresponding to the reproduced positioning data in the MQ topic need to be updated to avoid incorrect consumption or reproduction.

[0098] The MQ consumer retry mechanism diagram is as follows Figure 3 The schematic diagram of the timing task compensation mechanism is shown in Figure 4 shown.

[0099] In some implementations, the scheduled task compensation process uses scheduled task minute-level compensation process. For abnormal data in the consumption exception table, the first and second level MQs are produced and consumed again through minute-level scheduled tasks to ensure that the data eventually completes the business process.

[0100] Based on the first-level exception data, the scheduled task reads the original first-level MQ message identifier and first-level MQ message parameters of the corresponding record based on the thread pool multi-thread, and retry the producer through the first-level MQ exception record based on the first-level MQ message parameters, encapsulating it into the message format of the corresponding first-level MQ producer, and reproducing the corresponding first-level MQ. If the production is successful, the new first-level MQ message identifier and the new first-level MQ message production status will be updated; if the production fails, no update processing will be performed on the corresponding record, and the first-level MQ will be re-produced again when the scheduled task is executed next time. The data of successful reproduction in each thread is counted, and the processing results of each thread are merged, and the number of successful first-level MQ reproductions of this scheduled task is recorded.

[0101] Based on the secondary abnormal data, the scheduled task first reads the original primary MQ message identifier, the original secondary MQ message identifier, and the secondary MQ message parameters of the corresponding record based on the thread pool multithreading, and retry the producer based on the secondary MQ message parameters through the secondary MQ abnormal record, encapsulating it into the message format of the corresponding secondary MQ producer, and reproducing the corresponding secondary MQ. If the production is successful, the new secondary MQ message identifier and the new secondary MQ message production status will be updated; if the production fails, no update processing will be performed on the corresponding record, and the secondary MQ will be re-produced again when the scheduled task is executed next time. The data of successful reproduction in each thread is counted, and the processing results of each thread are merged, and the number of successful secondary MQ reproductions of this scheduled task is recorded.

[0102] Thread pool is a technology that creates several threads in advance and manages and reuses them in a unified manner. It is like a "thread resource pool". The system assigns tasks to idle threads in the pool for processing, rather than recreating threads every time a task is received. It can improve system response speed and resource management. Through thread pool multithreading, the positioning data of multiple positioning sources of different ships can be immediately received and processed at the same time, ensuring that the data can be captured in time and will not be lost or backlog due to the delay of single-thread processing, and improving the timeliness of alarm information and maintaining the stable operation of the system.

[0103] For the first and second level MQs that have been successfully reproduced, the corresponding first and second level MQ consumers continue to consume them, following the same processing flow as S2 and S4, to ensure that all abnormal records can be recorded and messages can be produced again.

[0104] The embodiments of the present application can solve the actual production problems of high resource usage, low alarm effectiveness, and low service availability when the positioning data of multiple positioning sources of ships and multiple alarm strategy types generate real-time alarm reminder information through the splitting of production and consumption of the first and second level MQ, the MQ retry mechanism, and the minute-level compensation mechanism for scheduled tasks, ensure the high effectiveness of business functions while improving high availability, solve existing business pain points, and can be expanded to similar scenarios in other industries, forming a cross-industry and cross-scenario general solution for real-time analysis of large amounts of data and alarm problems.

[0105] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a real-time alarm reminder generation system based on ship multi-positioning source data, an electronic device and corresponding embodiments.

[0106] Figure 5 It is a structural diagram of a real-time alarm reminder generation system based on multi-positioning source data of a ship shown in Example 1 of the present application.

[0107] See also Figure 5 The real-time alarm reminder generation system based on ship multi-positioning source data includes a primary production unit 510, a primary consumption unit 520, a secondary production unit 530, and a secondary consumption unit 540.

[0108] The first-level production unit 510 is used to obtain the first-level positioning data and write it into the corresponding first-level MQ topic.

[0109] In some implementations, the primary production unit 510 is used to receive real-time positioning data; based on the positioning source of the real-time positioning data, the real-time positioning data is grouped and processed to obtain primary positioning data, and the data is written into a corresponding primary MQ topic.

[0110] The primary consumption unit 520 is used to perform primary consumption processing on the primary positioning data in the primary MQ topic to obtain secondary positioning data that is a combination of the primary positioning data and the alarm strategy type.

[0111] In some embodiments, the first-level consumption unit 520 is used to correspond the first-level positioning data in the first-level MQ topic with the preset alarm strategy list, and determine whether it meets the preset conditions of the alarm strategy; if it does, the first-level positioning data is combined with its corresponding alarm strategy type to obtain the second-level positioning data.

[0112] The secondary production unit 530 is used to write the secondary positioning data into the corresponding secondary MQ topic.

[0113] The secondary consumption unit 540 is used to perform secondary consumption processing on the secondary positioning data in the secondary MQ topic to determine whether the alarm triggering condition is met; if so, an alarm reminder message is generated and sent to the corresponding alarm reminder personnel.

[0114] Figure 6 It is a structural diagram of a real-time alarm reminder generation system based on multi-positioning source data of a ship shown in Example 2 of the present application.

[0115] See also Figure 6 In addition to the primary consumption unit 520, the secondary production unit 530, and the secondary consumption unit 540, the real-time alarm reminder generation system based on the ship multi-positioning source data also includes a task abnormality compensation system 550, which is used to write the abnormal data generated by the failure into the consumption abnormality table when the consumption processing fails, and perform task abnormality compensation processing on the abnormal data in the consumption abnormality table.

[0116] In some embodiments, the task exception compensation system 550 is used to repeat the consumption processing when the consumption processing fails, until the number of repeated consumption processing failures exceeds a preset threshold, generate exception data and write it into the consumption exception table; perform timed task compensation processing on the exception data in the consumption exception table.

[0117] In some embodiments, the task anomaly compensation system 550 is used to determine the type of abnormal data in the consumption anomaly table; the type of abnormal data includes primary abnormal data and secondary abnormal data; the abnormal data is processed for data reproduction according to the type of abnormal data to obtain reproduction positioning data, which is written into the corresponding MQ topic, and the identifier and processing status corresponding to the reproduction positioning data in the MQ topic are updated; the reproduction positioning data includes primary positioning data and secondary positioning data.

[0118] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.

[0119] Figure 7 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.

[0120] See also Figure 7 , the electronic device 700 includes a memory 710 and a processor 720 .

[0121] The processor 720 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0122] The memory 710 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage. Among them, ROM may store static data or instructions required by the processor 720 or other modules of the computer. The permanent storage may be a readable and writable storage device. The permanent storage may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 710 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 710 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0123] The memory 710 stores executable codes, and when the executable codes are processed by the processor 720 , the processor 720 can execute part or all of the methods described above.

[0124] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0125] Alternatively, the present application can also be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) on which an executable code (or a computer program or a computer instruction code) is stored. When the executable code (or a computer program or a computer instruction code) is executed by a processor of an electronic device (or a server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0126] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A real-time alarm reminder generation method based on multi-positioning source data of ships, characterized in that: include: Get the first-level positioning data and write it into the corresponding first-level MQ topic; Performing a first-level consumption process on the first-level positioning data in the first-level MQ topic to obtain second-level positioning data that is a combination of the first-level positioning data and an alarm strategy type; Writing the secondary positioning data into the corresponding secondary MQ topic; Perform secondary consumption processing on the secondary positioning data in the secondary MQ topic to determine whether the alarm triggering condition is met; if so, generate alarm reminder information and send it to the corresponding alarm reminder personnel.

2. The method according to claim 1, characterized in that The performing first-level consumption processing on the first-level positioning data in the first-level MQ topic to obtain second-level positioning data combined with the first-level positioning data and the alarm strategy type includes: Compare the first-level positioning data in the first-level MQ topic with the preset alarm strategy list, and determine whether it meets the preset conditions of the alarm strategy; If the condition is satisfied, the primary positioning data is combined with the corresponding alarm strategy type to obtain the secondary positioning data.

3. The method according to claim 1, characterized in that The obtaining of the first-level positioning data and writing into the corresponding first-level MQ topic includes: Receive real-time positioning data; The real-time positioning data is grouped and processed based on the positioning source of the real-time positioning data to obtain primary positioning data, which is written into a corresponding primary MQ topic.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the consumption processing fails, the abnormal data generated by the failure is written into the consumption abnormality table, and the task abnormality compensation processing is performed on the abnormal data in the consumption abnormality table.

5. The method according to claim 4, characterized in that When the consumption processing fails, the abnormal data generated by the failure is written into the consumption abnormality table, and the abnormal data in the consumption abnormality table is subjected to task abnormality compensation processing, including: When the consumption process fails, the consumption process is repeated until the number of repeated consumption process failures exceeds a preset threshold, generating abnormal data and writing it into a consumption abnormality table; Perform timed task compensation processing on the abnormal data in the consumption abnormality table.

6. The method according to claim 4, characterized in that The performing a scheduled task compensation process on the abnormal data in the consumption abnormality table includes: Determine the type of the abnormal data in the consumption abnormality table; the type of the abnormal data includes primary abnormal data and secondary abnormal data; The abnormal data is processed for data reproduction according to the type of the abnormal data to obtain reproduction positioning data, which is written into the corresponding MQ topic, and the identifier and processing status corresponding to the reproduction positioning data in the MQ topic are updated; the reproduction positioning data includes primary positioning data and secondary positioning data.

7. A real-time alarm reminder generation system based on multi-positioning source data of ships, characterized in that: include: The first-level production unit is used to obtain the first-level positioning data and write it into the corresponding first-level MQ topic; A primary consumption unit, used for performing primary consumption processing on the primary positioning data in the primary MQ topic to obtain secondary positioning data which is a combination of the primary positioning data and an alarm strategy type; A secondary production unit, used for writing the secondary positioning data into a corresponding secondary MQ topic; The secondary consumption unit is used to perform secondary consumption processing on the secondary positioning data in the secondary MQ topic to determine whether the alarm triggering condition is met; if so, generate alarm reminder information and send it to the corresponding alarm reminder personnel.

8. The system according to claim 7, characterized in that The system also includes a task exception compensation system, which is used to write the abnormal data generated by the failure into a consumption exception table when the consumption processing fails, and perform task exception compensation processing on the abnormal data in the consumption exception table.

9. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 6.

10. A computer-readable storage medium having executable codes stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 6.