Method, device, electronic device and storage medium for message processing

By reading and storing messages from the prohibited queue during non-prohibited periods, combined with priority identification and operation wait time control, the system pressure problem caused by message accumulation is solved, and the system's operational stability is improved.

CN116132523BActive Publication Date: 2025-11-04CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310027533.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-09
Publication Date
2025-11-04
Estimated Expiration
2043-01-09

AI Technical Summary

Technical Problem

When there are a large number of push messages, delayed push messages will accumulate, causing excessive system pressure and making it impossible to run smoothly.

Method used

When the current time is not within the prohibited sending period, a preset number of messages to be processed are read from the prohibited sending queue, their priority identifiers are obtained and stored in the corresponding message queue, and the operation waiting time is calculated to control the message processing progress, limit the number of messages processed each time, and avoid system overload.

Benefits of technology

It enables real-time control of system load during message push, avoiding system overload and improving system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132523B_ABST
    Figure CN116132523B_ABST
Patent Text Reader

Abstract

The application discloses a message processing method and device, electronic equipment and a storage medium, and relates to the technical field of big data analysis. A specific embodiment of the method comprises the following steps: in response to the current time not belonging to a forbidden sending time period, reading a preset number of to-be-processed messages from a forbidden sending queue, obtaining priority identifiers in each to-be-pushed message, and storing each to-be-pushed message in a message queue corresponding to the priority identifier; obtaining processing time information of each to-be-processed message, in response to the processing time information not satisfying a preset condition, calculating an operation waiting time based on the processing time information and preset standard time information, and waiting for reading the preset number of to-be-processed messages from the forbidden sending queue after the operation waiting time. The embodiment can solve the problem that when the number of pushed messages is large, a large number of delayed pushed messages will accumulate, and if message pushing is simultaneously performed at this time, the system pressure will be too large, and the system cannot run smoothly.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data analysis, and in particular to a message processing method and device, electronic equipment and a storage medium. BACKGROUND

[0002] With the maturity and perfection of Internet technology and the popularity of mobile application scenarios, the interaction between applications and users is more frequent, so the message push business volume for the application is increasing. In the message push of the application, in order to avoid disturbing the user at a specific time, the message is usually delayed to push. In the prior art, the delayed push message is usually stored first, and then pushed to the user when it is allowed to push. However, when the number of push messages is large, the delayed push messages will accumulate in large quantities, and if the message push is performed at the same time, it is easy to cause the system pressure to be too large, resulting in the system unable to run smoothly. SUMMARY

[0003] Therefore, the embodiments of the present application provide a message processing method and device, electronic equipment and a storage medium, which can solve the problem that when the number of push messages is large, the delayed push messages will accumulate in large quantities, and if the message push is performed at the same time, it is easy to cause the system pressure to be too large, resulting in the system unable to run smoothly.

[0004] To achieve the above object, according to one aspect of the embodiments of the present application, a message processing method is provided.

[0005] The message processing method of the embodiments of the present application comprises: in response to the current time not belonging to the forbidden time period, reading a preset number of to-be-processed messages from the forbidden queue, obtaining the priority identifier in each to-be-pushed message, and storing each to-be-pushed message to the message queue corresponding to the priority identifier.

[0006] Obtaining the processing time information of each to-be-processed message, in response to the processing time information not satisfying the preset condition, calculating the operation waiting time based on the processing time information and the preset standard time information, and waiting for reading a preset number of to-be-processed messages from the forbidden queue after the operation waiting time, and performing the operation of storing to the message queue.

[0007] In one embodiment, the processing time information comprises the processing time spent by the to-be-processed message, and the standard time information comprises the processing standard time.

[0008] Based on the processing time information and the preset standard time information, the operation waiting time is calculated, comprising:

[0009] The time difference between the processing time spent and the standard time information is calculated, and the time difference is determined as the operation waiting time.

[0010] In still another embodiment, the processing time information comprises processing time spent by the to-be-processed message, and the standard time information comprises processing standard time;

[0011] Based on the processing time information and the preset standard time information, an operation waiting time is calculated, comprising:

[0012] Based on the processing time information and the preset standard time information, a proportion of the processing time spent by the to-be-processed message to the processing standard time is calculated, so as to calculate an operation waiting time based on the proportion and the processing standard time.

[0013] In still another embodiment, the processing time information of each to-be-processed message is obtained, comprising:

[0014] The processing time spent by each to-be-processed message is obtained, so as to calculate a processing rate of to-be-processed message in combination with the data volume of each to-be-processed message.

[0015] In still another embodiment, the method further comprises:

[0016] A to-be-processed message is received, and a forbidden sending identifier in the to-be-processed message is obtained, so as to query a corresponding forbidden sending time period;

[0017] In response to the current time belonging to the forbidden sending time period, the to-be-processed message is stored into a forbidden sending queue; in response to the current time not belonging to the forbidden sending time period, a priority identifier in the to-be-processed message is obtained, so as to store the to-be-processed message into a message queue corresponding to the priority identifier.

[0018] In still another embodiment, storing each to-be-pushed message into the message queue corresponding to the priority identifier comprises:

[0019] The number of messages included in the message queue corresponding to the priority identifier is obtained;

[0020] In response to the number being greater than a preset number threshold, the to-be-processed message including the priority identifier is stored into the forbidden sending queue; in response to the number being less than or equal to the preset number threshold, each to-be-pushed message is stored into the message queue corresponding to the priority identifier.

[0021] In still another embodiment, the method further comprises:

[0022] In response to the processing time information satisfying a preset condition, a preset number of to-be-processed messages are read from the forbidden sending queue, and an operation of storing into a message queue is performed.

[0023] To achieve the above object, according to another aspect of the embodiment of the present application, a device for message processing is provided.

[0024] The device for processing messages in an embodiment of the application comprises: a storage unit configured to read a preset number of to-be-processed messages from a forbidden queue in response to a current time not belonging to a forbidden time period, acquire a priority identifier in each of the to-be-processed messages, and store each of the to-be-processed messages in a message queue corresponding to the priority identifier;

[0025] a processing unit configured to acquire processing time information of each of the to-be-processed messages, calculate an operation waiting time based on the processing time information and preset standard time information in response to the processing time information not satisfying a preset condition, and wait for reading a preset number of to-be-processed messages from the forbidden queue and performing an operation of storing in a message queue after the operation waiting time.

[0026] In an embodiment, the time information comprises processing time spent by a to-be-processed message, and the standard time information comprises processing standard time.

[0027] The processing unit is specifically configured to:

[0028] calculate a time difference between the processing time spent and the standard time information, and determine the time difference as the operation waiting time.

[0029] In another embodiment, the processing unit is specifically configured to:

[0030] calculate a proportion of the processing time spent by the to-be-processed message in the standard time based on the processing time information and the preset standard time information, and calculate an operation waiting time based on the proportion and the standard time.

[0031] In another embodiment, the processing unit is specifically configured to:

[0032] acquire the processing time spent by each of the to-be-processed messages, and calculate a processing rate of the to-be-processed messages based on data amounts of the to-be-processed messages.

[0033] In another embodiment, the device further comprises:

[0034] a receiving unit configured to receive a to-be-processed message, acquire a forbidden identifier in the to-be-processed message, and query a corresponding forbidden time period.

[0035] The storage unit is specifically configured to store the to-be-processed message in a forbidden queue in response to a current time belonging to a forbidden time period, and acquire a priority identifier in the to-be-processed message to store the to-be-processed message in a message queue corresponding to the priority identifier in response to a current time not belonging to a forbidden time period.

[0036] In another embodiment, the storage unit is specifically configured to:

[0037] acquire a quantity of messages included in the message queue corresponding to the priority identifier;

[0038] in response to the quantity being greater than a preset quantity threshold, store the to-be-processed messages including the priority identifier to a forbidden sending queue; and in response to the quantity being less than or equal to the preset quantity threshold, store each of the to-be-pushed messages to the message queue corresponding to the priority identifier.

[0039] In yet another embodiment, the processing unit is further configured to:

[0040] in response to the processing time information satisfying a preset condition, read a preset quantity of to-be-processed messages from the forbidden sending queue, and perform the operation of storing to a message queue.

[0041] To achieve the above object, according to another aspect of embodiments of the present application, an electronic device is provided.

[0042] The electronic device of embodiments of the present application comprises one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the message processing method provided by embodiments of the present application.

[0043] To achieve the above object, according to another aspect of embodiments of the present application, a computer readable medium is provided.

[0044] The computer readable medium of embodiments of the present application has a computer program stored thereon, and the program is executed by a processor to implement the message processing method provided by embodiments of the present application.

[0045] To achieve the above object, according to another aspect of embodiments of the present application, a computer program product is provided.

[0046] The computer program product of embodiments of the present application comprises a computer program, and the program is executed by a processor to implement the message processing method provided by embodiments of the present application.

[0047] An embodiment of the above application has the following advantages or beneficial effects: in the embodiment of the application, after determining that the current time does not belong to the forbidden sending time period, a preset number of to-be-processed messages in the forbidden sending queue can be read, the preset number can limit the number of to-be-processed messages in the forbidden sending queue processed each time, so that processing of a large number of to-be-processed messages at the same time can be avoided, and excessive pressure on the system can be avoided; during processing of the to-be-processed messages, processing time information of each to-be-processed message can be obtained, when it is determined that the to-be-processed message does not meet the preset condition, the operation waiting time can be calculated, so that the to-be-processed message in the forbidden sending queue can be continuously processed after the operation waiting time, so that the processing progress of the to-be-processed message in the forbidden sending queue can be adjusted in real time based on the processing of the to-be-processed message, the control of the processing progress of the to-be-processed message in the forbidden sending queue can be realized, so that processing of a large number of to-be-processed messages at the same time can be avoided, excessive pressure on the system can be avoided, and the stability of system operation can be improved.

[0048] Further effects of the above non-conventional optional mode will be described in the following in combination with the specific embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0049] The accompanying drawings are used to better understand the application and do not constitute undue limitations on the application. Among them:

[0050] Figure 1 is a schematic diagram of a system architecture of a message processing system according to an embodiment of the application;

[0051] Figure 2 is a schematic diagram of a main flow of a message processing method according to an embodiment of the application;

[0052] Figure 3 is a schematic diagram of another main flow of a message processing method according to an embodiment of the application;

[0053] Figure 4 is a schematic diagram of another main flow of a message processing method according to an embodiment of the application;

[0054] Figure 5 is a schematic diagram of main units of a message processing device according to an embodiment of the application;

[0055] Figure 6 is another exemplary system architecture diagram to which an embodiment of the application can be applied;

[0056] Figure 7 is a structural schematic diagram of a computer system suitable for implementing an embodiment of the application. DETAILED DESCRIPTION

[0057] Exemplary embodiments of the present application are described herein with reference to the accompanying drawings, which are meant to be exemplary in nature, and include various details intended to facilitate understanding of the application. Accordingly, it should be understood that various changes and modifications to the embodiments described herein can be made by those having ordinary skill in the art without departing from the spirit and scope of the application. Likewise, it is to be understood that the features implied by the description herein are to be combined in all possible combinations, unless otherwise explicitly addressed herein. Furthermore, in this Document, the term "comprising" does not exclude the presence of elements or steps other than those listed in a limitation. The term "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. It is further understood that values, steps, constituents and ingredients are in ranges and / or lists and / or underlined and / or emboldened, unless otherwise specified herein, are intended to be open-ended ranges, and are therefore susceptible to an "any" interpretation.

[0058] It should be noted that the embodiments and features of the embodiments in the present application can be combined with each other without conflict. The acquisition, storage, use, processing, etc. of data in the technical solutions of the present application comply with the relevant provisions of national laws and regulations.

[0059] The message processing system provided by the embodiments of the present application can be used in a scenario of pushing messages, and can be used in a scenario of buffering messages in a forbidden sending time period and processing the messages in a non-forbidden sending time period.

[0060] Figure 1 As shown in the figure, it is a structural schematic diagram of a message processing system in the embodiments of the present application. As shown in the figure, the message processing system is connected with an external system, and can receive messages sent by the external system to push the messages through the processing of the message processing system. As shown in the figure, the message processing system can include a module A, a module B, a module C and a buffer module. The module A can be used to determine whether the message received from the external system is forbidden to be sent, and send the message to the storage module for storage when it is determined that the message needs to be forbidden to be sent. The storage module can be provided with a forbidden sending queue to store the messages that need to be forbidden to be sent. The module B can be used to process the messages in the forbidden sending queue in a non-forbidden sending time period, and store the messages in a queue for message pushing. Then, the module C can push the messages in the queue for message pushing. Figure 1 Figure 1 The message processing system provided by the embodiments of the present application can be used in a scenario of pushing messages, and can be used in a scenario of buffering messages in a forbidden sending time period and processing the messages in a non-forbidden sending time period.

[0061] The message processing method provided by the embodiments of the present application can be executed by the message processing system in the system architecture as shown in the figure, and the method includes the following steps. Figure 1 Figure 2

[0062] S201: In response to the current time not belonging to a forbidden sending time period, reading a preset number of to-be-processed messages from the forbidden sending queue, obtaining the priority identifiers in each to-be-pushed message, and storing each to-be-pushed message in a message queue corresponding to the priority identifier.

[0063] ​​​The forbidden sending time period can be preconfigured, for example, from 9:00 PM to 9:00 AM, which is usually the time when the user needs to rest, and therefore can be set as the forbidden sending time period. The to-be-processed messages that belong to the forbidden sending time period and need to be forbidden can be stored in the forbidden sending queue, so that the to-be-processed messages in the forbidden sending queue can be processed after it is monitored that the current time does not belong to the forbidden sending time period. The to-be-processed messages can be messages sent by an external system and used for pushing.

[0064] In order to avoid that the system stability is reduced due to too many to-be-processed messages being processed at the same time, the number of to-be-processed messages in the forbidden sending queue can be preconfigured, that is, the maximum number of to-be-processed messages in the forbidden sending queue that can be processed at a time. When the number of to-be-processed messages in the forbidden sending queue does not meet the preconfigured number, the number of to-be-processed messages read from the forbidden sending queue in this step can be less than the preconfigured number.

[0065] The to-be-processed messages can include a priority identifier of the message, such as a priority identifier indicating the priority of the message pushing. In the embodiments of the present application, a message queue corresponding to each priority can be set, so as to facilitate the pushing processing of each message according to the priority. Therefore, after the to-be-processed messages are read in this step, the priority identifier in each to-be-processed message can be obtained, and then each to-be-processed message can be stored in the message queue corresponding to the priority identifier, so as to facilitate the subsequent pushing processing.

[0066] In some embodiments, in order to avoid that the system pressure is too large due to too many to-be-processed messages in the message queue corresponding to each priority, after the priority identifier in each to-be-processed message is obtained in this step, it can be first judged whether the number of messages included in the message queue corresponding to the priority identifier is greater than a preconfigured number threshold. If the number of messages included in the message queue is greater than the preconfigured number threshold, it means that a large number of messages have been stored in the message queue, so at this time the read to-be-processed messages can be stored in the forbidden sending queue, that is, the processing of the to-be-processed messages is suspended. If the number of messages included in the message queue is not greater than the preconfigured number threshold, it means that the number of messages stored in the message queue is not large or small, so at this time each to-be-processed message can be stored in the message queue corresponding to the priority identifier. Specifically, storing each to-be-processed message in the message queue corresponding to the priority identifier in this step can be performed as follows: obtaining the number of messages included in the message queue corresponding to the priority identifier; in response to the number being greater than the preconfigured number threshold, storing the to-be-processed message including the priority identifier in the forbidden sending queue; and in response to the number being less than or equal to the preconfigured number threshold, storing each to-be-processed message in the message queue corresponding to the priority identifier.

[0067] S202: Obtain processing time information of each to-be-processed message, in response to the processing time information not satisfying a preset condition, calculate an operation waiting time based on the processing time information and preset standard time information, wait for a preset number of to-be-processed messages to be read from the forbidden sending queue after the operation waiting time, and perform the operation of storing to the message queue.

[0068] In order to avoid too many to-be-processed messages from putting too much pressure on the styling system, the processing of the to-be-processed messages is monitored in the embodiment of the application, so that the processing time information of each to-be-processed message can be obtained in this step. The processing time information can include various types, such as processing time, so as to determine the processing of the to-be-processed messages by the system. Generally, if the to-be-processed messages are processed too quickly, it is easy to form a backlog in the message queue, thereby bringing a lot of pressure to the subsequent message pushing processing. Therefore, the preset condition can be set to control the processing of the to-be-processed messages in the forbidden sending queue. The preset condition can be set based on the processing time information. Specifically, the processing time information can include processing time, and the preset condition can be that the processing time of the to-be-processed message is not less than a preset standard time, and the preset standard time represents the time required for normal processing of the to-be-processed message.

[0069] The processing time information does not satisfy the preset condition, which means that the to-be-processed messages in the forbidden sending queue are processed too quickly. Therefore, the processing of the to-be-processed messages in the forbidden sending queue can be paused at this time, and the operation waiting time is calculated. The operation waiting time represents the time of pausing the processing of the to-be-processed messages in the forbidden sending queue. After waiting for the operation waiting time, step S201 can be performed again, that is, a preset number of to-be-processed messages are read from the forbidden sending queue, and the operation of storing to the message queue is performed, thereby realizing the control of the processing progress of the to-be-processed messages in the forbidden sending queue.

[0070] In the embodiment of the application, the standard time information is preset, so that the operation waiting time can be calculated based on the processing time information and the preset standard time information in this step. Specifically, the processing time information includes the processing time of the to-be-processed message, and the standard time information includes the processing standard time of the to-be-processed message. Therefore, the time difference between the processing time and the standard time information can be calculated in this step, and the time difference is determined as the operation waiting time.

[0071] For example, the processing time of the to-be-processed message obtained in this step is 40 seconds, and the preset processing standard time is 60 seconds. Therefore, the operation waiting time can be calculated as 20 seconds.

[0072] In yet another embodiment, the operation waiting time can also be calculated based on the processing time information and preset standard time information, by calculating the proportion of the processing time of the to-be-processed message in the processing standard time, and then multiplying the proportion by the processing standard time to obtain the operation waiting time. The proportion of the processing time of the to-be-processed message in the processing standard time represents the percentage of the processing time of the to-be-processed message in the processing standard time, and then the operation waiting time can be calculated by multiplying the proportion by the processing standard time.

[0073] It should be noted that in the embodiments of the present application, the processing rate of the to-be-processed message can also be used to determine whether the preset condition is met, and at this time the preset condition can be a preset standard processing rate. Therefore, the processing time of each to-be-processed message can be obtained in this step to calculate the processing rate of the to-be-processed message in combination with the data amount of each to-be-processed message. If the processing rate is greater than the preset standard rate, it can be determined that the preset condition is met; if the processing rate is not greater than the preset standard rate, it can be determined that the preset condition is not met.

[0074] In the embodiments of the present application, after it is determined that the processing time information meets the preset condition, the to-be-processed messages in the forbidden queue can be continuously processed, that is, a preset number of to-be-processed messages are read from the forbidden queue in response to the processing time information meeting the preset condition, and the operation of storing to the message queue is performed.

[0075] In the embodiments of the present application, after it is determined that the current time does not belong to the forbidden time period, a preset number of to-be-processed messages can be read from the forbidden queue. The preset number can limit the number of to-be-processed messages processed from the forbidden queue at a time, so as to avoid processing a large number of to-be-processed messages at the same time and causing excessive pressure on the system. During the processing of the to-be-processed messages, the processing time information of each to-be-processed message can also be obtained, and when it is determined that the processing time information does not meet the preset condition, the operation waiting time can be calculated. Therefore, the processing of the to-be-processed messages in the forbidden queue can be continued after waiting for the operation waiting time, so as to adjust the processing progress of the to-be-processed messages in the forbidden queue in real time based on the processing of the to-be-processed messages, control the processing progress of the to-be-processed messages in the forbidden queue, and avoid processing a large number of to-be-processed messages at the same time and causing excessive pressure on the system, thereby improving the stability of the system.

[0076] The method for processing messages in the embodiments of the present application will be described in detail below with reference to the embodiments shown in Figure 2 Figure 3 The method comprises the following steps:

[0077] S301: In response to the current time not belonging to the forbidden time period, a preset number of to-be-processed messages are read from the forbidden queue. ​

[0078] S302: Obtain the priority identifier in each to-be-pushed message, so as to store each to-be-pushed message in the message queue corresponding to the priority identifier.

[0079] S303: Obtain the processing time consumption of each to-be-processed message, so as to calculate the processing rate of the to-be-processed message in combination with the data volume of each to-be-processed message, and determine whether the preset condition is met.

[0080] S304: In response to the processing time information not meeting the preset condition, calculate the operation waiting time based on the processing time information and the preset standard time information, so as to wait for reading a preset number of to-be-processed messages from the forbidden sending queue and performing the operation of storing to the message queue after the operation waiting time.

[0081] S305: In response to the processing time information meeting the preset condition, read a preset number of to-be-processed messages from the forbidden sending queue and perform the operation of storing to the message queue.

[0082] It should be noted that the data processing principle in the embodiment of the application is the same as the corresponding data processing principle in the embodiment shown in Figure 2 and will not be described here again.

[0083] The method for processing messages in the embodiment of the application will be specifically described below in combination with the embodiment shown in Figure 2 , and as shown in Figure 4 , the method comprises the following steps.

[0084] S401: Receive a to-be-processed message, and obtain the forbidden sending identifier in the to-be-processed message, so as to query the corresponding forbidden sending time period.

[0085] After the message processing system receives the to-be-processed message, it can be healthy and checked to verify the legality of the to-be-processed message, and then the forbidden sending identifier can be obtained from the to-be-processed message to determine whether it belongs to the forbidden sending message. The forbidden sending identifier indicates that the message is prohibited to be sent in the forbidden sending time period, so after the forbidden sending identifier is obtained in this step, the corresponding forbidden sending time period can be queried first, and then it is determined whether the current time is in the forbidden sending time period.

[0086] S402: Determine whether the current time belongs to the forbidden sending time period.

[0087] S403: In response to the current time belonging to the forbidden sending time period, store the to-be-processed message in the forbidden sending queue.

[0088] If the current time belongs to the forbidden sending time period, the to-be-processed message needs to be stored first, that is, stored in the forbidden sending queue, so as to be processed later through the embodiment shown in Figure 2 .

[0089] S404: In response to the current time not belonging to the forbidden sending time period, obtaining a priority identifier in the to-be-processed message to store the to-be-processed message in a message queue corresponding to the priority identifier.

[0090] If the current time does not belong to the forbidden sending time period, the to-be-processed message can be normally processed, that is, the to-be-processed message is stored in a message queue corresponding to the priority identifier to perform the push processing.

[0091] It should be noted that the data processing principle in the embodiment of the present application is the same as the corresponding data processing principle in the embodiment shown in Figure 2 and will not be described here again.

[0092] To solve the problems in the prior art, an embodiment of the present application provides a device 500 for message processing, as shown in Figure 5 The device 500 comprises:

[0093] A storage unit 501 is configured to read a preset number of to-be-processed messages from a forbidden sending queue in response to the current time not belonging to the forbidden sending time period, obtain a priority identifier in each of the to-be-processed messages, and store each of the to-be-processed messages in a message queue corresponding to the priority identifier.

[0094] A processing unit 502 is configured to obtain processing time information of each of the to-be-processed messages, in response to the processing time information not satisfying a preset condition, calculate an operation waiting time based on the processing time information and preset standard time information, wait for a preset number of to-be-processed messages to be read from the forbidden sending queue after the operation waiting time, and perform an operation of storing in a message queue.

[0095] It should be understood that the manner of implementing the embodiment of the present application is the same as the manner of implementing the embodiment shown in Figure 2 and will not be described here again.

[0096] In one embodiment, the time information comprises processing time spent by the to-be-processed message, and the standard time information comprises a processing standard time.

[0097] The processing unit 502 is specifically configured to:

[0098] Calculate a time difference between the processing time spent and the standard time information, and determine the time difference as the operation waiting time.

[0099] In another embodiment, the processing unit 502 is specifically configured to:

[0100] Calculate a proportion of the processing time spent in the standard time based on the processing time information and the preset standard time information, and calculate the operation waiting time based on the proportion and the standard time.

[0101] In yet another embodiment, the processing unit 502 is specifically configured to:

[0102] acquire processing time consumption of each of the to-be-processed messages, to calculate processing rate of the to-be-processed messages based on data volume of each of the to-be-processed messages.

[0103] In yet another embodiment, the apparatus 500 further comprises:

[0104] a receiving unit configured to receive to-be-pushed messages, and acquire a non-issuing identifier in the to-be-pushed messages to query a corresponding non-issuing time period;

[0105] The storage unit 501 is specifically configured to, in response to the current time belonging to the non-issuing time period, store the to-be-pushed messages to a non-issuing queue; and in response to the current time not belonging to the non-issuing time period, acquire a priority identifier in the to-be-pushed messages to store the to-be-pushed messages to a message queue corresponding to the priority identifier.

[0106] In yet another embodiment, the storage unit 501 is specifically configured to:

[0107] acquire a quantity of messages included in the message queue corresponding to the priority identifier;

[0108] in response to the quantity being greater than a preset quantity threshold, store to-be-processed messages including the priority identifier to the non-issuing queue; and in response to the quantity being less than or equal to the preset quantity threshold, store each of the to-be-pushed messages to the message queue corresponding to the priority identifier.

[0109] In yet another embodiment, the processing unit 502 is further configured to:

[0110] in response to the processing time information satisfying a preset condition, read a preset quantity of to-be-processed messages from the non-issuing queue, and perform an operation of storing to a message queue.

[0111] It should be understood that the manner of implementing the embodiments of the present application is the same as the manner of implementing the embodiments shown in Figure 2 、 Figure 3 or Figure 4 , which will not be described here in detail.

[0112] In the embodiment of the present application, after it is determined that the current time does not belong to the forbidden sending time period, a preset number of to-be-processed messages in the forbidden sending queue can be read, the preset number can limit the number of to-be-processed messages in the forbidden sending queue processed each time, so that processing of a large number of to-be-processed messages at the same time can be avoided, and excessive pressure on the system can be avoided; during the processing of the to-be-processed messages, processing time information of each to-be-processed message can be obtained, when it is determined that the to-be-processed message does not meet the preset condition, the operation waiting time can be calculated, so that the processing of the to-be-processed messages in the forbidden sending queue can be continued after the operation waiting time, so that the processing progress of the to-be-processed messages in the forbidden sending queue can be adjusted in real time based on the processing of the to-be-processed messages, the control of the processing progress of the to-be-processed messages in the forbidden sending queue can be realized, so that processing of a large number of to-be-processed messages at the same time can be avoided, excessive pressure on the system can be avoided, and the stability of system operation can be improved.

[0113] According to the embodiments of the present application, the embodiments of the present application further provide an electronic device and a readable storage medium.

[0114] The electronic device of the embodiments of the present application comprises at least one processor, and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the message processing method provided by the embodiments of the present application.

[0115] Figure 6 An exemplary system architecture 600 to which the message processing method or the message processing apparatus of the embodiments of the present application can be applied is shown.

[0116] As shown in Figure 6 The system architecture 600 can include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0117] A user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various client applications can be installed on the terminal devices 601, 602, 603.

[0118] The terminal devices 601, 602, 603 can be, but are not limited to, smart phones, tablet computers, laptop computers, desktop computers, etc.

[0119] The server 605 can be a server providing various services, which can analyze and process received product information query request and the like, and feed back the processing result (e.g., product information - just an example) to the terminal device.

[0120] It should be noted that the method for processing messages provided by the embodiments of the present application is generally executed by the server 605, and accordingly, the apparatus for processing messages is generally arranged in the server 605.

[0121] It should be understood that, Figure 6 The number of terminal devices, networks and servers in the system is merely illustrative. Any number of terminal devices, networks and servers can be provided according to the implementation needs.

[0122] Reference will be made to Figure 7 which shows a structural diagram of a computer system 700 suitable for implementing the embodiments of the present application. Figure 7 The computer system shown is merely an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0123] As shown in Figure 7 , the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 702 or loaded from a storage portion 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the system 700 are also stored in the RAM 703. The CPU 701, the ROM 702 and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0124] The following components are connected to the I / O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 708 including a hard disk, and the like; and a communication portion 709 including a network interface card such as a LAN card, a modem, and the like. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 710 as needed, so that a computer program read therefrom is installed in the storage portion 708 as needed.

[0125] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program in accordance with the embodiments disclosed herein. For example, embodiments disclosed herein include a computer program product which includes a computer program tangibly embodied on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flow charts. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 709 and / or installed from a removable media 711. When the computer program is executed by the central processing unit (CPU) 701, the above-described functions defined in the system of the present invention are performed.

[0126] It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium may, for example, be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device. In the present invention, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, in which a computer readable program code is carried. Such a propagated data signal can take many forms, including but not limited to, an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that can send, propagate or transfer a program for use by or in connection with an instruction execution system, apparatus or device. The program code contained on the computer readable medium can be transmitted using any suitable medium, including but not limited to, wireless, wire line, optical fiber cable, RF, etc., or any suitable combination thereof.

[0127] The computer program product of the present application can be a storage medium or a computer program product that stores instructions. For example, the storage medium can be a floppy disk, a USB flash drive, a DVD, a CD, a memory stick, or a hard disk. The computer program product of the present application can also be a computer program that is transmitted over a network. For example, the computer program can be a piece of code that is transmitted over the Internet or over a local area network. The computer program product of the present application can also be a computer program that is stored in a computer program product and is transmitted over a network. For example, the computer program can be a piece of code that is stored in a computer program product and is transmitted over the Internet or over a local area network.

[0128] The units described in the embodiments of the present application can be implemented by software, or by hardware. The units described can also be implemented in a processor, for example, a processor can be described as including a storage unit and a processing unit. In some cases, the names of the units do not limit the units themselves, for example, a storage unit can also be described as a "message storage unit".

[0129] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist separately and not be assembled into the device. The computer readable medium carries one or more programs, which, when executed by the device, cause the device to perform the message processing method provided by the present application.

[0130] As another aspect, the present application also provides a computer program product, which includes a computer program. When the program is executed by a processor, the method for message processing provided by the embodiments of the present application is implemented.

[0131] The specific embodiments described above do not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principles of the present application shall fall within the scope of the protection of the present application.

Claims

1. A method of message processing, characterized by, The method comprises: reading a preset number of to-be-processed messages from the forbidden queue in response to the current time not belonging to the forbidden time period, obtaining a priority identifier in each to-be-pushed message, and storing each to-be-pushed message to a message queue corresponding to the priority identifier; obtaining processing time information of each to-be-processed message, in response to the processing time information not satisfying a preset condition, calculating an operation waiting time based on the processing time information and preset standard time information, and waiting for a preset number of to-be-processed messages to be read from the forbidden queue after the operation waiting time, and performing the operation of storing to the message queue; the processing time information comprises processing time spent by the to-be-processed message, and the standard time information comprises processing standard time; calculating the operation waiting time based on the processing time information and the preset standard time information comprises: calculating the proportion of the processing time spent by the to-be-processed message in the processing standard time based on the processing time information and the preset standard time information, and calculating the operation waiting time based on the proportion and the processing standard time; obtaining the processing time information of each to-be-processed message comprises: obtaining the processing time spent by each to-be-processed message, and calculating the processing rate of the to-be-processed message in combination with the data amount of each to-be-processed message; if the processing rate is greater than a preset standard rate, it can be determined that the preset condition is satisfied; if the processing rate is not greater than the preset standard rate, it can be determined that the preset condition is not satisfied.

2. The method of claim 1, wherein, The processing time information comprises processing time spent by the to-be-processed message, and the standard time information comprises processing standard time; calculating the operation waiting time based on the processing time information and the preset standard time information comprises: calculating the time difference between the processing time spent and the standard time information, and determining the time difference as the operation waiting time.

3. The method of claim 1, wherein, The method further comprises: receiving a to-be-processed message, obtaining a forbidden identifier in the to-be-processed message, and querying a corresponding forbidden time period; in response to the current time belonging to the forbidden time period, storing the to-be-processed message to the forbidden queue; in response to the current time not belonging to the forbidden time period, obtaining a priority identifier in the to-be-processed message, and storing the to-be-processed message to a message queue corresponding to the priority identifier.

4. The method of claim 1, wherein, storing each to-be-pushed message to the message queue corresponding to the priority identifier comprises: obtaining the number of messages included in the message queue corresponding to the priority identifier; in response to the number being greater than a preset number threshold, storing the to-be-processed message including the priority identifier to the forbidden queue; in response to the number being less than or equal to the preset number threshold, storing each to-be-pushed message to the message queue corresponding to the priority identifier.

5. The method of claim 1, wherein, The method further comprises: in response to the processing time information satisfying the preset condition, reading a preset number of to-be-processed messages from the forbidden queue, and performing the operation of storing to the message queue.

6. An apparatus for message processing, the apparatus comprising: The method comprises: The storage unit is configured to, in response to the current time not belonging to the forbidden sending time period, read a preset number of to-be-processed messages from the forbidden sending queue, obtain a priority identifier in each to-be-pushed message, and store each to-be-pushed message in a message queue corresponding to the priority identifier. The processing unit is configured to obtain processing time information of each to-be-processed message, in response to the processing time information not satisfying a preset condition, calculate an operation waiting time based on the processing time information and preset standard time information, wait for a preset number of to-be-processed messages to be read from the forbidden sending queue after the operation waiting time, and perform an operation of storing to-be-pushed messages in a message queue; the processing time information includes processing time spent by a to-be-processed message, and the standard time information includes a processing standard time. The processing unit is specifically configured to: calculate a proportion of the processing time spent by the to-be-processed message to the standard time based on the processing time information and the preset standard time information, and calculate the operation waiting time based on the proportion and the standard time. The processing unit is specifically configured to: obtain the processing time spent by each to-be-processed message, and calculate a processing rate of to-be-processed messages based on data amounts of the to-be-processed messages; if the processing rate is greater than a preset standard rate, it can be determined that the preset condition is satisfied. If the processing rate is not greater than the preset standard rate, it can be determined that the preset condition is not satisfied.

7. The apparatus of claim 6, wherein, The processing time information includes processing time spent by a to-be-processed message, and the standard time information includes a processing standard time. The processing unit is specifically configured to: calculate a time difference between the processing time spent and the standard time information, and determine the time difference as the operation waiting time.

8. The apparatus of claim 7, wherein, The device further includes: The receiving unit is configured to receive a to-be-pushed message, obtain a forbidden sending identifier in the to-be-pushed message, and query a corresponding forbidden sending time period. The storage unit is specifically configured to, in response to the current time belonging to the forbidden sending time period, store the to-be-pushed message in the forbidden sending queue; and in response to the current time not belonging to the forbidden sending time period, obtain a priority identifier in the to-be-pushed message, and store the to-be-pushed message in a message queue corresponding to the priority identifier.

9. An electronic device, comprising: One or more processors; A storage device configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method in any one of claims 1-5. The program is executed by the processor to implement the method in any one of claims 1-5.

10. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method in any one of claims 1-5.

11. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Method and apparatus for controlling traffic

    CN108696451A

  • Message pushing method, device and equipment

    CN114979250A