CN114385374A - Message processing method and device based on message middleware and storage medium - Google Patents

Message processing method and device based on message middleware and storage medium Download PDF

Info

Publication number
CN114385374A
CN114385374A CN202111296732.6A CN202111296732A CN114385374A CN 114385374 A CN114385374 A CN 114385374A CN 202111296732 A CN202111296732 A CN 202111296732A CN 114385374 A CN114385374 A CN 114385374A
Authority
CN
China
Prior art keywords
message
network node
sent
process module
target
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.)
Pending
Application number
CN202111296732.6A
Other languages
Chinese (zh)
Inventor
易柯楠
周正龙
干宇航
桂烜
王崇申
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN KANGBIDA ZHONGCHUANG TECHNOLOGY CO LTD
Original Assignee
SHENZHEN KANGBIDA ZHONGCHUANG TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN KANGBIDA ZHONGCHUANG TECHNOLOGY CO LTD filed Critical SHENZHEN KANGBIDA ZHONGCHUANG TECHNOLOGY CO LTD
Priority to CN202111296732.6A priority Critical patent/CN114385374A/en
Publication of CN114385374A publication Critical patent/CN114385374A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution

Landscapes

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

Abstract

The invention provides a message processing method, a device and a storage medium based on a message middleware, wherein the message middleware comprises a plurality of network nodes, each network node comprises a message bus process module and a plurality of user process modules which are connected to the message bus process module, and the message bus process modules of the network nodes are connected with each other to form the message middleware of a decentralized deployment structure. Therefore, the invention judges which network node in the message middleware is the target network node according to the target network node carried by the message to be sent and the related information of the target user process during the message processing process, and transmits the message only through the message bus process module and the user process modules in the whole message sending and receiving process without passing through the message service node, thereby overcoming the problems of a centralized structure, having the advantages of high performance, high reliability, low network flow and low delay, and being suitable for being applied to an industrial field monitoring system.

Description

Message processing method and device based on message middleware and storage medium
Technical Field
The present invention relates to the field of message processing technologies, and in particular, to a message processing method, a message processing apparatus, and a storage medium.
Background
Currently, message middleware systems mainly employ centralized deployment structures, such as Kafka, RabbitMQ, etc., as shown in fig. 1. The network nodes in the system are divided into user nodes (running processes for receiving and sending messages by using message middleware, called user processes) and message service nodes (nodes for providing message transit service, running message service programs). By network node is meant a networked device, such as a computer, embedded device, etc., running these programs. All user processes of the user nodes are connected to the message service node, and mutual connection does not exist between all user nodes and processes. The user process sends the message to the message service node, and the message service node forwards the message to the user process needing the message.
The above message transmission structure belongs to a centralized structure, which relies heavily on message service nodes, which are likely to become performance bottlenecks and reliability risk points of the whole system. If the message service node fails, the entire system will be disabled.
In addition, the centralized structure needs to be transferred through the message service node, so that the network flow is enlarged, and the message delay is increased. For example, the user node 1 sends the message to the user node 2, and needs to send the message to the message service node first, and then the message service node forwards the message, and this forwarding process greatly accumulates network traffic at the message service node. Therefore, the existing message processing method is based on the technical problem of low reliability caused by overlarge network traffic.
Therefore, the prior art is to be improved.
Disclosure of Invention
The invention mainly aims to provide a message processing method, a message processing device and a storage medium based on message middleware, so as to at least solve the technical problem of low reliability caused by overlarge network flow in the existing message processing method.
In a first aspect of the present invention, a message processing method based on a message middleware is provided, where the message middleware includes a plurality of network nodes, and each network node includes a message bus process module and a plurality of user process modules connected to the message bus process module; message bus process modules of each network node are connected with each other; the method is applied to each network node and comprises the following steps:
the user process module acquires a message to be sent and sends the message to be sent to a message bus process module of the network node; the message to be sent carries relevant information of a target network node and a target user process;
when receiving the message to be sent from the network node, the message bus process module judges whether the related information of the target network node belongs to the message to be received of the network node; if so, the message bus process module sends the message to be sent to a user process module corresponding to the relevant information of the target user process in the network node; if not, sending the message to be sent to the message bus process module of the corresponding network node;
and the message bus process module also forwards the message to be sent to a user process module corresponding to the relevant information of the target user process in the network node where the message to be sent is located when receiving the message to be sent from other network nodes.
In a second aspect of the present invention, an electronic device is provided, which includes a memory, a processor, and a bus;
the bus is used for realizing connection communication between the memory and the processor;
the processor is configured to execute a computer program stored on the memory;
the processor, when executing the computer program, implements the steps in the message processing method provided by the first aspect.
In a third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program is configured to implement the steps in the message processing method provided in the first aspect when executed by a processor.
The invention provides a message processing method, a device and a storage medium based on a message middleware, wherein the message middleware comprises a plurality of network nodes, each network node comprises a message bus process module and a plurality of user process modules which are connected to the message bus process module, and the message bus process modules of the network nodes are connected with each other, so that the message middleware of a decentralized deployment structure is formed. The identities of all network nodes in the system are equal, network connection is established mutually, and no central node exists. Therefore, the invention judges which network node in the message middleware is the target network node according to the target network node carried by the message to be sent and the related information of the target user process during the message processing process, and the transmission is carried out only through the message bus process module and the user process modules in the whole message sending and receiving process without passing through the message service node, thereby overcoming the problems of a centralized structure, having the advantages of high performance, high reliability, low network flow and low delay, and being suitable for being applied to an industrial field monitoring system.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a prior art centralized deployment architecture for message transport as mentioned in the background;
FIG. 2 is a system diagram of message middleware according to the present invention;
FIG. 3 is a schematic diagram of a network node in the message middleware according to the present invention;
fig. 4 is a flowchart of a message processing method based on message middleware according to a first embodiment of the present invention;
fig. 5 is a flowchart of a message processing method based on message middleware according to a second embodiment of the present invention;
fig. 6 is a flowchart of a message processing method based on message middleware according to a fourth embodiment of the present invention;
fig. 7 is a schematic diagram illustrating module connection inside an electronic device according to a fifth embodiment of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It is noted that relative terms such as "first," "second," and the like may be used to describe various components, but these terms are not intended to limit the components. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the present invention. The term "and/or" refers to a combination of any one or more of the associated items and the descriptive items.
The message processing method based on the message middleware provided by the invention is suitable for the message middleware shown in figure 2, and the message middleware is provided with a plurality of network nodes with consistent structures. Each network node comprises a message bus process module and a plurality of user process modules which are connected to the message bus process module, and the message bus process modules of the network nodes are connected with each other, so that a message middleware of a decentralized deployment structure is formed. According to the system structure of the message middleware, the message bus process module and the user process module are arranged in two structures, a traditional message service node is not provided, the problems of a centralized structure are solved, and the message middleware has the advantages of high performance, high reliability, low network flow and low delay, and is suitable for being applied to an industrial field monitoring system.
Fig. 3 is a flowchart illustrating a message processing method based on message middleware according to a first embodiment of the present invention, where the method includes:
step S301, a user process module acquires a message to be sent and sends the message to be sent to a message bus process module of the network node; the message to be sent carries relevant information of a target network node and a target user process;
in this embodiment, the target network node represents a network node corresponding to a message to be sent, that is, the target network node is a network node that needs to process information to be sent, and the related information of the target network node may be a name, a number, and the like of the target network node, and the related information of the target user process may be a name, a number, and the like of a target user process module, where the related information is not specifically limited.
Step S302, when the message bus process module receives the message to be sent from the network node, whether the relevant information of the target network node belongs to the message to be received of the network node is judged; when the judgment result is yes, the message bus process module sends the message to be sent to a user process module corresponding to the relevant information of the target user process in the network node; if not, sending the message to be sent to a message bus process module of the corresponding network node;
step S303, when receiving the message to be sent from other network nodes, the message bus process module forwards the message to be sent to the user process module corresponding to the information related to the target user process in the network node where the message to be sent is located.
In this embodiment, each network node is in the same message domain, where the message domain is a set of predefined (configured) network nodes, and the configuration of one message domain includes a unique name (e.g., a host name) of each network node and an IP address of each network node. That is, each network node in the message domain realizes data transmission based on each IP address without relying on a conventional message service node for forwarding.
Therefore, when each network node carries out a message processing process, the judgment is carried out through the relevant information of the target network node and the target user process carried by the message to be sent, and when the message to be sent is determined not to belong to the message to be received in the network node (namely, the message to be received is indicated to be the target network node by the rest network nodes in the message domain), the message bus process module of the network node sends the message to be sent to the message bus process module of the corresponding network node. That is, if the sender and the receiver of the message are both in the same node, the message is forwarded by the message bus service process in the node of the network, i.e. the local interaction, without passing through the network. In the traditional centralized structure, the message needs to be forwarded through the message service node and needs to pass through the network. Therefore, the message middleware reduces network flow and communication delay. The method has the advantages of high performance, high reliability, low network flow and low delay, and is suitable for being applied to an industrial field monitoring system.
Fig. 4 is a flowchart illustrating a message processing method based on message middleware according to a second embodiment of the present invention, where the second embodiment defines a message to be sent and related information of a target network node in the first embodiment, where the message to be sent includes a peer-to-peer message, and the related information of the target network node includes a target node name; the second embodiment also defines the step of determining whether the related information of the target network node belongs to the message to be received of the network node, and includes:
step S401, the message bus process module identifies the name of the target node from the related information of the target network node;
step S402, the message bus process module matches the name of the target node with the name of the network node to obtain a matching result;
step S403, the message bus process module determines whether the peer-to-peer message belongs to a message to be received of the local network node according to the matching result.
Specifically, when the message to be sent includes a point-to-point message, the local process processing module in the network node identifies the name of the target node from the related information of the target network node, and then the local process processing module in the network node matches the name of the target node with the name of the network node to obtain a matching result. The obtained matching result can be a matching result that the name of the target node is equal to the name of the network node, or the name of the target node is not equal to the name of the network node, so that the local process processing module in the network node detects whether the peer-to-peer message belongs to the message to be received in the network node according to the matching result. In the transmission process of the point-to-point message, the attribution judgment of the point-to-point message is completed accurately and quickly through the name of the target node.
In this embodiment, the step of sending the message to be sent to the user process module corresponding to the relevant information of the target user process in the network node by the message bus process module includes:
step S404, the message bus process module identifies the name of the target user process according to the relevant information of the target user process;
step S405, the message bus process module sends the message to be sent to the user process module corresponding to the target user process name in the network node.
Specifically, in the transmission process of the peer-to-peer message, the related information in the peer-to-peer message may also have a target user process name, and based on that each network node has a unique node name in the message field, each user process has a unique process name in the node, so that a unique receiving address may be determined. That is, the target network node is determined by the target user process name, so that the message bus process module of the network node accurately sends the message to be sent to the user process module corresponding to the target user process name in the network node.
In this embodiment, before the step of sending the message to be sent to the message bus process module of the corresponding network node, the method further includes:
step S406, the message bus process module in the network node acquires the communication connection state of the message bus process module of the corresponding network node;
step S407, when the communication connection state is in the unconnected state, the message bus process module in the network node deletes the point-to-point message;
step S408, when the communication connection state is in the connected state, the message bus process module in the network node sends the point-to-point message to the message bus process module of the network node corresponding to the target node name.
Specifically, after the message bus process module of the network node obtains the point-to-point message, the message bus process module of the network node needs to obtain a communication connection state of the message bus process module of the corresponding network node, where the communication connection state indicates whether the message bus process module of the corresponding network node is in an online state. Obviously, when the communication connection state is the disconnection state, it indicates that the message bus process module of the corresponding network node is in the disconnection state. And when the communication connection state is the connected state, the message bus process module corresponding to the network node is indicated to be in the online state. Therefore, before the message bus process module of the network node transmits the point-to-point message to the message bus process module of the corresponding network node, whether the point-to-point message needs to be sent is determined based on the communication connection state, and transmission power consumption is reduced to a certain extent.
As shown in fig. 5, the message bus process module has a remote process module and a local process module, and the user process module has an in-process agent module and a communicator. The local process processing module identifies a target node name from the related information of the target network node, matches the target node name with the local network node name to obtain a matching result, and judges whether the point-to-point message belongs to a message to be received of the local network node according to the matching result. And the local process processing module identifies the name of the target user process according to the related information of the target user process, and sends the message to be sent to a user process module corresponding to the name of the target user process in the network node. And the in-process agent module acquires the communication connection state of the message bus process module corresponding to the network node, deletes the point-to-point message when the communication connection state is in an unconnected state, and sends the point-to-point message to the message bus process module of the network node corresponding to the name of the target node when the communication connection state is in a connected state.
The method comprises the following steps that a plurality of user process modules in each network node are provided with communicators, a message to be sent also carries a target communicator name, and the message to be sent is forwarded to a user process module corresponding to related information of a target user process in the network node where the message to be sent is located, and the method comprises the following steps: and the message bus process module identifies the name of the target communicator according to the message to be sent, and forwards the message to be sent to the communicator which is positioned in the network node and corresponds to the name of the target communicator. Specifically, when the network node receives the message to be sent, the message bus process module gives the name of the target communicator and forwards the message to be sent to the communicator corresponding to the name of the target communicator in the network node where the network node is located, so that the transmission of the message to be sent in the network node is realized without passing through a message service node. The communicator module is used as a terminal unit of the message bus and can also be used for receiving and transmitting messages of user codes, increasing, deleting, modifying, checking and the like of subscriptions.
Fig. 6 is a flow diagram illustrating a message processing method based on message middleware according to a third embodiment of the present invention, in which the message bus process module further has a local process subscription management module, and the message to be sent further includes a subscription message with a topic; i.e. each network node is also adapted to a publish-subscribe mode. The step of judging whether the related information of the target network node belongs to the message to be received of the network node comprises the following steps:
step S601, the message bus process module sends the subscription message to the local process subscription management module;
step S602, the local process subscription management module identifies a topic from the subscription message;
and the local process subscription management module judges whether the message to be sent belongs to the message to be received of the network node according to the theme.
Wherein the theme may be a theme name, such as a power monitoring subsystem or a fire protection subsystem; the topic is used as the attribute of the subscription message and is set by the user code when sending the message according to the actual meaning of the service. The user code may set any number of topics of interest to the communicator according to its business requirements, called subscriptions, which the communicator may subsequently receive messages matching its subscriptions. In short, it can be quickly and simply determined whether the information to be transmitted is the information to be received of the first network node by the theme.
In this embodiment, the topic may further include a subsystem name and a channel segment name, and specifically, the topic may be a multi-segment line, such as "xxx. Currently, a two-terminal theme is adopted, namely 'subsystem and channel'. Firstly, each segment is matched independently, if equal, the segment is matched, and if not equal, the segment is not matched; and then, solving the logical AND of the matching results of the segments, namely that all the segments are matched and are matched integrally. When subscribing, any segment can be set to 'all', and then the segment matches any value. Assuming that the topic of a message is "power monitoring subsystem measures point data change channel", the matching result of the subscription is shown in the following table 1:
TABLE 1
Figure BDA0003335651380000081
The communicator may subscribe to any number of topics, wherein the communicator receives a message as long as one subscription matches the topic of the message. Assuming that the topic of a message is "video subsystem, alert channel", the added subscription of the communicator is as follows, and whether the communicator will receive the message is as follows in table 2:
TABLE 2
Figure BDA0003335651380000091
The step of judging, by the local process subscription management module, whether the message to be sent belongs to a message to be received of the network node according to the topic includes:
step S603, the local process subscription management module determines the subscription integral matching degree of the topic according to the subsystem name and the channel segment name;
step S604, the local process subscription management module determines whether the message to be sent belongs to the message to be received of the network node according to the subscription overall matching degree.
Specifically, a local process subscription management module in the network node extracts a first subscription message and a second subscription message (the first subscription message and the second subscription message are information pre-stored in the local process subscription management module and can feed back the subscribed subscription message in the network node), matches the first subscription message with the subsystem name, and matches the second subscription message with the subsystem name; as can be seen from table 2 above, when the subsystem names match correctly and the channel segment names match correctly, the subscription global matching degree is correct. And when the name of the subsystem is matched and at least one of the channel segment names has a matching error, the matching degree of the whole subscription is the matching error.
In this embodiment, the message bus process module further has a remote node subscription management module;
the step of sending the message to be sent to the message bus process module of the corresponding network node includes:
step S605, the message bus process module sends the subscription message to the remote node processing module of the local network node;
step S606, the remote node processing module of the network node detects whether the target network node subscribes to the subscription message;
step S607, when the target network node subscribes to the subscription message, the remote node processing module of the network node sends the subscription message to the target network node.
In this embodiment, when the local process subscription management module in the local network node detects that the subscription message does not belong to the message to be received of the local network node (indicating that the subscription message should be the message to be received of the other network nodes) according to the subscription overall matching degree, the local process processing module in the local network node sends the subscription message to the remote node processing module in the local network node, the local process processing module in the local network node sends the subscription message to the remote node subscription management module in the local network node, the remote node subscription management module in the local network node detects whether the other network nodes subscribe to the subscription message (it should be noted that when the other network nodes subscribe to the subscription message, it indicates that communicators in the other network nodes have subscribed topics), if the other network nodes subscribe to the subscription message, the remote node subscription management module in the network node sends the subscription message to the target network node. Thereby, a fast transmission of subscription messages between different network nodes is accomplished.
In this embodiment, a communicator management subscription module is disposed in the user process module, and when the target network node does not subscribe to the subscription message, the following steps are performed:
step S608, the remote node processing module of the network node sends the subscription message to the in-process agent module of the network node;
step S609, the in-process agent module of the network node acquires the communicator which subscribes the subscription message through the communicator management subscription module;
step S610, the in-process agent module of the network node sends the subscription information to the communicator which subscribes the subscription information.
Therefore, when the target network node does not subscribe the subscription message (indicating that the subscription message is the information to be received by the network node), the information transmission in one network node is realized based on the remote node processing module, the communicator management subscription module and the communicator in the network node, and the subscription message does not need to pass through the message service node, so that the low network flow is effectively reduced.
It can be seen that, in both the point-to-point mode and the subscription and publication mode, if the sender and the receiver of the message are in the same node, the message is forwarded by the message bus service process (native process processing module) in the node, i.e. the native interaction, without passing through the network. In the centralized structure, the message needs to be forwarded through the message service node and needs to pass through the network. Therefore, the message middleware reduces network flow and communication delay.
In addition, for the subscription and publication mode, in cross-node communication, a message is subscribed by any number of processes or communicators in a node, only one message is transmitted to the node through a network, and then the message is distributed to each target user process by a message bus service process in the node and then distributed to each communicator by an agent module in the process. Therefore, the message middleware reduces the network flow and avoids network congestion.
In this embodiment, when each network node is in the subscription and publication mode (during the transmission process of the subscription information), the method further includes the following steps: the communicator receives a subscription adjustment instruction of a user, the communicator sends the subscription adjustment instruction to an in-process proxy module, the in-process proxy module controls a communicator subscription management module to modify subscription information of the communicator and obtains a first feedback result, the in-process proxy module judges whether the modification causes the overall subscription condition of the in-process according to the feedback result, if yes, the in-process proxy module sends the overall subscription change information of the in-process to a message bus process module of the network node, a local process processing module controls the local process subscription management module to modify the subscription information and obtains a second feedback result, the local process processing module judges whether the modification causes the overall subscription condition of the network node according to the second feedback result, if yes, the subscription change information is sent to a remote node processing module, and the remote node processing module sends the subscription change information to remote nodes of other network nodes And the remote node processing modules of the other network nodes operate the remote node subscription management module to modify the subscription information.
The "overall subscription condition of the process" refers to a deduplication (deduplication removing) set of subscriptions of all communicators in the process. Such as table 3 below:
TABLE 3
Communicator 1 subscription “aaa.111”、“bbb.333”
Communicator 2 subscription “aaa.111”、“ddd.222”
Overall subscription “aaa.111”、“bbb.333”、“ddd.222”
And the analogy is the same as that of the 'overall subscription condition of the node'. In addition, subscription change version numbers of a sender are carried in subscription change messages and heartbeat messages between a user process and a message service process of the node, as well as between the nodes, and the version numbers are continuously increased by 1 every time the subscription change messages and the heartbeat messages are changed. When the receiver finds that the version number is discontinuous, which indicates that an exception occurs, the receiver requests all the subscription information of the receiver from the sender.
In this embodiment, the method further includes: after a message bus service process module of the network node is started, names and IP addresses of other network nodes in the message domain are obtained from message domain configuration, a TCP client in a remote node processing module of the network node initiates TCP connection to the corresponding network node, whether the connection is successful or not is judged, if the connection is successful, the remote node processing module sends heartbeat messages (the heartbeat messages comprise the local name and the subscription change version number), after the other network nodes receive the heartbeat messages, the remote node management module of the other network nodes records that the subscription change version number of the network node is invalid or is not equal to the heartbeat messages, the messages requesting all subscription information are described and enter a sending queue of the network node, if the TCP client of the other network nodes corresponding to the network node is not connected, the connection to the local network node is initiated, if the network nodes are connected, sending messages requesting all subscription information, receiving all the subscription information recovery of the network nodes by the rest network nodes, setting the connection state of the network nodes in the management information as connected, operating the remote node subscription management unit, recording the subscription information and the subscription change version number of the network nodes, and setting the version number as valid. The steps are the online processes of all network nodes.
In this embodiment, the method further includes: when the message bus service process module of the network node is actively withdrawn, the remote node processing module sends the withdrawal message of the network node to other connected network nodes, when the other network nodes receive the withdrawal message of the network node or do not receive the heartbeat message after overtime, the other network nodes set the connection state of the network node in the management information as the unconnected state, and the remote node subscription management module is operated to delete all subscription messages of the network node and set the subscription version number of the subscription message as invalid. And disconnecting the TCP server and the TCP client from the connection established with the network node, and connecting the other network nodes with the TCP client of the network node at intervals of a preset time period. The steps are the off-line process of each network node.
Fig. 7 shows an electronic device provided in a fifth embodiment of the present invention, which can be used to implement the message processing method in any of the foregoing embodiments. The electronic device includes:
a memory 701, a processor 702, a bus 703 and a computer program stored on the memory 701 and executable on the processor 702, the memory 701 and the processor 702 being connected by the bus 703. The processor 702, when executing the computer program, implements the message processing method in the foregoing embodiments. Wherein the number of processors may be one or more.
The Memory 701 may be a high-speed Random Access Memory (RAM) Memory or a non-volatile Memory (non-volatile Memory), such as a magnetic disk Memory. The memory 701 is used for storing executable program code, and the processor 702 is coupled with the memory 701.
Further, an embodiment of the present application also provides a computer-readable storage medium, where the computer-readable storage medium may be provided in the electronic device in each of the foregoing embodiments, and the computer-readable storage medium may be a memory.
The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the message middleware-based message processing method in the foregoing embodiments. Further, the computer-readable storage medium may be various media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RAM, a magnetic disk, or an optical disk.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts shown as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a readable storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned readable storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required in the present application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the present specification and drawings, or used directly or indirectly in other related fields, are included in the scope of the present invention.

Claims (10)

1. A message processing method based on message middleware is characterized in that the message middleware comprises a plurality of network nodes, and each network node comprises a message bus process module and a plurality of user process modules which are connected to the message bus process module; message bus process modules of each network node are connected with each other; the method is applied to each network node and comprises the following steps:
the user process module acquires a message to be sent and sends the message to be sent to a message bus process module of the network node; the message to be sent carries relevant information of a target network node and a target user process;
when receiving the message to be sent from the network node, the message bus process module judges whether the related information of the target network node belongs to the message to be received of the network node; if so, the message bus process module sends the message to be sent to a user process module corresponding to the relevant information of the target user process in the network node; if the judgment result is negative, the message to be sent is sent to the message bus process module of the corresponding network node;
and the message bus process module also forwards the message to be sent to a user process module corresponding to the relevant information of the target user process in the network node where the message to be sent is located when receiving the message to be sent from other network nodes.
2. The message processing method based on message middleware of claim 1, wherein the message to be sent comprises a point-to-point message, and the related information of the target network node comprises a target node name;
the step of judging whether the related information of the target network node belongs to the message to be received of the network node comprises the following steps:
the message bus process module identifies the name of the target node from the related information of the target network node;
the message bus process module matches the target node name with the network node name to obtain a matching result;
and the message bus process module judges whether the point-to-point message belongs to a message to be received of the network node according to the matching result.
3. The message processing method based on message middleware of claim 2, wherein the related information of the target user process includes a target user process name;
the step of sending the message to be sent to a user process module corresponding to the relevant information of the target user process in the network node by the message bus process module comprises the following steps:
the message bus process module identifies the name of the target user process according to the relevant information of the target user process;
and the message bus process module sends the message to be sent to a user process module corresponding to the target user process name in the network node.
4. The message processing method based on message middleware of claim 3, wherein before the step of transmitting the message to be transmitted to the message bus process module of the corresponding network node, further comprising:
a message bus process module in the network node acquires the communication connection state of the message bus process module of the corresponding network node;
when the communication connection state is in an unconnected state, a message bus process module in the network node deletes the point-to-point message;
and when the communication connection state is in a connected state, a message bus process module in the network node sends the point-to-point message to the message bus process module of the network node corresponding to the target node name.
5. The message processing method based on message middleware as claimed in claim 4, wherein, several user process modules in each network node have communicators, and the message to be sent also carries the name of the target communicator;
the step of forwarding the message to be sent to the user process module corresponding to the relevant information of the target user process in the network node where the message to be sent is located includes:
the message bus process module identifies the name of a target communicator according to the message to be sent;
and the message bus process module forwards the message to be sent to the communicator corresponding to the name of the target communicator in the network node where the message to be sent is located.
6. The message processing method based on message middleware of claim 1, wherein the message bus process module further has a local process subscription management module, and the message to be sent further includes a subscription message having a topic;
the step of judging whether the related information of the target network node belongs to the message to be received of the network node comprises the following steps:
the message bus process module sends the subscription message to a local process subscription management module;
the local process subscription management module identifies the topic from the subscription message;
and the local process subscription management module judges whether the message to be sent belongs to the message to be received of the local network node according to the theme.
7. The message processing method based on message middleware of claim 6, wherein the subject includes a subsystem name and a channel segment name;
the step that the local process subscription management module judges whether the message to be sent belongs to the message to be received of the local network node according to the theme comprises the following steps:
the local process subscription management module determines the overall subscription matching degree of the topic according to the subsystem name and the channel segment name;
and the local process subscription management module judges whether the message to be sent belongs to the message to be received of the network node according to the subscription integral matching degree.
8. The message processing method based on message middleware of claim 7, wherein the message bus process module further has a remote node subscription management module;
the step of sending the message to be sent to the message bus process module of the corresponding network node includes:
the message bus process module sends the subscription message to the remote node processing module of the local network node;
the remote node processing module of the local network node detects whether the target network node subscribes to the subscription message;
and when the target network node subscribes to the subscription message, the remote node processing module of the network node sends the subscription message to the target network node.
9. An electronic device, comprising a memory, a processor and a bus;
the bus is used for realizing connection communication between the memory and the processor;
the processor is configured to execute a computer program stored on the memory;
the processor, when executing the computer program, performs the steps of the method of any one of claims 1 to 8.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202111296732.6A 2021-11-03 2021-11-03 Message processing method and device based on message middleware and storage medium Pending CN114385374A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111296732.6A CN114385374A (en) 2021-11-03 2021-11-03 Message processing method and device based on message middleware and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111296732.6A CN114385374A (en) 2021-11-03 2021-11-03 Message processing method and device based on message middleware and storage medium

Publications (1)

Publication Number Publication Date
CN114385374A true CN114385374A (en) 2022-04-22

Family

ID=81196359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111296732.6A Pending CN114385374A (en) 2021-11-03 2021-11-03 Message processing method and device based on message middleware and storage medium

Country Status (1)

Country Link
CN (1) CN114385374A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115114051A (en) * 2022-08-29 2022-09-27 国汽智控(北京)科技有限公司 Node communication method, device, equipment and storage medium
CN115883654A (en) * 2022-11-29 2023-03-31 深圳市汇川技术股份有限公司 Process communication method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115114051A (en) * 2022-08-29 2022-09-27 国汽智控(北京)科技有限公司 Node communication method, device, equipment and storage medium
CN115883654A (en) * 2022-11-29 2023-03-31 深圳市汇川技术股份有限公司 Process communication method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US7518983B2 (en) Proxy response apparatus
US8467303B2 (en) Method and apparatus for preventing network conflict
CN114385374A (en) Message processing method and device based on message middleware and storage medium
KR101871383B1 (en) Method and system for using a recursive event listener on a node in hierarchical data structure
CN109379291B (en) Method and device for processing service request in networking
US8738770B2 (en) Sending synchronous responses to requests from frontend applications
US6992985B1 (en) Method and system for auto discovery of IP-based network elements
EP1867137A1 (en) Method and apparatus for efficiently expanding a p2p network
TWI740210B (en) Method for terminal device management and server
CN113391979A (en) Processing method, equipment and system for monitoring data display and storage medium
CN103685357A (en) Account multi-open message processing method and system
CN112738184A (en) Plug-in dynamic registration distributed micro-service gateway system
CN114090342A (en) Storage disaster tolerance link management method, message execution node and storage control cluster
CN114244768A (en) Forwarding method, device, equipment and storage medium for two-layer unknown multicast
CN104518983B (en) A kind of communication means and device of more equipment rooms
CN111880949A (en) Method, system, device, server and terminal for processing service information
TW201038019A (en) Message processing method and system
CN110716827A (en) Hot backup method suitable for distributed system and distributed system
CN115190168B (en) Edge server management system and server cluster
CN110890989A (en) Channel connection method and device
CN115022392B (en) IOT-oriented distributed publishing and subscribing service method and system
CN115529340B (en) Data management method of VPX chassis CHMC module based on soft bus
CN113794639B (en) Communication method and device
CN108173910B (en) Method and system for managing application
CN114567611A (en) Data processing method and device

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