CN117156398A - Message processing method, device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN117156398A
CN117156398A CN202310985367.2A CN202310985367A CN117156398A CN 117156398 A CN117156398 A CN 117156398A CN 202310985367 A CN202310985367 A CN 202310985367A CN 117156398 A CN117156398 A CN 117156398A
Authority
CN
China
Prior art keywords
message
timeout
index
time information
consumer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310985367.2A
Other languages
Chinese (zh)
Inventor
江继针
胡文辉
吴华挚
苏儒
孙立军
宁志刚
林德煜
梁祯夏
阮晓军
陈泽森
李高正
林锦荣
吴政
万倩茹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Internet Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Internet Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Internet Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202310985367.2A priority Critical patent/CN117156398A/en
Publication of CN117156398A publication Critical patent/CN117156398A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1848Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/188Time-out mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a message processing method, a message processing device, electronic equipment and a storage medium, and relates to the technical field of message communication services. Comprising the following steps: the message timeout detection service receives a message timeout detection request sent by a message consumer, wherein the detection request comprises an identification ID of a first message; retrieving and acquiring a first message index of the first message based on the ID of the first message, wherein the first message index contains first timeout time information; and determining a timeout detection result according to the first timeout time information, and sending the timeout detection result to the message consumer. Therefore, the overtime time of the first message can be determined based on the message index to judge whether the first message overtime, and the method avoids modifying the original message structure when detecting the message overtime, has better reusability, improves the message processing efficiency, has high concurrency and high throughput capacity, can adapt to a large-scale message processing scene, occupies less system memory and can reduce the hardware cost.

Description

Message processing method, device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of messaging services, and in particular relates to a message processing method, a device, electronic equipment and a storage medium.
Background
The message timeout control is one of the core functions of basic message communication services such as short messages, 5G messages and the like or a message driving software architecture, and whether the timeout detection is timely and accurate or not can possibly influence the development of business, so that a message timeout detection method with more efficiency and wider application range is needed to process various types of messages.
Disclosure of Invention
The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art.
An embodiment of a first aspect of the present disclosure proposes a message processing method, performed by a message timeout detection service, the method comprising: receiving a message timeout detection request sent by a message consumer, wherein the detection request comprises an identification ID of a first message; retrieving and acquiring a first message index of the first message based on the ID of the first message, wherein the first message index contains first timeout time information; determining a timeout detection result according to the first timeout time information; and sending the overtime detection result to the consumer.
In a second aspect of the present disclosure, there is provided a message processing method performed by a message consumer, the method comprising: receiving a first message, wherein the first message comprises an identification ID of the first message; sending a message timeout detection request to a message timeout detection service, wherein the detection request comprises an ID of the first message; and receiving a timeout detection result sent by the message timeout detection service, wherein the timeout detection result is used for indicating whether the first message has timed out.
In a third aspect of the present disclosure, there is provided a message processing method performed by a message generator, the method including: determining an identification ID of a first message to be sent and first timeout time information; sending an index generation request to a message timeout detection service, wherein the index generation request comprises a first message ID and first timeout time information; and sending the first message.
An embodiment of a fourth aspect of the present disclosure provides a message processing apparatus configured in a message timeout detection service, the apparatus including: the first receiving module is used for receiving a message overtime detection request sent by a message consumer, wherein the detection request comprises an identification ID of a first message; the first acquisition module is used for searching and acquiring a first message index of the first message based on the ID of the first message, wherein the first message index contains first timeout time information; the first determining module is used for determining a timeout detection result according to the first timeout time information; and the first sending module is used for sending the overtime detection result to the consumer.
In a fifth aspect of the present disclosure, there is provided a message processing apparatus configured on a message consumer, the apparatus including: the second receiving module is used for receiving a first message, wherein the first message comprises 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, where the detection request includes an ID of the first message; and a third receiving module, configured to receive a timeout detection result sent by the message timeout detection service, where the timeout detection result is used to indicate whether the first message has timed out.
A sixth aspect of the present disclosure provides a message processing apparatus configured on a message generator, the apparatus including: the second determining module is used for determining the identification ID of the first message to be sent and the first timeout time information; a third sending module, configured to send an index generation request to a message timeout detection service, where the index generation request includes a first message ID and first timeout time information; and the fourth sending module is used for sending the first message.
An embodiment of a seventh aspect of the present disclosure proposes an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to implement a message processing method as set forth in embodiments of the present disclosure.
An eighth aspect of the present disclosure proposes a computer readable storage medium storing a computer program which, when executed by a processor, implements a message processing method as proposed by the embodiments of the present disclosure.
An embodiment of a ninth aspect of the present disclosure proposes a computer program product comprising a computer program which, when executed by a processor, implements a message processing method as proposed by an embodiment of the present disclosure.
The message processing method, the device, the electronic equipment and the storage medium provided by the disclosure have the following beneficial effects:
in the present disclosure, after receiving a message timeout detection request sent by a message consumer, a message timeout detection service retrieves and acquires a first message index of a first message based on an ID of the first message, then determines a timeout detection result according to first timeout time information included in the first message index, and sends the timeout detection result to the message consumer. Therefore, the overtime time of the first message can be determined based on the message index to judge whether the first message overtime, and the message processing method avoids modifying the original message structure when detecting the message overtime, has better reusability, improves the message processing efficiency, has high concurrent high throughput capability, can adapt to a large-scale message processing scene, occupies less system memory and can reduce the hardware cost.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
fig. 1 is a flow chart of a message processing method according to an embodiment of the disclosure;
FIG. 2 is a flow chart of a message processing method according to another embodiment of the present disclosure;
FIG. 3 is a flow chart of a message processing method according to another embodiment of the present disclosure;
FIG. 4 is a flow chart of a message processing method according to another embodiment of the present disclosure;
FIG. 5 is a flow chart of a message processing method according to another embodiment of the present disclosure;
fig. 6 is a signaling interaction diagram of a message processing method according to another embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a message processing apparatus according to an embodiment of the disclosure;
fig. 8 is a schematic structural diagram of a message processing apparatus according to another embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a message processing apparatus according to another embodiment of the present disclosure;
fig. 10 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure.
The message processing method in the embodiment of the disclosure may be executed by the message processing apparatus in the embodiment of the disclosure, and the apparatus may be applied to any electronic device to implement a function of processing the detected timeout message. The electronic device may be any device with computing capability, for example, may be a hardware device with various operating systems, touch screens, and/or display screens, such as a mobile phone, a tablet computer, a personal computer, and a personal digital assistant, which is not limited in this disclosure.
Message processing methods, apparatuses, electronic devices, and storage media of embodiments of the present disclosure are described below with reference to the accompanying drawings.
Fig. 1 is a flow chart of a message processing method according to an embodiment of the disclosure.
As shown in fig. 1, the message processing method, which is performed by the message timeout detection service, may include:
Step 101, receiving a message timeout detection request sent by a message consumer, wherein the detection request comprises an identification ID of a first message.
The message consumer refers to a module for acquiring a message from a message queue or a message middleware and the like and executing corresponding service logic processing according to the content of the message. The identification ID of the first message refers to a value capable of uniquely identifying a message, typically automatically generated by a message service or application, and assigned with the message when the message is sent, and may be a string, integer, etc., or other suitable data type, which is not limited by this disclosure.
Step 102, retrieving and acquiring 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.
The first timeout information may refer to a natural time, represented by a long integer value, and may include time zone and specific time information. The first message index is a data structure that can be used to quickly poll the relevant data of the first message, such as the first timeout information of the first message, etc.
In the embodiment of the disclosure, the message timeout detection service may acquire the first message ID and the first timeout time information in advance to generate a first message index, store the first message index and the first message ID in a message index table in association, and then, after receiving the 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 time information of the first message from the retrieved first message index.
Step 103, determining a timeout detection result according to the first timeout time information.
In the embodiment of the disclosure, the message timeout detection service may acquire current time information, compare the current time information with the first timeout time information, and obtain a timeout detection result, if the current time information is after the first timeout time information, then it may be determined that the timeout detection result of the first message is timeout, otherwise, the timeout detection result of the first message is not timeout.
Alternatively, the message timeout detection service may delete the stored first message ID and the first timeout time information after determining the timeout detection result.
In the embodiment of the disclosure, after the timeout detection result of the first message is determined, the first message is processed by the message consumer and is deleted from the message queue to be processed, so that the message timeout detection service can delete the stored first message ID and the first timeout time information, release the storage space, and improve the retrieval efficiency of the message index.
And step 104, sending a timeout detection result to the message consumer.
In the embodiment of the disclosure, 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 operation on the first message according to the detection result.
In this embodiment, after receiving a message timeout detection request sent by a message consumer, the message timeout detection service retrieves and acquires a first message index of a first message based on an ID of the first message, then determines a timeout detection result according to first timeout time information included in the first message index, and sends the timeout detection result to the message consumer. Therefore, the overtime time of the first message can be determined based on the message index to judge whether the first message overtime, and the message processing method avoids modifying the original message structure when detecting the message overtime, has better reusability, improves the message processing efficiency, has high concurrent high throughput capability, can adapt to a large-scale message processing scene, occupies less system memory and can reduce the hardware cost.
Fig. 2 is a flow chart of a message processing method according to another embodiment of the disclosure.
As shown in fig. 2, the message processing method, which is performed by the message timeout detection service, may include:
step 201, receiving an index generation request sent by a message producer, wherein the index generation request includes a first message ID and first timeout information.
Where a message producer refers to a module that produces a message and sends it to a message queue or message middleware.
Step 202, a first message index is generated based on the first timeout information.
In the embodiment of the disclosure, the message timeout detection service may sort the first messages according to the first timeout time information, and generate the first message index according to the timeout time corresponding to the first messages.
Step 203, determining a first message set to which the first message index belongs according to a first time period to which the first timeout information belongs.
In the disclosure, each first message set corresponds to a first time period, 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 period may be a fixed time length interval, or may be a time length determined according to practical situations, such as a degree of density of timeout time information, which is not limited in the disclosure.
In the embodiment of the disclosure, since each first message set corresponds to one first time period, the message timeout detection service may determine, according to a time interval in which the first timeout time information is located, only one corresponding first time period, so that all first message indexes are respectively divided into different first message sets by the determined first time period.
Step 204, the first message index and the first message ID are associated and stored in the first message set.
In this embodiment, the message timeout detection service receives an index generation request sent by a message producer, where the index generation request includes a first message ID and first timeout time information, and then generates a first message index based on the first timeout time information, determines a first message set to which the first message index belongs according to a first time period to which the first timeout time information belongs, and stores the first message index and the first message ID in association with the first message set. Therefore, the message timeout detection service can generate the message index at any time based on the message ID and the timeout time information thereof, thereby guaranteeing the real-time property of the update of the message index and the integrity of the detection information, dividing the message index into different sets according to the belonged time period, improving the management efficiency of the message timeout information and providing conditions for improving the efficiency of message processing.
Fig. 3 is a flow chart of a message processing method according to another embodiment of the disclosure.
As shown in fig. 3, the message processing method, which is performed by the message timeout detection service, may include:
Step 301, detecting each message index in the second message set if a second time period associated with the second message set has arrived.
The second message set is any one of the first message sets stored in the timeout detection service.
In the embodiment of the disclosure, the message timeout detection service may monitor a plurality of stored first message sets, and when it is monitored that the current time is the start time of the second time period associated with the second message set, timeout detection may be sequentially performed on each message index in the second message set, or may also be performed on a plurality of message indexes at the same time.
Step 302, when the second timeout time information corresponding to the second message index is reached, sending a message timeout processing instruction 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.
Wherein the second message index may be any one or more message indexes contained in the second message set.
When the second timeout information corresponding to the plurality of second message indexes arrives at the same time, the message timeout detection service may sequentially send the message timeout processing instruction to the associated message consumer, or may also send the message timeout processing instruction synchronously, which is not limited in this disclosure.
In the embodiment of the disclosure, when the message timeout detection service detects 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 may be determined, and the second message ID is sent to the message consumer associated with the message queue or the message middleware in which the second message is located according to the second message, to indicate that the second message is timeout.
Step 303, deleting the second message index and the second message ID in the second message set.
Step 304, in the event that the second time period ends, sending a message timeout process indication to the message consumer associated with each message index in the second set of messages.
In the embodiment of the disclosure, when the message timeout detection service detects that the current time is the maximum time in the second time period, it may be determined that all second messages associated with the second message indexes in the second message set have been timed out, so that a message consumer associated with each message index may be indicated to perform timeout processing on the corresponding second message.
Step 305, deleting the second set of messages.
In this embodiment, when a 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, then sends a message timeout processing instruction to a message consumer associated with the second message index when second timeout time information corresponding to the second message index is reached, where the message timeout processing instruction includes a second message ID associated with the second message index, then deletes the second message index and the second message ID in the second message set, and then sends a message timeout processing instruction to the message consumer associated with each message index in the second message set when the second time period is over, and deletes the second message set. Therefore, the message timeout service can monitor the message set according to the time information, actively perform the message timeout detection operation, improve the message processing efficiency, ensure the timeliness of timeout message processing, and perform batch detection on the messages through the message set, so that the message processing method is more suitable for a large-scale message processing environment and is more practical.
Fig. 4 is a flowchart of a message processing method according to another embodiment of the present disclosure.
As shown in fig. 4, the message processing method, executed by a message consumer, may include:
step 401, a first message is received, wherein the first message includes an identification ID of the first message.
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 the message middleware, which is not limited in this disclosure.
Step 402, a message timeout detection request is sent to a message timeout detection service, wherein the detection request includes an ID of a first message.
In the embodiment of the disclosure, after the message consumer acquires the first message, because the first message may have conditions of reduced data security, failure and the like caused by timeout, a message timeout detection request needs to be sent to a message timeout detection service to determine whether the first message is timeout, so that the security of message data is ensured, the processing of invalid messages is avoided, and the message processing efficiency of the message consumer is improved.
Step 403, receiving a timeout detection result sent by the message timeout detection service, where the timeout detection result is used to indicate whether the first message has timed out.
In the embodiment of the disclosure, the message consumer may take corresponding processing operation on the first message according to the timeout detection result. For example, in the case that the timeout detection result indicates that the timeout has occurred, the message consumer may determine any one of the following processing manners according to the actual situation: determining that the first message is invalid, directly ignoring or discarding; the first message is returned to the message generator, and the message queue is rejoined after the first timeout time information is modified; the first message is marked as timeout, and the reservation facilitates subsequent analysis. Alternatively, in the event that the timeout detection result indicates that the timeout has not occurred, the message consumer may execute business logic associated with the first message based on the content of the first message.
In the embodiment of the disclosure, the message consumer may also receive a message timeout processing instruction sent by the message timeout detection service without sending a message timeout detection request to the message timeout detection service, where the message timeout processing instruction includes a second message ID, and then may timeout process a second message associated with the second message ID.
In this embodiment, after receiving the first message, the message consumer first sends a message timeout detection request including the first message ID to the message timeout detection service, then receives a timeout detection result returned by the message timeout detection service, and performs a corresponding processing operation according to the timeout detection result, so that a timeout condition of the first message can be determined in an active or passive manner, thereby ensuring the security of message data, avoiding processing of invalid messages, and improving the message processing efficiency of the message consumer.
Fig. 5 is a flowchart of a message processing method according to another embodiment of the present disclosure.
As shown in fig. 5, the message processing method, which is executed by a message producer, may include:
step 501, determining an identification ID and first timeout information of a first message to be sent.
In the embodiment of the present disclosure, after generating the first message, the message producer may determine, according to a preset rule, an ID of the first message to be sent and processed, and may determine, according to a memory size occupied by the message, a validity period of message data, and so on, first timeout time information of the first message, which is not limited in this disclosure.
Step 502, an index generation request is sent to a message timeout detection service, wherein the index generation request includes a first message ID and first timeout time information.
In the embodiment of the disclosure, the message producer can send each first message ID and the first timeout time information to the message timeout detection service to generate the message index, so that the timeout condition of each first message can be monitored in real time conveniently.
Step 503, send a first message.
In the embodiment of the present disclosure, the message producer may directly send the first message to be processed to the message consumer, or may also send the first message to a message queue or a message middleware associated with the message consumer, which is not limited in this disclosure.
In this embodiment, the message producer first determines the ID of the first message to be sent and the first timeout information, 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 to process, so that the timeout detection efficiency of the message is improved by generating the corresponding message index before processing the message, so that the message processing method can have high concurrency and high throughput, and is more suitable for a large-scale message processing environment.
Fig. 6 is a flowchart of a message processing method according to another embodiment of the present disclosure.
As shown in fig. 6, the message processing method may include:
in step 601, the message generator determines an identification ID and first timeout information of a first message to be sent.
Step 602, an index generation request is sent to a message timeout detection service.
In step 603, the message timeout detection service generates a first message index based on the first timeout time information in the index generation request, and stores the first message index in association with the first message ID.
The message producer sends a first message to the message consumer, step 604.
In step 605, the message consuming sends a message timeout detection request to the message timeout detection service.
In step 606, the message timeout detection service retrieves and obtains a first message index of the first message based on the first message ID in the message timeout detection request, and determines a timeout detection result according to the first timeout time information in the first message index.
Step 607, send the timeout detection result to the message consumer.
For specific implementation manners of the steps 601 to 607, reference may be made to the foregoing embodiments of the disclosure, which are not described herein.
In this embodiment, after determining the ID of the first message to be sent and the first timeout information, the message generator 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, and the message producer sends the first message to the message consumer, and then the message consumer sends a message timeout detection request to the message timeout detection service, then the message timeout detection service retrieves and acquires the first message index of the first message based on the first message ID in the message timeout detection request, then determines a timeout detection result according to the first timeout information in the first message index, and sends the timeout detection result to the message consumer. Therefore, whether the message overturns or not can be detected by creating the message index according to the overtime information, and the timeliness and the safety of the message data are ensured.
In order to implement the above embodiment, the present disclosure also proposes a message processing apparatus.
Fig. 7 is a schematic structural diagram of a message processing apparatus according to an embodiment of the disclosure.
As shown in fig. 7, the message processing apparatus 700 is configured in a message timeout detection service. May include:
a first receiving module 701, configured to receive a message timeout detection request sent by a message consumer, where the detection request includes an identification ID of a first message;
a first obtaining module 702, configured to retrieve and obtain a first message index of a first message based on an ID of the first message, where the first message index includes first timeout information;
a first determining module 703, configured to determine a timeout detection result according to the first timeout time information;
a first sending module 704, configured to send the timeout detection result to the consumer.
In some embodiments, the first determining module 703 may be further configured to:
the stored ID of the first message and the first timeout information are deleted.
In some embodiments, the first receiving module 701 may be further configured to:
receiving an index generation request sent by a message producer, wherein the index generation request comprises a first message ID and first timeout time information;
Generating a first message index based on the first timeout time information;
the first message index is stored in association with the first message ID.
In some embodiments, the first receiving module 701 may be further configured to:
determining a first message set to which a first message index belongs according to a first time period to which first timeout time information belongs;
the first message index and the first message ID are associated and stored in a first message set.
In some embodiments, the message processing apparatus 700 may further include:
detecting each message index in the second message set if a second time period associated with the second message set is reached;
sending a message timeout processing instruction to a message consumer associated with the second message index under the condition that second timeout time information corresponding to the second message index is reached, wherein the message timeout processing instruction comprises a second message ID associated with the second message index;
and deleting the second message index and the second message ID in the second message set.
In some embodiments, the message processing apparatus 700 may further include:
sending a message timeout process indication to the message consumer associated with each message index in the second set of messages if the second time period ends;
The second set of messages is deleted.
It should be noted that the foregoing explanation of the embodiment of the message processing method is also applicable to the message processing apparatus in this embodiment, and will not be repeated here.
In this embodiment, after receiving a message timeout detection request sent by a message consumer, the message timeout detection service retrieves and acquires a first message index of a first message based on an ID of the first message, then determines a timeout detection result according to first timeout time information included in the first message index, and sends the timeout detection result to the message consumer. Therefore, the overtime time of the first message can be determined based on the message index to judge whether the first message overtime, and the message processing method avoids modifying the original message structure when detecting the message overtime, has better reusability, improves the message processing efficiency, has high concurrent high throughput capability, can adapt to a large-scale message processing scene, occupies less system memory and can reduce the hardware cost.
Fig. 8 is a schematic structural diagram of a message processing apparatus according to another embodiment of the present disclosure.
As shown in fig. 8, the message processing apparatus 800 is configured at a message consumer. May include:
A second receiving module 801, configured to receive a first message, where the first message includes an identification ID of the first message;
a second sending module 802, configured to send a message timeout detection request to a message timeout detection service, where the detection request includes an ID of the first message;
a third receiving module 803, configured to receive a timeout detection result sent by the message timeout detection service, where the timeout detection result is used to indicate whether the first message has timed out.
In some embodiments, the third receiving module 803 may be further configured to;
receiving a message timeout processing instruction sent by a message timeout detection service, wherein the message timeout processing instruction comprises a second message ID;
and carrying out timeout processing on the second message associated with the second message ID.
It should be noted that the foregoing explanation of the embodiment of the message processing method is also applicable to the message processing apparatus in this embodiment, and will not be repeated here.
In this embodiment, after receiving the first message, the message consumer first sends a message timeout detection request including the first message ID to the message timeout detection service, then receives a timeout detection result returned by the message timeout detection service, and performs a corresponding processing operation according to the timeout detection result, so that a timeout condition of the first message can be determined in an active or passive manner, thereby ensuring the security of message data, avoiding processing of invalid messages, and improving the message processing efficiency of the message consumer.
Fig. 9 is a schematic structural diagram of a message processing apparatus according to another embodiment of the present disclosure.
As shown in fig. 9, the message processing apparatus 900 is disposed on the message generator side. May include:
a second determining module 901, configured to determine an ID of a first message to be sent and first timeout information;
a third sending module 902, configured to send an index generation request to a message timeout detection service, where the index generation request includes a first message ID and first timeout time information;
a fourth sending module 903, configured to send the first message.
It should be noted that the foregoing explanation of the embodiment of the message processing method is also applicable to the message processing apparatus in this embodiment, and will not be repeated here.
In this embodiment, the message producer first determines the ID of the first message to be sent and the first timeout information, 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 to process, so that the timeout detection efficiency of the message is improved by generating the corresponding message index before processing the message, so that the message processing method can have high concurrency and high throughput, and is more suitable for a large-scale message processing environment.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 10 shows a schematic block diagram of an example electronic device 1000 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the electronic device 1000 may include a computing unit 1001 that may 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 by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Various components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and communication unit 1009 such as a network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, for example, a message processing method. For example, in some embodiments, the message processing method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communication unit 1009. When a computer program is loaded into RAM 1003 and executed by 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 the template generation method in any other suitable way (e.g., by means of firmware).
Various implementations of the apparatus and techniques described here above may 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), on-chip device devices (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on programmable devices including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, operable to receive data and instructions from, and to transmit data and instructions to, a storage device, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable message processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution apparatus, device, or apparatus. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor apparatus, device, or apparatus, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the apparatus and techniques described here 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 a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The apparatus and techniques described here may be implemented in a computing device that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the apparatus and techniques described here), or any combination of such background, middleware, or front-end 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: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer device may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called as a cloud service server or a cloud host, and is a host product in a cloud service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual Private Server" or simply "VPS"). The server may be a cloud server, a server of a distributed device, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (15)

1. A method of message processing, the method performed by a message timeout detection service, the method comprising:
receiving a message timeout detection request sent by a message consumer, wherein the detection request comprises an identification ID of a first message;
retrieving and acquiring a first message index of the first message based on the ID of the first message, wherein the first message index contains first timeout time information;
Determining a timeout detection result according to the first timeout time information;
and sending the overtime detection result to the consumer.
2. The method of claim 1, further comprising, after said determining a timeout detection result based on said first timeout time information:
and deleting the stored ID of the first message and the first timeout time information.
3. The method of claim 1 or 2, further comprising, prior to receiving the message timeout detection request sent by the message consumer:
receiving an index generation request sent by a message producer, wherein the index generation request comprises the first message ID and first timeout time information;
generating the first message index based on the first timeout time information;
and storing the first message index in association with the first message ID.
4. The method of claim 3, wherein the storing the first message index in association with the first message ID comprises:
determining a first message set to which the first message index belongs according to a first time period to which the first timeout time information belongs;
The first message index and the first message ID are associated and stored in the first message set.
5. The method as recited in claim 4, further comprising:
detecting each message index in a second set of messages upon reaching a second time period associated with the second set of messages;
sending a message timeout processing instruction to a message consumer associated with a second message index under the condition that second timeout time information corresponding to the second message index is reached, wherein the message timeout processing instruction comprises a second message ID associated with the second message index;
deleting the second message index and the second message ID in the second message set.
6. The method as recited in claim 5, further comprising:
sending a message timeout process indication to a message consumer associated with each message index in the second set of messages if the second time period ends;
deleting the second set of messages.
7. A method of message processing, the method performed by a message consumer, the method comprising:
receiving a first message, wherein the first message comprises an identification ID of the first message;
Sending a message timeout detection request to a message timeout detection service, wherein the detection request comprises an ID of the first message;
and receiving a timeout detection result sent by the message timeout detection service, wherein the timeout detection result is used for indicating whether the first message has timed out.
8. The method as recited in claim 7, further comprising:
receiving a message timeout processing instruction sent by the message timeout detection service, wherein the message timeout processing instruction comprises a second message ID;
and carrying out timeout processing on the second message associated with the second message ID.
9. A method of message processing, the method performed by a message producer, the method comprising:
determining an identification ID of a first message to be sent and first timeout time information;
sending an index generation request to a message timeout detection service, wherein the index generation request comprises a first message ID and first timeout time information;
and sending the first message.
10. A message processing apparatus, the apparatus being configured in a message timeout detection service, the apparatus comprising:
the first receiving module is used for receiving a message overtime detection request sent by a message consumer, wherein the detection request comprises an identification ID of a first message;
The first acquisition module is used for searching and acquiring a first message index of the first message based on the ID of the first message, wherein the first message index contains first timeout time information;
the first determining module is used for determining a timeout detection result according to the first timeout time information;
and the first sending module is used for sending the overtime detection result to the consumer.
11. A message processing apparatus, the apparatus configured at a message consumer, the apparatus comprising:
the second receiving module is used for receiving a first message, wherein the first message comprises 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, where the detection request includes an ID of the first message;
and a third receiving module, configured to receive a timeout detection result sent by the message timeout detection service, where the timeout detection result is used to indicate whether the first message has timed out.
12. A message processing apparatus, the apparatus being configured at a message producer, the apparatus comprising:
the second determining module is used for determining the identification ID of the first message to be sent and the first timeout time information;
A third sending module, configured to send an index generation request to a message timeout detection service, where the index generation request includes a first message ID and first timeout time information;
and the fourth sending module is used for sending the first message.
13. An electronic device, comprising
At least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message processing method of any one of claims 1-6.
14. A computer readable storage medium storing a computer program, which when executed by a processor implements a message processing method according to any one of claims 1-9.
15. A computer program product comprising a computer program which, when executed by a processor, implements a message processing method as claimed in any one of claims 1 to 9.
CN202310985367.2A 2023-08-04 2023-08-04 Message processing method, device, electronic equipment and storage medium Pending CN117156398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310985367.2A CN117156398A (en) 2023-08-04 2023-08-04 Message processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310985367.2A CN117156398A (en) 2023-08-04 2023-08-04 Message processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117156398A true CN117156398A (en) 2023-12-01

Family

ID=88910990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310985367.2A Pending CN117156398A (en) 2023-08-04 2023-08-04 Message processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117156398A (en)

Similar Documents

Publication Publication Date Title
US20230020324A1 (en) Task Processing Method and Device, and Electronic Device
CN113778644B (en) Task processing method, device, equipment and storage medium
CN117156398A (en) Message processing method, device, electronic equipment and storage medium
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN114706610A (en) Business flow chart generation method, device, equipment and storage medium
CN117076185B (en) Server inspection method, device, equipment and medium
CN113836291B (en) Data processing method, device, equipment and storage medium
CN109547290B (en) Cloud platform garbage data detection processing method, device, equipment and storage medium
CN116340097A (en) Method, device, equipment and storage medium for processing abnormal information
CN114416040A (en) Page construction method, device, equipment and storage medium
CN117670236A (en) Mobile-terminal-based to-be-handled flow approval method, device, equipment and medium
CN114328224A (en) Method and device for reproducing exception request, electronic equipment and storage medium
CN117785494A (en) Asynchronous process processing method, device and system, electronic equipment and storage medium
CN117076427A (en) Server data management method, device, equipment and storage medium
CN115801718A (en) Message processing method and device, electronic equipment and message processing system
CN114201564A (en) Map production task processing method and device, electronic equipment and storage medium
CN117081939A (en) Traffic data processing method, device, equipment and storage medium
CN116170188A (en) Network access control method, device, electronic equipment and storage medium
CN116501968A (en) Method, device, electronic equipment and medium for subscribing internet of things data
CN115794255A (en) Data processing method and device, electronic equipment and storage medium
CN117950750A (en) Application program deployment change processing method, device, equipment and medium
CN117827949A (en) Method and device for batch writing of data into database based on memory queue
CN118226120A (en) Power consumption determination method and device, electronic equipment and storage medium
CN116015665A (en) Method, device, equipment and medium for repeatedly detecting virtual article
CN114722043A (en) Data storage method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination