CN116089125A - Distributed message queue system, message publishing method and message receiving method - Google Patents

Distributed message queue system, message publishing method and message receiving method Download PDF

Info

Publication number
CN116089125A
CN116089125A CN202310149692.5A CN202310149692A CN116089125A CN 116089125 A CN116089125 A CN 116089125A CN 202310149692 A CN202310149692 A CN 202310149692A CN 116089125 A CN116089125 A CN 116089125A
Authority
CN
China
Prior art keywords
message
client
topic
identifier
theme
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
CN202310149692.5A
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.)
Wuming Technology Hangzhou Co ltd
Original Assignee
Wuming Technology Hangzhou 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 Wuming Technology Hangzhou Co ltd filed Critical Wuming Technology Hangzhou Co ltd
Priority to CN202310149692.5A priority Critical patent/CN116089125A/en
Publication of CN116089125A publication Critical patent/CN116089125A/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

Abstract

The application discloses a distributed message queue system, a message publishing method and a message receiving method, and belongs to the technical field of computers. In the system, a server side sends a first identifier to a first client side, wherein the first identifier is used for identifying computer equipment where the first client side is located; sending the first identification to the second client; the first client merges the first identifier with the first message theme to obtain a second message theme; sending a second message to the server, wherein the second message carries a second message theme; the second client merges the first identifier with the first message theme to obtain a second message theme; the second client subscribes to a second message theme through the server; and the server side sends the second message to the client side subscribing to the second message theme. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.

Description

Distributed message queue system, message publishing method and message receiving method
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a distributed message queue system, a message publishing method, and a message receiving method.
Background
In a distributed message queuing (also known as Nats) system, the sending or receiving of desired messages is accomplished by subscribing or publishing messages under the subject of the messages between processes of a computer device.
The process of each computer device corresponds to one client in the distributed message queue system, and the message topics issued by the message issuing party (the client for issuing the message) and the message topics subscribed by the message receiving party (the client for receiving the message) are predefined in the client. The message publisher sends the message under the message subject published by the message publisher to the server, and the message receiver receives the message under the message subject subscribed by the message publisher through the server, so that the message receiving and sending among different processes are realized.
In the above scheme, in the case that the client needs to publish a message under a new message theme or subscribe to a message under a new message theme, the message theme needs to be predefined in the code, so that the relevant code needs to be modified, and the implementation process is complex.
Disclosure of Invention
The application provides a distributed message queue system, a message publishing method and a message receiving method, which can simplify the process of adding a message theme. The technical scheme is as follows:
according to an aspect of the present application, there is provided a distributed message queuing system, the system comprising: the system comprises a server, a first client and a second client;
the server side is used for sending a first identifier to the first client side, and the first identifier is used for identifying computer equipment where the first client side is located; the server is further configured to send the first identifier to the second client;
the first client is configured to combine the first identifier with a first message topic to obtain a second message topic, where the first message topic is a message topic of a first message published by the first client, and the second message topic is a message topic to be published by the first client; the first client is further configured to send a second message to the server, where the second message carries the second message theme;
the second client is configured to combine the first identifier with the first message topic to obtain the second message topic, where the first message topic is a message topic of the first message to which the second client has subscribed, and the second message topic is a message topic to which the second client is to subscribe; the second client is further configured to subscribe to the second message topic through the server;
The server is further configured to send the second message to a client subscribing to the second message topic.
According to another aspect of the present application, there is provided a message publishing method applied to a distributed message queue system, the method being applied to a first client, the method comprising:
acquiring a first identifier of the first client through a server, wherein the first identifier is used for identifying computer equipment where the first client is located;
combining the first identifier with the first message theme to obtain a second message theme;
and releasing the message under the second message theme through the server.
According to another aspect of the present application, there is provided a message receiving method applied to a distributed message queue system, the method being applied to a second client, the method comprising:
acquiring a first identifier of a first client through a server, wherein the first identifier is used for identifying computer equipment where the first client is located;
combining the first identifier with the first message theme to obtain a second message theme;
and receiving the message under the second message theme through the server.
According to another aspect of the present application, there is provided a messaging method applied to a distributed message queue system, the method being applied to a server, the method comprising:
Sending a first identifier to a first client, wherein the first identifier is used for identifying computer equipment where the first client is located;
sending the first identification to a second client;
receiving a message under a second message subject issued by the first client;
sending a message under the second message theme to the second client;
the first client and the second client are used for combining the first identifier and a first message theme to obtain the second message theme.
According to another aspect of the present application, there is provided a message publishing device applied to a distributed message queue system, the device comprising:
the receiving and transmitting module is used for acquiring a first identifier of the device through the server, wherein the first identifier is used for identifying computer equipment where the device is located;
the processing module is used for combining the first identifier with the first message theme to obtain a second message theme;
the receiving and transmitting module is configured to issue, through the server, a message under the second message theme.
In an alternative design, the apparatus further comprises:
the acquisition module is used for acquiring a second identifier of the computer equipment where the device is located;
The receiving and transmitting module is configured to send a first request to the server, where the first request carries the second identifier;
the receiving and transmitting module is configured to receive the first identifier sent by the server, where the first identifier is generated by the server according to the second identifier.
In an alternative design, the second identifier includes at least one of:
a media access control (Media Access Control, MAC) address;
an internet protocol (Internet Protocol, IP) address;
processor device number.
In an alternative design, the transceiver module is configured to:
and receiving the first identifier sent by the server, wherein the first identifier is generated by the server according to the timestamp of the first request.
In an alternative design, the processing module is configured to:
and adding the first identifier to the tail of the first message theme to obtain the second message theme.
According to another aspect of the present application, there is provided a message receiving apparatus applied to a distributed message queue system, the apparatus comprising:
the receiving and transmitting module is used for acquiring a first identifier of a first client through a server, wherein the first identifier is used for identifying computer equipment where the first client is located;
The processing module is used for combining the first identifier with the first message theme to obtain a second message theme;
the receiving and transmitting module is configured to receive, through the server, a message under the second message theme.
In an alternative design, the transceiver module is configured to:
sending a second request to the server;
and receiving the first identifier sent by the server, wherein the first identifier is generated by the server according to a second identifier, and the second identifier is obtained by the first client and is obtained by the computer equipment where the first client is located.
In an alternative design, the processing module is configured to:
and adding the first identifier to the tail of the first message theme to obtain the second message theme.
According to another aspect of the present application, there is provided a messaging apparatus for use in a distributed message queuing system, the apparatus comprising:
the receiving and transmitting module is used for sending a first identifier to a first client, wherein the first identifier is used for identifying computer equipment where the first client is located;
the receiving and transmitting module is used for sending the first identifier to a second client;
the receiving and transmitting module is used for receiving the message under the second message subject issued by the first client;
The receiving and transmitting module is used for sending the message under the second message theme to the second client;
the first client and the second client are used for combining the first identifier and a first message theme to obtain the second message theme.
In an alternative design, the apparatus further comprises:
the receiving and transmitting module is used for receiving a first request sent by the first client, wherein the first request carries a second identifier, and the second identifier is an identifier of computer equipment where the first client is located, which is acquired by the first client;
the generation module is used for generating the first identifier according to the second identifier;
the receiving and transmitting module is configured to send the first identifier to the first client.
In an alternative design, the generating module is configured to:
the first identifier is generated from a timestamp of the receipt of the first request.
In an alternative design, the second identifier includes a MAC address and/or an IP address of a computer device in which the first client is located; the apparatus further comprises:
the determining module is used for determining the computer equipment where the first client side with the abnormality occurs according to the MAC address and/or the IP address under the condition that the message under the second message subject has the abnormal release.
According to another aspect of the present application, there is provided a computer device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or a set of instructions, the at least one instruction, the at least one program, the code set or the set of instructions being loaded and executed by the processor to implement a message publishing method applied to a distributed message queue system, a message receiving method applied to a distributed message queue system or a messaging method applied to a distributed message queue system as described in the above aspect.
According to another aspect of the present application, there is provided a computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes or a set of instructions loaded and executed by a processor to implement a message publishing method applied to a distributed message queue system, a message receiving method applied to a distributed message queue system or a messaging method applied to a distributed message queue system as described in the above aspect.
According to another aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the message publishing method applied to the distributed message queue system, the message receiving method applied to the distributed message queue system, or the messaging method applied to the distributed message queue system provided in various optional implementations of the above aspects.
The beneficial effects that this application provided technical scheme brought include at least:
and adding the identification of the message publisher into the first message topic to obtain a newly generated second message topic, wherein the message publisher can publish the message under the second message topic through the second message topic. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a diagram of a related art implementation of messaging through distributed message queues according to an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram of a computer system provided in an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of a messaging process provided by an exemplary embodiment of the present application;
FIG. 4 is a block diagram of a distributed message queue system provided in one exemplary embodiment of the present application;
FIG. 5 is a flow chart of a message publishing method for a distributed message queue system according to one exemplary embodiment of the present application;
FIG. 6 is a flow chart of a message publishing method for a distributed message queue system according to one exemplary embodiment of the present application;
FIG. 7 is a flow chart of a messaging method for a distributed message queue system according to one exemplary embodiment of the present application;
FIG. 8 is a flow chart of a messaging method for a distributed message queue system according to one exemplary embodiment of the present application;
FIG. 9 is a schematic diagram of a process of sending a first identifier by a server provided in an exemplary embodiment of the present application;
FIG. 10 is a schematic diagram of a process for publishing and subscribing to message topics provided by one exemplary embodiment of the present application;
FIG. 11 is a schematic diagram of a process for receiving a message provided by an exemplary embodiment of the present application;
FIG. 12 is a schematic diagram of a message publishing device for use in a distributed message queuing system according to an exemplary embodiment of the present application;
FIG. 13 is a schematic diagram of a message publishing device for use in a distributed message queuing system according to an exemplary embodiment of the present application;
fig. 14 is a schematic diagram of a message receiving device applied to a distributed message queue system according to an exemplary embodiment of the present application;
FIG. 15 is a schematic diagram of a messaging device for use in a distributed message queuing system according to an exemplary embodiment of the present application;
FIG. 16 is a schematic diagram of a messaging device for use in a distributed message queuing system according to an exemplary embodiment of the present application;
FIG. 17 is a schematic diagram of a messaging device for use in a distributed message queuing system according to an exemplary embodiment of the present application;
fig. 18 is a schematic structural diagram of a computer device according to an exemplary embodiment of the present application.
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
First, description will be made of related terms related to the embodiments of the present application:
distributed message queues (also known as Nats): the inter-process receives and transmits data by subscribing events and publishing events and driving a model provided by the distributed message queue. The process only needs to subscribe to the message subject (subject) of interest to itself, and does not need to know the counterpart program. And the distributed message queues are balanced by self load, and service registration discovery is not needed. In a specific application scenario, the distributed message queue system is a system for transmitting a message under a message theme between a message publishing client and a message receiving client by publishing the message under the message theme by the message publishing client and subscribing the message under the message theme by the message receiving client.
Service end (Nats Server): message queue middleware for registering and forwarding messages. The system can be deployed by a single machine or a cluster, and can be horizontally expanded.
Client (Nats Client): for subscribing/publishing messages.
In a multi-program collaboration scenario, communication between services (processes) is often required, and a common technology is Kafka (an open source stream processing platform, specifically a high throughput distributed publish-subscribe messaging system, which can process all action stream data of consumers in a website), and the like. The services have transactions that need to be executed by themselves and the transactions processed by threads are taken off after receiving the message.
In the related art, a distributed message queue (also called Nats) system is generally used to implement sending or receiving a desired message by subscribing or publishing a message under a message topic between processes of a computer device. Illustratively, fig. 1 is a schematic diagram of messaging through a distributed message queue in accordance with the related art provided by an exemplary embodiment of the present application. As shown in fig. 1, the process of each computer device corresponds to one client in the distributed message queue system, and a message topic issued by a message issuer 101 (a client that issues a message) and a message topic subscribed by a message receiver 102 (a client that receives a message) are predefined in the client. The message publisher sends the message under the published message theme to the server 103, and the message receiver receives the message under the subscribed message theme through the server 103, so that the message receiving and sending among different processes are realized.
In the related art, subscription and publishing modes of the distributed message queue system separate subscribed message topics, that is, corresponding message topics can be set for different messages to be transmitted. In the case that the client needs to publish a message under a new message topic or subscribe to a message under a new message topic, for example, when a process is required to realize simultaneous interaction of multiple message topics, the simultaneous interaction can only be realized by adding the message topic or adding a sub-topic after the message topic. However, since the message topics need to be predefined in the codes, the related codes need to be modified, the implementation process is complex, and the dynamic addition of the message topics and the communication between subscribed message topics cannot be realized.
In the method provided by the embodiment of the application, the subtopic can be used as the minimum unit in the subscription through the distributed cloud scheduling mode, and the subtopic is dynamically generated according to the existing message topic and the identifier of the computer equipment where the client is located, so that the dynamic addition of the subtopic can be realized. In the process of adding the sub-topics, the code does not need to be modified, so that the process of adding the sub-topics is simplified. Also, security and subsequent traceability is improved because the sub-topics, when declared, may be uniquely identified based on the internet protocol (Internet Protocol, IP) address and/or the media access control (Media Access Control, MAC) address of the message publisher.
Fig. 2 is a schematic diagram of a computer system according to an exemplary embodiment of the present application. As shown in fig. 2, the computer system 200 includes a server 201, a first computer device 202, and a second computer device 203.
The server 201 may be a server, or a server cluster formed by a plurality of servers, or a virtual server in a cloud computing service center, or the like. The server 201 is deployed with a server in the distributed message queue system, where the server is configured to receive a message under a managed message topic sent by a message publisher in the distributed message queue system, and is configured to send a message under a subscribed message topic to a message receiver in the distributed message queue system.
A connection may be established between the server 201 and the first computer device 202 and the second computer device 203 via a wired network or a wireless network, respectively. A first client in the distributed message queue system is deployed in the first computer device 202, where the first client is a message publisher, and is configured to publish, through a server, a message under a message topic managed by the first client. A second client in the distributed message queue system is deployed in the second computer device 203, where the second client is a message receiver, and the second client is configured to receive, through the server, a message under a message topic subscribed to by the second client. The information under the information subject published by the first client side comprises information under the information subject subscribed by the second client side.
It should be noted that the number of the server 201, the first computer device 202, and the second computer device 203 is merely illustrative, and is not a limitation of the computer system provided in the embodiments of the present application. For example, in a distributed message queue system, there can also be more message publishers and message recipients.
In addition, the first client and the second client can be disposed in the same computer device, in addition to being disposed in different computer devices. That is, the first computer device 202 and the second computer device 203 may be the same computer device or different computer devices, and fig. 2 mainly illustrates that the first computer device 202 and the second computer device 203 are different computer devices.
In addition, the above-mentioned manner of dividing the first client and the second client into the message publisher or the message receiver is mainly determined according to whether the two provide the message publishing function or the message receiving function for the same message subject. It will be appreciated that the first client and the second client can also act as both a message publisher and a message receiver, i.e. the first client and the second client can support both the function of publishing messages and the function of subscribing to messages.
Fig. 3 is a schematic diagram of a messaging process provided in an exemplary embodiment of the present application. As shown in fig. 3, a first client 301 (a message publisher) in the distributed message queue system is able to obtain a first identifier sent by the server 303 by sending a first request to the server 303, where the first identifier is used to identify a computer device where the first client 301 is located. The first request carries a second identifier of the computer device where the first client 301 is located, where the first identifier is generated by the server 303 according to the second identifier. Thereafter, a second client 302 (message recipient) in the distributed message queue system can send a second request to the server 303 to obtain the first identification.
After the first identifier is obtained, the first client 301 and the second client 302 combine the first identifier with the existing first message topic (e.g., add the first identifier to the tail of the first message topic), so as to obtain the second message topic. After obtaining the second message theme, the first client 301 can issue a message under the second message theme through the server 303, and the second client 302 can receive the message under the second message theme through the server 303.
And adding the identification of the message publisher into the first message topic to obtain a newly generated second message topic, wherein the message publisher can publish the message under the second message topic through the second message topic, and the message receiver can receive the message under the second message topic through the second message topic. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.
Fig. 4 is a block diagram of a distributed message queue system provided in an exemplary embodiment of the present application. The distributed message queue system 400 includes a server 401, a first client 402, and a second client 403;
a server 401, configured to send a first identifier to a first client 402, where the first identifier is used to identify a computer device where the first client 402 is located; the server 401 is further configured to send a first identifier to the second client 403;
the first client 402 is configured to combine the first identifier with a first message topic to obtain a second message topic, where the first message topic is a message topic of a first message that has been issued by the first client 402, and the second message topic is a message topic to be issued by the first client 402; the first client 402 is further configured to send a second message to the server 401, where the second message carries a second message theme;
The second client 403 is configured to combine the first identifier with a first message topic to obtain a second message topic, where the first message topic is a message topic of a first message subscribed by the second client 403, and the second message topic is a message topic to be subscribed by the second client 403; the second client 403 is further configured to subscribe to a second message topic through the server 401;
the server 401 is further configured to send the second message to a client subscribed to the second message topic.
In some embodiments, the first client 402 is further configured to obtain a second identifier of a computer device on which the first client 402 is located; the first client 402 is further configured to send a first request to the server 401, where the first request carries a second identifier;
the server 401 is further configured to generate a first identifier according to the second identifier;
wherein the second identifier comprises at least one of:
MAC address;
IP address;
processor device number.
In some embodiments, the server 401 is further configured to generate the first identifier according to a timestamp of the received first request.
In some embodiments, the first client 402 is further configured to input the content of the second message into a classification model to obtain a classification of the second message; the first client 402 is further configured to combine the classification of the second message with a second identifier of a computer device where the first client 402 is located, to obtain a first identifier;
The classification model is obtained through training according to the content of the sample message and the sample classification of the sample message.
In some embodiments, the second client 403 is further configured to send a second request to the server 401, where the second request is used to request the server 401 to send the first identifier to the second client 403.
In some embodiments, the second identification includes a MAC address and/or an IP address of the computer device where the first client 402 is located;
the server 401 is further configured to determine, according to the MAC address and/or the IP address, a computer device where the first client 402 having the abnormality is located, where the message under the second message subject has the abnormality in publishing.
In some embodiments, the first message topic is a first parent topic or a first child topic in the distributed message queue system 400;
in the case where the first message topic is a first parent topic, the second message topic is a second child topic of the first parent topic;
in the case where the first message topic is a first sub-topic, the second message topic is a third sub-topic of a second parent topic to which the second sub-topic corresponds.
In summary, in the system provided in this embodiment, the identifier of the message publisher is added to the first message topic, so as to obtain a newly generated second message topic, and the message publisher may publish a message under the second message topic through the second message topic. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.
Fig. 5 is a flow chart of a message publishing method applied to a distributed message queue system according to an exemplary embodiment of the present application. The method may be used for a first client in a distributed message queue system. As shown in fig. 5, the method includes:
step 502: and acquiring a first identifier of the first client through the server.
The first client establishes communication connection with a server in the distributed message queue system, and the first client is a message publisher, namely the first client has a function of publishing a message under a certain message theme. Illustratively, the messages in the distributed message queue system are messages generated by program execution. The first client may be implemented as a front end, such as a World Wide Web (Web) end.
The first identifier is used to identify a computer device where the first client is located, for example, the first identifier is used to uniquely identify the computer device where the first client is located in the distributed message queue system.
Optionally, the first identifier is generated by the server according to a second identifier of the computer device where the first client is located, or is generated according to a timestamp. Optionally, in the process of acquiring the first identifier, the first client acquires the second identifier of the computer device where the first client is located, and sends a first request carrying the second identifier to the server, so that the server generates the first identifier according to the second identifier in the first request and sends the first identifier to the first client. Optionally, the server can also generate the first identifier according to a timestamp of receiving the first request.
Step 504: and combining the first identifier with the first message theme to obtain a second message theme.
The first message topic is a message topic that has been defined in the first client, i.e. the first client is a client that has supported publishing messages under the first message topic, and the second message topic is a message topic that is newly defined based on the first identity.
In a distributed message queue system, message topics may be divided into parent topics (parent message topics) and child topics (child message topics). Wherein, the parent topic does not have a previous level message topic, and the child topic has a previous level message topic, namely the parent topic of the child topic. Messages under a parent topic may be partitioned by a child topic. For example, the parent topic is weather information, and each child topic under the parent topic is weather information of each province. The client can subscribe to all provinces of weather information (i.e., subscribe to the parent topic) and can also subscribe to some provinces of weather information (i.e., subscribe to the child topic).
Illustratively, there are message 1, message 2, and message 3 under the parent topic, message 1 and message 2 under the child topic 1 of the parent topic, and message 3 under the child topic 2 of the parent topic.
Optionally, the first message topic is a first parent topic or a first child topic in the distributed message queue system. In the case where the first message topic is a first parent topic, the second message topic is a second child topic of the first parent topic. In the case where the first message topic is a first sub-topic, the second message topic is a third sub-topic of a second parent topic to which the second sub-topic corresponds.
Illustratively, the first message topic is the parent topic or the child topic described above, and the second message topic is a newly generated child topic of the first message topic where the first message topic is the parent topic. In the case where the first message topic is a sub-topic, the second message topic is a sub-topic of the newly generated parent topic of the first message topic. For example, where a first message topic is the parent topic described above that includes message 1, message 2, and message 3, then a second message topic is the next newly defined sub-topic for that parent topic (e.g., sub-topic 3 that is different from sub-topic 1 and sub-topic 2), in which case the second message topic may include one or more of message 1, message 2, and message 3, or the second message topic can also include messages newly defined under that parent topic. For example, where the first message topic is the above-described sub-topic 2 that includes message 3, the second message topic is a newly defined sub-topic under the parent topic of this sub-topic 2, in which case the second message topic may include one or more of message 1, message 2, and message 3, or the second message topic can also include a newly defined message under this parent topic.
Optionally, when the first client merges the first identifier with the first message topic, the first client adds the first identifier to the header, middle or end of the first message topic to obtain the second message topic. For example, the second message topic is "first message topic. First identity".
Step 506: and releasing the message under the second message theme through the server.
After determining the second message theme, the first client can issue the message under the second message theme. The first client side sends the message under the second message theme to the server side, and then the server side sends the message under the second message theme to a message receiver subscribed to the second message theme, so that the sending and receiving of messages among different processes are realized.
The corresponding relation between the message under the second message theme and the second message theme is established through manual configuration. Optionally, the process that the first client obtains the first identifier through the server side to determine the second message theme and then issue the message under the second message theme is performed by the first client through the instruction and the predefined code. The instructions and predefined code are manually set, the predefined code comprising content defining the rules for generating new sub-topics described above.
In summary, in the method provided in this embodiment, the identifier of the message publisher is added to the first message topic, so as to obtain a newly generated second message topic, and the message publisher may publish the message under the second message topic through the second message topic. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.
Fig. 6 is a flow chart of a message receiving method applied to a distributed message queue system according to an exemplary embodiment of the present application. The method may be used for a second client in a distributed message queue system. As shown in fig. 6, the method includes:
step 602: and acquiring a first identifier of the first client through the server.
The second client establishes communication connection with a server in the distributed message queue system, and the second client is a message receiver, namely the second client has the function of subscribing the message under a certain message theme. Optionally, the second client comprises one or more clients. Illustratively, the messages in the distributed message queue system are messages generated by program execution. The second client may be implemented as a front-end, e.g., a WEB-end.
The first identification is used to identify the computer device at which the first client is located, e.g., the first identification is used to uniquely identify the computer device at which the first client is located in a distributed message queue system.
Step 604: and combining the first identifier with the first message theme to obtain a second message theme.
The first message topic is a message topic that has been defined in the second client, i.e. the second client is a client that has supported subscribing to messages under the first message topic, and the second message topic is a newly defined message topic based on the first identity.
Optionally, the first message topic is a parent topic or a child topic, and the second message topic is a child topic of the newly generated first message topic in the case where the first message topic is a parent topic. In the case where the first message topic is a sub-topic, the second message topic is a sub-topic of the newly generated parent topic of the first message topic.
Optionally, when the second client merges the first identifier with the first message topic, the second client adds the first identifier to the header, middle or end of the first message topic to obtain the second message topic.
Step 606: and receiving the message under the second message theme through the server.
The first client is a message publisher of a second message theme, the first client also generates the second message theme according to the first identifier and the first message theme, and after the first client determines the second message theme, the first client publishes a message under the second message theme. The second client generates a second message topic from the first identity and the first message topic in the same manner as the first client. I.e. the second message topic determined by the first client is the same as the second message topic determined by the second client.
The first client side sends the message under the second message theme to the server side, and then the server side sends the message under the second message theme to a message receiver subscribed to the second message theme, namely the second client side, so that the receiving and sending of messages among different processes are realized.
The corresponding relation between the message under the second message theme and the second message theme is established through manual configuration. Optionally, the process that the second client obtains the first identifier through the server side to determine the second message theme and further receive the message under the second message theme is performed by the second client through the instruction and the predefined code. The instructions and predefined code are manually set, the predefined code comprising content defining the rules for generating new sub-topics described above.
In summary, in the method provided in this embodiment, the identifier of the message publisher is added to the first message topic, so as to obtain a newly generated second message topic, and the message receiver may receive the message under the second message topic through the second message topic. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.
Fig. 7 is a flow chart of a messaging method applied to a distributed message queue system according to an exemplary embodiment of the present application. The method can be used for a server in a distributed message queue system. As shown in fig. 7, the method includes:
Step 702: and sending the first identification to the first client.
The server establishes communication connection with a first client and a second client in the distributed message queue system. The first client is a message publisher, i.e. the first client has the function of publishing messages under a certain message topic. The second client is a message receiver, i.e. the second client has the function of subscribing to a message under a certain message topic. Illustratively, the messages in the distributed message queue system are messages generated by program execution. The first client and the second client may be implemented as front ends, e.g. WEB ends.
The first identification is used to identify the computer device at which the first client is located, e.g., the first identification is used to uniquely identify the computer device at which the first client is located in a distributed message queue system.
Optionally, the first identifier is generated by the server according to a second identifier of the computer device where the first client is located, or is generated according to a timestamp. Optionally, in the process of sending the first identifier to the first client, the first client may acquire a second identifier of the computer device where the first client is located, and send a first request carrying the second identifier to the server, so that the server generates the first identifier according to the second identifier in the first request and sends the first identifier to the first client. Optionally, the server can also generate the first identifier according to a timestamp of receiving the first request.
The first client is used for combining the first identifier with the first message theme to obtain a second message theme. The first message topic is a message topic that has been defined in the first client, i.e. the first client is a client that has supported publishing messages under the first message topic, and the second message topic is a message topic that is newly defined based on the first identity.
Step 704: and sending the first identification to the second client.
The second client is used for combining the first identifier with the first message theme to obtain a second message theme. The first message topic is a message topic that has been defined in the second client, i.e. the second client is a client that has supported subscribing to messages under the first message topic, and the second message topic is a newly defined message topic based on the first identity.
Step 706: and receiving the message under the second message subject issued by the first client.
After determining the second message theme, the first client can issue the message under the second message theme, and the first client can send the message under the second message theme to the server.
Step 708: and sending the message under the second message theme to the second client.
The second client generates a second message topic according to the first identifier and the first message topic in the same manner as the first client generates a second message topic according to the first identifier and the first message topic. I.e. the second message topic determined by the first client is the same as the second message topic determined by the second client. The server side can send the information under the second information subject issued by the first client side to the information receiver subscribed to the second information subject, namely the second client side, so that the receiving and sending of the information among different processes are realized.
The corresponding relation between the message under the second message theme and the second message theme is established through manual configuration. Optionally, the process of generating the first identifier by the server and sending the first identifier by the server is performed by a predefined code, where the predefined code is set manually, and the predefined code includes content for defining the rule for generating the new sub-topic.
In summary, in the method provided in this embodiment, the identifier of the message publisher is added to the first message topic, so as to obtain a newly generated second message topic, the message publisher may publish the message under the second message topic through the second message topic, and the message receiver may receive the message under the second message topic through the second message topic. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.
Fig. 8 is a flow chart of a messaging method applied to a distributed message queue system according to an exemplary embodiment of the present application. The method may be used in the system shown in fig. 2. As shown in fig. 8, the method includes:
Step 802: the first client sends a first request to the server.
The server establishes communication connection with a first client and a second client in the distributed message queue system. The first client is a message publisher, i.e. the first client has the function of publishing messages under a certain message topic. The second client is a message receiver, i.e. the second client has the function of subscribing to a message under a certain message topic.
In the process of sending the first request, the first client side can acquire the second identifier of the computer equipment where the first client side is located, so that the first request is sent to the server side, and the first request carries the second identifier. Optionally, the first server encapsulates the second identifier into JS (a programming language) object profile (Java Script Object Notation, JSON) data, and sends the data to the server in a request manner.
Optionally, the second identifier includes at least one of the following:
MAC address;
IP address;
processor device number.
Wherein the processor device number includes a central processor (Central Processing Unit, CPU) device number and/or a graphics processor (Graphics Processing Unit, GPU) device number of the computer device in which the first client is located.
Step 804: the server generates a first identifier.
The first identification is used to identify a computer device where the first client is located. After receiving the first request sent by the first client, the server generates a first identifier according to the second identifier in the first request. Alternatively, the server can also generate the first identification according to a timestamp of the receipt of the first request. Optionally, the server can also generate the first identifier according to the timestamp of the received first request and the second identifier.
Optionally, the server generates the first identifier based on a hash algorithm. The hash algorithm comprises a message digest algorithm 4 (Message Digest Algorithm, MD4), a message digest algorithm 5 (Message Digest Algorithm, MD5), a secure hash algorithm (Secure Hash Algorithm, SHA) and the like. It should be noted that the above algorithm is only used as an example, and the server side can also generate the first identifier through other algorithms, which is not limited in this embodiment of the present application.
For example, the second identifier acquired by the server is the MAC address "52:54:00:3b:ca:3f", and the first identifier generated by the server through MD5 is "0420fb09ef6f397586d5aaeac6205fa8". The timestamp of the first request received by the server is "2022-12-22:22:22", and the first identifier generated by the server through the SHA224 is "6e9fa0ede868248f2fb38b9394651fa55c87409e5259856c4fd766f7". The second identifier acquired by the server is "52a3bc14f44f202 f 713 d beb b357744f6e968746d13a9a2 e3f0b8872bfbb130d93d5bdc3f4235e6ecf209b26c9a465d72d9952731a97fb8c7aae74767dc" and the first identifier generated by the server through SHA3-512 is "52a3bc14f44f202d713beb b357744f6e968746d13a9a 3 e 0b8872bfbb130d93d5bdc3f4235e6ecf209b26c9 d72d9952731a97fb8c7aae74767dc".
Optionally, after receiving the first request, the server may query whether the stored data includes the second identifier. And under the condition that the stored data comprises the second identifier, the server side can acquire the first identifier corresponding to the generated second identifier. And under the condition that the stored data does not comprise the second identifier, the server generates the first identifier according to the second identifier.
Step 806: the server side sends a first identification to the first client side.
After the server generates the first identifier of the computer equipment where the first client is located according to the first request, the first identifier is sent to the first client, so that the first client generates a new message theme according to the first identifier.
Fig. 9 is a schematic diagram illustrating a process of sending a first identifier by a server according to an exemplary embodiment of the present application. As shown in fig. 9, a first client 901 sends a request carrying an identifier of a computer device where the first client 901 is located to a server 902, and after receiving the request, the server 902 generates an identifier according to data in the request and sends the identifier to the first client 901.
Alternatively, the first client may also generate the first identifier by itself without acquiring the first identifier by the server. The first client inputs the content of the second message into the classification model to obtain the classification of the second message. The content of the second message includes at least one of a title corresponding to the second message, a text corresponding to the second message, a picture corresponding to the second message, a video corresponding to the second message, and the like. The first client then merges the classification of the second message with the second identification of the computer device in which the first client is located, resulting in the first identification. The classification model is trained from the content of the sample message and the sample classification of the sample message. Optionally, the classification model is implemented based on a convolutional neural network (Convolutional Neural Networks, CNN). The information to be published is classified through the machine learning model, and the information theme which can uniquely identify the client and reflect the type of the information can be obtained by combining the identification of the equipment where the client is located, so that the type of the information can be conveniently known according to the generated information theme, and the follow-up maintenance is convenient.
After the first client generates the first identifier in the above manner, the generated first identifier is sent to the server, and the server may send the first identifier to other clients, for example, the second client, that need to subscribe to the second message topic in the distributed message queue system. Optionally, the above process of generating the first identifier may also be executed by the server, where in this case, the first client may send the content of the second message and the second identifier of the computer device where the first client is located to the server, and after the server generates the first identifier through the local classification model according to the above manner, the server feeds back the generated first identifier to the first client and other clients needing to subscribe to the subject of the second message.
Step 808: and the first client merges the first identifier with the first message theme to obtain a second message theme.
The first message topic is a message topic that has been defined in the first client, i.e. the first client is a client that has supported publishing messages under the first message topic, and the second message topic is a message topic that is newly defined based on the first identity. Optionally, the first message topic is the parent topic or the sub-topic, and the second message topic is a newly generated sub-topic of the first message topic in case the first message topic is the parent topic. In the case where the first message topic is a sub-topic, the second message topic is a sub-topic of the newly generated parent topic of the first message topic.
Optionally, when the first client merges the first identifier with the first message topic, the first client adds the first identifier to the header, middle or end of the first message topic to obtain the second message topic. For example, the second message topic is "first message topic. First identity".
Step 810: the first client issues the message under the second message theme to the server.
After determining the second message theme, the first client can issue the message under the second message theme, and the first client can send the message under the second message theme to the server.
Step 812: the second client sends a second request to the server.
The second request is used for requesting the server to send a first identifier of the computer equipment where the first client is located, so that the second client generates a new message theme according to the first identifier. Optionally, the second client sends the second request to the server after the first client sends the first request to the server. The second client sending the second request to the server can also be before the first client sending the first request to the server. In this case, the server may also be able to generate the first identifier according to the identifier of the computer device on which the second client is located, and/or a timestamp of the second request received. And transmitting the generated first identification to the first client when the first client transmits the first request. Such that the first client and the second client generate new message topics.
Step 814: the server side sends the first identification to the second client side.
The first identifier is generated by the server according to a second identifier and/or a timestamp of a first request of the first client, and the second identifier is obtained by the first client and is obtained by the computer equipment where the first client is located.
Step 816: and the second client merges the first identifier with the first message theme to obtain a second message theme.
The first message topic is a message topic that has been defined in the second client, i.e. the second client is a client that has supported subscribing to messages under the first message topic, and the second message topic is a newly defined message topic based on the first identity. Optionally, when the second client merges the first identifier with the first message topic, the second client adds the first identifier to the header, middle or end of the first message topic to obtain the second message topic.
The second client generates a second message topic from the first identity and the first message topic in the same manner as the first client. I.e. the second message topic determined by the first client is the same as the second message topic determined by the second client.
Alternatively, the computer device on which the first client is located is mainly used to perform graphics rendering related tasks, in which case the first identifier may be referred to as a GPU identifier (gpu_id).
By way of example, FIG. 10 is a schematic diagram of a process for publishing and subscribing to message topics as provided by one exemplary embodiment of the present application. As shown in fig. 10, after receiving the "gpu_id" sent by the server 1002, the first client 1001 may add the "gpu_id" after the "conversion" of the first message topic, thereby obtaining a second message topic "conversion gpu_id (conversion gpu_id)", and then may issue a message according to the second message topic. After receiving the "gpu_id" sent by the server 1002, the second client 1003 adds the "gpu_id" after the "conversion (conversion)" of the first message topic, so as to obtain a second message topic "conversion.
For example, the first message is entitled "conversion", the second identifier sent by the first client to the server is referred to as MAC address "52:54:00:3b:ca:3f", and the first identifier generated by the server according to the MAC address is referred to as "0420fb09ef6f397586d5aaeac6205fa8". The server side sends the first identification to the first client side and the second client side, and a second message topic generated by the first client side and the second client side according to the first message topic and the first identification is 'conversion.0420fb09ef6f 39755865 aaeac6205 fa8'.
For example, the first message is entitled "conversion.1", the second identifier sent by the first client to the server is referred to as MAC address "52:54:00:3b:ca:3f", and the first identifier generated by the server according to the MAC address is referred to as "0420fb09ef6f397586d5aaeac6205fa8". The server sends the first identifier to the first client and the second client, and the second message generated by the first client and the second client according to the first message subject and the first identifier is entitled "version.1.0420fb09ef6f 39755865 aaeac6205fa8" or "version.0420fb09ef6f 39755865 aaeac6205fa8".
Step 818: and the second client receives the message under the second message theme sent by the server.
The first client side sends the message under the second message theme to the server side, and then the server side sends the message under the second message theme to a message receiver subscribed to the second message theme, namely the second client side, so that the receiving and sending of messages among different processes are realized. The corresponding relation between the message under the second message theme and the second message theme is established through manual configuration.
Illustratively, FIG. 11 is a schematic diagram of a process for receiving messages provided by an exemplary embodiment of the present application. As shown in fig. 11, the first client 1101 issues a message under the subject of the second message to the server 1102, the message being used to instruct execution of a certain instruction. The server 1102 then sends the second message subject to the second client 1103, i.e. the second client 1103 receives the message subject to the second message. Upon receiving the message, the second client 1103 will execute the instructions in the message.
Step 820: and under the condition that the message under the second message theme is abnormal in release, the server determines the computer equipment where the first abnormal client is located.
Under the condition that the message under the second message subject appears abnormal release, the server can locate the computer equipment where the first client is located according to the acquired MAC address and/or IP address of the computer equipment where the first client is located, so that the problem can be quickly located, and the follow-up problem finding and optimization iteration are facilitated. Since both the MAC address and the IP address of the computer device can uniquely identify the computer device, and the MAC address generally does not change, locating the computer device in the above manner has accuracy.
In a specific example, a message publisher (publishing) is used to Publish a message under a first message topic and a message recipient (Subscribe) is used to Subscribe to the message under the first message topic. When a message transmitted between a message publisher and a message receiver through a first message theme cannot meet the current requirement, namely a new sub-theme needs to be created for the first message theme, the message publisher requests a server to generate a first identifier so as to acquire the first identifier. The server sends the first identification generated by the server to the message receiver. After the first identifier is obtained, the message publisher and the message receiver can generate the same new second message theme by adding the first identifier after the first message theme. The message publisher and message recipient can then transmit the desired message via the new second message topic.
In the distributed message queue system in the above example, there may be a plurality of clients such as a third client and a fourth client, and these clients may subscribe to the second message topic newly published by the message publisher (the first client) in the above manner, so as to receive the message under the second message topic. For specific implementation processes of subscribing to the second message topic and receiving the message under the second message topic by these clients (the third client, the fourth client, etc.), reference may be made to the description of the message subscriber (the second client), which is not repeated in the embodiments of the present application. In addition, these clients can also request the server to generate an identification (gpu_id) for the first client in the same manner as the first client, and generate a new message topic based on the generated identification, thereby publishing a message under the newly generated message topic. Clients in the distributed message queue system can subscribe to these newly generated message topics to receive messages under these message topics. The scheme realizes the dynamic capacity expansion of the message theme in the distributed message queue system.
In summary, in the method provided in this embodiment, the identifier of the message publisher is added to the first message topic, so as to obtain the second message topic, the message publisher may publish the message under the second message topic through the second message topic, and the message receiver may receive the message under the second message topic through the second message topic. Because the second message theme is a newly defined message theme, dynamic addition of the message theme can be realized, and in the process of adding the message theme, a code is not required to be modified, so that the process of adding the message theme is simplified.
In addition, the method provided by the embodiment of the application separates the parent theme from the sub-theme, and when the user dynamically adds the sub-theme, the user only needs to set own generation rules (namely, rules for generating the second message theme) without modifying the original total message theme. Namely, when the requirement is changed, only the local code is required to be changed, so that a new function can be better introduced. And the subtopic can be uniquely identified by the IP address and the MAC address of the publisher in the declaration process, and when the enterprise deploys related services, if the Nats service has a problem. The method can quickly locate the problem according to the identification, and is convenient for checking the subsequent problem and quickly optimizing iteration.
It should be noted that, the sequence of the steps of the method provided in the embodiment of the present application may be appropriately adjusted, the steps may also be increased or decreased according to the situation, and any method that is easily conceivable to be changed by those skilled in the art within the technical scope of the present application should be covered within the protection scope of the present application, so that no further description is given.
Fig. 12 is a schematic diagram of a message publishing device applied to a distributed message queue system according to an exemplary embodiment of the present application. As shown in fig. 12, the apparatus includes:
The transceiver module 1201 is configured to obtain, by using a server, a first identifier of the device, where the first identifier is used to identify a computer device where the device is located;
a processing module 1202, configured to combine the first identifier with a first message topic to obtain a second message topic;
the transceiver module 1201 is configured to issue, through the server, a message under the second message theme.
In an alternative design, as shown in fig. 13, the apparatus further comprises:
an obtaining module 1203, configured to obtain a second identifier of a computer device where the apparatus is located;
the transceiver module 1201 is configured to send a first request to the server, where the first request carries the second identifier;
the transceiver module 1201 is configured to receive the first identifier sent by the server, where the first identifier is generated by the server according to the second identifier.
In an alternative design, the second identifier includes at least one of:
a MAC address;
an IP address;
processor device number.
In an alternative design, the transceiver module 1201 is configured to:
and receiving the first identifier sent by the server, wherein the first identifier is generated by the server according to the timestamp of the first request.
In an alternative design, the processing module 1202 is configured to:
and adding the first identifier to the tail of the first message theme to obtain the second message theme.
Fig. 14 is a schematic diagram of a message receiving apparatus applied to a distributed message queue system according to an exemplary embodiment of the present application. As shown in fig. 14, the apparatus includes:
the transceiver module 1401 is configured to obtain, by using a server, a first identifier of a first client, where the first identifier is used to identify a computer device where the first client is located;
a processing module 1402, configured to combine the first identifier with a first message topic to obtain a second message topic;
the transceiver module 1401 is configured to receive, by the server, a message under the second message theme.
In an alternative design, the transceiver module 1401 is configured to:
sending a second request to the server;
and receiving the first identifier sent by the server, wherein the first identifier is generated by the server according to a second identifier, and the second identifier is obtained by the first client and is obtained by the computer equipment where the first client is located.
In an alternative design, the processing module 1402 is configured to:
And adding the first identifier to the tail of the first message theme to obtain the second message theme.
Fig. 15 is a schematic diagram of a messaging device applied to a distributed message queue system according to an exemplary embodiment of the present application. As shown in fig. 15, the apparatus includes:
a transceiver module 1501, configured to send a first identifier to a first client, where the first identifier is used to identify a computer device where the first client is located;
the transceiver module 1501 is configured to send the first identifier to a second client;
the transceiver module 1501 is configured to receive a message under a second message theme issued by the first client;
the transceiver module 1501 is configured to send a message under the second message theme to the second client;
the first client and the second client are used for combining the first identifier and a first message theme to obtain the second message theme.
In an alternative design, as shown in fig. 16, the apparatus further comprises:
the transceiver module 1501 is configured to receive a first request sent by the first client, where the first request carries a second identifier, where the second identifier is an identifier of a computer device where the first client is located, where the first client is acquired by the first client;
A generating module 1502, configured to generate the first identifier according to the second identifier;
the transceiver module 1501 is configured to send the first identifier to the first client.
In an alternative design, the generating module 1502 is configured to:
the first identifier is generated from a timestamp of the receipt of the first request.
In an alternative design, the second identifier includes a MAC address and/or an IP address of a computer device in which the first client is located; as shown in fig. 17, the apparatus further includes:
a determining module 1503, configured to determine, according to the MAC address and/or the IP address, a computer device where the first client where the abnormality occurs, where the abnormality occurs in the message under the second message subject occurs.
It should be noted that: the message issuing device provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the message publishing device provided in the above embodiment and the message publishing method embodiment applied to the distributed message queue system belong to the same concept, and the detailed implementation process of the message publishing device is detailed in the method embodiment and will not be described herein.
Similarly, in the message receiving apparatus provided in the above embodiment, only the division of the above functional modules is used as an example, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the message receiving device provided in the above embodiment belongs to the same concept as the message receiving method embodiment applied to the distributed message queue system, and the detailed implementation process of the message receiving device is detailed in the method embodiment, which is not described herein again.
Similarly, the message transceiver provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the message transceiver provided in the above embodiment belongs to the same concept as the message transceiver method embodiment applied to the distributed message queue system, and the detailed implementation process of the message transceiver is referred to the method embodiment, which is not repeated here.
Embodiments of the present application also provide a computer device comprising: the system comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the message publishing method applied to the distributed message queue system, the message receiving method applied to the distributed message queue system or the message receiving method applied to the distributed message queue system provided by the method embodiments.
Illustratively, fig. 18 is a schematic structural diagram of a computer device according to an exemplary embodiment of the present application.
The computer apparatus 1800 includes a central processing unit (Central Processing Unit, CPU) 1801, a system Memory 1804 including a random access Memory (Random Access Memory, RAM) 1802 and a Read-Only Memory (ROM) 1803, and a system bus 1805 connecting the system Memory 1804 and the central processing unit 1801. The computer device 1800 also includes a basic Input/Output system (I/O) 1806, which facilitates the transfer of information between various devices within the computer device, and a mass storage device 1807 for storing an operating system 1813, application programs 1814, and other program modules 1815.
The basic input/output system 1806 includes a display 1808 for displaying information and an input device 1809, such as a mouse, keyboard, etc., for user input of information. Wherein the display 1808 and the input device 1809 are coupled to the central processing unit 1801 via an input output controller 1810 coupled to the system bus 1805. The basic input/output system 1806 can also include an input/output controller 1810 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input output controller 1810 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 1807 is connected to the central processing unit 1801 through a mass storage controller (not shown) connected to the system bus 1805. The mass storage device 1807 and its associated computer-readable storage media provide non-volatile storage for the computer device 1800. That is, the mass storage device 1807 may include a computer-readable storage medium (not shown) such as a hard disk or a compact disk-Only (CD-ROM) drive.
The computer-readable storage medium may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable storage instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, erasable programmable read-Only register (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-Only Memory (EEPROM), flash Memory or other solid state Memory devices, CD-ROM, digital versatile disks (Digital Versatile Disc, DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the one described above. The system memory 1804 and mass storage 1807 described above may be referred to collectively as memory.
The memory stores one or more programs configured to be executed by the one or more central processing units 1801, the one or more programs containing instructions for implementing the above-described method embodiments, the central processing unit 1801 executing the one or more programs to implement the methods provided by the respective method embodiments described above.
According to various embodiments of the present application, the computer device 1800 may also operate by a remote computer device connected to the network through a network, such as the Internet. I.e., the computer device 1800 may connect to the network 1812 through a network interface unit 1811 connected to the system bus 1805, or alternatively, the network interface unit 1811 may be used to connect to other types of networks or remote computer device systems (not shown).
The memory also includes one or more programs stored in the memory, the one or more programs including steps for performing the methods provided by the embodiments of the present application, as performed by the computer device.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and each module described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
The embodiment of the application also provides a computer readable storage medium, wherein at least one instruction, at least one section of program, code set or instruction set is stored in the readable storage medium, and when the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by a processor of computer equipment, the message issuing method applied to the distributed message queue system, the message receiving method applied to the distributed message queue system or the message receiving method applied to the distributed message queue system provided by the embodiment of the method are realized.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the message publishing method applied to the distributed message queue system, the message receiving method applied to the distributed message queue system or the message transceiving method applied to the distributed message queue system provided in the above method embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the above readable storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments is merely illustrative of the present application and is not intended to limit the invention to the particular embodiments shown, but on the contrary, the intention is to cover all modifications, equivalents, alternatives, and alternatives falling within the spirit and principles of the invention.
The foregoing description of the preferred embodiments is merely illustrative of the present application and is not intended to limit the invention to the particular embodiments shown, but on the contrary, the intention is to cover all modifications, equivalents, alternatives, and alternatives falling within the spirit and principles of the invention.

Claims (11)

1. A distributed message queuing system, the system comprising: the system comprises a server, a first client and a second client;
the server side is used for sending a first identifier to the first client side, and the first identifier is used for identifying computer equipment where the first client side is located; the server is further configured to send the first identifier to the second client;
the first client is configured to combine the first identifier with a first message topic to obtain a second message topic, where the first message topic is a message topic of a first message published by the first client, and the second message topic is a message topic to be published by the first client; the first client is further configured to send a second message to the server, where the second message carries the second message theme;
the second client is configured to combine the first identifier with the first message topic to obtain the second message topic, where the first message topic is a message topic of the first message to which the second client has subscribed, and the second message topic is a message topic to which the second client is to subscribe; the second client is further configured to subscribe to the second message topic through the server;
The server is further configured to send the second message to a client subscribing to the second message topic.
2. The system of claim 1, wherein the system further comprises a controller configured to control the controller,
the first client is further configured to obtain a second identifier of a computer device where the first client is located; the first client is further configured to send a first request to the server, where the first request carries the second identifier;
the server is further configured to generate the first identifier according to the second identifier;
wherein the second identifier comprises at least one of:
a medium access control MAC address;
an internet protocol IP address;
processor device number.
3. The system of claim 2, wherein the system further comprises a controller configured to control the controller,
the server is further configured to generate the first identifier according to a timestamp that receives the first request.
4. The system of claim 2, wherein the system further comprises a controller configured to control the controller,
the first client is further configured to input the content of the second message into a classification model to obtain a classification of the second message; the first client is further configured to combine the classification of the second message with a second identifier of a computer device where the first client is located, to obtain the first identifier;
The classification model is obtained through training according to the content of the sample message and the sample classification of the sample message.
5. The system according to any one of claim 1 to 4, wherein,
the second client is further configured to send a second request to the server, where the second request is used to request the server to send the first identifier to the second client.
6. The system according to any of claims 2 to 4, wherein the second identification comprises a MAC address and/or an IP address of the computer device where the first client is located;
the server is further configured to determine, according to the MAC address and/or the IP address, a computer device where the first client having the abnormality is located, where the abnormality occurs in a message under the second message subject.
7. The system of any of claims 1 to 4, wherein the first message topic is a first parent topic or a first child topic in the distributed message queue system;
in the case that the first message topic is the first parent topic, the second message topic is a second child topic of the first parent topic;
In the case that the first message topic is the first sub-topic, the second message topic is a third sub-topic of a second parent topic corresponding to the second sub-topic.
8. A message publishing method for a distributed message queuing system, the method being applied to a first client, the method comprising:
acquiring a first identifier of the first client through a server, wherein the first identifier is used for identifying computer equipment where the first client is located;
combining the first identifier with a first message theme to obtain a second message theme, wherein the first message theme is the message theme of a first message issued by the first client, and the second message theme is the message theme to be issued by the first client;
and sending a second message to the server, wherein the second message carries the second message theme, and the server is used for sending the second message to a client subscribing the second message theme.
9. The method of claim 8, wherein the method further comprises:
acquiring a second identifier of the computer equipment where the first client is located;
And sending a first request to the server, wherein the first request carries the second identifier.
10. A message receiving method applied to a distributed message queue system, the method being applied to a second client, the method comprising:
acquiring a first identifier of a first client through a server, wherein the first identifier is used for identifying computer equipment where the first client is located;
combining the first identifier with a first message theme to obtain a second message theme, wherein the first message theme is the message theme of a first message which is published by the first client and subscribed by the second client, the second message theme is the message theme of a second message published by the first client, and the second message theme is the message theme to be subscribed by the second client;
subscribing the second message theme through the server to receive the second message under the second message theme.
11. A messaging method applied to a distributed message queuing system, wherein the method is applied to a server, the method comprising:
sending a first identifier to a first client, wherein the first identifier is used for identifying computer equipment where the first client is located;
Sending the first identification to a second client;
receiving a second message under a second message theme issued by the first client;
sending the second message under the second message theme to the second client;
the first client and the second client are used for merging the first identifier and a first message theme to obtain the second message theme, wherein the first message theme is a message theme of a first message which is published by the first client and subscribed by the second client.
CN202310149692.5A 2023-02-16 2023-02-16 Distributed message queue system, message publishing method and message receiving method Pending CN116089125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310149692.5A CN116089125A (en) 2023-02-16 2023-02-16 Distributed message queue system, message publishing method and message receiving method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310149692.5A CN116089125A (en) 2023-02-16 2023-02-16 Distributed message queue system, message publishing method and message receiving method

Publications (1)

Publication Number Publication Date
CN116089125A true CN116089125A (en) 2023-05-09

Family

ID=86208337

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310149692.5A Pending CN116089125A (en) 2023-02-16 2023-02-16 Distributed message queue system, message publishing method and message receiving method

Country Status (1)

Country Link
CN (1) CN116089125A (en)

Similar Documents

Publication Publication Date Title
CN110086636B (en) Message distribution method based on mqtt, server and storage medium
US20180329644A1 (en) Data Pipeline Architecture for Analytics Processing Stack
EP3182284A1 (en) Data pipeline architecture for cloud processing of structured and unstructured data
US7921427B2 (en) Method and system for processing messages in an application cluster
CN111711663A (en) Processing method and device for publishing and subscribing services and electronic equipment
US7865550B2 (en) Message processing control in a publish/subscribe system
CN112118315A (en) Data processing system, method, device, electronic equipment and storage medium
CN114024972B (en) Long connection communication method, system, device, equipment and storage medium
CN108683668A (en) Resource checksum method, apparatus, storage medium and equipment in content distributing network
CN110753129A (en) Message transmission method, system, device, equipment and computer readable storage medium
CN107342929B (en) Method, device and system for sending new message notification
CN110727507B (en) Message processing method and device, computer equipment and storage medium
CN110798495B (en) Method and server for end-to-end message push in cluster architecture mode
JP5961471B2 (en) Output comparison method in multiple information systems
CN114610504A (en) Message processing method and device, electronic equipment and storage medium
CN111614726A (en) Data forwarding method, cluster system and storage medium
CN116089125A (en) Distributed message queue system, message publishing method and message receiving method
US9442882B2 (en) Efficient maintenance of a distributed system membership view
CN113472638B (en) Edge gateway control method, system, device, electronic equipment and storage medium
CN116107710A (en) Method, apparatus, device and medium for processing offline rendering tasks
CN110247808B (en) Information transmission method, device, equipment and readable storage medium
CN109309583B (en) Information acquisition method and device based on distributed system, electronic equipment and medium
CN113407339A (en) Resource request feedback method and device, readable storage medium and electronic equipment
CN115202800A (en) Edge cloud service data processing method and device, computer equipment and storage medium
CN112100414A (en) Data processing method, device, system and computer readable storage medium

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