CN116033008A - Message processing method and device, electronic equipment and readable storage medium - Google Patents

Message processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116033008A
CN116033008A CN202211573294.8A CN202211573294A CN116033008A CN 116033008 A CN116033008 A CN 116033008A CN 202211573294 A CN202211573294 A CN 202211573294A CN 116033008 A CN116033008 A CN 116033008A
Authority
CN
China
Prior art keywords
message
target
push
sending
pushing
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
CN202211573294.8A
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.)
Xiamen Stone City Software Technology Co ltd
Original Assignee
Xiamen Stone City Software 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 Xiamen Stone City Software Technology Co ltd filed Critical Xiamen Stone City Software Technology Co ltd
Priority to CN202211573294.8A priority Critical patent/CN116033008A/en
Publication of CN116033008A publication Critical patent/CN116033008A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The present disclosure provides a message processing method, a device, an electronic apparatus, and a readable storage medium, where the method includes: detecting whether an event of sending a target message occurs; under the condition that an event of sending a target message occurs, determining a sending channel of the target message as a target sending channel; and sending the target message through the target sending channel.

Description

Message processing method and device, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of message processing technology, and more particularly, to a message processing method, a message processing apparatus, an electronic device, and a computer-readable storage medium.
Background
The message pushing requirements of the service platform are complex, and the message sending channels of each service line can be different, and the service platform comprises an in-station sending channel, a short message pushing channel, a nail pushing channel, a mailbox pushing channel, an applet pushing channel, a public number pushing channel, an application pushing channel and the like.
In the prior art, each service line of the service platform respectively develops a respective message pushing function to butt-joint a corresponding third party platform, so that the repeated development of the message pushing function is caused, and the problems of difficult maintenance, higher operation and maintenance cost and the like are solved.
Disclosure of Invention
It is an object of embodiments of the present disclosure to provide a new solution that can solve at least one of the above problems.
According to a first aspect of the present disclosure, there is provided a message processing method, including:
detecting whether an event of sending a target message occurs;
under the condition that an event of sending a target message occurs, determining a sending channel of the target message as a target sending channel;
and sending the target message through the target sending channel.
Optionally, the method further comprises:
determining a message processing mode of the target message;
executing the step of transmitting the target message through the target transmission channel under the condition that the message processing mode is synchronous message processing;
and under the condition that the message processing mode is asynchronous message processing, sending the target message to a message queue, then taking the target message out of the message queue, and executing the step of sending the target message through the target sending channel.
Optionally, in a case that the target transmission channel is an in-station transmission channel, the transmitting the target message through the target transmission channel includes:
And storing the target message into a preset intra-station message table.
Optionally, in the case that the target sending channel is a third party push channel, the sending the target message through the target sending channel includes:
storing the target message into a preset push message table;
determining a third party pushing interface corresponding to the target message as a target pushing interface;
pushing the target message through the target pushing interface, and updating the pushing state of the target message in the pushing message table according to a pushing result.
Optionally, the method further comprises:
determining a message processing mode of the target message;
executing the step of pushing the target message through the target pushing interface under the condition that the message processing mode is synchronous message processing;
and detecting whether a timed push event occurs or not under the condition that the message processing mode is asynchronous message processing, and executing the step of pushing the target message through the target push interface under the condition that the timed push event occurs.
Optionally, the method further comprises:
responding to a message inquiry instruction sent by a service module, acquiring a plurality of messages in a message table in a station and a push message table, and obtaining a message list; the in-station message table is recorded with messages sent through an in-station sending channel, and the push message table is recorded with messages sent through a third-party push channel;
And returning the message list to the business service module.
Optionally, the method further comprises:
responding to a push state query instruction of the target message sent by a business service module, and acquiring the push state of the target message through the push message table;
and returning the push state of the target message to the business service module.
According to a second aspect of the present disclosure, there is provided a message processing apparatus comprising:
the event detection module is used for detecting whether an event of sending the target message occurs or not;
the channel determining module is used for determining a sending channel of the target message as a target sending channel under the condition that an event for sending the target message occurs;
and the message sending module is used for sending the target message through the target sending channel.
According to a third aspect of the present disclosure there is provided an electronic device comprising an apparatus as described in the second aspect of the present disclosure; or alternatively, the process may be performed,
the electronic device comprises a processor and a memory for storing a computer program for controlling the processor to perform the method according to the first aspect of the present disclosure.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method according to the first aspect of the present disclosure.
The method and the device have the advantages that through the embodiment of the disclosure, under the condition that the occurrence of the event of sending the target message is detected, the target sending channel of the target message is determined, and then the target message is sent through the target sending channel, so that the message sending function can be unified, the problem that each business service unit respectively develops the corresponding message sending function to cause repeated development and operation and maintenance is avoided, the development and operation and maintenance cost can be reduced, and the server resource can be saved. In addition, the interfaces can be pushed uniformly, and the complexity and the workload of accessing the service system are reduced. In addition, the message service can be stripped from the service system for centralized treatment, and the effect of high cohesion and low coupling is realized.
Other features of the present disclosure and its advantages will become apparent from the following detailed description of exemplary embodiments of the disclosure, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a block diagram of one example of a hardware configuration of an electronic device that may be used to implement embodiments of the present disclosure;
FIG. 2 is a flow diagram of a message processing method according to an embodiment of the present disclosure;
FIG. 3a is a schematic diagram of a synchronous message processing architecture according to an embodiment of the present disclosure;
FIG. 3b is a schematic diagram of an asynchronous message processing architecture according to an embodiment of the present disclosure;
FIG. 4 is a block schematic diagram of a message processing apparatus according to an embodiment of the present disclosure;
fig. 5 is a block schematic diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
< hardware configuration >
Fig. 1 is a block diagram illustrating a hardware configuration of an electronic device 1000 in which embodiments of the present disclosure may be implemented.
As shown in fig. 1, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, ROM (read only memory), RAM (random access memory), nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, any type of USB interface, headphone interface, or the like. The communication device 1400 can be capable of wired or wireless communication, and specifically can include Wifi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display, a touch display, or the like. The input device 1600 may include, for example, a touch screen, keyboard, somatosensory input, and the like. A user may input/output voice information through the speaker 1700 and microphone 1800.
In an embodiment of the present disclosure, the electronic device 1000 may be an electronic product such as a computer, a computer cluster, a server, a notebook, a tablet, or a mobile phone.
The electronic device shown in fig. 1 is merely illustrative and is in no way meant to limit the disclosure, its application, or uses. In an embodiment of the disclosure, the memory 1200 of the electronic device 1000 is configured to store instructions for controlling the processor 1100 to operate to perform any one of the methods provided by the embodiments of the disclosure. It will be appreciated by those skilled in the art that although a plurality of devices are shown for the electronic apparatus 1000 in fig. 1, the present disclosure may relate to only some of the devices thereof, for example, the electronic apparatus 1000 relates to only the processor 1100 and the storage device 1200. The skilled artisan can design instructions in accordance with the disclosed aspects of the present disclosure. How the instructions control the processor to operate is well known in the art and will not be described in detail here.
The electronic device 1000 shown in fig. 1 is merely illustrative and is in no way intended to limit the specification, its application, or uses.
Various embodiments and examples according to the present disclosure are described below with reference to the accompanying drawings.
< method example >
In this embodiment, a message processing method is provided. The method may be implemented by an electronic device. The electronic device may be an electronic device 1000 as shown in fig. 1. In one example, the method may also be implemented by a message service module of the electronic device.
As shown in fig. 2, the method of the present embodiment may include the following steps S2100 to S2300:
in step S2100, it is detected whether an event of transmitting the target message occurs.
In this embodiment, the event of sending the target message may be preset according to the application scenario or specific requirements.
In this embodiment, as shown in fig. 3a and fig. 3b, a business service module 3100 and a message service module 3200 may be provided in the electronic device 1000 for executing this embodiment, where the business service module 3100 is used for a functional module for external interaction, and the message service module 3200 may execute the message processing method of this embodiment and interact with the business service module 3100. A plurality of service units 3110 may be included in the service module 3100, and each service unit 3110 may perform a corresponding service control flow.
In one embodiment, it may be that any service unit 3110 of the service module 3100 triggers an event of sending the target message to occur when the corresponding service operation is completed.
For example, in the process of executing the order procedure by the service unit 3110, the last service step of the order procedure may be to send a message indicating the result of the order to the user, and then the service unit 3110 executes the last service step of the order procedure, triggering the event of sending the target message.
For another example, the user sends a logistic sign-up instruction to the corresponding service unit 3110 in the service module 3100 through the corresponding terminal device, and the corresponding service unit 3110 may trigger occurrence of an event for sending the target message in response to the logistic sign-up instruction.
In one example, the manner in which the service unit 3110 triggers the event of sending the target message may be a sending instruction for sending the target message to the message service module 3200 (where the sending instruction may include parameter information of the target message), or may be parameter information of sending the target message to the message service module 3200, which is not limited herein.
In one embodiment of the present disclosure, as shown in fig. 3a and 3b, the message service module 3200 may include a receiving end 3210, may be a transmitting instruction for receiving a target message transmitted by the service unit 3110 by the receiving end 3210 of the message service module 3200, and performs step S2200.
Step S2200, when the event of sending the target message occurs, determining the sending channel of the target message as the target sending channel.
In this embodiment, the sending channel of the target message may be an in-station sending channel or a third party pushing channel, and the third party pushing channel may include a short message pushing channel, a mail pushing channel, an applet pushing channel, an application pushing channel, and the like.
In one embodiment, the transmission channel of the target message may be determined based on the business service unit that triggered the occurrence of the event that transmitted the target message. Specifically, a first comparison table indicating the correspondence between the service unit and the transmission channel may be stored in advance, and the transmission channel corresponding to the service unit triggering the event of the transmission target message may be determined as the target transmission channel by searching the first comparison table.
In another embodiment, the sending channel of the target message may also be determined by the service unit and sent to the message service module. Specifically, the service unit may identify the target transmission channel of the target message by the first type of the target message, and the message service module may determine the target transmission channel by reading the first type of the target message.
Step S2300, the target message is transmitted through the target transmission channel.
In this embodiment, as shown in fig. 3a and 3b, the message service module 3200 may further include an in-station message unit 3220 and a push message unit 3230.
In the case where the target transmission channel is an in-station transmission channel, the target message may be transmitted through the in-station message unit 3220 of the message service module 3200. In the case where the target transmission channel is a third party push channel, the target message may be transmitted through the push message unit 3230 of the message service module 3200.
According to the embodiment of the disclosure, under the condition that the occurrence of the event of sending the target message is detected, the target sending channel of the target message is determined, and then the target message is sent through the target sending channel, so that the message sending function can be unified, the problem that each business service unit develops the corresponding message sending function to cause repeated development and operation and maintenance is avoided, the development and operation and maintenance cost can be reduced, and the server resource can be saved. In addition, the interfaces can be pushed uniformly, and the complexity and the workload of accessing the service system are reduced. In addition, the message service can be stripped from the service system for centralized treatment, and the effect of high cohesion and low coupling is realized.
In one embodiment of the present disclosure, the method may further comprise: determining a message processing mode of a target message; if the message processing method is synchronous message processing, step S2300 is executed to send the target message through the target sending channel; when the message processing mode is asynchronous message processing, the target message is sent to the message queue, and then the target message is fetched from the message queue, and step S2300 is executed to send the target message through the target sending channel.
In one embodiment, the message handling of the target message may be determined based on the service element triggering the occurrence of the event that sent the target message. Specifically, a second comparison table indicating the correspondence between the service unit and the message processing mode may be stored in advance, and by looking up the second comparison table, the message processing mode corresponding to the service unit triggering the occurrence of the event of sending the target message may be determined as the message processing mode of the target message.
In another embodiment, the message processing manner of the target message may also be determined by the service unit and sent to the message service module. Specifically, the service unit may identify the message processing manner of the target message through the second type of the target message, and the message service module may determine the message processing manner of the target message by reading the second type of the target message.
In this embodiment, the message processing manner of the target message may be synchronous message processing or asynchronous message processing.
In the case that the message processing mode of the target message is synchronous message processing and the target sending channel is an intra-station sending channel, the receiving end can send the target message to an intra-station message unit, and the target message is sent through the intra-station message unit of the message service module. In the case that the message processing mode of the target message is synchronous message processing and the target sending channel is a third party push channel, the receiving end may send the target message to the push message unit, and send the target message through the push message unit of the message service module.
In this embodiment, as shown in fig. 3b, the message service module 3200 may further include a message queue 3240 and a consumer 3250.
When the message processing manner of the target message is asynchronous message processing and the target transmission channel is an intra-station transmission channel, the receiving end 3210 may send the target message to the message queue 3240, the consuming end 3250 may take the target message out of the message queue 3240 and send the target message to the intra-station message unit 3220, and the intra-station message unit 3220 of the message service module 3200 may send the target message. In the case that the message processing manner of the target message is asynchronous message processing and the target sending channel is a third party push channel, the receiving end 3210 may send the target message to the message queue 3240, and then the consuming end 3250 takes the target message out of the message queue and sends the target message to the push message unit 3230, and the push message unit 3230 of the message service module 3200 sends the target message.
Through the message service module of the embodiment, unified sending processing can be carried out on the synchronous message processing and the asynchronous message processing, development and operation cost can be reduced, and server resources can be saved.
In one embodiment of the present disclosure, in a case where the target transmission channel is an in-station transmission channel, transmitting the target message through the target transmission channel may include: and storing the target message into a preset in-station message table.
As shown in fig. 3a and 3b, the in-station message unit 3220 of the message service module 3200 may include an in-station message subunit 3221 and an in-station message table 3222, and all messages transmitted through an in-station transmission channel are recorded in the in-station message table 3222. Specifically, the messages recorded in the intra-station message table may be all messages sent by the receiving end 3210 to the intra-station message unit 3220, including synchronous messages sent by the receiving end 3210 directly to the intra-station message unit 3220, and asynchronous messages sent by the receiving end 3210 to the message queue 3240, and then fetched from the message queue 3240 by the consuming end 3250 and sent to the intra-station message unit 3220.
In the in-station message table, parameter information of each message may also be recorded, and the parameter information of the message may include, for example, a sender, a receiver, a transmission time, and the like of the message.
In an embodiment where the target transmission channel is an intra-station transmission channel, the target message may be transmitted through the target transmission channel by the receiving end 3210 or the consuming end 3250 to the intra-station message subunit 3221, and then stored in the intra-station message table 3222 by the intra-station message subunit 3221.
By the embodiment, the message service architecture can be simplified, and the producer consumer mode is adopted inside, so that the high availability of the asynchronous message processing service is ensured, and the expansibility of the message service is improved.
In one embodiment of the present disclosure, in a case where the target transmission channel is a third party push channel, transmitting the target message through the target transmission channel may include: storing the target message into a preset push message table; determining a third party pushing interface corresponding to the target message as a target pushing interface; pushing the target message through the target pushing interface, and updating the pushing state of the target message in the pushing message table according to the pushing result.
As shown in fig. 3a and 3b, the push message unit 3230 of the message service module 3200 may include a push message subunit 3231, a push message table 3232, and a third party push subunit 3233. All messages sent through the push message unit 3230 are recorded in the push message table 3232. Specifically, the messages recorded in the push message table may be all the messages sent by the receiving end 3210 to the push message unit 3230, including synchronous messages sent by the receiving end 3210 directly to the push message unit 3230, and asynchronous messages sent by the receiving end 3210 to the message queue 3240, and then fetched from the message queue 3240 by the consuming end 3250 and sent to the push message unit 3230.
In the push message table, parameter information of each message may also be recorded, and the parameter information of the message may include, for example, a pusher, a receiver, a push time, a push status of the message, a message identifier for uniquely identifying the message, and the like.
In one embodiment, the push status of the message may include not pushed, push success, push failure.
In this embodiment, the third party pushing subunit 3233 may include a plurality of third party pushing interfaces, for example, the plurality of third party pushing interfaces may include a sms pushing interface, a mail pushing interface, an applet pushing interface, a public number pushing interface, an application pushing interface, and the like.
In an embodiment in which the target sending channel is a third party push channel, sending the target message through the target sending channel may be that the receiving end 3210 or the consuming end 3250 sends the target message to the push message subunit 3231, then the push message subunit 3231 stores the target message in the push message table 3232, the third party push subunit 3233 obtains the target message in the push message table 3232, and determines a third party push interface corresponding to the target message, as a target push interface, and pushes the target message through the target push interface.
Specifically, the push message table 3232 may send the target message with the push state being not pushed to the third party push subunit 3233, or the third party push subunit 3233 may search and obtain the target message with the push state being not pushed from the push message table 3232.
After the third party pushing subunit 3233 pushes the target message through the target pushing interface, it may obtain a pushing result of the target message, return the pushing result to the pushing message table, and update the pushing state of the target message according to the pushing result by the pushing message table. Before the third party pushing subunit 3233 pushes the target message through the target pushing interface, in a case where the third party pushing subunit 3233 does not return the pushing result to the pushing message table, the pushing state of the target message in the pushing message table is not pushed. In the case that the pushing result of the target message is that the pushing is successful, the pushing state of the target message in the pushing message table may be updated to be that the pushing is successful. In the case that the pushing result of the target message is that the pushing fails, the pushing state of the target message in the pushing message table may be updated to be that the pushing fails.
In one embodiment of the present disclosure, the method may further comprise: determining a message processing mode of a target message; under the condition that the message processing mode is synchronous message processing, executing the step of pushing the target message through the target pushing interface; and detecting whether a timed push event occurs or not under the condition that the message processing mode is asynchronous message processing, and executing the step of pushing the target message through the target push interface under the condition that the timed push event occurs.
In an embodiment in which the message processing manner of the target message is synchronous message processing, the third party pushing subunit 3233 may obtain the target message in the push message table 3232, determine a third party pushing interface corresponding to the target message, and use the third party pushing interface as the target pushing interface, and push the target message through the target pushing interface.
As shown in fig. 3b, the push message unit 3230 may further include a timing task sub-unit 3234 and a push message post-processing sub-unit 3235.
In an embodiment in which the message processing manner of the target message is asynchronous message processing, the timing task subunit 3234 may detect whether a timing push event occurs, acquire a message with a push state of not pushing and a push failure from the push message table 3232 under the condition that the timing push event occurs, send the message with the push state of not pushing and the push failure to the push message post-processing subunit 3235, send the message with the push state of not pushing and the push failure to the third party push subunit 3233 by the push message post-processing subunit 3235, determine a third party push interface corresponding to each message by the third party push subunit 3233, and push each message with the push state of not pushing and the push failure through the corresponding third party push interface.
In one embodiment, the timed push event may be the attainment of a preset timed push time. The timing push time may be preset according to the application scenario or specific requirements. For example, the timed push time may be an entire point of time of day.
In one embodiment of the present disclosure, the method may further comprise: responding to a message inquiry instruction sent by a service module, acquiring a message in a message table in a station and a message in a push message table, and obtaining a message list; and returning the message list to the business service module.
In this embodiment, any one of the service units 3110 in the service module 3100 may send a message query instruction to the message service module 3200. The receiving end 3210 of the message service module 3200, in response to the message query instruction, sends a first instruction for querying an in-station message table to the in-station message subunit 3221 of the in-station message unit 3220, and sends a second instruction for querying a push message table to the push message subunit 3231 of the push message unit 3230. The intra-station message subunit 3221 acquires the message recorded in the intra-station message table 3222 and returns to the receiving end 3210 in response to the first instruction. The push message subunit 3231, in response to the second instruction, acquires the message recorded in the push message table 3232 and returns to the receiving end 3210. The receiving end 3210 integrates the message recorded in the intra-station message table 3222 returned by the intra-station message subunit 3221 and the message recorded in the push message table 3232 returned by the push message subunit 3231 to obtain a message list, and returns the message list to the service module.
In one example, the receiving end 3210 may integrate the messages according to the sending time to obtain a message list. In this way, all messages in the message list can be arranged according to the sequence of the sending time.
In another example, the receiving end may integrate the messages according to the push state, and then integrate the messages according to the sending time to obtain the message list. In this way, the messages in the message list are firstly arranged according to the push state, and the messages with the same push state can be arranged according to the sequence of the sending time.
By the embodiment, a unified query interface can be provided for the outside, and the complexity and the workload of service system access are reduced.
In one embodiment of the present disclosure, the method may further comprise: responding to a push state query instruction of a target message sent by a service module, and acquiring the push state of the target message through a push message table; and returning the push state of the target message to the business service module.
In this embodiment, the push state query instruction may further include a message identifier of the target message, so that the message service module 3200 queries the push state of the target message according to the message identifier.
Specifically, any one of the service units 3110 in the service module 3100 may send a push status query instruction of the target message to the message service module 3200. The receiving end 3210 of the message service module 3200, in response to the push status query instruction, sends a third instruction for querying the push status of the target message to the push message subunit 3231 of the push message unit 3230. The push message subunit 3231, in response to the third instruction, queries the push state of the target message recorded in the push message table 3232, and returns the queried push state to the receiving end 3210. The receiving end 3210 returns the received push status to the service module.
By the embodiment, a unified query interface can be provided for the outside, and the complexity and the workload of service system access are reduced.
< example 1>
In one example, the service module 3100 triggers the service unit 3110 that sends the event of the target message, where the corresponding message processing mode is synchronous message processing, and the target sending channel of the target message is an in-station sending channel.
Then, as shown in fig. 3a, the receiving end 3210 of the message service module 3200 may be a transmitting instruction for receiving the target message transmitted by the service unit 3110, and determines a target transmission channel of the target message to be an intra-station transmission channel. The receiving end 3210 transmits the target message to the intra-station message subunit 3221 in the intra-station message unit 3220, and the intra-station message subunit 3221 stores the target message in the intra-station message table 3222.
< example 2>
In one example, the service module 3100 triggers the service unit 3110 that sends the event of the target message, where the corresponding message processing manner is synchronous message processing, and the target sending channel of the target message is a third party push channel.
Then, as shown in fig. 3a, the receiving end 3210 of the message service module 3200 may be a sending instruction for receiving the target message sent by the service unit 3110, and determines the target sending channel of the target message to be the third party push channel. The receiving end 3210 sends the target message to the push message subunit 3231 in the push message unit 3230, the push message subunit 3231 stores the target message in the push message table 3232, the third party push subunit 3233 obtains the target message with the push state not pushed in the push message table 3232, determines a third party push interface corresponding to the target message, and uses the third party push interface as the target push interface to push the target message through the target push interface.
< example 3>
In one example, the service module 3100 triggers the service unit 3110 to send the event of the target message, where the corresponding message processing manner is asynchronous message processing, and the target sending channel of the target message is an in-station sending channel.
Then, as shown in fig. 3b, the receiving end 3210 of the message service module 3200 may be a transmitting instruction for receiving the target message transmitted by the service unit 3110, and determines a target transmission channel of the target message to be an intra-station transmission channel. The receiving end 3210 sends the target message to the message queue 3240, and the consuming end 3250 fetches the target message from the message queue 3240 and sends the target message to the intra-station message subunit 3221 in the intra-station message unit 3220, and the intra-station message subunit 3221 stores the target message in the intra-station message table 3222.
< example 4>
In one example, the service module 3100 triggers the service unit 3110 to send the event of the target message, where the corresponding message processing manner is asynchronous message processing, and the target sending channel of the target message is a third party push channel.
Then, as shown in fig. 3b, the receiving end 3210 of the message service module 3200 may be a sending instruction for receiving the target message sent by the service unit 3110, and determines the target sending channel of the target message to be the third party push channel. The receiving end 3210 sends the target message to the message queue 3240, then the consuming end 3250 takes the target message out of the message queue 3240 and sends the target message to the push message subunit 3231 in the push message unit 3230, the push message subunit 3231 stores the target message in the push message table 3232, the timing task subunit 3234 regularly acquires the messages (including the target message) with the push state of not pushing and the push failure from the push message table 3232, sends the messages with the push state of not pushing and the push failure to the push message post-processing subunit 3235, the push message post-processing subunit 3235 sends the messages with the push state of not pushing and the push failure to the third party push subunit 3233, the third party push subunit 3233 determines a third party push interface corresponding to each message, and pushes each message with the push state of not pushing and the push failure through the corresponding third party push interface.
< device example >
In the present embodiment, there is provided a message processing apparatus 4000, as shown in fig. 4, including an event detection module 4100, a channel determination module 4200, and a message transmission module 4300. The event detection module 4100 is configured to detect whether an event of sending a target message occurs; the channel determination module 4200 is configured to determine, as a target transmission channel, a transmission channel of a target message in a case where an event of transmitting the target message occurs; the message transmission module 4300 is configured to transmit the target message through the target transmission channel.
In one embodiment of the present disclosure, the message processing apparatus 4000 may further include:
a module for determining a message handling manner of the target message;
the message sending module 4300 is further configured to perform the step of sending the target message through the target sending channel if the message processing manner is synchronous message processing;
the message sending module 4300 is further configured to send the target message to a message queue, and then take the target message out of the message queue, and execute the step of sending the target message through the target sending channel when the message processing manner is asynchronous message processing.
In one embodiment of the present disclosure, in the case where the target transmission channel is an in-station transmission channel, the message transmission module 4300 is further configured to:
and storing the target message into a preset intra-station message table.
In one embodiment of the present disclosure, in the case where the target transmission channel is a third party push channel, the message transmission module 4300 is further configured to:
storing the target message into a preset push message table;
determining a third party pushing interface corresponding to the target message as a target pushing interface;
pushing the target message through the target pushing interface, and updating the pushing state of the target message in the pushing message table according to a pushing result.
In one embodiment of the present disclosure, the message processing apparatus 4000 may further include:
a module for determining a message handling manner of the target message;
the message sending module 4300 is further configured to perform the step of pushing the target message through the target push interface if the message processing manner is synchronous message processing;
the message sending module 4300 is further configured to detect whether a timed push event occurs when the message processing manner is asynchronous message processing, and execute the step of pushing the target message through the target push interface when the timed push event occurs.
In one embodiment of the present disclosure, the message processing apparatus 4000 may further include:
the module is used for responding to the message inquiry instruction sent by the service module, acquiring a plurality of messages in the message table in the station and the push message table, and obtaining a message list;
and the module is used for returning the message list to the business service module.
In one embodiment of the present disclosure, the message processing apparatus 4000 may further include:
a module for responding to the push state query instruction of the target message sent by the business service module and obtaining the push state of the target message through the push message table;
and the module is used for returning the push state of the target message to the business service module.
It will be appreciated by those skilled in the art that the message processing apparatus 4000 may be implemented in various ways. For example, the message processing apparatus 4000 may be implemented by an instruction configuration processor. For example, the message processing apparatus 4000 may be implemented by storing instructions in a ROM and reading the instructions from the ROM into a programmable device when the device is started. For example, message handling apparatus 4000 may be solidified into a dedicated device (e.g., ASIC). The message processing apparatus 4000 may be divided into units independent of each other or they may be implemented by being combined together. The message processing apparatus 4000 may be implemented by one of the above-described various implementations, or may be implemented by a combination of two or more of the above-described various implementations.
In this embodiment, the message processing apparatus 4000 may have various implementation forms, for example, the message processing apparatus 4000 may be any functional module running in a software product or an application program that provides a message processing service, or a peripheral embedded part, a plug-in part, a patch part, etc. of the software product or the application program, or may be the software product or the application program itself.
< electronic device embodiment >
The embodiment of the disclosure also provides electronic equipment.
In one aspect, as shown in fig. 5, the electronic device 5000 includes a memory 5100 and a processor 5200.
The memory 5100 may be used to store executable computer instructions.
The processor 5200 may be configured to perform a message processing method according to an embodiment of the method of the present disclosure according to control of the executable computer instructions.
The electronic device 5000 may be an electronic device 1000 shown in fig. 1, or may be a device having another hardware configuration, and is not limited thereto. The electronic device 5000 may be, for example, a mobile phone, a portable computer, a tablet computer, a palm top computer, a desktop computer, a computer cluster, etc., which is not limited in this disclosure.
In further embodiments, the electronic device 5000 may include the above message processing apparatus 4000.
In one embodiment, the modules of the above message processing apparatus 4000 may be implemented by the processor 5200 executing computer instructions stored in the memory 5100.
According to the embodiment of the disclosure, under the condition that the occurrence of the event of sending the target message is detected, the target sending channel of the target message is determined, and then the target message is sent through the target sending channel, so that the message sending function can be unified, the problem that each business service unit develops the corresponding message sending function to cause repeated development and operation and maintenance is avoided, the development and operation and maintenance cost can be reduced, and the server resource can be saved. In addition, the interfaces can be pushed uniformly, and the complexity and the workload of accessing the service system are reduced. In addition, the message service can be stripped from the service system for centralized treatment, and the effect of high cohesion and low coupling is realized.
< computer-readable storage Medium embodiment >
In this embodiment, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a message processing method as in any of the embodiments of the present disclosure.
According to the embodiment of the disclosure, under the condition that the occurrence of the event of sending the target message is detected, the target sending channel of the target message is determined, and then the target message is sent through the target sending channel, so that the message sending function can be unified, the problem that each business service unit develops the corresponding message sending function to cause repeated development and operation and maintenance is avoided, the development and operation and maintenance cost can be reduced, and the server resource can be saved. In addition, the interfaces can be pushed uniformly, and the complexity and the workload of accessing the service system are reduced. In addition, the message service can be stripped from the service system for centralized treatment, and the effect of high cohesion and low coupling is realized.
The embodiments described above mainly focus on differences from other embodiments, but it should be clear to a person skilled in the art that the embodiments described above may be used alone or in combination with each other as desired.
The various embodiments in this disclosure are described in a progressive manner, and identical and similar parts of the various embodiments are referred to each other, and each embodiment is mainly described as different from other embodiments, but it should be apparent to those skilled in the art that the above embodiments may be used alone or in combination with each other as desired. In addition, for the device embodiment, since it corresponds to the method embodiment, description is relatively simple, and reference should be made to the description of the corresponding part of the method embodiment for relevant points. The system embodiments described above are merely illustrative, in that the modules illustrated as separate components may or may not be physically separate.
The present disclosure may be an apparatus, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or border servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, pose setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with pose information of computer readable program instructions, which may execute the computer readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvement of the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.

Claims (10)

1. A method of message processing comprising:
detecting whether an event of sending a target message occurs;
under the condition that an event of sending a target message occurs, determining a sending channel of the target message as a target sending channel;
and sending the target message through the target sending channel.
2. The method according to claim 1, wherein the method further comprises:
determining a message processing mode of the target message;
executing the step of transmitting the target message through the target transmission channel under the condition that the message processing mode is synchronous message processing;
And under the condition that the message processing mode is asynchronous message processing, sending the target message to a message queue, then taking the target message out of the message queue, and executing the step of sending the target message through the target sending channel.
3. The method of claim 1, wherein, in the case where the target transmission channel is an in-station transmission channel, the transmitting the target message through the target transmission channel comprises:
and storing the target message into a preset intra-station message table.
4. The method of claim 1, wherein, in the case where the target transmission channel is a third party push channel, the transmitting the target message through the target transmission channel comprises:
storing the target message into a preset push message table;
determining a third party pushing interface corresponding to the target message as a target pushing interface;
pushing the target message through the target pushing interface, and updating the pushing state of the target message in the pushing message table according to a pushing result.
5. The method according to claim 4, wherein the method further comprises:
Determining a message processing mode of the target message;
executing the step of pushing the target message through the target pushing interface under the condition that the message processing mode is synchronous message processing;
and detecting whether a timed push event occurs or not under the condition that the message processing mode is asynchronous message processing, and executing the step of pushing the target message through the target push interface under the condition that the timed push event occurs.
6. The method according to claim 1, wherein the method further comprises:
responding to a message inquiry instruction sent by a service module, acquiring a plurality of messages in a message table in a station and a push message table, and obtaining a message list; the in-station message table is recorded with messages sent through an in-station sending channel, and the push message table is recorded with messages sent through a third-party push channel;
and returning the message list to the business service module.
7. The method according to claim 4, wherein the method further comprises:
responding to a push state query instruction of the target message sent by a business service module, and acquiring the push state of the target message through the push message table;
And returning the push state of the target message to the business service module.
8. A message processing apparatus, comprising:
the event detection module is used for detecting whether an event of sending the target message occurs or not;
the channel determining module is used for determining a sending channel of the target message as a target sending channel under the condition that an event for sending the target message occurs;
and the message sending module is used for sending the target message through the target sending channel.
9. An electronic device comprising the apparatus of claim 8; or alternatively, the process may be performed,
the electronic device comprising a processor and a memory for storing an executable computer program for controlling the processor to perform the method according to any one of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, perform the method of any of claims 1 to 7.
CN202211573294.8A 2022-12-08 2022-12-08 Message processing method and device, electronic equipment and readable storage medium Pending CN116033008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211573294.8A CN116033008A (en) 2022-12-08 2022-12-08 Message processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211573294.8A CN116033008A (en) 2022-12-08 2022-12-08 Message processing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116033008A true CN116033008A (en) 2023-04-28

Family

ID=86090207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211573294.8A Pending CN116033008A (en) 2022-12-08 2022-12-08 Message processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116033008A (en)

Similar Documents

Publication Publication Date Title
KR102148552B1 (en) Providing an unseen message count across devices
US20180160396A1 (en) Message pushing method, client, server and programmable device
CN105183513A (en) Application recommendation method and apparatus
CN111708557B (en) Method, device and storage medium for updating configuration file
CN106293738B (en) Expression image updating method and device
US11178084B2 (en) Systems and methods for including enriched calling information in rich communications services (RCS) messaging
US10530732B2 (en) Method for using a content subscription list and electronic device supporting the same
US20220124483A1 (en) Nomination of a primary cell phone from a pool of cell phones
CN103607431A (en) Mobile terminal resource processing method, apparatus and equipment thereof
WO2016123034A1 (en) Methods and devices for processing information card
CN109391658B (en) Account data synchronization method and equipment, storage medium and terminal thereof
CN110795314B (en) Method and device for detecting slow node and computer readable storage medium
CN110442416B (en) Method, electronic device and computer-readable medium for presenting information
CN112311818B (en) Method, device, terminal and storage medium for downloading applet data packet
CN106339402B (en) Method, device and system for pushing recommended content
CN108848122B (en) Method and equipment for pushing information and showing information
CN111526192A (en) Remote control method and device of terminal, terminal and computer readable storage medium
CN107463419B (en) Application restarting method and device and computer readable storage medium
CN113268179B (en) Session message processing method, device, equipment and storage medium
CN104933085A (en) Electronic book update method, terminal and server
CN112910855B (en) Sample message processing method and device
CN116033008A (en) Message processing method and device, electronic equipment and readable storage medium
CN106209601B (en) State update message pushing method and device
CN109656659B (en) Behavior event processing method and device, electronic equipment and readable storage medium
CN109948012B (en) Serial number generation method and device 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