CN112565059B - Message transmission method and system based on instant messaging private cloud architecture - Google Patents

Message transmission method and system based on instant messaging private cloud architecture Download PDF

Info

Publication number
CN112565059B
CN112565059B CN202011395579.8A CN202011395579A CN112565059B CN 112565059 B CN112565059 B CN 112565059B CN 202011395579 A CN202011395579 A CN 202011395579A CN 112565059 B CN112565059 B CN 112565059B
Authority
CN
China
Prior art keywords
message
client
server
service
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.)
Active
Application number
CN202011395579.8A
Other languages
Chinese (zh)
Other versions
CN112565059A (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.)
CCI China Co Ltd
Original Assignee
CCI China 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 CCI China Co Ltd filed Critical CCI China Co Ltd
Priority to CN202011395579.8A priority Critical patent/CN112565059B/en
Publication of CN112565059A publication Critical patent/CN112565059A/en
Application granted granted Critical
Publication of CN112565059B publication Critical patent/CN112565059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/06Message adaptation to terminal or network requirements
    • H04L51/066Format adaptation, e.g. format conversion or compression
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Abstract

The application relates to a message transmission method and a system based on an instant messaging private cloud architecture, wherein the method comprises the steps of sending a connection request, verifying the connection request by a WS server, and if the connection request passes the verification, establishing bidirectional connection between a first client and a service server; acquiring and processing a service request sent by the first client, adding a filling type and a receiver as a UDP DATA Frame message in the connection request after processing, and sending the UDP DATA Frame message to the WS server; and converting the UDP DATA Frame Message into a Message and sending the Message to a second client in the receiver after judging that the received UDP DATA Frame Message is a client Message according to the filling type, wherein the Message is decoded by the second client to obtain an IMmessage. By decoupling the WS server from the service server and the message storage service, the expansibility of the system is improved, the content of the release and deployment process is simplified, the deployment efficiency is improved, the service upgrade and the hot release are facilitated, and the stability of the system is ensured.

Description

Message transmission method and system based on instant messaging private cloud architecture
Technical Field
The application relates to the field of application of an instant messaging private cloud, in particular to a message transmission method and system based on an instant messaging private cloud architecture.
Background
WebSocket is a protocol originally provided by HTML5 for full duplex communication over a single TCP connection.
The WebSocket allows the server to actively push data to the client, so that data exchange between the client and the server becomes simpler. In the WebSocket API, the browser and the server only need to complete one handshake, and persistent connection can be directly established between the browser and the server, and bidirectional data transmission is carried out. The WebSocket has the characteristics that: (1) the method is established on a TCP protocol, and the realization of a server side is easier. (2) Has good compatibility with HTTP protocol. The default ports are also 80 and 443 and the handshake phase uses HTTP protocol, so it is not easy to mask the handshake and can go through various HTTP proxy servers. (3) The data format is light, the performance cost is low, and the communication is efficient. (4) Text may be transmitted, as well as binary data. (5) Without a homology limitation, a client may communicate with any server. (6) The protocol identifier is WS (WSS if encrypted) and the server site is a URL.
Currently, in order to realize a push technology, the technology used by many websites is Ajax polling. Polling is the HTTP request by the browser to the server at specific intervals, and then the server returns the latest data to the browser on the client. This conventional model brings with it obvious disadvantages that the browser needs to send requests to the server continuously, however, HTTP requests may contain a long header, where the really valid data may be only a small part, which obviously wastes much resources such as bandwidth.
Therefore, the WebSocket protocol can better save server resources and bandwidth, and can carry out communication in real time.
The existing instant messaging services are generally cloud services provided by service providers, only some private cloud service cluster deployment schemes are too complex, auxiliary services such as a service registration center and the like are needed, and the implementation is complicated and the workload is large; in the aspect of architecture, the WS server is tightly coupled with the service server and the message storage service, which is not beneficial to service upgrade and hot release, and the upgrade and deployment of the service server can cause the WS server to suspend service; therefore, a cluster scheme with a simplified architecture, a service splitting scheme with low coupling, and an extensible and friendly message protocol matched with the cluster scheme and the service splitting scheme are needed to at least solve the problems that the deployment coupling of an instant messaging private cloud architecture is tight, and service upgrading and hot release are not facilitated in the related art.
Disclosure of Invention
The embodiment of the application provides a message transmission method and system based on an instant messaging private cloud architecture, and aims to at least solve the problems that the instant messaging private cloud architecture in the related technology is relatively tightly coupled in deployment and is not beneficial to service upgrading and hot release.
In a first aspect, an embodiment of the present application provides a message transmission method based on an instant messaging private cloud architecture, where the method includes the following steps: sending a connection request, wherein the connection request is verified by a WS server, and if the connection request passes the verification, establishing the bidirectional connection between a first client and a service server; acquiring and processing a service request sent by the first client, adding a filling type and a receiver as a UDP DATA Frame message in the connection request after processing, and sending the UDP DATA Frame message to the WS server, wherein the receiver comprises at least one second client which is used for receiving the message sent by the first client; and after judging that the received UDP DATA Frame Message is a client Message according to the filling type, converting the UDP DATA Frame Message into a Message and sending the Message to the second client, wherein the Message is decoded by the second client to obtain an IMmessage.
In some embodiments, sending a connection request, where the connection request is verified by the WS server, and if the connection request passes the verification, establishing a bidirectional connection between the first client and the service server includes: sending a connection request, wherein the connection request comprises an application identifier, a user identifier, an authentication token and a timestamp; according to the application identifier and the user identifier, the authentication token verifies whether the first client is legal or not and verifies the timeliness of the connection request through the timestamp; and if the verification is passed, establishing the bidirectional connection between the first client and the service server.
In some embodiments, before the connection request is a bidirectional connection, the service server verifies identity information of the first client and sends the identity information to the first client, where the identity information includes a user name and a password of the first client.
In some embodiments, the UDP DATA Frame Message further includes a Message version, a flag, and a number of recipients, where the application identifier, the recipients, the padding type, the Message version, the flag, and the number of recipients form a Message header of the UDP DATA Frame Message, the Message version is used to determine a Message structure of the UDP DATA Frame Message, and the UDP DATA Frame Message is parsed into the Message according to the Message structure.
In some embodiments, the IMMessage message includes one or more of sender, type, recipient, media type, content, thumbnail, attachment storage address, remark information, metering information, extension information.
In some of these embodiments, the method further comprises: and according to the filling type, sending a message storage instruction to the message storage service after judging that the received UDP DATA Frame message is a service end message.
In some of these embodiments, the method further comprises: and receiving and processing a file storage request, and sending an attachment storage address to the service server after successful storage, wherein the attachment storage address is returned to the first client by the service server.
In some embodiments, the media types include at least message media and attachment media, and the other server receives the attachment media and calls an attachment stored in the file service through the attachment storage address.
In some embodiments, the media types include one or more of unknown type, text type, expression type, picture type, voice type, video type, file type, geographical location type, news type, friend recommendation type, link type, red packet type, and command push type.
In a second aspect, an embodiment of the present application provides a message transmission system based on an instant messaging private cloud architecture, including a first client, a WS server, and a service server; the first client is used for sending a connection request, the connection request is verified by the WS server, and if the connection request passes the verification, the bidirectional connection between the first client and the service server is established; the service server is used for acquiring and processing the service request sent by the first client, adding a filling type and a receiver as a UDP DATA Frame message into the connection request after processing, and sending the UDP DATA Frame message to the WS server; and the WS server is used for converting the UDP DATA Frame Message into a Message and sending the Message to the second client after judging that the received UDP DATA Frame Message is the client Message according to the filling type, and the Message is decoded by the second client to obtain the IMmessage Message.
In some embodiments, the message transmission system further comprises a message storage service for acquiring and storing the server-side message of the WS server; the file service is used for acquiring a request for storing the attachment sent by the service server, and returning the address of the attachment to the service server after the attachment is successfully stored; a gateway layer, configured to forward messages between the first client and the service server, the message storage service, the WS server, and the file service.
In a third aspect, an embodiment of the present application provides an electronic apparatus, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the message transmission method based on the instant messaging private cloud architecture according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, where the program, when executed by a processor, implements the message transmission method based on the instant messaging private cloud architecture according to the first aspect.
Compared with the related art, the message transmission method and system based on the instant messaging private cloud architecture provided by the embodiment of the application solve the problems that the instant messaging private cloud architecture in the related art is relatively tightly coupled in deployment and is not beneficial to service upgrading and hot release. In order to facilitate rapid privatization deployment and reduce coupling of a WS server and a service server, the service is divided into the service server and the WS server, the service server broadcasts a UDP DATA Frame message to the WS server, and the message is determined to be a server side message or a client side message through a padding field in the UDP DATA Frame message; the WS server forwards the client message to a second client in the receiver, and the WS server and the service server are decoupled, so that the expansibility of the system is improved, the content of a release and deployment process is simplified, the deployment efficiency is improved, the service upgrade and the hot release are facilitated, and the stability of the system is ensured.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more concise and understandable description of the application, and features, objects, and advantages of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram of a message transmission method based on an instant messaging private cloud architecture according to an embodiment of the present application;
fig. 2 is an architecture diagram of a messaging system based on an instant messaging private cloud architecture according to an embodiment of the present application;
FIG. 3 is a flow chart of a server, a business server, a WS server communication according to an embodiment of the application;
FIG. 4 is a message structure diagram according to an embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
The embodiment provides a message transmission method based on an instant messaging private cloud architecture, and the flow of the method is shown in fig. 1, and the method comprises the following steps:
step 101, sending a connection request, the connection request being verified by the WS server, and if the verification is passed, establishing a bidirectional connection with the service server.
In this implementation, referring to step 3 in fig. 3, the first client sends a connection request to the WS server, where the connection request is sent to the first client after the service server verifies the identity of the first client, and is forwarded by the first client to the WS server for authentication.
Specifically, before the connection request is a bidirectional connection, the service server verifies the identity information of the first client and sends the identity information to the client, wherein the identity information includes a user name and a password of the first client. The first client sends information such as a user name and a password to the service server, the service server receives the information such as the user name and the password and verifies the information, if the information passes the verification, the information is returned to the client connection request, and the client carries the connection request to send a message for requesting connection to the WS server.
In some embodiments, step 101 specifically includes: sending a connection request, wherein the connection request comprises an application identifier, a user identifier, an authentication token and a timestamp; according to the application identifier and the user identifier, the authentication token verifies whether the first client is legal or not and verifies the timeliness of the connection request through the timestamp; and if the verification is passed, establishing the bidirectional connection with the service server.
In this embodiment, the service server verifies the identity of the first client, and if the verification is successful, the application identifier, the user identifier, the authentication token, and the timestamp are encrypted and then sent to the first client, and the first client forwards the application identifier, the user identifier, and the authentication token to the WS server, and the WS server checks the first client. Specifically, the application identifier is an application identity ID, the user identifier is an identity ID of a user, the application identity ID and the user identity ID have an effect of uniquely identifying the application and the user, the same application ID represents the same application, the same identity ID is regarded as the same user, the authentication token is a token which is issued by the service server to a specific user and is valid within a certain time range and can use authentication of the WS server, and the WS server verifies whether the first client is legal or not according to the application identifier, the user identifier and the authentication token, and verifies timeliness of the connection request through the timestamp.
In step 101, referring to step 1 to step 3 in fig. 3, the present invention solves the problem that the existing private cloud architecture is coupled more tightly, which is not favorable for service upgrade and hot release, by splitting the service into the service server and the WS server. After splitting, the identity of the first client needs to be verified whether to be valid or not through authentication of the service server and the WS server. Specifically, a first client sends information such as a user name and a password to a service server, the service server returns an application identifier, a user identifier, an authentication token and a timestamp to the client after verification, the client carries the connection request to send a connection request message to the WS server, the WS server verifies whether the first client is legal according to the connection request and checks timeliness of the connection request, if the verification is passed, service data interaction is carried out with the first client through the WS server, and if the verification is not passed, service data interaction with the first client is rejected.
Step 102, acquiring and processing a service request sent by a first client, adding a filling type and a receiver as a UDP DATA Frame message in the connection request after processing, and sending the UDP DATA Frame message to a WS server, wherein the receiver comprises at least one second client, and the second client is used for receiving the message sent by the first client.
In this embodiment, if the verification fails, the WS server rejects the service data interaction with the first client, and if the verification passes, referring to step 4 in fig. 3, the WS server returns a status code prompt to the service server: the first client is successfully connected. Indicating that the service server can continue to send the associated service message. Referring to step 5 in fig. 3, the first client sends a service request to the service server through an http protocol, the service server sends a UDP DATA Frame message to the WS server after receiving the service request, the WS server determines which clients the service server is to send the http message to through the receiver, and obtains which applications the client is to access from the application identifier.
In this embodiment, Padding (Padding type) is used to distinguish the type of the message, for example, 0 is a client message, the WS server receives the type of message and correspondingly forwards the message through the websocket protocol, and if the Padding value is 1, the WS server is a server message and is generally used to convey an instruction of the service server. The Padding field may also be extended by setting other values. The method can expand the message type by using padding of the UDP message header for communication between services, and achieves the purposes of reducing the volume of the sent message, saving network resources and efficiently transmitting the message.
In one embodiment, the UDP DATA Frame message further comprises a message version, a flag, a number of recipients, wherein the application identification, the recipients, the padding type, the message version, the flag, the number of recipients constitute a message header of the UDP DATA Frame.
In this embodiment, a Version field (message Version) of a message header of an inter-service communication UDP protocol is used to determine a message type, specifically, Version is used to distinguish message versions, messages of different versions may have different message structures, and after the Version is determined by Version, messages may be correctly analyzed by different methods.
In this embodiment, Mark (tag) using the UDP header is mainly used when padding has a value of 1, i.e., a server message. Illustratively, the flag is a child message or a message fragment transmission when a message has a parent-child relationship, a flag is a fragmented message and whether it is an end state.
In this embodiment, Num (number of receivers) of the UDP header is used for mainly obtaining the number of receivers, and the data length of the Receiver is determined by the number.
In step 102, the invention provides an inter-service communication Message protocol convenient for expansion on the basis of splitting a service server and a WS server, wherein version and padding are set in a UDP DATA Frame Message in the Message protocol to improve the expansibility, reduce the Message volume and save the bandwidth, the WS server forwards a Message to a second client included in a receiver after judging that the Message is a client Message through the UDP DATA Frame Message, and the WS server sends a Message storage instruction to a Message storage service after judging that the Message is a server Message. The UDP DATA Frame message is set, so that the transmission flow and content of the message are simplified, and the deployment efficiency is improved.
And 103, after judging that the received UDP DATA Frame Message is the client Message according to the filling type, converting the UDP DATA Frame Message into a Message and sending the Message to the second client, wherein the Message is decoded by the second client to obtain the IMmessage.
In this embodiment, referring to step 7 in fig. 3, the WS server sends a binary body (Message) to the second client of the receiver after determining that the WS server is the client Message through the padding field, and the Message is decoded by the second client through the jssdkmaddress.
In some embodiments, the IMMessage includes one or more of a sender, a type, a recipient, a media type, content, a thumbnail, an attachment storage address, remark information, metering information, extended information.
In this embodiment, the sender may be represented by sender; representing type by type, wherein the type value of 1 represents single chat, and the type value of 2 represents group chat; media types are expressed through mediacodes, and communication services are provided for different service scenes according to different media types; and representing a receiver through the receiver, wherein the receiver comprises one or more second clients, and the second clients are receiving objects for sending messages to the first client. Illustratively, in one embodiment, the first client is client a and the second client is client B, and in another embodiment, the first client is client a and the second client is client B, client C or client D.
In this embodiment, thumbnail represents a thumbnail address, memo represents a description file source, memo represents content, amunt represents the number of downloads, and ext represents resource information.
Illustratively, sender, receiver, type, media, url (attachment storage address) in the IMMessage is a necessary field, and thumbnail, memo, amuunt, ext are optional fields, and an adjustment may be made according to the business design, for example, if the thumbnail has no value, then a default picture is used, and amuunt is defined as the number of forwarding times, etc.
In some embodiments, the media types include at least message media and attachment media, and the other server calls the attachment stored in the file service through the attachment storage address after receiving the attachment media.
Illustratively, fig. 3 shows normal flows in the embodiment of the present application, including connection establishment and message transmission. Wherein, the message media and the attachment media are respectively taken as examples.
Illustratively, step 201-206 illustrates one embodiment in which MediaCode is the media of a message.
Step 201, a first client sends information such as a user name, a password and the like to a service server;
step 202, the service server receives the information such as the user name and the password and verifies the information. If the verification is passed, returning to the client: a string containing an APPID (application unique identifier), a USERID (user unique identifier), a token (authentication token), a timestamp, and encrypted; wherein, the unique application identifier is the unique identifier of the business application using the WS server; the user unique identification refers to the unique identification of a specific user registered under a certain service application; the authentication token is a token which is issued to a specific user by the service server and is valid within a certain time range and can use the authentication of the WS server; the first client can be a device which can use http and websocket at a PC end or a mobile end;
And step 203, after receiving the token, the first client carries the relevant information to send a connection request to the WS server.
And step 204, after receiving the message, the WS server analyzes the related content, authenticates the related content through APPID, USERID and token verification, verifies timeliness through timemap, and returns a service server state code to prompt the client to be successfully connected if the related content passes verification.
In step 205, the first client receives the status code of the service server, which means that the websocket is successfully connected and can continue to send related service messages. At this time, the first client sends a message format of MEDIA _ TEXT MediaType ═ 1 to the service server through the http protocol, which is the plain TEXT message of fig. 4. Since the system does not maintain the user organization of the service application, the client will put all the client USERID that needs to receive the message into the Receiver field of the above request according to the internal organization condition.
Step 206, after receiving the http request, the service server broadcasts the client message with the padding value of 0 to the WS server through the UDP protocol, after receiving the http request, the WS server parses the APPID and the Receiver through sdk, determines that the client message is a client message through the padding field, sends a binary Body containing the text content of the message to a second client included in the Receiver, then sends the server message with the padding value of 1 to the message storage service through the UDP protocol, and the message storage service stores the message after receiving the message.
Illustratively, step 301-306 illustrates one embodiment where MediaCode is the attachment media.
Step 301, a first client sends a request for uploading pictures to a service server through an http protocol;
step 302, after receiving the request, the service server sends a file storage request to a file service through an http protocol;
step 303, after the file service is successfully stored, returning the address of the stored picture to the service server, and returning the address to the first client by the service server;
step 304, the first client sends a picture message that MEDIA _ TEXT MediaType is 3 to the service server after receiving the storage address of the file;
step 305, the service server broadcasts to the WS server through a UDP protocol after receiving the message, the WS server analyzes the APPID and the Receiver, sends a binary Body containing a file storage address to a second client included in the Receiver, and then sends a message storage instruction to a message storage service through the UDP protocol;
in step 306, the second client calls img tag of html to display the picture after receiving the message that MEDIA _ TEXT MediaType is 3.
It is noted that in step 306, the image tag is only one technical means for displaying the picture and is not a limiting requirement; the picture can also be displayed by other browser technologies such as (css attribute background, canvas, svg of html tag).
In some embodiments, the present invention shows several media types providing communication services for different business scenarios, including one or more of unknown type, text type, emotion type, picture type, voice type, video type, file type, geographical location type, news type, friend recommendation type, link type, red envelope type, and command push type.
In step 103, the Message is set to three formats, UDP DATA Frame, Message and IMMessage. In an outside-in inclusive relationship. The service server broadcasts the UDP to the Message storage system and the WS server system through the router, the WS server reads the APPID and the Receiver after receiving the UDP DATA Frame Message and forwards the binary Body, namely the Message, to all the clients contained in the Receiver, and the clients decode the Message by a JSDKMessage. The second client can acquire the sender information, determine the media type, content, thumbnail, resource URL and the like through IMmessage (message format), so that the expansibility of the system is improved, and the publishing and deploying processes and content are simplified.
Through the steps 101 to 103, the invention provides a message transmission method based on an instant messaging private cloud architecture, and solves the problems that the instant messaging private cloud architecture is relatively tightly coupled in deployment and is not beneficial to service upgrade and hot release in the related technology. Specifically, in order to facilitate rapid privatization deployment and reduce coupling of a WS server with a service server and a message storage service, the service is divided into the service server, a file service, a message storage service, the WS server and a gateway layer, the service server broadcasts a UDP DATA Frame message to the WS server, and the message is determined to be a server message or a client message through a padding field in the UDP DATA Frame message; the WS server forwards the message of the server to the message storage service, and forwards the message of the client to the second client in the receiver, so that the method improves the expansibility of the system, simplifies the content of the release and deployment process, improves the deployment efficiency, is favorable for service upgrade and thermal release and ensures the stability of the system by decoupling the WS server from the service server and the message storage service. Furthermore, the invention provides an inter-service communication Message protocol convenient for expansion, which is divided into three types including UDP DATA Frame, Message and IMmessage step by step, wherein version and padding are set in the UDP DATA Frame Message in the Message protocol to improve the expansibility, reduce the Message volume and save the bandwidth, the WS server forwards the Message to a second client included in a receiver after judging as the client Message through the UDP DATA Frame Message, and the WS server sends a Message storage instruction to a Message storage service after judging as the server Message. The UDP DATA Frame message is set, so that the transmission flow and content of the message are simplified, the deployment efficiency is improved, and the bandwidth is saved. In addition, the second client can acquire the sender information, determine the media type, content, thumbnail, resource URL and the like through the IMmessage message (message format), so that the expansibility of the system is improved, and communication services are provided for different service scenes by providing the media types which can use different service types.
Based on the same technical concept, fig. 2 exemplarily shows a message transmission system based on an instant messaging private cloud architecture provided by an embodiment of the present invention, including:
the first client is used for sending a connection request, the connection request is verified by the WS server, and if the connection request passes the verification, the bidirectional connection between the first client and the service server is established;
the service server is used for acquiring and processing the service request sent by the first client, adding the filling type into the connection request after processing, taking a receiver as a UDP DATA Frame message, and sending the UDP DATA Frame message to the WS server;
and the WS server is used for converting the UDP DATA Frame Message into a Message and sending the Message to the second client after judging that the received UDP DATA Frame Message is the client Message according to the filling type, and the Message is decoded by the second client to obtain the IMmessage Message.
In one embodiment, the first client is further used to send a username, password to the traffic server.
In one embodiment, the first client is further used to send a service request to the service server.
In one embodiment, the first client is further configured to send a ping pong acknowledgement connection with the WS server.
In one embodiment, the traffic server is also used to send messages to the message storage service, WS server, via UDP broadcast by the router.
In one embodiment, the WS server is further configured to verify validity of the first client and timeliness of the connection request, and when the verification is passed, establish a bidirectional connection between the first client and the service server, and return a service server status code to prompt that the connection of the first client is successful.
In one embodiment, the message transmission system further comprises:
the message storage service is used for acquiring and storing the server-side message of the WS server;
the file service is used for acquiring a request for storing the attachment sent by the service server, and returning the address of the attachment to the service server after the attachment is successfully stored;
and the gateway layer is used for forwarding messages between the first client and the business server, the message storage service, the WS server and the file service.
The present embodiment also provides an electronic device comprising a memory 304 and a processor 302, wherein the memory 304 stores a computer program, and the processor 302 is configured to execute the computer program to perform the steps of any of the method embodiments described above.
Specifically, the processor 302 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
Memory 304 may include, among other things, mass storage 304 for data or instructions. By way of example, and not limitation, the memory 304 may include a hard disk drive (hard disk drive, abbreviated HDD), a floppy disk drive, a Solid State Drive (SSD), flash memory, an optical disk, a magneto-optical disk, tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. Memory 304 may include removable or non-removable (or fixed) media, where appropriate. The memory 304 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 304 is a Non-Volatile (Non-Volatile) memory. In certain embodiments, memory 304 includes Read-only memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or FLASH memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a static random-access memory (SRAM) or a dynamic random-access memory (DRAM), where the DRAM may be a fast page mode dynamic random-access memory 304 (FPMDRAM), an extended data output dynamic random-access memory (EDODRAM), a synchronous dynamic random-access memory (SDRAM), or the like.
Memory 304 may be used to store or cache various data files that need to be processed and/or used for communication, as well as possibly computer program instructions, executed by processor 302.
The processor 302 reads and executes the computer program instructions stored in the memory 304 to implement any one of the message transmission methods based on the instant messaging private cloud architecture in the above embodiments.
Optionally, the electronic apparatus may further include a transmission device 306, wherein the transmission device 306 is connected to the processor 302.
The transmitting device 306 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmitting device 306 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
Alternatively, in this embodiment, the processor 302 may be configured to execute the following steps by a computer program:
S101, sending a connection request, verifying the connection request by the WS server, and if the connection request passes the verification, establishing the bidirectional connection between the first client and the service server.
S102, acquiring and processing a service request sent by a first client, adding a filling type and a receiver as a UDP DATA Frame message in the connection request after processing, and sending the UDP DATA Frame message to the WS server.
S103, after the received UDP DATA Frame Message is judged to be the client Message according to the filling type, the UDP DATA Frame Message is converted into a Message and sent to the second client, and the Message is decoded by the second client to obtain the IMmessage.
It should be noted that, for specific examples in this embodiment, reference may be made to examples described in the foregoing embodiments and optional implementations, and details of this embodiment are not described herein again.
In addition, in combination with the message transmission method based on the instant messaging private cloud architecture in the above embodiment, the embodiment of the present application may provide a storage medium to implement. The storage medium has a computer program stored thereon; when executed by a processor, the computer program implements any one of the message transmission methods based on the instant messaging private cloud architecture in the embodiments.
It should be understood by those skilled in the art that various technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, however, as long as there is no contradiction between the combinations of the technical features, the scope of the present description should be considered as being described in the present specification.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not to be construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims (13)

1. A message transmission method based on an instant communication private cloud architecture is characterized by comprising the following steps:
a first client sends a connection request, the connection request is verified by a WS server, and if the connection request passes verification, the two-way connection between the first client and a service server is established;
a service server acquires and processes a service request sent by the first client, adds a filling type and a receiver as a UDP DATA Frame message in the connection request after processing, and sends the UDP DATA Frame message to the WS server, wherein the receiver comprises at least one second client used for receiving the message sent by the first client;
And the WS server judges that the received UDP DATA Frame Message is a client Message according to the filling type, converts the UDP DATA Frame Message into a Message and sends the Message to the second client, and the Message is decoded by the second client to obtain an IMmessage.
2. The message transmission method according to claim 1, wherein the sending of the connection request is verified by the WS server, and if the verification is successful, the establishing of the bidirectional connection between the first client and the service server comprises:
sending a connection request, wherein the connection request comprises an application identifier, a user identifier, an authentication token and a timestamp;
according to the application identifier, the user identifier and the authentication token, verifying whether the first client is legal or not and verifying timeliness of the connection request through the timestamp;
and if the verification is passed, establishing the bidirectional connection between the first client and the service server.
3. The message transmission method based on the instant messaging private cloud architecture of claim 2, wherein before the connection request is a bidirectional connection, the service server verifies identity information of the first client and sends the identity information to the first client, wherein the identity information includes a user name and a password of the first client.
4. The message transmission method based on the instant messaging private cloud architecture of claim 2, wherein the UDP DATA Frame message further comprises a message version, a flag, and a number of recipients, wherein the application identifier, the recipients, the padding type, the message version, the flag, and the number of recipients constitute a message header of the UDP DATA Frame message,
and the Message version is used for determining the Message structure of the UDP DATA Frame Message and analyzing the UDP DATA Frame Message into the Message according to the Message structure.
5. The messaging method according to claim 1, wherein the IMMessage message comprises one or more of sender, type, recipient, media type, content, thumbnail, attachment storage address, remark information, metering information, and extension information.
6. The message transmission method based on the instant messaging private cloud architecture according to claim 1, wherein the method further comprises:
and according to the filling type, sending a message storage instruction to a message storage service after judging that the received UDP DATA Frame message is a server-side message, wherein the message storage service is used for acquiring and storing the server-side message of the WS server.
7. The message transmission method based on the instant messaging private cloud architecture of claim 5, wherein the method further comprises:
and receiving and processing a file storage request, and sending an attachment storage address to the service server after successful storage, wherein the attachment storage address is returned to the first client by the service server.
8. The message transmission method based on the instant messaging private cloud architecture of claim 7, wherein the media types at least include message media and attachment media, and the other servers call the attachments stored in the file service through the attachment storage addresses after receiving the attachment media.
9. The message transmission method based on the instant messaging private cloud architecture of claim 7, wherein the media type comprises one or more of an unknown type, a text type, an emoticon type, a picture type, a voice type, a video type, a file type, a geographic location type, a news type, a friend recommendation type, a link type, a red packet type, and an instruction push type.
10. A message transmission system based on an instant messaging private cloud architecture is characterized by comprising a first client, a WS server and a business server;
The first client is used for sending a connection request, the connection request is verified by the WS server, and if the connection request passes the verification, the bidirectional connection between the first client and the service server is established;
the service server is configured to obtain and process a service request sent by the first client, add a padding type to the connection request after the processing, use a receiver as a UDP DATA Frame message, and send the UDP DATA Frame message to the WS server, where the receiver includes at least one second client, and the second client is configured to receive the message sent by the first client;
and the WS server is used for converting the UDP DATA Frame Message into a Message and sending the Message to the second client after judging that the received UDP DATA Frame Message is the client Message according to the filling type, and the Message is decoded by the second client to obtain the IMmessage Message.
11. The messaging system according to claim 10, wherein the messaging system further comprises:
the message storage service is used for acquiring and storing the server-side message of the WS server;
the file service is used for acquiring a request for storing the attachment sent by the service server, and returning the address of the attachment to the service server after the attachment is successfully stored;
A gateway layer, configured to forward messages between the first client and the service server, the message storage service, the WS server, and the file service.
12. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the message transmission method based on the instant messaging private cloud architecture according to any one of claims 1 to 9.
13. A storage medium having a computer program stored therein, wherein the computer program is configured to execute the instant messaging private cloud architecture based message transmission method according to any one of claims 1 to 9 when executed.
CN202011395579.8A 2020-12-03 2020-12-03 Message transmission method and system based on instant messaging private cloud architecture Active CN112565059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011395579.8A CN112565059B (en) 2020-12-03 2020-12-03 Message transmission method and system based on instant messaging private cloud architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011395579.8A CN112565059B (en) 2020-12-03 2020-12-03 Message transmission method and system based on instant messaging private cloud architecture

Publications (2)

Publication Number Publication Date
CN112565059A CN112565059A (en) 2021-03-26
CN112565059B true CN112565059B (en) 2022-06-28

Family

ID=75047678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011395579.8A Active CN112565059B (en) 2020-12-03 2020-12-03 Message transmission method and system based on instant messaging private cloud architecture

Country Status (1)

Country Link
CN (1) CN112565059B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827075A (en) * 2009-12-31 2010-09-08 深圳市泓讯电子科技有限公司 Method and system for customizing interactive application service for mobile terminal
CN104683433A (en) * 2013-11-27 2015-06-03 夏普株式会社 Network System, Constant Connection Method, Communication Method,electronic Device, Constant Connection Server, Application Server, And Program
CN109246239A (en) * 2018-10-19 2019-01-18 行吟信息科技(上海)有限公司 A kind of personal letter processing method and system
CN109660617A (en) * 2018-12-18 2019-04-19 中电科华云信息技术有限公司 A kind of information push method based on server cluster
CN109889516A (en) * 2019-02-14 2019-06-14 视联动力信息技术股份有限公司 A kind of method for building up and device of session channel
CN110120946A (en) * 2019-04-29 2019-08-13 武汉理工大学 A kind of Centralized Authentication System and method of Web and micro services
CN110313148A (en) * 2017-02-01 2019-10-08 开文Sa无限责任公司 For web application open platform interface (WOPI) server architecture of distributed network computing environment and application
CN110995797A (en) * 2019-11-19 2020-04-10 湖北民族大学 Multilayer B/S and C/S mixed software system and asynchronous real-time communication method between layers

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080091761A1 (en) * 2002-08-06 2008-04-17 Stt Webos, Inc. Method and apparatus for information exchange over a web based environment
US8073472B1 (en) * 2005-08-26 2011-12-06 Openwave Systems Inc. System and method for providing prepaid billing for instant messaging users
CN101710882A (en) * 2009-11-09 2010-05-19 南京希华通信技术有限公司 Method for realizing multi-IM protocol Web version instant message
US9439049B2 (en) * 2012-01-27 2016-09-06 Sybase, Inc. System and method for message service gateway
CN107508781A (en) * 2016-06-14 2017-12-22 贵阳朗玛信息技术股份有限公司 Exchange method, system and server architecture based on Web proxy server
CN106713437A (en) * 2016-12-16 2017-05-24 江苏神州信源系统工程有限公司 Method used by server to send message to client in NAT network

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827075A (en) * 2009-12-31 2010-09-08 深圳市泓讯电子科技有限公司 Method and system for customizing interactive application service for mobile terminal
CN104683433A (en) * 2013-11-27 2015-06-03 夏普株式会社 Network System, Constant Connection Method, Communication Method,electronic Device, Constant Connection Server, Application Server, And Program
CN110313148A (en) * 2017-02-01 2019-10-08 开文Sa无限责任公司 For web application open platform interface (WOPI) server architecture of distributed network computing environment and application
CN109246239A (en) * 2018-10-19 2019-01-18 行吟信息科技(上海)有限公司 A kind of personal letter processing method and system
CN109660617A (en) * 2018-12-18 2019-04-19 中电科华云信息技术有限公司 A kind of information push method based on server cluster
CN109889516A (en) * 2019-02-14 2019-06-14 视联动力信息技术股份有限公司 A kind of method for building up and device of session channel
CN110120946A (en) * 2019-04-29 2019-08-13 武汉理工大学 A kind of Centralized Authentication System and method of Web and micro services
CN110995797A (en) * 2019-11-19 2020-04-10 湖北民族大学 Multilayer B/S and C/S mixed software system and asynchronous real-time communication method between layers

Also Published As

Publication number Publication date
CN112565059A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
US20060218234A1 (en) Scheme of sending email to mobile devices
US6629130B2 (en) Method and apparatus for processing electronic mail
US7779077B2 (en) File transmission method in instant messaging service and mobile communications terminal for supporting the same
JP6434611B2 (en) Interworking lightweight machine-to-machine protocol using device management protocol
US20060047844A1 (en) One step approach to deliver multimedia from local PC to mobile devices
US7966387B1 (en) System and method for provisioning personalized data into mobile device
US20060184609A1 (en) Simplified scheme of rich content messaging from PC to mobile devices
CN102821057A (en) File sending method, device and system
CN106878460B (en) Communication processing method and device
WO2009000212A1 (en) A message processing apparatus and terminal, a system and method for transmiting messages
CN103795689A (en) Resource subscription method and device
WO2011038564A1 (en) Adaptive method and system for screen display of mobile terminal in network application
JP2012512448A (en) Method and configuration for creating a virtual relationship between communication devices to publish personal data
US20140082123A1 (en) Content caching and delivering system with traffic of repetitively requested content reduced
US8001220B2 (en) Dynamic UI system and method for remotely controlling legacy device
WO2020068412A1 (en) Advanced resource link binding management
CN101778496B (en) Method for wireless gateway to support function of multimedia message services and wireless gateway thereof
JP2005510818A (en) Communication system in which communication system having client and server also has browser performance
CN112565059B (en) Message transmission method and system based on instant messaging private cloud architecture
US7689648B2 (en) Dynamic peer network extension bridge
EP3198804B1 (en) Method, apparatus, system and media for transmitting messages between networked devices in data communication with a local network access point
EP2693779A1 (en) Method, apparatus and system for forwarding a multimedia message and apparatus for receiving the multimedia message
KR100712807B1 (en) Multimedia contents providing service system and method thereof
CN116192933B (en) Method and system for dynamically expanding non-HTTP protocol based on micro-service gateway
US20090325548A1 (en) Method and apparatus for providing network output service by using mobile communication 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