CN112835728A - Message processing method and device, computer equipment and storage medium - Google Patents

Message processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112835728A
CN112835728A CN202110175679.8A CN202110175679A CN112835728A CN 112835728 A CN112835728 A CN 112835728A CN 202110175679 A CN202110175679 A CN 202110175679A CN 112835728 A CN112835728 A CN 112835728A
Authority
CN
China
Prior art keywords
message
service
data center
mode
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110175679.8A
Other languages
Chinese (zh)
Other versions
CN112835728B (en
Inventor
陈禹旭
胡钊
金文娴
余芸
姜唯
萧展辉
张凌志
任昊文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Original Assignee
Southern Power Grid Digital Grid Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Southern Power Grid Digital Grid Research Institute Co Ltd
Priority to CN202110175679.8A priority Critical patent/CN112835728B/en
Publication of CN112835728A publication Critical patent/CN112835728A/en
Application granted granted Critical
Publication of CN112835728B publication Critical patent/CN112835728B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0709Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a distributed system consisting of a plurality of standalone computer nodes, e.g. clusters, client-server systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The application relates to a message processing method, a message processing device, computer equipment and a storage medium. The method comprises the following steps: acquiring a service message; the service message is sent to a second data center at the same time of being sent to the first data center; the second data center is a standby data center of the first data center; checking the current operation mode; when the current operation mode is a production mode, after executing the service processing operation corresponding to the service message, confirming the service message reception; and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message. By adopting the method, the message loss and the message repetition can be reduced.

Description

Message processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a message processing method and apparatus, a computer device, and a storage medium.
Background
With the continuous expansion of system functions, the core service flow is larger and larger, and more resources are used. The asynchronous micro-service architecture in the micro-service architecture system can improve the throughput of the system, reduce resource consumption, realize decoupling between service instances and improve the expansion capability of the system. However, it lacks design for disaster tolerance, and is easy to cause message loss and cause system data inconsistency in the unavailable state of the message service node.
Disclosure of Invention
In view of the above, it is necessary to provide a message processing method, an apparatus, a computer device, and a storage medium capable of reducing message loss and message repetition in response to the above technical problems.
A message processing method applied to a first data center, the method comprising:
acquiring a service message; the service message is sent to a second data center at the same time of being sent to the first data center; the first data center is a standby data center of the second data center;
checking the current operation mode;
when the current operation mode is a production mode, after executing the service processing operation corresponding to the service message, confirming the service message reception;
and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message.
In one embodiment, the first data center is normally in a standby mode, and the second data center is normally in a production mode;
the method further comprises the following steps:
when the second data center fails, switching the domain name and switching the current operation mode from a standby mode to a production mode; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
In one embodiment, the acquiring the service message includes:
receiving a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to the message queue of the first data center and the message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to service types.
In one embodiment, the method further comprises:
the message receiving end of the message queue sends the service message to a message processing server end of the message queue; the service message has one-to-one corresponding internal message identification in a message queue system;
the message processing server side lands the service message;
and the message processing server side feeds back service message confirmation information to the message receiving side.
In one embodiment, the method further comprises:
the message processing server sends the service message to a message processing terminal; the service message has one-to-one corresponding service identification in a service system;
receiving the service message confirmation information fed back by the message processing terminal;
and deleting the landing service message according to the service message confirmation information.
A message processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the service message; the service message is sent to a second data center at the same time of being sent to the first data center; the first data center is a standby data center of the second data center;
the checking module is used for checking the current operation mode;
the processing module is used for receiving and processing the service message after executing the service processing operation corresponding to the service message when the current operation mode is the production mode; and when the current operation mode is the standby mode, after skipping the execution of the service processing operation corresponding to the service message, performing service message receiving and processing confirmation.
In one embodiment, the first data center is normally in a standby mode, and the second data center is normally in a production mode;
the device further comprises:
the switching module is used for switching the domain name and switching the current operation mode from the standby mode to the production mode when the second data center fails; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
In one embodiment, the obtaining module is further configured to receive a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to the message queue of the first data center and the message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to service types.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a service message; the service message is sent to a second data center at the same time of being sent to the first data center; the second data center is a standby data center of the first data center;
checking the current operation mode;
when the current operation mode is a production mode, after executing the service processing operation corresponding to the service message, confirming the service message reception;
and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a service message; the service message is sent to a second data center at the same time of being sent to the first data center; the second data center is a standby data center of the first data center;
checking the current operation mode;
when the current operation mode is a production mode, after executing the service processing operation corresponding to the service message, confirming the service message reception;
and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message.
According to the message processing method, the message processing device, the computer equipment and the storage medium, through setting the double sending and the operation mode of the service message, when the current operation mode is the production mode, the service message receiving confirmation is carried out after the service processing operation corresponding to the service message is executed; and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message. In this way, one of the two data centers is used as a conventional data center, one of the two data centers is used as an application-level disaster recovery data center, and when the application-level disaster recovery data center is in a standby mode, actual service processing is not performed and only reception confirmation is performed, and when the application-level disaster recovery data center is in a production mode, service processing confirmation is performed, so that message loss and message repetition can be reduced, and system data consistency is guaranteed.
Drawings
FIG. 1 is a flow diagram illustrating a message processing method according to one embodiment;
FIG. 2 is an architecture diagram of an implementation of a message processing method in one embodiment;
FIG. 3 is a diagram showing an architecture of an implementation of a message processing method in another embodiment;
FIG. 4 is a block diagram showing the structure of a message processing apparatus according to an embodiment;
FIG. 5 is a block diagram showing the construction of a message processing apparatus according to another embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a message processing method is provided, and this embodiment is illustrated by applying the method to a first data center. The first data center includes a server cluster comprised of a plurality of servers. In this embodiment, the message processing method includes the following steps:
step 102, acquiring a service message; the service message is sent to the second data center at the same time of being sent to the first data center; the first data center is a spare data center of the second data center.
Wherein a business message is a message related to a specific business service. Such as a login message associated with a login service, etc. The first data center and the second data center are both data centers, but different data centers. The first data center is a spare data center of the second data center.
In one embodiment, obtaining a service message comprises: receiving a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to a message queue of the first data center and a message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to the service types.
Specifically, the business message service is respectively deployed in a first data center and a second data center in a cluster according to a ratio of 1: 1. In view of the practical use of the first data center as an application-level disaster recovery device, it is ensured that double-sending is performed when sending messages and that no actual traffic processing is performed at the first data center. And after the second data center fails, the first data center is switched to a production mode, and at the moment, the first data center starts to process normal service information, so that the service integrity and consistency are ensured to the maximum extent.
Referring to fig. 2, a diagram illustrating an implementation architecture of a message processing method in one embodiment is shown. As can be seen from this figure, two data centers are involved in the message processing scenario, a first data center (data center B) and a second data center (data center a), wherein data center B is a backup center for the data centers. And calling a production service to send the business message when the producer needs to send the business message, wherein the production service respectively sends the message to the message cluster of the data center A and the message cluster of the data center B. The producer is the role of message generation, such as business application, which generates a message according to the business and sends the message to the message queue, the production service is a specific business service (micro-service), and the business message is generated and then sent to the message queue by calling an amqp protocol interface.
Step 104, checking the current operation mode.
It is understood that the mode of the data center also includes a production mode and a standby mode, the data center performs normal business processing in the production mode, and the data center does not need business processing in the standby mode.
In one embodiment, the first data center is normally in a standby mode of operation and the second data center is normally in a production mode of operation. Thus, in a conventional situation, after receiving the message, the consumer of the first data center determines that the current operation mode is the standby mode, and does not perform service processing but performs consumer confirmation. And after receiving the message, the consumer of the second data center judges that the current operation mode is a production model, and performs normal service processing and consumer confirmation. The consumer is a service or a service logic for receiving and processing a service message, and the service message is determined according to a specific service, for example: when a user logs in, a login module (producer) can produce a message, message contents including user information, time and the like are sent to a message queue, then a consumer monitors whether the queue has data or not, and if the queue has the data, the data can be taken out from the queue for processing, for example, a module (consumer) recording user login records can analyze the data according to convention according to the content of the transmitted message and then write the data into a database or a file and the like.
Further, the message processing method further comprises: when the second data center fails, switching the domain name and switching the current operation mode from the standby mode to the production mode; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
Specifically, when the second data center fails, the second data center switches between a Domain Name System (DNS) and a master-slave database, and then switches between a production mode and a standby mode, so that it is ensured that unprocessed messages are processed according to normal business rules.
And 106, when the current operation mode is the production mode, after the service processing operation corresponding to the service message is executed, confirming the reception of the service message.
And 108, when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message.
According to the message processing method, through setting the double sending and the operation mode of the service message, when the current operation mode is the production mode, after the service processing operation corresponding to the service message is executed, the service message receiving confirmation is carried out; and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message. In this way, one of the two data centers is used as a conventional data center, one of the two data centers is used as an application-level disaster recovery data center, and when the application-level disaster recovery data center is in a standby mode, actual service processing is not performed and only reception confirmation is performed, and when the application-level disaster recovery data center is in a production mode, service processing confirmation is performed, so that message loss and message repetition can be reduced, and system data consistency is guaranteed.
It should be noted that, in order to ensure consistency of data logic processing, in an actual implementation process, idempotent implementation is required when two data centers send and process messages. The message queue system generates an internal message identifier to ensure the upper half field power and the like, a service sender brings in a service identifier, and a service receiver removes the duplicate and ensures the power and the like.
In one embodiment, the message processing method further includes: the message receiving end of the message queue sends the service message to the message processing server end of the message queue; the service message has one-to-one corresponding internal message identification in the message queue system; the message processing server side lands the service message; and the message processing server side feeds back the service message confirmation information to the message receiving side.
The Message Queue (MQ) is a kind of data structure of "first-in first-out" in the basic data structure. The method is generally used for solving the problems of application decoupling, asynchronous messages, flow peak clipping and the like, and realizes a high-performance, high-availability, scalable and final consistency framework. The message receiving end of the message queue is a sending end MQ-client, and the message processing service end of the message queue is a service end MQ-server. The internal message identification (inner-msg-id) is globally unique and generated by a message queue system, has service independence and shields a message sending party and a message receiving party. The traffic message acknowledgement character may be an acknowledgement character ack (acknowledgement character), a transmission class control character that a receiving station sends to a sending station in data communication. Indicating that the transmitted data is received without errors.
For example, referring to fig. 3, a diagram illustrating an implementation architecture of a message processing method in one embodiment is shown. The middle MQ message sends the top half: 1. the transmitting end MQ-client sends the message to the service end MQ-server; 2. the service end MQ-server lands the message; 3. and the MQ-server returns the ACK to the MQ-client at the transmitting end. If 3 is lost, the service message is retransmitted after the time of the sending end MQ-client is over, which may cause the service end MQ-server to receive the repeated service message. However, at this time, the service message retransmission is initiated by the MQ-client, the service message is processed by the MQ-server, and in order to avoid the service message repeated in the step 2, an internal message identifier is generated inside the MQ system for each service message, and is used as a basis for de-duplication, idempotency and the like.
In one embodiment, the message processing method further includes: the message processing server sends the service message to the message processing terminal; the service message has one-to-one corresponding service identification in the service system; receiving service message confirmation information fed back by a message processing end; and deleting the landing service message according to the service message confirmation information.
The message processing end is a receiving end MQ-client, and the service identification biz-id has service uniqueness.
By way of example, with continued reference to fig. 3, the MQ message sends the next half field: 4. the server MQ-server sends the message to the receiving end MQ-client; 5. the receiving end MQ-client sends ACK back to the service end; 6. and the service end MQ-server deletes the floor message. The MQ-client at the receiving end returns ACK to the MQ-server at the service end, the active calling behavior of the message consumption service party is realized, and the automatic initiation by the MQ-client cannot be realized, because the MQ system does not know when the consumption of the consumer is really successful. If 5 is lost, the service MQ-server will retransmit the message after timeout, possibly causing the MQ-client to receive repeated messages. At the moment, retransmission is initiated by MQ-server, the message processing is a message consumption service party, message retransmission tends to cause repeated consumption of the service party, and in order to ensure service idempotency, a biz-id is required in a service message body to be used as the basis for de-duplication, idempotency and the like.
In one embodiment, the producer will also perform double-feed when sending messages after switching the first data center to production mode after the second data center fails. At this time, the message processing method is also applied to the second data center. If the first data center is switched to the production mode after the second data center fails, and a producer does not perform double sending when sending the message, the second data center acquires a service message before the second data center fails, and the service message is sent to the second data center while being sent to the first data center; checking the current operation mode; and when the current operation mode is the production mode, after the service processing operation corresponding to the service message is executed, the service message receiving confirmation is carried out. And after the second data center fails, the service message is not sent to the second data center any more.
In summary, the present application provides an asynchronous message system scheme emphasizing the idempotent nature of disaster recovery and messages under an asynchronous micro-service architecture, and compared with a common micro-service message bus system, the asynchronous message system scheme solves the problems of message loss, message repeated consumption and the like easily caused in the unavailable state of a main message service node, guarantees the system data consistency, and can further improve the stability and service continuity of a service system.
In further embodiments, after the failure of the second data center is repaired, the domain name switching and the mode switching of the data center may be triggered, the operation mode of the second data center may be switched to the production mode, and the operation mode of the first data center may be switched back to the standby mode.
It should be understood that, although the various steps in the flowchart of fig. 1 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 1 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
In one embodiment, as shown in fig. 4, there is provided a message processing apparatus including: an obtaining module 401, a viewing module 402 and a processing module 403, wherein:
an obtaining module 401, configured to obtain a service message; the service message is sent to the second data center at the same time of being sent to the first data center; the second data center is a standby data center of the first data center;
a viewing module 402, configured to view a current operating mode;
a processing module 403, configured to perform service message reception and processing confirmation after performing a service processing operation corresponding to a service message when the current operation mode is a production mode; and when the current operation mode is the standby mode, after skipping the execution of the service processing operation corresponding to the service message, performing service message receiving and processing confirmation.
As shown in fig. 5, in one embodiment, the first data center is normally in a standby mode, and the second data center is normally in a production mode;
the message processing apparatus further includes:
a switching module 404, configured to perform domain name switching and switch a current operation mode from a standby mode to a production mode when the second data center fails; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
In one embodiment, the obtaining module 401 is further configured to receive a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to a message queue of the first data center and a message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to the service types.
In one embodiment, the processing module 403 is further configured to send the service message to a message processing server of the message queue by a message receiving end of the message queue; the service message has one-to-one corresponding internal message identification in the message queue system; the message processing server side lands the service message; and the message processing server side feeds back the service message confirmation information to the message receiving side.
In one embodiment, the processing module 403 is further configured to send the service message to a message processing end by the message processing server; the service message has one-to-one corresponding service identification in the service system; receiving service message confirmation information fed back by a message processing end; and deleting the landing service message according to the service message confirmation information.
The message processing device performs double sending and operation mode setting on the service message, and then performs service message receiving confirmation after executing the service processing operation corresponding to the service message when the current operation mode is the production mode; and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message. In this way, one of the two data centers is used as a conventional data center, one of the two data centers is used as an application-level disaster recovery data center, and when the application-level disaster recovery data center is in a standby mode, actual service processing is not performed and only reception confirmation is performed, and when the application-level disaster recovery data center is in a production mode, service processing confirmation is performed, so that message loss and message repetition can be reduced, and system data consistency is guaranteed.
For the specific definition of the message processing device, reference may be made to the above definition of the message processing method, which is not described herein again. The respective modules in the message processing apparatus described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a first data center, whose internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for application development related resources. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a message processing method. Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: acquiring a service message; the service message is sent to a second data center at the same time of being sent to the first data center; the second data center is a standby data center of the first data center; checking the current operation mode; when the current operation mode is a production mode, after executing the service processing operation corresponding to the service message, confirming the service message reception; and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message.
In one embodiment, the first data center is normally in a standby mode, and the second data center is normally in a production mode; the processor, when executing the computer program, further performs the steps of: when the second data center fails, switching the domain name and switching the current operation mode from the standby mode to the production mode; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
In one embodiment, obtaining a service message comprises: receiving a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to a message queue of the first data center and a message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to the service types.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the message receiving end of the message queue sends the service message to the message processing server end of the message queue; the service message has one-to-one corresponding internal message identification in the message queue system; the message processing server side lands the service message; and the message processing server side feeds back the service message confirmation information to the message receiving side.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the message processing server sends the service message to the message processing terminal; the service message has one-to-one corresponding service identification in the service system; receiving service message confirmation information fed back by a message processing end; and deleting the landing service message according to the service message confirmation information.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a service message; the service message is sent to the second data center at the same time of being sent to the first data center; the second data center is a standby data center of the first data center; checking the current operation mode; when the current operation mode is a production mode, after executing the service processing operation corresponding to the service message, confirming the service message reception; and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message.
In one embodiment, the first data center is normally in a standby mode, and the second data center is normally in a production mode; the computer program when executed by the processor further realizes the steps of: when the second data center fails, switching the domain name and switching the current operation mode from the standby mode to the production mode; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
In one embodiment, obtaining a service message comprises: receiving a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to a message queue of the first data center and a message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to the service types.
In one embodiment, the computer program when executed by the processor further performs the steps of: the message receiving end of the message queue sends the service message to the message processing server end of the message queue; the service message has one-to-one corresponding internal message identification in the message queue system; the message processing server side lands the service message; and the message processing server side feeds back the service message confirmation information to the message receiving side.
In one embodiment, the computer program when executed by the processor further performs the steps of: the message processing server sends the service message to the message processing terminal; the service message has one-to-one corresponding service identification in the service system; receiving service message confirmation information fed back by a message processing end; and deleting the landing service message according to the service message confirmation information.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A message processing method applied to a first data center, the method comprising:
acquiring a service message; the service message is sent to a second data center at the same time of being sent to the first data center; the first data center is a standby data center of the second data center;
checking the current operation mode;
when the current operation mode is a production mode, after executing the service processing operation corresponding to the service message, confirming the service message reception;
and when the current operation mode is the standby mode, skipping the execution of the service processing operation corresponding to the service message, and then confirming the reception of the service message.
2. The method according to claim 1, wherein the first data center is normally in a standby mode and the second data center is normally in a production mode;
the method further comprises the following steps:
when the second data center fails, switching the domain name and switching the current operation mode from a standby mode to a production mode; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
3. The method of claim 1, wherein the obtaining the service message comprises:
receiving a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to the message queue of the first data center and the message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to service types.
4. The method of claim 3, further comprising:
the message receiving end of the message queue sends the service message to a message processing server end of the message queue; the service message has one-to-one corresponding internal message identification in a message queue system;
the message processing server side lands the service message;
and the message processing server side feeds back service message confirmation information to the message receiving side.
5. The method of claim 4, further comprising:
the message processing server sends the service message to a message processing terminal; the service message has one-to-one corresponding service identification in a service system;
receiving the service message confirmation information fed back by the message processing terminal;
and deleting the landing service message according to the service message confirmation information.
6. A message processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the service message; the service message is sent to a second data center at the same time of being sent to the first data center; the first data center is a standby data center of the second data center;
the checking module is used for checking the current operation mode;
the processing module is used for receiving and processing the service message after executing the service processing operation corresponding to the service message when the current operation mode is the production mode; and when the current operation mode is the standby mode, after skipping the execution of the service processing operation corresponding to the service message, performing service message receiving and processing confirmation.
7. The apparatus of claim 6, wherein the first data center is normally in a standby mode and the second data center is normally in a production mode;
the device further comprises:
the switching module is used for switching the domain name and switching the current operation mode from the standby mode to the production mode when the second data center fails; and the second data center switches the domain name when a fault occurs and switches the current operation mode from the production mode to the standby mode.
8. The apparatus of claim 6, wherein the obtaining module is further configured to receive a service message through a message queue; after the business message is generated by the business application, calling the business service corresponding to the business message to carry out message double-sending to the message queue of the first data center and the message queue of the second data center; and the service servers of the first data center correspond to the service servers of the second data center one by one according to service types.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202110175679.8A 2021-02-09 2021-02-09 Message processing method, device, computer equipment and storage medium Active CN112835728B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110175679.8A CN112835728B (en) 2021-02-09 2021-02-09 Message processing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110175679.8A CN112835728B (en) 2021-02-09 2021-02-09 Message processing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112835728A true CN112835728A (en) 2021-05-25
CN112835728B CN112835728B (en) 2024-04-12

Family

ID=75933032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110175679.8A Active CN112835728B (en) 2021-02-09 2021-02-09 Message processing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112835728B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075861A (en) * 2007-06-28 2007-11-21 中兴通讯股份有限公司 Method for realizing main spared board thermal backup and reversing main spared board
CN103064731A (en) * 2012-12-26 2013-04-24 人民搜索网络股份公司 Device and method for improving message queue system performance
US9043640B1 (en) * 2005-08-26 2015-05-26 Open Invention Network, LLP System and method for event-driven live migration of multi-process applications
CN109460322A (en) * 2018-11-14 2019-03-12 西安瑞蓝创软件科技有限公司 The standby switching drilling system of calamity based on flow scheduling engine technique and method
CN109766198A (en) * 2018-12-28 2019-05-17 深圳前海微众银行股份有限公司 Stream Processing method, apparatus, equipment and computer readable storage medium
US20190205203A1 (en) * 2017-12-28 2019-07-04 Facebook, Inc. Techniques for dynamic throttling in batched bulk processing
CN111580977A (en) * 2020-05-12 2020-08-25 中国民航信息网络股份有限公司 Resource adjusting method and related equipment
CN111666162A (en) * 2020-04-30 2020-09-15 平安科技(深圳)有限公司 Distributed message transmission method, device, computer equipment and storage medium
CN111708841A (en) * 2020-06-08 2020-09-25 中国工商银行股份有限公司 Database data synchronization method and device
CN112286723A (en) * 2020-09-30 2021-01-29 北京大米科技有限公司 Computer room disaster recovery control method, terminal and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9043640B1 (en) * 2005-08-26 2015-05-26 Open Invention Network, LLP System and method for event-driven live migration of multi-process applications
CN101075861A (en) * 2007-06-28 2007-11-21 中兴通讯股份有限公司 Method for realizing main spared board thermal backup and reversing main spared board
CN103064731A (en) * 2012-12-26 2013-04-24 人民搜索网络股份公司 Device and method for improving message queue system performance
US20190205203A1 (en) * 2017-12-28 2019-07-04 Facebook, Inc. Techniques for dynamic throttling in batched bulk processing
CN109460322A (en) * 2018-11-14 2019-03-12 西安瑞蓝创软件科技有限公司 The standby switching drilling system of calamity based on flow scheduling engine technique and method
CN109766198A (en) * 2018-12-28 2019-05-17 深圳前海微众银行股份有限公司 Stream Processing method, apparatus, equipment and computer readable storage medium
CN111666162A (en) * 2020-04-30 2020-09-15 平安科技(深圳)有限公司 Distributed message transmission method, device, computer equipment and storage medium
CN111580977A (en) * 2020-05-12 2020-08-25 中国民航信息网络股份有限公司 Resource adjusting method and related equipment
CN111708841A (en) * 2020-06-08 2020-09-25 中国工商银行股份有限公司 Database data synchronization method and device
CN112286723A (en) * 2020-09-30 2021-01-29 北京大米科技有限公司 Computer room disaster recovery control method, terminal and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
INSTANCE_SELF: ""生产者与消费者模式(理解) 进程间通信之消息队列编程"", Retrieved from the Internet <URL:《https://www.cnblogs.com/love-life-insist/p/10543011.html》> *
JUNAN CHEN: ""Key Technologies Multi-active data synchronization for Dispatch and Control System"", 《2020 ASIA-PACIFIC CONFERENCE ON IMAGE PROCESSING, ELECTRONICS AND COMPUTERS(IPEC)》, 12 June 2020 (2020-06-12), pages 177 - 183 *
常晟: ""基于事件驱动的云平台数据同步研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 2015, 15 March 2015 (2015-03-15), pages 138 - 1522 *

Also Published As

Publication number Publication date
CN112835728B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
AU2019201592A1 (en) Exactly-once transaction semantics for fault tolerant FPGA based transaction systems
US20040221207A1 (en) Proxy response apparatus
CN112118315A (en) Data processing system, method, device, electronic equipment and storage medium
EP2597818A1 (en) Cluster management system and method
WO2017071384A1 (en) Message processing method and apparatus
CN108228581B (en) Zookeeper compatible communication method, server and system
CN112671554A (en) Node fault processing method and related device
CN113986501A (en) Real-time database API (application program interface) uninterrupted calling method, system, storage medium and server
JP2005301436A (en) Cluster system and failure recovery method for it
CN113766013A (en) Session creation method, device, equipment and storage medium
CN116192863B (en) Micro-service flow processing method, DPU service grid deployment method and system
CN110351122B (en) Disaster recovery method, device, system and electronic equipment
CN112835728B (en) Message processing method, device, computer equipment and storage medium
CN114338584B (en) Message withdraw method and message transmission system
CN111416851A (en) Method for session synchronization among multiple load balancers and load balancer
CN114884805B (en) Data transmission method, device, terminal and storage medium
CN107872479B (en) Cloud management platform and controller integration method and system and related modules
WO2019201111A1 (en) Information processing method, apparatus and device, and computer-readable storage medium
CN113596195B (en) Public IP address management method, device, main node and storage medium
CN113518131B (en) Fault-tolerant processing method, device and system for transmission data of network abnormality
CN111416726B (en) Resource management method, sending end equipment and receiving end equipment
JP6182779B1 (en) Transfer device, transfer method, and program
CN110890989A (en) Channel connection method and device
CN105830408B (en) Allocation of resources during a split brain situation
CN116828022B (en) Method, device, equipment and medium for managing connection relation with server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230822

Address after: 518000 building 501, 502, 601, 602, building D, wisdom Plaza, Qiaoxiang Road, Gaofa community, Shahe street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: China Southern Power Grid Digital Platform Technology (Guangdong) Co.,Ltd.

Address before: Room 86, room 406, No.1, Yichuang street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province

Applicant before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant