CN114945005A - Message processing method and related equipment - Google Patents
Message processing method and related equipment Download PDFInfo
- Publication number
- CN114945005A CN114945005A CN202210568044.9A CN202210568044A CN114945005A CN 114945005 A CN114945005 A CN 114945005A CN 202210568044 A CN202210568044 A CN 202210568044A CN 114945005 A CN114945005 A CN 114945005A
- Authority
- CN
- China
- Prior art keywords
- message
- parameter
- processing
- flow control
- delay time
- 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.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 24
- 238000000034 method Methods 0.000 claims abstract description 55
- 230000008569 process Effects 0.000 claims abstract description 24
- 238000004891 communication Methods 0.000 claims description 3
- 230000000903 blocking effect Effects 0.000 abstract description 7
- 230000003993 interaction Effects 0.000 abstract description 6
- 230000003111 delayed effect Effects 0.000 abstract description 5
- 238000004590 computer program Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000007474 system interaction Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/28—Flow control; Congestion control in relation to timing considerations
- H04L47/283—Flow control; Congestion control in relation to timing considerations in response to processing delays, e.g. caused by jitter or round trip time [RTT]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
- H04L47/2433—Allocation of priorities to traffic types
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/6205—Arrangements for avoiding head of line blocking
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The message processing method and the related device provided by the disclosure can obtain a first message, wherein the first message carries a delay time parameter, a deduplication parameter and a flow control parameter; performing delay processing on the first message by using the delay time parameter, and determining the processing time of the first message; under the condition that the processable time is reached, determining whether the first message is subjected to deduplication processing according to the deduplication parameters, and if so, removing a second message which is obtained in the delayed processing process and is the same as the first message; and adding the first message to the target message queue according to the flow control parameter. According to the method and the device, the priority of the message can be accurately distinguished through the delay time parameter, the de-duplication parameter and the flow control parameter carried by the message, the message with different priorities is guaranteed to be correspondingly processed, meanwhile, the number of the messages added to the message queue is reduced, message blocking can be effectively relieved, and the interaction efficiency of the system is improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a message processing method and related devices.
Background
Currently, interaction between related systems often needs to be completed through a message queue. However, as the complexity of the system increases and the number of messages increases, the system interaction faces the problems of long message blocking time and untimely message processing, resulting in inefficient system interaction and even system crash.
Therefore, how to reduce the message congestion and process the message in time becomes a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
In view of the foregoing problems, the present disclosure provides a message processing method and related device that overcome or at least partially solve the foregoing problems, and the technical solutions are as follows:
a method of message processing, comprising:
obtaining a first message, wherein the first message carries a delay time parameter, a deduplication parameter and a flow control parameter;
performing delay processing on the first message by using the delay time parameter, and determining the processing time of the first message;
under the condition that the processable time is reached, determining whether the first message is subjected to deduplication processing according to the deduplication parameter, and if so, removing a second message which is obtained in the delayed processing process and is identical to the first message;
and adding the first message to a target message queue according to the flow control parameter.
Optionally, before the obtaining the first message, the method further includes:
generating the first message, wherein the first message comprises meta information corresponding to the first message;
determining a source scene corresponding to the first message according to the meta-information;
configuring the delay time parameter, the deduplication parameter, and the flow control parameter corresponding to the source scenario for the first message.
Optionally, the performing, by using the delay time parameter, a delay process on the first message to determine a processable time of the first message includes:
determining the delay time length of the first message according to the delay time parameter;
and performing delay processing on the first message according to the delay time length, and determining the processing time of the first message according to the obtaining time of the first message and the delay time length.
Optionally, the removing a second message that is the same as the first message and obtained in the delay processing process includes:
according to the meta information in the message, determining a second message which is the same as the first message in other messages obtained in the delay processing process;
removing the second message.
Optionally, the adding the first message to a target message queue according to the flow control parameter includes:
determining at least one scheduling-allowed thread corresponding to the flow control parameter;
and in the condition that any one of the allowed scheduling threads is idle, adding the first message to a target message queue through the idle allowed scheduling thread.
Optionally, the meta information includes a service type, a service parameter, a flow control concurrent thread number, a time when the message is processed, and a name of a processor where the message is processed.
Optionally, the first message is a trigger message for streaming media.
A message processing apparatus comprising: a message obtaining unit, a first determining unit, a second determining unit, a message removing unit and a message adding unit,
the message obtaining unit is configured to obtain a first message, where the first message carries a delay time parameter, a deduplication parameter, and a flow control parameter;
the first determining unit is configured to perform delay processing on the first message by using the delay time parameter, and determine a processable time of the first message;
the second determining unit is configured to determine whether to perform deduplication processing on the first message according to the deduplication parameter when the processable time is reached, and if so, trigger the message removing unit;
the message removing unit is used for removing a second message which is obtained in the delay processing process and is the same as the first message;
and the message adding unit is used for adding the first message to a target message queue according to the flow control parameter.
A computer-readable storage medium on which a program is stored, the program implementing a message processing method of any one of the above when executed by a processor.
An electronic device comprising at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform any of the message processing methods described above.
By means of the technical scheme, the message processing method and the related device provided by the disclosure can obtain the first message, wherein the first message carries the delay time parameter, the duplicate removal parameter and the flow control parameter; performing delay processing on the first message by using the delay time parameter, and determining the processing time of the first message; under the condition that the processable time is reached, determining whether the first message is subjected to deduplication processing according to the deduplication parameters, and if so, removing a second message which is obtained in the delayed processing process and is the same as the first message; and adding the first message to the target message queue according to the flow control parameter. According to the method and the device, the priority of the message can be accurately distinguished through the delay time parameter, the duplication removal parameter and the flow control parameter carried on the message, the messages with different priorities are guaranteed to be correspondingly processed, meanwhile, the number of the messages added to the message queue is reduced, message blocking can be effectively relieved, and the interaction efficiency of the system is improved.
The foregoing description is only an overview of the technical solutions of the present disclosure, and the embodiments of the present disclosure are described below in order to make the technical means of the present disclosure more clearly understood and to make the above and other objects, features, and advantages of the present disclosure more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the disclosure. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating an implementation manner of a message processing method according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating another implementation of a message processing method according to an embodiment of the present disclosure;
fig. 3 is a flowchart illustrating another implementation of a message processing method according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating another implementation of a message processing method according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating another implementation manner of a message processing method according to an embodiment of the present disclosure;
fig. 6 shows a schematic structural diagram of a message processing apparatus provided by an embodiment of the present disclosure;
fig. 7 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, a flowchart of an implementation manner of a message processing method provided in an embodiment of the present disclosure may include:
s100, obtaining a first message, wherein the first message carries a delay time parameter, a deduplication parameter and a flow control parameter.
The first message may be an interactive message generated by the first system for making a remote service call with the second system. Optionally, the first message may be a trigger message for streaming media. Streaming media may include videos, music, audio books, and electronic books, among others.
Wherein the delay time parameter is used to indicate a time for delaying processing of the first message. For example: if the delay time parameter is 5 minutes, the first message is waited for 5 minutes and then processed after being obtained. And under the condition that the delay time parameter is 0 second, immediately processing the first message after obtaining the first message.
Wherein the deduplication parameter is used to indicate whether other messages that are the same as the first message are to be removed.
Wherein the flow control parameter is used for indicating the permission of scheduling the thread set for the first message.
Optionally, based on the method shown in fig. 1, as shown in fig. 2, a flowchart of another implementation of the message processing method provided in the embodiment of the present disclosure may further include, before step S100:
and A100, generating a first message, wherein the first message comprises meta information corresponding to the first message.
The embodiment of the present disclosure may pre-configure the meta information corresponding to the first message, and encapsulate the meta information to generate the first message. Optionally, the meta information includes a service type, a service parameter, a flow control concurrent thread number, a time when the message is processed, and a name of a processor where the message is processed.
And A200, determining a source scene corresponding to the first message according to the meta-information.
Optionally, the source scene may include a manual orchestration video operation trigger message and a video up-and-down automatic trigger message. It can be understood that the source scene can be set according to actual requirements.
And A300, configuring a delay time parameter, a deduplication parameter and a flow control parameter corresponding to a source scene for the first message.
The embodiment of the disclosure may set a delay time parameter, a deduplication parameter, and a flow control parameter corresponding to each source scene in advance, and configure the delay time parameter, the deduplication parameter, and the flow control parameter corresponding to the source scene for the first message after identifying the source scene corresponding to the first message. For example: in the embodiment of the disclosure, when the source scene is a video operation trigger message that is manually arranged, the set delay time parameter may be 0 second, the deduplication parameter may be a parameter corresponding to no deduplication, and the flow control parameter may be a parameter corresponding to all allowable scheduling threads. In the embodiment of the present disclosure, when the source scene is a video offline automatic triggering small resource, the set delay time parameter may be 5 minutes, the deduplication parameter may be a parameter corresponding to deduplication, and the flow control parameter may be a parameter corresponding to one thread allowed to be scheduled.
The embodiment of the disclosure configures a corresponding delay time parameter, a deduplication parameter and a flow control parameter for the first message through a source scene corresponding to the first message. The priority of the first message is defined by the delay time parameter, the deduplication parameter and the flow control parameter, so that the first message can be processed according to the priority in the follow-up process.
S200, delay processing is carried out on the first message by using the delay time parameter, and the processing time of the first message is determined.
Specifically, after any message is obtained, the embodiment of the present disclosure may determine the processing time of each message according to the delay time parameter carried in each message, arrange each message according to the processing time sequence, and perform subsequent processing on the message when the processing time of any message reaches.
Optionally, based on the method shown in fig. 1, as shown in fig. 3, a flowchart of another implementation manner of the message processing method provided in the embodiment of the present disclosure may include that step S200 includes:
s210, determining the delay time length of the first message according to the delay time parameter.
S220, delaying the first message according to the delay time, and determining the processing time of the first message according to the obtaining time and the delay time of the first message.
For ease of understanding, this is illustrated here by way of example: in the case where the delay time parameter is 3 minutes, it may be determined that the delay time period for the first message is 3 minutes, and if the obtaining time at which the first message is obtained is 13:25:00, it may be determined that the processable time of the first message is 13:28: 00.
S300, under the condition that the processable time is up, whether the first message is subjected to the deduplication processing is determined according to the deduplication parameter, and if so, the step S400 is executed.
It can be understood that, in the embodiments of the present disclosure, the parameters corresponding to the deduplication processing and the parameters corresponding to the non-deduplication processing may be preset, for example: the embodiment of the present disclosure may set "0" as a parameter corresponding to non-deduplication processing, and set "1" as a parameter corresponding to deduplication processing. And determining to perform the deduplication processing on the first message when the obtained deduplication parameter is '1', and determining not to perform the deduplication processing on the first message when the obtained deduplication parameter is '0'.
And S400, removing a second message which is obtained in the delay processing process and is the same as the first message.
Optionally, the embodiment of the present disclosure may determine, as the second message, a message that is the same as part or all of the information in the meta information of the first message.
It is understood that, in the process of performing the delay processing on the first message, the embodiment of the present disclosure may continue to obtain other messages. And under the condition that the processing time of the first message is reached, detecting the meta information of each other message, determining a second message which is the same as the first message, and deleting the second message.
Optionally, based on the method shown in fig. 2, as shown in fig. 4, a flowchart of another implementation manner of the message processing method provided in the embodiment of the present disclosure may include that step S400 includes:
s410, according to the meta information in the message, determining a second message which is the same as the first message in other messages obtained in the delay processing process.
Optionally, the embodiment of the present disclosure may determine a message that is the same as the service type and the service parameter of the first message as the second message.
Specifically, the embodiment of the present disclosure may continue to obtain other messages during the process of performing the delay processing on the first message. And under the condition that the processing time of the first message is reached, detecting the service type and the service parameter of each other message, comparing the service type and the service parameter of each other message with the service type and the service parameter of the first message, and if the service type and the service parameter of each other message are the same as the service type and the service parameter of the first message, determining that the other message is a second message which is the same as the first message.
And S420, removing the second message.
For ease of understanding, the description is made herein by way of example: in the case where the delay time parameter is 6 minutes, if the acquisition time at which the first message is acquired is 15:33:00, it is determined that the processable time of the first message is 13:39: 00. And at 13:39:00, detecting the service type and the service parameter of other messages obtained in the process of delay processing of 15:33:00 to 13:38:59, comparing the service type and the service parameter of each other message with the service type and the service parameter of the first message, if the service type and the service parameter of each other message are the same as the service type and the service parameter of the first message, determining that the other messages are the same as the first message, and deleting the second message.
The embodiment of the disclosure can reduce the entering of redundant messages into the message queue by removing the same message, avoid the waste of computer resources caused by the occupation of the thread by the redundant messages, and effectively alleviate the problem of message blocking.
And S500, adding the first message to the target message queue according to the flow control parameter.
Optionally, based on the method shown in fig. 1, as shown in fig. 5, a flowchart of another implementation manner of the message processing method provided in the embodiment of the present disclosure may include that step S500 includes:
and S510, determining at least one scheduling permission thread corresponding to the flow control parameter.
S520, under the condition that any allowed scheduling thread is idle, the first message is added to the target message queue through the idle allowed scheduling thread.
The method and the device for adding the first message to the target message queue can control the thread allowing to be scheduled by adding the first message to the target message queue through the flow control parameter, so that the speed of adding the first message to the target message queue is limited. It will be appreciated that in the event that each scheduling allowed thread of the first message is occupied, the time that the first message is added to the target message queue is delayed until the scheduling allowed thread of the first message is idle.
In a general situation, the more the allowable scheduling threads corresponding to the flow control parameters configured by the messages with higher priorities are, so that the less the possibility that the messages with higher priorities are blocked is before being added to the target message queue, the message with higher priorities can be ensured to be processed in time, and the message processing efficiency is improved.
Optionally, in the embodiment of the present disclosure, the messages in the target message queue may be sequentially transferred to the second system in a first-in first-out manner, so that the second system responds to the messages, and returns the response result to the first system.
The message processing method provided by the present disclosure can obtain a first message, where the first message carries a delay time parameter, a deduplication parameter, and a flow control parameter; performing delay processing on the first message by using the delay time parameter, and determining the processing time of the first message; under the condition that the processable time is reached, determining whether the first message is subjected to deduplication processing according to the deduplication parameters, and if so, removing a second message which is obtained in the delayed processing process and is the same as the first message; and adding the first message to the target message queue according to the flow control parameter. According to the method and the device, the priority of the message can be accurately distinguished through the delay time parameter, the duplication removal parameter and the flow control parameter carried on the message, the messages with different priorities are guaranteed to be correspondingly processed, meanwhile, the number of the messages added to the message queue is reduced, message blocking can be effectively relieved, and the interaction efficiency of the system is improved.
Although the operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Corresponding to the foregoing method embodiment, an embodiment of the present disclosure further provides a message processing apparatus, whose structure is shown in fig. 6, and may include: a message obtaining unit 100, a first determining unit 200, a second determining unit 300, a message removing unit 400, and a message adding unit 500.
A message obtaining unit 100, configured to obtain a first message, where the first message carries a delay time parameter, a deduplication parameter, and a flow control parameter.
The first determining unit 200 is configured to perform delay processing on the first message by using the delay time parameter, and determine a processable time of the first message.
A second determining unit 300, configured to determine whether to perform deduplication processing on the first message according to the deduplication parameter when the processable time is reached, and if so, trigger the message removing unit 400.
A message removing unit 400, configured to remove a second message that is the same as the first message and obtained in the delay processing procedure.
A message adding unit 500, configured to add the first message to the target message queue according to the flow control parameter.
Optionally, the message processing apparatus may further include: the device comprises a message generating unit, a third determining unit and a parameter configuring unit.
A message generating unit, configured to generate a first message before the message obtaining unit 100 obtains the first message, where the first message includes meta information corresponding to the first message.
And a third determining unit, configured to determine, according to the meta information, a source scenario corresponding to the first message.
And the parameter configuration unit is used for configuring a delay time parameter, a deduplication parameter and a flow control parameter corresponding to the source scene for the first message.
Optionally, the first determining unit 200 may be specifically configured to determine a delay duration of the first message according to the delay time parameter; and performing delay processing on the first message according to the delay time length, and determining the processing time of the first message according to the obtaining time and the delay time length of the obtained first message.
Optionally, the message removing unit 400 may be specifically configured to determine, according to the meta information in the message, a second message that is the same as the first message in the other messages obtained in the delay processing process; the second message is removed.
Optionally, the message adding unit 500 is specifically configured to determine at least one scheduling allowing thread corresponding to the flow control parameter; and in the case that any allowed scheduling thread is idle, adding the first message to the target message queue through the idle allowed scheduling thread.
Optionally, the meta information includes a service type, a service parameter, a flow control concurrent thread number, a time when the message is processed, and a name of a processor where the message is processed.
Optionally, the first message is a trigger message for streaming media.
The message processing device provided by the present disclosure may obtain a first message, where the first message carries a delay time parameter, a deduplication parameter, and a flow control parameter; performing delay processing on the first message by using the delay time parameter, and determining the processing time of the first message; under the condition that the processing time is up, determining whether the first message is subjected to the de-duplication processing according to the de-duplication parameters, and if so, removing a second message which is obtained in the delay processing process and is the same as the first message; and adding the first message to the target message queue according to the flow control parameter. According to the method and the device, the priority of the message can be accurately distinguished through the delay time parameter, the duplication removal parameter and the flow control parameter carried on the message, the messages with different priorities are guaranteed to be correspondingly processed, meanwhile, the number of the messages added to the message queue is reduced, message blocking can be effectively relieved, and the interaction efficiency of the system is improved.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
The message processing device comprises a processor and a memory, wherein the message obtaining unit 100, the first determining unit 200, the second determining unit 300, the message removing unit 400, the message adding unit 500 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, the kernel parameters are adjusted to accurately distinguish the message priority through the delay time parameters, the duplication removal parameters and the flow control parameters carried on the messages, so that the messages with different priorities are correspondingly processed, the number of the messages added to the message queue is reduced, the message blocking can be effectively relieved, and the interaction efficiency of the system is improved.
The disclosed embodiments provide a computer-readable storage medium on which a program is stored, the program implementing the message processing method when executed by a processor.
The embodiment of the disclosure provides a processor, which is used for running a program, wherein the message processing method is executed when the program runs.
As shown in fig. 7, an embodiment of the present disclosure provides an electronic device 1000, where the electronic device 1000 includes at least one processor 1001, and at least one memory 1002 and a bus 1003 connected to the processor 1001; the processor 1001 and the memory 1002 complete communication with each other through the bus 1003; the processor 1001 is arranged to call program instructions in the memory 1002 to perform the message handling method described above. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present disclosure also provides a computer program product adapted to perform a program of initializing a message handling method step when executed on an electronic device.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, electronic devices (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, an electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
In the description of the present disclosure, it is to be understood that the directions or positional relationships indicated as referring to the terms "upper", "lower", "front", "rear", "left" and "right", etc., are based on the directions or positional relationships shown in the drawings, and are only for convenience of describing the present invention and simplifying the description, but do not indicate or imply that the positions or elements referred to must have specific directions, be constituted and operated in specific directions, and thus, are not to be construed as limitations of the present disclosure.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The above are merely examples of the present disclosure, and are not intended to limit the present disclosure. Various modifications and variations of this disclosure will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the scope of the claims of the present disclosure.
Claims (10)
1. A message processing method, comprising:
obtaining a first message, wherein the first message carries a delay time parameter, a deduplication parameter and a flow control parameter;
performing delay processing on the first message by using the delay time parameter, and determining the processing time of the first message;
under the condition that the processable time is up, determining whether the first message is subjected to deduplication processing according to the deduplication parameter, and if so, removing a second message which is obtained in the delay processing process and is the same as the first message;
and adding the first message to a target message queue according to the flow control parameter.
2. The method of claim 1, wherein prior to said obtaining the first message, the method further comprises:
generating the first message, wherein the first message comprises meta information corresponding to the first message;
determining a source scene corresponding to the first message according to the meta-information;
configuring the delay time parameter, the deduplication parameter, and the flow control parameter corresponding to the source scenario for the first message.
3. The method of claim 1, wherein the delaying the first message by using the delay time parameter to determine the processable time of the first message comprises:
determining the delay time length of the first message according to the delay time parameter;
and performing delay processing on the first message according to the delay time length, and determining the processing time of the first message according to the obtaining time of the first message and the delay time length.
4. The method of claim 2, wherein the removing of a second message that is identical to the first message and obtained during the delay process comprises:
according to the meta information in the message, determining a second message which is the same as the first message in other messages obtained in the delay processing process;
removing the second message.
5. The method of claim 1, wherein adding the first message to a target message queue according to the flow control parameter comprises:
determining at least one scheduling-allowed thread corresponding to the flow control parameter;
and in the condition that any one of the allowed scheduling threads is idle, adding the first message to a target message queue through the idle allowed scheduling thread.
6. The method of claim 2, wherein the meta information comprises a service type, a service parameter, a flow control concurrency thread number, a time when a message is processed, and a processor name when a message is processed.
7. The method according to any one of claims 1 to 6, wherein the first message is a trigger message for streaming media.
8. A message processing apparatus, comprising: a message obtaining unit, a first determining unit, a second determining unit, a message removing unit and a message adding unit,
the message obtaining unit is configured to obtain a first message, where the first message carries a delay time parameter, a deduplication parameter, and a flow control parameter;
the first determining unit is configured to perform delay processing on the first message by using the delay time parameter, and determine a processable time of the first message;
the second determining unit is configured to determine whether to perform deduplication processing on the first message according to the deduplication parameter when the processable time is reached, and if so, trigger the message removing unit;
the message removing unit is used for removing a second message which is obtained in the delay processing process and is the same as the first message;
and the message adding unit is used for adding the first message to a target message queue according to the flow control parameter.
9. A computer-readable storage medium on which a program is stored, the program implementing a message processing method according to any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory complete mutual communication through the bus; the processor is operable to invoke program instructions in the memory to perform the message processing method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210568044.9A CN114945005B (en) | 2022-05-24 | 2022-05-24 | Message processing method and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210568044.9A CN114945005B (en) | 2022-05-24 | 2022-05-24 | Message processing method and related equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114945005A true CN114945005A (en) | 2022-08-26 |
CN114945005B CN114945005B (en) | 2024-02-06 |
Family
ID=82908770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210568044.9A Active CN114945005B (en) | 2022-05-24 | 2022-05-24 | Message processing method and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114945005B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112925661A (en) * | 2021-03-09 | 2021-06-08 | 广州虎牙科技有限公司 | Message processing method and device, computer equipment and storage medium |
CN112925642A (en) * | 2021-02-25 | 2021-06-08 | 百果园技术(新加坡)有限公司 | Delayed message processing method, device, equipment and storage medium |
WO2021120783A1 (en) * | 2019-12-20 | 2021-06-24 | 华为技术有限公司 | Message processing method and apparatus |
CN113709214A (en) * | 2021-08-04 | 2021-11-26 | 北京快乐茄信息技术有限公司 | Message processing method and device, electronic equipment and storage medium |
-
2022
- 2022-05-24 CN CN202210568044.9A patent/CN114945005B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021120783A1 (en) * | 2019-12-20 | 2021-06-24 | 华为技术有限公司 | Message processing method and apparatus |
CN112925642A (en) * | 2021-02-25 | 2021-06-08 | 百果园技术(新加坡)有限公司 | Delayed message processing method, device, equipment and storage medium |
CN112925661A (en) * | 2021-03-09 | 2021-06-08 | 广州虎牙科技有限公司 | Message processing method and device, computer equipment and storage medium |
CN113709214A (en) * | 2021-08-04 | 2021-11-26 | 北京快乐茄信息技术有限公司 | Message processing method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114945005B (en) | 2024-02-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021180025A1 (en) | Message processing method and apparatus, electronic device and medium | |
CN109582466B (en) | Timed task execution method, distributed server cluster and electronic equipment | |
JP6876806B2 (en) | Blockchain Consensus Formation Methods and Devices | |
US10606653B2 (en) | Efficient priority-aware thread scheduling | |
CN108628688B (en) | Message processing method, device and equipment | |
CN108595315B (en) | Log collection method, device and equipment | |
CN110764930B (en) | Request or response processing method and device based on message mode | |
CN110069217B (en) | Data storage method and device | |
CN108647102B (en) | Service request processing method and device of heterogeneous system and electronic equipment | |
CN109558249B (en) | Control method and device for concurrent operation | |
CN108628615B (en) | Method, device and equipment for detecting abandoned codes | |
CN112416534A (en) | Agent-based task management method and device | |
CN110968406B (en) | Method, device, storage medium and processor for processing task | |
CN114945005A (en) | Message processing method and related equipment | |
CN111159298A (en) | Service request processing method and device, electronic equipment and storage medium | |
CN106960055B (en) | File deletion method and device | |
CN112685158B (en) | Task scheduling method and device, electronic equipment and storage medium | |
CN114995982A (en) | Task processing method and device and storage medium | |
CN113347110A (en) | Flow control method, flow control device, storage medium and equipment | |
CN110908792B (en) | Data processing method and device | |
CN107360441B (en) | User live broadcast room speech control method and device | |
CN110688352B (en) | File deletion method and device and computer readable storage medium | |
CN117041980B (en) | Network element management method and device, storage medium and electronic equipment | |
CN109428915B (en) | Data acquisition method and device | |
CN111858002B (en) | Concurrent processing method, system and device based on asynchronous IO |
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 |