CN113742110A - Message transmission method and device, electronic equipment and storage medium - Google Patents

Message transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113742110A
CN113742110A CN202111065884.5A CN202111065884A CN113742110A CN 113742110 A CN113742110 A CN 113742110A CN 202111065884 A CN202111065884 A CN 202111065884A CN 113742110 A CN113742110 A CN 113742110A
Authority
CN
China
Prior art keywords
subscriber
current
producer
message
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111065884.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.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Wodong Tianjun Information Technology Co Ltd
Priority to CN202111065884.5A priority Critical patent/CN113742110A/en
Publication of CN113742110A publication Critical patent/CN113742110A/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a message transmission method, device, electronic device and storage medium, the method comprising: in response to receiving a current message under a predetermined topic, determining a current producer sending the current message; determining at least one subscriber subscribing to a predetermined topic, resulting in a subscriber set; taking a message transmission channel configured aiming at a preset theme; determining a target producer and a target subscriber according to the message transmission channel; and in the event that it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers, sending the current message to the target subscriber.

Description

Message transmission method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a message transmission method, a message transmission apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
An MQ (Message Queue) is a Message transmission system. MQs are classified into different modes according to different message delivery modes. One is for a producer/subscriber model, where a message sent by a producer (sender of the message) enters a queue, multiple subscribers (receivers of the message) listen to the queue at the same time, and each message in the queue is fetched by only one subscriber, enabling point-to-point transmission of the message. Another is a publish/subscribe model, where a producer publishes a message under a predefined topic, multiple subscribers (recipients of the message) subscribe to the predefined topic in common, and take the message from under the predefined topic in common.
Disclosure of Invention
The present disclosure provides a message transmission method, a message transmission apparatus, an electronic device, a computer-readable storage medium, and a computer program product, which alleviate a problem that a current message is commonly used by all subscribers in a publish/subscribe mode, and enable peer-to-peer transmission of the current message.
One aspect of the present disclosure provides a message transmission method, including: in response to receiving a current message under a predetermined topic, determining a current producer that sent the current message; determining at least one subscriber subscribing to the predetermined topic, resulting in a subscriber set; acquiring a message transmission channel configured for the preset theme; determining a target producer and a target subscriber according to the message transmission channel; and sending the current message to the target subscriber if it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers.
According to an embodiment of the present disclosure, the message transmission method further includes: determining whether the message transmission channel is configured; sending the current message to each subscriber in the set of subscribers if it is determined that the message transmission channel is not configured.
According to an embodiment of the present disclosure, the sending the current message to the target subscriber in case it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers comprises: and under the condition that the identification information of the current producer is determined to be the same as the identification information of the target producer and the identification information set corresponding to the subscriber set comprises the identification information of the target subscriber, sending the current message to the target subscriber.
According to an embodiment of the present disclosure, the message transmission method further includes: sending the current message to each subscriber in the set of subscribers if a preset condition is met; wherein the preset condition comprises at least one of: the current producer is different from the target producer; the target subscriber is not included in the set of subscribers.
According to an embodiment of the present disclosure, the message transmission method further includes: presenting identification information of the current producer and identification information of a subscriber receiving the current message.
Another aspect of the present disclosure provides a message transmission apparatus, including: the system comprises a current producer determining module, a subscriber set determining module, a message transmission channel acquiring module, an object determining module and a first sending module; the current producer determination module is used for responding to the received current message under a preset theme and determining a current producer for sending the current message; the subscriber set determining module is used for determining at least one subscriber subscribed to the predetermined topic to obtain a subscriber set; the message transmission channel acquisition module is used for acquiring a message transmission channel configured aiming at the preset theme; the object determining module is used for determining a target producer and a target subscriber according to the message transmission channel; a first sending module is to send the current message to the target subscriber if it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers.
According to an embodiment of the present disclosure, the message transmission apparatus further includes: the judging module and the second sending module; the judging module is used for determining whether the message transmission channel is configured; a second sending module is configured to send the current message to each subscriber in the set of subscribers if it is determined that the message transmission channel is not configured.
Another aspect of the disclosure provides an electronic device comprising one or more processors, further comprising memory for storing one or more programs; wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the methods of embodiments of the present disclosure.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method of the embodiments of the present disclosure when executed.
Another aspect of the present disclosure provides a computer program product comprising computer-executable instructions that, when executed, implement the method of an embodiment of the present disclosure.
According to the embodiment of the present disclosure, since the current producer, the target producer, the subscriber set, and the target subscriber are predetermined, and when the current producer is the same as the target producer and the target subscriber is included in the subscriber set, the current message that the current producer is published into the topic is sent to the target subscriber. Therefore, the problem that the current message is commonly used by all the subscribers can be relieved, and the point-to-point transmission of the current message between the target producer and the target subscriber can be realized.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an exemplary system architecture to which the message transmission method and apparatus of the present disclosure may be applied;
fig. 2 schematically illustrates a flow chart of a message transmission method according to an embodiment of the present disclosure;
FIG. 3A schematically illustrates a message transmission model diagram specifying a target subscriber usage message according to an embodiment of the disclosure;
fig. 3B schematically illustrates a message transmission model diagram of a subscriber common usage message according to an embodiment of the present disclosure;
fig. 4 schematically shows a flow chart of a message transmission method according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of a message transmission apparatus according to an embodiment of the disclosure; and
fig. 6 schematically shows a block diagram of an electronic device adapted to implement a message transmission method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The on-line practical application adopts the deployment of multi-machine multi-cluster multi-instance, that is, the publish/subscribe mode is adopted, and a plurality of subscribers commonly use the message under the same predetermined theme. When a certain number of machines need to be upgraded, in order to avoid the problem that a large number of machines cannot normally run after being upgraded due to errors of codes used for upgrading, one machine needs to be upgraded preferentially, then the upgraded machine is verified, and after the verification is passed, other machines are upgraded gradually.
In validating on the upgraded machine, the test system acts as a producer, which updates the message, for example, modifies the message format of the message. After the test system publishes the updated message under the predetermined topic, the upgraded machine acts as a subscriber, which obtains the updated message by subscribing to the predetermined topic for verification.
However, in the publish/subscribe mode, the unedited machine may also subscribe to the predetermined topic to obtain the updated message, and since the unedited machine cannot be restricted from obtaining the updated message and the unedited machine cannot process the updated message, the unedited machine may report an error when obtaining the updated message.
The embodiment of the disclosure provides a message transmission method. The method comprises the following steps: in response to receiving a current message under a predetermined topic, determining a current producer sending the current message; determining at least one subscriber subscribing to a predetermined topic, resulting in a subscriber set; acquiring a message transmission channel configured aiming at a preset theme; determining a target producer and a target subscriber according to the message transmission channel; and in the event that it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers, sending the current message to the target subscriber.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which a message transmission method may be applied, according to an embodiment of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal device 101 may be used as a producer, for example, the terminal device 101 is a test system for testing a machine to be tested. The terminal devices 102, 103 may be regarded as subscribers, for example, the terminal device 102 is a machine to be tested after the upgrade is completed, and the terminal device 103 is a machine which is not yet upgraded and does not need to be tested. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The backend management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a message transmission instruction generated according to a message sent by the terminal device 101 and a message transmission channel configured in advance) to the terminal device 102 and/or the terminal device 103.
It should be noted that the message transmission method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the message transmission method and apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The message transmission method provided by the embodiment of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Correspondingly, the message transmission method and apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, and 103 and/or the server 105. Alternatively, the message transmission method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Correspondingly, the message transmission method apparatus provided by the embodiment of the present disclosure may also be disposed in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the current message may be uploaded to the server 105 through the terminal apparatus 101 and the network 104 as the producer. The server 105 then performs the message transmission method provided by the disclosed embodiments. The server 105 then outputs the result to the terminal apparatus 102 via the network 104, so that the current message sent by the terminal apparatus 101 is transmitted to the terminal apparatus 102 via the pre-configured message transmission channel while restricting the transmission of the current message to the terminal apparatus 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of a message transmission method according to an embodiment of the disclosure.
As shown in fig. 2, the method includes operations S201 to S205.
In operation S201, in response to receiving a current message under a predetermined subject, a current producer who transmits the current message is determined.
The predetermined theme corresponds to at least one producer, the producer is a sender of the message, and the producer publishes the message under the predetermined theme. From the messages published under the set topic, the producer who sent the message can be determined. For example, the current message includes identification information of the current producer, the identification information may be IP, ID, name, etc., and the identification information has uniqueness, so that the current producer who sends the current message can be determined by the identification information in the case where a plurality of producers issue messages to a predetermined subject.
In operation S202, at least one subscriber subscribed to a predetermined topic is determined, resulting in a subscriber set.
The predetermined topic may correspond to a plurality of subscribers, the subscribers are receivers of the messages, and the subscribers acquire the messages in the predetermined topic by subscribing to the predetermined topic. The subscriber set may include all subscribers subscribed to a predetermined topic. In some embodiments, determining the subscriber to the predetermined topic may include obtaining identification information of the subscriber to the predetermined topic, and determining the subscriber through the identification information.
In operation S203, a message transmission channel configured for a predetermined topic is acquired.
The message transmission channel can send and receive messages through the queues to achieve the effect of point-to-point message transmission. The message transmission channel can be configured in advance according to the requirements of users. For example, there are 10 machines in the line, of which 1 has been upgraded and the remaining 9 have not. In order to verify whether the upgraded machine can work normally, the upgraded machine needs to be tested by using the test system, for example, the test system sends a current message to the machine to be tested. Therefore, a channel connecting the test system (target producer) and the machine under test (target subscriber) can be configured as a message transmission channel.
In some embodiments, the configuration of the message transmission channel may be performed by specifying identification information of the target producer and identification information of the target subscriber. For example, if the IP of the test system is 192.168.0.1 and the IP of the updated machine is 192.168.0.2, the IP of the target producer is 192.168.0.1, and the IP of the target subscriber is 192.168.0.2, so as to implement the configuration of the message transmission channel. After the configuration is completed, the message sent by the target producer with the IP of 192.168.0.1 is transmitted to the target subscriber with the IP of 192.168.0.2 through the message transmission channel.
In operation S204, a target producer and a target subscriber are determined according to the message transmission channel.
In operation S205, in case it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set, the current message is sent to the target subscriber.
The process of sending the current message to the target subscriber may include: and sending the current message to a message transmission channel from the preset theme, and sending the current message to the target subscriber through the message transmission channel.
Furthermore, in order to make the current message sent by the target producer used only by the target subscriber, the current message may not be sent to the remaining subscribers in the subscriber set other than the target subscriber, thereby implementing point-to-point transmission of the current message.
A message transmission model corresponding to the embodiment of the present disclosure is shown in fig. 3A. There may be multiple producers 302 posting messages under a predefined topic 303 and there may be multiple subscribers 307 subscribing to the predefined topic 303. In transmitting a message, first, the current producer 301 posts the current message under a predefined topic 303. Then, since the current producer 301 is the same as the target producer 302 and the target subscriber 306 is included in the subscriber set 305, the message transmission apparatus transmits the current message under the predetermined subject 303 to the message transmission channel 304. The current message is then transmitted to the target subscriber 306 through point-to-point processing of the message transmission channel 304. Further, the message transmitting device does not send the current message to subscribers 307 in the subscriber set 305 other than the target subscriber 306.
The embodiment of the disclosure can alleviate the problem that the current message is commonly used by all subscribers in the publish/subscribe mode, thereby realizing that the current message cannot be transmitted point-to-point, and preventing the remaining subscribers except the target subscriber in the subscriber set from being abnormally reported by using the current message.
According to another embodiment of the present disclosure, the message transmission method may further include the following operations.
And in the case that a preset condition is met, sending the current message to each subscriber in the subscriber set. The preset condition includes at least one of a first condition that the current producer is different from the target producer and a second condition that the target subscriber is not included in the subscriber set.
It should be noted that whether the preset condition is satisfied may be determined by way of judgment, and the operation of judging whether the preset condition is satisfied may be performed after referring to operation S204 in fig. 2.
In some embodiments, determining whether the preset condition is satisfied may include: it is determined whether the target subscriber is included in the set of subscribers. If not, determining that the preset condition is met. If yes, judging whether the current producer is the same as the target producer. And if the current producer is different from the target producer, determining that the preset condition is met. If the current producer is the same as the target producer, the current message is sent to the target subscriber.
The satisfaction of the preset condition indicates that: the current producer or target subscriber of the current message fails to match the configured message transmission channel, and the current message cannot be transmitted from the current producer to the target subscriber through the message transmission channel.
A message transmission model corresponding to the embodiment of the present disclosure is shown in fig. 3B. There may be multiple producers 302 posting messages under the predefined topic 303 and there may be multiple subscribers 307 subscribing to the predefined topic 303. In transmitting a message, first, the current producer 301 posts the current message under a predefined topic 303. Then, since the current producer 301 is different from the target producer 302 and/or since the target subscriber 306 is not included in the subscriber set 305, the message transmission apparatus transmits the current message under the predetermined topic 303 to each subscriber 307 in the subscriber set 305, and the current message does not need to pass through the message transmission channel 304 in the transmission process.
In one arrangement, the messages are prohibited from being used by the remaining subscribers of the subscriber set other than the target subscriber. For example, 10 machines need to be upgraded, 1 machine needs to be upgraded, the upgraded machine needs to be tested, the remaining 9 machines do not need to be upgraded temporarily, and the user manually configures and limits the IP of the 9 machines without being upgraded to prohibit the 9 machines without being upgraded from using messages. This approach can affect normal use of messages by non-upgraded machines.
In the embodiment of the present disclosure, when the current producer or the target subscriber does not match the pre-configured message transmission channel, the remaining subscribers in the subscriber set except the target subscriber are not limited, and the message transmission apparatus transmits the current message to each subscriber subscribed to the predetermined topic, thereby guaranteeing that the subscriber uses the message normally.
According to another embodiment of the present disclosure, the message transmission method may further include the following operations.
The identification information of the current producer and the identification information of the subscriber receiving the current message are presented.
It should be noted that, in practical applications, when a user configures a message transmission channel, an error occurs, for example, identification information of a wrong target producer is specified, or identification information of a wrong target subscriber is specified, or the user forgets to configure the message transmission channel configuration, or after updating the target producer and/or the target subscriber, forgets to correspondingly update the last configured message transmission channel configuration, which may cause an abnormal error report when the user uses the current message.
Therefore, the embodiment of the disclosure can display the identification information of the current producer and the identification information of the subscriber receiving the current message through the display device, so that the user can conveniently and intuitively know the sender and the receiver of the current message, and the problem of wrong configuration of the message transmission channel can be timely found.
According to another embodiment of the present disclosure, the message transmission method may further include the following operations.
And judging whether the message transmission channel is configured.
If not, the current message is sent to each subscriber in the subscriber set.
It should be noted that the operation of determining whether the message transmission channel is configured may be performed after referring to operation S202 in fig. 2.
The message transmission channel is configured, and can be identification information of a target producer and identification information of a target subscriber which are specified by a user. The message transmission channel is configured to indicate that the user wants the message sent by the target producer to be used by the target subscriber, and the message is not used by the remaining subscribers in the subscriber set except the target subscriber. Accordingly, operation S230 in reference to fig. 2 is performed in order to direct transmission of the message sent by the target producer to the target subscriber.
The message transmission channel is not configured yet and may be at least one of identification information of the target producer and identification information of the target subscriber that the user does not specify. The message transmission channel is not configured to indicate that the message sent by the target producer does not need to be directed to be forwarded to the target subscriber. Thus, the message transmission means sends the current message to each subscriber of the set of subscribers, so that each subscriber of the set of subscribers uses the current message.
In some embodiments, after determining whether the message transmission channel is configured, if the determination result is yes, operation S203 in fig. 2 may be performed.
According to another embodiment of the present disclosure, referring to operation S205 in fig. 2 may include the following operations.
And under the condition that the identification information of the current producer is determined to be the same as the identification information of the target producer, and the identification information of the target subscriber is included in the identification information set corresponding to the subscriber set, sending the current message to the target subscriber.
It should be noted that, because the identification information has uniqueness, it is easy and accurate to determine whether the current producer is the same as the target producer, and whether the target subscriber is included in the subscriber set.
As shown in fig. 4, the message transmission method of the present disclosure is described below with a specific embodiment. The method includes operations S401 to S409. It will be understood by those skilled in the art that the following examples are illustrative only, and the present disclosure is not limited thereto.
In operation S401, in response to receiving a current message under a predetermined topic, a current producer who sends the current message is determined. For example, the current message includes the IP of the current producer, from which the current producer is determined.
In operation S402, at least one subscriber subscribed to a predetermined topic is determined, resulting in a subscriber set. For example, the subscriber subscribes to the information of the predetermined topic, obtains the IP and port of the subscriber subscribed to the predetermined topic, and determines the subscriber through the IP and/or port.
In operation S403, it is determined whether a message transmission channel is configured. If not, performing operation S404; if yes, operation S405 is performed. For example, it is determined whether the user has specified identification information of the target producer and identification information of the target subscriber. If the user does not specify at least one of the identification information of the target producer and the identification information of the target subscriber, it is determined that the message transmission channel has not been configured, and then operation S404 is performed. If the user has designated the identification information of the target producer and has designated the identification information of the target subscriber, it is determined that the message transmission channel is configured, and then operation S405 is performed.
In operation S404, the current message is sent to each subscriber in the subscriber set. For example, the message transmission means transmits the current message under the predetermined topic to each subscriber in the subscriber set, so that the current message is commonly used by the subscribers subscribed to the predetermined topic. In addition, the current message does not need to pass through a message transmission channel when being transmitted.
In operation S405, a message transmission channel configured for a predetermined topic is acquired. For example, the message transmission device reads the configured message transmission channel.
In operation S406, a target producer and a target subscriber are determined according to the message transmission channel. For example, the IP of the target producer and the IP of the target subscriber are determined, and the port of the target producer and the port of the target subscriber can also be obtained.
In operation S407, it is determined whether the current producer is the same as the target producer. If yes, perform operation S408; if not, operation S404 is performed.
In operation S408, it is determined whether the target subscriber is included in the subscriber set. If yes, perform operation S409; if not, operation S404 is performed.
In operation S409, the current message is transmitted to the target subscriber. For example, the message transmission device transmits the current message under the predetermined theme to the message transmission channel, and sends the current message to the target subscriber through the message transmission channel.
Fig. 5 schematically shows a block diagram of a message transmitting apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, a message transmission apparatus 500 of an embodiment of the present disclosure includes: a current producer determination module 501, a subscriber set determination module 502, a message transmission channel acquisition module 503, an object determination module 504, and a first sending module 505. The current producer determination module 501 is configured to determine a current producer to send a current message in response to receiving the current message under a predetermined topic. The subscriber set determining module 502 is configured to determine at least one subscriber subscribed to a predetermined topic, resulting in a subscriber set. The message transmission channel acquiring module 503 is configured to acquire a message transmission channel configured for a predetermined topic. The object determination module 504 is configured to determine a target producer and a target subscriber according to the message transmission channel. The first sending module 505 is configured to send the current message to the target subscriber if it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers.
According to an embodiment of the present disclosure, the message transmission apparatus 500 further includes: the device comprises a judging module and a second sending module. The judging module is used for determining whether the message transmission channel is configured. The second sending module is used for sending the current message to each subscriber in the subscriber set under the condition that the message transmission channel is determined not to be configured.
According to an embodiment of the present disclosure, the first sending module 505 includes: and the first sending sub-module is used for sending the current message to the target subscriber under the condition that the identification information of the current producer is determined to be the same as the identification information of the target producer and the identification information set corresponding to the subscriber set comprises the identification information of the target subscriber.
According to an embodiment of the present disclosure, the message transmission apparatus 500 further includes: and a third sending module, configured to send the current message to each subscriber in the subscriber set if a preset condition is met. The preset condition includes at least one of: the current producer differs from the target producer in that the target subscriber is not included in the set of subscribers.
According to an embodiment of the present disclosure, the message transmission apparatus 500 further includes: a presentation module for presenting identification information of a current producer and identification information of a subscriber receiving the current message.
It should be noted that, the embodiments of the apparatus portion of the present disclosure correspond to the same or similar embodiments of the method portion of the present disclosure, and the detailed description of the present disclosure is omitted here.
Any number of modules, sub-modules, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules and sub-modules according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging the circuit, or in any one of three implementations, or in any suitable combination of any of the three. Alternatively, one or more of the modules, sub-modules according to embodiments of the disclosure may be implemented at least partly as computer program modules, which when executed may perform corresponding functions.
For example, any plurality of the current producer determination module 501, the subscriber set determination module 502, the message transmission channel acquisition module 503, the object determination module 504, and the first sending module 505 may be combined in one module/unit/sub-unit to be implemented, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the current producer determination module 501, the subscriber set determination module 502, the message transmission channel acquisition module 503, the object determination module 504, and the first sending module 505 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the current producer determination module 501, the subscriber set determination module 502, the message transmission channel acquisition module 503, the object determination module 504 and the first sending module 505 may be at least partially implemented as a computer program module which, when executed, may perform a corresponding function.
Fig. 6 schematically illustrates a block diagram of an electronic device suitable for implementing the above-described methods and apparatuses in accordance with an embodiment of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 600 may also include input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604, according to an embodiment of the disclosure. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM602 and/or RAM 603 described above and/or one or more memories other than the ROM602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A method of message transmission, comprising:
in response to receiving a current message under a predetermined topic, determining a current producer that sent the current message;
determining at least one subscriber subscribing to the predetermined topic, resulting in a subscriber set;
acquiring a message transmission channel configured for the preset theme;
determining a target producer and a target subscriber according to the message transmission channel; and
sending the current message to the target subscriber if it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers.
2. The method of claim 1, further comprising:
determining whether the message transmission channel is configured;
sending the current message to each subscriber in the set of subscribers if it is determined that the message transmission channel is not configured.
3. The method of claim 1, wherein the sending the current message to the target subscriber if it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers comprises:
and under the condition that the identification information of the current producer is determined to be the same as the identification information of the target producer and the identification information set corresponding to the subscriber set comprises the identification information of the target subscriber, sending the current message to the target subscriber.
4. The method of any of claims 1 to 3, further comprising:
sending the current message to each subscriber in the set of subscribers if a preset condition is met; wherein the preset condition comprises at least one of:
the current producer is different from the target producer;
the target subscriber is not included in the set of subscribers.
5. The method of claim 4, further comprising:
presenting identification information of the current producer and identification information of a subscriber receiving the current message.
6. A message transmission apparatus, comprising:
a current producer determination module, configured to determine, in response to receiving a current message under a predetermined topic, a current producer that sends the current message;
a subscriber set determining module, configured to determine at least one subscriber subscribed to the predetermined topic, and obtain a subscriber set;
the message transmission channel acquisition module is used for acquiring a message transmission channel configured aiming at the preset theme;
the object determining module is used for determining a target producer and a target subscriber according to the message transmission channel; and
a first sending module to send the current message to the target subscriber if it is determined that the current producer is the same as the target producer and the target subscriber is included in the set of subscribers.
7. The apparatus of claim 6, further comprising:
the judging module is used for determining whether the message transmission channel is configured or not;
a second sending module, configured to send the current message to each subscriber in the subscriber set if it is determined that the message transmission channel is not configured.
8. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
10. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 5 when executed.
CN202111065884.5A 2021-09-10 2021-09-10 Message transmission method and device, electronic equipment and storage medium Pending CN113742110A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111065884.5A CN113742110A (en) 2021-09-10 2021-09-10 Message transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111065884.5A CN113742110A (en) 2021-09-10 2021-09-10 Message transmission method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113742110A true CN113742110A (en) 2021-12-03

Family

ID=78738114

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111065884.5A Pending CN113742110A (en) 2021-09-10 2021-09-10 Message transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113742110A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827194A (en) * 2022-03-25 2022-07-29 青岛海尔科技有限公司 Method and apparatus for transmitting execution result, storage medium, and electronic apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827194A (en) * 2022-03-25 2022-07-29 青岛海尔科技有限公司 Method and apparatus for transmitting execution result, storage medium, and electronic apparatus
CN114827194B (en) * 2022-03-25 2024-03-22 青岛海尔科技有限公司 Method and device for sending execution result, storage medium and electronic device

Similar Documents

Publication Publication Date Title
US11750444B2 (en) Implementation of compliance settings by a mobile device for compliance with a configuration scenario
CN110442524B (en) Method and device for testing web service interface with authentication authorization
EP2589179B1 (en) Apparatus and method for controlling access to multiple services
WO2019242162A1 (en) Middleware installation method and apparatus, and computer device and storage medium
CN113141383B (en) Device information subscription method, client, server, system and storage medium
CN110377440B (en) Information processing method and device
US10972564B2 (en) System and method for automating actions in distributed computing
CN109618174B (en) Live broadcast data transmission method, device, system and storage medium
CN111914262A (en) Test method, device, system, electronic equipment and storage medium
US20140019957A1 (en) Method, apparatus, and system for sharing software among terminals
WO2014008864A1 (en) Method, apparatus, and system for sharing software among terminals
WO2017079866A1 (en) Application installation package acquisition method, information broadcast method, mobile device and base station
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN111782988B (en) Method, apparatus, computer system and storage medium for determining source of application program
CN110855772A (en) Cross-device data storage method, system, device, server and medium
CN110708366A (en) Plug-in process management method, related method and related device
CN110764979A (en) Log identification method, system, electronic device and computer readable medium
US9021114B2 (en) Automatic connection of computing devices
CN113760697A (en) Interface testing method and device, electronic equipment and storage medium
CN113742110A (en) Message transmission method and device, electronic equipment and storage medium
US20120047204A1 (en) Apparatus and method for providing a device management package and a method for receiving the device management package
US9577967B2 (en) Method and system for managing an informational site using a social networking application
CN109495319B (en) Method, device and equipment for determining fault information of CDN node
CN106230878B (en) Equipment service calling method and device based on AllJoyn framework
CN110278248B (en) Method and device for distributing testament information 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