Distributed message distribution processing mechanism

By introducing a distributed message distribution processing mechanism into the application software design, the problem of untimely message processing and blocking in communication between various software submodules is solved, real-time message processing and normal process operation is achieved.

CN120020728APending Publication Date: 2025-05-20NANJING HANYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311542104.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

In the existing application software design, the communication methods between various software submodules lack a unified message processing and forwarding mechanism, resulting in inaccurate communication time control, which may cause blocking the main process or untimely processing.

Method used

A distributed message distribution and processing mechanism is designed to establish message interaction between the service submodule and the unified message processing main module through a unified message creation interface and a message receiving interface. The specific steps include each service submodule creating a message event and forwarding it to the unified message processing main module for storage, sorting and processing through the unified message channel.

Benefits of technology

Through the distributed message processing and distribution mechanism, it is possible to process messages while ensuring the normal operation of the process, avoiding time-consuming messages blocking the main process, and real-time processing of messages is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
Patent Text Reader

Abstract

The invention belongs to the technical field of communication, and particularly relates to a distributed message distribution processing mechanism. According to the scheme, a distributed message processing and distributing mechanism is used, the message processing process is subjected to marginalized issuing and unified processing, normal operation of the process can be fully guaranteed while the message is processed, the situation that a host process is blocked when a certain time-consuming message is processed is avoided, and meanwhile real-time processing of the message is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of communication technologies, and particularly relates to a distributed message distribution and processing mechanism. Background Art

[0002] In current application software designs, the communication methods between software sub-modules are function callbacks, queries, etc. There is no unified message processing and forwarding mechanism, which often causes problems such as inaccurate control of communication time between sub-modules, blocking of the main process, or untimely processing.

[0003] In view of this, the present invention designs a distributed message distribution and processing mechanism to solve the above problems. Summary of the Invention

[0004] Object of the Invention: The object of the present invention is to provide a distributed message distribution and processing mechanism for the deficiencies in current technologies.

[0005] Technical Solution: To achieve the above object, the present invention provides a distributed message distribution and processing mechanism, which establishes message interaction between service sub-modules and a unified message processing main module, including the following steps: S1. Each service sub-module creates a message event through a unified message creation interface and fills in the message definition according to service requirements; S2. The messages sent by each service sub-module are forwarded through a unified message channel to the unified message processing main module for storage; S3. The unified message processing main module sorts the received messages according to the processing time and forwards and processes them according to the destination module and processing method; S4. Each service sub-module receives the messages through a unified message receiving interface and processes the messages according to the processing method.

[0006] Further, for message distribution, according to the processing time required by the message and the message ID, the message ID determines the priority level of the message. The smaller the ID, the higher the priority. Messages with a smaller required processing time are preferentially forwarded; when the required processing times are the same, messages with a higher priority are preferentially forwarded.

[0007] Further, it includes a main module and several sub-modules. Both the main module and the sub-modules are used to process corresponding events. The main module runs in the main thread, and the sub-modules run in sub-threads. Both the main module and the sub-modules can create message events to be processed.

[0008] Further, each of the message events includes a processing time, a destination module, and a processing method.

[0009] Further, the main module contains a set of message events for message collection and storage. At the same time, the main module and the sub-modules contain a set of various methods that can be processed according to the message ID number.

[0010] Further, each sub-module constructs a message based on the three elements of time, purpose, and processing method for the message to be processed, and sends the message to the main module.

[0011] Beneficial effects: By using a distributed message processing and distribution mechanism, this solution distributes and uniformly processes the message processing process to the edge, which can fully ensure the normal operation of the process while processing messages, and there will be no situation where the main process is blocked when processing a relatively time-consuming message. At the same time, real-time message processing is ensured. Description of the Drawings

[0012] Figure 1 is the framework diagram of the message distribution system of the present invention; Figure 2 is the definition diagram of the distributed message of the present invention. Embodiment

[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. It should be noted that the terms "front", "rear", "left", "right", "upper", and "lower" used in the following description refer to the directions in the drawings, and the terms "inner" and "outer" respectively refer to the directions towards or away from the geometric center of a specific component. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present invention fall within the scope of protection of the present invention.

[0014] Embodiment 1 will be further explained as follows. Figure 1 - Figure 2 for further explanation.

[0015] The present invention provides a distributed message distribution and processing mechanism to establish message interaction between business sub-modules and a unified message processing main module, including the following steps: S1. Each business sub-module creates a message event through a unified message creation interface and fills in the message definition according to business needs; S2. Forward the messages sent by each business sub-module to the unified message processing main module for storage via a unified message channel; S3. The unified message processing main module sorts the received messages according to the processing time and forwards and processes them according to the destination module and processing method; S4. Each business sub-module receives messages through a unified message receiving interface and processes the messages according to the processing method.

[0016] The specific implementation is as follows: 1. The present invention altogether includes one main module and several sub-modules. Both the main module and the sub-modules are used to process corresponding events. The main module runs in the main thread, and the sub-modules run in sub-threads. Both the main module and the sub-modules can create message events to be processed.

[0017] 2. Each message event includes a processing time, a destination module, and a processing method. For example: (Message event ID: 1, to be processed after 5 seconds, processed by sub-module 2, and the processing method is to refresh the HDMI display) 3. The main module includes a set group of message events for message collection and storage. At the same time, both the main module and the sub-modules include a set of various methods that can be processed according to the message ID number (for example: ID: 0 Processing: restart; ID: 1 Processing: reset; ID: 2 Processing: clear cache; ID: 3 Processing: clear data; ID: 4 Processing: sleep). The set of preset message processing methods in the main module are generally the common operation methods of each device, and the set of processing methods in the sub-modules are generally the processing methods related to the business of their own modules. Each module can create messages and send the messages to the main module. After receiving the messages, the main module stores and processes the messages.

[0018] 4. Each sub-module constructs messages according to the three elements of time (when to process), destination (which sub-module to process), and processing method (how to process) of the messages to be processed, and sends the messages to the main module. For example, we now have four sub-modules: sub-module 1, sub-module 2, sub-module 3, and sub-module 4.

[0019] Sub-module 1 creates a message event (Message ID: 0, time: after 3 seconds, processing method: start AI recognition, to be processed by sub-module 2); Sub-module 2 creates a message event (Message ID: 1, time: after 5 seconds, processing method: turn off AI recognition, to be processed by sub-module 4); Sub-module 3 creates a message event (Message ID: 4, time: after 10 seconds, processing method: none, to be processed by the main module); The above three modules will send the messages to the main module.

[0020] 5. After receiving the messages, the main module sorts them according to the processing time of the messages and puts them into its own message queue set.

[0021] 6. The main module loops to query its own message queue, retrieves the latest message to be processed according to the time, and determines the message processing priority according to the message label if the times are the same. If there are already processed methods and destination modules in the message, the message is sent to the destination module according to the destination module in the message. The destination module will process it according to the processing method in the message. If not, the message is sent to the destination sub-module, and the destination sub-module processes it according to the message label and processes it in the main module. For example, in the above sub-module 3, the processing method in the created message event (message ID: 4, time: 10 seconds later, processing method: none, to be processed by the main module) is none, so the main module can process it according to message ID 4. According to the above example, ID4 puts the device into sleep mode. The main module prints and stores logs for message sending and receiving for easy problem tracking and location.

[0022] Message distribution is based on the time the message needs to be processed and the message ID. The message ID determines the priority level of the message. The smaller the ID, the higher the priority. Messages with smaller processing times are forwarded first; when the processing times are the same, messages with higher priorities are forwarded first.

[0023] 7. For the message events sent to the sub-module, after the destination sub-module receives the message, if there is a processing method in the message, it is processed according to the processing method. If there is no processing method, it obtains the message label of the message, finds the processing method according to the message ID label and processes it. If no corresponding message label is found, it is not processed.

[0024] 8. The main module jumps to point 5 for the next loop processing.

[0025] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any reference signs in the claims should not be regarded as limiting the claimed rights.

Claims

1. A distributed message distribution processing mechanism, characterized by: Establishing message interaction between the business submodule and the unified message processing main module includes the following steps: S1. Each business submodule creates a message event through a unified message creation interface and fills in the message definition according to business needs; S2, forwarding the messages sent by each business submodule to the unified message processing main module via a unified message channel for storage; S3, the unified message processing main module sorts the received messages according to the processing time and forwards and processes them according to the destination module and processing method; S4. Each business submodule receives the message through a unified message receiving interface and processes the message according to the processing method.

2. A distributed message distribution processing mechanism according to claim 1, characterized in that: Message distribution is based on the time required for message processing and the message ID. The message ID determines the priority of the message. The smaller the ID, the higher the priority. Messages that require less processing time are forwarded first. When the processing time is the same, messages with higher priority are forwarded first.

3. A distributed message distribution processing mechanism according to claim 1, characterized in that: It includes a main module and several sub-modules. Both the main module and the sub-modules are used to handle corresponding events. The main module runs in the main thread, and the sub-modules run in the sub-thread. Both the main module and the sub-modules can create message events to be processed.

4. A distributed message distribution processing mechanism according to claim 3, characterized in that: Each of the message events includes processing time, target module, and processing method.

5. A distributed message distribution processing mechanism according to claim 1, characterized in that: The main module contains a collection group of message events for collecting and storing messages. At the same time, the main module and sub-modules contain a collection of various methods that can be processed according to the message ID number.

6. A distributed message distribution processing mechanism according to claim 1, characterized in that: Each submodule constructs the message to be processed according to the three elements of time, purpose and processing method, and sends the message to the main module.