CN114564316A - Message pushing method, device, equipment and storage medium - Google Patents

Message pushing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114564316A
CN114564316A CN202111615620.2A CN202111615620A CN114564316A CN 114564316 A CN114564316 A CN 114564316A CN 202111615620 A CN202111615620 A CN 202111615620A CN 114564316 A CN114564316 A CN 114564316A
Authority
CN
China
Prior art keywords
event
url
name
message data
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.)
Pending
Application number
CN202111615620.2A
Other languages
Chinese (zh)
Inventor
肖博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Fantasy Network Technology Co ltd
Original Assignee
Beijing Fantasy Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Fantasy Network Technology Co ltd filed Critical Beijing Fantasy Network Technology Co ltd
Priority to CN202111615620.2A priority Critical patent/CN114564316A/en
Publication of CN114564316A publication Critical patent/CN114564316A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links

Landscapes

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

Abstract

The present disclosure provides a message pushing method, device, equipment and storage medium, the method mainly includes: receiving first message data from a producer device, the first message data including a first event name and an event attribute; according to the first event name, selecting a target event URL corresponding to the first event name from an event Uniform Resource Locator (URL) list, wherein the event URL is an event uniform resource locator provided by consumer equipment and is used for receiving an event subscribed by the consumer equipment; and pushing the first message data to corresponding consumer equipment through the selected target event URL. According to the message pushing method, the message pushing device, the message pushing equipment and the message pushing storage medium, consumer equipment does not need to be configured, message data are transmitted in a short connection mode, physical connection between producer equipment and the consumer equipment and a service system does not need to be kept, and namely the producer equipment and the consumer equipment do not need to be in the same machine room.

Description

Message pushing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of information processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for pushing a message.
Background
With the continuous expansion of services, it becomes crucial to decouple services using a messaging system. At present, the message system accessed on the mainstream micro-service architecture needs to be directionally developed aiming at the message system. The message system is generally divided into two roles of producer and consumer, the service of producer or consumer is defined to be accessed according to the role access specification of the message system, the service code of the message system which is desired to be accessed is required to be modified in the access process, namely, the service is decoupled by adopting a full-intrusion message system.
However, in such a fully intrusive messaging system, the producer and the consumer need to be configured to implement message passing between the producer and the consumer, and the producer and the consumer must be physically connected to the business system, i.e., the producer and the consumer must be in the same machine room.
Disclosure of Invention
The present disclosure provides a message pushing method, apparatus, device and storage medium, so as to at least solve the above technical problems in the prior art.
According to a first aspect of the present disclosure, there is provided a message pushing method, including: the method comprises the following steps: receiving first message data from a producer device, the first message data including a first event name and an event attribute; according to the first event name, selecting a target event URL corresponding to the first event name from an event Uniform Resource Locator (URL) list, wherein the event URL is an event uniform resource locator provided by consumer equipment and is used for receiving an event subscribed by the consumer equipment; and pushing the first message data to corresponding consumer equipment through the selected target event URL.
In an implementation manner, before the selecting, according to the first event name, a target event URL corresponding to the first event name from the event URL list, the method further includes: acquiring a second event name provided by the consumer equipment and an event URL corresponding to the second event name; and generating the event URL list according to the second event name and the event URL.
In an embodiment, the generating the event URL list according to the second event name and the event URL includes: establishing a dictionary data structure; and correspondingly storing the second event name and the event URL to the dictionary data structure to generate the event URL list.
In an embodiment, the selecting, according to a first event name, a target event URL corresponding to the first event name from an event URL list includes: judging whether a second event name identical to the first event name exists in the event URL list or not; and if a second event name which is the same as the first event name exists in the event URL list, determining an event URL corresponding to the second event name which is the same as the first event name in the event URL list as a target event URL.
In one embodiment, the method further comprises: discarding the first message data from the producer device if a second event name identical to the first event name does not exist in the event URL list. In one embodiment, the receiving the first message data from the producer device includes: storing message data from a producer device to a first message queue; extracting the first message data from the first message queue using a multi-threaded mode.
In an embodiment, the pushing the first message data to the corresponding consumer device through the selected target event URL includes: judging whether the target event URL is unique; if the target event URL is unique, directly pushing the first message data to corresponding consumer equipment through the selected target event URL; and if the target event URL is not unique, the first message data is concurrently pushed to the corresponding consumer equipment through the selected target event URL.
According to a second aspect of the present disclosure, there is provided a message push apparatus, the apparatus including: a receiving module, configured to receive first message data from a producer device, where the first message data includes a first event name and an event attribute; a selecting module, configured to select, according to the first event name, a target event URL corresponding to the first event name from an event uniform resource locator URL list, where the event URL is an event uniform resource locator provided by a consumer device and is used to receive an event subscribed by the consumer device; and the pushing module is used for pushing the first message data to corresponding consumer equipment through the selected target event URL.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods of the present disclosure.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the present disclosure.
According to the message pushing method, the message pushing device, the message pushing equipment and the message pushing storage medium, message data sent by producer equipment are pushed to consumer equipment by calling a Uniform Resource Locator (URL) provided by the consumer equipment without configuring the consumer equipment, and the message data are transmitted in a short connection mode, the producer equipment and the consumer equipment do not need to be physically connected with a service system, namely the producer equipment and the consumer equipment do not need to be in the same machine room.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present disclosure will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Fig. 1 is a flowchart illustrating a message pushing method according to a first embodiment of the disclosure;
fig. 2 is a flowchart illustrating a message pushing method according to a second embodiment of the disclosure;
FIG. 3 illustrates an event URL configuration user interface diagram of a second embodiment of the present disclosure;
FIG. 4 is a schematic diagram of an event URL list according to a second embodiment of the present disclosure;
fig. 5 is a flowchart illustrating a message pushing method according to a third embodiment of the disclosure;
fig. 6 shows a schematic flow chart of a message pushing method according to a fourth embodiment of the present disclosure;
fig. 7 is a flowchart illustrating a message pushing method according to a fifth embodiment of the disclosure;
fig. 8 shows a flowchart of a message pushing method according to a sixth embodiment of the disclosure;
fig. 9 is a schematic structural diagram of a message pushing apparatus according to a seventh embodiment of the present disclosure;
fig. 10 is a schematic diagram illustrating a composition structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order to make the objects, features and advantages of the present disclosure more apparent and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
Fig. 1 is a schematic flowchart of a message pushing method according to a first embodiment of the present disclosure, where the method is applied to a message subscription center, and the message subscription center receives message data from a producer device as message middleware and pushes the message data to a consumer device, as shown in fig. 1, the method mainly includes:
step S101, receiving first message data from a producer device, where the first message data includes a first event name and an event attribute.
In this embodiment, the pushing of the message data is realized by a semi-intrusive message system, and compared with a fully intrusive message system, the semi-intrusive message system only needs to modify the code of the producer device when accessing the producer device, and the consumer device can directly access the producer device. In the semi-intrusive message system, if message data is to be transmitted from a producer device to a consumer device, first message data, namely first message data, generated by the producer device needs to be received, wherein the first message data comprises a first event name and event attributes, and the event attributes are specific scene data of an event occurrence.
In one embodiment, before receiving the message data generated by the producer device, a short connection may be established with the producer device via a particular network transport protocol, and then the first message data sent by the producer device may be received via the short connection. The short connection does not need to maintain the connection characteristic, namely the short connection only needs to be established once when message data is transmitted, and the connection is interrupted after the transmission is finished. In this embodiment, the client refers to the producer device, that is, after receiving the message data sent by the producer device once, the short connection may be interrupted, and when the message data needs to be received next time, the short connection is re-established with the producer device without the need of configuration and registration of the producer device. Specifically, a short connection may be established with the producer device through a network transport Protocol such as a HyperText Transfer Protocol (HTTP) or a Remote Procedure Call Protocol (RPC), and the network transport Protocol for establishing a short connection with the producer device is not limited in this disclosure.
Step S102, according to the first event name, selecting a target event URL corresponding to the first event name from an event uniform resource locator URL list, wherein the event URL is an event uniform resource locator provided by the consumer equipment and is used for receiving the event subscribed by the consumer equipment.
In this embodiment, after receiving the first event name and the event attribute from the producer device, an event URL corresponding to the first event name, that is, a target event URL, needs to be selected from an event uniform resource locator URL list according to the first event name, where the event URL is an event uniform resource locator provided by the consumer device and is used to receive an event subscribed by the consumer device.
In a service system, after a producer device issues an event, an event name and an event attribute of the event sent by the producer device are identified in a service document, so that a consumer device develops a corresponding event URL; when a consumer device needs to subscribe to a certain event, the event name and the event attribute of the event which the consumer device needs to subscribe to can be extracted from the business document, and the event URL corresponding to the event name is developed by using the event name and the event attribute.
In an implementation manner, an event URL list may be generated according to an event name and an event URL configuration provided by a consumer device, after receiving a first event name and an event attribute sent by a producer device, the first event name may be compared with event names in the event URL list one by one, and an event URL corresponding to an event name in the event URL list that is the same as the first event name may be determined as a target event URL, where specifically, one or more target event URLs may be provided.
Step S103, pushing the first message data to the corresponding consumer device through the selected target event URL.
In this embodiment, after the target event URL is determined, the first message data may be pushed to the corresponding consumer device through the target event URL.
In an implementation manner, in the transmission process of the message data, a network transport protocol for establishing a short connection with the producer device may be different from a network transport protocol corresponding to the target event URL, and at this time, the first message data from the producer device cannot be directly pushed to the corresponding consumer device through the target event URL.
In a first embodiment of the present disclosure, a semi-intrusive message system is used to implement message push between a producer device and a consumer device, a target event URL corresponding to an event name from the producer device is selected from an event URL list according to the event name from the producer device, and message data from the producer device is pushed to the corresponding consumer device through the target event URL. Therefore, because the communication between the client and the producer is short connection, the producer equipment does not need to be configured and registered, and the target event URL provided by the consumer equipment is called to push message data, so that the consumer can complete access without modifying codes, the consumer and the producer do not need to be in the same machine room, the message pushing is more convenient, and the cost is lower.
Fig. 2 is a schematic flowchart of a message pushing method according to a second embodiment of the present disclosure, where the method is applied to a message subscription center, and as shown in fig. 2, the method further includes:
in step S201, a second event name provided by the consumer device and an event URL corresponding to the second event name are acquired.
In this embodiment, first, an event URL list needs to be generated so as to select a corresponding target event URL according to a first event name from the producer device, and therefore, before selecting the target event URL corresponding to the first event name in the event URL list according to the first event name, a second event name provided by the consumer device and an event URL corresponding to the second event name need to be obtained.
In one implementation, a simple user interface may be provided to obtain the second event name and the event URL corresponding to the second event name. Fig. 3 is a schematic diagram of an event URL configuration user interface according to a second embodiment of the present disclosure, as shown in fig. 3, an event name and an event URL input box are disposed in the user interface, a user may input a second event name provided by a consumer device and an event URL corresponding to the second event name into the corresponding input box, and click an "immediate submit" button to configure the second event name and the event URL corresponding to the second event name, and if an input error occurs, click a "reset" button to empty contents in the input box and input again.
Step S202, an event URL list is generated according to the second event name and the event URL.
In this embodiment, after obtaining the second event name provided by the consumer device and the event URL corresponding to the second event name, the consumer device configures the second event name and the event URL to generate an event URL list.
In one embodiment, a specific data structure may be established to implement the configuration of the second event name and the event URL corresponding to the second event name. Fig. 4 is a schematic diagram of an event URL list according to a second embodiment of the present disclosure, and as shown in fig. 4, the event URL list may be a one-to-many data structure, that is, the same event name may correspond to a plurality of event URLs, and specifically, after obtaining a second event name provided by a consumer device and an event URL corresponding to the second event name, the second event name and the event URL may be stored in a specific data structure, so as to generate an event URL list.
In the second embodiment of the present disclosure, the second event name provided by the consumer device and the event URL corresponding to the second event name are acquired through the event URL configuration user interface, and then stored in the specific data structure to generate the event URL list, so that it is ensured that the target event URL can be subsequently selected in the event URL list according to the first event name from the producer device, thereby implementing accurate push of the message.
Fig. 5 is a schematic flowchart of a message pushing method according to a third embodiment of the present disclosure, where the method is applied to a message subscription center, and as shown in fig. 5, step S202 mainly includes:
step S301, a dictionary data structure is established.
In this embodiment, in order to configure the second event name from the consumer device and the event URL corresponding to the second event name, a dictionary data structure needs to be established first. The dictionary data structure can embody the mapping relation between event names and event URLs, corresponding event URLs can be conveniently searched through the event names in the dictionary data structure, the packaging operation of the dictionary data structure is relatively simple, the second event names and the event URLs corresponding to the second event names can be directly stored in the dictionary, the corresponding event URLs can be removed according to the second event names, and therefore if the consumer equipment wants to cancel the subscription of a certain event, only the configured event URLs need to be deleted in the dictionary data structure according to the event names, and the configuration of the whole service system does not need to be modified.
Step S302, the second event name and the event URL are correspondingly stored in a dictionary data structure, and an event URL list is generated.
In this embodiment, after the second event name and the event URL corresponding to the second event name are obtained from the consumer device and the dictionary data structure is established, the second event name and the event URL corresponding to the second event name may be stored in the dictionary data structure, so as to generate the event URL list.
In the third embodiment of the present disclosure, the second event name from the consumer device and the event URL corresponding to the second event name are stored by the dictionary data structure, the configuration process of the event URL is simplified, and the consumer device can easily delete the configured event URL according to the event name in the dictionary data structure, further reducing the coupling between the business systems.
Fig. 6 shows a flowchart of a message pushing method according to a fourth embodiment of the present disclosure, where the method is applied to a message subscription center, and as shown in fig. 6, step S102 mainly includes:
step S401 is to determine whether a second event name identical to the first event name exists in the event URL list.
In this embodiment, after receiving the first event name and the event attribute from the producer device, a target event URL corresponding to the first event name may be selected from the already generated event URL list according to the first event name, and specifically, it is first necessary to determine whether a second event name identical to the first event name exists in the event URL list.
In an implementation manner, a second event name identical to the first event name can be found in the event URL list in a traversal manner, and if the second event name identical to the first event name is found, the second event name identical to the first event name exists in the event URL list; if the second event name identical to the first event name is not found, the second event name identical to the first event name does not exist in the event URL list.
In step S402, if a second event name identical to the first event name exists in the event URL list, the event URL corresponding to the second event name identical to the first event name in the event URL list is determined as the target event URL.
In this embodiment, if it is determined that a second event name identical to the first event name exists in the event URL list, the event URL corresponding to the second event name is a subscription interface provided by the consumer device and corresponding to the first message data sent by the producer device, and at this time, the event URL corresponding to the second event name identical to the first event name in the event URL list may be determined as the target event URL.
In an embodiment, because the event attribute of interest of different consumer devices for the same event may be different, the generated event URLs may also be different, that is, in the event URL list, a case where the same event name corresponds to a plurality of different event URLs may occur, that is, the target event URL may also be one or more event URLs.
In another embodiment, if it is determined that the second event name identical to the first event name does not exist in the event URL list, the first message data from the producer device may be discarded, thereby reducing the burden on the storage space.
In the fourth embodiment of the present disclosure, by comparing the first event name with the second event name, and determining the target event URL from the event URL list, the target event URL corresponding to the first message data from the producer device can be accurately determined, and the accuracy of message pushing is ensured.
Fig. 7 is a flowchart illustrating a message pushing method according to a fifth embodiment of the present disclosure, where the method is applied to a message subscription center, and as shown in fig. 7, step S101 mainly includes:
step S501, store the message data from the producer device to the first message queue.
In this embodiment, if a plurality of producer devices send message data simultaneously, a large amount of message data may be received in the same time period, and at this time, the message data from the producer devices may be buffered in the first message queue first.
In one embodiment, the first message queue may be a first-in-first-out data structure, i.e. the first message data entering the first message queue is processed first. The first message queue may serve as a buffering mechanism, that is, if a large amount of message data cannot be processed in time, the message data that cannot be processed may be buffered in the first message queue to wait for processing.
Step S502, extracting first message data from the first message queue by adopting a multithreading mode.
In this embodiment, after the large batch of message data is cached in the first message queue, the first message data may be extracted from the first message queue by using a multithread mode, that is, the message data is extracted from the first message queue by using a plurality of threads together, and the message data extracted by each thread is the first message data.
In the fifth embodiment of the present disclosure, through a buffering mechanism of the first message queue and an extraction manner of the multi-thread mode, normal pushing of message data can be ensured, and a processing speed of large batches of message data is increased.
Fig. 8 is a flowchart illustrating a message pushing method according to a sixth embodiment of the present disclosure, where the method is applied to a message subscription center, and as shown in fig. 8, step S103 mainly includes:
step S601, determine whether the target event URL is unique.
In this embodiment, after obtaining the target event URL, the first message data may be pushed to the corresponding consumer device through the target event URL, and it needs to be determined whether one or more target event URLs are available, that is, whether the target event URL is unique.
In an implementation mode, a second event name which is the same as the first event name can be searched in the event URL list in a traversal mode, whether the event URL corresponding to the second event name is unique is judged, and if the event URL corresponding to the second event name is unique, the target event URL is unique; and if the event URL corresponding to the second event name is not unique, the target event URL is not unique.
Step S602, if the target event URL is unique, directly pushing the first message data to the corresponding consumer device through the selected target event URL.
In this embodiment, if the target event URL is unique, the first message data is pushed to the corresponding consumer device through the selected target event URL, that is, the target event URL is called, and the first message data is pushed to the consumer device.
Step S603, if the target event URL is not unique, concurrently pushing the first message data to the corresponding consumer device through the selected target event URL.
In this embodiment, if the target event URL is not unique, the first message data is concurrently pushed to the corresponding consumer device through the selected target event URL, that is, the plurality of target event URLs are called in a unified manner, the first message data is simultaneously pushed to the plurality of consumer devices, and when the consumer device receives the first event name and the event attribute through the event URL, the event URL only concerns the event attribute required by the corresponding consumer device.
In a sixth embodiment of the present disclosure, how to push the number of messages to the consumer device is determined by the number of target event URLs, and if the target event URL is unique, the first message data is directly pushed to the corresponding consumer device through the selected target event URL; and if the target event URL is not unique, the first message data is concurrently pushed to the corresponding consumer equipment through the selected target event URL. In this embodiment, the first message data is pushed to the consumer by calling the target event URL, and the consumer does not need to monitor the message data all the time, so that long connection with the consumer is not required, that is, the consumer does not need to be configured and registered, and the consumer and the producer may not be in the same machine room.
Fig. 9 shows a schematic structural diagram of a message pushing apparatus according to a seventh embodiment of the present disclosure, and as shown in fig. 9, the apparatus mainly includes:
a module receiver 70 for receiving first message data from a producer device, the first message data including a first event name and an event attribute; a selecting module 71, configured to select, according to the first event name, a target event URL corresponding to the first event name from an event uniform resource locator URL list, where the event URL is an event uniform resource locator provided by a consumer and is used to receive an event subscribed by the consumer; and the pushing module 72 is configured to push the first message data to the corresponding consumer device through the selected target event URL.
As shown in fig. 9, the apparatus further includes:
an obtaining module 73, configured to obtain a second event name provided by the consumer device and an event URL corresponding to the second event name; and a generating module 74, configured to generate an event URL list according to the second event name and the event URL.
As shown in fig. 9, the generating module 74 mainly includes:
the establishing submodule 741 is used for establishing a dictionary data structure; the first storage sub-module 742 is configured to correspondingly store the second event name and the event URL in a dictionary data structure, so as to generate an event URL list.
As shown in fig. 9, the selecting module 71 mainly includes:
a first judgment sub-module 711, configured to judge whether a second event name identical to the first event name exists in the event URL list; the determining sub-module 712 is configured to determine, as the target event URL, an event URL corresponding to a second event name in the event URL list, where the second event name is the same as the first event name, if the second event name is present in the event URL list.
As shown in fig. 9, the apparatus further includes:
a discarding module 75, configured to discard the first message data from the producer device if there is no second event name in the event URL list that is the same as the first event name.
As shown in fig. 9, the receiving module 70 mainly includes:
a second storage submodule 701, configured to store message data from a producer device in the first message queue; an extracting submodule 702 is configured to extract the first message data from the first message queue using a multithreading mode.
As shown in fig. 9, the pushing module 72 mainly includes:
a second determining submodule 721 configured to determine whether the target event URL is unique; the first pushing submodule 722 is configured to, if the target event URL is unique, directly push the first message data to the corresponding consumer device through the selected target event URL; the second pushing sub-module 723 is configured to, if the target event URL is not unique, concurrently push the first message data to the corresponding consumer device through the selected target event URL.
The present disclosure also provides an electronic device and a readable storage medium according to an embodiment of the present disclosure.
FIG. 10 illustrates a schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the device 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 1001 performs the various methods and processes described above, such as a message push method. For example, in some embodiments, a message push method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of a message push method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform a message push method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, "a plurality" means two or more unless specifically limited otherwise.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A message pushing method, the method comprising:
receiving first message data from a producer device, the first message data including a first event name and an event attribute;
according to the first event name, selecting a target event URL corresponding to the first event name from an event Uniform Resource Locator (URL) list, wherein the event URL is an event uniform resource locator provided by consumer equipment and is used for receiving an event subscribed by the consumer equipment;
and pushing the first message data to corresponding consumer equipment through the selected target event URL.
2. The method according to claim 1, wherein before said selecting a target event URL corresponding to a first event name from a list of event URLs according to the first event name, the method further comprises:
acquiring a second event name provided by the consumer equipment and an event URL corresponding to the second event name;
and generating the event URL list according to the second event name and the event URL.
3. The method of claim 2, wherein generating the event URL list based on the second event name and the event URL comprises:
establishing a dictionary data structure;
and correspondingly storing the second event name and the event URL to the dictionary data structure to generate the event URL list.
4. The method according to claim 2, wherein said selecting a target event URL corresponding to the first event name from the event URL list according to the first event name comprises:
judging whether a second event name identical to the first event name exists in the event URL list or not;
and if a second event name which is the same as the first event name exists in the event URL list, determining an event URL corresponding to the second event name which is the same as the first event name in the event URL list as a target event URL.
5. The method of claim 4, further comprising: discarding the first message data from the producer device if a second event name identical to the first event name does not exist in the event URL list.
6. The method of claim 1, wherein receiving first message data from a producer device comprises:
storing message data from a producer device to a first message queue;
extracting the first message data from the first message queue using a multi-threaded mode.
7. The method of claim 1, wherein the pushing the first message data to the corresponding consumer device via the selected target event URL comprises:
judging whether the target event URL is unique;
if the target event URL is unique, directly pushing the first message data to corresponding consumer equipment through the selected target event URL;
and if the target event URL is not unique, the first message data is concurrently pushed to the corresponding consumer equipment through the selected target event URL.
8. A message push apparatus, the apparatus comprising:
a receiving module, configured to receive first message data from a producer device, where the first message data includes a first event name and an event attribute;
a selecting module, configured to select, according to the first event name, a target event URL corresponding to the first event name from an event uniform resource locator URL list, where the event URL is an event uniform resource locator provided by a consumer device and is used to receive an event subscribed by the consumer device;
and the pushing module is used for pushing the first message data to corresponding consumer equipment through the selected target event URL.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202111615620.2A 2021-12-27 2021-12-27 Message pushing method, device, equipment and storage medium Pending CN114564316A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111615620.2A CN114564316A (en) 2021-12-27 2021-12-27 Message pushing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111615620.2A CN114564316A (en) 2021-12-27 2021-12-27 Message pushing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114564316A true CN114564316A (en) 2022-05-31

Family

ID=81712757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111615620.2A Pending CN114564316A (en) 2021-12-27 2021-12-27 Message pushing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114564316A (en)

Similar Documents

Publication Publication Date Title
CN112311656B (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN113934958B (en) Page loading method and device, electronic equipment and computer readable medium
CN111427701A (en) Workflow engine system and business processing method
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN111309747A (en) Data synchronization method, system and device
WO2017143747A1 (en) Network request method and system for network terminal
CN111694629A (en) Information display method and device and electronic equipment
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113761097B (en) Map tile loading method, device, equipment and medium for browser end
CN112558933A (en) Component rendering method and device, readable medium and electronic equipment
CN112948138A (en) Method and device for processing message
CN112667368A (en) Task data processing method and device
CN114564316A (en) Message pushing method, device, equipment and storage medium
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN111368557B (en) Video content translation method, device, equipment and computer readable medium
CN113779018A (en) Data processing method and device
CN110795670A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN112749204A (en) Method and device for reading data
CN115374320B (en) Text matching method and device, electronic equipment and computer medium
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN114253520B (en) Interface code generation method and device
CN113449938B (en) System and method for vehicle monitoring
CN112200643B (en) Article information pushing method and device, electronic equipment and computer readable medium
CN114500438B (en) File sharing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination