CN113704004A - Notification service implementation method, device, equipment and storage medium - Google Patents

Notification service implementation method, device, equipment and storage medium Download PDF

Info

Publication number
CN113704004A
CN113704004A CN202111007149.9A CN202111007149A CN113704004A CN 113704004 A CN113704004 A CN 113704004A CN 202111007149 A CN202111007149 A CN 202111007149A CN 113704004 A CN113704004 A CN 113704004A
Authority
CN
China
Prior art keywords
notification
sending
sent
information
message queue
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.)
Granted
Application number
CN202111007149.9A
Other languages
Chinese (zh)
Other versions
CN113704004B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111007149.9A priority Critical patent/CN113704004B/en
Publication of CN113704004A publication Critical patent/CN113704004A/en
Application granted granted Critical
Publication of CN113704004B publication Critical patent/CN113704004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

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

Abstract

The disclosure provides a method, a device, equipment and a storage medium for realizing notification service, relates to the technical field of cloud computing, and can be applied to a cloud platform. The method comprises the following steps: receiving a notification to be sent, wherein the notification to be sent comprises sender information and a notification sending mode of the notification to be sent; if the information of the sender passes the verification, sending a notification to be sent to a message queue; and sending the notification to be sent in the message queue based on the notification rule corresponding to the notification sending mode. The implementation method of the notification service distributes the server resources according to the needs, thereby saving the server resources and ensuring the timeliness of the notification.

Description

Notification service implementation method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computers, and in particular, to the field of cloud computing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for implementing a notification service.
Background
A Notification service (Simple Message Notification) is a service that can actively push Notification messages according to the needs of users. The notification service sends the requested traffic with obvious peaks and peaks, such as instantaneous high traffic during the day and low traffic at night. The industry typically peak-and-valley-fills traffic through message queues for such scenarios, but users are time-critical for notification delivery for notification services. On the premise of ensuring the timeliness of notification sending, the service pressure in a short time can be only solved by utilizing flow peak clipping and valley filling.
Disclosure of Invention
The disclosure provides a method, an apparatus, a device and a storage medium for implementing a notification service.
According to a first aspect of the present disclosure, a method for implementing a notification service is provided, including: receiving a notification to be sent, wherein the notification to be sent comprises sender information and a notification sending mode of the notification to be sent; if the information of the sender passes the verification, sending a notification to be sent to a message queue; and sending the notification to be sent in the message queue based on the notification rule corresponding to the notification sending mode.
According to a second aspect of the present disclosure, an apparatus for implementing a notification service is provided, including: the system comprises a receiving module, a sending module and a sending module, wherein the receiving module is configured to receive a notification to be sent, and the notification to be sent comprises sender information and a notification sending mode of the notification to be sent; the first sending module is configured to send a notification to be sent to the message queue if the sender information passes the verification; and the second sending module is configured to send the to-be-sent notification in the message queue based on the notification rule corresponding to the notification sending mode.
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 memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in any one of the implementations of the first aspect.
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 a computer to perform the method as described in any one of the implementations of the first aspect.
According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
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 drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is an exemplary system architecture diagram in which the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for implementing a notification service, according to the present disclosure;
FIG. 3 is a flow diagram of another embodiment of a method of implementing a notification service according to the present disclosure;
FIG. 4 is a flow diagram of one application scenario of a method of implementing a notification service according to the present disclosure;
FIG. 5 is a schematic diagram illustrating one embodiment of an apparatus for implementing a notification service according to the present disclosure;
fig. 6 is a block diagram of an electronic device for implementing a method of implementing a notification service of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of a notification service implementation method or a notification service implementation apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or transmit information or the like. Various client applications may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the above-described electronic apparatuses. It may be implemented as multiple pieces of software or software modules, or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may provide various services. For example, the server 105 may analyze and process the notification to be transmitted received from the terminal apparatuses 101, 102, 103, and generate a processing result (e.g., transmit the notification to be transmitted).
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the implementation method of the notification service provided by the embodiment of the present disclosure is generally executed by the server 105, and accordingly, the implementation device of the notification service is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method of implementing a notification service in accordance with the present disclosure is shown. The implementation method of the notification service comprises the following steps:
step 201, receiving a notification to be sent, where the notification to be sent includes sender information and a notification sending mode of the notification to be sent.
In this embodiment, an execution main body (for example, the server 105 shown in fig. 1) of the implementation method of the notification service may receive a to-be-sent notification sent by a user, where the to-be-sent notification includes sender information and a notification sending manner of the to-be-sent notification. Here, the present disclosure provides an HTTP (Hyper Text Transfer Protocol) notification transmission interface through which a user can transmit a notification to be transmitted, so that the execution main body can receive the notification to be transmitted, where the notification to be transmitted is a notification that the execution main body needs to transmit to a third party.
In this embodiment, relevant information, such as a user name, a user password, a notification transmission method, and the like, may be configured for each user in advance, where the notification transmission method includes but is not limited to: e-mail, voice, IOS, Android and the like. Each user can configure a plurality of notification sending modes, and each notification sending mode can configure corresponding current limiting rules, sending failure retry times and other rules. For example, the notification transmission method configured for the user a is a mail, and the current limiting rule configured for the mail notification transmission method is as follows: 20 mails are sent every minute and, in case of failure of sending, it will be retried 3 times.
The to-be-sent notification received by the execution main body includes information of a sender, that is, information such as a name of a user who sends the notification, and a notification sending mode, that is, a sending mode in which the execution main body sends the to-be-sent notification.
Step 202, if the sender information passes the verification, sending a notification to be sent to a message queue.
In this embodiment, the execution main body may send the notification to be sent to the message queue when the sender information of the notification to be sent passes the verification. After receiving the notification to be sent, the execution main body performs permission check on the sender information of the notification to be sent, for example, performs check on a user and a notification sending mode, so as to verify the identity of the sender of the notification to be sent, and if the identity passes the check, the execution main body sends the notification to be sent to a message queue. And if the identity of the sender of the notification to be sent is correct through the verification, adding the notification to be sent into a message queue needing to send the notification so as to send the notification.
Optionally, if the verification fails, a verification failure message is returned to the sender to be notified, and a notification of a failure of sending and submitting is indicated.
It should be noted that, in this step, an entry function is used to add the notification to be sent to the message queue, and the entry function is a function application with the largest bearer traffic.
Step 203, sending the to-be-sent notification in the message queue based on the notification rule corresponding to the notification sending mode.
In this embodiment, the execution body may send the to-be-sent notification in the message queue based on the notification rule corresponding to the notification sending manner. Since the relevant information of the notification to be sent is configured, the execution main body acquires a notification rule corresponding to the notification to be sent after taking out the notification to be sent from the message queue, where the notification rule includes a current limiting rule, a retry number of times of sending failure, and the like, and sends the notification to be sent in the message queue based on the acquired notification rule.
Optionally, the executing entity performs internal current limiting by using a distributed current limiter, and if the notification to be sent is hit, that is, limited, the executing entity sends the asynchronous library falling request of the notification to be sent to a message queue to wait for re-execution until the asynchronous library falling request reaches a threshold of the number of retry failures, and the notification to be sent fails to be sent; if the to-be-sent notification is not hit, i.e., not limited, the execution body calls a function of a specific notification mode to send the to-be-sent notification.
Note that, in this step, a notification function is used to send a notification to be sent.
The method for implementing the notification service provided by the embodiment of the disclosure includes the steps of firstly receiving a notification to be sent, wherein the notification to be sent includes sender information and a notification sending mode of the notification to be sent; then if the information of the sender passes the verification, sending a notification to be sent to a message queue; and finally, sending the notification to be sent in the message queue based on the notification rule corresponding to the notification sending mode. According to the implementation method of the notification service in the embodiment, the HTTP notification sending interface is provided, so that the use of the user is facilitated, and the use experience of the user is improved; in addition, the method runs in function calculation, realizes notification service by using a message queue in the back-end service, is a notification service method based on the Serverless cloud native technology, can reduce cost and improve efficiency, and can allocate server resources as required, so that the server resources are saved, and the notification timeliness is further improved.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
With continued reference to fig. 3, fig. 3 illustrates a flow 300 of another embodiment of a method of implementing a notification service according to the present disclosure. The implementation method of the notification service comprises the following steps:
step 301, receiving a notification to be sent.
Step 301 is substantially the same as step 201 in the foregoing embodiment, and the specific implementation manner may refer to the foregoing description of step 201, which is not described herein again.
In some optional implementations of this embodiment, before performing step 301, the method for implementing the service further includes: and calling the function application to perform cold start preheating. Since the larger the proportion of the application function cold start to the notification request flow is, the larger the service response time is, in the implementation manner, the cold start preheating of the function application can be performed through the communication with the log platform and the configuration manner, so that the proportion of the notification request cold start is reduced, and the service response time is reduced.
Step 302, checking the sender information of the notification to be sent.
In this embodiment, an executing body (for example, the server 105 shown in fig. 1) of the implementation method of the notification service may check sender information of the notification to be sent, that is, verify user information of the sender of the notification to be sent, so as to determine whether the sender is a normal user. Specifically, the execution main body may match sender information in the notification to be sent with information stored in advance, so as to perform permission check. If not, go to step 303; if the verification is passed, step 304 is performed.
Step 303, returning verification failure information.
In this embodiment, the execution main body may return verification failure information and indicate that the notification of the transmission submission fails when the sender information fails to pass the verification, so as to notify the sender of the notification to be sent in time of the status of the notification to be sent.
And step 304, coding the notification to be sent to obtain coding information.
In this embodiment, the execution body may encode the notification to be sent when the sender information passes the verification, so as to obtain encoded information, which is recorded as encoded information.
Step 305, sending the encoded information to a message queue.
In this embodiment, the execution body may send the encoded information obtained in step 304 to a message queue, where the message queue stores the notification message that has passed the verification and is to be sent. And coding the notice to be sent, sending the coded information to a message queue, and waiting for sending.
Step 306, decoding the encoded information in the message queue to obtain decoded information.
In this embodiment, the execution body may decode the encoded information in the message queue, so as to obtain decoded information, which is recorded as decoded information.
And 307, acquiring a current limiting rule corresponding to the notification sending mode.
In this embodiment, the execution main body may obtain a current limiting rule corresponding to the notification transmission manner. Since the notification sending method and the notification rule corresponding to each notification sending method have been configured in advance for each user, and the notification rule includes the current limiting rule, the number of failed retries, and the like, the execution main body can obtain the current limiting rule corresponding to the notification sending method in the notification to be sent.
And 308, limiting the decoding information based on the current limiting rule.
In this embodiment, the executing entity may perform the current limiting on the decoded information based on the current limiting rule obtained in step 307, if the decoded information is hit, that is, limited, step 309 is performed, otherwise, step 310 is performed.
Step 309, sending the asynchronous warehouse-falling request in the current-limiting state to a message queue.
In this embodiment, the execution agent may send the asynchronous library falling request in the current limiting state to the message queue in the case that the decoded information is current limited. Specifically, the execution entity writes it back to the message queue to wait for execution again.
And step 310, calling a function corresponding to the notification sending mode to send decoding information.
In this embodiment, the execution main body may call a function corresponding to the notification transmission method to transmit the decoded information when the decoded information is not limited.
The method comprises the steps of obtaining corresponding decoding information by decoding the coding information, limiting the decoding information based on a current limiting rule corresponding to a notification sending mode, and calling a function corresponding to the notification sending mode to send the decoding information under the condition that the decoding information is not limited, so that notification service is realized.
Step 311, determine whether the decoding information is successfully transmitted.
In this embodiment, the executing entity may determine whether the decoding message is successfully sent, if the decoding message is successfully sent, execute step 312, otherwise, execute step 313.
Step 312, the asynchronous library falling request with the successful sending status is sent to the message queue.
In this embodiment, the execution body may send, to the message queue, an asynchronous library falling request notifying that the decoding information is successfully sent, so as to asynchronously write the record notifying that the decoding information is successfully sent to the database.
Step 313, sending the asynchronous library falling request with the sending failure state to a message queue.
In this embodiment, the execution body may send, to the message queue, an asynchronous library placement request notifying a transmission failure state in the case that the transmission of the decoding information fails, so as to asynchronously write a record notifying the transmission failure in the database.
That is, in this embodiment, regardless of whether the message is successfully sent, the record is written into the database, so that the sent record can be checked and sorted later.
In some optional implementations of this embodiment, the method for implementing the service further includes: recording the content of the notification to be sent and the notification sending state to obtain a notification record table; and aggregating or cleaning the data in the notification record table.
In this implementation, the details of the sending of each notification are recorded, resulting in a notification record table. Each record may contain information such as user name, notification mode, notification sender list, notification content, notification status, etc. The notification status includes, among others, notification of successful transmission, internal current limiting, external current limiting, notification of failed transmission, etc.
The notification record table is generally built by taking days as dimensions, and then the notification records are aggregated by timing tasks according to the days, wherein each aggregation record comprises information such as a user name, a notification mode, a date character string, the number of times of successful notification sending, the number of times of internal current limiting, the number of times of external current limiting, the number of times of failure notification and the like.
By adopting the management method, the safety of the notification service can be ensured, and the functions of tracing the notification record, controlling the flow of each notification mode and the like can be realized.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the method for implementing the notification service in this embodiment first receives a notification to be sent, where the notification to be sent includes sender information and a notification sending method of the notification to be sent, checks the sender information of the notification to be sent, returns a check failure information if the check fails, encodes the notification to be sent to obtain encoded information if the check passes, then sends the encoded information to a message queue, decodes the encoded information in the message queue to obtain decoded information, obtains a current limiting rule corresponding to the notification sending method, limits current of the decoded information based on the current limiting rule, sends an asynchronous falling bank request in a current limiting state to the message queue if the current is limited, and calls a function corresponding to the notification sending method to send the decoded information if the current is not limited, and then judging whether the decoding information is successfully sent, if so, sending the asynchronous database dropping request informing of the successful sending state to a message queue, and if not, sending the asynchronous database dropping request informing of the failed sending state to the message queue. According to the implementation method of the notification service in the embodiment, the HTTP notification sending interface is provided, so that the use of the user is facilitated, and the use experience of the user is improved; in addition, the method runs in function calculation, realizes notification service by using a message queue in back-end service, is a notification service method based on a Serverless cloud native technology, can reduce cost and improve efficiency, and can allocate server resources as required, so that the server resources are saved, and the notification timeliness is further improved; moreover, the notification records can be traced, so that the flow of each notification mode is controlled.
With continued reference to fig. 4, fig. 4 is a flow chart of one application scenario of a method of implementing a notification service according to the present disclosure. In the application scenario, firstly, a user sends a to-be-sent notification through a notification sending HTTP trigger, the execution main body receives the to-be-sent notification, and then calls an entry function to execute the following operations: and carrying out authority verification on the information of the sender in the notification to be sent, if the information of the sender passes the authority verification, coding the notification to be sent to obtain coded information, and then sending the asynchronous message to a message queue. The executing body returns the successful sending information to the user after the message is sent; and if the verification fails, the execution main body returns verification failure information to the user and indicates that the sending and submitting fails.
Then, the executing entity triggers the main logic for notifying the execution of the function notification sending through the trigger, and the method includes: decoding the coded information to obtain decoded information, then obtaining a corresponding current limiting rule, limiting the current of the decoded information by using a distributed current limiter, synchronously calling a sending function of a specific notification mode to send the decoded information under the condition that the decoded information is not limited, sending an asynchronous library falling request which is notified successfully to a message queue under the condition that the sending is successful, and sending the asynchronous library falling request which is notified unsuccessfully to the message queue under the condition that the sending is unsuccessful. And under the condition that the decoding information is limited, sending an asynchronous library falling request for notifying the limitation to the message queue, waiting to be executed again, and if the threshold of the number of times of retry failure is reached, failing to send a notification to be sent.
And finally, the message queue with the notification records performs asynchronous library falling through an automatic library falling component. Each notification record contains information such as a notification mode, a notification sender list, notification content, notification status, and the like. And the notification record table is built by taking days as dimensions, and the notification record aggregation or cleaning is carried out by timing tasks according to the days, so that the security of the notification service is ensured, and the notification record can be traced.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for implementing a notification service, where the apparatus embodiment corresponds to the method embodiment shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for implementing the notification service of the present embodiment includes: a receiving module 501, a first sending module 502 and a second sending module 503. The receiving module 501 is configured to receive a notification to be sent, where the notification to be sent includes sender information and a notification sending mode of the notification to be sent; a first sending module 502 configured to send a notification to be sent to a message queue if the sender information passes the verification; and a second sending module 503 configured to send the to-be-sent notification in the message queue based on the notification rule corresponding to the notification sending manner.
In the present embodiment, in the implementation apparatus 500 of the notification service: the specific processing of the receiving module 501, the first sending module 502, and the second sending module 503 and the technical effects thereof can refer to the related descriptions of step 201 and step 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the first sending module includes: the encoding submodule is configured to encode the notification to be sent to obtain encoding information; a first sending submodule configured to send the encoded information to a message queue.
In some optional implementations of this embodiment, the second sending module includes: the decoding submodule is configured to decode the encoded information in the message queue to obtain decoded information; the obtaining submodule is configured to obtain a current limiting rule corresponding to the notification sending mode; a current limiting sub-module configured to current limit the decoded information based on a current limiting rule; and the second sending submodule is configured to call a function corresponding to the notification sending mode to send the decoding information in response to the fact that the decoding information is not limited.
In some optional implementation manners of this embodiment, the second sending module further includes: and the third sending submodule is configured to respond to the decoded information being limited, and send the asynchronous database falling request in the limited current state to the message queue.
In some optional implementation manners of this embodiment, the apparatus for implementing the notification service further includes: a third sending module configured to send the asynchronous library falling request with a sending success state to the message queue in response to the decoding information sending success; and the fourth sending module is configured to respond to the decoding information sending failure and send the asynchronous library falling request with the sending failure state to the message queue.
In some optional implementation manners of this embodiment, the apparatus for implementing the notification service further includes: the recording module is configured to record the content of the notification to be sent and the notification sending state to obtain a notification record table; and the aggregation module is configured to aggregate or clear the data in the notification record table.
In some optional implementation manners of this embodiment, the apparatus for implementing the notification service further includes: and the calling module is configured to call the function application to perform cold start preheating.
In some optional implementation manners of this embodiment, the apparatus for implementing the notification service further includes: the checking module is configured to check the sender information to be notified; and the return module is configured to return verification failure information if the sender information fails to be verified.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 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. 6, the apparatus 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 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 calculation unit 601 executes the respective methods and processes described above, such as the implementation method of the notification service. For example, in some embodiments, the method of implementing the notification service may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the implementation method of the notification service described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured by any other suitable means (e.g., by means of firmware) to perform the implementation method of the notification service.
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.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (19)

1. A method for implementing a notification service includes:
receiving a notification to be sent, wherein the notification to be sent comprises sender information and a notification sending mode of the notification to be sent;
if the sender information passes the verification, sending the notification to be sent to a message queue;
and sending the notification to be sent in the message queue based on the notification rule corresponding to the notification sending mode.
2. The method of claim 1, wherein the sending the notification to be sent to a message queue comprises:
coding the notification to be sent to obtain coding information;
and sending the coding information to a message queue.
3. The method according to claim 2, wherein the sending the to-be-sent notification in the message queue based on the notification rule corresponding to the notification sending manner includes:
decoding the coding information in the message queue to obtain decoding information;
acquiring a current limiting rule corresponding to the notification sending mode;
current limiting the decoded information based on the current limiting rule;
and calling a function corresponding to the notification sending mode to send the decoding information in response to the fact that the decoding information is not limited.
4. The method according to claim 3, wherein the sending the to-be-sent notification in the message queue based on the notification rule corresponding to the notification sending manner further comprises:
in response to the decoded information being throttled, sending an asynchronous drop request in a throttled state to the message queue.
5. The method according to claim 3, wherein after the sending of the notification to be sent in the message queue based on the notification rule corresponding to the notification sending manner, the method further comprises:
responding to the decoding information sending success, and sending an asynchronous library falling request in a successful sending state to the message queue;
and responding to the decoding information transmission failure, and transmitting the asynchronous library falling request with the transmission failure state to the message queue.
6. The method of claim 5, wherein the method further comprises:
recording the content of the notification to be sent and the notification sending state to obtain a notification record table;
and aggregating or cleaning the data in the notification record table.
7. The method of any of claims 1-6, wherein prior to the receiving a notification to send, the method further comprises:
and calling the function application to perform cold start preheating.
8. The method of any of claims 1-7, wherein after the receiving a notification to send, the method further comprises:
checking the sender information of the notification to be sent;
and if the sender information does not pass the verification, returning verification failure information.
9. An apparatus for implementing a notification service, comprising:
the system comprises a receiving module, a sending module and a sending module, wherein the receiving module is configured to receive a notification to be sent, and the notification to be sent comprises sender information and a notification sending mode of the notification to be sent;
a first sending module configured to send the notification to be sent to a message queue if the sender information passes the verification;
and the second sending module is configured to send the to-be-sent notification in the message queue based on the notification rule corresponding to the notification sending mode.
10. The apparatus of claim 9, wherein the first transmitting module comprises:
the coding submodule is configured to code the notification to be sent to obtain coding information;
a first sending submodule configured to send the encoded information to a message queue.
11. The apparatus of claim 10, wherein the second transmitting means comprises:
the decoding submodule is configured to decode the coding information in the message queue to obtain decoding information;
the obtaining submodule is configured to obtain a current limiting rule corresponding to the notification sending mode;
a current limiting sub-module configured to current limit the decoded information based on the current limiting rule;
and the second sending submodule is configured to call a function corresponding to the notification sending mode to send the decoding information in response to the decoding information not being limited.
12. The apparatus of claim 11, wherein the second transmitting means further comprises:
a third sending submodule configured to send an asynchronous pool request in a current limited state to the message queue in response to the decoded information being current limited.
13. The apparatus of claim 12, wherein the apparatus further comprises:
a third sending module configured to send an asynchronous library falling request in a sending success state to the message queue in response to the decoding information being sent successfully;
a fourth sending module configured to send an asynchronous library falling request in a sending failure state to the message queue in response to the decoding information sending failure.
14. The apparatus of claim 13, wherein the apparatus further comprises:
the recording module is configured to record the content of the notification to be sent and the notification sending state to obtain a notification record table;
an aggregation module configured to aggregate or clean data in the notification record table.
15. The apparatus of any of claims 9-14, wherein the apparatus further comprises:
and the calling module is configured to call the function application to perform cold start preheating.
16. The apparatus of any of claims 9-15, wherein the apparatus further comprises:
the checking module is configured to check the sender information to be notified;
and the return module is configured to return verification failure information if the sender information fails to be verified.
17. 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-8.
18. 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-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8.
CN202111007149.9A 2021-08-30 2021-08-30 Method, device, equipment and storage medium for realizing notification service Active CN113704004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111007149.9A CN113704004B (en) 2021-08-30 2021-08-30 Method, device, equipment and storage medium for realizing notification service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111007149.9A CN113704004B (en) 2021-08-30 2021-08-30 Method, device, equipment and storage medium for realizing notification service

Publications (2)

Publication Number Publication Date
CN113704004A true CN113704004A (en) 2021-11-26
CN113704004B CN113704004B (en) 2023-09-29

Family

ID=78657021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111007149.9A Active CN113704004B (en) 2021-08-30 2021-08-30 Method, device, equipment and storage medium for realizing notification service

Country Status (1)

Country Link
CN (1) CN113704004B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979256A (en) * 2022-05-19 2022-08-30 北京京东乾石科技有限公司 Message pushing method and device, electronic equipment and computer readable medium
WO2023123022A1 (en) * 2021-12-29 2023-07-06 深圳晶泰科技有限公司 Method and apparatus for acquiring molecular properties, and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105141763A (en) * 2015-08-11 2015-12-09 北京思特奇信息技术股份有限公司 Method and system for carrying out message group sending through APP (Application) of smart phone
CN110225109A (en) * 2019-06-05 2019-09-10 浙江汇信科技有限公司 A kind of data transmission method of more queues
US20190356717A1 (en) * 2018-05-17 2019-11-21 Shanghai Bilibili Technology Co., Ltd. Multimedia file processing
CN111371892A (en) * 2020-03-05 2020-07-03 中国银行股份有限公司 High-concurrency distributed message pushing system and method
CN111400062A (en) * 2020-03-12 2020-07-10 苏州浪潮智能科技有限公司 Information notification method, device, system and computer readable storage medium
CN112615929A (en) * 2020-12-24 2021-04-06 上海掌门科技有限公司 Method and equipment for pushing messages
CN112887193A (en) * 2021-01-13 2021-06-01 广州市玄武无线科技股份有限公司 Message sending method, system, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105141763A (en) * 2015-08-11 2015-12-09 北京思特奇信息技术股份有限公司 Method and system for carrying out message group sending through APP (Application) of smart phone
US20190356717A1 (en) * 2018-05-17 2019-11-21 Shanghai Bilibili Technology Co., Ltd. Multimedia file processing
CN110225109A (en) * 2019-06-05 2019-09-10 浙江汇信科技有限公司 A kind of data transmission method of more queues
CN111371892A (en) * 2020-03-05 2020-07-03 中国银行股份有限公司 High-concurrency distributed message pushing system and method
CN111400062A (en) * 2020-03-12 2020-07-10 苏州浪潮智能科技有限公司 Information notification method, device, system and computer readable storage medium
CN112615929A (en) * 2020-12-24 2021-04-06 上海掌门科技有限公司 Method and equipment for pushing messages
CN112887193A (en) * 2021-01-13 2021-06-01 广州市玄武无线科技股份有限公司 Message sending method, system, terminal and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王刚;张鹰;潘刚;李孝杰;: "SMS自动回复在企业销售平台中的设计与实现", 陕西科技大学学报(自然科学版), no. 03 *
王钰;叶?越: "基于商用多媒体云平台的终端推送服务设计", 微型电脑应用, no. 06 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023123022A1 (en) * 2021-12-29 2023-07-06 深圳晶泰科技有限公司 Method and apparatus for acquiring molecular properties, and storage medium
CN114979256A (en) * 2022-05-19 2022-08-30 北京京东乾石科技有限公司 Message pushing method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN113704004B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
CN113704004B (en) Method, device, equipment and storage medium for realizing notification service
CN109873863B (en) Asynchronous calling method and device of service
CN111161085B (en) Service request processing method, device, electronic equipment and computer readable medium
CN112184367A (en) Order processing method and device
CN114637611A (en) Information processing method and device based on message queue and computer equipment
CN112437001B (en) Method and device for guaranteeing reliable delivery and consumption of messages
CN112948081B (en) Method, device, equipment and storage medium for processing tasks in delayed mode
US10176459B2 (en) Sending an out-of-facility notification based on aggregated content from a task management system and communications with at least one collaboration partner in an occupation context
US11303587B2 (en) Chatbot information processing
CN111866767B (en) Message processing method, device, electronic equipment and readable medium
CN109617789B (en) Method, system, electronic device and storage medium for processing session message
CN116521639A (en) Log data processing method, electronic equipment and computer readable medium
CN112953769B (en) Data transmission method, device, computer system and readable storage medium
CN114374686A (en) File processing method, device and equipment based on browser
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN111580882B (en) Application program starting method, device, computer system and medium
CN111432357B (en) Information processing method and system and computing equipment
CN113890906A (en) Call forwarding method and device, electronic equipment and computer readable storage medium
CN112272211A (en) Service request processing method, device and system
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN111722946A (en) Distributed transaction processing method and device, computer equipment and readable storage medium
CN110297871A (en) A kind of method that isomeric data acquires in real time
CN113766437B (en) Short message sending method and device
CN113765864B (en) Service request processing method and device
CN116827672A (en) File transmission method, device, computer 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
GR01 Patent grant
GR01 Patent grant