CN112689005A - Message sending method and device, storage medium and electronic device - Google Patents

Message sending method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112689005A
CN112689005A CN202011522171.2A CN202011522171A CN112689005A CN 112689005 A CN112689005 A CN 112689005A CN 202011522171 A CN202011522171 A CN 202011522171A CN 112689005 A CN112689005 A CN 112689005A
Authority
CN
China
Prior art keywords
message
messages
type
sent
message type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011522171.2A
Other languages
Chinese (zh)
Other versions
CN112689005B (en
Inventor
陈皓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202011522171.2A priority Critical patent/CN112689005B/en
Publication of CN112689005A publication Critical patent/CN112689005A/en
Application granted granted Critical
Publication of CN112689005B publication Critical patent/CN112689005B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a message sending method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring a message to be sent through a target application by the target application; determining the message type of the message in the target application, and assembling the message according to an assembly template corresponding to the message type to obtain an assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages; and sending the assembled message through the target application according to the sending mode corresponding to the message type. By adopting the technical scheme, the problem that different types of messages need to be sent through different applications in the related technology is solved.

Description

Message sending method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a message sending method and apparatus, a storage medium, and an electronic apparatus.
Background
At present, in the prior art, a message system is designed according to self service attributes, an all-around and multi-dimensional unified scheme is not provided, instant messages such as WeChat, short message and mail, timing messages and common messages can be integrated, and a scheme is temporarily built when a certain message type is needed. Moreover, there are many application scenarios of the message, the design in the early stage is particularly important, and the design schemes based on the message are infinite at present, but all are wars of each other, and there is no comprehensive consideration, so that when a new message type is introduced, the system can be redesigned or marginally iterated. In summary, the prior art currently has the following disadvantages: no complete scheme is available for classifying the access messages, which undoubtedly increases risks for the later development of developers; most of the existing message systems are warfare respectively, and instant messages and timing messages are not summarized to the message system.
For the problem that different types of messages need to be sent through different applications in the related art, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a message sending method and device, a storage medium and an electronic device, which aim to solve the problem that different types of messages in the related art need to be sent through different applications.
According to an embodiment of the present invention, there is provided a message sending method, including: acquiring a message to be sent through a target application by the target application; determining the message type of the message in the target application, and assembling the message according to an assembly template corresponding to the message type to obtain an assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages; and sending the assembled message through the target application according to the sending mode corresponding to the message type.
Optionally, determining the message type of the message in the target application includes: acquiring target identification information from the message, wherein the target identification information is used for identifying the message type of the message, and different identification information corresponds to different message types; and determining the message type of the message according to the target identification information.
Optionally, determining the message type of the message in the target application includes: displaying different message types to the target object; and acquiring a confirmation message of the target object, wherein the confirmation message is used for indicating the message type of the message selected by the target object from the different displayed message types.
Optionally, assembling the message according to the assembly template corresponding to the message type to obtain an assembled message, where the assembling includes: acquiring a message format corresponding to an assembly template corresponding to the message type; and assembling the message according to the message format to obtain the assembled message.
Optionally, the sending the assembled message through the target application according to the sending mode corresponding to the message type includes: under the condition that the message type is the message between services, the message between services is sent in a message queue MQ mode; under the condition that the message type is the instant message, the instant message is sent based on a sending mode of a full duplex communication protocol long connection; and sending the timing message by triggering a sending mode of a timing task under the condition that the message type is the timing message.
Optionally, after obtaining the message to be sent through the target application, the method further includes: transcoding the message to obtain a transcoded message; and verifying the transcoded message, wherein the message type of the message is determined in the target application under the condition that the verification is passed, and the message is assembled according to an assembly template corresponding to the message type to obtain the assembled message.
According to another embodiment of the present invention, there is provided a message transmitting apparatus including: the acquisition module is used for acquiring a message to be sent through a target application; a first determining module, configured to determine a message type of the message in the target application, and assemble the message according to an assembly template corresponding to the message type to obtain an assembled message, where the message type at least includes one of: inter-service messages, instant messages, timing messages; and the sending module is used for sending the assembled message through the target application according to the sending mode corresponding to the message type.
Optionally, the apparatus further comprises: a second determining module, configured to obtain target identification information from the message, where the target identification information is used to identify a message type of the message, and different identification information corresponds to different message types; and determining the message type of the message according to the target identification information.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to carry out the steps of any of the above-described method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the message to be sent is obtained through the target application by the target application; determining the message type of the message in the target application, and assembling the message according to an assembly template corresponding to the message type to obtain an assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages; and sending the assembled message through the target application according to the sending mode corresponding to the message type. That is to say, the message type of the message to be sent is determined, the message is assembled according to the assembly template corresponding to the message type, and finally the assembled message is sent through the target application according to the sending mode corresponding to the message type. By adopting the technical scheme, the problem that different types of messages need to be sent through different applications in the related technology is solved. Therefore, different types of messages can be sent through one application, and the life of people is facilitated.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a client of a message sending method according to an embodiment of the present invention;
fig. 2 is a flow chart of a message sending method according to an embodiment of the present invention;
FIG. 3 is a flow diagram of invoking different applications according to an embodiment of the present invention;
FIG. 4 is a flow diagram of message unified entry work according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a message sending method according to an embodiment of the present invention;
fig. 6 is a block diagram (one) of a message transmitting apparatus according to an embodiment of the present invention;
fig. 7 is a block diagram of a message transmitting apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided by the embodiments of the present application may be executed in a client, or similar device. Taking the example of running on the client, fig. 1 is a hardware structure block diagram of the client of a message sending method according to an embodiment of the present invention. As shown in fig. 1, the client may include one or more processors 102 (only one is shown in fig. 1), where the processors 102 may include, but are not limited to, a Microprocessor (MPU) or a Programmable Logic Device (PLD), and a memory 104 for storing data, and in an exemplary embodiment, the client may further include a transmission device 106 for communication function and an input/output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely an illustration and is not intended to limit the structure of the client. For example, the client may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 may be used to store a client program, for example, a software program and a module of application software, such as a computer program corresponding to the message sending method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to clients over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the client. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a message sending method is provided, which is applied to the client, and fig. 2 is a flowchart of a message sending method according to an embodiment of the present invention, where the flowchart includes the following steps:
step S202, obtaining a message to be sent through a target application;
step S204, determining the message type of the message in the target application, and assembling the message according to the assembling template corresponding to the message type to obtain the assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages;
and step S206, sending the assembled message through the target application according to the sending mode corresponding to the message type.
According to the invention, the message to be sent is obtained through the target application by the target application; determining the message type of the message in the target application, and assembling the message according to an assembly template corresponding to the message type to obtain an assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages; and sending the assembled message through the target application according to the sending mode corresponding to the message type. That is to say, the message type of the message to be sent is determined, the message is assembled according to the assembly template corresponding to the message type, and finally the assembled message is sent through the target application according to the sending mode corresponding to the message type. By adopting the technical scheme, the problem that different types of messages need to be sent through different applications in the related technology is solved. Therefore, different types of messages can be sent through one application, and the life of people is facilitated.
It should be noted that the present invention solves the problem that different types of messages need to be sent by different applications. At present, most of the prior arts design a message system according to their own service attributes, and there is no comprehensive and multidimensional unified scheme, and a small part of the prior arts such as aurora push only strives for cross-APP chat, or cannot send different types of messages through one scheme or application. Aurora push is an independent third-party cloud push platform and is dedicated to providing mobile message push application for global mobile application developers. A developer can easily add a Push function to his App only by integrating an aurora Push SDK at a client. However, for example, the aurora pushed by aurora is an address book, and is only dedicated to solving the problem of cross-APP chat. If messages are classified into inter-service messages, instant messages, and timing messages according to types, only instant messages can be transmitted through an aurora, i.e., an address book. The invention can send messages between services, instant messages and timing messages.
There are various embodiments of step S204, one of which is to determine the message type of the message in the target application, including: acquiring target identification information from the message, wherein the target identification information is used for identifying the message type of the message, and different identification information corresponds to different message types; and determining the message type of the message according to the target identification information.
It should be noted that the messages may be classified into inter-service messages, instant messages, and timing messages according to types, where the inter-service messages may be regarded as common messages, and the inter-service messages refer to messages between pure services. After receiving a message to be sent, assembling the message according to an assembly template corresponding to the message type, and determining the message type of the message before obtaining the assembled message. One way to determine the message type of the message is to determine the message type of the message in the target application according to the target identification information, for example, if the message to be sent is a mail, the target identification information of the mail may be a mailbox of a receiver, and if the message to be sent has a mailbox address, the message to be sent may be determined to be a mail. If the message to be sent has the identification information sent at the timing, the message to be sent can be determined to be the timing message, and the application provided by the invention can trigger the timing task to be sent.
It should be noted that, the present invention implements that sending different types of messages is sent by invoking applications or services corresponding to the different types of messages. But the work done by the underlying layers of the application of the invention when invoking the application or service corresponding to different types of messages is not visible to the user. For the user, it is visible that the application of the invention, for the user, is sending different types of messages through the application of the invention.
It should be noted that mail can be divided into service messages, and an online chat tool such as a WeChat is one of instant messages in general, but timing messages can also be sent using WeChat. For example, the following steps are carried out: the WeChat is required to be called to send timing messages, and the target identification information of the messages to be sent includes two information: the identification sent by WeChat, the identification sent at regular time. The message to be sent can be divided into timing messages, the message to be sent triggers a timing task, and the timing task calls a WeChat to send the message to be sent at the timing moment. The message to be sent can be divided into WeChat messages, and the WeChat messages send the message to be sent at the timing moment. The target identification information is used for identifying the message type of the message, different identification information corresponds to different message types, and the message type of the message can be determined through the technical means.
There are various embodiments of step S204, wherein another embodiment is to determine the message type of the message in the target application, and further includes: displaying different message types to the target object; and acquiring a confirmation message of the target object, wherein the confirmation message is used for indicating the message type of the message selected by the target object from the different displayed message types.
It should be noted that, in addition to determining the message type of the message in the target application according to the target identification information, the message type of the message may also be determined by selecting an application of the present invention to display a different message type to the target object. The application of the invention displays different message types to the target object, after the target object selects a certain message type displayed by the application, the application acquires the confirmation message of the target object, and acquires the message type of the message selected by the target object from the displayed different message types from the confirmation message. For example, the following steps are carried out: the target object is also a user, a message to be sent is edited, the application can display message types such as mail, WeChat, QQ, short message, timing task and the like to the user, and the user selects the message type of the message from the different displayed message types, so that the message type of the message can be determined.
In step S204, the message is assembled according to the assembly template corresponding to the message type, and the assembled message is obtained, including: acquiring a message format corresponding to an assembly template corresponding to the message type; and assembling the message according to the message format to obtain the assembled message.
It should be noted that, the message may be divided into a message between services, an instant message, and a timing message according to the type; instant messages can be classified into WeChat messages, QQ messages and the like according to applications; messages between services can be classified into short messages, mails, etc. It should be noted that the type of the message is not fixed, for example, a WeChat is called to send a timing message, and then the WeChat message is a timing message. Different message types correspond to different assembly templates, for example, the assembly templates of instant messages and services are different, and the assembly templates of WeChat messages and QQ messages in the message instant messages are different. It should be noted that the assembly templates corresponding to the message types actually correspond to different formats for different message types, and an assembly template is a format. For example, a WeChat message needs to be sent, a user edits a message to be sent through the application of the present invention, the application determines that the message to be sent is a WeChat message according to the target identification information, or the application of the present invention displays different message types to a target object, and the user selects a WeChat message. The user only needs to edit the WeChat message to be sent in the application, the application calls the WeChat assembly template to obtain the assembled WeChat message, and the application calls the WeChat to send the WeChat message. That is, through the present invention, the user can send the corresponding message without opening different applications, and the user can send different types of messages only by the application of the present invention.
In step S206, the sending the assembled message through the target application according to the sending method corresponding to the message type includes: under the condition that the message type is the message between services, the message between services is sent in a message queue MQ mode; under the condition that the message type is the instant message, the instant message is sent based on a sending mode of a full duplex communication protocol long connection; and sending the timing message by triggering a sending mode of a timing task under the condition that the message type is the timing message.
It should be noted that, when the Message type is an inter-service Message, the inter-service Message is sent in a Message Queue (MQ) manner. The invention recommends using a RocketMQ mode, which is a message middleware with low delay, high reliability, scalability and easy use, is developed by an Ali Bara message middleware team and is applied to a production system in a large scale, thereby meeting the demand of on-line massive message accumulation. Donated to Apache by the end of 2016 and became the Apache top level item. The method carries out sequential consumption, asynchronous consumption, synchronous consumption and the like by utilizing the advantages of MQ (high concurrency and low traffic peak). And sending the instant message based on a sending mode of a full duplex communication protocol long connection under the condition that the message type is the instant message. The invention proposes that the transmission mode of the full duplex communication protocol long connection is the transmission mode of the WebSocket long connection. WebSocket is a protocol for full-duplex communication over a single TCP connection, making data exchange between a client and an applicator simpler, allowing an application to actively push data to the client. In the WebSocket API, the browser and the application only need to complete one handshake, and persistent connection can be directly established between the browser and the application and bidirectional data transmission is carried out. And sending the timing message by triggering a sending mode of a timing task under the condition that the message type is the timing message.
For example, the following steps are carried out: the WeChat is required to be called to send timing messages, and the messages to be sent can be divided into timing messages and WeChat messages. The application of the invention calls a WeChat assembly template to assemble the message to be sent, triggers a timing task while assembling the message to be sent, and calls the WeChat to send the message to be sent at the timing moment. The message to be sent is divided into WeChat messages, the application of the invention calls a WeChat assembly template to assemble the message to be sent, and the WeChat sends the assembled message at the timing moment. It should be noted that after the message is assembled, the message is not sent immediately, but a verification process is performed, for example, the format of the message and the correctness of the template are performed, here, one-step filtering is performed based on a redis cache, and only the message passing the verification process can be sent. Through the technical means, the problem that different types of messages need to be sent through different applications in the related art is solved. Therefore, different types of messages can be sent through one application, and the life of people is facilitated.
In an optional embodiment, after obtaining, by the target application, the message to be sent, the method further includes: transcoding the message to obtain a transcoded message; and verifying the transcoded message, wherein the message type of the message is determined in the target application under the condition that the verification is passed, and the message is assembled according to an assembly template corresponding to the message type to obtain the assembled message.
It should be noted that after the target application acquires the message to be sent, the message needs to be transcoded, and the obtained transcoded message is the message to be sent. The transcoded message needs to be verified, so that errors are avoided when the message is transcoded and errors occur when a user edits the message to be sent. And under the condition that the verification is passed, determining the message type of the message in the target application, and assembling the message according to an assembling template corresponding to the message type to obtain the assembled message.
In order to better understand the above technical solutions, an alternative embodiment of the present invention is further provided for explaining the above technical solutions.
In an alternative embodiment, it is a flowchart of invoking different applications according to an embodiment of the present invention, as shown in fig. 3:
the service system 1, the service system 2 and the service system 3 are three different service systems or service applications, and each service system or service application has its own: a base center, a user center, a transaction center, and a payment application. The business system may provide a message assembly template to the message application basic, where the message assembly template includes a system id (systemid), a message type (messageType), an initialization message flag (messageFlag), and an ext parameter. The message application basic assembles the message through the message assembly template. The messaging application basic also includes different applications: message processing, transaction processing, flow clipping, record store tracking. Different messaging applications may provide different applications. The message application business is directly applied to the user, and the user calls the message application basic through the message application business. The benefit of two messaging applications is that if one of the messaging applications basic fails, the messaging application business can be used instead. Through the technical means, different message applications are called
Fig. 4 is a flow chart of the operation of the message unified entry according to the embodiment of the present invention, as shown in fig. 4:
the invention can send different types of messages by providing an application, and the application realizes that one application sends different types of messages by a message uniform entrance. The message unified entry is an interface of the application of the present invention, and after determining the message type of the message, the application calls different systems or applications through the message unified entry to send the message of the corresponding type. The message unified entry supports application call mail, WeChat, short message, PC terminal and other applications. The application calls the corresponding application by calling a different application. The application comprises the following steps: the method comprises the steps of e-mail docking application, short message docking application, PC docking application, third-party WeChat public number application and other applications. The application is used to implement all functions required for the corresponding application to send messages.
Fig. 5 is a flowchart illustrating a message sending method according to an embodiment of the present invention, as shown in fig. 5:
s502: carrying out message transcoding on the received message;
s504: performing scene verification on the transcoded message, executing S506 if the verification is successful, and finishing message sending if the verification is failed;
s506: message classification, i.e. determining the message type of the message;
s508: assembling a message body, and calling an assembling template corresponding to the message type to assemble the message after determining the message type of the message, wherein the assembled message is the message body;
s510: judging whether the messages are ordinary messages, namely messages among services, if so, sending the messages, if not, judging whether the messages are timing messages, if so, sending the messages, if not, judging the messages to be instant messages, and putting the instant messages into a Websocket queue for sending.
According to the invention, the message to be sent is obtained through the target application by the target application; determining the message type of the message in the target application, and assembling the message according to an assembly template corresponding to the message type to obtain an assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages; and sending the assembled message through the target application according to the sending mode corresponding to the message type. That is to say, the message type of the message to be sent is determined, the message is assembled according to the assembly template corresponding to the message type, and finally the assembled message is sent through the target application according to the sending mode corresponding to the message type. By adopting the technical scheme, the problem that different types of messages need to be sent through different applications in the related technology is solved. Therefore, different types of messages can be sent through one application, and the life of people is facilitated.
In this embodiment, a message sending apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details of which have been already described are omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 6 is a block diagram of a message transmitting apparatus according to another embodiment of the present invention; as shown in fig. 6, includes:
the acquisition module 60: the method comprises the steps of obtaining a message to be sent through a target application;
a first determining module 62, configured to determine a message type of the message in the target application, and assemble the message according to an assembly template corresponding to the message type to obtain an assembled message, where the message type at least includes one of: inter-service messages, instant messages, timing messages;
a sending module 64, configured to send the assembled message through the target application according to the sending manner corresponding to the message type.
According to the invention, the message to be sent is obtained through the target application by the target application; determining the message type of the message in the target application, and assembling the message according to an assembly template corresponding to the message type to obtain an assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages; and sending the assembled message through the target application according to the sending mode corresponding to the message type. That is to say, the message type of the message to be sent is determined, the message is assembled according to the assembly template corresponding to the message type, and finally the assembled message is sent through the target application according to the sending mode corresponding to the message type. By adopting the technical scheme, the problem that different types of messages need to be sent through different applications in the related technology is solved. Therefore, different types of messages can be sent through one application, and the life of people is facilitated.
It should be noted that the present invention solves the problem that different types of messages need to be sent by different applications. At present, most of the prior arts design a message system according to their own service attributes, and there is no comprehensive and multidimensional unified scheme, and a small part of the prior arts such as aurora push only strives for cross-APP chat, or cannot send different types of messages through one scheme or application. Aurora push is an independent third-party cloud push platform and is dedicated to providing mobile message push application for global mobile application developers. A developer can easily add a Push function to his App only by integrating an aurora Push SDK at a client. However, for example, the aurora pushed by aurora is an address book, and is only dedicated to solving the problem of cross-APP chat. If messages are classified into inter-service messages, instant messages, and timing messages according to types, only instant messages can be transmitted through an aurora, i.e., an address book. The invention can send messages between services, instant messages and timing messages.
Fig. 7 is a block diagram (ii) of a message sending apparatus according to an embodiment of the present invention, as shown in fig. 7:
a second determining module 66, configured to obtain target identification information from the message, where the target identification information is used to identify a message type of the message, and different identification information corresponds to different message types; and determining the message type of the message according to the target identification information.
It should be noted that the messages may be classified into inter-service messages, instant messages, and timing messages according to types, where the inter-service messages may be regarded as common messages, and the inter-service messages refer to messages between pure services. After receiving a message to be sent, assembling the message according to an assembly template corresponding to the message type, and determining the message type of the message before obtaining the assembled message. One way to determine the message type of the message is to determine the message type of the message in the target application according to the target identification information, for example, if the message to be sent is a mail, the target identification information of the mail may be a mailbox of a receiver, and if the message to be sent has a mailbox address, the message to be sent may be determined to be a mail. If the message to be sent has the identification information sent at the timing, the message to be sent can be determined to be the timing message, and the application provided by the invention can trigger the timing task to be sent.
It should be noted that mail can be divided into service messages, and an online chat tool such as a WeChat is one of instant messages in general, but timing messages can also be sent using WeChat. For example, the following steps are carried out: the WeChat is required to be called to send timing messages, and the target identification information of the messages to be sent includes two information: the identification sent by WeChat, the identification sent at regular time. The message to be sent can be divided into timing messages, the message to be sent triggers a timing task, and the timing task calls a WeChat to send the message to be sent at the timing moment. The message to be sent can be divided into WeChat messages, and the WeChat messages send the message to be sent at the timing moment. The target identification information is used for identifying the message type of the message, different identification information corresponds to different message types, and the message type of the message can be determined through the technical means.
Optionally, the first determining module 62 is further configured to display different message types to the target object; and acquiring a confirmation message of the target object, wherein the confirmation message is used for indicating the message type of the message selected by the target object from the different displayed message types.
It should be noted that, in addition to determining the message type of the message in the target application according to the target identification information, the message type of the message may also be determined by selecting an application of the present invention to display a different message type to the target object. The application of the invention displays different message types to the target object, after the target object selects a certain message type displayed by the application, the application acquires the confirmation message of the target object, and acquires the message type of the message selected by the target object from the displayed different message types from the confirmation message. For example, the following steps are carried out: the target object is also a user, a message to be sent is edited, the application can display message types such as mail, WeChat, QQ, short message, timing task and the like to the user, and the user selects the message type of the message from the different displayed message types, so that the message type of the message can be determined.
Optionally, the first determining module 62 is further configured to obtain a message format corresponding to the assembly template corresponding to the message type; and assembling the message according to the message format to obtain the assembled message.
It should be noted that, the message may be divided into a message between services, an instant message, and a timing message according to the type; instant messages can be classified into WeChat messages, QQ messages and the like according to applications; messages between services can be classified into short messages, mails, etc. It should be noted that the type of the message is not fixed, for example, a WeChat is called to send a timing message, and then the WeChat message is a timing message. Different message types correspond to different assembly templates, for example, the assembly templates of instant messages and services are different, and the assembly templates of WeChat messages and QQ messages in the message instant messages are different. It should be noted that the assembly templates corresponding to the message types actually correspond to different formats for different message types, and an assembly template is a format. For example, a WeChat message needs to be sent, a user edits a message to be sent through the application of the present invention, the application determines that the message to be sent is a WeChat message according to the target identification information, or the application of the present invention displays different message types to a target object, and the user selects a WeChat message. The user only needs to edit the WeChat message to be sent in the application, the application calls the WeChat assembly template to obtain the assembled WeChat message, and the application calls the WeChat to send the WeChat message. That is, through the present invention, the user can send the corresponding message without opening different applications, and the user can send different types of messages only by the application of the present invention.
Optionally, the sending module 64 is further configured to send the inter-service message in a message queue MQ manner when the message type is the inter-service message; under the condition that the message type is the instant message, the instant message is sent based on a sending mode of a full duplex communication protocol long connection; and sending the timing message by triggering a sending mode of a timing task under the condition that the message type is the timing message.
It should be noted that, when the Message type is an inter-service Message, the inter-service Message is sent in a Message Queue (MQ) manner. The invention recommends using a RocketMQ mode, which is a message middleware with low delay, high reliability, scalability and easy use, is developed by an Ali Bara message middleware team and is applied to a production system in a large scale, thereby meeting the demand of on-line massive message accumulation. Donated to Apache by the end of 2016 and became the Apache top level item. The method carries out sequential consumption, asynchronous consumption, synchronous consumption and the like by utilizing the advantages of MQ (high concurrency and low traffic peak). And sending the instant message based on a sending mode of a full duplex communication protocol long connection under the condition that the message type is the instant message. The invention proposes that the transmission mode of the full duplex communication protocol long connection is the transmission mode of the WebSocket long connection. WebSocket is a protocol for full-duplex communication over a single TCP connection, making data exchange between a client and an applicator simpler, allowing an application to actively push data to the client. In the WebSocket API, the browser and the application only need to complete one handshake, and persistent connection can be directly established between the browser and the application and bidirectional data transmission is carried out. And sending the timing message by triggering a sending mode of a timing task under the condition that the message type is the timing message.
For example, the following steps are carried out: the WeChat is required to be called to send timing messages, and the messages to be sent can be divided into timing messages and WeChat messages. The application of the invention calls a WeChat assembly template to assemble the message to be sent, triggers a timing task while assembling the message to be sent, and calls the WeChat to send the message to be sent at the timing moment. The message to be sent is divided into WeChat messages, the application of the invention calls a WeChat assembly template to assemble the message to be sent, and the WeChat sends the assembled message at the timing moment. It should be noted that after the message is assembled, the message is not sent immediately, but a verification process is performed, for example, the format of the message and the correctness of the template are performed, here, one-step filtering is performed based on a redis cache, and only the message passing the verification process can be sent. Through the technical means, the problem that different types of messages need to be sent through different applications in the related art is solved. Therefore, different types of messages can be sent through one application, and the life of people is facilitated.
Optionally, the obtaining module 60 is further configured to transcode the message to obtain a transcoded message; and verifying the transcoded message, wherein the message type of the message is determined in the target application under the condition that the verification is passed, and the message is assembled according to an assembly template corresponding to the message type to obtain the assembled message.
It should be noted that after the target application acquires the message to be sent, the message needs to be transcoded, and the obtained transcoded message is the message to be sent. The transcoded message needs to be verified, so that errors are avoided when the message is transcoded and errors occur when a user edits the message to be sent. And under the condition that the verification is passed, determining the message type of the message in the target application, and assembling the message according to an assembling template corresponding to the message type to obtain the assembled message.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a message to be sent through a target application;
s2, determining the message type of the message in the target application, and assembling the message according to the assembling template corresponding to the message type to obtain the assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages;
s3, the assembled message is sent through the target application according to the sending mode corresponding to the message type.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a message to be sent through a target application;
s2, determining the message type of the message in the target application, and assembling the message according to the assembling template corresponding to the message type to obtain the assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages;
s3, the assembled message is sent through the target application according to the sending mode corresponding to the message type.
Optionally, in this option, the specific examples in this embodiment may refer to the examples described in the foregoing embodiment and optional implementation, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for sending a message, comprising:
acquiring a message to be sent through a target application by the target application;
determining the message type of the message in the target application, and assembling the message according to an assembly template corresponding to the message type to obtain an assembled message, wherein the message type at least comprises one of the following types: inter-service messages, instant messages, timing messages;
and sending the assembled message through the target application according to the sending mode corresponding to the message type.
2. The method of claim 1, wherein determining the message type of the message in the target application comprises:
acquiring target identification information from the message, wherein the target identification information is used for identifying the message type of the message, and different identification information corresponds to different message types;
and determining the message type of the message according to the target identification information.
3. The method of claim 1, wherein determining the message type of the message in the target application comprises:
displaying different message types to the target object;
and acquiring a confirmation message of the target object, wherein the confirmation message is used for indicating the message type of the message selected by the target object from the different displayed message types.
4. The method of claim 1, wherein assembling the message according to the assembly template corresponding to the message type to obtain an assembled message comprises:
acquiring a message format corresponding to an assembly template corresponding to the message type;
and assembling the message according to the message format to obtain the assembled message.
5. The method of claim 1, wherein sending the assembled message through the target application according to the sending method corresponding to the message type comprises:
under the condition that the message type is the message between services, the message between services is sent in a message queue MQ mode;
under the condition that the message type is the instant message, the instant message is sent based on a sending mode of a full duplex communication protocol long connection;
and sending the timing message by triggering a sending mode of a timing task under the condition that the message type is the timing message.
6. The method of claim 2, wherein after the target application obtains the message to be sent through the target application, the method further comprises:
transcoding the message to obtain a transcoded message;
and checking the transcoded message, wherein under the condition that the checking is passed, the message type of the message is determined in the target application, and the message is assembled according to an assembly template corresponding to the message type to obtain the assembled message.
7. A message transmission apparatus, comprising:
the acquisition module is used for acquiring a message to be sent through a target application;
a first determining module, configured to determine a message type of the message in the target application, and assemble the message according to an assembly template corresponding to the message type to obtain an assembled message, where the message type at least includes one of: inter-service messages, instant messages, timing messages;
and the sending module is used for sending the assembled message through the target application according to the sending mode corresponding to the message type.
8. The apparatus of claim 7, further comprising:
a second determining module, configured to obtain target identification information from the message, where the target identification information is used to identify a message type of the message, and different identification information corresponds to different message types; and determining the message type of the message according to the target identification information.
9. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the method of any one of claims 1 to 6.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 6 by means of the computer program.
CN202011522171.2A 2020-12-21 2020-12-21 Message sending method and device, storage medium and electronic device Active CN112689005B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011522171.2A CN112689005B (en) 2020-12-21 2020-12-21 Message sending method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011522171.2A CN112689005B (en) 2020-12-21 2020-12-21 Message sending method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112689005A true CN112689005A (en) 2021-04-20
CN112689005B CN112689005B (en) 2023-04-07

Family

ID=75450149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011522171.2A Active CN112689005B (en) 2020-12-21 2020-12-21 Message sending method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112689005B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113794620A (en) * 2021-07-27 2021-12-14 奇安信科技集团股份有限公司 Message sending method, device, equipment, system and storage medium
CN114221883A (en) * 2021-12-14 2022-03-22 平安壹钱包电子商务有限公司 Message testing method, device, server and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107645524A (en) * 2016-07-21 2018-01-30 腾讯科技(深圳)有限公司 A kind of message push processing method and device
CN110601952A (en) * 2018-06-12 2019-12-20 北京京东尚科信息技术有限公司 Multi-channel message notification sending method and device
CN110855548A (en) * 2019-10-18 2020-02-28 深圳前海微众银行股份有限公司 Message pushing method and device
CN111027298A (en) * 2019-05-31 2020-04-17 珠海随变科技有限公司 Message sending method, system, computer device and storage medium
CN111949177A (en) * 2020-08-11 2020-11-17 深圳传音控股股份有限公司 Information transmission method, terminal device, and computer-readable storage medium
CN112039754A (en) * 2020-09-09 2020-12-04 武汉悦学帮网络技术有限公司 Message processing system, method, sending method, device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107645524A (en) * 2016-07-21 2018-01-30 腾讯科技(深圳)有限公司 A kind of message push processing method and device
CN110601952A (en) * 2018-06-12 2019-12-20 北京京东尚科信息技术有限公司 Multi-channel message notification sending method and device
CN111027298A (en) * 2019-05-31 2020-04-17 珠海随变科技有限公司 Message sending method, system, computer device and storage medium
CN110855548A (en) * 2019-10-18 2020-02-28 深圳前海微众银行股份有限公司 Message pushing method and device
CN111949177A (en) * 2020-08-11 2020-11-17 深圳传音控股股份有限公司 Information transmission method, terminal device, and computer-readable storage medium
CN112039754A (en) * 2020-09-09 2020-12-04 武汉悦学帮网络技术有限公司 Message processing system, method, sending method, device and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113794620A (en) * 2021-07-27 2021-12-14 奇安信科技集团股份有限公司 Message sending method, device, equipment, system and storage medium
CN113794620B (en) * 2021-07-27 2023-07-25 奇安信科技集团股份有限公司 Message sending method, device, equipment, system and storage medium
CN114221883A (en) * 2021-12-14 2022-03-22 平安壹钱包电子商务有限公司 Message testing method, device, server and storage medium

Also Published As

Publication number Publication date
CN112689005B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US11088975B2 (en) Systems and methods for coordinating real-time messaging for data sharing and updating between participants using disparate message data formats
US7801941B2 (en) Apparatus and method for exchanging data between two devices
US8495249B2 (en) Providing sync notifications to client devices
CN1788474B (en) Method, device and system for processing message addressed to client terminal
CN102958008B (en) Method, system and mobile terminals for realizing instant messaging
CN103069755B (en) Use the method and system that the instant message of multiple client instance transmits
CN112689005B (en) Message sending method and device, storage medium and electronic device
EP1659820A2 (en) Short message service (sms) remote control system and method
CA2782462C (en) Reliable delivery of content to a push-state aware client device
US7801959B1 (en) Method and system for pushing electronic messages to a wireless portable device using a standard mail server interface
CN103024698A (en) Mobile terminal and method and system for integrating information of linkmen
KR100738040B1 (en) Method for providing application Program Interface in open mobile business supporting system
US7010790B2 (en) Modular method and device for the tracing of a multimedia message through a telecommunications network
US8285856B1 (en) Methods and systems for integrating a messaging service with an application
KR100620331B1 (en) Mms transfer process test system including mms monitoring device for tracing and display mms transfer process, and test method transfer process using the same
CN114022278B (en) Analog transaction processing method and device
CN112866268B (en) Message processing method and system
EP2490467A1 (en) Method and arrangement for registering a user
EP2330793A1 (en) System and Method for Centrally Distributing Mobile Content
CN113672488A (en) Log text processing method and device
US11470031B2 (en) Electronic mail format protocol for instructing automatic behavior of electronic devices executing an electronic mail client application
CN115474071B (en) Content display method, device, equipment and storage medium
CN115632994A (en) Message processing method and device, electronic equipment and computer readable medium
CN113780614A (en) Risk identification method and device
CN115934830A (en) Data synchronization method and device, storage medium and electronic device

Legal Events

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