A message notification method, device, computer device and storage medium

By deploying message corps and multi-replica mechanisms in the cloud platform system, listening and parsing database logs in real time, the system performance degradation in high-concurrency scenarios in microservice architecture is solved, and the reliability and efficiency of cross-layer communication and task completion are achieved.

CN119728626BActive Publication Date: 2025-07-08JINAN INSPUR DATA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510230756.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-07-08
Estimated Expiration
2045-02-28

AI Technical Summary

Technical Problem

In the cloud platform of microservice architecture, the traditional message notification mechanism causes system performance to decline in high concurrency scenarios, frequent state queries increase system load, affect the real-time and reliability of the system, and fail to effectively solve the cross-layer communication problem between microservices.

Method used

By deploying the database, platform layer and virtualization layer in the cloud platform system, using the message corps to realize real-time monitoring and parsing database logs, creating platform microservice message queues, pushing database event information, and combining the master-slave architecture and multi-replica mechanism to achieve cross-layer communication and task completion judgment.

Benefits of technology

It improves the consistency and timeliness of data synchronization, reduces system load, ensures the real-time and reliability of the system, and realizes reliable and efficient cross-layer communication between microservices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728626B_ABST
    Figure CN119728626B_ABST
Patent Text Reader

Abstract

The present application relates to a message notification method, apparatus, computer device, and storage medium. The method includes: in response to the platform microservice receiving a database change task, creating a corresponding platform microservice message queue in the message general queue; obtaining database logs, and parsing to obtain database event information; pushing the database event information to the platform microservice message queue; determining whether the database change task has been completed according to the database event information in the platform microservice message queue; and in response to the completion of the database change task, feeding back the completion information of the database change task to the database. By using this method, the system load can be reduced, the efficiency and stability of the system in high-concurrency scenarios can be improved, the real-time performance and reliability of messages can be ensured, and cross-layer communication between microservices can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of message notification, and particularly to a message notification method, device, computer device, and storage medium. Background Art

[0002] With the rapid development of cloud computing technology, the microservices architecture has been widely applied in cloud platforms. By splitting system functions into multiple independent services, each service can be independently deployed, scaled, and maintained, improving the availability and flexibility of cloud platform systems. However, due to the independence of the microservices architecture, problems such as communication and data consistency between microservices have become increasingly prominent.

[0003] In the prior art, for communication between microservices, the traditional message notification mechanism used is usually the polling method, that is, the microservice continuously queries the status until the required resources or services are configured. However, this message notification method will cause a serious decline in system performance in high-concurrency scenarios. Frequent status queries not only increase the system load but may also cause message delays or losses, affecting the real-time and reliability of the system. In addition, in cloud platform systems, there is a need for message passing across platform layers and virtualization layers between microservices, and the traditional message notification method has not proposed a good solution for cross-layer communication between microservices. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a message notification method, device, computer device, and storage medium that can reduce the system load, improve the efficiency and stability of the system in high-concurrency scenarios, ensure the real-time and reliability of messages, and achieve cross-layer communication between microservices.

[0005] On the one hand, a message notification method is provided. The method is applied to a cloud platform system in which a database, a platform layer, a virtualization layer, and a message queue are deployed. A number of platform microservices are deployed inside the platform layer, and a number of management microservices are deployed inside the virtualization layer. The method includes:

[0006] In response to a platform microservice receiving a database change task, create a corresponding platform microservice message queue in the message queue.

[0007] Obtain the database log and parse it to obtain database event information.

[0008] Push the database event information to the platform microservice message queue.

[0009] Based on the database event information in the platform microservice message queue, determine whether the database change task has been completed.

[0010] Upon completion of the execution of the database change task, the completion information of the database change task is fed back to the database.

[0011] In one embodiment, the database has a master-slave architecture. The database includes a master node and a slave node. Obtain the database log and parse it to obtain database event information, including:

[0012] Based on the master-slave protocol, set up a disguised slave node in the database;

[0013] Based on the disguised slave node, through the read-write thread, obtain the database log pushed by the master node;

[0014] Based on the database log, obtain the data change information;

[0015] Parse according to the data change information to obtain database change task information;

[0016] According to the database change task information, combined with the database event type, perform corresponding data structure adjustments to obtain database event information.

[0017] In one embodiment, according to the database change task information, combined with the database event type, perform corresponding data structure adjustments to obtain database event information, including:

[0018] According to the database change task information, combined with the database event type, parse and generate serialized data;

[0019] In response to the database event type being an add / delete event, parse the database change task information into a serialized array;

[0020] In response to the database event type being an update event, parse the database change task information into a serialized hash table;

[0021] Based on the serialized data, perform re-parsing to convert the serialized data into a key-value pair data structure to obtain database event information.

[0022] In one embodiment, there are several replicas of the disguised slave node in the database, where the number of several replicas is greater than or equal to three. Push the database event information to the platform microservice message queue, including:

[0023] In response to the start of several replicas, generate several replica numbers correspondingly;

[0024] Write the several replica numbers into the same ordered set to obtain the current replica sequence;

[0025] According to the current replica sequence, select a master replica from several replicas, and the remaining replicas are slave replicas;

[0026] Based on the replica, a database log is obtained, and in response to the replica being a primary replica, database event information is generated based on the primary replica according to the database log;

[0027] In response to the replica being a slave replica, the database log received from the slave replica is discarded.

[0028] In one embodiment, according to the current replica sequence, a master replica is selected from a number of replicas, and the remaining replicas are slave replicas, including:

[0029] Based on the preset heartbeat interval, heartbeat detection is performed on several replicas respectively;

[0030] In response to the result of the heartbeat detection being healthy and the replica sequence corresponding to the replica existing in the current replica sequence, the replica sequence number is updated according to the current replica sequence;

[0031] In response to the result of the heartbeat detection being a failure and the replica sequence number corresponding to the replica existing in the current replica sequence, it is determined whether the replica can be restored to health within the expiration time, and in response to the determination result being no, the replica sequence number is deleted from the current replica sequence;

[0032] In response to the result of the heartbeat detection being healthy and the replica sequence number corresponding to the replica not existing in the current replica sequence, the replica sequence number is added to the end of the current replica sequence;

[0033] In response to the replica sequence number corresponding to the replica being the first in the current replica sequence, the replica is a primary replica, otherwise, it is a secondary replica.

[0034] In one embodiment, a message re-push queue is also deployed in the cloud platform system to push database event information to the platform microservice message queue, including:

[0035] Get the master copy of the fake slave node;

[0036] Create a main push single thread based on the master copy;

[0037] In response to the generation of database event information based on the primary copy, the database event information is pushed to the message team through the primary push single thread;

[0038] In response to the primary copy failing to successfully push the database event information to the message queue, the database event information is stored in the message re-push queue;

[0039] Create a message re-push thread based on the message re-push queue;

[0040] Push the database event information in the message re-push queue to the message queue through the message re-push thread;

[0041] In response to the message team successfully receiving the database event information, the database event information is pushed to the platform microservice message queue.

[0042] In one embodiment, a message broadcast queue is also deployed in the message team. In response to the message team successfully receiving the database event information, the database event information is pushed to the platform microservice message queue, including:

[0043] In response to the message queue receiving the database event information, the database event information is stored in the message broadcast queue;

[0044] In response to the message broadcast queue receiving the database event information, the database event information is distributed to all platform microservice message queues through the message broadcast queue, wherein the database event information from the message re-push queue is marked as a failed re-push message.

[0045] In one embodiment, judging whether the database change task is completed according to the database event information in the platform microservice message queue includes:

[0046] Based on the platform microservice, perform a pre-query to determine whether the platform microservice has a pre-microservice;

[0047] In response to the platform microservice not having a preceding microservice, the platform microservice executes the database change task and feeds back completion information of the database change task to the database;

[0048] In response to the presence of a preceding microservice for the platform microservice, task completion information of the preceding microservice of the platform microservice is obtained, and whether the database change task is executed is determined according to the task completion information of the preceding microservice.

[0049] In one embodiment, the front-end microservice includes at least one or more of the following: a platform microservice and a management microservice, and the task completion information of the front-end microservice is obtained in the following manner:

[0050] In response to the presence of a preceding microservice for the platform microservice, the current preceding microservice of the platform microservice is obtained, and the platform microservice is set to be delayed start, and a delayed start task corresponding to the database change task is generated;

[0051] In response to the current front-end microservice not being a management microservice, the current front-end microservice is used as a new platform microservice, and a front-end query is recursively performed until the current front-end microservice obtained is a management microservice;

[0052] In response to the current front-end microservice being a management microservice, the management microservice is called to execute the resource configuration task corresponding to the database change task, and task completion information of the management microservice is obtained;

[0053] In response to the platform microservice receiving the task completion information of the current front-end microservice, the delayed start task is closed and the platform microservice is executed to obtain the task completion information of the platform microservice.

[0054] In one embodiment, the task completion information of the front-end service of the platform microservice is obtained, and based on the task completion information of the front-end microservice, it is determined whether the database change task has been completed, including:

[0055] In response to the generation of the delayed start task, a corresponding task record information is created and stored in the task record table, where the task record information includes at least one of the following: task serial number, required resource type, requested resource serial number;

[0056] Through the message general queue, the database event information is distributed to the platform microservice message queue, where the database event information includes at least one of the following: service completion serial number, configured resource type, configured resource serial number, current status of the configured resource, failure retry flag;

[0057] In response to the required resource type and the configured resource type being the same, the database event information is the associated information of the platform microservice;

[0058] In response to the database event information being the associated information of the platform microservice, a comparison is made in combination with the task record table to determine whether the database event information is the task completion information of the front-end microservice. Otherwise, the database event information is discarded in the platform microservice message queue.

[0059] In one embodiment, in response to the database event information being the associated information of the platform microservice, a comparison is made in combination with the task record table to determine whether the database event information is the task completion information of the front-end microservice, and it further includes:

[0060] Setting the task completion information of the front-end microservice includes: invalid completion information, valid completion information;

[0061] All the task record information in the task record table is queried. In response to the existence of the same task serial number and service completion serial number, the database event information is the relevant information of the front-end microservice;

[0062] In response to the database event information being the relevant information of the front-end microservice, the failure retry flag is obtained. In response to the failure retry flag being yes, the database event information is the invalid completion information;

[0063] In response to the failure retry flag being no, the current status of the configured resource is obtained;

[0064] In response to the current status of the configured resource being in a steady state, the database event information is the valid completion information of the front-end microservice. Otherwise, the database event information is the uncompleted information of the front-end microservice.

[0065] In one embodiment, in response to the database event information being the task completion information of the pre-microservice, the platform microservice corresponding delayed start task is executed, including:

[0066] Obtain the task completion information of the pre-microservice;

[0067] In response to the task completion information of the pre-microservice being valid completion information, directly wake up the delayed start task and execute it;

[0068] In response to the task completion information of the pre-microservice being invalid completion information, wake up the delayed start task and execute it based on the polling query method;

[0069] In response to the execution of the delayed start task, delete the task record information corresponding to the delayed start task from the task record table.

[0070] On the other hand, a message notification device is provided. The device is applied to a cloud platform system. In the cloud platform system, a database, a platform layer, a virtualization layer, and a message general queue are deployed. Several platform microservices are deployed inside the platform layer, and several management microservices are deployed inside the virtualization layer. The device includes:

[0071] A queue creation module, configured to create a corresponding platform microservice message queue in the message general queue in response to the platform microservice receiving a database change task;

[0072] A log listening module, configured to obtain the database log and parse it to obtain the database event information;

[0073] A message pushing module, configured to push the database event information to the platform microservice message queue;

[0074] A message judgment module, configured to judge whether the database change task has been completed according to the database event information in the platform microservice message queue;

[0075] A message feedback module, configured to, in response to the completion of the database change task, feedback the completion information of the database change task to the database.

[0076] On another aspect, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0077] In response to the platform microservice receiving a database change task, create a corresponding platform microservice message queue in the message general queue;

[0078] Obtain the database log and parse it to obtain the database event information;

[0079] Push the database event information to the platform microservice message queue;

[0080] Judge whether the database change task has been completed according to the database event information in the platform microservice message queue;

[0081] In response to the completion of the database change task, feedback the completion information of the database change task to the database.

[0082] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0083] In response to the platform microservice receiving the database change task, create a corresponding platform microservice message queue in the message general queue;

[0084] Obtain the database log and parse it to obtain the database event information;

[0085] Push the database event information to the platform microservice message queue;

[0086] Judge whether the database change task has been completed according to the database event information in the platform microservice message queue;

[0087] In response to the completion of the database change task, feedback the completion information of the database change task to the database.

[0088] The above message notification method, device, computer device and storage medium can capture database events such as data changes in a timely manner by listening to and parsing the database log in real time, avoiding the latency problem of the traditional polling mechanism, which is beneficial to improving the consistency and timeliness of data synchronization and ensuring the real-time performance and reliability of the system; at the same time, through the active notification mechanism of the message general queue, it is possible to reduce the frequent status queries among microservices, reduce the system load, and improve the stability of the system in a concurrent scenario; in addition, each microservice in the platform layer and the virtualization layer is connected to the same database and message general queue, and the information generated by microservices in different layers will be converted into database events and pushed to the message general queue for distribution, so that cross-layer communication between microservices can be realized, providing a reliable and efficient cross-layer service communication mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] Figure 1 It is an application environment diagram of the message notification method in an embodiment;

[0090] Figure 2 It is a schematic flowchart of the message notification method in an embodiment;

[0091] Figure 3Schematic diagram of the detailed process of the message notification method implemented by the database listening parser in an embodiment;

[0092] Figure 4 Schematic diagram of the workflow for the database listening parser to obtain database event information by disguising as a slave node in an embodiment;

[0093] Figure 5 Schematic diagram of the workflow of the master replica selector in an embodiment;

[0094] Figure 6 Schematic diagram of the workflow of the message pusher in an embodiment;

[0095] Figure 7 Block diagram of the message notification device in an embodiment;

[0096] Figure 8 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0097] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0098] A message notification method provided by the present application can be applied to an application environment as shown in Figure 1 . Among them, the terminal 102 communicates with the server 104 through a network. A cloud platform system is deployed in the server 104, and a database, a platform layer, a virtualization layer, and a message queue are deployed in the cloud platform system. A number of platform microservices are deployed inside the platform layer, and a number of management microservices are deployed inside the virtualization layer. The server 104 receives a service request sent by the terminal 102, and the server 104 starts a number of platform microservices and a number of management microservices corresponding to the platform layer in the cloud platform system. The number of platform microservices and the number of management microservices communicate with each other based on the message notification method, and finally the service request of the terminal 102 is completed. Among them, the terminal 102 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0099] In one embodiment, as shown in Figure 2 , a message notification method is provided. Taking the method applied to the server side 104 in Figure 1 as an example, the method includes the following steps:

[0100] Step 201, in response to the platform microservice receiving a database change task, create a corresponding platform microservice message queue in the message queue.

[0101] Among them, a microservice is a microservice unit that provides specific service functions in the cloud platform system. A number of microservices are independent of each other and can be independently deployed and extended. The platform microservice is a microservice deployed at the platform layer, usually including computing services, storage services, and network services; the message queue is a message middleware used to transmit messages in the microservice system, and there is an information exchange unit in the message queue.

[0102] Specifically, in response to the startup of a number of platform microservices, create a number of platform microservice message queues in the message queue. Among them, a number of platform microservice message queues correspond one-to-one with a number of platform microservices. A number of platform microservice message queues are independent of each other, and a number of platform microservice message queues are all connected to the information exchange unit in the message queue.

[0103] Step 202, obtain the database log and parse it to obtain database event information.

[0104] Among them, the database log is a log file that records database operations and is used to track data changes in the database, such as inserting, updating, or deleting data; the database event refers to the event data obtained by parsing the database log, usually including the database operation type and the specific data content of the operation; the database is preferably MySQL, and the database log is preferably Binlog, that is, Binary Log, which is used to record all changes to the database and is stored in binary form.

[0105] Specifically, the database has a master-slave architecture, and the database includes: a master node and a slave node; based on the master-slave protocol, set up a disguised slave node in the database; the disguised slave node includes a number of replicas, elect a master replica from a number of replicas, and obtain the database log pushed by the master node through the master replica; according to the database log, perform parsing to obtain database change task information; combine the database event type to perform corresponding data structure adjustment to obtain database event information.

[0106] Step 203, push the database event information to the platform microservice message queue.

[0107] Specifically, a message re-push queue is also deployed in the cloud platform system; the master replica of the disguised slave node, based on the main push single-thread, pushes the database event information to the message queue; in response to a push failure, store the database event information in the message re-push queue, and based on the re-push message thread, perform re-push and mark it as a failed re-push message; in response to the message queue receiving the database event information, broadcast the database event information in the message queue and distribute it to all platform microservice message queues.

[0108] Step 204: Determine whether the database change task has been completed according to the database event information in the platform microservice message queue.

[0109] Specifically, determine whether there is a pre-microservice for the platform microservice; in response to the non-existence of a pre-microservice for the platform microservice, the platform microservice executes the database change task and feeds back the completion information of the database change task to the database; in response to the existence of a pre-microservice for the platform microservice, obtain the task completion information of the pre-microservice of the platform microservice, and determine whether the database change task has been completed according to the task completion information of the pre-microservice, where the pre-microservice includes: the platform microservice and the management microservice.

[0110] Step 205: In response to the completion of the database change task, feed back the completion information of the database change task to the database.

[0111] Specifically, after the platform microservice completes the database change task, the database event corresponding to the database change task is recorded through the database log, and the corresponding database change task information is generated.

[0112] In the above message notification method, by obtaining and parsing the database log in real-time monitoring, it is possible to capture database events such as data changes in a timely manner, avoiding the latency problem of the traditional polling mechanism, which is beneficial to improving the consistency and timeliness of data synchronization and ensuring the real-time performance and reliability of the system; at the same time, through the active notification mechanism of the message queue, it is possible to reduce the frequent status queries between microservices, reduce the system load, and improve the stability of the system in a concurrent scenario; in addition, each microservice in the platform layer and the virtualization layer is connected to the same database and message queue, and the information generated by microservices in different layers will be converted into database events and pushed to the message queue for distribution, so that cross-layer communication between microservices can be achieved, providing a reliable and efficient cross-layer service communication mechanism.

[0113] In one embodiment, the database is a master-slave architecture, and the database includes: a master node and a slave node. Obtaining the database log and parsing to obtain the database event information includes:

[0114] Based on the master-slave protocol, set up a disguised slave node in the database;

[0115] Based on the disguised slave node, obtain the database log pushed by the master node through the read-write thread;

[0116] According to the database log, obtain the data change information;

[0117] Parse according to the data change information to obtain the database change task information;

[0118] According to the database change task information, combined with the database event type, corresponding data structure adjustments are made to obtain database event information.

[0119] Specifically, in this embodiment, by setting up a disguised slave node of the database, the database log is monitored and parsed in real time, realizing the instant capture and notification of data changes, avoiding the latency problem brought by the traditional polling mechanism, establishing an instant notification mechanism, and making the data synchronization and status update between microservices more timely and accurate.

[0120] In one embodiment, according to the database change task information, combined with the database event type, corresponding data structure adjustments are made to obtain database event information, including:

[0121] According to the database change task information, combined with the database event type, serialized data is parsed and generated;

[0122] In response to the database event type being an addition or deletion event, the database change task information is parsed into a serialized array;

[0123] In response to the database event type being an update event, the database change task information is parsed into a serialized hash table;

[0124] Based on the serialized data, further parsing is performed to convert the serialized data into a key-value pair data structure to obtain database event information.

[0125] It should be noted that in response to the database event type being an addition or deletion event, the database event information is parsed into a serialized array. A feasible implementation example is: Serializable[] row;

[0126] In response to the database event type being an update event, the database event information is parsed into a serialized hash table. A feasible implementation example is: Map.Entry<Serializable[], Serializable[]> row;

[0127] It should be noted that taking MySQL and Binlog as an example, typical database tables include the field names and field values of each field, but the data recorded in Binlog does not include the field names. However, the position of each field value in the serialized array corresponds one-to-one with the position of each field in the table structure, so as to identify the corresponding field names. Therefore, in one embodiment, first query the table structure from the database to find the corresponding relationship between the field names and field positions in the database table, and then combine the serialized array and the table structure to convert the serialized array into a key-value pair data structure that is convenient for reading and writing;

[0128] Further note that when parsing the values of the two data types of tinyint(1) and bit(1) in the database table, 1 will be converted to the boolean value true, and 0 will be converted to the boolean value false, which is the same as the default data processing specification of the database;

[0129] During the parsing process of database events, it is supported to configure not to deserialize events other than TABLE_MAP events, insert, delete, and update events, and it is supported to configure not to deserialize date and time and strings to reduce performance loss;

[0130] During the parsing process, it is supported to parse some table-related events, discard the table events that are not concerned about, so as to greatly improve the parsing efficiency; moreover, the tables and table fields that the user is concerned about are stored in the database; this configuration method enables in the production environment, without shutting down the machine and without delaying the normal business operation, only by updating the database, the messages pushed to the message queue can be controlled;

[0131] During the parsing process, after obtaining the database change task information, add a serial number to each database change task information, and then store the database change task information in a cache queue; by setting up a thread pool, based on the threads in the thread pool, concurrently retrieve the database change task information from the cache queue and perform parsing. After the parsing is completed, the results are pushed as messages in order, so as to ensure that the order of the database event information pushed after parsing is the same as the order of obtaining the original database time information, and at the same time, in a high-concurrency scenario, it has a more efficient database event parsing efficiency.

[0132] Specifically, in this embodiment, by converting the database change task information into corresponding serialized data according to different database change task types, and then converting it into a key-value pair form, the complexity of parsing and conversion can be reduced while ensuring the authenticity and reliability of the information.

[0133] In one embodiment, there are several replicas of the disguised slave node in the database, where the number of several replicas is greater than or equal to three. Pushing the database event information to the platform microservice message queue includes:

[0134] In response to the start of several replicas, several replica numbers are generated correspondingly;

[0135] Write several replica numbers into the same ordered set to obtain the current replica sequence;

[0136] According to the current replica sequence, select a primary replica from several replicas, and the remaining replicas are secondary replicas;

[0137] Based on the replica, obtain the database log. In response to the replica being the primary replica, based on the primary replica, generate database event information according to the database log;

[0138] In response to the replica being a secondary replica, discard the database log received from the secondary replica.

[0139] Specifically, in this embodiment, by deploying multiple replicas through disguising the secondary nodes and combining with the election mechanism, it can ensure that a new primary replica can be quickly elected to continue to undertake tasks when the primary replica fails, realizing the failover mechanism and ensuring the continuity and reliability of message notification.

[0140] In one embodiment, according to the current replica sequence, select a primary replica from several replicas, and the remaining replicas are secondary replicas, including:

[0141] Based on a preset heartbeat interval, perform heartbeat detection on several replicas respectively;

[0142] In response to the result of the heartbeat detection being healthy and there being a replica serial number corresponding to the replica in the current replica sequence, update the replica serial number according to the current replica sequence;

[0143] In response to the result of the heartbeat detection being a failure and there being a replica serial number corresponding to the replica in the current replica sequence, determine whether the replica can recover to be healthy within the expiration time. In response to the determination result being no, delete the replica serial number in the current replica sequence;

[0144] In response to the result of the heartbeat detection being healthy and there being no replica serial number corresponding to the replica in the current replica sequence, add the replica serial number to the end of the current replica sequence;

[0145] In response to the replica serial number corresponding to the replica being the first in the current replica sequence, the replica is the primary replica; otherwise, it is a secondary replica.

[0146] Specifically, in this embodiment, by introducing heartbeat monitoring as the primary replica election mechanism to perform health check and recovery judgment on the replicas, the high availability of the replicas is ensured; moreover, the dynamic adjustment of the replica sequence effectively improves the fault tolerance of the system and avoids the situation that event pushing is affected due to replica failures.

[0147] It should be noted that if the preset heartbeat interval is set to n, the expiration time is preferably configured as 3n, and the primary replica goes offline only after three heartbeat failures; this can avoid problems with the heartbeat mechanism. For example, network latency or a brief network interruption may cause misjudgment of the primary replica failure, thus triggering unnecessary failover; in addition, the specific heartbeat time can also be set according to the business scale of one's own system and the tolerance for latency, and optimized in combination with sufficient testing and production practice.

[0148] It should be noted that the ordered set is preferably a Redis ordered set. Among them, the Redis ordered set is preferably deployed in a master-slave cluster mode, so as to avoid the situation where multiple replicas cannot update and query the Redis ordered set when there is a Redis single point of failure, which may lead to the abnormal execution of the master replica selection process.

[0149] In one embodiment, a message re-push queue is also deployed in the cloud platform system. Pushing the database event information to the platform microservice message queue includes:

[0150] Obtain the master replica of the disguised slave node;

[0151] Create a main push single-thread according to the master replica;

[0152] In response to generating database event information based on the master replica, push the database event information to the message general queue through the main push single-thread;

[0153] In response to the master replica failing to successfully push the database event information to the message general queue, store the database event information in the message re-push queue;

[0154] Create a message re-push thread according to the message re-push queue;

[0155] Push the database event information in the message re-push queue to the message general queue through the message re-push thread;

[0156] In response to the message general queue successfully receiving the database event information, push the database event information to the platform microservice message queue.

[0157] Specifically, in this embodiment, by combining the message re-push queue and the main push single-thread mechanism, reliable message delivery can be ensured; and if the message push fails, the system can automatically re-push, ensuring the ultimate consistency of the message and the accurate feedback of the task completion information.

[0158] In one embodiment, a message broadcast queue is also deployed in the message general queue. In response to the message general queue successfully receiving the database event information, pushing the database event information to the platform microservice message queue includes:

[0159] In response to the message general queue receiving the database event information, store the database event information in the message broadcast queue;

[0160] In response to the message broadcast queue receiving the database event information, distribute the database event information to all platform microservice message queues through the message broadcast queue, where the database event information originating from the message re-push queue is marked as a failed re-push message.

[0161] Specifically, this embodiment uses the message broadcast queue mechanism to enable the platform microservice to receive all relevant database event information, thereby improving the scalability and flexibility of the system; at the same time, the marking processing of failed re-pushed messages can effectively identify and track anomalies in the message processing process.

[0162] In one embodiment, judging whether the database change task is completed according to the database event information in the platform microservice message queue includes:

[0163] Based on the platform microservice, perform a pre-query to determine whether the platform microservice has a pre-microservice;

[0164] In response to the platform microservice not having a preceding microservice, the platform microservice executes the database change task and feeds back completion information of the database change task to the database;

[0165] In response to the presence of a preceding microservice for the platform microservice, task completion information of the preceding microservice of the platform microservice is obtained, and whether the database change task is executed is determined according to the task completion information of the preceding microservice.

[0166] Specifically, in this embodiment, in combination with the pre-query mechanism, the platform microservice can determine whether the database change task is completed based on the task completion information of the pre-microservice, thereby ensuring that the dependency relationship of task execution is correctly handled and avoiding execution conflicts between tasks.

[0167] In one embodiment, the front-end microservice includes at least one or more of the following: platform microservice and management microservice. The task completion information of the front-end microservice is obtained in the following manner:

[0168] In response to the presence of a preceding microservice for the platform microservice, the current preceding microservice of the platform microservice is obtained, and the platform microservice is set to be delayed start, and a delayed start task corresponding to the database change task is generated;

[0169] In response to the current front-end microservice not being a management microservice, the current front-end microservice is used as a new platform microservice, and a front-end query is recursively performed until the current front-end microservice obtained is a management microservice;

[0170] In response to the current front-end microservice being a management microservice, the management microservice is called to execute the resource configuration task corresponding to the database change task, and task completion information of the management microservice is obtained;

[0171] In response to the platform microservice receiving the task completion information of the current front-end microservice, the delayed start task is closed and the platform microservice is executed to obtain the task completion information of the platform microservice.

[0172] Specifically, in this embodiment, through the recursive query mechanism of the preposed microservice, it is ensured that the platform microservice can execute the database change task after the preposed service is completed, avoiding the execution of tasks that do not conform to the dependency relationship and improving the task scheduling accuracy of the system.

[0173] In one embodiment, based on the dynamic calculation method, according to the historical execution duration of the resource configuration task corresponding to the database change task executed by the management microservice, set the delay start time of the delay start task corresponding to the database change task;

[0174] In response to the expiration of the delay start time or the awakening of the delay start task, close the delay start task and run the corresponding platform microservice;

[0175] It should be noted that a feasible calculation method for the delay start time is as follows:

[0176] Obtain all the execution durations of the resource configuration tasks for the data change tasks executed by the preposed microservice of the platform microservice in the past detection period. Here, the preposed microservice is the management microservice. In response to the preposed microservice not being the management microservice, perform a recursive preposed query until the corresponding management microservice is found;

[0177] Select several execution durations with the longest time from all the execution durations. Preferably, the number of several execution durations is 3;

[0178] Based on the selected several execution durations, calculate the average execution duration;

[0179] According to the average execution duration, multiply by the adjustment coefficient to obtain the delay start time, where the adjustment coefficient is preferably 1.1 - 1.3.

[0180] In one embodiment, obtain the task completion information of the preposed service of the platform microservice, and judge whether the database change task is completed according to the task completion information of the preposed microservice, including:

[0181] In response to the generation of the delay start task, create a corresponding task record information and store it in the task record table, where the task record information includes at least one of the following: task serial number, required resource type, requested resource serial number;

[0182] Through the message general queue, distribute the database event information to the platform microservice message queue, where the database event information includes at least one of the following: service completion serial number, configured resource type, configured resource serial number, current state of the configured resource, failure retry flag;

[0183] In response to the required resource type and the configured resource type being the same, the database event information is the associated information of the platform microservice;

[0184] In response to the database event information being the associated information of the platform microservice, compare it with the task record table to determine whether the database event information is the task completion information of the previous microservice. Otherwise, discard the database event information in the platform microservice message queue.

[0185] Specifically, in this embodiment, by comparing the task record table, it is ensured that the database event information is consistent with the task completion information of the previous microservice, further improving the accuracy and consistency of task execution. At the same time, the processing mechanism of the failure retry flag enhances the fault tolerance of the system.

[0186] In one embodiment, in response to the database event information being the associated information of the platform microservice, compare it with the task record table to determine whether the database event information is the task completion information of the previous microservice, and further includes:

[0187] Setting the task completion information of the previous microservice includes: invalid completion information, valid completion information;

[0188] Query all task record information in the task record table. In response to the existence of the same task serial number and service completion serial number, the database event information is the relevant information of the previous microservice;

[0189] In response to the database event information being the relevant information of the previous microservice, obtain the failure retry flag. In response to the failure retry flag being yes, the database event information is the invalid completion information;

[0190] In response to the failure retry flag being no, obtain the current state of the configuration resource;

[0191] In response to the current state of the configuration resource being the steady state, the database event information is the valid completion information of the previous microservice. Otherwise, the database event information is the uncompleted information of the previous microservice.

[0192] Specifically, in this embodiment, by setting the valid and invalid completion information and querying the task record table, it is ensured that the platform microservice can accurately identify the task status of the previous microservice, thereby improving the stability and correctness of task execution and reducing the execution failure caused by incorrect task status judgment.

[0193] In one embodiment, in response to the database event information being the task completion information of the previous microservice, execute the delayed start task corresponding to the platform microservice, including:

[0194] Obtain the task completion information of the previous microservice;

[0195] In response to the task completion information of the previous microservice being the valid completion information, directly wake up the delayed start task and execute it;

[0196] In response to the task completion information of the pre-microservice being invalid completion information, wake up the delayed start task and execute it based on the polling query method;

[0197] In response to the execution of the delayed start task, delete the task record information corresponding to the delayed start task from the task record table.

[0198] Specifically, the mechanism of the delayed start task in this embodiment ensures that after the task of the pre-microservice is completed, the platform microservice can execute the database change task in a timely manner; through polling query and health status check, it ensures that the task is started and executed as expected, improving the overall response ability of the system and the reliability of task execution.

[0199] It should be understood that although Figure 2 the steps in the flowchart are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figure 2 at least a part of the steps in

[0200] may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0200] It is worth noting that in one embodiment, a database log listening parser and a message listening dispatcher are introduced to implement the message notification method as shown in Figure 2 . For the detailed work process, see Figure 3 , where the platform microservice includes: computing platform microservice, network platform microservice, storage platform microservice, and the platform microservice message queue includes: computing platform microservice message queue, network platform microservice message queue, storage platform microservice message queue.

[0201] In one embodiment, the database listening parser obtains database event information by disguising as a slave node. The specific work process is as shown in Figure 4 .

[0202] In one embodiment, a master replica selector is introduced to implement multi-replica deployment and replica selection. The work process of the master replica selector is as shown in Figure 5 , where the master replica selector is also connected to a monitoring device and an alarm device to continuously monitor whether the master replica selector is running normally.

[0203] In one embodiment, a message pusher is introduced to implement the push of database event information. The work process of the message pusher is asFigure 6 as shown

[0204] In one embodiment, as Figure 7 shown, a message notification device is provided. A database, a platform layer, a virtualization layer, and a message general queue are deployed in a cloud platform system. A number of platform microservices are deployed inside the platform layer, and a number of management microservices are deployed inside the virtualization layer. The device is applied to the cloud platform system, and the device includes: a queue creation module, a log listening and parsing module, a message pushing module, a message judgment module, and a message feedback module, where:

[0205] The queue creation module is configured to create a corresponding platform microservice message queue in the message general queue in response to the platform microservice receiving a database change task;

[0206] The log listening module is configured to obtain database logs and parse to obtain database event information;

[0207] The message pushing module is configured to push the database event information to the platform microservice message queue;

[0208] The message judgment module is configured to judge whether the database change task is completed according to the database event information in the platform microservice message queue;

[0209] The message feedback module is configured to, in response to the completion of the database change task, feedback the completion information of the database change task to the database.

[0210] The log listening module is configured to set a disguised slave node in the database based on the master-slave protocol; based on the disguised slave node, obtain the database logs pushed by the master node through read and write threads; obtain data change information according to the database logs; parse according to the data change information to obtain database change task information; and perform corresponding data structure adjustment according to the database change task information in combination with the database event type to obtain database event information.

[0211] The log listening module is further configured to parse and generate serialized data according to the database change task information in combination with the database event type; in response to the database event type being an add / delete event, parse the database change task information into a serialized array; in response to the database event type being an update event, parse the database change task information into a serialized hash table; and perform secondary parsing based on the serialized data to convert the serialized data into a key-value pair data structure to obtain database event information.

[0212] The log monitoring module is also used to generate a number of replica sequence numbers in response to the startup of a number of replicas; write the number of replica sequence numbers into the same ordered set to obtain the current replica sequence; select a primary replica from the number of replicas according to the current replica sequence, and the remaining replicas are secondary replicas; based on the replicas, obtain database logs, and in response to the replica being the primary replica, generate database event information based on the database logs according to the primary replica; in response to the replica being a secondary replica, discard the database logs received by the secondary replica.

[0213] The log monitoring module is also used to perform heartbeat detection on a number of replicas respectively based on a preset heartbeat interval; in response to the result of the heartbeat detection being healthy and there being a replica sequence number corresponding to the replica in the current replica sequence, update the replica sequence number according to the current replica sequence; in response to the result of the heartbeat detection being a failure and there being a replica sequence number corresponding to the replica in the current replica sequence, determine whether the replica can recover health within the expiration time, and in response to the judgment result being no, delete the replica sequence number in the current replica sequence; in response to the result of the heartbeat detection being healthy and there being no replica sequence number corresponding to the replica in the current replica sequence, add the replica sequence number to the end of the current replica sequence; in response to the replica sequence number corresponding to the replica being the first in the current replica sequence, the replica is the primary replica, otherwise, it is a secondary replica.

[0214] The message pushing module is used to obtain the primary replica of the disguised slave node; create a main push single-thread according to the primary replica; in response to the generation of database event information based on the primary replica, push the database event information to the message general queue through the main push single-thread; in response to the primary replica failing to successfully push the database event information to the message general queue, store the database event information in the message re-push queue; create a message re-push thread according to the message re-push queue; push the database event information in the message re-push queue to the message general queue through the message re-push thread; in response to the message general queue successfully receiving the database event information, push the database event information to the platform microservice message queue.

[0215] The message pushing module is also used to store the database event information in the message broadcast queue in response to the message general queue receiving the database event information; in response to the message broadcast queue receiving the database event information, distribute the database event information to all platform microservice message queues through the message broadcast queue, where the database event information originating from the message re-push queue is marked as a failed re-push message.

[0216] The message judgment module is used to perform a pre-query based on the platform microservice to determine whether the platform microservice has a pre-query microservice; in response to the platform microservice not having a pre-query microservice, the platform microservice executes the database change task and feeds back the completion information of the database change task to the database; in response to the platform microservice having a pre-query microservice, the task completion information of the pre-query microservice is obtained, and according to the task completion information of the pre-query microservice, it is determined whether the database change task is completed.

[0217] The message judgment module is also used to, in response to the existence of a predecessor microservice of the platform microservice, obtain the current predecessor microservice of the platform microservice, set the platform microservice to delayed start, and generate a delayed start task corresponding to the database change task; in response to the current predecessor microservice not being a management microservice, use the current predecessor microservice as a new platform microservice, and recursively perform a predecessor query until the current predecessor microservice obtained is a management microservice; in response to the current predecessor microservice being a management microservice, call the management microservice to execute the resource configuration task corresponding to the database change task, and obtain the task completion information of the management microservice; in response to the platform microservice receiving the task completion information of the current predecessor microservice, close the delayed start task and execute the platform microservice to obtain the task completion information of the platform microservice.

[0218] The message judgment module is also used to set the delayed start time of the delayed start task corresponding to the database change task based on the historical execution time of the resource configuration task corresponding to the database change task executed by the management microservice based on a dynamic calculation method.

[0219] The message judgment module is also used to respond to the generation of a delayed start task, and then create a corresponding task record information stored in the task record table, wherein the task record information includes at least one of the following: task sequence number, required resource type, and requested resource sequence number; distribute the database event information to the platform microservice message queue through the message queue, wherein the database event information includes at least one of the following: service completion sequence number, configuration resource type, configuration resource sequence number, configuration resource current status, and failure re-push mark; in response to the required resource type and the configuration resource type being consistent, the database event information is the associated information of the platform microservice; in response to the database event information being the associated information of the platform microservice, a comparison is performed in combination with the task record table to determine whether the database event information is the task completion information of the preceding microservice, otherwise, the database event information is discarded in the platform microservice message queue.

[0220] The message judgment module is further configured to set the task completion information of the pre-microservice, including: invalid completion information and valid completion information; query all task record information in the task record table, and in response to the existence of the same task serial number and service completion serial number, the database event information is the relevant information of the pre-microservice; in response to the database event information being the relevant information of the pre-microservice, obtain the failure re-push flag, and in response to the failure re-push flag being yes, the database event information is invalid completion information; in response to the failure re-push flag being no, obtain the current state of the configuration resource; in response to the current state of the configuration resource being the steady state, the database event information is the valid completion information of the pre-microservice, otherwise, the database event information is the uncompleted information of the pre-microservice.

[0221] The message judgment module is further configured to obtain the task completion information of the pre-microservice; in response to the task completion information of the pre-microservice being valid completion information, directly wake up the delayed start task and execute it; in response to the task completion information of the pre-microservice being invalid completion information, wake up the delayed start task and execute it based on the polling query method; in response to the execution of the delayed start task, delete the task record information corresponding to the delayed start task from the task record table.

[0222] For the specific limitations of the message notification device, reference can be made to the limitations on the message notification method in the above text, which will not be elaborated here. Each module in the above message notification device can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above modules.

[0223] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 8 shown. The computer device includes a processor, a memory, a network interface and a database connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store message notification data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a message notification method.

[0224] Those skilled in the art can understand, Figure 4The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0225] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0226] In response to the platform microservice receiving a database change task, create a corresponding platform microservice message queue in the message queue;

[0227] Obtain the database log and parse to obtain database event information;

[0228] Push the database event information to the platform microservice message queue;

[0229] Judge whether the database change task has been completed according to the database event information in the platform microservice message queue;

[0230] In response to the completion of the database change task, feedback the completion information of the database change task to the database.

[0231] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0232] In response to the platform microservice receiving a database change task, create a corresponding platform microservice message queue in the message queue;

[0233] Obtain the database log and parse to obtain database event information;

[0234] Push the database event information to the platform microservice message queue;

[0235] Judge whether the database change task has been completed according to the database event information in the platform microservice message queue;

[0236] In response to the completion of the database change task, feedback the completion information of the database change task to the database.

[0237] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0238] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0239] The above embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application.

Claims

1. A message notification method, which is applied to a cloud platform system, characterized in that, The cloud platform system is deployed with database, platform layer, virtualization layer and message team. Several platform microservices are deployed in the platform layer, and several management microservices are deployed in the virtualization layer. The methods include: In response to the platform microservice receiving the database change task, a corresponding platform microservice message queue is created in the message queue; Get database logs and parse them to get database event information; Push database event information to the platform microservice message queue; Based on the database event information in the platform microservice message queue, determine whether the database change task has been completed, including: in response to the existence of a predecessor microservice for the platform microservice, obtain the current predecessor microservice of the platform microservice, and set the platform microservice to delayed start, and generate a delayed start task corresponding to the database change task; in response to the generation of the delayed start task, create a corresponding task record information and store it in the task record table, and the task record information at least includes: the required resource type; distribute the database event information to the platform microservice message queue through the message team, and the database event information at least includes: the configuration resource type; in response to the required resource type and the configuration resource type being consistent, the database event information is the associated information of the platform microservice; in response to the database event information being the associated information of the platform microservice, compare it with the task record table to determine Whether the database event information is the task completion information of the front-end microservice, otherwise, the database event information is discarded in the platform microservice message queue; wherein, the task completion information of the front-end microservice is obtained in the following manner: the front-end microservice includes at least one or more of the following: platform microservice, management microservice; in response to the current front-end microservice not being a management microservice, the current front-end microservice is used as a new platform microservice, and a front query is recursively performed until the current front-end microservice obtained is a management microservice; in response to the current front-end microservice being a management microservice, the management microservice is called to execute the resource configuration task corresponding to the database change task, and the task completion information of the management microservice is obtained; in response to the platform microservice receiving the task completion information of the current front-end microservice, the delayed start task is closed and the platform microservice is executed to obtain the task completion information of the platform microservice; In response to the completion of the database change task, completion information of the database change task is fed back to the database.

2. The message notification method according to claim 1, wherein The database is a master-slave architecture, and includes: a master node and a slave node. The database log is obtained and parsed to obtain database event information, including: Based on the master-slave protocol, setting a fake slave node in the database; Based on the disguised slave node, the database log pushed by the master node is obtained through a read-write thread; According to the database log, data change information is obtained; Parse the data change information to obtain database change task information; According to the database change task information and in combination with the database event type, corresponding data structure adjustment is performed to obtain database event information.

3. The message notification method according to claim 2, characterized in that The step of adjusting the corresponding data structure according to the database change task information and the database event type to obtain the database event information includes: According to the database change task information and in combination with the database event type, parsing and generating serialized data; In response to the database event type being a add / delete event, parsing the database change task information into a serialized array; In response to the database event type being an update event, parsing the database change task information into a serialized hash table; Based on the serialized data, the serialized data is parsed again to convert the serialized data into a key-value pair data structure to obtain the database event information.

4. The message notification method according to claim 2, wherein The fake slave node has a plurality of copies in the database, wherein the number of the plurality of copies is greater than or equal to three, and pushing the database event information to the platform microservice message queue includes: In response to the activation of a plurality of the replicas, a plurality of replica serial numbers are correspondingly generated; Writing the serial numbers of several replicas into the same ordered set to obtain the current replica sequence; According to the current replica sequence, a master replica is selected from the plurality of replicas, and the remaining replicas are slave replicas; Based on the replica, the database log is obtained, and in response to the replica being the primary replica, the database event information is generated according to the database log based on the primary replica; In response to the replica being a slave replica, discarding the database log received by the slave replica.

5. A message notification method according to claim 4, characterized in that, The selecting a master copy from the plurality of copies according to the current copy sequence, and the remaining copies being slave copies, comprises: Based on a preset heartbeat interval, performing heartbeat detection on each of the plurality of replicas; In response to the result of the heartbeat detection being healthy and the replica sequence number corresponding to the replica existing in the current replica sequence, updating the replica sequence number according to the current replica sequence; In response to the result of the heartbeat detection being a failure and the replica sequence number corresponding to the replica existing in the current replica sequence, determining whether the replica can be restored to health within the expiration time, and in response to a negative determination result, deleting the replica sequence number from the current replica sequence; In response to the result of the heartbeat detection being healthy and the replica sequence number corresponding to the replica not existing in the current replica sequence, adding the replica sequence number to the end of the current replica sequence; In response to the replica sequence number corresponding to the replica being the first in the current replica sequence, the replica is the master replica; otherwise, it is the slave replica.

6. A message notification method according to claim 4, characterized in that, The cloud platform system also deploys a message re-push queue, and the database event information is pushed to the platform microservice message queue, including: Obtaining the master copy of the camouflaged slave node; According to the master copy, a main push single thread is created; In response to generating the database event information based on the primary copy, the database event information is pushed to the message team through the primary push single thread; In response to the primary copy failing to successfully push the database event information to the message queue, storing the database event information in the message re-push queue; Creating a message re-push thread according to the message re-push queue; Pushing the database event information in the message re-push queue to the message queue through the message re-push thread; In response to the message general team successfully receiving the database event information, push the database event information to the platform microservice message queue.

7. The message notification method according to claim 6, wherein A message broadcast queue is also deployed in the message general team. The step of pushing the database event information to the platform microservice message queue in response to the message general team successfully receiving the database event information includes: In response to the message general team receiving the database event information, store the database event information in the message broadcast queue; In response to the message broadcast queue receiving the database message, distribute the database message to all the platform microservice message queues through the message broadcast queue, where the database event information originating from the message re-push queue is marked as a failed re-push message.

8. A message notification method according to claim 1, characterized in that, Based on the database event information in the platform microservice message queue, determine whether the database change task has been completed, including: Based on the platform microservice, perform a pre-query to determine whether there is a pre-microservice for the platform microservice; In response to the platform microservice having no pre-microservice, the platform microservice executes the database change task and feeds back the completion information of the database change task to the database; In response to the platform microservice having a pre-microservice, obtain the task completion information of the pre-microservice of the platform microservice, and based on the task completion information of the pre-microservice, determine whether the database change task has been completed.

9. A message notification method according to claim 8, characterized in that The task record information at least further includes at least one of the following: task serial number, request resource serial number; The database event information at least further includes at least one of the following: service completion serial number, configuration resource serial number, current state of the configuration resource, failed re-push flag.

10. A message notification method according to claim 9, characterized in that, In response to the database event information being the associated information of the platform microservice, compare it in combination with the task record table to determine whether the database event information is the task completion information of the pre-microservice, and further includes: The task completion information set for the pre-microservice includes: invalid completion information, valid completion information; Query all the task record information in the task record table. In response to the existence of the same task serial number and service completion serial number, the database event information is the relevant information of the pre-microservice; In response to the database event information being the relevant information of the pre-microservice, obtain the failed re-push flag. In response to the failed re-push flag being yes, the database event information is the invalid completion information; In response to the failed re-push flag being no, obtain the current state of the configuration resource; In response to the current state of the configuration resource being in a steady state, the database event information is the valid completion information of the pre-microservice, otherwise, the database event information is the uncompleted information of the pre-microservice.

11. A message notification method according to claim 10, characterized in that, In response to the database event information being the task completion information of the pre-microservice, execute the corresponding delayed start task of the platform microservice, including: Obtain the task completion information of the pre-microservice; In response to the task completion information of the preposed microservice being the valid completion information, directly wake up the delayed start task and execute it; In response to the task completion information of the preposed microservice being the invalid completion information, wake up the delayed start task and execute it based on the polling query method; In response to the execution of the delayed start task, delete the task information corresponding to the delayed start task from the task record table.

12. A message notification device for implementing the message notification method according to any one of claims 1-11, wherein the device is applied to a cloud platform system, and is characterized in that, A database, a platform layer, a virtualization layer, and a message general queue are deployed in the cloud platform system. A number of platform microservices are deployed inside the platform layer, and a number of management microservices are deployed inside the virtualization layer. The device includes: A queue creation module, configured to create a corresponding platform microservice message queue in the message general queue in response to the platform microservice receiving a database change task; A log monitoring module, configured to obtain database logs and parse to obtain database event information; A message pushing module, configured to push the database event information to the platform microservice message queue; A message judgment module, configured to judge whether the database change task is completed according to the database event information in the platform microservice message queue; A message feedback module, configured to, in response to the completion of the database change task, feedback the completion information of the database change task to the database.

13. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Service processing method and system

    CN108076098A

  • Data synchronization method and device, electronic equipment and storage medium

    CN116756241A

  • Cache refreshing method, device and equipment, computer program product and storage medium

    CN118568114A