Message processing methods, apparatus, media and systems

By employing a parallel architecture and dynamically selecting processing paths, the problem of message backlog in message queue systems under sudden traffic surges was solved, enabling rapid consumption and efficient processing while preventing system crashes.

CN123123300APending Publication Date: 2026-11-17AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611458603.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, message queue systems are prone to congestion during sudden traffic surges, resulting in low message processing efficiency. Conventional optimization methods are limited by AGI memory bottlenecks, leading to message processing timeouts or link paralysis.

Method used

The system employs a parallel architecture, immediately launching a low-complexity, high-speed first intelligent framework to generate draft results and a high-complexity, high-accuracy second intelligent framework to generate standard results. It also dynamically selects the processing path based on consumption lag and response time metrics, including using draft results, standard results, or setting timeout thresholds to clean up messages.

Benefits of technology

Under the bottleneck of AGI computing power, the rapid consumption of messages removed from the queue avoids the infinite accumulation of messages, improves message processing efficiency, prevents system crashes, and ensures the stability and robustness of message processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123300A_ABST
    Figure CN123123300A_ABST
Patent Text Reader

Abstract

This application provides a message processing method, apparatus, medium, and system. The method includes: after retrieving a message, simultaneously initiating an asynchronous task that generates a draft result by a first intelligent framework and an asynchronous task that generates a standard result by a second intelligent framework; obtaining the consumption lag of the message queue system and the response time index of the second intelligent framework; and performing one of the following based on the consumption lag and response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, determining a timeout threshold, and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold. This solves the problem of low message processing efficiency caused by message accumulation in the message queue in existing solutions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of message processing technology, and more specifically, to a message processing method, apparatus, medium, and system. Background Technology

[0002] The inference time for a single message can range from hundreds of milliseconds to several seconds, and memory resources are expensive, making it difficult to scale horizontally indefinitely. When a sudden surge in upstream traffic causes the message generation rate to momentarily exceed the maximum throughput of the AGI, the Consumer Lag of the message queue system will rise sharply.

[0003] Existing conventional optimization methods (such as increasing consumer instances and increasing batch processing size) are often limited by AGI's memory bottleneck and context length constraints, resulting in limited effectiveness. Once the backlog exceeds a certain threshold, it will cause message processing timeouts (TTL expiration), which will manifest as "function not executed" or "unresponsive" on the user end. In severe cases, frequent rebalancing of consumer groups can even paralyze the entire chain.

[0004] In other words, existing solutions tend to have messages piling up in the message queue, leading to low message processing efficiency. Summary of the Invention

[0005] The main objective of this application is to provide a message processing method, apparatus, medium, and system to at least solve the problem of low message processing efficiency caused by message accumulation in message queues in existing solutions.

[0006] To achieve the above objectives, according to one aspect of this application, a message processing method is provided, comprising: after retrieving a message, simultaneously initiating an asynchronous task that generates a draft result by a first intelligent framework and an asynchronous task that generates a standard result by a second intelligent framework, wherein the algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft result is lower than that of the standard result; obtaining the consumption lag of the message queue system and the response time index of the second intelligent framework, and performing one of the following based on the consumption lag and the response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, determining a timeout threshold, and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold.

[0007] Optionally, based on the consumption lag and the response time metric, one of the following can be performed: using the draft result as the final message processing result, using the standard result as the final message processing result, setting a timeout threshold and cleaning up at least a portion of the messages in the message queue system according to the timeout threshold, including: when the consumption lag is greater than or equal to a first lag threshold and the consumption lag is less than a second lag threshold, determining the timeout threshold and cleaning up at least a portion of the messages in the message queue system according to the timeout threshold.

[0008] Optionally, based on the consumption lag and the response time indicator, one of the following can be performed: using the draft result as the final message processing result, using the standard result as the final message processing result, setting a timeout threshold and cleaning up at least a portion of the messages in the message queue system according to the timeout threshold, including: when the consumption lag is less than a first lag threshold and the response time indicator is less than a preset response time, using the draft result as the final message processing result or using the standard result as the final message processing result based on the cosine similarity between the draft result and the standard result.

[0009] Optionally, the draft result is used as the final message processing result, or the standard result is used as the final message processing result, based on the cosine similarity between the draft result and the standard result. This includes: using the draft result as the final message processing result when the cosine similarity is less than a similarity threshold; and using the standard result as the final message processing result when the cosine similarity is greater than or equal to the similarity threshold.

[0010] Optionally, one of the following actions may be performed based on the consumption lag and the response time indicator: using the draft result as the final message processing result, using the standard result as the final message processing result, setting a timeout threshold and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold, including: using the draft result as the final message processing result when the consumption lag is greater than or equal to a second lag threshold, or when the response time indicator is greater than or equal to a preset response time.

[0011] Optionally, if the consumption lag is greater than or equal to the second lag threshold, or the response time indicator is greater than or equal to the preset response time, after using the draft result as the final message processing result, the method further includes: stopping the task being processed by the second intelligent framework and clearing all pending tasks of the second intelligent framework.

[0012] Optionally, determining the timeout threshold includes: determining the corresponding timeout threshold based on the range of message quantity in the message queue system.

[0013] According to another aspect of this application, a message processing apparatus is provided, comprising: a pull unit, configured to pull messages and, in parallel, initiate an asynchronous task in which a first intelligent framework generates draft results and an asynchronous task in which a second intelligent framework generates standard results, wherein the algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft results is lower than that of the standard results; and an acquisition unit, configured to acquire the consumption lag of a message queue system and the response time index of the second intelligent framework, and, based on the consumption lag and the response time index, perform one of the following: using the draft results as the final message processing result, using the standard results as the final message processing result, determining a timeout threshold, and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold.

[0014] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform any of the methods described.

[0015] According to another aspect of this application, a message processing system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any of the methods described.

[0016] Applying the technical solution of this application, after retrieving messages, two asynchronous tasks are immediately launched in parallel: one is a draft result generated by a low-complexity, high-speed first intelligent framework, and the other is a standard result generated by a high-complexity, high-accuracy second intelligent framework. This parallel architecture allows the system to intervene in the decision-making process without waiting for the time-consuming standard result, thus eliminating the direct blocking of the consumption process by long-tail latency from the architecture. The system monitors the consumption lag and the response time of the second intelligent framework in real time, and dynamically selects the processing path based on these two indicators, ensuring that even under AGI computing power bottlenecks, messages can be quickly consumed and removed from the queue, avoiding the infinite accumulation of messages due to waiting for complex calculations. When the system faces severe backlog (large lag) or extremely slow response, the system not only uses draft results to accelerate consumption, but also dynamically sets timeout thresholds based on the lag range to clean up messages that have been waiting for too long or may have expired, improving message processing efficiency and thus solving the problem of low message processing efficiency caused by message accumulation in the message queue in existing solutions. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A flowchart illustrating a message processing method according to an embodiment of this application is shown;

[0019] Figure 2 A structural block diagram of a message processing apparatus provided according to an embodiment of this application is shown. Detailed Implementation

[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:

[0024] AGI: Artificial General Intelligence, here referring to the core intelligent components or models used in a system to process messages.

[0025] Consumer Lag: Consumer lag (or backlog).

[0026] TTL: Time To Live, refers to the maximum time a message is allowed to remain in a message queue. If a message waits in the queue for longer than the set TTL, it will be considered invalid or expired and will usually be discarded or moved to a dead-letter queue.

[0027] Rebalance: Rebalancing.

[0028] As described in the background section, existing conventional optimization methods (such as increasing consumer instances and increasing batch processing size) are often limited by AGI's memory bottleneck and context length constraints, resulting in limited effectiveness. Once the backlog exceeds a certain threshold, it will cause message processing timeouts (TTL expiration), and the user end will exhibit "function not executed" or "unresponsive." In severe cases, frequent rebalancing of consumer groups can even paralyze the entire chain. To address the problem of low message processing efficiency caused by message backlog in existing solutions, embodiments of this application provide a message processing method, apparatus, medium, and system.

[0029] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0030] This embodiment provides a message processing method. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0031] Figure 1 This is a flowchart of a message processing method according to an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps:

[0032] Step S101: After pulling the message, start the asynchronous task of generating draft results by the first intelligent framework and the asynchronous task of generating standard results by the second intelligent framework in parallel. The algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft results is lower than that of the standard results.

[0033] The second intelligent framework can be used for large language models.

[0034] The first intelligent framework can be a small language model or a random forest algorithm.

[0035] Step S102: Obtain the consumption lag of the message queue system and the response time index of the second intelligent framework, and perform one of the following based on the consumption lag and the response time index: use the draft result as the final message processing result, use the standard result as the final message processing result, determine the timeout threshold and clean up at least some of the messages in the message queue system based on the timeout threshold.

[0036] Upon retrieving messages, this application immediately initiates two asynchronous tasks in parallel: one generates a draft result using a low-complexity, high-speed first intelligent framework, and the other generates a standard result using a high-complexity, high-accuracy second intelligent framework. This parallel architecture allows the system to intervene in the decision-making process without waiting for the time-consuming standard result, thus eliminating the direct blocking of the consumption process by long-tail latency. The system monitors the consumption lag and the response time of the second intelligent framework in real time, dynamically selecting the processing path based on these two indicators: if the system is healthy, it can flexibly choose to use either the draft or the standard result based on the similarity between the draft and the standard result or business requirements, ensuring both processing speed and quality. When the lag or response time exceeds a threshold, the system forces the generation of a rapidly produced draft result as the final output and further triggers a cleanup mechanism. This ensures that even under AGI computing power bottlenecks, messages can be quickly consumed and removed from the queue, avoiding the infinite backlog of messages caused by waiting for complex calculations. When the system faces severe backlog (large delay) or extremely slow response, it not only uses draft results to accelerate consumption, but also dynamically sets timeout thresholds based on the delay range to clean up messages that have been waiting for too long or may have expired, thereby improving message processing efficiency and solving the problem of low message processing efficiency caused by message accumulation in the message queue in the existing solution.

[0037] In one embodiment of this application, one of the following is performed based on the consumption lag and the response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, setting a timeout threshold and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold, including: when the consumption lag is greater than or equal to a first lag threshold and the consumption lag is less than a second lag threshold, determining the timeout threshold and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold.

[0038] The first hysteresis threshold represents the critical point at which the system begins to experience backlog, but is still within the normal processing capacity, or the backlog has not yet had a significant perceived impact on downstream business.

[0039] The second lag threshold indicates a critical point where severe system backlog may trigger memory overflow, CPU overload, database connection pool exhaustion, or even an avalanche effect.

[0040] This approach avoids excessive intervention or ineffective cleanup during minor delays, ensuring the normal logic of message processing. For moderate backlogs, dynamically setting timeout thresholds to clean up delayed messages effectively releases queue resources, preventing further deterioration of the delay that could lead to system crashes or cascading failures. It also avoids the data consistency risks associated with directly discarding or forcibly rolling back messages during extremely severe delays. This demonstrates an adaptive balance between system stability and message integrity, enhancing the robustness and self-healing capabilities of the message queue system under fluctuating loads.

[0041] In one embodiment of this application, one of the following is performed based on the consumption lag and the response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, setting a timeout threshold and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold, including: when the consumption lag is less than a first lag threshold and the response time index is less than a preset response time, using the draft result as the final message processing result or using the standard result as the final message processing result based on the cosine similarity between the draft result and the standard result.

[0042] When the system is in a healthy state (low latency, short response time), it indicates sufficient computing resources and no backlog pressure. Decision-making based on similarity calculations at this time avoids the logical redundancy of complex judgments only when resources are strained, ensuring processing is completed at the lowest computational cost under normal conditions, maximizing throughput. Cosine similarity is used to measure the consistency between draft results (usually generated quickly but may be incomplete) and standard results (complete and accurate but time-consuming). If the two are highly similar, the draft results have sufficient credibility and can be used directly, saving the lengthy waiting time for standard results and further improving response speed; if the similarity is low, the standard results are used, ensuring data accuracy and the rigor of business logic.

[0043] In one embodiment of this application, the method of using the draft result as the final message processing result or the standard result as the final message processing result based on the cosine similarity between the draft result and the standard result includes: using the draft result as the final message processing result when the cosine similarity is less than a similarity threshold; and using the standard result as the final message processing result when the cosine similarity is greater than or equal to the similarity threshold.

[0044] The similarity threshold can be between 70% and 90%.

[0045] When the draft result is highly similar to the standard result (similarity ≥ threshold), it indicates that the draft result has sufficient credibility. Using the standard result ensures that the final output data has undergone complete verification, meets high consistency requirements, and prevents business logic errors caused by potential defects in the draft result. When the similarity is low (similarity < threshold), it indicates that there is a significant difference between the draft result and the standard result. In this case, blindly adopting the standard result may not reflect rapid changes or specific edge cases captured in the draft, or it may indicate that the system is currently in an unstable state. Although using the draft result may sacrifice some accuracy, it can avoid unpredictable logical conflicts when processing severely inconsistent data, ensure the continuity of the message processing flow, and prevent timeouts or blockages caused by waiting for high-cost standard calculations.

[0046] In one embodiment of this application, one of the following is performed based on the above-mentioned consumption lag and the above-mentioned response time index: using the above-mentioned draft result as the final message processing result, using the above-mentioned standard result as the final message processing result, setting a timeout threshold and cleaning up at least a portion of the messages in the above-mentioned message queue system according to the above-mentioned timeout threshold, including: using the above-mentioned draft result as the final message processing result when the above-mentioned consumption lag is greater than or equal to a second lag threshold, or when the above-mentioned response time index is greater than or equal to a preset response time.

[0047] When lag or response time exceeds a critical threshold, it indicates that system processing resources are extremely strained. Continuing to wait for the costly generated standard result at this point can easily lead to consumer thread blocking, connection pool exhaustion, or even service crashes. Forcing the use of draft results with minimal computational overhead can quickly release consumption capacity, prevent further deterioration of message backlog, and ensure that the message queue system does not collapse due to a single point of performance failure. By quickly processing and removing messages from the queue (even using draft results), queue storage space and memory resources can be immediately freed up, creating conditions for processing subsequent incoming messages and avoiding the risk of memory overflow due to the accumulation of old messages.

[0048] In one embodiment of this application, when the consumption lag is greater than or equal to the second lag threshold, or the response time indicator is greater than or equal to the preset response time, after using the draft result as the final message processing result, the method further includes: stopping the task being processed by the second intelligent framework and clearing all pending tasks of the second intelligent framework.

[0049] Secondary intelligent frameworks typically involve complex computations or AI inference, consuming significant amounts of CPU, memory, or I / O resources. Continuing to run these tasks under high latency / lag conditions exacerbates system congestion. Immediately stopping and cleaning up these tasks instantly releases occupied critical computing resources, allowing the system to focus its limited resources on processing core message flows and preventing complete system deadlock due to resource exhaustion. Pending tasks often involve potential subsequent state updates or resource release waiting. Cleaning up these tasks prevents resources from remaining unprocessed for extended periods due to task suspension or timeout retries, ensuring that backlogged data in the message queue can be quickly processed by subsequent lightweight drafting logic.

[0050] In one embodiment of this application, determining the timeout threshold includes: determining the corresponding timeout threshold based on the range of message quantity in the message queue system.

[0051] Setting a shorter timeout threshold when there is little message backlog can quickly remove a small number of delayed messages and release resources quickly; while setting a longer timeout threshold when there is a serious backlog gives more time for messages that are still valuable to be processed or to wait for a more stable state, avoiding the accidental loss of important business data due to overly aggressive message discarding.

[0052] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0053] This application also provides a message processing apparatus. It should be noted that the message processing apparatus of this application can be used to execute the message processing method provided in this application. This apparatus is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0054] The message processing apparatus provided in the embodiments of this application will be described below.

[0055] Figure 2 This is a structural block diagram of a message processing apparatus according to an embodiment of this application. For example... Figure 2As shown, the device includes: a pull unit 21, used to pull messages and then concurrently start an asynchronous task that generates a draft result by a first intelligent framework and an asynchronous task that generates a standard result by a second intelligent framework, wherein the algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft result is lower than that of the standard result; and an acquisition unit 22, used to acquire the consumption lag of the message queue system and the response time index of the second intelligent framework, and perform one of the following based on the consumption lag and the response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, determining a timeout threshold, and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold.

[0056] In one embodiment of this application, the acquisition unit includes: a first processing module configured to determine the timeout threshold and clean up at least a portion of the messages in the message queue system based on the timeout threshold when the consumption lag is greater than or equal to a first lag threshold and the consumption lag is less than a second lag threshold.

[0057] In one embodiment of this application, the acquisition unit includes: a second processing module configured to, when the consumption lag is less than a first lag threshold and the response time index is less than a preset response time, adopt the draft result as the final message processing result or adopt the standard result as the final message processing result based on the cosine similarity between the draft result and the standard result.

[0058] In one embodiment of this application, the second processing module includes: a first processing submodule used to use the draft result as the final message processing result when the cosine similarity is less than the similarity threshold; and a second processing submodule used to use the standard result as the final message processing result when the cosine similarity is greater than or equal to the similarity threshold.

[0059] In one embodiment of this application, the acquisition unit includes: a third processing module used to use the draft result as the final message processing result when the consumption lag is greater than or equal to a second lag threshold, or the response time index is greater than or equal to a preset response time.

[0060] In one embodiment of this application, the above-mentioned apparatus further includes: a processing unit configured to, when the consumption lag is greater than or equal to a second lag threshold, or the response time index is greater than or equal to a preset response time, after adopting the draft result as the final message processing result, stop the task being processed by the second intelligent framework and clear all pending tasks of the second intelligent framework.

[0061] In one embodiment of this application, the acquisition unit includes: a fourth processing module for determining the corresponding timeout threshold based on the range of the number of messages in the message queue system.

[0062] The aforementioned message processing device includes a processor and a memory. The aforementioned pull unit and fetch unit, etc., are all stored as program units in the memory, and the processor executes these program units stored in the memory to implement the corresponding functions. All of the aforementioned modules are located in the same processor; alternatively, the aforementioned modules may be located in different processors in any combination.

[0063] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problem of message queue accumulation leading to low message processing efficiency in existing solutions.

[0064] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0065] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device containing the computer-readable storage medium to execute the message processing method.

[0066] This invention provides a processor for running a program, wherein the program executes the message processing method described above.

[0067] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps: after retrieving a message, it initiates in parallel an asynchronous task to generate a draft result using a first intelligent framework and an asynchronous task to generate a standard result using a second intelligent framework. The algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft result is lower than that of the standard result. It then obtains the consumption lag of the message queue system and the response time index of the second intelligent framework, and performs one of the following based on the consumption lag and the response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, determining a timeout threshold, and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold. The device described herein can be a server, PC, PAD, mobile phone, etc.

[0068] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps: after pulling a message, starting in parallel an asynchronous task that generates a draft result by a first intelligent framework and an asynchronous task that generates a standard result by a second intelligent framework, wherein the algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft result is lower than that of the standard result; obtaining the consumption lag of the message queue system and the response time index of the second intelligent framework, and performing one of the following based on the consumption lag and the response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, determining a timeout threshold, and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold.

[0069] This application also provides a message processing system, including: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any of the above-described methods.

[0070] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0071] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can 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, etc.) containing computer-usable program code.

[0072] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can 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, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0075] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0076] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0077] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0078] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0079] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0080] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A message processing method, characterized in that, include: After retrieving the message, an asynchronous task to generate a draft result by the first intelligent framework and an asynchronous task to generate a standard result by the second intelligent framework are started in parallel. The algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft result is lower than that of the standard result. Obtain the consumption lag of the message queue system and the response time metric of the second intelligent framework, and perform one of the following based on the consumption lag and the response time metric: use the draft result as the final message processing result, use the standard result as the final message processing result, determine a timeout threshold, and clean up at least a portion of the messages in the message queue system based on the timeout threshold.

2. The method according to claim 1, characterized in that, Based on the consumption lag and the response time metric, perform one of the following: use the draft result as the final message processing result, use the standard result as the final message processing result, set a timeout threshold and clean up at least a portion of the messages in the message queue system according to the timeout threshold, including: If the consumption lag is greater than or equal to a first lag threshold and the consumption lag is less than a second lag threshold, the timeout threshold is determined and at least a portion of the messages in the message queue system are cleaned up according to the timeout threshold.

3. The method according to claim 1, characterized in that, Based on the consumption lag and the response time metric, perform one of the following: use the draft result as the final message processing result, use the standard result as the final message processing result, set a timeout threshold and clean up at least a portion of the messages in the message queue system according to the timeout threshold, including: If the consumption lag is less than a first lag threshold and the response time index is less than a preset response time, the draft result is used as the final message processing result, or the standard result is used as the final message processing result, based on the cosine similarity between the draft result and the standard result.

4. The method according to claim 3, characterized in that, Based on the cosine similarity between the draft result and the standard result, the draft result is used as the final message processing result, or the standard result is used as the final message processing result, including: If the cosine similarity is less than the similarity threshold, the draft result is used as the final message processing result. If the cosine similarity is greater than or equal to the similarity threshold, the standard result is used as the final message processing result.

5. The method according to claim 1, characterized in that, Based on the consumption lag and the response time metric, perform one of the following: use the draft result as the final message processing result, use the standard result as the final message processing result, set a timeout threshold and clean up at least a portion of the messages in the message queue system according to the timeout threshold, including: If the consumption lag is greater than or equal to the second lag threshold, or if the response time index is greater than or equal to the preset response time, the draft result shall be used as the final message processing result.

6. The method according to claim 5, characterized in that, If the consumption lag is greater than or equal to a second lag threshold, or the response time indicator is greater than or equal to a preset response time, after using the draft result as the final message processing result, the method further includes: Stop the task being processed by the second intelligent framework and clean up all pending tasks of the second intelligent framework.

7. The method according to claim 1, characterized in that, Determine the timeout threshold, including: The corresponding timeout threshold is determined based on the range of message quantity in the message queue system.

8. A message processing device, characterized in that, include: The pull unit is used to pull messages and then launch asynchronous tasks in parallel to generate draft results by the first intelligent framework and standard results by the second intelligent framework. The algorithm complexity of the first intelligent framework is lower than that of the second intelligent framework, and the generation speed of the draft results is lower than that of the standard results. The acquisition unit is used to acquire the consumption lag of the message queue system and the response time index of the second intelligent framework, and to perform one of the following based on the consumption lag and the response time index: using the draft result as the final message processing result, using the standard result as the final message processing result, determining a timeout threshold and cleaning up at least a portion of the messages in the message queue system based on the timeout threshold.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 7.

10. A message processing system, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising methods for performing any one of claims 1 to 7.