CN113938522B - Event message transmission method, system, device and computer storage medium - Google Patents

Event message transmission method, system, device and computer storage medium Download PDF

Info

Publication number
CN113938522B
CN113938522B CN202111185305.0A CN202111185305A CN113938522B CN 113938522 B CN113938522 B CN 113938522B CN 202111185305 A CN202111185305 A CN 202111185305A CN 113938522 B CN113938522 B CN 113938522B
Authority
CN
China
Prior art keywords
event
transmitted
message
terminal
event message
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.)
Active
Application number
CN202111185305.0A
Other languages
Chinese (zh)
Other versions
CN113938522A (en
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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202111185305.0A priority Critical patent/CN113938522B/en
Publication of CN113938522A publication Critical patent/CN113938522A/en
Application granted granted Critical
Publication of CN113938522B publication Critical patent/CN113938522B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node

Abstract

The invention provides an event message transmission method, an event message transmission system, event message transmission equipment and a computer storage medium, wherein the event message transmission method comprises the following steps: the event publishing terminal pushes the event message to be transmitted to an event bus so as to distribute the event message to be transmitted to corresponding namespaces through the event bus, and each namespace is connected with a plurality of event subscribing terminals; the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, and transmits the event to be transmitted to a target event processing terminal when the judging result is yes, wherein the target event processing terminal is one or more event processing terminals registered in the event subscribing terminal in advance; and the target event processing end processes the event message to be transmitted. The invention realizes the separation of the release and the receiving of the event, releases the coupling relation between the event release end and the final event receiving equipment, and improves the event processing efficiency.

Description

Event message transmission method, system, device and computer storage medium
Technical Field
The present invention relates to the field of message transmission technologies, and in particular, to a method, a system, an apparatus, and a computer storage medium for transmitting an event message.
Background
In internet product applications, there are often some scenes where event notifications are issued, for example, in a state machine, when a task state changes, an in-station notification needs to be sent to related personnel to remind the related personnel to check the task state; for another example, in the workflow, when the workflow goes to a certain step, a manual auditing node is set, and a short message is required to inform related personnel to conduct approval, etc.
In the related art, the method of event notification is generally a manner of directly calling a downstream interface, that is, the event publishing terminal calls an interface of a corresponding event receiving terminal according to the notification manner of the event, so as to forward the event to the event receiving terminal, and the receiving terminal performs corresponding processing on the event. For example, when the task state in the state machine changes, the state machine as an event issuing end directly calls an interface of the terminal equipment of the related personnel, and sends the event to the terminal equipment of the related personnel.
However, the existing method greatly increases the coupling between the event issuing end and the event receiving end, and once the notification mode or notification behavior of the event changes, all the behaviors for sending the event notification need to be modified, thereby reducing the efficiency of event forwarding and processing.
Disclosure of Invention
The invention provides an event message transmission method, an event message transmission system, event message transmission equipment and a computer storage medium, which are used for solving the problems of low efficiency of event forwarding and event processing caused by strong coupling between an event release end and an event receiving end in the prior art.
A first aspect of the present invention provides an event message transmission method, including:
the event publishing terminal pushes the event message to be transmitted to an event bus so as to distribute the event message to be transmitted to corresponding namespaces through the event bus, and each namespace is connected with a plurality of event subscribing terminals;
the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, and transmits the event to be transmitted to a target event processing terminal when the judging result is yes, wherein the target event processing terminal is one or more event processing terminals registered in the event subscribing terminal in advance;
and the target event processing end processes the event message to be transmitted.
Optionally, each event subscription terminal corresponds to a set of event subscription information;
the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, including:
and the event subscription terminal judges whether the event message to be transmitted is a subscribed event message according to the corresponding event subscription message.
Optionally, the event message to be transmitted includes a first set of event topics, and the event subscription information includes a second set of event topics subscribed by the event subscription end;
the event subscription terminal judges whether the event message to be transmitted is a subscribed event message according to the corresponding event subscription message, and comprises the following steps:
judging whether the first group of event topics contain the second group of event topics, if so, determining that the event message to be transmitted is the subscribed event message of the event subscription terminal.
Optionally, the event message to be transmitted includes names of one or more namespaces;
the distributing the event message to be transmitted to the corresponding naming space through the event bus includes:
distributing the event message to be transmitted to one or more namespaces corresponding to the names of the namespaces through the event bus;
wherein the different namespaces are isolated from each other.
Optionally, before the event publisher pushes the event message to be transmitted to the event bus, the method further includes:
creating a name space on the event bus according to registration information input by a user, and binding the registration information with the name space;
wherein, a piece of registration information is correspondingly bound with a naming space.
Optionally, the processing the event message to be transmitted by the target event processing end includes:
and the target event processing end calls a target transmission interface according to the event message to be transmitted so as to transmit the event message to be transmitted to target equipment through the target transmission interface.
Optionally, the method further comprises:
if the target transmission interface is successfully called, the target event processing end returns a calling result of the target transmission interface to a preset callback interface address;
if the target transmission interface fails to be called, the target event processing end returns an abnormal reason to a preset callback interface address, and the target transmission interface is called again according to preset calling times.
A second aspect of the present invention provides an event message transmission system comprising: the system comprises an event bus, event subscription terminals and event processing terminals, wherein a plurality of namespaces are arranged on the event bus, each namespace is connected with a plurality of event subscription terminals, and each event subscription terminal is connected with one or more event processing terminals;
the event publishing terminal pushes the event message to be transmitted to an event bus so as to distribute the event message to be transmitted to a corresponding naming space through the event bus;
the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, and transmits the event to be transmitted to a target event processing terminal when the judging result is yes, wherein the target event processing terminal is one or more event processing terminals registered in the event subscribing terminal in advance;
and the target event processing end processes the event message to be transmitted.
A third aspect of the present invention provides a computer apparatus comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored in the memory to cause the at least one processor to perform the method of event message transmission according to the first aspect of the present invention.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the method for transmitting an event message according to the first aspect of the present invention.
The invention provides an event message transmission method, a system, equipment and a computer storage medium, wherein when an event is triggered, an event publishing terminal pushes an event message to be transmitted onto an event bus directly, then the event message to be transmitted is distributed into corresponding namespaces through the event bus, and as each namespace is connected with a plurality of event subscribing terminals, each event subscribing terminal can judge whether the event message to be transmitted is the event message subscribed by the event subscribing terminal, if the event message to be transmitted is the event message subscribed by the event subscribing terminal, the event subscribing terminal transmits the event message to be transmitted to a target event processing terminal registered in the event subscribing terminal in advance for processing. The event information is uniformly pushed to the event bus, the receiving and processing of the subsequent event information are completed by the event subscribing terminal and the event processing terminal, the event release and receiving are split, the coupling relation between the event release terminal and the final event receiving equipment is relieved, the influence on the whole system caused by the change of an external event processing mechanism is avoided, and the event processing efficiency is improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention and that other drawings can be obtained from them without inventive effort for a person skilled in the art.
FIG. 1 is an application scenario diagram of an event message transmission method according to an exemplary embodiment of the present invention;
FIG. 2 is a flow chart of an event message transmission method according to an exemplary embodiment of the present invention;
FIG. 3 is a flow chart of an event message transmission method according to an exemplary embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a structure of an event message transmission system according to an exemplary embodiment of the present invention;
fig. 5 is a schematic diagram of a computer device according to an exemplary embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
At present, in internet product applications, there are often some situations where event notification is issued, in related art, a method for event notification is generally a manner of directly calling a downstream interface, that is, logic for sending a time notification is written in an application in advance by using hard coding, an event issuing terminal calls an interface of a corresponding event receiving terminal according to a notification manner of an event described by the coding, so as to forward the event to the event receiving terminal, and the receiving terminal performs corresponding processing on the event. However, this method greatly increases the coupling between the event issuing end and the event receiving end, and once the notification mode or notification behavior of the event changes, all the behaviors of sending the event notification need to be modified, thereby reducing the efficiency of event forwarding and processing.
In view of this drawback, the main idea of the present invention is: the event bus mode is adopted, namely, whatever event messages are uniformly sent to the event bus, then the event messages are sent to the name space through the event bus, and the receiving and processing of the subsequent event messages are determined by the event subscription end and the event processing end, so that the release and receiving of the event are decoupled. Specifically, when an event is triggered, an event publishing end pushes an event message to be transmitted to an event bus, then the event message to be transmitted is distributed to a corresponding naming space through the event bus, and as each naming space is connected with a plurality of event subscribing ends, each event subscribing end can judge whether the event message to be transmitted is subscribed to the event message by the event subscribing end, if the event message to be transmitted is subscribed to the event message by the event subscribing end, the event subscribing end transmits the event message to be transmitted to a target event processing end registered in the event subscribing end in advance for processing. The event information is uniformly pushed to the event bus, the receiving and processing of the subsequent event information are completed by the event subscribing terminal and the event processing terminal, the event release and receiving are split, the coupling relation between the event release terminal and the final event receiving equipment is relieved, the influence on the whole system caused by the change of an external event processing mechanism is avoided, and the event processing efficiency is improved.
Fig. 1 is an application scenario diagram of an event message transmission method according to an exemplary embodiment of the present invention.
As shown in fig. 1, the application scenario provided in this embodiment includes an internet product 101, a server 102, and a terminal device 103; the internet products can include, but are not limited to, products such as state machines, communication applications, game applications and the like, and in the running process of the products, some scenes for releasing event messages usually exist, namely, the event release end is equipment for bearing the internet products; the event issuing end sends the event message triggered in the application process of the product to the service end, and the service end processes the event message and decides which terminal equipment to send the event message to. The terminal device may include, but is not limited to, a mobile phone, a wearable device, a computer, and the like.
Fig. 2 is a flow chart illustrating an event message transmission method according to an exemplary embodiment of the present invention.
As shown in fig. 2, the method provided in this embodiment may include the following steps.
S201, an event publishing terminal pushes an event message to be transmitted to an event bus so as to distribute the event message to be transmitted to corresponding namespaces through the event bus, and each namespace is connected with a plurality of event subscribing terminals.
In this embodiment, the event publishing terminal may be, but not limited to, a device with an internet product, such as a mobile phone, a tablet, a computer, etc.
Specifically, when an event is triggered, the event publishing terminal pushes data such as event specific content and the like as event information to be transmitted to an event bus, a plurality of namespaces can be added to the event bus, different namespaces are isolated from each other and do not affect each other, and the event information to be transmitted is distributed to the corresponding namespaces through the event bus.
In one possible embodiment, the event message to be transmitted may include the name of the namespace, the topic of the event, and the specific content to which the event corresponds. Wherein the namespace name indicates which one or more namespaces to send the event message to be transmitted to; an event topic is a collection of strings, a set of tags that are used to identify the event.
The structure of the event message to be transmitted may be, for example, as follows:
Figure BDA0003298946710000061
wherein, the name of the namespace is task; the payload is event specific content data to be sent, and comprises a data identification id, a data name and a status; topics is the subject of the event.
It should be noted that a plurality of event subscription ends can be added under one namespace, so as to realize connection between the event subscription ends and the namespaces.
S202, the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, and transmits the event to be transmitted to a target event processing terminal when the judging result is yes, wherein the target event processing terminal is one or more event processing terminals registered in the event subscribing terminal in advance.
It should be noted that one event subscription terminal may register one or more event processing terminals.
Specifically, the event subscription end can acquire the event message to be transmitted in the corresponding connected namespaces, further judge whether the acquired event message to be transmitted is subscribed by the event subscription end, and if yes, forward the event message to be transmitted to the corresponding event processing end by the event subscription end.
The namespace a is connected to two event subscription ends, namely an event subscription end 1 and an event subscription end 2, and after an event to be transmitted is distributed to the namespace a through an event bus, the event subscription end 1 and the event subscription end 2 respectively determine whether the event message to be transmitted is subscribed, if the event message to be transmitted is subscribed by the event subscription end 1, but not subscribed by the event subscription end 2, the event subscription end 1 sends the event message to be transmitted to a target event processing end registered in the event subscription end 1.
S203, the target event processing end processes the event message to be transmitted.
Specifically, the event transmission message is finally processed by the target event processing end, and the specific sending of the event message to be transmitted to which terminal equipment is determined.
In this embodiment, when an event is triggered, an event publishing end pushes an event message to be transmitted to an event bus directly, and then the event message to be transmitted is distributed to a corresponding namespace through the event bus. The event information is uniformly pushed to the event bus, the receiving and processing of the subsequent event information are completed by the event subscribing terminal and the event processing terminal, the event release and receiving are split, the coupling relation between the event release terminal and the final event receiving equipment is relieved, the influence on the whole system caused by the change of an external event processing mechanism is avoided, and the event processing efficiency is improved.
Fig. 3 is a flow chart of an event message transmission method according to an exemplary embodiment of the present invention, and the embodiment further describes in detail specific flows of issuing, receiving, etc. of an event message based on the embodiment shown in fig. 2.
As shown in fig. 3, the method for transmitting event messages provided in this embodiment mainly includes four stages of event transmission, event grouping, event subscription and event processing.
The event publishing terminal is connected with an event bus, a plurality of namespaces such as a namespace 1, a namespace 2 and the like are created on the event bus in advance according to the registration information of a user, a plurality of event subscribing terminals are added in each namespace, for example, an event subscribing terminal 1, an event subscribing terminal 2 and an event subscribing terminal 3 are added under the namespace 1, each event subscribing terminal can register one or a plurality of event processing terminals in advance, for example, the event subscribing terminal 1 registers an event processing terminal 1 and an event processing terminal 2, and the like.
Specifically, in the event sending stage, the event publishing end sends an event message to the event bus, where the event message may include a name of a namespace, an event topic, and specific content corresponding to the event, and different event messages are identified by the event topic (e.g., topic1, topic2, and topic3 identify three event messages respectively).
In a possible embodiment, before the event publisher pushes the event message to be transmitted to the event bus, the method further includes: creating a name space on the event bus according to registration information input by a user, and binding the registration information with the name space; wherein, a piece of registration information is correspondingly bound with a naming space.
Specifically, before using the internet product, the user needs to register in the internet product, and the registration information includes an account number and the like, and a registration account number can be correspondingly created and bound to a namespace. Different user registration accounts can be bound to different namespaces, and because the different namespaces are isolated from each other and are not associated with each other, the isolation among different users can be realized through a plurality of namespaces, and the problem of disordered event forwarding is avoided.
Further, in the event grouping stage, all event messages are directly sent to the event bus, and different event messages are transmitted to respective corresponding namespaces through the event bus.
In one possible embodiment, the namespace name in the event message indicates which one or more namespaces to send the event message to be transmitted, and the distributing the event message to the corresponding namespaces through the event bus includes: and distributing the event message to be transmitted to one or more namespaces corresponding to the names of the namespaces through the event bus.
In an exemplary process of using the internet product, the internet product triggers an event notification, and if the user a registers that the account is correspondingly bound to the namespace 1, the namespace name included in the event message issued by the event issuing end is "namespace 1", so that the event message is sent to the namespace 1 through the event bus.
In this embodiment, by grouping all event messages transmitted on the event bus, the event messages corresponding to different users are respectively distributed to different namespaces, so as to realize isolation between different users.
Further, in the event subscription stage, different event subscription ends can pre-select event messages subscribed to different topics, and each event subscription end corresponds to a group of event subscription information; for example, the event subscription information corresponding to the event subscription terminal 1 is topic1 and topic2, which means that the event subscription terminal 1 subscribes to event messages corresponding to topic1 and topic2, and similarly, the event subscription terminal 2 subscribes to event messages corresponding to topic3, and the event subscription terminal 3 subscribes to event messages corresponding to topic3 and topic 4.
Specifically, each event subscription terminal can acquire an event message to be transmitted in a corresponding connected naming space, further judge whether the acquired event message to be transmitted is subscribed by itself, and if yes, forward the event message to be transmitted to a corresponding event processing terminal by the event subscription terminal.
In a possible case of this embodiment, the event subscription terminal may determine whether a certain event has been subscribed according to the event subscription information. Specifically, the event message to be transmitted comprises a first group of event topics, and the event subscription information comprises a second group of event topics subscribed by the event subscription terminal; the event subscription terminal judges whether the event message to be transmitted is a subscribed event message according to the corresponding event subscription message, and comprises the following steps: judging whether the first group of event topics contain the second group of event topics, if so, determining that the event message to be transmitted is the subscribed event message of the event subscription terminal.
Illustratively, the time subscription message corresponding to the event subscription terminal 1 is denoted as topic1 and topic2. An event topic contained in an event message a to be transmitted in the namespace 1 is topic1 and topic2, and the event subscription terminal 1 is subscribed to the event message a to be transmitted; for another example, an event topic contained in an event message B to be transmitted in the namespace 1 is topic3, which indicates that the event subscriber 1 does not subscribe to the event B to be transmitted, and the event subscriber 2 subscribes to the event message B to be transmitted. Thus, the event message a to be transmitted will be forwarded to the event subscriber 1, and the event message B to be transmitted will be forwarded to the event subscriber 2.
In this embodiment, by forwarding the event messages in the namespace to different event subscription terminals according to the subscribed event topics, the different event subscription terminals determine the subsequent transmission operation of the event messages, thereby improving the transmission efficiency of the event messages.
Further, in the event processing stage, since each event subscription end can register one or more event processing ends in advance, after the event subscription end acquires the subscribed event message, the event subscription end sends the event message to the corresponding target event processing end, and the target event processing end determines the final receiving end of the event message.
In a possible embodiment, the processing, by the target event processing end, the event message to be transmitted includes: and the target event processing end calls a target transmission interface according to the event message to be transmitted so as to transmit the event message to be transmitted to target equipment through the target transmission interface. Further, if the target transmission interface is successfully called, the target event processing end returns a calling result of the target transmission interface to a preset callback interface address; if the target transmission interface fails to be called, the target event processing end returns an abnormal reason to a preset callback interface address, and the target transmission interface is called again according to preset calling times.
For example, after receiving the event message, the target event processing end may call a corresponding hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) interface, forward the event message to the HTTP interface, and send the event message to the target terminal device through the HTTP interface, for example, a program description structure of the target event processing end is as follows:
Figure BDA0003298946710000101
wherein, handler represents the event handling end name; enabled indicates whether the event handler is enabled, which is enabled by default in a particular embodiment (indicated by true); retry (optional) indicates the number of retries (defaults to 0) if the call to the target transport interface fails. The backURL (optional) indicates that a callback interface after completion of the call target transport interface can be specified. If the target transmission interface is successfully called, a calling result is returned through the callback interface, and if the target transmission interface is called abnormally, an abnormal reason is returned through the callback interface. Url in httpAttempt represents callback interface address, and the calling method can be get, delete, put, head, option, patch, put, post, put, trace and the like.
Specifically, when the target event processing end fails to call the target transmission interface, the target transmission interface is re-called according to the value set by the retry parameter, and meanwhile, a call failure reason is returned to a callback interface address url so as to be convenient for related personnel to timely locate an error reason; and when the target event processing end successfully calls the target transmission interface, a call result is returned to the callback interface address url.
In this embodiment, by creating a plurality of namespaces on the event bus according to the user registration information, different users are distributed in different namespaces for management, so that isolation between users is achieved. Furthermore, the retry mechanism is set by the event processing end, so that the retry times can be defined by oneself under the condition that the event message transmission fails due to the calling failure of the target transmission interface, and the success rate of the event transmission is ensured as much as possible. And after the target transmission interface is successfully called to transmit the event message, a call result can be returned through the callback interface address, so that related personnel can know the event message transmission state in time. According to the method and the device, the event message is transmitted in a mode based on the http event bus, event message queuing processing is not needed, and real-time performance of event message transmission is improved. And decoupling of event release and receiving is realized, even if the transmission mechanism of event information is changed, the logic of event information transmission through an event bus, a naming space and an event subscription terminal is not changed, and the event transmission efficiency can be improved only by modifying a target transmission interface of an event processing terminal.
In one or more possible embodiments, the event message transmission method provided by the embodiment can deploy an event bus in three sustainable deployment modes, including a local mode, a Redis mode and a ZooKeeper mode, wherein the local deployment can be single-machine deployment without any external third-party component support, and is convenient and quick, and suitable for testing or lightweight requirements; the Redis deployment mode and the ZooKeeper deployment mode support multi-node distributed deployment, persistence of bus configuration is realized through a Redis, zooKeeper mode, and transverse expansion can be dynamically carried out to enhance concurrency capability.
Fig. 4 is a schematic diagram illustrating the structure of an event message transmission system according to an exemplary embodiment of the present invention.
As shown in fig. 4, the event message transmission system provided in this embodiment includes: an event bus 401, an event subscription terminal 402 and an event processing terminal 403, wherein a plurality of namespaces are arranged on the event bus, each namespace is connected with a plurality of event subscription terminals, and each event subscription terminal is connected with one or a plurality of event processing terminals; the event publishing terminal pushes the event message to be transmitted to an event bus so as to distribute the event message to be transmitted to a corresponding naming space through the event bus; the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, and transmits the event to be transmitted to a target event processing terminal when the judging result is yes, wherein the target event processing terminal is one or more event processing terminals registered in the event subscribing terminal in advance; and the target event processing end processes the event message to be transmitted.
Further, each event subscription terminal corresponds to a group of event subscription information; the event subscription terminal is specifically configured to: judging whether the event message to be transmitted is a subscribed event message or not according to the corresponding event subscription message.
Further, the event message to be transmitted comprises a first group of event topics, and the event subscription information comprises a second group of event topics subscribed by the event subscription terminal;
the event subscription terminal is specifically configured to: judging whether the first group of event topics contain the second group of event topics, if so, determining that the event message to be transmitted is the subscribed event message of the event subscription terminal.
Further, the event message to be transmitted includes names of one or more namespaces; the event bus is also for: distributing the event message to be transmitted to one or more namespaces corresponding to the names of the namespaces; wherein the different namespaces are isolated from each other.
Further, before the event publishing end pushes the event message to be transmitted to the event bus, the event bus is further configured to: creating a name space according to registration information input by a user, and binding the registration information with the name space; wherein, a piece of registration information is correspondingly bound with a naming space.
Further, the target event processing end is specifically configured to: and calling a target transmission interface according to the event message to be transmitted so as to transmit the event message to be transmitted to target equipment through the target transmission interface.
Further, the target event processing end is further configured to: if the target transmission interface is successfully called, a call result of the target transmission interface is returned to a preset callback interface address; if the target transmission interface fails to be called, returning an abnormal reason to a preset callback interface address, and re-calling the target transmission interface according to preset calling times.
Specific functional implementation of each module provided in this embodiment may refer to the detailed description of the method embodiments described above.
Fig. 5 is a schematic diagram of a hardware structure of a computer device according to the present invention. As shown in fig. 5, the computer device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. The processor 501 and the memory 502 are connected by a bus 503.
In a specific implementation, at least one processor 501 executes computer-executable instructions stored in the memory 502, so that at least one processor 501 performs the method in the above-described method embodiment.
The specific implementation process of the processor 501 may refer to the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 5, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise high speed RAM memory or may further comprise non-volatile storage NVM, such as at least one disk memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
Another embodiment of the present application provides a computer readable storage medium having stored therein computer executable instructions that when executed by a processor implement the event message transmission method in the above method embodiments.
Another embodiment of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the event message transmission method in the above method embodiments.
The computer readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short). The processor and the readable storage medium may reside as discrete components in a device.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (10)

1. A method for transmitting an event message, comprising:
the event publishing terminal pushes the event message to be transmitted to an event bus so as to distribute the event message to be transmitted to corresponding namespaces through the event bus, and each namespace is connected with a plurality of event subscribing terminals;
the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, and transmits the event to be transmitted to a target event processing terminal when the judging result is yes, wherein the target event processing terminal is one or more event processing terminals registered in the event subscribing terminal in advance;
and the target event processing end processes the event message to be transmitted.
2. The method of claim 1, wherein each event subscription corresponds to a set of event subscription information;
the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, including:
and the event subscription terminal judges whether the event message to be transmitted is a subscribed event message according to the corresponding event subscription message.
3. The method of claim 2, wherein the event message to be transmitted comprises a first set of event topics, and the event subscription information comprises a second set of event topics to which the event subscription terminal has subscribed;
the event subscription terminal judges whether the event message to be transmitted is a subscribed event message according to the corresponding event subscription message, and comprises the following steps:
judging whether the first group of event topics contain the second group of event topics, if so, determining that the event message to be transmitted is the subscribed event message of the event subscription terminal.
4. The method of claim 1, wherein the event message to be transmitted comprises names of one or more namespaces;
the distributing the event message to be transmitted to the corresponding naming space through the event bus includes:
distributing the event message to be transmitted to one or more namespaces corresponding to the names of the namespaces through the event bus;
wherein the different namespaces are isolated from each other.
5. The method of claim 4, wherein the event publisher pushes the event message to be transmitted to the event bus before the method further comprises:
creating a name space on the event bus according to registration information input by a user, and binding the registration information with the name space;
wherein, a piece of registration information is correspondingly bound with a naming space.
6. The method according to any one of claims 1-5, wherein the processing the event message to be transmitted by the target event processing end includes:
and the target event processing end calls a target transmission interface according to the event message to be transmitted so as to transmit the event message to be transmitted to target equipment through the target transmission interface.
7. The method as recited in claim 6, further comprising:
if the target transmission interface is successfully called, the target event processing end returns a calling result of the target transmission interface to a preset callback interface address;
if the target transmission interface fails to be called, the target event processing end returns an abnormal reason to a preset callback interface address, and the target transmission interface is called again according to preset calling times.
8. An event message transmission system, comprising: the system comprises an event bus, event subscription terminals and event processing terminals, wherein a plurality of namespaces are arranged on the event bus, each namespace is connected with a plurality of event subscription terminals, and each event subscription terminal is connected with one or more event processing terminals;
the event publishing terminal pushes the event message to be transmitted to an event bus so as to distribute the event message to be transmitted to a corresponding naming space through the event bus;
the event subscribing terminal judges whether the event message to be transmitted is a subscribed event message, and transmits the event to be transmitted to a target event processing terminal when the judging result is yes, wherein the target event processing terminal is one or more event processing terminals registered in the event subscribing terminal in advance;
and the target event processing end processes the event message to be transmitted.
9. A computer device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the event message transmission method of any of claims 1-7.
10. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor implement the method of event message transmission as claimed in any of claims 1 to 7.
CN202111185305.0A 2021-10-12 2021-10-12 Event message transmission method, system, device and computer storage medium Active CN113938522B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111185305.0A CN113938522B (en) 2021-10-12 2021-10-12 Event message transmission method, system, device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111185305.0A CN113938522B (en) 2021-10-12 2021-10-12 Event message transmission method, system, device and computer storage medium

Publications (2)

Publication Number Publication Date
CN113938522A CN113938522A (en) 2022-01-14
CN113938522B true CN113938522B (en) 2023-06-13

Family

ID=79278728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111185305.0A Active CN113938522B (en) 2021-10-12 2021-10-12 Event message transmission method, system, device and computer storage medium

Country Status (1)

Country Link
CN (1) CN113938522B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118772A (en) * 2022-06-21 2022-09-27 壹沓科技(上海)有限公司 Message communication system and method
CN115794444B (en) * 2023-02-02 2023-05-16 广州钛动科技股份有限公司 Event communication method, event communication device, computer equipment and computer readable storage medium
CN117032725B (en) * 2023-09-27 2023-12-26 统信软件技术有限公司 Event processing method and device, electronic equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7181490B1 (en) * 2001-02-14 2007-02-20 Cisco Technology, Inc. Method and apparatus for mapping network events to names of network devices
CN102622675A (en) * 2012-03-14 2012-08-01 浙江大学 Method and system for realizing interoperation of enterprises under cluster supply chain environment
CN106411919A (en) * 2016-10-31 2017-02-15 用友网络科技股份有限公司 Web push method based on event bus
CN110471780A (en) * 2019-08-21 2019-11-19 北京百佑科技有限公司 Distributed event processing unit, terminal and computer storage medium
WO2020139395A1 (en) * 2018-12-28 2020-07-02 Didi Research America, Llc Reading messages in a shared memory architecture for a vehicle

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10701206B2 (en) * 2016-07-01 2020-06-30 Genesys Telecommunications Laboratories, Inc. System and method for contact center communications
US10572405B1 (en) * 2018-12-28 2020-02-25 Didi Research America, Llc Writing messages in a shared memory architecture for a vehicle
US11128587B2 (en) * 2019-05-13 2021-09-21 Sap Se Enterprise messaging using a virtual message broker

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7181490B1 (en) * 2001-02-14 2007-02-20 Cisco Technology, Inc. Method and apparatus for mapping network events to names of network devices
CN102622675A (en) * 2012-03-14 2012-08-01 浙江大学 Method and system for realizing interoperation of enterprises under cluster supply chain environment
CN106411919A (en) * 2016-10-31 2017-02-15 用友网络科技股份有限公司 Web push method based on event bus
WO2020139395A1 (en) * 2018-12-28 2020-07-02 Didi Research America, Llc Reading messages in a shared memory architecture for a vehicle
CN110471780A (en) * 2019-08-21 2019-11-19 北京百佑科技有限公司 Distributed event processing unit, terminal and computer storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Design and implementation of a decentralized message bus for microservices;Pakorn Kookarinrat;《IEEE》;全文 *
云呼叫中心服务与配置管理系统的设计与实现;李宇辉;《中国优秀硕士学位论文全文数据库信息科技辑》;全文 *

Also Published As

Publication number Publication date
CN113938522A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
CN113938522B (en) Event message transmission method, system, device and computer storage medium
CN1788474B (en) Method, device and system for processing message addressed to client terminal
CN111371892A (en) High-concurrency distributed message pushing system and method
US11272329B2 (en) Mobile messaging platform
CN111461887B (en) Block chain consensus processing method and device and electronic equipment
US10454795B1 (en) Intermediate batch service for serverless computing environment metrics
US11171899B2 (en) System for delivering notification messages across different notification media
CN111224814B (en) Message processing method and device
CN111031135B (en) Message transmission method and device and electronic equipment
CN111090532B (en) Application service calling method, device, electronic equipment and computer storage medium
US8510426B2 (en) Communication and coordination between web services in a cloud-based computing environment
CN112437155A (en) Service data processing method and device and server equipment
US20100315240A1 (en) Messaging engine health check
CN112751935A (en) Request processing method and device, electronic equipment and storage medium
CN113645260A (en) Service retry method, device, storage medium and electronic equipment
CN108429636B (en) Method and device for positioning abnormal system and electronic equipment
CN111078437A (en) Remote calling method and device of verification code, electronic equipment and readable storage medium
CN112437126B (en) Task flow processing method and device based on atomic interface
CN114706697A (en) Method, device, equipment, medium and program product for processing message subscription event
CN113672488A (en) Log text processing method and device
US20150120607A1 (en) System and method for customer event email consolidation and delivery
CN114298830A (en) Batch service processing method and device and batch service processing platform
CN110162415B (en) Method, server, device and storage medium for processing data request
CN114461424A (en) Inter-unit service discovery method, device and system under unitized deployment architecture
CN113868479A (en) Method and device for processing service data

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
GR01 Patent grant
GR01 Patent grant