CN114124847A - Message queue message processing method and device - Google Patents

Message queue message processing method and device Download PDF

Info

Publication number
CN114124847A
CN114124847A CN202111414281.1A CN202111414281A CN114124847A CN 114124847 A CN114124847 A CN 114124847A CN 202111414281 A CN202111414281 A CN 202111414281A CN 114124847 A CN114124847 A CN 114124847A
Authority
CN
China
Prior art keywords
message
information
processing
data information
delay
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.)
Pending
Application number
CN202111414281.1A
Other languages
Chinese (zh)
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111414281.1A priority Critical patent/CN114124847A/en
Publication of CN114124847A publication Critical patent/CN114124847A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/56Queue scheduling implementing delay-aware scheduling
    • 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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a message queue message processing method and a device, which can be used in the financial field, wherein the method comprises the following steps: receiving a message of a message queue, wherein the message comprises message data information; updating corresponding local historical data information according to the message data information; if the updating fails, reading the delay processing information from the parameter information table according to the message data information; and carrying out delay waiting processing on the message according to the delay processing information. The invention can process the message in the message queue, and reduces the cost and complexity on the basis of ensuring the message processing efficiency and accuracy.

Description

Message queue message processing method and device
Technical Field
The invention relates to the field of finance, in particular to a message queue message processing method and device. It should be noted that the message queue message processing method and apparatus of the present invention can be used in the financial field, and can also be used in any field except the financial field.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
When two systems need to transmit messages through message middleware, after a request system sends a request message, a receiving system often needs to transmit a response message. In some scenarios, a request system needs to receive and process multiple response messages before completing a complete transaction, and if multiple response messages have dependency and must be processed sequentially, a receiving timing error may occur, resulting in processing failure. For example, after the product system sends the payment message, the local state needs to be updated according to the receipt of the clearing system, and the business personnel can determine the subsequent operation according to the state, but the receipt of the clearing system is divided into two, and the two receipts have processing sequence, and the second receipt can be processed only after the first receipt is successfully processed. In practical applications, the two response pieces are usually received in a synchronous sequence, or sent later and then sent first.
In the prior art, one-time interaction is usually changed into secondary interaction, but the method increases development cost and complexity, the message processing efficiency and accuracy cannot be guaranteed, and a receiving system needs to be additionally developed, which may not be realized due to excessive development and modification complexity.
Therefore, a message queue message processing scheme that can overcome the above problems is needed.
Disclosure of Invention
The embodiment of the invention provides a message queue message processing method, which is used for processing a message queue message and reducing the cost and the complexity on the basis of ensuring the message processing efficiency and the accuracy, and comprises the following steps:
receiving a message of a message queue, wherein the message comprises message data information;
updating corresponding local historical data information according to the message data information;
if the updating fails, reading the delay processing information from the parameter information table according to the message data information;
and carrying out delay waiting processing on the message according to the delay processing information.
The embodiment of the invention provides a message queue message processing device, which is used for processing a message queue message and reducing the cost and complexity on the basis of ensuring the message processing efficiency and accuracy, and comprises the following components:
the message receiving module is used for receiving messages of the message queue, wherein the messages comprise message data information;
the information updating module is used for updating the corresponding local historical data information according to the message data information;
the information reading module is used for reading the delay processing information from the parameter information table according to the message data information if the updating fails;
and the delay processing module is used for carrying out delay waiting processing on the message according to the delay processing information.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the message queue message processing method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the message queue message processing method is realized.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the method for processing a message in a message queue is implemented.
The embodiment of the invention receives the message of the message queue, wherein the message comprises message data information; updating corresponding local historical data information according to the message data information; if the updating fails, reading the delay processing information from the parameter information table according to the message data information; and carrying out delay waiting processing on the message according to the delay processing information. When the updating failure is found, the embodiment of the invention reads the delay processing information from the parameter information table according to the message data information, and performs delay waiting processing on the message according to the delay processing information, thereby reducing the cost and complexity on the basis of ensuring the message processing efficiency and accuracy.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic diagram of a message queue message processing method in an embodiment of the present invention;
FIG. 2 is a diagram illustrating another message queue message processing method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating another message queue message processing method according to an embodiment of the present invention;
FIG. 4 is a diagram of a message queue message processing apparatus according to an embodiment of the present invention;
FIG. 5 is a diagram of another message queue message processing apparatus according to an embodiment of the present invention;
FIG. 6 is a diagram of another message queue message processing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
First, terms in the embodiments of the present invention are described:
message queue: refers to a container that holds messages during their transmission.
Message: a message type applied in payment services refers to a message in the following.
As mentioned above, in the current IT system, along with the wide application of the distributed architecture and the cluster architecture, when multiple messages are transmitted through the message middleware, the sending timing often is inconsistent with the receiving timing, and if there is dependency management on processing for multiple messages, the processing of the receiving system will be failed due to the error of the timing.
In order to perform message processing in a message queue and reduce cost and complexity on the basis of ensuring message processing efficiency and accuracy, an embodiment of the present invention provides a message processing method in a message queue, as shown in fig. 1, where the method may include:
step 101, receiving a message of a message queue, wherein the message comprises message data information;
102, updating corresponding local historical data information according to the message data information;
step 103, if the updating fails, reading the delay processing information from the parameter information table according to the message data information;
and step 104, carrying out delay waiting processing on the message according to the delay processing information.
As shown in fig. 1, it can be known that, in the embodiment of the present invention, a message of a message queue is received, where the message includes message data information; updating corresponding local historical data information according to the message data information; if the updating fails, reading the delay processing information from the parameter information table according to the message data information; and carrying out delay waiting processing on the message according to the delay processing information. When the updating failure is found, the embodiment of the invention reads the delay processing information from the parameter information table according to the message data information, and performs delay waiting processing on the message according to the delay processing information, thereby reducing the cost and complexity on the basis of ensuring the message processing efficiency and accuracy.
The inventors have found that after receiving a message from a message queue, two aspects need to be considered: firstly, the message can be correctly received, and the message is ensured not to be lost; and secondly, the message can be processed normally, the analysis of the message is ensured, and the reported state is updated. In an embodiment of the invention, the order of reception and processing of the message queue messages is additionally considered. Assume that the received message is divided into receipt one and receipt two. The receipt is an intermediate state which indicates that the report state can be updated according to the unique index in the processing of the receiving system, and the receipt is a final state which can be updated only according to the information received by the receipt. Therefore, in the conventional operation, once the receipt two is received and processed first, the result is only processing failure, and the report cannot be updated to the final state, which affects the subsequent operation of the service. Therefore, embodiments of the present invention address how to ensure the order and correct processing of two response pieces. Therefore, a message processing mechanism of receipt delay processing and transaction compensation checking processing is provided. Receipt delay processing means that some messages (such as receipt two) can be delayed under necessary conditions. The transaction compensation checking processing refers to that the message state is directly or indirectly subjected to supplementary checking through other online or batch processing functions on the premise of not increasing the development complexity so as to confirm the final state.
In an embodiment, a message of a message queue is received, where the message includes message data information.
In this embodiment, the message data information includes: transaction code information and message type.
In this embodiment, after receiving a message in a message queue, the correctness of the message is checked. Each message is independently processed and analyzed without considering the sequence or the relevance among the messages.
In the embodiment, the corresponding local historical data information is updated according to the message data information.
And when the specific implementation is carried out, updating the corresponding local historical data information of the analyzed message according to the specific application.
In the embodiment, if the updating fails, the delay processing information is read from the parameter information table according to the message data information. And carrying out delay waiting processing on the message according to the delay processing information.
In this embodiment, as shown in fig. 2, the message queue message processing method further includes:
and 105, if the delay processing information can not be read from the parameter information table according to the message data information, sending an error message reminding message.
In specific implementation, parameterization can be carried out on message attributes, if updating fails, delay processing information is read from a parameter information table according to transaction code information and message types, whether delay processing and the duration of the delay processing are needed or not is determined, and if corresponding delay processing information exists, delay waiting is carried out according to the read information; if the delay processing information does not exist, the message is regarded as an error message, and an error message reminding message is sent.
In this embodiment, as shown in fig. 3, the message queue message processing method further includes:
step 106, collecting general transaction information files in a set night batch time period;
and 107, performing supplementary checking processing on the message according to the general transaction information file.
During specific implementation, at night batch time, a transaction compensation checking function is started, a general transaction information file issued by a target system is collected, local report data are synchronized according to data information in the file, and the message state of the system is complementarily checked. The embodiment of the invention adds transaction compensation check and adopts other indirect means or alternative conditions to carry out supplementary check on the transaction. The main reason is that the delay processing module is used as a module for processing real-time messages, certain consumption is caused to system resources, delay processing needs to be controlled within a certain range between balanced resource consumption and timeliness, and transactions beyond the range can be processed in a low-cost mode of a transaction compensation checking module. The received unordered messages are converted into ordered messages to be processed through a delay processing mechanism and a transaction compensation checking mechanism, and the accuracy and timeliness of application processing are improved under the condition of limited development cost.
The embodiment of the invention considers the factors of project implementation range, development period, development cost, technical complexity, interface management and the like, and only needs one part to modify technology to solve the corresponding technical problem. And the time delay processing has strong expandability, supports various types of message processing and has universality.
Based on the same inventive concept, an embodiment of the present invention further provides a message queue message processing apparatus, as described in the following embodiments. Because the principles for solving the problems are similar to the message queue message processing method, the implementation of the message queue message processing device can refer to the implementation of the method, and repeated parts are not described again.
Fig. 4 is a structural diagram of a message queue message processing apparatus in an embodiment of the present invention, and as shown in fig. 4, the message queue message processing apparatus includes:
a message receiving module 401, configured to receive a message of a message queue, where the message includes message data information;
an information updating module 402, configured to update corresponding local historical data information according to the message data information;
an information reading module 403, configured to, if the update fails, read the delay processing information from the parameter information table according to the message data information;
and a delay processing module 404, configured to perform delay waiting processing on the packet according to the delay processing information.
In one embodiment, the message data information includes: transaction code information and message type.
In one embodiment, as shown in fig. 5, the message queue message processing apparatus further includes:
and an error reminding module 405, configured to send an error message reminding message if the delay processing information cannot be read from the parameter information table according to the message data information.
In one embodiment, as shown in fig. 6, the message queue message processing apparatus further includes:
the file acquisition module 406 is used for acquiring general transaction information files at a set night batch time period;
and the supplementary checking module 407 is configured to perform supplementary checking on the message according to the general transaction information file.
Based on the aforementioned inventive concept, as shown in fig. 7, an embodiment of the present invention further provides a computer device 700, which includes a memory 710, a processor 720, and a computer program 730 stored in the memory 710 and executable on the processor 720, where the processor 720 implements the message queue message processing method when executing the computer program 730.
Based on the foregoing inventive concept, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for processing a message in a message queue is implemented.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the method for processing a message in a message queue is implemented.
The embodiment of the invention receives the message of the message queue, wherein the message comprises message data information; updating corresponding local historical data information according to the message data information; if the updating fails, reading the delay processing information from the parameter information table according to the message data information; and carrying out delay waiting processing on the message according to the delay processing information. When the updating failure is found, the embodiment of the invention reads the delay processing information from the parameter information table according to the message data information, and performs delay waiting processing on the message according to the delay processing information, thereby reducing the cost and complexity on the basis of ensuring the message processing efficiency and accuracy.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (11)

1. A message queue message processing method is characterized by comprising the following steps:
receiving a message of a message queue, wherein the message comprises message data information;
updating corresponding local historical data information according to the message data information;
if the updating fails, reading the delay processing information from the parameter information table according to the message data information;
and carrying out delay waiting processing on the message according to the delay processing information.
2. The message queue message processing method of claim 1, wherein the message data information comprises: transaction code information and message type.
3. The message queue message processing method of claim 1, further comprising:
and if the delay processing information can not be read from the parameter information table according to the message data information, sending an error message reminding message.
4. The message queue message processing method of claim 1, further comprising:
collecting general transaction information files at a set night batch time period;
and performing supplementary checking processing on the message according to the general transaction information file.
5. A message queue message processing apparatus, comprising:
the message receiving module is used for receiving messages of the message queue, wherein the messages comprise message data information;
the information updating module is used for updating the corresponding local historical data information according to the message data information;
the information reading module is used for reading the delay processing information from the parameter information table according to the message data information if the updating fails;
and the delay processing module is used for carrying out delay waiting processing on the message according to the delay processing information.
6. The message queue message processing device of claim 5, wherein the message data information comprises: transaction code information and message type.
7. The message queue message processing device of claim 5, further comprising:
and the error reminding module is used for sending an error message reminding message if the delay processing information cannot be read from the parameter information table according to the message data information.
8. The message queue message processing device of claim 5, further comprising:
the file acquisition module is used for acquiring the general transaction information files at the set night batch time period;
and the supplementary checking module is used for carrying out supplementary checking processing on the message according to the general transaction information file.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 4.
11. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1 to 4.
CN202111414281.1A 2021-11-25 2021-11-25 Message queue message processing method and device Pending CN114124847A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111414281.1A CN114124847A (en) 2021-11-25 2021-11-25 Message queue message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111414281.1A CN114124847A (en) 2021-11-25 2021-11-25 Message queue message processing method and device

Publications (1)

Publication Number Publication Date
CN114124847A true CN114124847A (en) 2022-03-01

Family

ID=80373155

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111414281.1A Pending CN114124847A (en) 2021-11-25 2021-11-25 Message queue message processing method and device

Country Status (1)

Country Link
CN (1) CN114124847A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103078873A (en) * 2013-01-29 2013-05-01 大唐移动通信设备有限公司 Asynchronous fault tolerance method, device and equipment for message
CN110661849A (en) * 2019-08-30 2020-01-07 中国人民财产保险股份有限公司 Request processing method and device, electronic equipment and storage medium
CN111367628A (en) * 2020-03-05 2020-07-03 中国银行股份有限公司 Distributed transaction processing method and device, message producer and consumer system
CN111652729A (en) * 2020-07-06 2020-09-11 中国银行股份有限公司 Method and device for submitting transaction information
CN112667382A (en) * 2020-12-30 2021-04-16 平安普惠企业管理有限公司 Task scheduling method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103078873A (en) * 2013-01-29 2013-05-01 大唐移动通信设备有限公司 Asynchronous fault tolerance method, device and equipment for message
CN110661849A (en) * 2019-08-30 2020-01-07 中国人民财产保险股份有限公司 Request processing method and device, electronic equipment and storage medium
CN111367628A (en) * 2020-03-05 2020-07-03 中国银行股份有限公司 Distributed transaction processing method and device, message producer and consumer system
CN111652729A (en) * 2020-07-06 2020-09-11 中国银行股份有限公司 Method and device for submitting transaction information
CN112667382A (en) * 2020-12-30 2021-04-16 平安普惠企业管理有限公司 Task scheduling method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108076098B (en) Service processing method and system
CN111277639B (en) Method and device for maintaining data consistency
WO2012000997A1 (en) An apparatus for processing a batched unit of work
CN111784329B (en) Service data processing method and device, storage medium and electronic device
CN111125106B (en) Batch running task execution method, device, server and storage medium
CN113157710B (en) Block chain data parallel writing method and device, computer equipment and storage medium
CN111861482A (en) Block chain account checking method and system
CN113094362A (en) Method and device for reliably delivering and processing asynchronous message
CN109995585B (en) Exception handling method, device and storage medium
CN109684130B (en) Method and device for backing up data of computer room
CN111198773B (en) Message-based application communication method and device
CN109218338B (en) Information processing system, method and device
US11163601B2 (en) Dynamically determine the transaction coordinator in multitier hybrid transaction processing middleware systems
CN114124847A (en) Message queue message processing method and device
CN113656374A (en) Method and device for processing service message with attachment
US20180063242A1 (en) Method and apparatus for operating infrastructure layer in cloud computing architecture
CN112333262A (en) Data updating prompting method and device, computer equipment and readable storage medium
CN107678840B (en) System, method and device for running tasks
CN110659980A (en) Transaction information processing method, system and peripheral system
GB2527798A (en) Synchronizing operations between regions when a network connection fails
CN110336847B (en) Payment message transmission system and method
CN114816679A (en) TOKEN mechanism distributed transaction final consistency middleware realized based on MQ
CN115633045A (en) Message transmission method, device and system
CN116149803A (en) Transaction processing method and device of database, electronic equipment and storage medium
CN111639936A (en) Transaction information acquisition method and device, electronic equipment and readable storage medium

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