A message queue management method and device, processing equipment and storage medium

CN115629893BActive Publication Date: 2026-10-27HANGZHOU ANHENG INFORMATION SECURITY TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211382171.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-07
Publication Date
2026-10-27
Estimated Expiration
2042-11-07

AI Technical Summary

Technical Problem

[0005]基于此,有必要针对上述技术问题,提供一种消息队列管理方法、装置、处理设备和存储介质,以解决相关技术中亟需一种能够准确处理消息队列中消息的方式的问题

Benefits of technology

[0010]通过本申请实施例提供的消息队列管理方法,消费者只要在接收生产者产生的大量待处理消息时,从其中获取所述消息标识,基于消息标识将待处理消息送入消息队列中,就能够使每个待处理消息被及时准确执行,避免不必要的损失,从而生产者在产生消息时,既不需要关心消息被送入哪一条消息队列,也不需要关注消息能否被顺利执行,大大减少工作量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115629893B_ABST
    Figure CN115629893B_ABST
Patent Text Reader

Abstract

The application relates to a message queue management method and device, processing equipment and a storage medium. The method comprises the following steps: receiving a to-be-processed message; acquiring a message identifier of the to-be-processed message; and sending the to-be-processed message into a message queue based on the message identifier. The method can ensure that each to-be-processed message is executed in time and accurately, avoid unnecessary losses, and greatly reduce workload.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a message queue management method, apparatus, processing device, and storage medium. Background Technology

[0002] With the rapid development of large-scale applications, various business operations of these applications need to run across microservices. This has led to the emergence of cross-microservice messaging technologies. Microservices exchange information via messages, and message queues, as the carriers of these messages, typically consist of a series of messages following a "first-in, first-out" (FIFO) principle. Messages are processed strictly according to the order in the message queue. However, some messages have delayed or queue-jumping attributes and cannot be processed promptly and correctly. Therefore, how to implement delayed message processing or interception has become an important research topic in the field of computer technology.

[0003] In existing technologies, message queues are usually divided into different types, and messages with different attributes are moved into different message queues accordingly. This approach not only requires processing the contents of each message queue separately, increasing workload, but also cannot guarantee that each message can be processed in a timely and accurate manner when there are a large number of messages.

[0004] Therefore, there is an urgent need in related technologies for a way to accurately process messages in message queues. Summary of the Invention

[0005] Therefore, it is necessary to provide a message queue management method, apparatus, processing device, and storage medium to address the aforementioned technical problems and solve the urgent need in related technologies for a way to accurately process messages in message queues.

[0006] In a first aspect, embodiments of this application provide a message queue management method, comprising the following steps:

[0007] Receive pending messages;

[0008] Obtain the message identifier of the message to be processed;

[0009] The message to be processed is sent to the message queue based on the message identifier.

[0010] With the message queue management method provided in this application embodiment, when a consumer receives a large number of messages to be processed generated by a producer, it only needs to obtain the message identifier from them and send the messages to be processed into the message queue based on the message identifier. This enables each message to be processed to be executed in a timely and accurate manner, avoiding unnecessary losses. Thus, when a producer generates a message, it does not need to care which message queue the message is sent to or whether the message can be executed smoothly, greatly reducing the workload.

[0011] Optionally, in one embodiment of this application, the message identifier includes an immediate execution identifier, and sending the message to be processed into the message queue based on the message identifier includes:

[0012] The message to be processed is sent to the head of the message queue.

[0013] Optionally, in one embodiment of this application, the message identifier includes a delayed execution identifier, and sending the message to be processed into the message queue based on the message identifier includes:

[0014] Determine whether the pending message needs to be suspended based on the delay execution flag;

[0015] If the pending message needs to be suspended, the pending message is sent to the head of the message queue, and message reception stops within the delay time. The pending message is then processed based on the delay time.

[0016] Optionally, in one embodiment of this application, the message identifier includes a delayed execution identifier, and the step of determining whether the message to be processed needs to be suspended based on the delayed execution identifier includes:

[0017] If the message to be processed does not need to be suspended, then the message to be processed is sent to the message queue based on the delay time.

[0018] Optionally, in one embodiment of this application, the message identifier includes a queue-jumping identifier, and sending the message to be processed into the message queue based on the message identifier includes:

[0019] Obtain the queue-jumping message information based on the queue-jumping identifier;

[0020] The message to be processed is sent into the message queue based on the interrupted message information.

[0021] Optionally, in one embodiment of this application, sending the message to be processed into the message queue based on the message identifier includes:

[0022] If the message to be interrupted is not found in the queue identifier, the message to be processed is sent to the head of the message queue.

[0023] Optionally, in one embodiment of this application, receiving the message to be processed includes:

[0024] Send the local machine's identity and the message information to be processed to the message manager.

[0025] Secondly, embodiments of this application also provide a message queue management device, the device comprising:

[0026] The pending message receiving module is used to receive pending messages;

[0027] The message identifier acquisition module is used to acquire the message identifier of the message to be processed;

[0028] The message queue management module is used to send the message to be processed into the message queue based on the message identifier.

[0029] Thirdly, this application also provides a processing device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the steps of the methods described in the above embodiments.

[0030] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the methods described in the various embodiments above.

[0031] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0032] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0033] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;

[0034] Figure 2 This is a flowchart of a message queue management method provided in one embodiment of this application;

[0035] Figure 3 This is a flowchart of the message queue management method for managing immediately executed messages provided in one embodiment of this application;

[0036] Figure 4 This is a flowchart of a delayed execution message management method provided in one embodiment of the message queue management method of this application;

[0037] Figure 5 This is a flowchart of a message queue management method for managing queued messages provided in one embodiment of this application;

[0038] Figure 6 This is an embodiment of the actual interaction process between the producer and the consumer provided in this application;

[0039] Figure 7This is a schematic diagram of the module structure of the message queue management device provided in the embodiments of this application;

[0040] Figure 8 This is a schematic diagram of the module structure of the processing device provided in the embodiments of this application. Detailed Implementation

[0041] To better understand the purpose, technical solution, and advantages of this application, the application is described and explained below in conjunction with the accompanying drawings and embodiments.

[0042] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0043] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of a terminal for a message queue management method according to an embodiment of this application. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0044] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the network data processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0046] The message queue management method described in this application will be explained in detail below with reference to the accompanying drawings. Figure 2 This is a flowchart illustrating one embodiment of the message queue management method provided in this application. While this application provides method operation steps as shown in the following embodiments or figures, the method may include more or fewer operation steps based on conventional or non-inventive methods. For steps that do not logically have a necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual network data processing or method execution, the method may be executed in the order shown in the embodiments or figures, or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0047] Specifically, one implementation of the message queue management method provided in this application is, for example... Figure 2 As shown, the method may include:

[0048] S201: Receive messages to be processed.

[0049] The executing entity in each embodiment of this application can be a consumer. Typically, large-scale applications are developed using a microservice architecture. When various business systems within the application need to interact, they usually need to run across microservices. These microservices exchange information via messages. The microservice node that sends the message is called the producer, and the microservice node that receives the message is called the consumer. The producer sends the message, and the message is temporarily stored in a message management queue. The consumer then retrieves the message from the queue.

[0050] The consumer has a message queue to be processed, which consists of a series of messages to be processed. The messages to be processed are sent by the producer and are processed by the consumer in a first-in, first-out (FIFO) order. That is, the messages that enter the message queue first are placed at the head of the queue and are processed by the consumer first, and the messages that enter the message queue later are queued up in order.

[0051] S203: Obtain the message identifier of the message to be processed;

[0052] Messages sent by producers have different execution requirements due to variations in their actions and intended purposes; therefore, different messages possess different attributes. In one embodiment of this application, each message sent by the producer has a corresponding message attribute table, including message information uniquely identifying the message, a message identifier indicating the message status, and characteristic information corresponding to the message status. The message information is a message ID; each message has an independent and unique message ID, facilitating quick location of each message by the consumer. The message status may include, for example, immediate execution, delayed execution, or queue jumping. The characteristic information corresponding to the message status may include, for example, the delayed execution time, whether the consumer needs to suspend, and queue jumping information. For instance, in one example, the message attribute table is shown in Table 1 below, which can record the execution requirements of each message.

[0053] Message ID(A) Message Identifier A Feature Information A Message ID(B) Message Identifier B Feature information B Message ID(C) Message identifier C Feature information C

[0054] S205: Send the message to be processed into the message queue based on the message identifier.

[0055] After receiving the message identifier of a message to be processed, the consumer sends it to the corresponding position in the message queue according to the message status. In practical applications, multiple producers generate a large number of messages simultaneously, and most messages are executed within a very short time frame. Therefore, it is necessary to immediately and accurately determine the execution requirements of each message and send it to the precise position in the message queue. Based on this, in the embodiments of this application, message identifiers are used to distinguish messages with different attributes, determine the execution requirements of the message to be processed, and send it to the appropriate position in the message queue.

[0056] The message queue management method provided in this application can receive messages to be processed, obtain the message identifier of the message to be processed, and send the message to be processed into the message queue based on the message identifier. In other words, when a consumer receives a large number of messages to be processed generated by a producer, it only needs to obtain the message identifier from them and send the messages to be processed into the message queue based on the message identifier. This ensures that each message to be processed is executed promptly and accurately, avoiding unnecessary losses. Therefore, when a producer generates a message, it does not need to worry about which message queue the message is sent to or whether the message can be executed successfully, greatly reducing workload.

[0057] In one embodiment of this application, such as Figure 3 As shown, the message identifier includes an immediate execution identifier, and sending the message to be processed into the message queue based on the message identifier includes:

[0058] S301: Send the message to be processed to the head of the message queue.

[0059] When the message identifier of the message to be processed is the immediate execution identifier, it means that the message to be processed is a message that needs to be processed immediately, and the message to be processed is sent to the head of the message queue.

[0060] In the above embodiments, a message to be processed is obtained, and if it is determined to be a message to be processed immediately by its message identifier, the message to be processed is sent to the head of the message queue to be processed, so that the consumer can process the message to be processed immediately and avoid unnecessary losses due to untimely processing.

[0061] In one embodiment of this application, such as Figure 4 As shown, the message identifier includes a delayed execution identifier, and the step of sending the message to be processed into the message queue based on the message identifier includes:

[0062] S401: Determine whether the pending message needs to be suspended based on the delayed execution flag;

[0063] When the message identifier of the pending message is a delayed execution identifier, it means that the pending message needs to be processed with a delay. Further, based on its delay characteristic information, the delay time for delayed processing is obtained, and it is determined whether the current consumer needs to perform a suspension operation.

[0064] S403: If the pending message needs to be suspended, the pending message is sent to the head of the message queue, and message reception is stopped within the delay time, and the pending message is processed based on the delay time.

[0065] If a pending message requires the current consumer to suspend it, the message is moved to the head of the message queue, but processing is temporarily suspended until a delay period. During this delay, the current consumer does not receive other pending messages until the previously requested message is processed within the delay period. After this delay, the suspended state is lifted, and the consumer resumes receiving pending messages normally.

[0066] In the above embodiment, a message to be processed is obtained. Its message identifier indicates it is a message requiring delayed processing. Further determination indicates that the consumer needs to perform a suspend operation. The message to be processed is then placed at the head of the message queue, and processing is temporarily suspended. During the delay period, no other messages to be processed are received. Once the delay period expires, the message at the head of the queue is processed immediately. Afterward, the suspended state is lifted, and normal message reception resumes. This message queue management method ensures that messages with delayed attributes are processed accurately and promptly, preventing the microservice node from missing the execution time of delayed messages while processing other messages.

[0067] Optionally, in one embodiment of this application, after determining whether the message to be processed needs to be suspended based on the delayed execution identifier, the process includes:

[0068] S405: If the message to be processed does not need to be suspended, then the message to be processed is sent to the message queue based on the delay time.

[0069] If the current pending message does not require the current consumer to perform a suspend operation, the pending message is sent to the corresponding position in the message queue based on the delay time. In the consumer's pending message queue, all pending messages are arranged according to a first-in, first-out (FIFO) rule. Furthermore, messages entering the pending message queue are marked with a time partition based on their entry time. When the delay time of a pending message is obtained, the time partition to which the pending message belongs is found based on this delay time, the corresponding mark is located, and the message is sent to the corresponding position. The consumer continues to receive pending messages normally. When the delay time is reached, the pending message is at the head of the message queue, and the consumer processes it. Specific time partitioning methods can be found in existing technologies and will not be elaborated here.

[0070] In the above embodiment, a message to be processed is obtained, and it is determined to be a message with delayed processing based on its message identifier. It is further determined that the consumer does not need to perform a suspension operation. The message to be processed is sent to the corresponding position in the message queue based on the delay time. The consumer continues to receive messages to be processed normally. When the delay time is reached, the message to be processed that is already at the head of the message queue is processed, so that messages with delayed attributes can be processed accurately and in a timely manner, and the current microservice node does not need to consume resources to repeatedly determine whether the delay execution time of the delayed message has been reached.

[0071] In one embodiment of this application, such as Figure 5 As shown, the message identifier includes a queue-jumping identifier, and the step of sending the message to be processed into the message queue based on the message identifier includes:

[0072] S501: Obtain the queue-jumping message information based on the queue-jumping identifier;

[0073] When the message identifier of the message to be processed is a queue-jumping identifier, it means that the message to be processed needs to be processed before a certain message. Further, based on its queue-jumping characteristic information, the message information of the message that was queued is obtained, including the message information that uniquely identifies the message identity of the message that was queued.

[0074] S503: Based on the interrupted message information, send the message to be processed into the message queue.

[0075] Based on the message information of the message that was interrupted, the message to be processed is sent to the message queue to ensure that it is processed before the message that was interrupted is executed. Specifically, based on the message information of the message that was interrupted, the corresponding message that was interrupted is found, and the message to be processed is sent before the message that was interrupted.

[0076] In the above embodiment, a message to be processed is obtained, and its message identifier is used to determine that it is a message that has jumped the queue. The message information that has jumped the queue is obtained, and the message to be processed is sent to the corresponding position in the message queue, so that the message that jumped the queue can be executed in a timely and accurate manner, and the execution of erroneous messages can be effectively intercepted.

[0077] Optionally, in one embodiment of this application, sending the message to be processed into the message queue based on the message identifier includes:

[0078] S505: If the message to be interrupted is not found in the queue identifier, then the message to be processed is sent to the head of the message queue.

[0079] When the message identifier of the message to be processed is a queue-jumping identifier, the queue-jumping feature information is further obtained. If there is no queue-jumping message information in the queue-jumping feature information, it means that the execution requirement of the message to be processed is the highest priority and needs to be executed immediately. Then the message to be processed is sent to the head of the message queue.

[0080] In the above embodiment, a message to be processed is obtained, and its message identifier is used to determine that it is a message that needs to be queued. If it is further determined that it is a message that needs to be queued and needs to be executed immediately, the message to be processed is sent to the head of the message queue, thereby ensuring that it can be processed first and effectively intercepting the execution of erroneous messages.

[0081] In one embodiment of this application, the step of receiving the message to be processed further includes:

[0082] S207: Send the local machine identity and pending message information to the message manager.

[0083] After a consumer receives a message to be processed, it needs to send its local identity identifier and the message information to the message manager. The local identity identifier is the identity ID of the microservice node currently receiving the message, and the message information is the message ID. The message manager stores the message information for each message received by each consumer, so that when a message to be processed is received, the consumer and the affected message can be quickly located. It can also provide specific information for messages with queue-jumping attributes.

[0084] The following specific example illustrates the actual interaction process between the producer and the consumer. Figure 6As shown, the message queue management system may include producers and consumers. In one embodiment of this application, each message produced by the producer has unique message information identifying the message's identity, namely a message ID, a message identifier indicating message status such as immediate execution, delayed execution, or queue jumping, and characteristic information indicating delayed execution time, whether the consumer needs to suspend, and queue-jumped message information. Each message is temporarily stored in the message queue of the management message, arranged according to the first-in, first-out principle. The message that enters the queue from the tail first is dequeued from the head first and consumed by the consumer. Each consumer has a unique identity ID. The consumer retrieves the message to be processed from the head of the message queue of the management message, sends its own identity ID and the message ID of the received message to be processed back to the message manager, retrieves the message identifier of the message to be processed, and if the message identifier includes an immediate execution identifier, then the message to be processed is sent to the head of the message queue for immediate execution; if the message identifier includes a delayed execution identifier, then it is determined whether the message to be processed needs to be suspended based on the delayed execution identifier. If the message to be processed needs to be suspended, then the message to be processed is sent to the head of the message queue, and receiving is stopped within the delay time. Receive messages and process the pending messages based on the delay time. If the pending messages do not need to be suspended, send the pending messages to the corresponding position in the message queue based on the delay time, and continue to receive pending messages normally until the delay time is reached and the pending messages are executed normally. If the message identifier includes a queue-jumping identifier, obtain the queue-jumping message information based on the queue-jumping identifier, find the queue-jumping message based on the queue-jumping message information, and send the pending messages before the queue-jumping messages. If the queue-jumping identifier does not contain the queue-jumping message information, send the pending messages to the head of the message queue.

[0085] In another embodiment of this application, the producer sends a message to shut down the server cluster and sets it to execute after a predetermined time, such as 30 seconds or 5 minutes. When the microservice node that performs the shutdown operation receives the message, it waits for the scheduled execution time. If the operator discovers an error in the shutdown operation and needs to terminate it, it can instruct the producer to immediately send a termination message. This message contains a queue-jumping identifier and characteristic information, including the identity ID of the microservice node performing the shutdown operation and the message ID of the shutdown message to be terminated. This allows for immediate and accurate location of the shutdown message in the pending message queue of the microservice node performing the shutdown operation, prioritizing the termination message and intercepting its execution. This avoids unnecessary losses and significantly reduces workload.

[0086] This application also provides a message queue management device 700, such as... Figure 7 As shown, the device includes:

[0087] The pending message receiving module is used to receive pending messages;

[0088] The message identifier acquisition module is used to acquire the message identifier of the message to be processed;

[0089] The message queue management module is used to send the message to be processed into the message queue based on the message identifier.

[0090] Optionally, in one embodiment of this application, the message identifier includes an immediate execution identifier, and sending the message to be processed into the message queue based on the message identifier includes:

[0091] The message to be processed is sent to the head of the message queue.

[0092] Optionally, in one embodiment of this application, the message identifier includes a delayed execution identifier, and sending the message to be processed into the message queue based on the message identifier includes:

[0093] Determine whether the pending message needs to be suspended based on the delay execution flag;

[0094] If the pending message needs to be suspended, the pending message is sent to the head of the message queue, and message reception stops within the delay time. The pending message is then processed based on the delay time.

[0095] Optionally, in one embodiment of this application, the message identifier includes a delayed execution identifier, and the step of determining whether the message to be processed needs to be suspended based on the delayed execution identifier includes:

[0096] If the message to be processed does not need to be suspended, then the message to be processed is sent to the message queue based on the delay time.

[0097] Optionally, in one embodiment of this application, the message identifier includes a queue-jumping identifier, and sending the message to be processed into the message queue based on the message identifier includes:

[0098] Obtain the queue-jumping message information based on the queue-jumping identifier;

[0099] The message to be processed is sent into the message queue based on the interrupted message information.

[0100] Optionally, in one embodiment of this application, sending the message to be processed into the message queue based on the message identifier includes:

[0101] If the message to be interrupted is not found in the queue identifier, the message to be processed is sent to the head of the message queue.

[0102] Optionally, in one embodiment of this application, receiving the message to be processed includes:

[0103] Send the local machine's identity and the message information to be processed to the message manager.

[0104] It should also be noted that the embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the accompanying drawings of the device embodiments provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0105] This application also provides a processing device, including a memory and a processor, wherein the memory stores computer program instructions, and the processor is configured to execute the computer program instructions to perform the methods described in the above embodiments.

[0106] The processing device can be a physical device or a cluster of physical devices, or it can be a virtualized cloud device, such as at least one cloud computing device in a cloud computing cluster. For ease of understanding, this application illustrates the structure of the processing device as an independent physical device.

[0107] like Figure 8 As shown, the processing device 800 includes a processor and a memory for storing computer program instructions for the processor; wherein the processor is configured to implement the above-described means when executing the computer program instructions. The processing device 800 includes a memory 801, a processor 803, a bus 805, and a communication interface 807. The memory 801, processor 803, and communication interface 807 communicate via the bus 805. The bus 805 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 8 The symbol is represented by only one thick line, but this does not indicate that there is only one bus or one type of bus. The communication interface 807 is used for communication with external devices.

[0108] The processor 803 can be a central processing unit (CPU). The memory 801 can include volatile memory, such as random access memory (RAM). The memory 801 can also include non-volatile memory, such as read-only memory (ROM), flash memory, HDD or SSD, etc.

[0109] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0110] This application also provides a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the steps of the methods described in the above embodiments.

[0111] A computer-readable storage medium can be a tangible device capable of holding and storing instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), electrically programmable read-only memory (EPROM or flash memory), static random-access memory (SRAM), compact disc read-only memory (CD-ROM), digital video disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof.

[0112] The computer program instructions described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer program instructions from the network and forwards them to a computer-readable storage medium within the respective computing / processing device.

[0113] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as "C" or similar languages. The computer program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from computer program instructions. These electronic circuits can execute computer program instructions to implement various aspects of this application.

[0114] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods and apparatus according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.

[0115] These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0116] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other equipment to perform the functions / actions specified in one or more blocks of a flowchart and / or block diagram.

[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatuses, systems, and methods according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.

[0118] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A message queue management method, characterized in that, The method includes: Receive pending messages; Obtain the message identifier of the message to be processed; The message to be processed is sent to the message queue based on the message identifier; Message identifiers include immediate execution identifiers, delayed execution identifiers, and queue jumping identifiers; When the message identifier is a delayed execution identifier, sending the message to be processed into the message queue based on the message identifier includes: Determine whether the pending message needs to be suspended based on the delay execution flag; If the pending message needs to be suspended, the pending message is sent to the head of the message queue, and message reception stops within the delay time. The pending message is then processed based on the delay time.

2. The message queue management method according to claim 1, characterized in that, The message identifier includes an immediate execution identifier, and the step of sending the message to be processed into the message queue based on the message identifier includes: The message to be processed is sent to the head of the message queue.

3. The message queue management method according to claim 1, characterized in that, The message identifier includes a delayed execution identifier, and the step of determining whether the message to be processed needs to be suspended based on the delayed execution identifier includes: If the message to be processed does not need to be suspended, then the message to be processed is sent to the message queue based on the delay time.

4. The message queue management method according to claim 1, characterized in that, The message identifier includes a queue-jumping identifier, and the step of sending the message to be processed into the message queue based on the message identifier includes: Obtain the queue-jumping message information based on the queue-jumping identifier; The message to be processed is sent into the message queue based on the interrupted message information.

5. The message queue management method according to claim 4, characterized in that, Sending the message to be processed into the message queue based on the message identifier includes: If the message to be interrupted is not found in the queue identifier, the message to be processed is sent to the head of the message queue.

6. The message queue management method according to claim 1, characterized in that, After receiving the message to be processed, the following is included: Send the local machine's identity and the message information to be processed to the message manager.

7. A message queue management device, characterized in that, The device includes: The pending message receiving module is used to receive pending messages; The message identifier acquisition module is used to acquire the message identifier of the message to be processed; the message identifier includes an immediate execution identifier, a delayed execution identifier, and a queue-jumping identifier. The message queue management module is used to send the message to be processed into the message queue based on the message identifier; When the message identifier is a delayed execution identifier, the message queue management module is further configured to determine whether the message to be processed needs to be suspended based on the delayed execution identifier; if the message to be processed needs to be suspended, the message to be processed is sent to the head of the message queue, and message reception is stopped within the delay time, and the message to be processed is processed based on the delay time.

8. A processing device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method, device and terminal for adjusting broadcast message queue

    CN106933686A

  • Method for managing message oriented middlewares

    CN107592215A

  • Data processing method and device

    CN112346840A

  • Full distribution type aggregation network servicer system

    CN1410905A