Message transmission method, device, electronic device and storage medium

By determining and sending the target subscriber's message in the publish/subscribe mode, the problem of the current message being used by all subscribers is solved, and the point-to-point transmission of messages is realized, avoiding the risk of errors caused by using updated messages by not upgrading the machine.

CN113742110BActive Publication Date: 2025-04-15BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111065884.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-10
Publication Date
2025-04-15
Estimated Expiration
2041-09-10

AI Technical Summary

Technical Problem

In publish/subscribe mode, the current message is used by all subscribers, resulting in the inability to achieve point-to-point transmission of messages. Unupgraded machines may report abnormal errors due to the inability to process the updated message.

Method used

Point-to-point transmission of messages is achieved by determining the current producer, target producer, subscriber collection and target subscriber, and sending the current message to the target subscriber when the current producer is the same as the target producer and the subscriber collection includes the target subscriber, the peer-to-point transmission of the message is achieved.

Benefits of technology

It alleviates the problem that the current message is used by all subscribers, realizes point-to-point transmission of messages, and prevents unupgraded machines from reporting abnormal errors due to using updated messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113742110B_ABST
    Figure CN113742110B_ABST
Patent Text Reader

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 that sends the current message; determining at least one subscriber who subscribes to the predetermined topic and obtaining a subscriber set; obtaining a message transmission channel configured for the predetermined topic; determining a target producer and a target subscriber according to the message transmission channel; and sending the current message to the target subscriber when it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more specifically, to a message transmission method, a message transmission device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] MQ (Message Queue) is a message transmission system. MQ is divided into different modes according to different message transmission methods. One is the producer / subscriber mode, where the message sent by the producer (sender of the message) enters the queue, multiple subscribers (receivers of the message) listen to the queue at the same time, and each message in the queue is only obtained by one subscriber, realizing point-to-point transmission of messages. The other is the publish / subscribe mode, where the producer publishes the message to a predetermined topic, and multiple subscribers (receivers of the message) subscribe to the predetermined topic together and obtain messages from the predetermined topic together. Summary of the invention

[0003] The present disclosure provides a message transmission method, a message transmission device, an electronic device, a computer-readable storage medium, and a computer program product, which alleviate the problem that the current message is commonly used by all subscribers in a publish / subscribe mode and realize point-to-point transmission of the current message.

[0004] One aspect of the present disclosure provides a message transmission method, comprising: in response to receiving a current message under a predetermined topic, determining a current producer that sends the current message; determining at least one subscriber who subscribes to the predetermined topic to obtain a subscriber set; acquiring a message transmission channel configured for the predetermined topic; determining a target producer and a target subscriber based on the message transmission channel; and when it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set, sending the current message to the target subscriber.

[0005] According to an embodiment of the present disclosure, the message transmission method further includes: determining whether the message transmission channel has been configured; and if it is determined that the message transmission channel has not been configured, sending the current message to each subscriber in the subscriber set.

[0006] According to an embodiment of the present disclosure, when it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set, sending the current message to the target subscriber includes: when it is determined that the identification information of the current producer is the same as the identification information of the target producer and the identification information set corresponding to the subscriber set includes the identification information of the target subscriber, sending the current message to the target subscriber.

[0007] According to an embodiment of the present disclosure, the message transmission method also includes: sending the current message to each subscriber in the subscriber set when a preset condition is met; wherein the preset condition includes at least one of the following: the current producer is different from the target producer; the target subscriber is not included in the subscriber set.

[0008] According to an embodiment of the present disclosure, the message transmission method further includes: displaying identification information of the current producer and identification information of a subscriber who has received the current message.

[0009] Another aspect of the present disclosure provides a message transmission device, including: a current producer determination module, a subscriber set determination module, a message transmission channel acquisition module, an object determination module and a first sending module; the current producer determination module is used to determine the current producer who sends the current message in response to receiving a current message under a predetermined topic; the subscriber set determination module is used to determine at least one subscriber who subscribes to the predetermined topic and obtain a subscriber set; the message transmission channel acquisition module is used to obtain a message transmission channel configured for the predetermined topic; the object determination module is used to determine a target producer and a target subscriber according to the message transmission channel; the first sending module is used to send the current message to the target subscriber when it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set.

[0010] According to an embodiment of the present disclosure, the message transmission device also includes: a judgment module and a second sending module; the judgment module is used to determine whether the message transmission channel has been configured; the second sending module is used to send the current message to each subscriber in the subscriber set when it is determined that the message transmission channel has not been configured.

[0011] Another aspect of the present disclosure provides an electronic device, comprising one or more processors and a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in the embodiments of the present disclosure.

[0012] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described in the embodiments of the present disclosure when executed.

[0013] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions. When the instructions are executed, they are used to implement the method described in the embodiments of the present disclosure.

[0014] According to the embodiments 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 subscriber set includes the target subscriber, the current message published by the current producer in the topic is sent to the target subscriber. Therefore, the problem of the current message being used by all subscribers can be alleviated, and the current message can be transmitted point-to-point between the target producer and the target subscriber. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0016] Figure 1 An exemplary system architecture to which the message transmission method and apparatus of the present disclosure can be applied is schematically shown;

[0017] Figure 2 The flowchart of the message transmission method according to the embodiment of the present disclosure is schematically shown;

[0018] Figure 3A A schematic diagram of a message transmission model for specifying a target subscriber to use a message according to an embodiment of the present disclosure is schematically shown;

[0019] Figure 3B A schematic diagram of a message transmission model for subscribers to jointly use messages according to an embodiment of the present disclosure is schematically shown;

[0020] Figure 4 A flowchart of a message transmission method according to another embodiment of the present disclosure is schematically shown;

[0021] Figure 5 A block diagram schematically shows a message transmission device according to an embodiment of the present disclosure; and

[0022] Figure 6 A block diagram of an electronic device suitable for implementing a message transmission method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0025] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0026] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0027] The actual online application will be deployed with multiple machines, multiple clusters and multiple instances, that is, using the publish / subscribe mode, multiple subscribers will use the messages under the same predetermined topic. When a certain number of machines need to be upgraded, in order to avoid errors in the upgraded code, which may cause a large number of machines to fail to operate normally after the upgrade, it is necessary to upgrade one of the machines first, and then verify the upgraded machine. After the verification is passed, other machines can be gradually upgraded.

[0028] During the verification process on the upgraded machine, the test system, as a producer, will update the message, such as modifying the message format. After the test system publishes the updated message to the predetermined topic, the upgraded machine, as a subscriber, obtains the updated message by subscribing to the predetermined topic for verification.

[0029] However, in the publish / subscribe mode, non-upgraded machines will also subscribe to the scheduled topic to obtain updated messages. Since it is impossible to restrict non-upgraded machines from obtaining updated messages, and non-upgraded machines cannot process updated messages, non-upgraded machines will report an exception when obtaining updated messages.

[0030] The embodiment of the present disclosure provides a message transmission method. The method includes: in response to receiving a current message under a predetermined topic, determining a current producer that sends the current message; determining at least one subscriber that subscribes to the predetermined topic and obtaining a subscriber set; obtaining a message transmission channel configured for the predetermined topic; determining a target producer and a target subscriber according to the message transmission channel; and sending the current message to the target subscriber when it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set.

[0031] Figure 1 The exemplary system architecture 100 to which the message transmission method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0032] like Figure 1 As shown, 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 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0033] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal device 101 can be used as a producer, for example, the terminal device 101 is a test system for testing the machine to be tested. The terminal devices 102 and 103 can be used as subscribers, for example, the terminal device 102 is a machine to be tested that has been upgraded, and the terminal device 103 is a machine that has not been upgraded and does not need to be tested. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).

[0034] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0035] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as message transmission instructions generated according to the message sent by the terminal device 101 and the pre-configured message transmission channel) to the terminal device 102 and / or the terminal device 103.

[0036] It should be noted that the message transmission method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the message transmission method device provided in the embodiment of the present disclosure can generally be set in the server 105. The message transmission method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105. Accordingly, the message transmission method device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105. Alternatively, the message transmission method provided in the embodiment of the present disclosure can also be executed by the terminal device 101, 102, or 103, or it can also be executed by other terminal devices different from the terminal device 101, 102, or 103. Accordingly, the message transmission method device provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103, or it can be set in other terminal devices different from the terminal device 101, 102, or 103.

[0037] For example, the current message can be uploaded to the server 105 through the terminal device 101 as a producer and the network 104. Then the server 105 executes the message transmission method provided in the embodiment of the present disclosure. Then the server 105 outputs the result to the terminal device 102 through the network 104, so that the current message sent by the terminal device 101 is transmitted to the terminal device 102 through the pre-configured message transmission channel, and the current message is limited to be transmitted to the terminal device 103.

[0038] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0039] Figure 2 The flowchart of the message transmission method according to the embodiment of the present disclosure is schematically shown.

[0040] like Figure 2 As shown, the method includes operations S201 to S205.

[0041] In operation S201, in response to receiving a current message under a predetermined topic, a current producer sending the current message is determined.

[0042] The predetermined topic corresponds to at least one producer. The producer is the sender of the message. The producer publishes the message to the predetermined topic. According to the message published to the set topic, the producer who sent the message can be determined. For example, the current message includes the identification information of the current producer. The identification information can be IP, ID, name, etc., and the identification information is unique, so that when multiple producers publish messages to the predetermined topic, the current producer who sent the current message can be determined by the identification information.

[0043] In operation S202, at least one subscriber subscribing to a predetermined topic is determined to obtain a subscriber set.

[0044] A predetermined topic may correspond to multiple subscribers, and a subscriber is a recipient of a message. A subscriber obtains messages in a predetermined topic by subscribing to the predetermined topic. A subscriber set may include all subscribers who subscribe to the predetermined topic. In some embodiments, a process of determining a subscriber who subscribes to a predetermined topic may include obtaining identification information of a subscriber who subscribes to the predetermined topic, and determining the subscriber by the identification information.

[0045] In operation S203, a message transmission channel configured for a predetermined topic is obtained.

[0046] The message transmission channel can send and receive messages through queues to achieve the effect of point-to-point message transmission. The message transmission channel can be pre-configured according to user needs. For example, there are 10 machines online, one of which has been upgraded, and the remaining 9 machines have not been upgraded. In order to verify whether the upgraded machine can work properly, it is necessary to use the test system to test the upgraded machine, for example, to send the current message sent by the test system to the machine to be tested. Therefore, a channel connecting the test system (target producer) and the machine to be tested (target subscriber) can be configured as a message transmission channel.

[0047] In some embodiments, the message transmission channel can be configured by specifying the identification information of the target producer and the 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 can be specified as 192.168.0.1, and the IP of the target subscriber can be specified as 192.168.0.2 to implement the configuration of the message transmission channel. After the configuration is completed, the message sent by the target producer with an IP of 192.168.0.1 will be transmitted to the target subscriber with an IP of 192.168.0.2 through the message transmission channel.

[0048] In operation S204, a target producer and a target subscriber are determined according to the message transmission channel.

[0049] In operation S205, when 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.

[0050] The process of sending the current message to the target subscriber may include: sending the current message from the predetermined topic to the message transmission channel, and sending the current message to the target subscriber through the message transmission channel.

[0051] In addition, in order to ensure that the current message sent by the target producer is used only by the target subscriber, the current message may not be sent to the remaining subscribers in the subscriber set except the target subscriber, thereby achieving point-to-point transmission of the current message.

[0052] The message transmission model corresponding to the embodiment of the present disclosure is as follows: Figure 3A As shown. There may be multiple producers 302 that publish messages to a predetermined topic 303, and there may be multiple subscribers 307 that subscribe to the predetermined topic 303. In the process of transmitting messages, first, the current producer 301 publishes the current message to the predetermined 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 device transmits the current message under the predetermined topic 303 to the message transmission channel 304. Then, the current message is transmitted to the target subscriber 306 through the point-to-point processing of the message transmission channel 304. In addition, the message transmission device does not send the current message to the subscriber 307 in the subscriber set 305 except the target subscriber 306.

[0053] The disclosed embodiments can alleviate the problem that the current message is used by all subscribers in the publish / subscribe mode, thereby achieving the current message cannot be transmitted point-to-point, and preventing the remaining subscribers in the subscriber set except the target subscriber from reporting abnormal errors due to the use of the current message.

[0054] According to another embodiment of the present disclosure, the message transmission method may further include the following operations.

[0055] If the preset conditions are met, the current message is sent to each subscriber in the subscriber set. The preset conditions include at least one of the following two conditions: the first condition is that the current producer is different from the target producer, and the second condition is that the target subscriber is not included in the subscriber set.

[0056] It should be noted that whether the preset condition is met can be determined by judging whether the preset condition is met. Figure 2 Executed after operation S204 in .

[0057] In some embodiments, determining whether the preset condition is met may include: determining whether the subscriber set includes the target subscriber. If not, determining that the preset condition is met. If yes, determining whether the current producer is the same as the target producer. 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, sending the current message to the target subscriber.

[0058] Meeting the preset condition means 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.

[0059] The message transmission model corresponding to the embodiment of the present disclosure is as follows: Figure 3B As shown. There may be multiple producers 302 that publish messages to a predetermined topic 303, and there may be multiple subscribers 307 that subscribe to the predetermined topic 303. In the process of transmitting messages, first, the current producer 301 publishes the current message to the predetermined topic 303. Then, because the current producer 301 is different from the target producer 302, and / or because the target subscriber 306 is not included in the subscriber set 305, the message transmission device 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 during the transmission process.

[0060] In one technical solution, the remaining subscribers in the subscriber set except the target subscriber will be prohibited from using messages. For example, 10 machines need to be upgraded, and the upgrade of one machine is completed. The upgraded machine needs to be tested, and the remaining 9 machines are not upgraded temporarily. The user manually configures the restriction of the IP addresses of the 9 non-upgraded machines to prohibit the 9 non-upgraded machines from using messages. This method will affect the normal use of messages by the non-upgraded machines.

[0061] In the embodiment of the present disclosure, when the current producer or target subscriber does not match the pre-configured message transmission channel, the remaining subscribers in the subscriber set except the target subscriber are not restricted, and the message transmission device transmits the current message to each subscriber who subscribes to the predetermined topic, thereby ensuring that the subscriber can use the message normally.

[0062] According to another embodiment of the present disclosure, the message transmission method may further include the following operations.

[0063] Displays the identification information of the current producer and the identification information of the subscriber who received the current message.

[0064] It should be noted that, considering the actual application, users may make mistakes when configuring the message transmission channel, such as specifying the wrong identification information of the target producer, or specifying the wrong identification information of the target subscriber, or forgetting to configure the message transmission channel configuration, or forgetting to update the last configured message transmission channel configuration after updating the target producer and / or target subscriber, which will cause the subscriber to receive an exception error when using the current message.

[0065] Therefore, the embodiment of the present disclosure can display the identification information of the current producer and the identification information of the subscriber who receives the current message through a display device, so that the user can intuitively understand the sender and receiver of the current message, thereby promptly discovering the problem of incorrect configuration of the message transmission channel.

[0066] According to another embodiment of the present disclosure, the message transmission method may further include the following operations.

[0067] Determine whether the message transmission channel has been configured.

[0068] If not, the current message is sent to each subscriber in the subscriber set.

[0069] It should be noted that the operation of determining whether the message transmission channel has been configured can be found in the reference Figure 2 The operation S202 is performed after that.

[0070] The message transmission channel has been configured, which means that the user has specified the identification information of the target producer and the identification information of the target subscriber. The message transmission channel has been configured, which means that the user wants the message sent by the target producer to be used by the target subscriber, and the message will not be used by the remaining subscribers in the subscriber set except the target subscriber. Therefore, the execution reference Figure 2 Operation S230 in the process is performed to transmit the message sent by the target producer to the target subscriber in a targeted manner.

[0071] The message transmission channel has not been configured, which may be that the user has not specified at least one of the identification information of the target producer and the identification information of the target subscriber. The message transmission channel has not been configured, which means that there is no need to forward the message sent by the target producer to the target subscriber. Therefore, the message transmission device sends the current message to each subscriber in the subscriber set, so that each subscriber in the subscriber set uses the current message.

[0072] In some embodiments, after determining whether the message transmission channel has been configured, if the determination result is yes, the reference Figure 2 Operation S203 in .

[0073] According to another embodiment of the present disclosure, Figure 2 Operation S205 in may include the following operations.

[0074] When it is determined that the identification information of the current producer is the same as the identification information of the target producer, and the identification information set corresponding to the subscriber set includes the identification information of the target subscriber, the current message is sent to the target subscriber.

[0075] It should be noted that, since the identification information is unique, it is relatively easy and accurate to determine whether the current producer is the same as the target producer, and to determine whether the target subscriber is included in the subscriber set.

[0076] like Figure 4 As shown, the message transmission method of the present disclosure is described below with a specific embodiment. The method includes operations S401 to S409. Those skilled in the art can understand that the following embodiments are only examples, and the present disclosure is not limited thereto.

[0077] 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 an IP address of the current producer, and the current producer is determined by the IP address of the current producer.

[0078] In operation S402, at least one subscriber subscribed to a predetermined topic is determined to obtain a subscriber set. For example, the IP and port of the subscriber subscribed to the predetermined topic are obtained through information about the subscriber subscribing to the predetermined topic, and the subscriber is determined through the IP and / or port.

[0079] In operation S403, it is determined whether the message transmission channel has been configured. If not, operation S404 is performed; if yes, operation S405 is performed. For example, it is determined whether the user has specified the identification information of the target producer and the identification information of the target subscriber. If the user has not specified 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 specified the identification information of the target producer and has specified the identification information of the target subscriber, it is determined that the message transmission channel has been configured, and then operation S405 is performed.

[0080] In operation S404, the current message is sent to each subscriber in the subscriber set. For example, the message transmission device transmits the current message under the predetermined topic to each subscriber in the subscriber set, so that the subscribers who subscribe to the predetermined topic can use the current message together. In addition, the current message does not need to pass through the message transmission channel when it is transmitted.

[0081] In operation S405, a message transmission channel configured for a predetermined topic is obtained. For example, the message transmission device reads the configured message transmission channel.

[0082] In operation S406, the target producer and the target subscriber are determined according to the message transmission channel, for example, the IP address of the target producer and the IP address of the target subscriber are determined, and the port number of the target producer and the port number of the target subscriber may also be obtained.

[0083] In operation S407, it is determined whether the current producer is the same as the target producer. If so, operation S408 is executed; if not, operation S404 is executed.

[0084] In operation S408, it is determined whether the target subscriber is included in the subscriber set. If yes, operation S409 is executed; if no, operation S404 is executed.

[0085] In operation S409, the current message is sent to the target subscriber. For example, the message transmission device transmits the current message under the predetermined topic to the message transmission channel, and sends the current message to the target subscriber through the message transmission channel.

[0086] Figure 5 The block diagram of a message transmission device according to an embodiment of the present disclosure is schematically shown.

[0087] like Figure 5 As shown, the message transmission device 500 of the 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 used to determine the current producer that sends the current message in response to receiving the current message under the predetermined topic. The subscriber set determination module 502 is used to determine at least one subscriber who subscribes to the predetermined topic and obtain a subscriber set. The message transmission channel acquisition module 503 is used to obtain a message transmission channel configured for the predetermined topic. The object determination module 504 is used to determine the target producer and the target subscriber according to the message transmission channel. The first sending module 505 is used to send the current message to the target subscriber when it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set.

[0088] According to an embodiment of the present disclosure, the message transmission device 500 further includes: a judgment module and a second sending module. The judgment module is used to determine whether the message transmission channel has been configured. The second sending module is used to send the current message to each subscriber in the subscriber set if it is determined that the message transmission channel has not been configured.

[0089] According to an embodiment of the present disclosure, the first sending module 505 includes: a first sending submodule, which is used to send the current message to the target subscriber when it is determined that the identification information of the current producer is the same as the identification information of the target producer, and the identification information set corresponding to the subscriber set includes the identification information of the target subscriber.

[0090] According to an embodiment of the present disclosure, the message transmission device 500 further includes: a third sending module, which is used to send the current message to each subscriber in the subscriber set when a preset condition is met. The preset condition includes at least one of the following: the current producer is different from the target producer, and the target subscriber is not included in the subscriber set.

[0091] According to an embodiment of the present disclosure, the message transmission device 500 further includes: a display module, which is used to display the identification information of the current producer and the identification information of the subscriber who receives the current message.

[0092] It should be noted that the embodiments of the device part of the present disclosure are the same or similar to the embodiments of the method part of the present disclosure, and the present disclosure will not repeat them here.

[0093] According to the modules and submodules of the embodiments of the present disclosure, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules and submodules of the embodiments of the present disclosure, any one or more thereof can be split into multiple modules for implementation. According to the modules and submodules of the embodiments of the present disclosure, any one or more thereof can be at least partially implemented 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 can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, according to the modules and submodules of the embodiments of the present disclosure, one or more thereof can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0094] For example, any multiple 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 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions 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 can be at least partially implemented 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 can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in an appropriate 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 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be performed.

[0095] Figure 6 A block diagram of an electronic device suitable for implementing the above-described method and apparatus according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0096] like Figure 6 As shown, the 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 part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0097] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0098] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The system 600 may further include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 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, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0099] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0100] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0101] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0102] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .

[0103] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0104] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0105] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A message transmission method, comprising: In response to receiving a current message under a predetermined topic, determining a current producer that sent the current message; Determine at least one subscriber who subscribes to the predetermined topic, and obtain a subscriber set; Determining whether the message transmission channel has been configured; In the case of determining the configuration of the message transmission channel, obtaining the message transmission channel configured for the predetermined topic, wherein the message transmission channel is configured as a channel connecting a target producer and a target subscriber; Determining a target producer and a target subscriber according to the message transmission channel; and If it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set, sending the current message to the target subscriber; When it is determined that the message transmission channel has not been configured, the current message is sent to each subscriber in the subscriber set.

2. The method according to claim 1, wherein: When it is determined that the current producer is the same as the target producer and the target subscriber is included in the subscriber set, sending the current message to the target subscriber comprises: When it is determined that the identification information of the current producer is the same as the identification information of the target producer, and the identification information set corresponding to the subscriber set includes the identification information of the target subscriber, the current message is sent to the target subscriber.

3. The method according to claim 1 or 2, further comprising: When a preset condition is met, the current message is sent to each subscriber in the subscriber set; wherein the preset condition includes at least one of the following: The current producer is different from the target producer; The target subscriber is not included in the subscriber set.

4. The method according to claim 3, further comprising: The identification information of the current producer and the identification information of the subscriber who received the current message are displayed.

5. A message transmission device, comprising: A current producer determination module, configured to determine a current producer that sends the current message in response to receiving a current message under a predetermined topic; A subscriber set determination module, used to determine at least one subscriber subscribing to the predetermined topic, and obtain a subscriber set; A judgment module, used to determine whether the message transmission channel has been configured; A message transmission channel acquisition module, configured to acquire a message transmission channel configured for the predetermined topic when the message transmission channel configuration is determined, wherein the message transmission channel is configured as a channel connecting a target producer and a target subscriber; an object determination module, configured to determine a target producer and a target subscriber according to the message transmission channel; and A first sending module, 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 subscriber set; The second sending module is configured to send the current message to each subscriber in the subscriber set when it is determined that the message transmission channel has not been configured.

6. An electronic device comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 4.

8. A computer program product, comprising computer executable instructions, which are used to implement the method according to any one of claims 1 to 4 when executed.

Citation Information

Patent Citations

  • Method, device, electronic device and storage medium for processing messages

    CN108897607A