Message processing method, device, electronic device and storage medium

The message timeout detection service retrieves timeout time information based on message ID, which solves the problem of low message timeout detection efficiency in the existing technology, achieves high concurrency and high throughput message processing, and reduces system memory usage and hardware costs.

CN117156398BActive Publication Date: 2024-10-22CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310985367.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-04
Publication Date
2024-10-22
Estimated Expiration
2043-08-04

AI Technical Summary

Technical Problem

Existing message timeout detection methods are inefficient when processing various types of messages, are difficult to adapt to large-scale message processing scenarios, and occupy high system memory, resulting in increased hardware costs.

Method used

Propose a message processing method that receives the timeout detection request from the message consumer through the message timeout detection service, retrieves and obtains the timeout time information in the message index based on the message ID, determines the timeout detection result, and sends the result to the consumer to avoid modification The original message structure improves reusability and processing efficiency, and has high concurrency and high throughput capabilities.

Benefits of technology

It achieves high efficiency and low memory usage when detecting message timeout, adapts to large-scale message processing scenarios, and reduces hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117156398B_ABST
    Figure CN117156398B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a message processing method, device, electronic device and storage medium, which relate to the technical field of message communication services. It includes: a message timeout detection service receives a message timeout detection request sent by a message consumer, wherein the detection request includes an identification ID of a first message; based on the ID of the first message, a first message index of the first message is retrieved and obtained, wherein the first message index includes first timeout information; according to the first timeout information, a timeout detection result is determined, and the timeout detection result is sent to the message consumer. Thus, the timeout time of the first message can be determined based on the message index to determine whether the first message has timed out. This method avoids modifying the original message structure when detecting a message timeout, has good reusability, improves the efficiency of message processing, has high concurrency and high throughput capabilities, can adapt to large-scale message processing scenarios, and occupies less system memory, which can reduce hardware costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of message communication services, and in particular to a message processing method, device, electronic device and storage medium. Background Art

[0002] Message timeout control is one of the core functions of basic message communication services or message-driven software architectures such as SMS and 5G messages. Whether the timeout detection is timely and accurate may often affect the development of the business. Therefore, a more effective and more widely applicable message timeout detection method is needed to handle various types of messages. Summary of the invention

[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0004] The first aspect embodiment of the present disclosure proposes a message processing method, which is executed by a message timeout detection service, and the method includes: receiving a message timeout detection request sent by a message consumer, wherein the detection request includes an identification ID of a first message; based on the ID of the first message, retrieving and obtaining a first message index of the first message, wherein the first message index includes first timeout information; determining a timeout detection result based on the first timeout information; and sending the timeout detection result to the consumer.

[0005] An embodiment of the second aspect of the present disclosure proposes a message processing method, which is executed by a message consumer, and the method includes: receiving a first message, wherein the first message includes an identification ID of the first message; sending a message timeout detection request to a message timeout detection service, wherein the detection request includes the ID of the first message; receiving a timeout detection result sent by the message timeout detection service, wherein the timeout detection result is used to indicate whether the first message has timed out.

[0006] An embodiment of the third aspect of the present disclosure proposes a message processing method, which is executed by a message generating party, and the method includes: determining an identification ID and first timeout information of a first message to be sent; sending an index generation request to a message timeout detection service, wherein the index generation request includes the first message ID and the first timeout information; and sending the first message.

[0007] An embodiment of the fourth aspect of the present disclosure proposes a message processing device, which is configured in a message timeout detection service, and the device includes: a first receiving module, used to receive a message timeout detection request sent by a message consumer, wherein the detection request includes an identification ID of a first message; a first acquisition module, used to retrieve and obtain a first message index of the first message based on the ID of the first message, wherein the first message index includes first timeout information; a first determination module, used to determine a timeout detection result based on the first timeout information; and a first sending module, used to send the timeout detection result to the consumer.

[0008] An embodiment of the fifth aspect of the present disclosure proposes a message processing device, which is configured on a message consumer side, and the device includes: a second receiving module, used to receive a first message, wherein the first message includes an identification ID of the first message; a second sending module, used to send a message timeout detection request to a message timeout detection service, wherein the detection request includes the ID of the first message; and a third receiving module, used to receive a timeout detection result sent by the message timeout detection service, wherein the timeout detection result is used to indicate whether the first message has timed out.

[0009] The sixth aspect embodiment of the present disclosure proposes a message processing device, which is configured on the message generating party, and the device includes: a second determination module, used to determine the identification ID and first timeout information of the first message to be sent; a third sending module, used to send an index generation request to the message timeout detection service, wherein the index generation request includes the first message ID and the first timeout information; and a fourth sending module, used to send the first message.

[0010] The seventh aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can implement the message processing method proposed in the embodiment of the present disclosure.

[0011] An eighth aspect embodiment of the present disclosure proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the message processing method proposed in the embodiment of the present disclosure is implemented.

[0012] The ninth aspect embodiment of the present disclosure proposes a computer program product, including a computer program, which, when executed by a processor, implements the message processing method proposed in the embodiment of the present disclosure.

[0013] The message processing method, device, electronic device and storage medium provided by the present disclosure have the following beneficial effects:

[0014] In the present disclosure, after receiving a message timeout detection request sent by a message consumer, the message timeout detection service retrieves and obtains the first message index of the first message based on the ID of the first message, and then determines the timeout detection result based on the first timeout information included in the first message index, and sends the timeout detection result to the message consumer. Thus, the timeout time of the first message can be determined based on the message index to determine whether the first message has timed out. The message processing method avoids modifying the original message structure when detecting a message timeout, has good reusability, improves the efficiency of message processing, has high concurrency and high throughput capabilities, can adapt to large-scale message processing scenarios, and occupies less system memory, which can reduce hardware costs.

[0015] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0017] Figure 1 A flowchart of a message processing method provided by an embodiment of the present disclosure;

[0018] Figure 2 A flowchart of a message processing method provided by another embodiment of the present disclosure;

[0019] Figure 3 A flowchart of a message processing method provided by another embodiment of the present disclosure;

[0020] Figure 4 A flowchart of a message processing method provided by another embodiment of the present disclosure;

[0021] Figure 5 A flowchart of a message processing method provided by another embodiment of the present disclosure;

[0022] Figure 6 A signaling interaction diagram of a message processing method provided by another embodiment of the present disclosure;

[0023] Figure 7 A schematic diagram of the structure of a message processing device provided by an embodiment of the present disclosure;

[0024] Figure 8 A schematic diagram of the structure of a message processing device provided by another embodiment of the present disclosure;

[0025] Fig. 9 A schematic diagram of the structure of a message processing device provided by another embodiment of the present disclosure;

[0026] Fig.10 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0027] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0028] The message processing method in the embodiment of the present disclosure can be executed by the message processing device in the embodiment of the present disclosure, and the device can be applied to any electronic device to realize the function of processing the detected timeout message. The electronic device can be any device with computing capabilities, such as a mobile phone, a tablet computer, a personal computer, a personal digital assistant, and other hardware devices with various operating systems, touch screens, and / or display screens, and the present disclosure does not limit this.

[0029] The message processing method, device, electronic device, and storage medium of the embodiments of the present disclosure are described below with reference to the accompanying drawings.

[0030] Figure 1 A flowchart of a message processing method provided by an embodiment of the present disclosure.

[0031] like Figure 1 As shown, the message processing method, which is executed by the message timeout detection service, may include:

[0032] Step 101: Receive a message timeout detection request sent by a message consumer, wherein the detection request includes an identification ID of a first message.

[0033] The message consumer refers to a module that obtains messages from a message queue or message middleware, and executes corresponding business logic processing according to the content of the message. The identification ID of the first message refers to a value that can uniquely identify a message, which is usually automatically generated by a message service or application and assigned together with the message when the message is sent. It can be a string, integer, or other appropriate data type, and this disclosure does not limit this.

[0034] Step 102: Based on the ID of the first message, retrieve and obtain a first message index of the first message, wherein the first message index includes first timeout information.

[0035] The first timeout information may refer to a natural time, represented by a long integer value, and may include a time zone and specific time information. The first message index is a data structure that can be used to quickly query the relevant data of the first message, such as the first timeout information of the first message.

[0036] In the embodiment of the present disclosure, the message timeout detection service can obtain the first message ID and the first timeout information in advance to generate a first message index, associate the first message index with the first message ID and store it in a message index table, and then, after receiving a message timeout detection request, retrieve the associated first message index in the message index table according to the first message ID, and obtain the first timeout information of the first message from the retrieved first message index.

[0037] Step 103: Determine a timeout detection result according to the first timeout period information.

[0038] In the disclosed embodiment, the message timeout detection service can obtain the current time information, compare it with the first timeout time information, and obtain the timeout detection result. If the current time information is after the first timeout time information, it can be judged that the timeout detection result of the first message is timed out; otherwise, the timeout detection result of the first message is not timed out.

[0039] Optionally, after determining the timeout detection result, the message timeout detection service may delete the stored first message ID and first timeout period information.

[0040] In the disclosed embodiment, after determining the timeout detection result of the first message, the first message will be processed by the message consumer and deleted from the queue of messages to be processed. Therefore, the message timeout detection service can delete the stored first message ID and first timeout information, free up storage space, and improve the retrieval efficiency of the message index.

[0041] Step 104: Send the timeout detection result to the message consumer.

[0042] In the disclosed embodiment, the message timeout detection service may send the obtained timeout detection result to the message consumer, so that the message consumer can take corresponding processing operations on the first message according to the detection result.

[0043] In this embodiment, after receiving the message timeout detection request sent by the message consumer, the message timeout detection service retrieves and obtains the first message index of the first message based on the ID of the first message, and then determines the timeout detection result based on the first timeout information included in the first message index, and sends the timeout detection result to the message consumer. Thus, the timeout of the first message can be determined based on the message index to determine whether the first message has timed out. This message processing method avoids modifying the original message structure when detecting a message timeout, has good reusability, improves the efficiency of message processing, has high concurrency and high throughput capabilities, can adapt to large-scale message processing scenarios, and occupies less system memory, which can reduce hardware costs.

[0044] Figure 2 A flowchart of a message processing method provided by another embodiment of the present disclosure.

[0045] like Figure 2 As shown, the message processing method, which is executed by the message timeout detection service, may include:

[0046] Step 201: Receive an index generation request sent by a message producer, wherein the index generation request includes a first message ID and first timeout information.

[0047] The message producer refers to the module that generates messages and sends them to the message queue or message middleware.

[0048] Step 202: Generate a first message index based on the first timeout information.

[0049] In the embodiment of the present disclosure, the message timeout detection service can sort the first messages according to the first timeout information, and generate the first message index according to the order of the timeout times corresponding to the first messages.

[0050] Step 203: Determine a first message set to which the first message index belongs according to the first time period to which the first timeout information belongs.

[0051] Among them, the first message set refers to a container-type data type, and the elements contained therein are not repeated. In the present disclosure, each first message set corresponds to a first time period, and the maximum time of the first time period is the timeout time of the set, and the first time periods corresponding to different first message sets do not overlap. The first time period can be a fixed time length interval, or a time length determined according to actual conditions, such as the density of timeout information, etc., which is not limited by the present disclosure.

[0052] In the embodiment of the present disclosure, since each first message set corresponds to a first time period, the message timeout detection service can determine a unique corresponding first time period based on the time interval where the first timeout information is located, thereby dividing all first message indexes into different first message sets according to the determined first time period.

[0053] Step 204: associate the first message index and the first message ID and store them in the first message set.

[0054] In this embodiment, the message timeout detection service receives an index generation request sent by the message producer, wherein the index generation request includes the first message ID and the first timeout information, and then generates the first message index based on the first timeout information, and determines the first message set to which the first message index belongs according to the first time period to which the first timeout information belongs, and associates the first message index with the first message ID and stores it in the first message set. Thus, the message timeout detection service can generate a message index based on the message ID and its timeout information at any time, ensuring the real-time update of the message index and the integrity of the detection information, and dividing the message index into different sets according to the time period to which it belongs, thereby improving the management efficiency of the message timeout information and providing conditions for improving the efficiency of message processing.

[0055] Figure 3 A flowchart of a message processing method provided by another embodiment of the present disclosure.

[0056] like Figure 3 As shown, the message processing method, which is executed by the message timeout detection service, may include:

[0057] Step 301: When a second time period associated with a second message set is reached, each message index in the second message set is detected.

[0058] The second message set is any first message set stored in the timeout detection service.

[0059] In the disclosed embodiment, the message timeout detection service can monitor multiple stored first message sets. When it is monitored that the current time is the start time of the second time period associated with the second message set, a timeout detection can be performed on each message index in the second message set in turn, or a timeout detection can be performed on multiple message indexes at the same time.

[0060] Step 302: When the second timeout information corresponding to the second message index is reached, a message timeout processing indication is sent to the message consumer associated with the second message index, wherein the message timeout processing indication includes the second message ID associated with the second message index.

[0061] The second message index may be any one or more message indexes included in the second message set.

[0062] It should be noted that when the second timeout information corresponding to multiple second message indexes arrives at the same time, the message timeout detection service can send message timeout processing instructions to the associated message consumers in sequence, or can also send message timeout processing instructions synchronously. This disclosure does not limit this.

[0063] In the embodiment of the present disclosure, when the message timeout detection service monitors that the current time is the second timeout time corresponding to the second message index, the second message stored in association with the second message index can be determined, and based on the message queue where the second message is located or the message consumer associated with the message middleware, a second message ID is sent to indicate that the second message has timed out.

[0064] Step 303: Delete the second message index and the second message ID in the second message set.

[0065] Step 304: When the second time period ends, a message timeout processing indication is sent to a message consumer associated with each message index in the second message set.

[0066] In the embodiment of the present disclosure, when the message timeout detection service monitors that the current time is the maximum time in the second time period, it can be determined that all second messages associated with the second message indexes in the second message set have timed out, and therefore the message consumer associated with each message index can be instructed to perform timeout processing on the corresponding second message.

[0067] Step 305: Delete the second message set.

[0068] In this embodiment, when the second time period associated with the second message set is reached, the message timeout detection service detects each message index in the second message set, and then, when the second timeout information corresponding to the second message index is reached, a message timeout processing instruction is sent to the message consumer associated with the second message index, wherein the message timeout processing instruction includes the second message ID associated with the second message index, and then the second message index and the second message ID in the second message set are deleted, and then, when the second time period ends, a message timeout processing instruction is sent to the message consumer associated with each message index in the second message set to delete the second message set. Thus, the message timeout service can monitor the message set according to the time information, actively perform the message timeout detection operation, improve the efficiency of message processing, ensure the timeliness of the timeout message processing, and batch detect the messages through the message set, so that the message processing method is more suitable for large-scale message processing environments and more practical.

[0069] Figure 4A flowchart of a message processing method provided by another embodiment of the present disclosure.

[0070] like Figure 4 As shown, the message processing method, executed by the message consumer, may include:

[0071] Step 401: Receive a first message, wherein the first message includes an identification ID of the first message.

[0072] In the embodiment of the present disclosure, the message consumer may receive the first message sent from the message producer, or may obtain the first message to be processed from the message queue or message middleware, which is not limited in the present disclosure.

[0073] Step 402: Send a message timeout detection request to a message timeout detection service, wherein the detection request includes the ID of the first message.

[0074] In the disclosed embodiment, after the message consumer obtains the first message, it is necessary to send a message timeout detection request to the message timeout detection service to determine whether the first message has timed out, because the first message may have reduced data security or become invalid due to timeout, so as to ensure the security of the message data, avoid the processing of invalid messages, and improve the message processing efficiency of the message consumer.

[0075] Step 403: Receive a timeout detection result sent by a message timeout detection service, wherein the timeout detection result is used to indicate whether the first message has timed out.

[0076] In the disclosed embodiment, the message consumer can take corresponding processing operations on the first message according to the timeout detection result. For example, when the timeout detection result indicates that the timeout has occurred, the message consumer can determine any one of the following processing methods according to the actual situation: determine that the first message is invalid, ignore or discard it directly; return the first message to the message generator and re-add it to the message queue after modifying the first timeout information; mark the first message as timed out and retain it for subsequent analysis. Alternatively, when the timeout detection result indicates that the timeout has not occurred, the message consumer can execute the business logic related to the first message according to the content of the first message.

[0077] In the embodiment of the present disclosure, the message consumer may receive a message timeout processing indication sent by the message timeout detection service without sending a message timeout detection request to the message timeout detection service, wherein the message timeout processing indication includes a second message ID, and then the second message associated with the second message ID can be timed out.

[0078] In this embodiment, after receiving the first message, the message consumer first sends a message timeout detection request containing the first message ID to the message timeout detection service, and then receives the timeout detection result returned by the message timeout detection service, and performs corresponding processing operations according to the timeout detection result, so that the timeout status of the first message can be determined in an active or passive manner, thereby ensuring the security of the message data, avoiding the processing of invalid messages, and improving the message processing efficiency of the message consumer.

[0079] Figure 5 A flowchart of a message processing method provided by another embodiment of the present disclosure.

[0080] like Figure 5 As shown, the message processing method, executed by the message producer, may include:

[0081] Step 501: Determine the identification ID and first timeout information of the first message to be sent.

[0082] In an embodiment of the present disclosure, after generating a first message, the message producer can determine the identification ID of the first message to be sent and processed according to preset rules, and can determine the first timeout information of the first message according to the memory size occupied by the message, the validity period of the message data, etc., and the present disclosure does not limit this.

[0083] Step 502: Send an index generation request to a message timeout detection service, wherein the index generation request includes a first message ID and first timeout information.

[0084] In the disclosed embodiment, the message producer may send each first message ID and first timeout information to a message timeout detection service to generate a message index, thereby facilitating real-time monitoring of the timeout status of each first message.

[0085] Step 503: Send the first message.

[0086] In the embodiment of the present disclosure, the message producer may send the first message to be processed directly to the message consumer, or may send it to a message queue or message middleware associated with the message consumer, which is not limited in the present disclosure.

[0087] In this embodiment, the message producer first determines the identification ID and the first timeout information of the first message to be sent, and then sends an index generation request including the first message ID and the first timeout information to the message timeout detection service, and then sends the first message for processing, thereby improving the timeout detection efficiency of the message by generating the corresponding message index before processing the message, so that the message processing method can have high concurrency and high throughput capabilities, and is more suitable for large-scale message processing environments.

[0088] Figure 6 A flowchart of a message processing method provided by another embodiment of the present disclosure.

[0089] like Figure 6 As shown, the message processing method may include:

[0090] Step 601: The message generator determines the identification ID and first timeout information of the first message to be sent.

[0091] Step 602: Send an index generation request to the message timeout detection service.

[0092] Step 603: The message timeout detection service generates a first message index based on the first timeout information in the index generation request, and associates and stores the first message index with the first message ID.

[0093] Step 604: The message producer sends the first message to the message consumer.

[0094] Step 605: The message consumer sends a message timeout detection request to the message timeout detection service.

[0095] Step 606: The message timeout detection service retrieves and obtains the first message index of the first message based on the first message ID in the message timeout detection request, and determines the timeout detection result according to the first timeout information in the first message index.

[0096] Step 607: Send the timeout detection result to the message consumer.

[0097] The specific implementation forms of the above steps 601 to 607 can refer to the above embodiments of the present disclosure and will not be repeated here.

[0098] In this embodiment, after the message generator determines the identification ID and the first timeout information of the first message to be sent, it sends an index generation request to the message timeout detection service. Then the message timeout detection service generates a first message index based on the first timeout information in the index generation request, and stores the first message index in association with the first message ID. The message producer sends the first message to the message consumer. After that, the message consumer sends a message timeout detection request to the message timeout detection service. The message timeout detection service retrieves and obtains the first message index of the first message based on the first message ID in the message timeout detection request. Then, according to the first timeout information in the first message index, it determines the timeout detection result and sends the timeout detection result to the message consumer. In this way, by creating a message index, it is possible to detect whether the message has timed out according to the timeout information, thereby ensuring the timeliness and security of the message data. The message processing method avoids modifying the original message structure when detecting a message timeout, has good reusability, improves the efficiency of message processing, and can adapt to large-scale message processing scenarios.

[0099] In order to implement the above embodiment, the present disclosure also proposes a message processing device.

[0100] Figure 7 A schematic diagram of the structure of a message processing device provided by an embodiment of the present disclosure.

[0101] like Figure 7 As shown, the message processing device 700 is configured in the message timeout detection service. It may include:

[0102] The first receiving module 701 is used to receive a message timeout detection request sent by a message consumer, wherein the detection request includes an identification ID of the first message;

[0103] A first acquisition module 702 is used to retrieve and acquire a first message index of the first message based on the ID of the first message, wherein the first message index includes first timeout information;

[0104] A first determining module 703, configured to determine a timeout detection result according to first timeout information;

[0105] The first sending module 704 is used to send the timeout detection result to the consumer.

[0106] In some embodiments, the first determining module 703 may also be used to:

[0107] The stored ID and first timeout information of the first message are deleted.

[0108] In some embodiments, the first receiving module 701 may also be used for:

[0109] Receive an index generation request sent by a message producer, wherein the index generation request includes a first message ID and first timeout information;

[0110] Based on the first timeout information, generate a first message index;

[0111] The first message index is associated with the first message ID and stored.

[0112] In some embodiments, the first receiving module 701 may also be used for:

[0113] Determine, according to the first time period to which the first timeout information belongs, the first message set to which the first message index belongs;

[0114] The first message index and the first message ID are associated and stored in the first message set.

[0115] In some embodiments, the message processing device 700 may further include:

[0116] When a second time period associated with the second message set is reached, detecting each message index in the second message set;

[0117] When the second timeout information corresponding to the second message index is reached, a message timeout processing indication is sent to the message consumer associated with the second message index, wherein the message timeout processing indication includes the second message ID associated with the second message index;

[0118] Delete the second message index and the second message ID in the second message set.

[0119] In some embodiments, the message processing device 700 may further include:

[0120] When the second time period ends, sending a message timeout processing indication to a message consumer associated with each message index in the second message set;

[0121] Delete the second message set.

[0122] It should be noted that the above explanation of the message processing method embodiment is also applicable to the message processing device in this embodiment, and will not be repeated here.

[0123] In this embodiment, after receiving the message timeout detection request sent by the message consumer, the message timeout detection service retrieves and obtains the first message index of the first message based on the ID of the first message, and then determines the timeout detection result based on the first timeout information included in the first message index, and sends the timeout detection result to the message consumer. Thus, the timeout of the first message can be determined based on the message index to determine whether the first message has timed out. This message processing method avoids modifying the original message structure when detecting a message timeout, has good reusability, improves the efficiency of message processing, has high concurrency and high throughput capabilities, can adapt to large-scale message processing scenarios, and occupies less system memory, which can reduce hardware costs.

[0124] Figure 8 A schematic diagram of the structure of a message processing device provided by another embodiment of the present disclosure.

[0125] like Figure 8 As shown, the message processing device 800 is configured on the message consumer side. It may include:

[0126] The second receiving module 801 is used to receive a first message, wherein the first message includes an identification ID of the first message;

[0127] The second sending module 802 is used to send a message timeout detection request to the message timeout detection service, wherein the detection request includes the ID of the first message;

[0128] The third receiving module 803 is used to receive a timeout detection result sent by a message timeout detection service, wherein the timeout detection result is used to indicate whether the first message has timed out.

[0129] In some embodiments, the third receiving module 803 may also be used for:

[0130] Receiving a message timeout processing indication sent by a message timeout detection service, wherein the message timeout processing indication includes a second message ID;

[0131] Perform timeout processing on the second message associated with the second message ID.

[0132] It should be noted that the above explanation of the message processing method embodiment is also applicable to the message processing device in this embodiment, and will not be repeated here.

[0133] In this embodiment, after receiving the first message, the message consumer first sends a message timeout detection request containing the first message ID to the message timeout detection service, and then receives the timeout detection result returned by the message timeout detection service, and performs corresponding processing operations according to the timeout detection result, so that the timeout status of the first message can be determined in an active or passive manner, thereby ensuring the security of the message data, avoiding the processing of invalid messages, and improving the message processing efficiency of the message consumer.

[0134] Fig. 9 A schematic diagram of the structure of a message processing device provided by another embodiment of the present disclosure.

[0135] like Fig. 9 As shown, the message processing device 900 is configured on the message generating side. It may include:

[0136] The second determination module 901 is used to determine the identification ID and first timeout information of the first message to be sent;

[0137] The third sending module 902 is used to send an index generation request to the message timeout detection service, wherein the index generation request includes the first message ID and the first timeout information;

[0138] The fourth sending module 903 is used to send the first message.

[0139] It should be noted that the above explanation of the message processing method embodiment is also applicable to the message processing device in this embodiment, and will not be repeated here.

[0140] In this embodiment, the message producer first determines the identification ID and the first timeout information of the first message to be sent, and then sends an index generation request including the first message ID and the first timeout information to the message timeout detection service, and then sends the first message for processing, thereby improving the timeout detection efficiency of the message by generating the corresponding message index before processing the message, so that the message processing method can have high concurrency and high throughput capabilities, and is more suitable for large-scale message processing environments.

[0141] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0142] Fig.10A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0143] like Fig.10 As shown, the electronic device 1000 may include a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0144] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0145] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as message processing methods. For example, in some embodiments, the message processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the message processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform a method for generating a template in any other appropriate manner (e.g., by means of firmware).

[0146] Various implementations of the devices and techniques described above herein can be implemented in digital electronic circuit devices, integrated circuit devices, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), devices on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable device including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage device, at least one input device, and at least one output device, and transmit data and instructions to the storage device, the at least one input device, and the at least one output device.

[0147] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable message processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0148] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution device, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor devices, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0149] To provide interaction with a user, the devices and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0150] The apparatus and techniques described herein may be implemented in a computing device including backend components (e.g., as a data server), or a computing device including middleware components (e.g., an application server), or a computing device including frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the apparatus and techniques described herein), or a computing device including any combination of such backend components, middleware components, or frontend components. The components of the apparatus may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0151] A computer device may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud service server or a cloud host, which is a host product in the cloud service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may be a cloud server, or a server of a distributed device, or a server combined with a blockchain.

[0152] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0153] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A message processing method, characterized in that: The method is performed by a message timeout detection service, and the method comprises: Receiving a message timeout detection request sent by a message consumer, wherein the detection request includes an identification ID of the first message; Based on the ID of the first message, retrieve and obtain a first message index of the first message, wherein the first message index includes first timeout information; Determine a timeout detection result according to the first timeout time information; Sending the timeout detection result to the consumer; Before receiving the message timeout detection request sent by the message consumer, the method further includes: Receiving an index generation request sent by a message producer, wherein the index generation request includes the first message ID and first timeout information; Based on the first timeout information, generate the first message index; The first message index is associated with the first message ID and stored.

2. The method according to claim 1, characterized in that After determining the timeout detection result according to the first timeout time information, the method further includes: Delete the stored ID of the first message and the first timeout information.

3. The method according to claim 1, characterized in that The associating and storing the first message index with the first message ID includes: Determine, according to the first time period to which the first timeout information belongs, the first message set to which the first message index belongs; The first message index and the first message ID are associated and stored in the first message set.

4. The method according to claim 3, characterized in that Also includes: When a second time period associated with a second message set is reached, detecting each message index in the second message set; When the second timeout information corresponding to the second message index is reached, sending a message timeout processing indication to the message consumer associated with the second message index, wherein the message timeout processing indication includes the second message ID associated with the second message index; Delete the second message index and the second message ID in the second message set.

5. The method according to claim 4, characterized in that Also includes: When the second time period ends, sending a message timeout processing indication to a message consumer associated with each message index in the second message set; Delete the second message set.

6. A message processing method, characterized in that: The method is executed by a message consumer, and the method includes: Receiving a first message, wherein the first message includes an identification ID of the first message; Sending a message timeout detection request to a message timeout detection service, wherein the detection request includes the ID of the first message; Receive a timeout detection result sent by the message timeout detection service, wherein the timeout detection result is used to indicate whether the first message has timed out.

7. The method according to claim 6, characterized in that Also includes: Receiving a message timeout processing indication sent by the message timeout detection service, wherein the message timeout processing indication includes a second message ID; Perform timeout processing on the second message associated with the second message ID.

8. A message processing method, characterized in that: The method is performed by a message producer, and includes: Determine an identification ID and first timeout information of a first message to be sent; Sending an index generation request to a message timeout detection service, wherein the index generation request includes a first message ID and first timeout information; sending the first message; The method further comprises: Send each of the first message IDs and the first timeout information to the message timeout detection service to generate a message index, so that the message timeout detection service can monitor the timeout status of each of the first messages in real time according to the message processing method described in any one of claims 1-5.

9. A message processing device, characterized in that: The device is configured in a message timeout detection service, and the device includes: A first receiving module, configured to receive a message timeout detection request sent by a message consumer, wherein the detection request includes an identification ID of the first message; A first acquisition module, configured to retrieve and acquire a first message index of the first message based on the ID of the first message, wherein the first message index includes first timeout information; A first determining module, used to determine a timeout detection result according to the first timeout time information; A first sending module, used for sending the timeout detection result to the consumer; Before receiving the message timeout detection request sent by the message consumer, the method further includes: Receiving an index generation request sent by a message producer, wherein the index generation request includes the first message ID and first timeout information; Based on the first timeout information, generate the first message index; The first message index is associated with the first message ID and stored.

10. A message processing device, characterized in that: The device is configured on the message consumer side, and the device includes: A second receiving module, configured to receive a first message, wherein the first message includes an identification ID of the first message; A second sending module, configured to send a message timeout detection request to a message timeout detection service, wherein the detection request includes an ID of the first message; The third receiving module is used to receive a timeout detection result sent by the message timeout detection service, wherein the timeout detection result is used to indicate whether the first message has timed out.

11. A message processing device, characterized in that: The device is configured on the message production side, and the device includes: A second determination module, used to determine an identification ID and first timeout information of a first message to be sent; A third sending module is used to send an index generation request to the message timeout detection service, wherein the index generation request includes a first message ID and first timeout information; A fourth sending module, configured to send the first message; The device also includes: Send each of the first message IDs and the first timeout information to the message timeout detection service to generate a message index, so that the message timeout detection service can monitor the timeout status of each of the first messages in real time according to the message processing method described in any one of claims 1-5.

12. An electronic device, characterized in that: include at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message processing method according to any one of claims 1 to 5.

13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the message processing method according to any one of claims 1 to 8 is implemented.

14. A computer program product comprising a computer program which, when executed by a processor, Implement the message processing method as described in any one of claims 1-8.