A method and apparatus for dynamically controlling message concurrency processing

By separating message control and message processing in the commercial bank's message processing system and using a reasonable algorithm to dynamically adjust the number of message processing programs, the shortcomings of the EVERY and FIRST triggering methods are solved, and the system's concurrent processing capability and resource utilization efficiency are improved.

CN115269227BActive Publication Date: 2026-01-09BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210904830.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2026-01-09
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

In existing technologies used in commercial bank message processing systems, the EVERY triggering method causes system oscillations, while the FIRST triggering method has insufficient concurrency and cannot meet the performance requirements of large transaction volumes, easily forming a performance bottleneck.

Method used

By separating message control and message processing, and using a reasonable algorithm to dynamically start message processing programs, the number of processing programs can be dynamically adjusted according to queue depth and the number of running programs, thereby optimizing system resource utilization.

Benefits of technology

It improved the system's concurrent processing capabilities, met the timeliness requirements of business processing, avoided excessive expansion of hardware resources, and optimized system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269227B_ABST
    Figure CN115269227B_ABST
Patent Text Reader

Abstract

The application provides a dynamic control message concurrent processing method and device, and relates to artificial intelligence, which comprises the following steps: initializing message processing parameters; acquiring the queue depth of a current MQ queue and the number of currently running message processing programs; determining the number of message processing programs that need to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs; starting a corresponding number of message processing programs in sequence according to the number of message processing programs that need to be restarted for the current MQ queue, and processing the messages in the MQ queue; after waiting for a set time length, cyclically acquiring the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time, cyclically determining the number of message processing programs that need to be restarted for the MQ queue at the next time in combination with the initialized message processing parameters, and starting the message processing programs in sequence until the queue depth of the MQ queue is zero.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence, and in particular to a dynamic control message concurrent processing method and device. BACKGROUND

[0002] This section is intended to provide background or context to the embodiments of the application recited in the claims. The description herein is not admitted to be prior art merely by inclusion in this section.

[0003] The existing commercial bank uses MQ middleware (Websphere MQ, a commercial messaging middleware, Websphere MQ provides an industrial standard, safe and reliable message transmission system) in software development to perform message transmission. After receiving the message, the commercial bank triggers the message processing program using the trigger mechanism of MQ to perform subsequent business processing.

[0004] If the trigger program is an online transaction program defined by CICS (Customer Information Control System, a transaction processing environment for commercial applications, a transaction middleware), it will be found that if the EVERY trigger mode is used, the system will have obvious "shock" due to the inability to control the time of message arrival, and when a large number of messages arrive at the same time, too many processing programs will be started in CICS, and if not controlled, CICS will even be crushed. Therefore, the EVERY mode is usually not a good trigger mode for CICS programs. When the FIRST mode is used, only one trigger program is called by MQ at each time, and the concurrency degree is obviously insufficient, and when the transaction volume is large, it may form a performance bottleneck.

[0005] Therefore, how to provide a new scheme which can solve the above technical problems is a technical problem to be solved in the field. SUMMARY

[0006] The embodiment of the present application provides a dynamic control message concurrent processing method, which separately designs message control and message processing, and dynamically starts the message processing program through a reasonable algorithm, so that the existing resources can be used to the maximum extent, the concurrent processing capacity of the system is improved, the business processing requirements are met, and the method comprises the following steps:

[0007] Initializing message processing parameters;

[0008] Obtaining the queue depth of the current MQ queue and the number of currently running message processing programs; the message processing program is used for processing the messages in the MQ queue;

[0009] determine the number of message processing programs needed to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of message processing programs currently running;

[0010] start the corresponding number of message processing programs in turn to process the messages in the MQ queue according to the number of message processing programs needed to be restarted for the current MQ queue;

[0011] after waiting for a set time length, cyclically acquire the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time, cyclically determine the number of message processing programs needed to be restarted for the MQ queue at the next time in combination with the initialized message processing parameters and start the programs in turn until the queue depth of the MQ queue is zero.

[0012] The embodiment of the application further provides a dynamic control message concurrent processing device, which comprises:

[0013] an initialization parameter module, configured to initialize message processing parameters;

[0014] an MQ queue state acquisition module, configured to acquire the queue depth of the current MQ queue and the number of message processing programs currently running; the message processing programs are used to process the messages in the MQ queue;

[0015] a number of restarted message processing programs determination module, configured to determine the number of message processing programs needed to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of message processing programs currently running;

[0016] a message processing program start module, configured to start the corresponding number of message processing programs in turn to process the messages in the MQ queue according to the number of message processing programs needed to be restarted for the current MQ queue;

[0017] a cyclic execution module, configured to, after waiting for a set time length, cyclically acquire the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time, cyclically determine the number of message processing programs needed to be restarted for the MQ queue at the next time in combination with the initialized message processing parameters and start the programs in turn until the queue depth of the MQ queue is zero.

[0018] The embodiment of the application further provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements the above-mentioned dynamic control message concurrent processing method when executing the computer program.

[0019] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the dynamic control message concurrent processing method.

[0020] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to realize the dynamic control message concurrent processing method.

[0021] The embodiment of the present application provides a dynamic control message concurrent processing method and device, which comprises: initializing message processing parameters; obtaining the queue depth of a current MQ queue and the number of currently running message processing programs; the message processing program is used for processing messages in the MQ queue; determining the number of message processing programs that need to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs; starting a corresponding number of message processing programs in sequence according to the number of message processing programs that need to be restarted for the current MQ queue, to process messages in the MQ queue; after waiting for a set time length, cyclically obtaining the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time, cyclically determining the number of message processing programs that need to be restarted for the MQ queue at the next time in combination with the initialized message processing parameters and starting the message processing programs in sequence until the queue depth of the MQ queue is zero. The message master and the message processing are designed respectively, and the message processing programs are dynamically started through a reasonable algorithm, so that the existing resources can be used to the maximum extent, the concurrent processing capacity of the system is improved, and the business processing requirements are met. The present application overcomes the obvious defects of the insufficient concurrent processing degree in the traditional design mode, dynamically starts the message processing programs according to the size of the messages to be processed through a control program and a specific algorithm, so that the existing resources can be used to the maximum extent, the concurrent processing capacity of the system is improved, and the timeliness requirements of the business are met. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without any creative effort. In the drawings:

[0023] Figure 1 A dynamic control message concurrent processing method is shown in the figure.

[0024] Figure 2 A flowchart of a dynamic control message concurrent processing method is shown in the figure.

[0025] Figure 3 An embodiment diagram of a dynamic control message concurrent processing method according to an embodiment of the present application.

[0026] Figure 4 An embodiment diagram of a dynamic control message concurrent processing method according to an embodiment of the present application.

[0027] Figure 5 An embodiment diagram of a computer device for implementing a dynamic control message concurrent processing method according to an embodiment of the present application.

[0028] Figure 6 An embodiment diagram of a dynamic control message concurrent processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application are further described in detail below with reference to the drawings. Herein, the illustrative embodiments of the present application and the descriptions thereof are used to explain the present application, but not to limit the present application.

[0030] Figure 1 An embodiment diagram of a dynamic control message concurrent processing method according to an embodiment of the present application is shown in FIG. 1, which provides a dynamic control message concurrent processing method according to an embodiment of the present application. Figure 1 The method designs message control and message processing separately, and dynamically starts message processing programs through a reasonable algorithm, so that the existing resources can be used to the maximum extent, the concurrent processing capability of the system is improved, and the business processing requirements are met. The method comprises the following steps.

[0031] Step 101: initializing message processing parameters;

[0032] Step 102: obtaining the queue depth of a current MQ queue and the number of message processing programs currently running; the message processing program is used to process messages in the MQ queue;

[0033] Step 103: determining the number of message processing programs needed to be started again for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of message processing programs currently running;

[0034] Step 104: starting the corresponding number of message processing programs in sequence according to the number of message processing programs needed to be started again for the current MQ queue, and processing messages in the MQ queue;

[0035] Step 105: after waiting for a set time length, the queue depth of the next time MQ queue and the number of message processing programs running at the next time are acquired circularly, the number of message processing programs needed to be started again by the next time MQ queue is determined circularly in combination with the initialized message processing parameters and is started in turn until the queue depth of the MQ queue is zero.

[0036] The method and device for dynamically controlling message concurrent processing provided by the embodiment of the application comprise: initializing message processing parameters; acquiring the queue depth of a current MQ queue and the number of message processing programs running at present; the message processing program is used for processing messages in the MQ queue; according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of message processing programs running at present, the number of message processing programs needed to be started again by the current MQ queue is determined; according to the number of message processing programs needed to be started again by the current MQ queue, a corresponding number of message processing programs are started in turn to process messages in the MQ queue; after waiting for a set time length, the queue depth of the next time MQ queue and the number of message processing programs running at the next time are acquired circularly, the number of message processing programs needed to be started again by the next time MQ queue is determined circularly in combination with the initialized message processing parameters and is started in turn until the queue depth of the MQ queue is zero. The message master and the message processing are designed respectively, and the message processing program is started dynamically through a reasonable algorithm, so that the existing resources can be used to the maximum extent, the concurrent processing capacity of the system is improved, and the business processing requirements are met. The application overcomes the defect that the concurrent processing degree of the traditional design mode is obviously insufficient, and through the control program and the specific algorithm, the message processing program is started dynamically according to the size of the message to be processed, so that the existing resources can be used to the maximum extent, the concurrent processing capacity of the system is improved, and the timeliness requirements of the business are met.

[0037] In the embodiment of the application, the professional glossaries involved are as follows:

[0038] CICS: Customer Information Control System, namely, a customer information control system, which provides a transaction processing environment for business applications and is a transaction middleware.

[0039] MQ: Websphere MQ, which is a commercial communication middleware of IBM. Websphere MQ provides a message transmission system with industrial standards, safety and reliability.

[0040] Queue depth: expression of the number of messages in the MQ queue.

[0041] Trigger mode: the processing mode of MQ to the received message. There are two trigger modes: EVERY and FIRST. EVERY is to trigger the defined transaction processing for each transaction, and FIRST is to trigger the defined transaction processing when the queue depth changes from 0 to 1.

[0042] In the design of large enterprise applications, the performance of the program in large transaction volume must be considered, and the highest processing efficiency must be provided. When the current bank payment system processes MQ messages, the FIRST mode is usually used, and only one trigger program is called by MQ at each moment. Due to the obvious lack of concurrency, a large number of messages are accumulated in MQ when the transaction volume is large, forming a performance bottleneck. Their solution is to increase hardware resources and expand the number of MQ queue configurations to relieve performance pressure. The existing system processing mechanism is that only one trigger program is called by MQ at each moment. When the number of messages is not large, the business processing requirements can be basically met, but when the number of messages is large, due to the obvious lack of concurrent processing, a large number of messages will be accumulated in MQ, forming a performance bottleneck, and the timeliness requirements of customers cannot be met.

[0043] The purpose of the present application is to dynamically start the message processing program through the control program and the specific algorithm, so as to maximize the use of existing resources, improve the concurrent processing capability of the system, and meet the business processing requirements.

[0044] Figure 2 A flowchart of a dynamic control message concurrent processing method according to an embodiment of the present application is shown in FIG. 1. Figure 2 When the dynamic control message concurrent processing method according to an embodiment of the present application is implemented, in one embodiment, it is applied to a control program, and the control program is used to start a message processing program to process messages in an MQ queue. The method comprises the following steps.

[0045] Initializing message processing parameters;

[0046] Obtaining the queue depth of the current MQ queue and the number of currently running message processing programs; the message processing program is used to process messages in the MQ queue;

[0047] According to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs, determining the number of message processing programs that need to be started again for the current MQ queue;

[0048] According to the number of message processing programs that need to be started again for the current MQ queue, starting a corresponding number of message processing programs in sequence to process messages in the MQ queue;

[0049] After waiting for a set time length, the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time are acquired in a loop, and the number of message processing programs needed to be started again by the MQ queue at the next time is determined in a loop in combination with the initialized message processing parameters and is started in turn until the queue depth of the MQ queue is zero.

[0050] To solve the concurrency problem of the MQ trigger in a large transaction volume environment, the application provides a relatively simple method: a control program processes the message mode. The control program is a trigger program defined in the MQ, and its function is to start a certain number of message processing programs and can be dynamically adjusted. There is only one control program running at any time in the system, and its responsibility is to only use the MQINQ command to obtain information such as the queue depth and the number of message processing programs on the queue. The control program does not directly read the message data in the queue. The message processing program is the real message processor, and each message processing program reads data from the input queue to process the business. The message processing program does not stop processing messages one by one until the queue is empty. The number of message processing programs can be controlled by the control program. The control program uses a specific algorithm to determine and control the number of message processing programs. The control program can obtain the queue depth and the number of message processing programs opened for the queue through the MQINQ command. The control program can set the initial value, the growth value, and the maximum value of the number of processing programs. At the first start, the initial value number of processing programs is started, and then the control program enters the delay (DELAY). After a few seconds, the control program wakes up and checks the queue depth and the number of message processing programs again. If the queue depth is still increasing, it indicates that the processing capacity is insufficient, and more message processing programs are started. This continues until the queue depth is 0, and the control program exits.

[0051] When the dynamic control message concurrency processing method provided by the embodiment of the application is implemented, in one embodiment, the queue depth of the current MQ queue is acquired, including:

[0052] The API function MQINQ of the MQ is called to obtain the queue depth of the current MQ queue. The queue depth is the number of messages in the current MQ queue.

[0053] When the dynamic control message concurrency processing method provided by the embodiment of the application is implemented, in one embodiment, the number of currently running message processing programs is acquired, including:

[0054] The CICS command is called to obtain the number of currently running message processing programs.

[0055] In the embodiment, the message processing is first parameterized, including initial value, growth value and maximum value of the number of processing programs; then the queue depth of the current MQ queue is obtained by calling the API function MQINQ of MQ; and then the number of currently running message processing programs is obtained by calling the CICS command.

[0056] Figure 3 An embodiment of the dynamic control message concurrent processing method is shown in the figure. Figure 3 As shown in the figure, when the dynamic control message concurrent processing method is implemented, in an embodiment, the initialized message processing parameters include: initial value, growth value and maximum value of the number of message processing programs.

[0057] According to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs, the number of message processing programs needed to be restarted for the current MQ queue is determined, including:

[0058] Step 301: when the queue depth of the current MQ queue is less than or equal to the first set value, the initial value is taken as the number of message processing programs to be started;

[0059] Step 302: when the queue depth of the current MQ queue is greater than the first set value and less than or equal to the second set value, the sum of the initial value and the first growth value is taken as the number of message processing programs to be started;

[0060] Step 303: when the queue depth of the current MQ queue is greater than the second set value and less than or equal to the third set value, the sum of the initial value and the second growth value is taken as the number of message processing programs to be started;

[0061] Step 304: when the queue depth of the current MQ queue is greater than the third set value and less than or equal to the fourth set value, the sum of the initial value and the third growth value is taken as the number of message processing programs to be started;

[0062] Step 305: when the queue depth of the current MQ queue is greater than the fourth set value, the maximum value is taken as the number of message processing programs to be started;

[0063] Step 306: the number of message processing programs to be started is subtracted by the number of currently running message processing programs to determine the number of message processing programs needed to be restarted for the current MQ queue.

[0064] The most important change in the embodiment is from the traditional mode of thinking to the flexible technical decoupling mode, and the message operation is split into two parts of message master and message processing. The difficulty lies in the algorithm design, that is, according to the depth of the current queue, the number of message processing programs needed is calculated to realize the dynamization and intelligentization of message processing.

[0065] Specifically, according to the initial value, the growth value and the maximum value of the number of processing programs, the depth of the current MQ queue and the number of currently running message processing programs, the number of message processing programs needed to be started again is determined, for example: 1) when the queue depth is 500, the initial value of the number of message processing programs maintained in the startup parameter is used as the number of message processing programs to be started; 2) when the queue depth is greater than 500 and less than 1000, the initial value + 1* growth value of the number of message processing programs is needed, which is used as the number of message processing programs to be started; 3) greater than 1000 and less than 2000, the initial value + 2* growth value of the number of message processing programs is needed, which is used as the number of message processing programs to be started; 4) greater than 2000 and less than 100 million, the initial value + 4* growth value of the number of message processing programs is needed, which is used as the number of message processing programs to be started; 5) more than 100 million, the maximum value of the number of message processing programs maintained in the startup parameter is needed, which is used as the number of message processing programs to be started; the number of message processing programs to be started obtained by the algorithm is reduced by the number of currently running message processing programs, and the number of message processing programs to be started again is obtained.

[0066] Figure 4 An embodiment of the dynamic control message concurrent processing method of the embodiment is shown in the figure. Figure 4 When the dynamic control message concurrent processing method provided by the embodiment is implemented, in an embodiment, according to the number of message processing programs needed to be started again for the current MQ queue, a corresponding number of message processing programs are started in sequence.

[0067] Step 401: according to the number of message processing programs needed to be started again for the current MQ queue, the START command of CICS is called to start a corresponding number of message processing programs in sequence.

[0068] Step 402: the plurality of message processing programs started again respectively read the messages in the MQ queue for logical processing to realize the business function.

[0069] In the embodiment, according to the number of message processing programs needed to be started again for the current MQ queue obtained by the above calculation, the START command of CICS is called to start the message processing programs one by one, and the plurality of message processing programs respectively read the messages for logical processing to complete the business function. When there is no message processing, it is exited.

[0070] In one embodiment of the method for dynamically controlling message concurrent processing, the restarted message processing program stops running when there is no message to process.

[0071] In one embodiment, after waiting for a set period of time, the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time are obtained, and the number of message processing programs needed to be restarted for the MQ queue at the next time is determined in combination with the initialized message processing parameters and then started one by one until the queue depth of the MQ queue is zero.

[0072] Specifically, after waiting for a set period of time, the control program wakes up, and the queue depth and the number of message processing programs are checked again. According to a specific algorithm, the needed message processing programs are started, and the next round of processing is entered. This continues until the queue depth is zero, the control program exits, and waits for the MQ system to be triggered again.

[0073] The method for dynamically controlling message concurrent processing provided by the embodiments of the present application is described briefly in combination with a specific scenario as follows.

[0074] The method for dynamically controlling message concurrent processing provided by the embodiments of the present application is implemented according to the following steps.

[0075] 1. The message processing is parameterized, including the initial value, the growth value and the maximum value of the number of processing programs.

[0076] 2. The depth of the current MQ queue is obtained by calling the API function MQINQ of the MQ.

[0077] 3. The number of currently running message processing programs is obtained by calling the CICS command.

[0078] 4. The number of processing programs needed to be restarted for the current message is determined according to the initial value, the growth value and the maximum value of the number of processing programs, the depth of the current MQ queue and the number of currently running message processing programs. For example, 1) when the queue depth is 500, the initial value of the number of message processing programs maintained in the startup parameters is started; 2) when the queue depth is greater than 500 and less than 1000, the initial value + 1* growth value of message processing programs are needed; 3) when the queue depth is greater than 1000 and less than 2000, the initial value + 2* growth value of message processing programs are needed; 4) when the queue depth is greater than 2000 and less than 100 million, the initial value + 4* growth value of message processing programs are needed; 5) when the queue depth is greater than 100 million, the maximum value of message processing programs maintained in the startup parameters is started. The number of message processing programs needed to be restarted is obtained by subtracting the number of currently running message processing programs from the result obtained according to the above algorithms.

[0079] 5. According to the result of the last step, the START command of CICS is called to start the message processing program one by one;

[0080] 6. The multiple message processing programs read the message and perform logical processing to complete the business function, and exit when there is no message processing;

[0081] 7. After sleeping for 3 seconds, the system control program wakes up and checks the queue depth and the number of message processing programs again, and starts the required message processing program according to a specific algorithm to enter the next round of processing;

[0082] 8. The process is repeated until the queue depth is 0, and the control program exits and waits for the next trigger of the MQ system.

[0083] Further, the embodiment of the present application also provides a modular example of a dynamic control message concurrent processing method, which comprises: an initialization parameter module, an MQ queue depth acquisition module, a current message processing program number acquisition module, a message processing calculation module, a message processing start module and a message processing module.

[0084] The initialization parameter module sets the initial value, increment value and maximum value of the processing program number; the MQ queue depth acquisition module obtains the current MQ queue depth by calling the MQ API function MQINQ; the current message processing program number acquisition module obtains the number of currently running message processing programs by calling the CICS command; the message processing calculation module determines the number of processing programs required to be started again according to the data obtained by the above modules by running a specific algorithm; the message processing start module starts the message processing program one by one by calling the START command of CICS according to the result calculated by the last module; and the message processing module reads the message and performs logical processing to complete the business function.

[0085] In the initialization parameter module, the initial value, increment value and maximum value of the processing program number are set to ensure the stability of the system during operation, that is, there is a basic program processing guarantee when processing a small amount of messages, and as the amount of messages increases, the processing program also increases, but there is an upper limit to the processing, which will not increase without limit, so as to ensure the original intention of the normal operation of the core system.

[0086] The embodiment of the present application places the master control program and the message processing program together, and the triggered program called by the MQ at each moment is only one, which obviously lacks concurrency, and when the transaction volume is large, it may form a performance bottleneck. Alternatively, the performance pressure can be relieved by increasing hardware resources, increasing the MQ queue manager and expanding the number of MQ queue configurations.

[0087] The embodiment of the present application designs message control and message processing respectively, and through reasonable algorithm, calculates the message processing module, dynamically starts the message processing program, can utilize the existing resources to the greatest extent, improves the concurrent processing capability of the system, meets the business processing requirements, and this point is also the protection point of the present application.

[0088] The embodiment of the present application overcomes the obvious defects of the concurrent processing degree of the traditional design mode, and through the control program and the specific algorithm, according to the size of the message to be processed, dynamically starts the message processing program, can utilize the existing resources to the greatest extent, improves the concurrent processing capability of the system, and meets the timeliness requirements of the business.

[0089] Figure 5 A schematic diagram of a computer device for running a dynamic control message concurrent processing method of the embodiment of the present application is shown in FIG. 1. Figure 5 The embodiment of the present application also provides a computer device 500, which comprises a memory 510, a processor 520, and a computer program 530 stored in the memory and capable of running on the processor, and the processor implements the above-mentioned dynamic control message concurrent processing method when executing the computer program.

[0090] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program implements the above-mentioned dynamic control message concurrent processing method when executed by a processor.

[0091] The embodiment of the present application also provides a computer program product, which comprises a computer program, and the computer program implements the above-mentioned dynamic control message concurrent processing method when executed by a processor.

[0092] The embodiment of the present application also provides a dynamic control message concurrent processing device, as described in the following embodiment. Since the principle of solving the problem of the device is similar to that of the dynamic control message concurrent processing method, the implementation of the device can be referred to the implementation of the dynamic control message concurrent processing method, and the repeated parts will not be described herein.

[0093] Figure 6 A schematic diagram of a dynamic control message concurrent processing device of the embodiment of the present application is shown in FIG. 1. Figure 6 The embodiment of the present application also provides a dynamic control message concurrent processing device.

[0094] When specifically implementing the dynamic control message concurrent processing device of the embodiment of the present application, in one embodiment, the device comprises:

[0095] The initialization parameter module 601 is configured to initialize the message processing parameter.

[0096] The MQ queue state acquisition module 602 is configured to acquire the queue depth of the current MQ queue and the number of currently running message processing programs; the message processing program is used to process the message in the MQ queue.

[0097] The number of restarted message processing programs determination module 603 is configured to determine the number of message processing programs needed to be restarted for the current MQ queue according to the initialized message processing parameter, the queue depth of the current MQ queue and the number of currently running message processing programs.

[0098] The message processing program starting module 604 is configured to start a corresponding number of message processing programs according to the number of message processing programs needed to be restarted for the current MQ queue, and process the message in the MQ queue.

[0099] The loop execution module 605 is configured to wait for a set time length, and then acquire the queue depth of the MQ queue at the next time and the number of running message processing programs at the next time, and determine the number of message processing programs needed to be restarted for the MQ queue at the next time according to the initialized message processing parameter, and start the message processing programs in sequence until the queue depth of the MQ queue is zero.

[0100] In the embodiment of the application, the MQ queue state acquisition module is specifically configured to:

[0101] The API function MQINQ of the MQ is called to obtain the queue depth of the current MQ queue; the queue depth is the number of messages in the current MQ queue.

[0102] In the embodiment of the application, the MQ queue state acquisition module is specifically configured to:

[0103] The CICS command is called to obtain the number of currently running message processing programs.

[0104] In the embodiment of the application, the initialized message processing parameter comprises an initial value, a growth value and a maximum value of the number of message processing programs.

[0105] The number of restarted message processing programs determination module is specifically configured to:

[0106] When the queue depth of the current MQ queue is less than or equal to a first set value, the initial value is taken as the number of message processing programs to be started.

[0107] When the queue depth of the current MQ queue is greater than the first set value and less than or equal to the second set value, the sum of the initial value and a growth value of the first multiple is taken as the number of message handlers to be started;

[0108] When the queue depth of the current MQ queue is greater than the second set value and less than or equal to the third set value, the sum of the initial value and a growth value of the second multiple is taken as the number of message handlers to be started;

[0109] When the queue depth of the current MQ queue is greater than the third set value and less than or equal to the fourth set value, the sum of the initial value and a growth value of the third multiple is taken as the number of message handlers to be started;

[0110] When the queue depth of the current MQ queue is greater than the fourth set value, the maximum value is taken as the number of message handlers to be started;

[0111] The number of message handlers to be started is reduced by the number of currently running message handlers to determine the number of message handlers to be restarted for the current MQ queue.

[0112] When the dynamic control message concurrent processing device provided by the embodiment of the present application is implemented, in one embodiment, the message handler starting module is specifically used for:

[0113] According to the number of message handlers to be restarted for the current MQ queue, a START command of CICS is called to start the corresponding number of message handlers one by one;

[0114] The restarted message handlers read the messages in the MQ queue respectively to implement the business function through logical processing.

[0115] When the dynamic control message concurrent processing device provided by the embodiment of the present application is implemented, in one embodiment, the message handler starting module is further used for stopping the running of the restarted message handlers when there is no message processing.

[0116] In summary, the embodiment of the present application provides a dynamic control message concurrent processing method and device, comprising: initializing message processing parameters; obtaining the queue depth of a current MQ queue and the number of currently running message processing programs; the message processing program is used for processing messages in the MQ queue; determining the number of message processing programs that need to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs; starting a corresponding number of message processing programs in sequence according to the number of message processing programs that need to be restarted for the current MQ queue, to process messages in the MQ queue; after waiting for a set time length, cyclically obtaining the queue depth of the MQ queue at the next time and the number of running message processing programs at the next time, cyclically determining the number of message processing programs that need to be restarted for the MQ queue at the next time according to the initialized message processing parameters and starting the message processing programs in sequence until the queue depth of the MQ queue is zero. The message master and the message processing are designed respectively, and the message processing program is dynamically started through a reasonable algorithm, so that the existing resources can be used to the maximum extent, the concurrent processing capacity of the system is improved, and the business processing requirements are met. The present application overcomes the defects of the obvious insufficient concurrent processing degree of the traditional design mode, dynamically starts the message processing program according to the size of the message to be processed through a control program and a specific algorithm, can use the existing resources to the maximum extent, improves the concurrent processing capacity of the system, and meets the timeliness requirements of the business.

[0117] The acquisition, storage, use, processing and the like of data in the technical solutions of the present application comply with relevant provisions of national laws and regulations. The various types of data, such as personal identity data, operation data and behavior data of individuals, customers and crowds, acquired by the present application have been authorized.

[0118] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can adopt a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product implemented on one or more computer usable storage media (including but not limited to disk memory, CD-ROM, optical memory and the like) containing computer usable program code.

[0119] The computer program instructions can 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 block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks

[0120] These computer program instructions can 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 instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks

[0121] The computer program instructions can 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 block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks

[0122] The above-described specific embodiments, the purpose, technical solutions and advantages of the present application are further described in detail, it should be understood that the above-described only for the specific embodiments of the present application has been described, and not used to limit the scope of protection of the present application, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application, should be included within the scope of protection of the present application.

Claims

1. A method for dynamically controlling message concurrency processing, the method comprising: The method comprises the following steps: initializing message processing parameters; obtaining the queue depth of the current MQ queue and the number of currently running message processing programs; the message processing program is used for processing messages in the MQ queue; determining the number of message processing programs that need to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs; starting the corresponding number of message processing programs in turn according to the number of message processing programs that need to be restarted for the current MQ queue to process messages in the MQ queue; waiting for a set time length, then cyclically obtaining the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time, cyclically determining the number of message processing programs that need to be restarted for the MQ queue at the next time in combination with the initialized message processing parameters and starting the programs in turn until the queue depth of the MQ queue is zero; obtaining the queue depth of the current MQ queue comprises the following steps: calling the API function MQINQ of the MQ to obtain the queue depth of the current MQ queue; the queue depth is the number of messages in the current MQ queue; obtaining the number of currently running message processing programs comprises the following steps: calling the CICS command to obtain the number of currently running message processing programs; the initialized message processing parameters comprise an initial value, a growth value and a maximum value of the number of message processing programs; determining the number of message processing programs that need to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs comprises the following steps: when the queue depth of the current MQ queue is less than or equal to a first set value, taking the initial value as the number of message processing programs to be started; when the queue depth of the current MQ queue is greater than the first set value and less than or equal to a second set value, taking the sum of the initial value and the growth value with a first multiple as the number of message processing programs to be started; when the queue depth of the current MQ queue is greater than the second set value and less than or equal to a third set value, taking the sum of the initial value and the growth value with a second multiple as the number of message processing programs to be started; when the queue depth of the current MQ queue is greater than the third set value and less than or equal to a fourth set value, taking the sum of the initial value and the growth value with a third multiple as the number of message processing programs to be started; when the queue depth of the current MQ queue is greater than the fourth set value, taking the maximum value as the number of message processing programs to be started; subtracting the number of currently running message processing programs from the number of message processing programs to be started to determine the number of message processing programs that need to be restarted for the current MQ queue.

2. The method of claim 1, wherein, starting the corresponding number of message processing programs in turn according to the number of message processing programs that need to be restarted for the current MQ queue to process messages in the MQ queue comprises the following steps: calling the START command of the CICS to start the corresponding number of message processing programs in turn according to the number of message processing programs that need to be restarted for the current MQ queue. The corresponding number of message processing programs restarted respectively read the messages in the MQ queue for logical processing to realize the business function.

3. The method of claim 1, wherein, Further comprising: The restarted message processing program stops running when there is no message processing.

4. A dynamic control message concurrency handling apparatus, characterized by, Comprising: An initialization parameter module for initializing message processing parameters; An MQ queue state acquisition module for acquiring the queue depth of the current MQ queue and the number of currently running message processing programs; the message processing program is used for processing the messages in the MQ queue; A number of restarted message processing programs determination module for determining the number of message processing programs needed to be restarted for the current MQ queue according to the initialized message processing parameters, the queue depth of the current MQ queue and the number of currently running message processing programs; A message processing program starting module for starting the corresponding number of message processing programs in turn according to the number of message processing programs needed to be restarted for the current MQ queue to process the messages in the MQ queue; A loop execution module for waiting for a set time length, then cyclically acquiring the queue depth of the MQ queue at the next time and the number of message processing programs running at the next time, cyclically determining the number of message processing programs needed to be restarted for the MQ queue at the next time in combination with the initialized message processing parameters and starting in turn until the queue depth of the MQ queue is zero; The MQ queue state acquisition module is specifically used for: Calling the API function MQINQ of the MQ to obtain the queue depth of the current MQ queue; the queue depth is the number of messages in the current MQ queue; The MQ queue state acquisition module is specifically used for: Calling the CICS command to obtain the number of currently running message processing programs; The initialized message processing parameters include: an initial value, a growth value and a maximum value of the number of message processing programs; The number of restarted message processing programs determination module is specifically used for: When the queue depth of the current MQ queue is less than or equal to a first set value, taking the initial value as the number of message processing programs to be started; When the queue depth of the current MQ queue is greater than the first set value and less than or equal to a second set value, taking the sum of the initial value and the growth value of a first multiple as the number of message processing programs to be started; When the queue depth of the current MQ queue is greater than the second set value and less than or equal to a third set value, taking the sum of the initial value and the growth value of a second multiple as the number of message processing programs to be started; When the queue depth of the current MQ queue is greater than the third set value and less than or equal to a fourth set value, taking the sum of the initial value and the growth value of a third multiple as the number of message processing programs to be started; When the queue depth of the current MQ queue is greater than the fourth set value, taking the maximum value as the number of message processing programs to be started; Subtracting the number of currently running message processing programs from the number of message processing programs to be started to determine the number of message processing programs needed to be restarted for the current MQ queue.

5. The apparatus of claim 4, wherein, The message processing program starting module is specifically used for: According to the number of message processing programs needed to be restarted by the current MQ queue, a START command of CICS is called to start the corresponding number of message processing programs one by one; The restarted corresponding number of message processing programs respectively read the messages in the MQ queue to implement the business functions through logical processing.

6. The apparatus of claim 4, wherein, The message processing program starting module is further used for stopping the running of the restarted message processing program when there is no message processing.

7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method in any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1 to 3.

9. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Message queue processing method and device

    CN106886457A

  • Message processing method and device, equipment and computer storage medium

    CN112925659A