CN109889439A - The instant communication method of cross-platform more scenes - Google Patents

The instant communication method of cross-platform more scenes Download PDF

Info

Publication number
CN109889439A
CN109889439A CN201910226521.1A CN201910226521A CN109889439A CN 109889439 A CN109889439 A CN 109889439A CN 201910226521 A CN201910226521 A CN 201910226521A CN 109889439 A CN109889439 A CN 109889439A
Authority
CN
China
Prior art keywords
server
user
client
platform
coco
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
CN201910226521.1A
Other languages
Chinese (zh)
Other versions
CN109889439B (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.)
Codyy Education Technology Co Ltd
Original Assignee
Codyy Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Codyy Education Technology Co Ltd filed Critical Codyy Education Technology Co Ltd
Priority to CN201910226521.1A priority Critical patent/CN109889439B/en
Publication of CN109889439A publication Critical patent/CN109889439A/en
Application granted granted Critical
Publication of CN109889439B publication Critical patent/CN109889439B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of instant communication methods of cross-platform more scenes, which comprises S1, client obtain the address Socket Server of COCO server and establish connection;S2, the instant messaging that client and COCO server are carried out based on JSON format verification and Verification.Instant messaging can be realized without downloading any plug-in unit of installation in the present invention, improves the ease for use and experience effect of user;The professional platform independence of communication is enhanced, can be used in multiple terminals;It can be used with unlimited scene, self-defined message communication improves reusability and scalability.

Description

The instant communication method of cross-platform more scenes
Technical field
The present invention relates to data communication technology fields, more particularly to a kind of instant communication method of cross-platform more scenes.
Background technique
Communication scheme in the prior art mostly uses greatly flash mechanics of communication, and the means of communication are as follows: source user logs in net Page, loads flash, flash connection socket server, and server is that the user distributes socket thread, and establishes and permanently connect It connects.Message data is sent to flash by source user, and message data is transmitted to socket server, socket server by flash Message data, is transmitted to the socket thread of target user, the target user by the socket thread for searching linking objective user Socket thread forward the message to the flash of target user again.Target user flash calls the shell script of client, It will be shown in message again webpage.This method can make user that can not realize Instant Messenger on any software of downloading again webpage News, reduce a lot not convenient, and instantaneity is fine.
However, for communication scheme using the flash plug-in unit of adobe, which needs installation maintenance in the prior art, together When professional platform independence it is poor.IOS system does not support flash, and adobe will also stop updating maintenance to flash in the year two thousand twenty, different clear Device performance of looking at also differs larger, and multiple terminals communication faces obstruction, and it is cross-platform logical to need individually to safeguard that a set of retransmission technique is done again News.Regardless of safeguarding from exploitation, stability all suffers from huge test.
Therefore, in view of the above technical problems, it is necessary to which a kind of instant communication method of cross-platform more scenes is provided.
Summary of the invention
In order to overcome the deficiencies of the prior art, the purpose of the present invention is to provide a kind of instant messaging sides of cross-platform more scenes Method, to realize the instant messaging of cross-platform, more scenes.
To achieve the goals above, the technical solution that one embodiment of the invention provides is as follows:
A kind of instant communication method of cross-platform more scenes, which comprises
S1, client obtain the address Socket Server of COCO server and establish connection;
S2, the instant messaging that client and COCO server are carried out based on JSON format verification and Verification.
As a further improvement of the present invention, the step S1 specifically:
Client is logged in, Token is obtained;
Using Token application Socket Server, according to Token and groupId obtain the address Socket Server and Port information, and the address Socket Server is obtained according to load-balancing algorithm;
Establish the connection of client Yu COCO server.
As a further improvement of the present invention, the load-balancing algorithm are as follows:
Random load-balancing algorithm, obtains idle server at random;Or,
Group load-balancing algorithm selects identical idle server according to group.
As a further improvement of the present invention, the step S2 specifically:
For user command, JSON format verification and Verification are successively carried out, if JSON format verification and Verification It is correct, then specific service logic is carried out, otherwise, without specific service logic.
As a further improvement of the present invention, the method also includes:
It is online by online message registration after client is connect with COCO server, COCO server authentication Token's Correctness and whether expired, if Token mistake, returns to Token error message, if Token is expired, it is expired to return to Token Message returns to online success message if Token is correct and not out of date.
As a further improvement of the present invention, the method also includes:
Transmitting groupId is instructed by addGroup, new user is added in user group, if being added successfully, to user group In all users send members group informations be added, and member's addition group information is back to client.
As a further improvement of the present invention, the method also includes:
User group is judged with the presence or absence of needing the initialization information that obtains, if so, COCO server is by the user group Initialization information is sent to client.
As a further improvement of the present invention, the method also includes:
COCO server receives user and rejects instruction;
Permission is rejected in verifying, is judged that user rejects whether instruction is administrator's initiation, is rejected instruction if so, executing, pick Except corresponding user, if it is not, then determining Insufficient privilege, rejecting instruction is not executed.
As a further improvement of the present invention, the method also includes:
COCO server receives control instruction, carries out respective operations according to control instruction, and operating result is back to visitor Family end and/or user group, the control instruction are sayed including taboo, prohibit one of text, user's invitation or a variety of.
As a further improvement of the present invention, the client is one of pc client, mobile terminal, browser or more Kind.
The invention has the following advantages:
Instant messaging can be realized without downloading any plug-in unit of installation, improve the ease for use and experience effect of user;
The professional platform independence of communication is enhanced, can be used in multiple terminals;
It can be used with unlimited scene, self-defined message communication improves reusability and scalability;
High concurrent, load balancing ensure that the stability and instantaneity of communication message transmitting;
Using encrypted set, message transmission is safer, protects privacy of user.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The some embodiments recorded in invention, for those of ordinary skill in the art, without creative efforts, It is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram of the instant communication method of the cross-platform more scenes of the present invention;
Fig. 2 is the specific flow chart that client is connect with COCO server in the embodiment of the invention;
Fig. 3 is the communication flow schematic diagram of client and COCO server in the embodiment of the invention;
Fig. 4 is the verifying flow chart that user is online in the embodiment of the invention;
Fig. 5 is the specific flow chart that user group is added in the embodiment of the invention;
Fig. 6 is the specific flow chart that user is rejected in the embodiment of the invention;
Fig. 7 is the specific flow chart of control command in the embodiment of the invention.
Specific embodiment
Technical solution in order to enable those skilled in the art to better understand the present invention, below in conjunction with of the invention real The attached drawing in example is applied, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described implementation Example is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is common Technical staff's every other embodiment obtained without making creative work, all should belong to protection of the present invention Range.
Join shown in Fig. 1, the invention discloses a kind of instant communication methods of cross-platform more scenes, this method comprises:
S1, client (Client) obtain the address Socket Server of COCO server and establish connection;
S2, the instant messaging that client and COCO server are carried out based on JSON format verification and Verification.
It is logical that COCO SERVER (COCO server) in the present invention is that a kind of cross-platform, more scenes can be used in conjunction with News and message push server, can be in real-time communications such as client, WEB terminal, mobile terminals.Using load-balancing algorithm, together When the communications protocol based on WebSocket, using group concept by 1 pair 1, more than 1 pair, the communication network of multi-to-multi be put into plus In close communication group, it can effectively guarantee the minimum unit of message push in this way, not only can guarantee message stablizes transmission, but also energy Guarantee the communication security of message, while can guarantee that different scenes are used in conjunction with COCO service, is not in interspersed interleaving problem, The independence and safety for keeping different scenes, can allow COCO to be widely used in various real-time communication scenes.
In addition, the group in the present invention is a kind of communication mode of conception division according to group, message is merely able in the group Transmitting, each group is according to md5 encryption algorithm for encryption.Group forgives different scenes division, such as: it is video conference, online Classroom, group chatting etc..It can guarantee that same user can act as different role in COCO in this way, guarantee that user disappears There is no intersections for breath.Simultaneously can also the situation in the same scene with group continue to divide, with the concept of dendrogram not broken dash Divide different group, guarantees independence, safety, the encryption under entire communication mode under each scene.
As shown in connection with fig. 2, step S1 in the embodiment of the invention specifically:
It logs in client (Client), obtains Token;
Using Token application Socket Server, according to Token and groupId obtain the address Socket Server and Port information, and the address Socket Server is obtained according to load-balancing algorithm;
Establish the connection of client Yu COCO server.
Wherein, two kinds of load-balancing algorithms of random and group are supported in the present invention, specifically:
Random load-balancing algorithm, obtains idle server at random;
Group load-balancing algorithm selects identical idle server according to group.
The communication of client and COCO server in step S2 of the present invention specifically:
Join shown in Fig. 3, for user command, JSON format verification and Verification is successively carried out, if JSON format verification It is correct with Verification, then specific service logic is carried out, otherwise, without specific service logic.
Include the following contents in communication process:
1, user is online
Join shown in Fig. 4, online by online message registration after client is connect with COCO server, COCO service Device verifies the correctness of Token and whether expired, if Token mistake, returns to Token error message, if Token is expired, It returns to Token stale messages and returns to online success message if Token is correct and not out of date.
2, user group is added
Join Fig. 5 shown in, by addGroup instruct transmitting groupId, new user is added in user group, if be added at Function, into user group, all users send member and group information are added, and member's addition group information is back to client.
In addition, COCO server judges user group with the presence or absence of the initialization information for needing to obtain, if so, COCO is serviced The initialization information of the user group is sent to client by device.
3, user is rejected
Join Fig. 6 shown in, reject user must administrator could initiate, administrator initiate kickUser order transmit GroupId and User ID, the user for telling COCO server to need to reject.
COCO server receive user reject instruction after, first verify that rejecting permission, judge user reject instruction whether be Administrator initiates, and rejects instruction if so, executing, rejects corresponding user, if it is not, then determining Insufficient privilege, do not execute rejecting Instruction.
The purpose of the function mainly include user in the presence of repeat to log in, the removing function under business demand, there are also exist to dislike The user of meaning attack rejects.
4, control command
Join shown in Fig. 7, COCO server receives control instruction, carries out respective operations according to control instruction, and operation is tied Fruit is back to client and/or user group.
Preferably, control instruction include prohibit speech, prohibit text, one of user invites etc. or a variety of, while further including making by oneself Adopted control command, user can be according to different business demand custom commands.This ensure that the scalability of COCO and polymorphic Property, it can be used in various scenes.
In addition, COCO server further comprises the functions such as group chat, single-point chat, message broadcast.Group chat function and message are wide It broadcasts similar, is to mass-send message data to group member;Single-point chat feature be in fact message data is individually issued group in its He is user, if that the message sent is not user in group, message will not be received, and COCO can do message block.
Preferably, the client (Client) in the present invention is one of pc client, mobile terminal, browser etc. or more Kind.
It can be seen from embodiment of above the invention has the following advantages:
Instant messaging can be realized without downloading any plug-in unit of installation, improve the ease for use and experience effect of user;
The professional platform independence of communication is enhanced, can be used in multiple terminals;
It can be used with unlimited scene, self-defined message communication improves reusability and scalability;
High concurrent, load balancing ensure that the stability and instantaneity of communication message transmitting;
Using encrypted set, message transmission is safer, protects privacy of user.
It should be noted that the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability Contain, so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also including Other elements that are not explicitly listed, or further include for this process, method, commodity or the intrinsic element of equipment. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, there is also other identical elements in commodity or equipment.
It will be understood by those skilled in the art that the embodiment of this specification one or more embodiment can provide as method, be System or computer program product.Therefore, complete hardware embodiment, complete software can be used in this specification one or more embodiment The form of embodiment or embodiment combining software and hardware aspects.Moreover, this specification one or more embodiment can be used In computer-usable storage medium (the including but not limited to disk that one or more wherein includes computer usable program code Memory, CD-ROM, optical memory etc.) on the form of computer program product implemented.
This specification one or more embodiment can computer executable instructions it is general on It hereinafter describes, such as program module.Generally, program module includes executing particular task or realization particular abstract data type Routine, programs, objects, component, data structure etc..Can also practice in a distributed computing environment this specification one or Multiple embodiments, in these distributed computing environments, by being executed by the connected remote processing devices of communication network Task.In a distributed computing environment, the local and remote computer that program module can be located at including storage equipment is deposited In storage media.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included within the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.
In addition, it should be understood that although this specification is described in terms of embodiments, but not each embodiment is only wrapped Containing an independent technical solution, this description of the specification is merely for the sake of clarity, and those skilled in the art should It considers the specification as a whole, the technical solutions in the various embodiments may also be suitably combined, forms those skilled in the art The other embodiments being understood that.

Claims (10)

1. a kind of instant communication method of cross-platform more scenes, which is characterized in that the described method includes:
S1, client obtain the address Socket Server of COCO server and establish connection;
S2, the instant messaging that client and COCO server are carried out based on JSON format verification and Verification.
2. the instant communication method of cross-platform more scenes according to claim 1, which is characterized in that the step S1 is specific Are as follows:
Client is logged in, Token is obtained;
Using Token application Socket Server, the address Socket Server and port are obtained according to Token and groupId Information, and the address Socket Server is obtained according to load-balancing algorithm;
Establish the connection of client Yu COCO server.
3. the instant communication method of cross-platform more scenes according to claim 2, which is characterized in that the load balancing is calculated Method are as follows:
Random load-balancing algorithm, obtains idle server at random;Or,
Group load-balancing algorithm selects identical idle server according to group.
4. the instant communication method of cross-platform more scenes according to claim 1, which is characterized in that the step S2 is specific Are as follows:
For user command, JSON format verification and Verification are successively carried out, if JSON format verification and Verification are just Really, then specific service logic is carried out, otherwise, without specific service logic.
5. the instant communication method of cross-platform more scenes according to claim 1, which is characterized in that the method is also wrapped It includes:
Online by online message registration after client is connect with COCO server, COCO server authentication Token's is correct Property and whether expired, if Token mistake, returns to Token error message, if Token expired, returns to Token stale messages, If Token is correct and not out of date, online success message is returned.
6. the instant communication method of cross-platform more scenes according to claim 1, which is characterized in that the method is also wrapped It includes:
Transmitting groupId is instructed by addGroup, new user is added in user group, if being added successfully, the institute into user group There is user to send member and group information is added, and member's addition group information is back to client.
7. the instant communication method of cross-platform more scenes according to claim 6, which is characterized in that the method is also wrapped It includes:
User group is judged with the presence or absence of needing the initialization information that obtains, if so, COCO server is by the initial of the user group Change information and is sent to client.
8. the instant communication method of cross-platform more scenes according to claim 1, which is characterized in that the method is also wrapped It includes:
COCO server receives user and rejects instruction;
Permission is rejected in verifying, is judged whether user's rejecting instruction is administrator's initiation, is rejected instruction if so, executing, rejecting pair The user answered does not execute rejecting instruction if it is not, then determining Insufficient privilege.
9. the instant communication method of cross-platform more scenes according to claim 1, which is characterized in that the method is also wrapped It includes:
COCO server receives control instruction, carries out respective operations according to control instruction, and operating result is back to client And/or user group, the control instruction are sayed including taboo, prohibit one of text, user's invitation or a variety of.
10. the instant communication method of cross-platform more scenes according to claim 1, which is characterized in that the client is One of pc client, mobile terminal, browser are a variety of.
CN201910226521.1A 2019-03-25 2019-03-25 Cross-platform multi-scene instant messaging method Expired - Fee Related CN109889439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910226521.1A CN109889439B (en) 2019-03-25 2019-03-25 Cross-platform multi-scene instant messaging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910226521.1A CN109889439B (en) 2019-03-25 2019-03-25 Cross-platform multi-scene instant messaging method

Publications (2)

Publication Number Publication Date
CN109889439A true CN109889439A (en) 2019-06-14
CN109889439B CN109889439B (en) 2021-09-14

Family

ID=66934111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910226521.1A Expired - Fee Related CN109889439B (en) 2019-03-25 2019-03-25 Cross-platform multi-scene instant messaging method

Country Status (1)

Country Link
CN (1) CN109889439B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699450A (en) * 2013-12-20 2014-04-02 国云科技股份有限公司 Linux adaptive component communication method
CN106230601A (en) * 2016-09-09 2016-12-14 武汉斗鱼网络科技有限公司 A kind of exchange of token method and system of the embedded webpage of client
CN107196847A (en) * 2017-04-28 2017-09-22 维沃移动通信有限公司 A kind of group chat method and mobile terminal
CN108243170A (en) * 2016-12-27 2018-07-03 青岛融贯汇众软件有限公司 Data access system and method based on socket frames
CN108989438A (en) * 2018-07-26 2018-12-11 青柠智云(杭州)科技有限责任公司 Implementation method, the device and system of data distribution network
CN109474608A (en) * 2018-12-06 2019-03-15 郑州云海信息技术有限公司 A kind of multi-platform means of communication and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699450A (en) * 2013-12-20 2014-04-02 国云科技股份有限公司 Linux adaptive component communication method
CN106230601A (en) * 2016-09-09 2016-12-14 武汉斗鱼网络科技有限公司 A kind of exchange of token method and system of the embedded webpage of client
CN108243170A (en) * 2016-12-27 2018-07-03 青岛融贯汇众软件有限公司 Data access system and method based on socket frames
CN107196847A (en) * 2017-04-28 2017-09-22 维沃移动通信有限公司 A kind of group chat method and mobile terminal
CN108989438A (en) * 2018-07-26 2018-12-11 青柠智云(杭州)科技有限责任公司 Implementation method, the device and system of data distribution network
CN109474608A (en) * 2018-12-06 2019-03-15 郑州云海信息技术有限公司 A kind of multi-platform means of communication and system

Also Published As

Publication number Publication date
CN109889439B (en) 2021-09-14

Similar Documents

Publication Publication Date Title
CN105657746B (en) A kind of wireless terminal fast roaming system and method based on AP syntople
CN104702696B (en) The cross-platform instant data interactive method of one kind, device and system
CN104980339B (en) Sharing files method and device
CN106162574A (en) Group system is applied universal retrieval method, server and terminal
WO2014043002A1 (en) Activity based recommendations within a social networking environment based upon graph activation
CN107734076A (en) Information push method, device and storage medium
CN104349208A (en) Message processing method, message processing device, gateway, set-top box and network television system
CN105227430A (en) A kind of social Internet of Things implementation method based on micro-letter platform
CN105656763A (en) Message pushing method and message pushing device
CN106817347A (en) Third-party application authentication method, certificate server, terminal and management server
CN104811371A (en) Brand-new instant messaging system
CN106559787B (en) Network access method, device and system
CN103729590A (en) Method, device and system for setting equipment access right
CN104468552B (en) A kind of connection control method and device
CN111194035A (en) Network connection method, device and storage medium
CN114079971A (en) Service flow management and control method, system, DPI node and storage medium
CN106453349A (en) An account number login method and apparatus
CN109889521B (en) Memory, communication channel multiplexing implementation method, device and equipment
CN104093081A (en) On-line instant chat system based on digital television and implementation method
CN105721274B (en) The fusion method and device of one kind of multiple instant messagings
CN105323537A (en) Video conferencing with mobile platform
CN106385516B (en) A kind of method, apparatus and terminal of the transfer of setting business
CN105306577A (en) Data sharing system and method between handheld devices based on APP
CN112929257A (en) Multi-scenario message sending method, device, server and storage medium
CN109889439A (en) The instant communication method of cross-platform more scenes

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210914