CN113204392B - Message processing method, device and storage medium - Google Patents

Message processing method, device and storage medium Download PDF

Info

Publication number
CN113204392B
CN113204392B CN202110385322.2A CN202110385322A CN113204392B CN 113204392 B CN113204392 B CN 113204392B CN 202110385322 A CN202110385322 A CN 202110385322A CN 113204392 B CN113204392 B CN 113204392B
Authority
CN
China
Prior art keywords
messages
polling period
processed
ith
message
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.)
Active
Application number
CN202110385322.2A
Other languages
Chinese (zh)
Other versions
CN113204392A (en
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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202110385322.2A priority Critical patent/CN113204392B/en
Publication of CN113204392A publication Critical patent/CN113204392A/en
Application granted granted Critical
Publication of CN113204392B publication Critical patent/CN113204392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a message processing method, a message processing device and a storage medium; the method comprises the following steps: acquiring the total number of messages of the messages to be processed, the number of unprocessed residual messages and the number of processed messages; and obtaining a batch processing number based on the total number of messages, the number of residual messages and the number of processed messages, and carrying out batch processing on the messages based on the batch processing number. The invention can dynamically calculate the batch processing number according to the actual situation, thereby improving the processing efficiency.

Description

Message processing method, device and storage medium
Technical Field
The present invention relates to information processing technologies, and in particular, to a method, an apparatus, and a storage medium for processing a message.
Background
With the development of network communication technology, batch technology is gradually adopted in information processing. A batch processing technology is adopted in network input/output (I/O), and a plurality of messages can be processed by one function call in the packet receiving and sending and message processing flow, so that the hit rate of a Cache (Cache) can be remarkably improved, the cost of stack/register group context switching during function call is allocated, the call time is less, and the system load is lower.
In the existing batch processing technology, the batch processing number is often set to be a static value, so that the requirements of network throughput and time delay under different flow models cannot be met at the same time, the batch processing number is not matched with the actual situation, and the batch processing efficiency is low.
Disclosure of Invention
The embodiment of the invention expects to provide a message processing method, a message processing device and a storage medium, which can dynamically calculate the batch processing number according to actual conditions, thereby improving the processing efficiency.
The technical scheme of the invention is realized as follows:
the embodiment of the invention provides a message processing method, which comprises the following steps:
acquiring the total number of messages of the messages to be processed, the number of unprocessed residual messages and the number of processed messages;
and obtaining a batch processing number based on the total number of messages, the number of the residual messages and the number of the processed messages, and carrying out message batch processing based on the batch processing number.
In the above scheme, the total number of messages includes: the total number of i-th messages; the total number of the ith messages is the total number of the messages to be processed in the ith polling period; the ith polling period is a polling period to be processed, and i is a positive integer;
the number of the remaining messages includes: the number of the i-th residual message to the number of the i+ (T-1) -th residual message; wherein T is the number of periods of a polling period to be processed, and T is an integer greater than or equal to 2;
The number of the processed messages comprises: the number of i th processed message to the number of i+ (T-1) th processed message;
the obtaining the total message number of the messages to be processed, the unprocessed residual message number and the processed message number includes:
acquiring the total number of the ith messages in the ith polling period;
carrying out batch processing on the message to be processed under the limit of the j-1 th batch processing number to obtain the unprocessed i-th residual message number and the processed i-th processed message number; wherein j is an integer of 2 or more;
continuing the batch processing of the ith+1 polling period under the limit of the jth batch processing number until the ith+ (T-1) polling period is reached, and acquiring the number of the ith+ (T-1) processed messages and the number of unprocessed ith+ (T-1) residual messages, thereby completing the acquisition of the total number of the messages to be processed, the number of unprocessed residual messages and the number of processed messages; wherein T is the number of periods of the polling period to be processed, and T is an integer greater than or equal to 2.
In the above scheme, the obtaining a batch number based on the total number of messages, the number of remaining messages, and the number of processed messages, and performing a batch process of the messages based on the batch number, includes:
And determining the j+1th batch processing number corresponding to the (i+T) th polling period to the (i+2) (T-1) th polling period according to the (i+ (T-1) th remaining message number, the (i) th message total number and the (i) th processed message number to the (i+ (T-1) th processed message number, and then using the j+1th batch processing number for subsequent batch processing, thereby obtaining a batch processing number based on the message total number, the remaining message number and the processed message number, and performing message batch processing based on the batch processing number.
In the above solution, obtaining the total number of the ith messages in the ith polling period includes:
if i is greater than 1, the i-1 th residual message number of the i-1 th polling period is obtained for the i-th polling period;
and receiving the ith group of messages, acquiring the ith received message quantity of the ith group of messages, and determining the sum of the ith-1 th residual message quantity and the ith received message quantity as the total quantity of the ith messages of the messages to be processed in the ith polling period.
In the above solution, the determining the j+1th batch processing number corresponding to the i+2nd (T-1) th polling period from the i+1th remaining number of messages, the i-th total number of messages, and the i-th processed number of messages to the i+1th processed number of messages includes:
Subtracting the total number of the ith messages from the number of the i+ (T-1) th remaining messages, adding the number of the ith processed messages to the sum of the number of the ith+ (T-1) th processed messages, and dividing the obtained result by the cycle number T of the polling cycle to be processed to obtain the j+1th batch processing number corresponding to the i+T polling cycle to the i+2 (T-1) th polling cycle.
In the above scheme, the method further comprises:
if i is equal to 1, acquiring the total number of 1 st messages of the messages to be processed in the 1 st polling period;
carrying out batch processing on the message to be processed under the limit of a preset initial batch processing number to obtain the number of unprocessed 1 st residual messages and the number of processed 1 st processed messages;
continuing batch processing of the 2 nd polling period under the limitation of the preset initial batch processing number until the T polling period is reached, and acquiring the number of the T processed messages and the number of unprocessed T residual messages; wherein T is the period number of the polling period to be processed, and T is more than or equal to 2;
and determining the 2 nd batch processing number corresponding to the 1+T polling period to the 2T-1 polling period according to the T remaining message number, the 1 st message total number and the 1 st processed message number to the T processed message number, wherein the 2 nd batch processing number is used for batch processing in the follow-up process.
In the above solution, the obtaining the 1 st total number of messages of the to-be-processed messages in the 1 st polling period includes:
and receiving the 1 st group of messages, acquiring the 1 st received message number of the 1 st group of messages, and determining the 1 st received message number as the 1 st message total number of the messages to be processed in the 1 st polling period.
In the above solution, the determining the 2 nd batch number corresponding to the 1+t polling period to the 2T-1 polling period according to the T-th remaining number of messages, the 1 st total number of messages, and the 1 st number of processed messages to the T-th number of processed messages includes:
subtracting the total number of the 1 st message from the number of the T remaining messages, adding the sum of the number of the 1 st processed messages to the number of the T processed messages, and dividing the obtained result by the cycle number T of the polling cycle to be processed to obtain the 2 nd batch processing number corresponding to the 1+T polling cycle to the 1+2 (T-1) polling cycle.
In the above scheme, the batch processing is performed on the to-be-processed message under the limitation of the jth batch processing number, to obtain the number of unprocessed ith remaining messages and the number of processed ith processed messages, including:
If the preset number of the messages processed in the ith polling period is larger than the j-1 th batch processing number, reducing the preset number to the j-1 th batch processing number;
batch processing is carried out on the messages meeting the preset quantity in the messages to be processed;
the number of unprocessed i-th residual messages and the number of processed i-th processed messages are obtained.
The embodiment of the invention also provides a message processing device, which comprises:
the acquisition unit is used for acquiring the total number of messages of the messages to be processed, the number of unprocessed residual messages and the number of processed messages;
the determining unit is used for obtaining a batch processing number based on the total number of the messages, the number of the rest messages and the number of the processed messages;
and the batch processing unit is used for carrying out batch processing on the messages based on the batch processing number.
In the above scheme, the total number of messages includes: the method comprises the steps of (1) obtaining the total number of i-th messages, wherein the total number of the i-th messages is the total number of messages to be processed in an i-th polling period, the i-th polling period is the polling period to be processed, and i is a positive integer; the number of the remaining messages includes: the number of the i-th residual message to the number of the i+ (T-1) -th residual message; wherein T is the number of periods of a polling period to be processed, and T is an integer greater than or equal to 2; the number of the processed messages comprises: the number of i th processed message to the number of i+ (T-1) th processed message;
The acquiring unit is further configured to acquire a total number of i messages in an i polling period; acquiring the unprocessed i-th residual message quantity and the processed i-th processed message quantity; the number of the i+ (T-1) th processed messages and the number of unprocessed i+ (T-1) th residual messages are obtained, wherein T is the number of periods of a polling period to be processed, and T is more than or equal to 2;
the batch processing unit is further configured to batch process the message to be processed in the ith polling period under the limitation of the j-1 th batch processing number; and continuing the batch processing of the (i+1) th polling period under the limitation of the jth batch processing number until the (i+ (T-1) th polling period is reached;
the determining unit is further configured to determine, according to the i+ (T-1) th remaining number of messages, the i th total number of messages, and the i th number of processed messages to the i+ (T-1) th number of processed messages, a j+1th batch number corresponding to the i+t polling period to the i+2 (T-1) th polling period, where the j+1th batch number is used for subsequent batch processing.
The embodiment of the invention also provides a message processing device, which comprises:
a memory for storing executable instructions;
And the processor is used for realizing the message processing method in the scheme when executing the executable instructions stored in the memory.
The embodiment of the invention also provides a storage medium which stores executable instructions for realizing the message processing method in the scheme when the processor is caused to execute.
It can be seen that the embodiments of the present invention provide a method, an apparatus, and a storage medium for processing a message, which can obtain a batch number based on a total number of messages, a number of remaining messages, and a number of processed messages after obtaining a total number of messages, a number of unprocessed remaining messages, and a number of processed messages of a message to be processed, so as to perform a batch processing of the message based on the batch number. Therefore, the batch processing number can be determined and updated according to the actual situation of batch processing, so that the batch processing number is adaptively adjusted to be matched with the actual situation, and the processing efficiency is improved.
Drawings
Fig. 1 is a schematic diagram of an application scenario of a message processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for processing a message according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a message processing method according to an embodiment of the present invention;
FIG. 4 is a flowchart III of a message processing method according to an embodiment of the present invention;
FIG. 5 is a flowchart of a message processing method according to an embodiment of the present invention;
FIG. 6 is a flowchart fifth of a message processing method according to an embodiment of the present invention;
FIG. 7 is a flowchart sixth of a message processing method according to an embodiment of the present invention;
FIG. 8 is a flowchart seventh of a message processing method according to an embodiment of the present invention;
FIG. 9 is a flowchart eighth of a message processing method according to an embodiment of the present invention;
FIG. 10 is a schematic diagram illustrating an effect of a message processing method according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a message processing apparatus according to a second embodiment of the present invention.
Detailed Description
The technical solution of the present invention will be further elaborated with reference to the accompanying drawings and examples, which should not be construed as limiting the invention, but all other embodiments which can be obtained by one skilled in the art without making inventive efforts are within the scope of protection of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
If a similar description of "first/second" appears in the present document, the following description is added, in which the terms "first/second/third" merely distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first/second/third" may, where allowed, interchange a specific order or precedence order such that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present invention, as shown in fig. 1, a message processing apparatus may be applied in a server 300; the server 300 is in communication connection with the cloud platform 301, the client 1 and the client 2, so that the server 300 can receive the messages to be processed from the cloud platform 301, the client 1 and the client 2 and batch-process the messages to be processed.
Fig. 2 is a schematic flow chart of an alternative method for processing a message according to an embodiment of the present invention, and will be described with reference to the steps shown in fig. 2.
S101, obtaining the total number of messages of the messages to be processed, the number of unprocessed residual messages and the number of processed messages.
In the embodiment of the present invention, a message (message) is a data unit exchanged and transmitted in a network, that is, a data block to be sent by a station at one time. The message processing apparatus may perform batch processing on the message in a Polling (Polling) manner, that is, the batch processing apparatus performs batch processing on the message at regular time, and a period of time during which batch processing is performed each time is referred to as a Polling period.
In the embodiment of the invention, the total number of the messages to be processed comprises: the total number of i-th messages; the total number of the ith messages is the total number of the messages to be processed in the ith polling period; the ith polling period is a polling period to be processed, and i is a positive integer;
the number of the remaining messages includes: the number of the i-th residual message to the number of the i+ (T-1) -th residual message; the number of the i-th residual messages to the i+ (T-1) -th residual messages are respectively the number of the residual messages after batch processing from the i-th polling period to the i+ (T-1) -th polling period; t is the number of periods of a polling period to be processed, and T is an integer greater than or equal to 2;
The number of messages processed includes: the number of i th processed message to the number of i+ (T-1) th processed message; the number of the i-th processed messages to the i+ (T-1) -th processed messages are the number of the messages which are batched when the i-th polling period to the i+ (T-1) -th polling period are batched respectively.
The message processing device can acquire the total number of the ith messages in the ith polling period; then, under the limit of the j-1 th batch processing number, batch processing is carried out on the message to be processed, and the unprocessed i-th residual message quantity and the processed i-th processed message quantity are obtained; wherein j is an integer of 2 or more; finally, under the limit of the j-th batch processing number, the batch processing of the i+1th polling period is continued until the i+ (T-1) th polling period is reached, and the i+ (T-1) th processed message quantity and the i+ (T-1) th unprocessed residual message quantity are obtained, so that the total message quantity of the messages to be processed, the unprocessed residual message quantity and the processed message quantity are obtained.
S102, obtaining a batch processing number based on the total number of messages, the number of residual messages and the number of processed messages, and carrying out message batch processing based on the batch processing number.
In the embodiment of the invention, after the message processing device obtains the i+ (T-1) th residual message number, the i th total message number and the i th processed message number to the i+ (T-1) th processed message number, the j+1th batch processing number corresponding to the i+T polling period to the i+2 (T-1) th polling period can be determined according to the i+T residual message number, the i+T residual message number and the i+processed message number, and is used in subsequent batch processing, so that the batch processing number is obtained based on the total message number, the residual message number and the processed message number, and the batch processing of the messages is performed based on the batch processing number.
In some embodiments of the present invention, the total number of messages includes: the total number of i-th messages; the total number of the ith messages is the total number of the messages to be processed in the ith polling period; the ith polling period is a polling period to be processed, and i is a positive integer; the number of the remaining messages includes: the number of the i-th residual message to the number of the i+ (T-1) -th residual message; wherein T is the number of periods of a polling period to be processed, and T is an integer greater than or equal to 2; the number of messages processed includes: the number of i th processed message to the number of i+ (T-1) th processed message; s101 shown in fig. 2 described above may be implemented by S201 to S203 shown in fig. 3, and each step will be described.
S201, obtaining the total number of the ith messages in the ith polling period.
In the embodiment of the invention, the message processing device can receive a certain amount of newly arrived messages after the last polling period is finished; after the polling period starts, carrying out batch processing on part or all of all messages in the polling period, wherein all messages in the polling period comprise the rest messages which are not processed in the previous polling period and the newly arrived messages in the polling period; after the batch processing of the polling period is completed, the polling period is ended. For example, after the 2 nd polling period is batched, 4 unprocessed messages remain; after the 2 nd polling period is finished, 2 new arrival messages are received; after the 3 rd polling period starts, carrying out batch processing on all messages in the polling period, which comprise 4 unprocessed messages remained in the 2 nd polling period and 2 newly arrived messages received after the 2 nd polling period ends, of 6 messages in total; after the 3 rd polling period batch process is completed, the 3 rd polling period is ended.
In the embodiment of the invention, the message processing device can preset the cycle number T of the polling cycle to be processed, wherein T is an integer greater than or equal to 2, and the T-1 polling cycle after one polling cycle to be processed is determined as the next polling cycle to be processed, and sequentially recursion. For example, if T is preset to be 4, determining the 4 th polling period as the first polling period to be processed, then determining the 3 rd polling period after the 4 th polling period, that is, the 7 th polling period as the next polling period to be processed; the 3 rd polling period after the 7 th polling period, namely the 10 th polling period is the next polling period to be processed; the successive recursion can result in the ith polling period being the polling period to be processed when i=1+3n (N > 0). For another example, if the preset T is 2, determining the 1 st polling period as the first polling period to be processed, then determining the 1 st polling period after the 1 st polling period, that is, the 2 nd polling period is the next polling period to be processed; the 1 st polling period after the 2 nd polling period, namely the 3 rd polling period is the next polling period to be processed; the successive recursion can result in the ith polling period being the polling period to be processed when i=n (N > 0).
In the embodiment of the invention, the total number of the ith messages of the messages to be processed in the ith polling period comprises the following steps: the i-1 th remaining message number of the i-1 st polling period, and the i-th received message number of the i-th group of received messages. And determining the sum of the i-1 th residual message number and the i-th received message number as the i-th message total number.
It can be understood that the polling period to be processed is set periodically, so that the polling period to be processed is distributed uniformly, uniformity of the collected data when the batch processing number is calculated each time is ensured, missing collection or repeated collection of the data is avoided, and therefore the calculated batch processing number is more stable and reliable.
S202, carrying out batch processing on the message to be processed under the limit of the j-1 th batch processing number, and obtaining the unprocessed i-th residual message number and the processed i-th processed message number; wherein j is an integer of 2 or more.
In the embodiment of the invention, the message processing device determines the j-1 th batch processing number in the last polling period to be processed before the ith polling period, wherein j is an integer greater than 1. Then, under the limit of the j-1 th batch processing number, batch processing is carried out on the message to be processed in the ith polling period, and the unprocessed ith residual message quantity and the processed ith processed message quantity are obtained.
The ith (T-1) polling period is the last polling period to be processed before the ith polling period, the jth-1 batch processing number is determined in the ith (T-1) polling period, and the jth-1 batch processing number is used for limiting the ith (T-1) +1 polling period until the batch processing is performed in the ith polling period. That is, a batch number is determined for each polling period to be processed, and the determined batch number is used to limit the next polling period after the polling period to be processed until the batch processing is performed in the next polling period to be processed after the polling period to be processed. For example, if T is preset to be 4, and the 7 th polling period is a polling period to be processed, the determined number of batches in the 7 th polling period is used to limit the 8 th polling period until the 10 th polling period (i.e., the next polling period to be processed after the 7 th polling period can be substituted into the batch processed in i+ (T-1)).
The number of unprocessed i-th residual messages is the number of the messages remained after batch processing in the i-th polling period; the number of the processed i-th processed messages is the number of the messages which are batched in the i-th polling period.
In the embodiment of the invention, the message processing device can judge the preset number of the messages processed in the ith polling period before the messages are batched in the ith polling period. If the predetermined number of the messages processed in the ith polling period is greater than the j-1 th batch processing number, the message processing device reduces the predetermined number to the j-1 th batch processing number. That is, the number of batches limits the upper limit of the number of batches of messages in one polling period, and when the predetermined number of processed messages is greater than the number of batches, the predetermined number is reduced to the number of batches.
It will be appreciated that the number of batches determined in each pending polling period is used to limit the next polling period following the pending polling period until the batch is performed in the next pending polling period following the pending polling period. Thus, the periodical dynamic update of the batch number can be realized, and the dynamic adjustment of the batch process is ensured.
S203, continuing the batch processing of the (i+1) th polling period under the limit of the j-th batch processing number until the (i+ (T-1) th polling period is reached, and acquiring the (i+ (T-1) th processed message number and the (i+ (T-1) th unprocessed residual message number, thereby completing the acquisition of the total message number of the messages to be processed, the unprocessed residual message number and the processed message number.
In the embodiment of the invention, the message processing device continues the batch processing of the (i+1) th polling period under the limit of the (j) th batch processing number, and simultaneously acquires the (i+1) th processed message number and the (i+1) th unprocessed residual message number. And (3) carrying out batch processing of the ith (T-1) polling period until the ith (T-1) polling period, and obtaining the number of the ith (T-1) processed messages and the number of unprocessed ith (T-1) residual messages, wherein T is the number of periods of the polling period to be processed, and T is an integer greater than or equal to 2. Thus, the batch processing of each of the i+1th to i+ (T-1) th polling periods is performed under the limitation of the jth batch processing number, and the number of processed messages and the number of unprocessed remaining messages of each polling period are obtained.
The j-th batch processing number is determined by the message processing device in the i-th polling period to be processed. The message processing apparatus determines a jth batch processing number in an ith polling period, the jth batch processing number being used to limit the (i+1) th polling period until the batch processing performed in the (i+ (T-1) th polling period.
The number of unprocessed i+1th residual messages is the number of residual messages after batch processing in the i+1th polling period; the number of the processed i+1th processed messages is the number of messages subjected to batch processing in the i+1th polling period. The number of the unprocessed i+ (T-1) th residual messages is the number of the residual messages after batch processing in the i+ (T-1) th polling period; the number of processed messages in the i+ (T-1) th processed is the number of messages batched in the i+ (T-1) th polling period. The ith polling period and the ith + (T-1) polling period are adjacent two polling periods to be processed. That is, the message processing apparatus acquires the related data including two adjacent polling periods to be processed and the batch processing of all the polling periods between the two polling periods, in preparation for determining the next batch processing number.
It will be appreciated that obtaining the number of processed messages and the number of unprocessed remaining messages for each of the i+1th to i+ (T-1) th polling periods can accumulate a sufficient data basis for the determination of the number of batches, making the determined number of batches closer to actual, more reliable.
In some embodiments of the present invention, S102 shown in fig. 2 and described above may be implemented through S204 shown in fig. 3, and each step will be described.
S204, determining the j+1th batch processing number corresponding to the (i+T) polling period to the (i+2) (T-1) polling period according to the (i+ (T-1) th residual message number, the (i) th total message number and the (i) th processed message number, and determining the batch processing number based on the total message number, the residual message number and the processed message number, and performing message batch processing based on the batch processing number.
In the embodiment of the invention, the message processing device determines the j+1th batch processing number according to the i+ (T-1) th residual message number, the i th total message number and the i th processed message number to the i+ (T-1) th processed message number, and is used for batch processing from the i+T polling period to the i+2 (T-1) th polling period.
In the embodiment of the invention, a manager of the message processing device can finish the determination and update of the batch processing number at any time; the upper loop limit may be set, and when the number of times of the determination and update of the number of batches reaches the upper loop limit, the determination and update of the number of batches is ended. There is no limitation in this regard.
It can be understood that, in the embodiment of the present invention, the j+1th batch number for limiting the i+t polling period to the i+2 (T-1) polling period is determined according to the data of the i+th polling period to the i+ (T-1) polling period, that is, the batch number of the next polling period is determined according to the data of the historical polling period according to the preset period number. Therefore, the batch processing number is dynamically updated according to the closest historical data at regular intervals, so that the batch processing number is adaptively adjusted, the batch processing number is matched with the actual situation, and the processing efficiency is improved.
In some embodiments of the present invention, S201 shown in fig. 3 described above may be implemented through S2011-S2012 shown in fig. 4, and each step will be described.
S2011, if i is larger than 1, the i-1 th residual message number of the i-1 th polling period is obtained for the i-th polling period.
In the embodiment of the invention, the message processing device acquires the i-1 th residual message number of the i-1 th polling period and is used for determining the total number of the messages to be processed of the i-1 th polling period. The number of the i-1 th residual messages in the i-1 th polling period is the number of the residual messages after batch processing is carried out in the i-1 th polling period.
S2012, receiving the ith group of messages, acquiring the number of the ith received messages of the ith group of messages, and determining the sum of the number of the i-1 th residual messages and the number of the ith received messages as the total number of the ith messages of the messages to be processed in the ith polling period.
In the embodiment of the invention, a message processing device receives an ith group of messages and acquires the quantity of the ith received messages of the ith group of messages; and then adding the obtained i-1 th residual message quantity and the i-th received message quantity, and determining the obtained added sum as the i-th message total quantity of the messages to be processed in the i-th polling period. That is, the total number of messages in one polling period is the sum of the remaining number of messages in the last polling period and the number of messages newly received in the present polling period.
In some embodiments of the present invention, S204 shown in fig. 3 and described above may be implemented by S2041 shown in fig. 5, and the steps will be described.
S2041, subtracting the total number of the ith messages from the number of the i+ (T-1) th remaining messages, adding the sum of the number of the ith processed messages to the number of the i+ (T-1) th processed messages, and dividing the obtained result by the period number T of the polling period to be processed to obtain the j+1th batch processing number corresponding to the i+Tth polling period to the i+2th (T-1) th polling period.
In the embodiment of the present invention, the message processing apparatus may implement S2041 through a calculation formula, and the specific calculation formula (1) is:
wherein B is j+1 For the j+1st lotNumber of treatments, l i+(T-1) For the number of i+ (T-1) th remaining messages, L i For the i-th total number of messages, b a And T is the number of the polling periods to be processed for the number a of the processed messages.
It will be appreciated that the j+1th batch number for limiting the i+t polling period to the i+2th (T-1) polling period is determined based on the data batch-processed from the i polling period to the i+ (T-1) polling period, that is, the batch number of the next polling period is determined based on the data batch-processed from one historical polling period periodically according to the preset number of periods. Therefore, the batch processing number is dynamically updated according to the nearest historical data at regular intervals, the batch processing number is matched with the actual situation, and the processing efficiency is improved.
In some embodiments of the present invention, if i is equal to 1, S201 to S204 shown in fig. 3 can be implemented through S301 to S304 shown in fig. 6, and each step will be described.
S301, if i is equal to 1, acquiring the total number of 1 st messages in the 1 st polling period.
In the embodiment of the invention, the message processing device acquires the 1 st message total number in the 1 st polling period, wherein the 1 st message total number is the total number of messages to be processed in the 1 st polling period.
S302, carrying out batch processing on the messages to be processed under the limit of a preset initial batch processing number, and obtaining the number of unprocessed 1 st residual messages and the number of processed 1 st processed messages.
In the embodiment of the invention, the message processing device limits batch processing by using a preset initial batch processing number because of insufficient batch processing historical data for the 1 st polling period to the T th polling period. The message processing device performs batch processing on the to-be-processed message in the 1 st polling period under the limit of a preset initial batch processing number, and acquires the number of unprocessed 1 st residual messages and the number of processed 1 st processed messages.
S303, continuing batch processing of the 2 nd polling period under the limit of a preset initial batch processing number until the T-th polling period is reached, and acquiring the T-th processed message number and the unprocessed T-th residual message number; wherein T is the period number of the polling period to be processed, and T is more than or equal to 2.
In the embodiment of the invention, the message processing device continues the batch processing of the 2 nd polling period under the limit of the preset initial batch processing number, and simultaneously acquires the 2 nd processed message number of the 2 nd polling period and the unprocessed 2 nd residual message number. And when the T polling period is reached, carrying out batch processing of the T polling period, and obtaining the quantity of the T processed messages and the quantity of unprocessed T residual messages, wherein T is the period number of the polling period to be processed, and T is more than or equal to 2.
S304, determining the 2 nd batch processing number corresponding to the 1+T polling period to the 2T-1 polling period according to the T remaining message number, the 1 st message total number and the 1 st processed message number to the T processed message number, and providing the 2 nd batch processing number for subsequent batch processing.
In the embodiment of the invention, the message processing device determines the 2 nd batch processing number according to the T remaining message number, the 1 st message total number, and the 1 st processed message number to the T processed message number, and is used for batch processing from the 1+T polling period to the 2T-1 polling period.
It will be appreciated that there is insufficient historical batch data for the 1 st to T th polling periods, so that the number of batches cannot be determined computationally. Therefore, the preset initial batch processing number is set to limit the 1 st polling period to the T th polling period, so that the batch processing from the 1 st polling period to the T th polling period can be effectively performed.
In some embodiments of the present invention, S301 shown in fig. 6 and described above may be implemented by S3011 shown in fig. 7, and each step will be described.
S3011, receiving the 1 st group of messages, obtaining the 1 st received message number of the 1 st group of messages, and determining the 1 st received message number as the 1 st total number of messages of the to-be-processed messages in the 1 st polling period.
In the embodiment of the invention, a message processing device receives the 1 st group of messages and acquires the 1 st received message number of the 1 st group of messages; and then determining the acquired 1 st received message number as the 1 st message total number of the messages to be processed in the 1 st polling period.
It will be appreciated that for the 1 st polling period, there are no remaining messages that were not processed in the previous polling period. Therefore, the 1 st received packet number is determined as the 1 st packet total number of the pending packets of the 1 st polling period.
In some embodiments of the present invention, S304 shown in fig. 6 and described above may be implemented through S3041 shown in fig. 8, and each step will be described.
S3041, subtracting the total number of the 1 st message from the number of the T remaining messages, adding the sum of the number of the 1 st processed messages to the number of the T processed messages, and dividing the obtained result by the period number T of the polling period to be processed to obtain the 2 nd batch processing number corresponding to the 1+T polling period to the 1+2 (T-1) polling period.
In the embodiment of the present invention, the message processing apparatus may implement S3041 through a calculation formula, and an exemplary specific calculation formula (2) is:
wherein B is 2 For the 2 nd batch number, l T For the number of the T-th residual messages, L 1 For the 1 st total number of messages, b a And T is the number of the polling periods to be processed for the number a of the processed messages.
In some embodiments of the present invention, S202 shown in fig. 3 described above may be implemented by S2021-S2023 shown in fig. 9, and the steps will be described in connection.
S2021, if the predetermined number of the processing messages in the ith polling period is greater than the j-1 th batch processing number, reducing the predetermined number to the j-1 th batch processing number.
In the embodiment of the invention, the message processing device can judge the preset number of the messages processed in the ith polling period before the messages are batched in the ith polling period. If the predetermined number of the messages processed in the ith polling period is greater than the j-1 th batch processing number, the message processing device reduces the predetermined number to the j-1 th batch processing number. That is, the number of batches limits the upper limit of the number of batches of messages in one polling period, and when the predetermined number of processed messages is greater than the number of batches, the predetermined number is reduced to the number of batches.
S2022, carrying out batch processing on the messages meeting the preset quantity in the messages to be processed.
In the embodiment of the invention, the message processing device acquires a batch of messages meeting the preset quantity in the messages to be processed, and then carries out batch processing on the acquired batch of messages.
S2023, acquiring the number of unprocessed i-th residual messages and the number of processed i-th processed messages.
In the embodiment of the invention, after finishing the batch processing of the ith polling period, the message processing device acquires the unprocessed ith residual message quantity and the processed ith processed message quantity in the ith polling period.
The following describes a message processing method according to an embodiment of the present invention according to an application scenario, as shown in fig. 10, including the following steps:
in a network input/Output System (NetBIOS, network Basic Input/Output System), a batch processing is performed on a message, that is, in a packet receiving and transmitting process and a message processing flow, a function call processes a plurality of messages. According to the principle of time/space locality, batch processing can significantly improve the hit rate of a processor Cache (CPU Cache), and the cost of stack/register set context switching during function call is shared. However, the smaller the batch processing number is, the more the single packet processing overhead is increased, the processing capacity of the processor is reduced, the network throughput is reduced, but the single packet processing time delay can be reduced, and the network time delay is reduced; the larger the batch processing number is, the single packet processing overhead is reduced, the processing capacity of the processor is increased, the network throughput is improved, but the single packet processing time delay is increased, and the network time delay is increased. Therefore, the static batch number cannot simultaneously meet the requirements of high throughput and low delay of the network under different flow models.
S401, setting a period number t=4 of a polling period to be processed, and counting the polling period t=1.
S402, in the 1 st polling period, batch processing is carried out on the message to be processed, and the polling period count T is confirmed to not reach the period number T=4, and is changed to 2.
In the embodiment of the present invention, as shown in fig. 10, in the 1 st polling period, the number of newly arrived messages in the 1 st polling period is 7, the number of batch-processed messages in the 1 st polling period is 5, and the number of unprocessed messages in the 1 st polling period is 2. After the batch processing is completed, the message processing device confirms that the polling period count T does not reach the period number T=4 of the polling period to be processed, and changes the polling period count T to 2.
S403, in the 2 nd polling period, batch processing is carried out on the message to be processed, and the polling period count T is confirmed to not reach the period number T=4, and is changed to 3.
In the embodiment of the present invention, as shown in fig. 10, in the 2 nd polling period, the number of newly arrived messages in the 2 nd polling period is 2, the number of batch-processed messages in the 2 nd polling period is 2, and the number of unprocessed messages in the 2 nd polling period is 2. After the batch processing is completed, the message processing device confirms that the polling period count T does not reach the period number T=4 of the polling period to be processed, and changes the polling period count T to 3.
S404, in the 3 rd polling period, the message to be processed is batched, and the polling period count T is confirmed to not reach the period number T=4, and the polling period count T is changed to 4.
In the embodiment of the present invention, as shown in fig. 10, in the 3 rd polling period, the number of newly arrived messages in the 3 rd polling period is 2, the number of batch-processed messages in the 3 rd polling period is 2, and the number of unprocessed messages in the 3 rd polling period is 2. After the batch processing is completed, the message processing device confirms that the polling period count T does not reach the period number T=4 of the polling period to be processed, and changes the polling period count T to 4.
S405, in the 4 th polling period, batch processing is carried out on the message to be processed, the polling period count T is confirmed to reach the period number T=4, the batch processing number is calculated and updated, and the polling period count T is changed to 1.
In the embodiment of the present invention, as shown in fig. 10, in the 4 th polling period, the number of newly arrived messages in the 4 th polling period is 0, the number of batch-processed messages in the 4 th polling period is 2, and the number of unprocessed messages in the 4 th polling period is 0. After finishing the batch processing, the message processing device confirms that the polling period count T has reached the period number T=4 of the polling period to be processed, and calculates and updates the batch processing number on the basis of the batch processing data from the 1 st polling period to the 4 th polling period. After the message processing device completes the calculation, the polling period count t is changed to 1 for the next polling period to be counted again.
In the embodiment of the invention, the message processing device determines the remaining message quantity l of the 4 th polling period on the basis of the batch processing data from the 1 st polling period to the 4 th polling period 4 The 1 st total number of messages L of the 1 st polling period =0 1 The number of processed messages from the 1 st polling period to the 4 th polling period is b 1 =5,b 2 =2,b 3 =2,b 4 =2, and substituting the above values into formula (1) to obtain a calculation formula (3), and calculating to obtain a 2 nd batch number B corresponding to the 5 th to 7 th polling periods 2
Fig. 11 is a schematic structural diagram of an alternative packet processing device according to an embodiment of the present invention. As shown in fig. 11, an embodiment of the present invention further provides a message processing apparatus 800, including: an acquisition unit 804, a determination unit 805, a batch processing unit 806, wherein:
an obtaining unit 804, configured to obtain a total number of messages of the messages to be processed, a remaining number of unprocessed messages, and a processed number of processed messages;
a determining unit 805, configured to obtain a batch number based on the total number of messages, the number of remaining messages, and the number of processed messages;
a batch processing unit 806, configured to batch process the message based on the batch processing number.
In some embodiments of the present invention, the total number of messages includes: the total number of i-th messages; the method comprises the steps of determining the total number of the ith messages as the total number of the messages to be processed in the ith polling period, wherein the ith polling period is the polling period to be processed, and i is a positive integer; the number of the remaining messages includes: the number of the i-th residual message to the number of the i+ (T-1) -th residual message; wherein T is the number of periods of a polling period to be processed, and T is an integer greater than or equal to 2; the number of messages processed includes: the number of i th processed message to the number of i+ (T-1) th processed message;
The obtaining unit 804 is further configured to obtain a total number of i-th packets in the i-th polling period; acquiring the number of unprocessed i-th residual messages and the number of processed i-th processed messages; and acquiring the number of the i+ (T-1) th processed messages and the number of unprocessed i+ (T-1) th residual messages;
the batch processing unit 806 is further configured to batch process the message to be processed in the ith polling period under the limitation of the j-1 th batch processing number; and continuing the batch processing of the (i+1) th polling period under the limitation of the jth batch processing number until the (i+ (T-1) th polling period is reached;
the determining unit 805 is further configured to determine, according to the i+ (T-1) th remaining number of messages, the i th total number of messages, and the i th number of processed messages to the i+ (T-1) th number of processed messages, a j+1th batch number corresponding to the i+t polling period to the i+2th (T-1) polling period, for use in a subsequent batch processing.
In some embodiments of the present invention, the obtaining unit 804 is further configured to obtain, for the i-1 th polling period, the i-1 st remaining number of messages in the i-1 st polling period if i is greater than 1; the method comprises the steps of receiving an ith group of messages, obtaining the number of the ith received messages of the ith group of messages, and determining the sum of the number of the i-1 th residual messages and the number of the ith received messages as the total number of the ith messages of the messages to be processed in the ith polling period.
In some embodiments of the present invention, the determining unit 805 is further configured to subtract the number of i+ (T-1) th remaining messages from the number of i th messages, add the sum of the number of i th processed messages to the number of i+ (T-1) th processed messages, and divide the obtained result by the number of periods T of the polling period to be processed to obtain the j+1th batch processing number corresponding to the i+t polling period to the i+2 (T-1) th polling period.
In some embodiments of the present invention, the obtaining unit 804 is further configured to obtain a 1 st total number of messages to be processed in the 1 st polling period if i is equal to 1; acquiring the number of unprocessed 1 st residual messages and the number of processed 1 st processed messages; the number of the T processed messages and the number of unprocessed T residual messages are obtained, wherein T is the period number of a polling period to be processed, and T is more than or equal to 2;
the batch processing unit 806 is further configured to batch process the to-be-processed packet in the 1 st polling period under the limitation of a preset initial batch processing number; and continuing batch processing of the 2 nd polling period under the limit of the preset initial batch processing number until the T-th polling period is reached;
The determining unit 805 is further configured to determine a 2 nd batch number corresponding to the 1+t polling period to the 2T-1 polling period according to the T-th remaining message number, the 1 st message total number, and the 1 st processed message number to the T-th processed message number, for use in subsequent batch processing.
In some embodiments of the present invention, the obtaining unit 804 is further configured to receive the 1 st group of messages, obtain the 1 st number of received messages of the 1 st group of messages, and determine the 1 st number of received messages as the 1 st total number of messages of the to-be-processed messages in the 1 st polling period.
In some embodiments of the present invention, the determining unit 805 is further configured to subtract the total number of the 1 st messages from the number of the T remaining messages, add the sum of the number of the 1 st processed messages to the number of the T processed messages, and divide the obtained result by the number T of the polling periods to be processed to obtain the 2 nd batch number corresponding to the 1+t polling periods to the 1+2 (T-1) polling periods.
In some embodiments of the present invention, the batch processing unit 806 is further configured to reduce the predetermined number to the j-1 th batch processing number if the predetermined number of the processed packets in the i-th polling period is greater than the j-1 th batch processing number; and carrying out batch processing on the messages meeting the preset quantity in the messages to be processed.
It should be noted that, fig. 12 is an optional structural schematic diagram of a message processing apparatus according to an embodiment of the present invention, and as shown in fig. 12, hardware entities of the message processing apparatus 800 include: a processor 801, a communication interface 802, and a memory 803, wherein:
the processor 801 generally controls the overall operation of the message processing apparatus 800.
Communication interface 802 may enable message processing apparatus 800 to communicate with other apparatuses or devices over a network.
The memory 803 is configured to store instructions and applications executable by the processor 801, and may also cache data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or processed by each module in the processor 801 and the message processing apparatus 800, which may be implemented by a flash memory (FLAS H) or a random access memory (Random Access Memory, RAM).
It should be noted that, in the embodiment of the present invention, if the method for detecting malicious behavior is implemented in the form of a software functional module, and sold or used as a separate product, the method may also be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied essentially or in a part contributing to the related art in the form of a software product stored in a storage medium, including several instructions for causing the message processing apparatus 800 (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the invention provides a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned method.

Claims (12)

1. A method for processing a message, comprising:
acquiring the total number of messages of the messages to be processed, the number of unprocessed residual messages and the number of processed messages;
obtaining a batch processing number based on the total number of messages, the number of residual messages and the number of processed messages, and carrying out message batch processing based on the batch processing number;
the total number of messages comprises: the total number of the ith messages, i is a positive integer; the total number of the ith messages is the total number of the messages to be processed in the ith polling period; the ith polling period is a polling period to be processed;
the number of the remaining messages includes: the number of the residual messages in the ith polling period is up to the number of the residual messages in the ith plus (T-1) polling period; wherein T is the number of periods of a polling period to be processed, and T is an integer greater than or equal to 2;
the number of the processed messages comprises: the number of processed messages in the ith polling period to the number of processed messages in the ith+ (T-1) polling period;
The obtaining a batch number based on the total number of messages, the number of remaining messages, and the number of processed messages includes:
and determining the j+1th batch processing number corresponding to the i+2th (T-1) polling period according to the number of the rest messages of the i+1th polling period, the total number of the i messages and the number of the processed messages of the i polling period to the number of the processed messages of the i+1th polling period, wherein j is an integer greater than or equal to 2.
2. The method for processing messages according to claim 1, wherein said obtaining a total number of messages of the messages to be processed, a remaining number of messages not processed, and a processed number of messages processed includes:
acquiring the total number of the ith messages in the ith polling period;
carrying out batch processing on the message to be processed under the limit of the j-1 th batch processing number, and obtaining the number of the unprocessed rest messages of the ith polling period and the number of the processed messages of the processed ith polling period;
and continuing the batch processing of the ith+1 polling period under the limit of the jth batch processing number until the ith+ (T-1) polling period is reached, and acquiring the processed message quantity of the ith+ (T-1) polling period and the unprocessed residual message quantity of the ith+ (T-1) polling period, thereby completing the acquisition of the message total quantity of the messages to be processed, the unprocessed residual message quantity and the processed message quantity.
3. The method according to claim 2, wherein the obtaining the total number of the ith messages in the ith polling period includes:
if i is greater than 1, aiming at the ith polling period, acquiring the residual message quantity of the ith-1 polling period;
receiving an ith group of messages, wherein the ith group of messages are new messages received after the end of an ith-1 polling period; and determining the sum of the number of the rest messages of the ith-1 polling period and the number of the ith group of messages as the total number of the ith messages of the ith polling period.
4. The method according to claim 1, wherein the determining the j+1th batch processing number corresponding to the i+t (T-1) th polling period to the i+2 (T-1) th polling period according to the remaining number of messages of the i+ (T-1) th polling period, the total number of messages of the i th polling period, and the number of processed messages of the i th polling period to the number of processed messages of the i+ (T-1) th polling period includes:
subtracting the total number of the ith messages from the number of the rest messages in the ith (T-1) polling period, adding the number of the processed messages in the ith polling period to the sum of the number of the processed messages in the ith (T-1) polling period, and dividing the obtained result by the period number T of the to-be-processed polling period to obtain the j+1 batch processing number corresponding to the ith (T) polling period to the ith (T-1) polling period.
5. The method for processing a message according to any one of claims 2 to 4, further comprising:
if i is equal to 1, acquiring the total number of 1 st messages in the 1 st polling period;
under the limitation of the preset initial batch processing number, carrying out batch processing on the message to be processed to obtain the number of the remaining messages of the unprocessed 1 st polling period and the number of the processed messages of the processed 1 st polling period;
continuing batch processing of the 2 nd polling period under the limitation of the preset initial batch processing number until the T polling period is reached, and acquiring the processed message quantity of the T polling period and the residual message quantity of the unprocessed T polling period; wherein T is the period number of the polling period to be processed, and T is more than or equal to 2;
and determining the 2 nd batch processing number corresponding to the 1+T polling period to the 2T-1 polling period according to the residual message number of the T polling period, the 1 st message total number and the processed message number of the 1 st polling period to the processed message number of the T polling period, wherein the 2 nd batch processing number is used for carrying out batch processing subsequently.
6. The method for processing messages according to claim 5, wherein said obtaining the 1 st total number of messages to be processed in the 1 st polling period comprises:
Receiving a 1 st group of messages, wherein the 1 st group of messages are messages received before the 1 st polling period starts; and determining the number of the 1 st group of messages as the total number of the 1 st messages of the messages to be processed in the 1 st polling period.
7. The method according to claim 6, wherein the determining the number of 2 nd batches corresponding to the 1+t polling periods to the 2T-1 st polling period according to the remaining number of messages in the T-th polling period, the total number of 1 st messages, and the number of processed messages in the 1 st polling period to the number of processed messages in the T-th polling period includes:
subtracting the total number of the 1 st messages from the number of the rest messages in the T-th polling period, adding the sum of the number of the processed messages in the 1 st polling period to the number of the processed messages in the T-th polling period, and dividing the obtained result by the period number T of the to-be-processed polling period to obtain the 2 nd batch processing number corresponding to the 1+T-th polling period to the 2T-1 nd polling period.
8. The method for processing a message according to claim 2, wherein the batch processing the message to be processed under the limitation of the jth batch processing number to obtain the remaining number of messages in the unprocessed ith polling period and the processed number of messages in the processed ith polling period includes:
If the preset number of the messages processed in the ith polling period is larger than the j-1 th batch processing number, reducing the preset number to the j-1 th batch processing number;
batch processing is carried out on the messages meeting the preset quantity in the messages to be processed;
and acquiring the number of the unprocessed residual messages of the ith polling period and the number of the processed messages of the processed ith polling period.
9. A message processing apparatus, comprising:
the acquisition unit is used for acquiring the total number of messages of the messages to be processed, the number of unprocessed residual messages and the number of processed messages;
the determining unit is used for obtaining a batch processing number based on the total number of the messages, the number of the rest messages and the number of the processed messages;
the batch processing unit is used for carrying out batch processing on the messages based on the batch processing number; the total number of messages comprises: the total number of the ith messages, i is a positive integer; the total number of the ith messages is the total number of the messages to be processed in the ith polling period; the ith polling period is a polling period to be processed; the number of the remaining messages includes: the number of the residual messages in the ith polling period is up to the number of the residual messages in the ith plus (T-1) polling period; wherein T is the number of periods of a polling period to be processed, and T is an integer greater than or equal to 2; the number of the processed messages comprises: the number of processed messages in the ith polling period to the number of processed messages in the ith+ (T-1) polling period;
The determining unit is further configured to determine a j+1th batch processing number corresponding to the i+2th (T-1) polling period from the i+t polling period to the i+2 (T-1) polling period according to the remaining number of messages in the i+1 polling period, the i-th total number of messages, and the number of messages processed in the i-th polling period to the number of messages processed in the i+1 polling period.
10. The message processing apparatus as recited in claim 9, wherein,
the acquiring unit is further configured to acquire a total number of i messages in an i polling period; acquiring the number of the unprocessed residual messages of the ith polling period and the number of the processed messages of the processed ith polling period; the number of processed messages of the ith+ (T-1) polling period and the number of unprocessed residual messages of the ith+ (T-1) polling period are obtained;
the batch processing unit is further configured to batch process the message to be processed in the ith polling period under the limitation of the j-1 th batch processing number; and continuing the batch processing of the (i+1) th polling period until the (i+ (T-1) th polling period is reached under the limit of the (j) th batch processing number.
11. A message processing apparatus, comprising:
a memory for storing executable instructions;
a processor for implementing the method of any one of claims 1 to 8 when executing executable instructions stored in said memory.
12. A storage medium having stored thereon executable instructions for causing a processor to perform the method of any one of claims 1 to 8.
CN202110385322.2A 2021-04-09 2021-04-09 Message processing method, device and storage medium Active CN113204392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110385322.2A CN113204392B (en) 2021-04-09 2021-04-09 Message processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110385322.2A CN113204392B (en) 2021-04-09 2021-04-09 Message processing method, device and storage medium

Publications (2)

Publication Number Publication Date
CN113204392A CN113204392A (en) 2021-08-03
CN113204392B true CN113204392B (en) 2024-04-09

Family

ID=77026488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110385322.2A Active CN113204392B (en) 2021-04-09 2021-04-09 Message processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN113204392B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9632850B1 (en) * 2016-05-05 2017-04-25 International Business Machines Corporation Polling parameter adjustment
CN108259377A (en) * 2018-02-13 2018-07-06 中国联合网络通信集团有限公司 Queue assignment method and device
CN109299049A (en) * 2018-10-11 2019-02-01 郑州云海信息技术有限公司 A kind of processing method and processing device of file access request
CN111461583A (en) * 2019-01-18 2020-07-28 北京京东尚科信息技术有限公司 Inventory counting method and device
CN112612607A (en) * 2020-12-16 2021-04-06 平安消费金融有限公司 Data processing method, device, computer equipment and medium based on message queue

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9632850B1 (en) * 2016-05-05 2017-04-25 International Business Machines Corporation Polling parameter adjustment
CN108259377A (en) * 2018-02-13 2018-07-06 中国联合网络通信集团有限公司 Queue assignment method and device
CN109299049A (en) * 2018-10-11 2019-02-01 郑州云海信息技术有限公司 A kind of processing method and processing device of file access request
CN111461583A (en) * 2019-01-18 2020-07-28 北京京东尚科信息技术有限公司 Inventory counting method and device
CN112612607A (en) * 2020-12-16 2021-04-06 平安消费金融有限公司 Data processing method, device, computer equipment and medium based on message queue

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杜永斐.内容分发系统中关键策略研究.《中国优秀硕士论文 信息科技》.2014,全文. *

Also Published As

Publication number Publication date
CN113204392A (en) 2021-08-03

Similar Documents

Publication Publication Date Title
CN113242568A (en) Task unloading and resource allocation method in uncertain network environment
CN108449286B (en) Network bandwidth resource allocation method and device
CN111049756B (en) Request response method and device, electronic equipment and computer readable storage medium
CN107708152B (en) Task unloading method of heterogeneous cellular network
CN102640455B (en) Permit again distribution method, demodulator and admission control system thereof
CN110808922A (en) Message processing method and device, storage medium and electronic equipment
CN107948084B (en) Current limiting method and device
CN104734985A (en) Data receiving flow control method and system
CN111225050A (en) Cloud computing resource allocation method and device
CN112367270A (en) Method and equipment for sending message
CN116506953A (en) Multi-channel switching method, system and medium applied to intelligent communication system
CN113204392B (en) Message processing method, device and storage medium
US7689798B2 (en) Method and device for determining size of memory frames
CN114205310A (en) Data transmission method and device based on time-sensitive network and electronic equipment
CN108023938B (en) Message sending method and server
CN113747507A (en) Computing resource management method and device for 5G ultra-dense network
CN110347477B (en) Service self-adaptive deployment method and device in cloud environment
CN113992586A (en) Flow control method and device, computer equipment and storage medium
CN111124672A (en) Data distribution method based on Redis cluster and related equipment
CN112511702B (en) Media frame pushing method, server, electronic equipment and storage medium
CN106899510B (en) Transmission rate control method and device based on iSCSI protocol
CN107707383B (en) Put-through processing method and device, first network element and second network element
CN107800648B (en) Data packet scheduling method and device
CN110266814A (en) Transmission method and transmitting device
CN116401071B (en) Resource allocation method and system for edge calculation

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
GR01 Patent grant
GR01 Patent grant