CN108306815A - A kind of method, apparatus, equipment and computer readable storage medium obtaining message - Google Patents
A kind of method, apparatus, equipment and computer readable storage medium obtaining message Download PDFInfo
- Publication number
- CN108306815A CN108306815A CN201711459948.3A CN201711459948A CN108306815A CN 108306815 A CN108306815 A CN 108306815A CN 201711459948 A CN201711459948 A CN 201711459948A CN 108306815 A CN108306815 A CN 108306815A
- Authority
- CN
- China
- Prior art keywords
- message
- service
- type
- gateway
- library
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000004891 communication Methods 0.000 claims description 10
- 230000002159 abnormal effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/214—Monitoring or handling of messages using selective forwarding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
Invention describes a kind of method, apparatus, equipment and computer readable storage medium obtaining message, this method includes:Information gateway receives the solicited message from application APP, and determines the type of the requested service message of request message;The information gateway obtains service message from message library corresponding with the type of the service message;Wherein, the message library is used for the service message that storage service side generates;The service message got is sent to the APP by the information gateway.Information gateway can reliably obtain various types of service messages in time, improve the process performance of information gateway.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for acquiring a message.
Background
The message center is a core message notification function of an APP (Application) and is used for performing message reminding to an end user. In the prior art, a message gateway in a message center directly calls a service party to obtain a service message of the service party. Due to the high coupling between the message gateway and the service party, the processing performance of the message gateway and the service party is poor, and the expansibility is poor.
Disclosure of Invention
The embodiments of the present invention mainly aim to provide a method, an apparatus, a device and a computer readable storage medium for acquiring a message, so as to timely and reliably acquire various types of service messages and improve the processing performance of a message gateway.
In order to achieve the above object, an embodiment of the present invention provides a method for acquiring a message, where the method includes:
a message gateway receives request information from an application program APP and determines the type of a service message requested by the request information;
the message gateway acquires the service message from a message library corresponding to the type of the service message; the message library is used for storing the service messages generated by the service party;
and the message gateway sends the acquired service message to the APP.
Optionally, the type of the service message includes:
push messages, system messages, or real-time messages.
Optionally, when the type of the service message is a push message, the obtaining, by the message gateway, the service message from a message library corresponding to the type of the service message includes:
and the message gateway acquires the push message from a preset push message library.
Optionally, when the type of the service message is a real-time message, the message gateway obtains the service message from a message library corresponding to the type of the service message, including:
and the message gateway acquires the real-time message from a preset real-time message library.
Optionally, when the type of the service message is a system message, the obtaining, by the message gateway, the service message from a message library corresponding to the type of the service message includes:
and the message gateway acquires the system message from a preset system message library through a system message service.
Optionally, after the message gateway obtains the service message from the message library corresponding to the type of the service message, the method further includes:
and the message gateway judges whether the service message is acquired from a message library corresponding to the type of the service message within set time, and if not, the operation of acquiring the service message is interrupted.
In addition, to achieve the above object, an embodiment of the present invention further provides an apparatus for acquiring a message, where the apparatus includes:
the receiving module is used for receiving request information from an application program APP by a message gateway and determining the type of a service message requested by the request information;
an obtaining module, configured to obtain, by the message gateway, a service message from a message library corresponding to a type of the service message; the message library is used for storing the service messages generated by the service party;
and the sending module is used for sending the obtained service message to the APP by the message gateway.
Optionally, the type of the service message includes:
push messages, system messages, or real-time messages.
In addition, to achieve the above object, an embodiment of the present invention further provides an apparatus for acquiring a message, where the apparatus includes: a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute the program for retrieving a message stored in the memory to implement the steps of the method for retrieving a message introduced above.
In addition, in order to achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, where a program for acquiring a message is stored;
the program for retrieving a message, when executed by at least one processor, causes the at least one processor to perform the steps of the method for retrieving a message as described above.
The method, the device, the equipment and the computer readable storage medium for acquiring the message provided by the embodiment of the invention set the corresponding message library for various types of service messages and store various types of service messages generated by a service party into the message library of the corresponding type; the message gateway obtains the service message from the preset message library aiming at different types, and the service message does not need to be directly obtained from the service party. The message gateway can timely and reliably acquire various types of service messages, and the processing performance of the message gateway is improved.
Drawings
Fig. 1 is a flowchart of a method of acquiring a message according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method of obtaining a message according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for acquiring a message according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a device for acquiring a message according to a fourth embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the embodiments of the present invention for achieving the intended purpose, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.
A first embodiment of the present invention provides a method for acquiring a message, and as shown in fig. 1, the method specifically includes the following steps:
step S101: the message gateway receives request information from an application program APP and determines the type of a service message requested by the request information.
Wherein the type of the service message comprises: push messages, system messages, or real-time messages.
Step S102: the message gateway acquires the service message from a message library corresponding to the type of the service message; the message library is used for storing the service messages generated by the service party.
Specifically, in the embodiment of the present invention, a corresponding message library is set for various types of service messages. And setting a push message library for storing the push messages generated by the service party aiming at the push messages. And aiming at the real-time message, setting a real-time database for storing the real-time message generated by the service party. And aiming at the system message, setting a system database for storing the system message generated by the service party.
It should be noted that the system message generated by the service side needs to rely on the system message service, and the message bus is stored in the system message library. The service side calls the message creating method, the system message is sent to the message bus through the system message service, and the message bus receives the system message and stores the system message into the system message library.
Further, step S102 includes:
the message gateway acquires a push message from a push message library; or,
the message gateway acquires a real-time message from a real-time message library; or,
and the message gateway acquires the system message from the system message library through the system message server.
It should be noted that, when the message gateway acquires the system message, the system message service needs to be invoked to acquire the system message in the system message library through the system message service.
When the system message is stored, the message bus is adopted for asynchronous decoupling, and the pressure written in the system message can be buffered; when reading the system message, the system message library is directly read through the system message service, so that the message acquisition efficiency is improved.
Step S103: and the message gateway sends the acquired service message to the APP.
Compared with the prior art, the embodiment of the invention sets the corresponding message library for various types of service messages and stores the service messages generated by each service party into the message library of the corresponding type. When the message gateway receives the request information, the service message is not required to be acquired from each service party, but can be acquired from each message library. The efficiency and the reliability of obtaining the service message are improved.
A second embodiment of the present invention provides a method for acquiring a message, as shown in fig. 2, where the method specifically includes the following steps:
step S201: the message gateway receives request information from an application program APP and determines the type of a service message requested by the request information.
Wherein the type of the service message comprises: push messages, system messages, or real-time messages.
Step S202: the message gateway acquires the service message from a message library corresponding to the type of the service message; the message library is used for storing the service messages generated by the service party.
Specifically, in the embodiment of the present invention, a corresponding message library is set for various types of service messages. And setting a push message library for storing the push messages generated by the service party aiming at the push messages. And aiming at the real-time message, setting a real-time database for storing the real-time message generated by the service party. And aiming at the system message, setting a system database for storing the system message generated by the service party.
It should be noted that the system message generated by the service side needs to rely on the system message service, and the message bus is stored in the system message library. The service side calls the message creating method, the system message is sent to the message bus through the system message service, and the message bus receives the system message and stores the system message into the system message library.
Further, the step S202 includes:
the message gateway acquires the push message from the push message library through a message link established between the message gateway and the push message library; or,
the message gateway acquires the real-time message from the real-time message library through a message link established between the message gateway and the real-time message library; or,
and the message gateway acquires the system message from the system message library through a message link established between the message gateway and the system message service and through the system message service.
Step S203: the message gateway judges whether the service message is acquired from a message library corresponding to the type of the service message within a set time, if so, the step S204 is executed; if not, go to step S205.
Step S204: and the message gateway sends the acquired service message to the APP.
Step S205: and the message gateway interrupts the operation of acquiring the service message.
Specifically, step S205 includes:
interrupting a message link between the message gateway and the push message library; or,
interrupting a message link between the message gateway and the real-time message library; or,
interrupting a message link between the message gateway and the system message service.
When the message gateway does not receive the service message within the set time, it indicates that the processing performance of the service party corresponding to the service message is abnormal, and in order to ensure the processing efficiency and load of the message gateway, when the processing performance of the service party is abnormal, a fusing strategy is adopted, namely, the operation of obtaining the service message is interrupted.
A third embodiment of the present invention provides an apparatus for acquiring a message, as shown in fig. 3, the apparatus specifically includes the following components:
a receiving module 301, configured to receive, by a message gateway, request information from an application APP, and determine a type of a service message requested by the request information;
an obtaining module 302, configured to obtain, by the message gateway, a service message from a message library corresponding to a type of the service message; the message library is used for storing the service messages generated by the service party;
a sending module 303, configured to send, by the message gateway, the obtained service message to the APP.
Specifically, the type of the service message includes:
push messages, system messages, or real-time messages.
Further, the obtaining module 302 is specifically configured to:
the message gateway acquires a push message from a push message library; or,
the message gateway acquires a real-time message from a real-time message library; or,
and the message gateway acquires the system message from the system message library through the system message server.
Still further, the apparatus further comprises:
and the fusing module is used for judging whether the service message is acquired from the message library corresponding to the type of the service message within set time or not by the message gateway after the message gateway acquires the service message from the message library corresponding to the type of the service message, and if not, interrupting the operation of acquiring the service message.
A fourth embodiment of the present invention provides an apparatus for acquiring a message, as shown in fig. 4, the apparatus includes: a processor 401, a memory 402, and a communication bus;
the communication bus is used for realizing connection communication between the processor 401 and the memory 402;
processor 401 is configured to execute the program stored in memory 402 to retrieve a message to perform the steps of:
a message gateway receives request information from an application program APP and determines the type of a service message requested by the request information;
the message gateway acquires the service message from a message library corresponding to the type of the service message; the message library is used for storing the service messages generated by the service party;
and the message gateway sends the acquired service message to the APP.
Specifically, the type of the service message includes:
push messages, system messages, or real-time messages.
Further, when the processor 401 executes the step of acquiring the service message from the message library corresponding to the type of the service message by the message gateway, the method specifically includes:
the message gateway acquires a push message from a push message library; or,
the message gateway acquires a real-time message from a real-time message library; or,
and the message gateway acquires the system message from the system message library through the system message server.
Further, the processor 401 is further configured to execute the program stored in the memory 402 for retrieving the message, so as to implement the following steps:
after the message gateway acquires the service message from the message library corresponding to the type of the service message, the message gateway judges whether the service message is acquired from the message library corresponding to the type of the service message within a set time, and if not, the operation of acquiring the service message is interrupted.
A fifth embodiment of the present invention proposes a computer-readable storage medium storing a program for acquiring a message;
when executed by at least one processor, the program for obtaining messages causes the at least one processor to perform the steps of:
a message gateway receives request information from an application program APP and determines the type of a service message requested by the request information;
the message gateway acquires the service message from a message library corresponding to the type of the service message; the message library is used for storing the service messages generated by the service party;
and the message gateway sends the acquired service message to the APP.
The method, the device, the equipment and the computer readable storage medium for acquiring the messages, which are introduced in the embodiment of the invention, set the corresponding message library for various types of service messages and store various types of service messages generated by a service party into the message library of the corresponding type; the message gateway obtains the service message from the preset message library aiming at different types, and the service message does not need to be directly obtained from the service party. The message gateway can timely and reliably acquire various types of service messages, and the processing performance of the message gateway is improved.
While the embodiments of the present invention have been described in terms of specific embodiments, it is to be understood that both the foregoing general description and the following detailed description are intended to provide further explanation and understanding of the invention as claimed.
Claims (10)
1. A method of retrieving a message, the method comprising:
a message gateway receives request information from an application program APP and determines the type of a service message requested by the request information;
the message gateway acquires the service message from a message library corresponding to the type of the service message; the message library is used for storing the service messages generated by the service party;
and the message gateway sends the acquired service message to the APP.
2. The method of claim 1, wherein the type of the service message comprises:
push messages, system messages, or real-time messages.
3. The method of claim 2, wherein when the type of the service message is a push message, the message gateway obtains the service message from a message library corresponding to the type of the service message, and the method comprises:
and the message gateway acquires the push message from a preset push message library.
4. The method of claim 2, wherein when the type of the service message is a real-time message, the message gateway obtains the service message from a message library corresponding to the type of the service message, and the method comprises:
and the message gateway acquires the real-time message from a preset real-time message library.
5. The method of claim 2, wherein when the type of the service message is a system message, the message gateway obtains the service message from a message library corresponding to the type of the service message, and the method comprises:
and the message gateway acquires the system message from a preset system message library through a system message service.
6. The method for acquiring message according to any claim 1-5, wherein after the message gateway acquires the service message from the message library corresponding to the type of the service message, the method further comprises:
and the message gateway judges whether the service message is acquired from a message library corresponding to the type of the service message within set time, and if not, the operation of acquiring the service message is interrupted.
7. An apparatus for retrieving a message, the apparatus comprising:
the receiving module is used for receiving request information from an application program APP by a message gateway and determining the type of a service message requested by the request information;
an obtaining module, configured to obtain, by the message gateway, a service message from a message library corresponding to a type of the service message; the message library is used for storing the service messages generated by the service party;
and the sending module is used for sending the obtained service message to the APP by the message gateway.
8. The apparatus for acquiring messages according to claim 7, wherein the type of the service message includes:
push messages, system messages, or real-time messages.
9. An apparatus for retrieving a message, the apparatus comprising: a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute the program for retrieving a message stored in the memory to implement the steps of the method for retrieving a message of any one of claims 1 to 6.
10. A computer-readable storage medium characterized in that the computer-readable storage medium stores a program for acquiring a message;
the program for retrieving a message, when executed by at least one processor, causes the at least one processor to perform the steps of the method for retrieving a message of any one of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711459948.3A CN108306815A (en) | 2017-12-28 | 2017-12-28 | A kind of method, apparatus, equipment and computer readable storage medium obtaining message |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711459948.3A CN108306815A (en) | 2017-12-28 | 2017-12-28 | A kind of method, apparatus, equipment and computer readable storage medium obtaining message |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN108306815A true CN108306815A (en) | 2018-07-20 |
Family
ID=62867575
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711459948.3A Pending CN108306815A (en) | 2017-12-28 | 2017-12-28 | A kind of method, apparatus, equipment and computer readable storage medium obtaining message |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108306815A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111314189A (en) * | 2020-01-17 | 2020-06-19 | 支付宝(杭州)信息技术有限公司 | Service message sending method and device |
| CN112084042A (en) * | 2019-06-13 | 2020-12-15 | 北京京东振世信息技术有限公司 | Message processing method and device |
| CN114513483A (en) * | 2022-01-14 | 2022-05-17 | 上海万物新生环保科技集团有限公司 | Message notification method and device based on service system |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102215177A (en) * | 2011-05-31 | 2011-10-12 | 广州华多网络科技有限公司 | Method and device for processing system message of instant communication software |
| CN104796322A (en) * | 2015-03-25 | 2015-07-22 | 腾讯科技(深圳)有限公司 | Message processing method and equipment |
| US20160330109A1 (en) * | 2015-05-08 | 2016-11-10 | Oracle International Corporation | Triggered-actions network processor |
| CN106850402A (en) * | 2017-01-16 | 2017-06-13 | 腾讯科技(深圳)有限公司 | The transmission method and device of message |
-
2017
- 2017-12-28 CN CN201711459948.3A patent/CN108306815A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102215177A (en) * | 2011-05-31 | 2011-10-12 | 广州华多网络科技有限公司 | Method and device for processing system message of instant communication software |
| CN104796322A (en) * | 2015-03-25 | 2015-07-22 | 腾讯科技(深圳)有限公司 | Message processing method and equipment |
| US20160330109A1 (en) * | 2015-05-08 | 2016-11-10 | Oracle International Corporation | Triggered-actions network processor |
| CN106850402A (en) * | 2017-01-16 | 2017-06-13 | 腾讯科技(深圳)有限公司 | The transmission method and device of message |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112084042A (en) * | 2019-06-13 | 2020-12-15 | 北京京东振世信息技术有限公司 | Message processing method and device |
| CN112084042B (en) * | 2019-06-13 | 2023-09-22 | 北京京东振世信息技术有限公司 | Message processing method and device |
| CN111314189A (en) * | 2020-01-17 | 2020-06-19 | 支付宝(杭州)信息技术有限公司 | Service message sending method and device |
| CN111314189B (en) * | 2020-01-17 | 2022-02-25 | 蚂蚁财富(上海)金融信息服务有限公司 | Service message sending method and device |
| CN114513483A (en) * | 2022-01-14 | 2022-05-17 | 上海万物新生环保科技集团有限公司 | Message notification method and device based on service system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10812314B2 (en) | Methods and apparatuses for pushing a message | |
| CN105825409B (en) | Electronic invoice message pushing system and method | |
| CN104181567B (en) | Terminal device positioning method, terminal device and terminal device positioning system | |
| CN110995851B (en) | Message processing method, device, storage medium and equipment | |
| CN108306815A (en) | A kind of method, apparatus, equipment and computer readable storage medium obtaining message | |
| CN110912805B (en) | Synchronization method, terminal, server and system for message reading status | |
| CN110708234A (en) | Message transmission processing method, message transmission processing device and storage medium | |
| CN115695497B (en) | Diagnostic data remote transmission method, device, electronic equipment and medium | |
| CN109766347B (en) | Data updating method, device, system, computer equipment and storage medium | |
| CN106612263B (en) | Method and equipment for processing application access request | |
| US20160112525A1 (en) | Distribution control device and method for same, push distribution system, and storage medium | |
| CN118101739B (en) | Network connection reset information acquisition method, device and storage medium | |
| CN108632321A (en) | Treating method and apparatus based on scheduling of resource under big data platform | |
| CN117762652A (en) | Distributed transaction processing method and device based on message middleware | |
| CN103380593B (en) | A kind of in system upgrade process to method, device and equipment that business processes | |
| CN111552907A (en) | Message processing method, device, equipment and storage medium | |
| CN108289165B (en) | Method and device for realizing camera control based on mobile phone and terminal equipment | |
| CN113224851B (en) | Power distribution terminal state determination method and device, electronic equipment and storage medium | |
| CN113127508B (en) | Serial number acquisition method, device and system | |
| CN117354956A (en) | 5G-based session establishment method and device, electronic equipment and storage medium | |
| CN115885570A (en) | Communication method, device and computer readable storage medium | |
| CN108989467B (en) | Centralized addressing method | |
| CN107704557B (en) | Processing method and device for operating mutually exclusive data, computer equipment and storage medium | |
| CN106453635A (en) | Message pushing method and device | |
| CN115630120B (en) | Data synchronization method, device, 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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180720 |
|
| RJ01 | Rejection of invention patent application after publication |