Multi-channel communication protocol unification method and systemTechnical Field
The invention relates to the technical field of communication, in particular to a method and a system for unifying multi-channel communication protocols.
Background
There are many channels of messages on the market today, for example: short messages, mails, weChats (public numbers, applets), aurora and the like, and each message channel is different in platform or corresponding account number main body, so that communication protocols are different and complex, and are difficult to unify. In the prior art, communication of different channels adopts APIs (application program interfaces) provided by different platforms, and when a plurality of message channels need to be called in a system, communication is required to be carried out through different agreements, so that agreements for interfacing the different message channels are required, and the user experience is poor.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a multi-channel communication protocol unification method with high feasibility and strong applicability.
In order to solve the above problems, the present invention provides a unified method of multi-channel communication protocol, comprising the steps of:
A. the client selects a channel corresponding to the message and a platform or account body corresponding to the channel;
B. the client acquires different extension attribute generators through different message channel attributes, and adds the extension attributes into a message extension module;
C. the client assembles the extension attribute, the message channel definition attribute and the general message attribute through a message protocol generator to generate a unified communication protocol;
D. the message center acquires the unified communication protocol and analyzes the message channel attribute through a message protocol analyzer;
E. the message center selects a corresponding extended attribute analyzer to analyze the corresponding attribute through the message channel attribute;
F. the message center generates message attributes corresponding to the message channels and invokes logic processing of the corresponding channels.
As a further development of the invention, step a is preceded by the step of: the same message channel attribute is configured for the client and the message center.
As a further improvement of the invention, the generic message attributes include the content of the message, the sender and receiver of the message, the title of the message, the content of the message.
As a further improvement of the invention, the message channel comprises a short message and a mail.
The invention also provides a system for unifying the multi-channel communication protocols, which comprises:
the client is used for selecting a channel corresponding to the message and a platform or account body corresponding to the channel; acquiring different extension attribute generators through different message channel attributes, and adding the extension attributes into a message extension module; the extended attribute, the message channel definition attribute and the general message attribute are assembled through a message protocol generator to generate a unified communication protocol;
the message center is used for acquiring the unified communication protocol and analyzing the message channel attribute through the message protocol analyzer; selecting a corresponding extended attribute analyzer to analyze the corresponding attribute through the message channel attribute; and generating message attributes of the corresponding message channels and calling logic processing of the corresponding channels.
As a further improvement of the invention, the method also comprises a message channel attribute configuration module which is used for configuring the same message channel attribute for the client and the message center.
As a further improvement of the invention, the generic message attributes include the content of the message, the sender and receiver of the message, the title of the message, the content of the message.
As a further improvement of the invention, the message channel comprises a short message and a mail.
The invention has the beneficial effects that:
the unified method and the unified system for the multi-channel communication protocol have high feasibility and strong applicability, so that the system for sending the message is decoupled from a third party message channel, the problem of integration of the third party message is solved, and the difficulty of message integration and use is greatly reduced.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention, as well as the preferred embodiments thereof, together with the following detailed description of the invention, given by way of illustration only, together with the accompanying drawings.
Drawings
FIG. 1 is a schematic diagram of a protocol in a preferred embodiment of the present invention;
FIG. 2 is a schematic diagram of a generator and parser in a preferred embodiment of the present invention;
fig. 3 is a schematic diagram of a unified approach to a multi-channel communication protocol in a preferred embodiment of the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and specific examples, which are not intended to be limiting, so that those skilled in the art will better understand the invention and practice it.
The present invention adopts a unified communication protocol, as shown in fig. 1, and in this embodiment, the protocol is divided into a message object definition module, a message general module and a message extension module,
the message object definition module: the message channel of the message is mainly distinguished, and a platform or an account body corresponding to the channel is mainly distinguished. The attributes common to all message channels are shown in table 1.
TABLE 1
The message universal module: mainly the content of the message and the transmission object and reception object of the message are defined as shown in table 2.
| templateCode | Defining message templates, the templates being managed by Unified Message Service (UMS) |
| from | Message sender |
| to | Message receiver |
| title | Header of message |
| content | Message content |
TABLE 2
The message expansion module: the method mainly aims at supporting attributes in cooperation with different message channels. The generation and analysis of the expansion module are completed by the corresponding generator and analyzer, and referring to fig. 2, user customization is not required.
Referring to fig. 2, the message channel attribute is configured as an integrated third party message channel definition and corresponding account password attribute, and the client and the message center are configured by using the same set of attribute. The message protocol generator is a processor that generates a unified message protocol. The message protocol parser is a processor that parses a unified message protocol. The message protocol parser and generator each attribute corresponds to an attribute in the unified message protocol. The message channel extension attribute generator is different from other attribute processors in the general attribute, each channel has a corresponding processor, and the processors add different attributes to the extension attribute. If the alicloud short message processor adds the signature of the extended attribute SignName to the extended attribute object extds. The message channel extended attribute parser functions in opposition to the extended attribute generator, extracts and assembles extended attributes into message attributes for the corresponding message channel.
Referring to fig. 3, the unified method of the multi-channel communication protocol in the preferred embodiment of the present invention comprises the following steps:
A. the client selects a channel corresponding to the message and a platform or account body corresponding to the channel;
B. the client acquires different extension attribute generators through different message channel attributes, and adds the extension attributes into a message extension module;
C. the client assembles the extension attribute, the message channel definition attribute and the general message attribute through a message protocol generator to generate a unified communication protocol;
D. a message center (UMS) acquires the unified communication protocol, and analyzes the message channel attribute through a message protocol analyzer;
E. the message center selects a corresponding extended attribute analyzer to analyze the corresponding attribute through the message channel attribute;
F. the message center generates message attributes corresponding to the message channels and invokes logic processing of the corresponding channels.
Wherein, the step A further comprises the following steps: the same message channel attribute is configured for the client and the message center. The general message attributes include the content of the message, the sender and receiver of the message, the title of the message, the content of the message, etc. The message channel comprises short messages, mails and the like.
The preferred embodiment of the invention also discloses a multi-channel communication protocol unification system, which comprises:
the client is used for selecting a channel corresponding to the message and a platform or account body corresponding to the channel; acquiring different extension attribute generators through different message channel attributes, and adding the extension attributes into a message extension module; the extended attribute, the message channel definition attribute and the general message attribute are assembled through a message protocol generator to generate a unified communication protocol;
the message center is used for acquiring the unified communication protocol and analyzing the message channel attribute through the message protocol analyzer; selecting a corresponding extended attribute analyzer to analyze the corresponding attribute through the message channel attribute; and generating message attributes of the corresponding message channels and calling logic processing of the corresponding channels.
The system also comprises a message channel attribute configuration module which is used for configuring the same message channel attribute for the client and the message center. The general message attributes include the content of the message, the sender and receiver of the message, the title of the message, the content of the message, etc. The message channel comprises short messages, mails and the like.
The unified method and the unified system for the multi-channel communication protocol have high feasibility and strong applicability, so that the system for sending the message is decoupled from a third party message channel, the problem of integration of the third party message is solved, and the difficulty of message integration and use is greatly reduced.
The above embodiments are merely preferred embodiments for fully explaining the present invention, and the scope of the present invention is not limited thereto. Equivalent substitutions and modifications will occur to those skilled in the art based on the present invention, and are intended to be within the scope of the present invention. The protection scope of the invention is subject to the claims.